bsv-mcp 0.5.1 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/README.md +28 -17
- package/dist/app.html +31 -23
- package/dist/index.js +5643 -6629
- package/dist/local-mcp-launcher.js +529 -294
- package/dist/local-ui/app.html +1 -1
- package/dist/local-ui/assets/index-0sM80Uuh.js +117 -0
- package/dist/local-ui/index.html +1 -1
- package/package.json +100 -65
- package/dist/local-ui/assets/index-B1jJYtjR.js +0 -109
package/dist/app.html
CHANGED
|
@@ -5,26 +5,31 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<meta name="theme-color" content="#0a0a0a" />
|
|
7
7
|
<title>BSV MCP</title>
|
|
8
|
-
<script type="module" crossorigin>var e=Object.defineProperty,t=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},n=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),r=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},i=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});(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 a=n((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,T());else{var t=n(l);t!==null&&ae(x,t.startTime-e)}}}var S=!1,C=-1,w=5,ee=-1;function te(){return g?!0:!(e.unstable_now()-ee<w)}function ne(){if(g=!1,S){var t=e.unstable_now();ee=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&&te());){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&&ae(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?T():S=!1}}}var T;if(typeof y==`function`)T=function(){y(ne)};else if(typeof MessageChannel<`u`){var re=new MessageChannel,ie=re.port2;re.port1.onmessage=ne,T=function(){ie.postMessage(null)}}else T=function(){_(ne,0)};function ae(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,ae(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,T()))),r},e.unstable_shouldYield=te,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),o=n(((e,t)=>{t.exports=a()})),s=n((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.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.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`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function te(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ne(e,t){return te(e.type,t,e.props)}function T(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function re(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ie=/\/+/g;function ae(e,t){return typeof e==`object`&&e&&e.key!=null?re(``+e.key):t.toString(36)}function oe(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(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 se(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,se(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ae(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(ie,`$&/`)+`/`),se(o,r,i,``,function(e){return e})):o!=null&&(T(o)&&(o=ne(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ie,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ae(a,u),c+=se(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ae(a,u++),c+=se(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return se(oe(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 ce(e,t,n){if(e==null)return e;var r=[],i=0;return se(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function le(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var E=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)},D={map:ce,forEach:function(e,t,n){ce(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ce(e,function(){t++}),t},toArray:function(e){return ce(e,function(e){return e})||[]},only:function(e){if(!T(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=D,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},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=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!ee.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 te(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)ee.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 te(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=T,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:le}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,E)}catch(e){E(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),c=n(((e,t)=>{t.exports=s()})),l=n((e=>{var t=c();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`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(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.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 o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.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=l(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=l(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})}}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=l(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=l(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})}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 s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.8`})),u=n(((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=l()})),d=n((e=>{var t=o(),n=c(),r=u();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 s(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function l(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(s(e)!==e)throw Error(i(188))}function p(e){var t=e.alternate;if(!t){if(t=s(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 o=a.alternate;if(o===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return f(a),e;if(o===r)return f(a),t;o=o.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=o;else{for(var c=!1,l=a.child;l;){if(l===n){c=!0,n=a,r=o;break}if(l===r){c=!0,r=a,n=o;break}l=l.sibling}if(!c){for(l=o.child;l;){if(l===n){c=!0,n=o,r=a;break}if(l===r){c=!0,r=o,n=a;break}l=l.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 m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),ee=Symbol.for(`react.suspense`),te=Symbol.for(`react.suspense_list`),ne=Symbol.for(`react.memo`),T=Symbol.for(`react.lazy`),re=Symbol.for(`react.activity`),ie=Symbol.for(`react.memo_cache_sentinel`),ae=Symbol.iterator;function oe(e){return typeof e!=`object`||!e?null:(e=ae&&e[ae]||e[`@@iterator`],typeof e==`function`?e:null)}var se=Symbol.for(`react.client.reference`);function ce(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===se?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case ee:return`Suspense`;case te:return`SuspenseList`;case re:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ne:return t=e.displayName||null,t===null?ce(e.type)||`Memo`:t;case T:t=e._payload,e=e._init;try{return ce(e(t))}catch{}}return null}var le=Array.isArray,E=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},de=[],fe=-1;function pe(e){return{current:e}}function me(e){0>fe||(e.current=de[fe],de[fe]=null,fe--)}function he(e,t){fe++,de[fe]=e.current,e.current=t}var ge=pe(null),_e=pe(null),ve=pe(null),ye=pe(null);function be(e,t){switch(he(ve,t),he(_e,e),he(ge,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?$d(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=$d(t),e=ef(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}me(ge),he(ge,e)}function xe(){me(ge),me(_e),me(ve)}function Se(e){e.memoizedState!==null&&he(ye,e);var t=ge.current,n=ef(t,e.type);t!==n&&(he(_e,e),he(ge,n))}function Ce(e){_e.current===e&&(me(ge),me(_e)),ye.current===e&&(me(ye),up._currentValue=ue)}var we,Te;function Ee(e){if(we===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);we=t&&t[1]||``,Te=-1<e.stack.indexOf(`
|
|
8
|
+
<script type="module" crossorigin>var e=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),t=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});(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 n=e((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 ee(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,te||(te=!0,ie());else{var t=n(l);t!==null&&se(ee,t.startTime-e)}}}var te=!1,x=-1,ne=5,S=-1;function re(){return g?!0:!(e.unstable_now()-S<ne)}function C(){if(g=!1,te){var t=e.unstable_now();S=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(x),x=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&re());){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&&se(ee,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?ie():te=!1}}}var ie;if(typeof y==`function`)ie=function(){y(C)};else if(typeof MessageChannel<`u`){var ae=new MessageChannel,oe=ae.port2;ae.port1.onmessage=C,ie=function(){oe.postMessage(null)}}else ie=function(){_(C,0)};function se(t,n){x=_(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`):ne=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(x),x=-1):h=!0,se(ee,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,te||(te=!0,ie()))),r},e.unstable_shouldYield=re,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),r=e(((e,t)=>{t.exports=n()})),i=e((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 ee(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var te=ee.prototype=new b;te.constructor=ee,_(te,y.prototype),te.isPureReactComponent=!0;var x=Array.isArray;function ne(){}var S={H:null,A:null,T:null,S:null},re=Object.prototype.hasOwnProperty;function C(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ie(e,t){return C(e.type,t,e.props)}function ae(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function oe(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var se=/\/+/g;function ce(e,t){return typeof e==`object`&&e&&e.key!=null?oe(``+e.key):t.toString(36)}function le(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(ne,ne):(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 ue(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,ue(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ce(e,0):a,x(o)?(i=``,c!=null&&(i=c.replace(se,`$&/`)+`/`),ue(o,r,i,``,function(e){return e})):o!=null&&(ae(o)&&(o=ie(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(se,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(x(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ce(a,u),c+=ue(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+ce(a,u++),c+=ue(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ue(le(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 de(e,t,n){if(e==null)return e;var r=[],i=0;return ue(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function fe(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 pe=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 me(e){var t=S.T,n={};n.types=t===null?null:t.types,S.T=n;try{var r=e(),i=S.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(ne,pe)}catch(e){pe(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),S.T=t}}function he(e){var t=S.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else me(he.bind(null,e))}var ge={map:de,forEach:function(e,t,n){de(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return de(e,function(){t++}),t},toArray:function(e){return de(e,function(e){return e})||[]},only:function(e){if(!ae(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ge,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=ee,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=S,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return S.H.useMemoCache(e)}},e.addTransitionType=he,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)!re.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 C(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)re.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 C(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=ae,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:fe}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=me,e.unstable_useCacheRefresh=function(){return S.H.useCacheRefresh()},e.use=function(e){return S.H.use(e)},e.useActionState=function(e,t,n){return S.H.useActionState(e,t,n)},e.useCallback=function(e,t){return S.H.useCallback(e,t)},e.useContext=function(e){return S.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return S.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return S.H.useEffect(e,t)},e.useEffectEvent=function(e){return S.H.useEffectEvent(e)},e.useId=function(){return S.H.useId()},e.useImperativeHandle=function(e,t,n){return S.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return S.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return S.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return S.H.useMemo(e,t)},e.useOptimistic=function(e,t){return S.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return S.H.useReducer(e,t,n)},e.useRef=function(e){return S.H.useRef(e)},e.useState=function(e){return S.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return S.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return S.H.useTransition()},e.version=`19.3.0`})),a=e(((e,t)=>{t.exports=i()})),o=e((e=>{var t=a();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},o=Symbol.for(`react.portal`),s=Symbol.for(`react.recoverable`),c=Symbol.for(`react.optimistic_key`);function l(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:r===c?c:``+r,children:e,containerInfo:t,implementation:n}}var u=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:s,_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 l(e,t,null,r)},e.flushSync=function(e){var t=u.T,n=i.p;try{if(u.T=null,i.p=2,e)return e()}finally{u.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 u.H.useFormState(e,t,n)},e.useFormStatus=function(){return u.H.useHostTransitionStatus()},e.version=`19.3.0`})),s=e(((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=o()})),c=e((e=>{var t=r(),n=a(),i=s();function o(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function u(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(l(e)!==e)throw Error(o(188))}function p(e){var t=e.alternate;if(!t){if(t=l(e),t===null)throw Error(o(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return f(i),e;if(a===r)return f(i),t;a=a.sibling}throw Error(o(188))}if(n.return!==r.return)n=i,r=a;else{for(var s=!1,c=i.child;c;){if(c===n){s=!0,n=i,r=a;break}if(c===r){s=!0,r=i,n=a;break}c=c.sibling}if(!s){for(c=a.child;c;){if(c===n){s=!0,n=a,r=i;break}if(c===r){s=!0,r=a,n=i;break}c=c.sibling}if(!s)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}function h(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&h(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(o(559))}}var ee=null,te=null;function x(e,t,n){return e===n||e===t&&(ee=e,!0)}function ne(e,t,n){return e===n?(te=e,!1):e===t&&(te!==null&&(ee=e),!0)}function S(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 re(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 C=Object.assign,ie=Symbol.for(`react.element`),ae=Symbol.for(`react.transitional.element`),oe=Symbol.for(`react.portal`),se=Symbol.for(`react.fragment`),ce=Symbol.for(`react.strict_mode`),le=Symbol.for(`react.profiler`),ue=Symbol.for(`react.consumer`),de=Symbol.for(`react.context`),fe=Symbol.for(`react.forward_ref`),pe=Symbol.for(`react.suspense`),me=Symbol.for(`react.suspense_list`),he=Symbol.for(`react.memo`),ge=Symbol.for(`react.lazy`),_e=Symbol.for(`react.activity`),ve=Symbol.for(`react.legacy_hidden`),ye=Symbol.for(`react.memo_cache_sentinel`),be=Symbol.for(`react.view_transition`),xe=Symbol.for(`react.recoverable`),Se=Symbol.iterator;function Ce(e){return typeof e!=`object`||!e?null:(e=Se&&e[Se]||e[`@@iterator`],typeof e==`function`?e:null)}var we=Symbol.for(`react.client.reference`);function Te(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===we?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case se:return`Fragment`;case le:return`Profiler`;case ce:return`StrictMode`;case pe:return`Suspense`;case me:return`SuspenseList`;case _e:return`Activity`;case be:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case oe:return`Portal`;case de:return e.displayName||`Context`;case ue:return(e._context.displayName||`Context`)+`.Consumer`;case fe:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case he:return t=e.displayName||null,t===null?Te(e.type)||`Memo`:t;case ge:t=e._payload,e=e._init;try{return Te(e(t))}catch{}}return null}var Ee=Array.isArray,w=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,T=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,De={pending:!1,data:null,method:null,action:null},Oe=[],ke=-1;function Ae(e){return{current:e}}function je(e){0>ke||(e.current=Oe[ke],Oe[ke]=null,ke--)}function Me(e,t){ke++,Oe[ke]=e.current,e.current=t}var Ne=Ae(null),Pe=Ae(null),Fe=Ae(null),Ie=Ae(null);function Le(e,t){switch(Me(Fe,t),Me(Pe,e),Me(Ne,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Cp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Cp(t),e=wp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}je(Ne),Me(Ne,e)}function Re(){je(Ne),je(Pe),je(Fe)}function ze(e){var t=e.memoizedState;t!==null&&(lh._currentValue=t.memoizedState,Me(Ie,e)),t=Ne.current;var n=wp(t,e.type);t!==n&&(Me(Pe,e),Me(Ne,n))}function Be(e){Pe.current===e&&(je(Ne),je(Pe)),Ie.current===e&&(je(Ie),lh._currentValue=De)}var Ve,He;function Ue(e){if(Ve===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ve=t&&t[1]||``,He=-1<e.stack.indexOf(`
|
|
9
9
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
10
|
-
`+
|
|
10
|
+
`+Ve+e+He}var We=!1;function Ge(e,t){if(!e||We)return``;We=!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(`
|
|
11
11
|
`),l=s.split(`
|
|
12
12
|
`);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=`
|
|
13
|
-
`+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{
|
|
13
|
+
`+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{We=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ue(n):``}function Ke(e,t){switch(e.tag){case 26:case 27:case 5:return Ue(e.type);case 16:return Ue(`Lazy`);case 13:return e.child!==t&&t!==null?Ue(`Suspense Fallback`):Ue(`Suspense`);case 19:return Ue(`SuspenseList`);case 0:case 15:return Ge(e.type,!1);case 11:return Ge(e.type.render,!1);case 1:return Ge(e.type,!0);case 31:return Ue(`Activity`);case 30:return Ue(`ViewTransition`);default:return``}}function qe(e){try{var t=``,n=null;do t+=Ke(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
14
14
|
Error generating stack: `+e.message+`
|
|
15
|
-
`+e.stack}}var je=Object.prototype.hasOwnProperty,Me=t.unstable_scheduleCallback,Ne=t.unstable_cancelCallback,Pe=t.unstable_shouldYield,Fe=t.unstable_requestPaint,Ie=t.unstable_now,Le=t.unstable_getCurrentPriorityLevel,Re=t.unstable_ImmediatePriority,ze=t.unstable_UserBlockingPriority,Be=t.unstable_NormalPriority,Ve=t.unstable_LowPriority,He=t.unstable_IdlePriority,Ue=t.log,We=t.unstable_setDisableYieldValue,Ge=null,Ke=null;function qe(e){if(typeof Ue==`function`&&We(e),Ke&&typeof Ke.setStrictMode==`function`)try{Ke.setStrictMode(Ge,e)}catch{}}var Je=Math.clz32?Math.clz32:Ze,Ye=Math.log,Xe=Math.LN2;function Ze(e){return e>>>=0,e===0?32:31-(Ye(e)/Xe|0)|0}var Qe=256,$e=262144,et=4194304;function tt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;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 nt(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=tt(n))):i=tt(o):i=tt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=tt(n))):i=tt(o)):i=tt(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function rt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function it(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function at(){var e=et;return et<<=1,!(et&62914560)&&(et=4194304),e}function ot(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function st(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ct(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Je(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&<(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function lt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Je(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ut(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Je(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function dt(e,t){var n=t&-t;return n=n&42?1:ft(n),(n&(e.suspendedLanes|t))===0?n:0}function ft(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function pt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function mt(){var e=D.p;return e===0?(e=window.event,e===void 0?32:Ep(e.type)):e}function ht(e,t){var n=D.p;try{return D.p=e,t()}finally{D.p=n}}var gt=Math.random().toString(36).slice(2),_t=`__reactFiber$`+gt,vt=`__reactProps$`+gt,yt=`__reactContainer$`+gt,bt=`__reactEvents$`+gt,xt=`__reactListeners$`+gt,St=`__reactHandles$`+gt,Ct=`__reactResources$`+gt,wt=`__reactMarker$`+gt;function Tt(e){delete e[_t],delete e[vt],delete e[bt],delete e[xt],delete e[St]}function Et(e){var t=e[_t];if(t)return t;for(var n=e.parentNode;n;){if(t=n[yt]||n[_t]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Cf(e);e!==null;){if(n=e[_t])return n;e=Cf(e)}return t}e=n,n=e.parentNode}return null}function Dt(e){if(e=e[_t]||e[yt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ot(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function kt(e){var t=e[Ct];return t||=e[Ct]={hoistableStyles:new Map,hoistableScripts:new Map},t}function At(e){e[wt]=!0}var jt=new Set,Mt={};function Nt(e,t){Pt(e,t),Pt(e+`Capture`,t)}function Pt(e,t){for(Mt[e]=t,e=0;e<t.length;e++)jt.add(t[e])}var Ft=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]*$`),It={},Lt={};function Rt(e){return je.call(Lt,e)?!0:je.call(It,e)?!1:Ft.test(e)?Lt[e]=!0:(It[e]=!0,!1)}function zt(e,t,n){if(Rt(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 Bt(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 Vt(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 Ht(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Ut(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Wt(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 Gt(e){if(!e._valueTracker){var t=Ut(e)?`checked`:`value`;e._valueTracker=Wt(e,t,``+e[t])}}function Kt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Ut(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function qt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Jt=/[\n"\\]/g;function Yt(e){return e.replace(Jt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Xt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Ht(t)):e.value!==``+Ht(t)&&(e.value=``+Ht(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Qt(e,o,Ht(n)):Qt(e,o,Ht(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=``+Ht(s):e.removeAttribute(`name`)}function Zt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Gt(e);return}n=n==null?``:``+Ht(n),t=t==null?n:``+Ht(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),Gt(e)}function Qt(e,t,n){t===`number`&&qt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function $t(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Ht(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function en(e,t,n){if(t!=null&&(t=``+Ht(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Ht(n)}function tn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(le(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Ht(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Gt(e)}function nn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var rn=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function an(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||rn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function on(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(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]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&an(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&an(e,o,t[o])}function sn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var cn=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`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),ln=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function un(e){return ln.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function dn(){}var fn=null;function pn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var mn=null,hn=null;function gn(e){var t=Dt(e);if(t&&(e=t.stateNode)){var n=e[vt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Xt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Yt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[vt]||null;if(!a)throw Error(i(90));Xt(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&&Kt(r)}break a;case`textarea`:en(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&$t(e,!!n.multiple,t,!1)}}}var _n=!1;function vn(e,t,n){if(_n)return e(t,n);_n=!0;try{return e(t)}finally{if(_n=!1,(mn!==null||hn!==null)&&(Au(),mn&&(t=mn,e=hn,hn=mn=null,gn(t),e)))for(t=0;t<e.length;t++)gn(e[t])}}function yn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[vt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var bn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),xn=!1;if(bn)try{var Sn={};Object.defineProperty(Sn,"passive",{get:function(){xn=!0}}),window.addEventListener(`test`,Sn,Sn),window.removeEventListener(`test`,Sn,Sn)}catch{xn=!1}var Cn=null,wn=null,Tn=null;function En(){if(Tn)return Tn;var e,t=wn,n=t.length,r,i=`value`in Cn?Cn.value:Cn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Tn=i.slice(e,1<r?1-r:void 0)}function Dn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function On(){return!0}function kn(){return!1}function An(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?On:kn,this.isPropagationStopped=kn,this}return h(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=On)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=On)},persist:function(){},isPersistent:On}),t}var jn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Mn=An(jn),Nn=h({},jn,{view:0,detail:0}),Pn=An(Nn),Fn,In,Ln,Rn=h({},Nn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Jn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Ln&&(Ln&&e.type===`mousemove`?(Fn=e.screenX-Ln.screenX,In=e.screenY-Ln.screenY):In=Fn=0,Ln=e),Fn)},movementY:function(e){return`movementY`in e?e.movementY:In}}),zn=An(Rn),Bn=An(h({},Rn,{dataTransfer:0})),Vn=An(h({},Nn,{relatedTarget:0})),Hn=An(h({},jn,{animationName:0,elapsedTime:0,pseudoElement:0})),Un=An(h({},jn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Wn=An(h({},jn,{data:0})),Gn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},O={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`},Kn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function qn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Kn[e])?!!t[e]:!1}function Jn(){return qn}var Yn=An(h({},Nn,{key:function(e){if(e.key){var t=Gn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Dn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?O[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Jn,charCode:function(e){return e.type===`keypress`?Dn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Dn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Xn=An(h({},Rn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Zn=An(h({},Nn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Jn})),Qn=An(h({},jn,{propertyName:0,elapsedTime:0,pseudoElement:0})),$n=An(h({},Rn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),er=An(h({},jn,{newState:0,oldState:0})),tr=[9,13,27,32],nr=bn&&`CompositionEvent`in window,rr=null;bn&&`documentMode`in document&&(rr=document.documentMode);var ir=bn&&`TextEvent`in window&&!rr,ar=bn&&(!nr||rr&&8<rr&&11>=rr),or=` `,sr=!1;function cr(e,t){switch(e){case`keyup`:return tr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function lr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var ur=!1;function dr(e,t){switch(e){case`compositionend`:return lr(t);case`keypress`:return t.which===32?(sr=!0,or):null;case`textInput`:return e=t.data,e===or&&sr?null:e;default:return null}}function fr(e,t){if(ur)return e===`compositionend`||!nr&&cr(e,t)?(e=En(),Tn=wn=Cn=null,ur=!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 ar&&t.locale!==`ko`?null:t.data;default:return null}}var pr={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 mr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!pr[e.type]:t===`textarea`}function hr(e,t,n,r){mn?hn?hn.push(r):hn=[r]:mn=r,t=Ld(t,`onChange`),0<t.length&&(n=new Mn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var gr=null,_r=null;function vr(e){Ad(e,0)}function yr(e){if(Kt(Ot(e)))return e}function br(e,t){if(e===`change`)return t}var xr=!1;if(bn){var Sr;if(bn){var Cr=`oninput`in document;if(!Cr){var wr=document.createElement(`div`);wr.setAttribute(`oninput`,`return;`),Cr=typeof wr.oninput==`function`}Sr=Cr}else Sr=!1;xr=Sr&&(!document.documentMode||9<document.documentMode)}function Tr(){gr&&(gr.detachEvent(`onpropertychange`,Er),_r=gr=null)}function Er(e){if(e.propertyName===`value`&&yr(_r)){var t=[];hr(t,_r,e,pn(e)),vn(vr,t)}}function Dr(e,t,n){e===`focusin`?(Tr(),gr=t,_r=n,gr.attachEvent(`onpropertychange`,Er)):e===`focusout`&&Tr()}function Or(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return yr(_r)}function kr(e,t){if(e===`click`)return yr(t)}function Ar(e,t){if(e===`input`||e===`change`)return yr(t)}function jr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Mr=typeof Object.is==`function`?Object.is:jr;function Nr(e,t){if(Mr(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(!je.call(t,i)||!Mr(e[i],t[i]))return!1}return!0}function k(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Pr(e,t){var n=k(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=k(n)}}function Fr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Fr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ir(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=qt(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=qt(e.document)}return t}function Lr(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 Rr=bn&&`documentMode`in document&&11>=document.documentMode,zr=null,Br=null,Vr=null,Hr=!1;function Ur(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Hr||zr==null||zr!==qt(r)||(r=zr,`selectionStart`in r&&Lr(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}),Vr&&Nr(Vr,r)||(Vr=r,r=Ld(Br,`onSelect`),0<r.length&&(t=new Mn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=zr)))}function Wr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Gr={animationend:Wr(`Animation`,`AnimationEnd`),animationiteration:Wr(`Animation`,`AnimationIteration`),animationstart:Wr(`Animation`,`AnimationStart`),transitionrun:Wr(`Transition`,`TransitionRun`),transitionstart:Wr(`Transition`,`TransitionStart`),transitioncancel:Wr(`Transition`,`TransitionCancel`),transitionend:Wr(`Transition`,`TransitionEnd`)},Kr={},qr={};bn&&(qr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Gr.animationend.animation,delete Gr.animationiteration.animation,delete Gr.animationstart.animation),`TransitionEvent`in window||delete Gr.transitionend.transition);function Jr(e){if(Kr[e])return Kr[e];if(!Gr[e])return e;var t=Gr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in qr)return Kr[e]=t[n];return e}var Yr=Jr(`animationend`),Xr=Jr(`animationiteration`),Zr=Jr(`animationstart`),Qr=Jr(`transitionrun`),$r=Jr(`transitionstart`),ei=Jr(`transitioncancel`),ti=Jr(`transitionend`),ni=new Map,ri=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error 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(` `);ri.push(`scrollEnd`);function ii(e,t){ni.set(e,t),Nt(t,[e])}var ai=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)},oi=[],si=0,ci=0;function li(){for(var e=si,t=ci=si=0;t<e;){var n=oi[t];oi[t++]=null;var r=oi[t];oi[t++]=null;var i=oi[t];oi[t++]=null;var a=oi[t];if(oi[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&&pi(n,i,a)}}function ui(e,t,n,r){oi[si++]=e,oi[si++]=t,oi[si++]=n,oi[si++]=r,ci|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function di(e,t,n,r){return ui(e,t,n,r),mi(e)}function fi(e,t){return ui(e,null,null,t),mi(e)}function pi(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-Je(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function mi(e){if(50<xu)throw xu=0,Su=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var hi={};function gi(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 _i(e,t,n,r){return new gi(e,t,n,r)}function vi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function yi(e,t){var n=e.alternate;return n===null?(n=_i(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&65011712,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 bi(e,t){e.flags&=65011714;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 xi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)vi(e)&&(s=1);else if(typeof e==`string`)s=tp(e,n,ge.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case re:return e=_i(31,n,t,a),e.elementType=re,e.lanes=o,e;case y:return Si(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=_i(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case ee:return e=_i(13,n,t,a),e.elementType=ee,e.lanes=o,e;case te:return e=_i(19,n,t,a),e.elementType=te,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case ne:s=14;break a;case T:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=_i(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Si(e,t,n,r){return e=_i(7,e,r,t),e.lanes=n,e}function Ci(e,t,n){return e=_i(6,e,null,t),e.lanes=n,e}function wi(e){var t=_i(18,null,null,0);return t.stateNode=e,t}function Ti(e,t,n){return t=_i(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ei=new WeakMap;function Di(e,t){if(typeof e==`object`&&e){var n=Ei.get(e);return n===void 0?(t={value:e,source:t,stack:Ae(t)},Ei.set(e,t),t):n}return{value:e,source:t,stack:Ae(t)}}var Oi=[],ki=0,Ai=null,ji=0,Mi=[],Ni=0,Pi=null,Fi=1,Ii=``;function Li(e,t){Oi[ki++]=ji,Oi[ki++]=Ai,Ai=e,ji=t}function Ri(e,t,n){Mi[Ni++]=Fi,Mi[Ni++]=Ii,Mi[Ni++]=Pi,Pi=e;var r=Fi;e=Ii;var i=32-Je(r)-1;r&=~(1<<i),n+=1;var a=32-Je(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Fi=1<<32-Je(t)+i|n<<i|r,Ii=a+e}else Fi=1<<a|n<<i|r,Ii=e}function zi(e){e.return!==null&&(Li(e,1),Ri(e,1,0))}function Bi(e){for(;e===Ai;)Ai=Oi[--ki],Oi[ki]=null,ji=Oi[--ki],Oi[ki]=null;for(;e===Pi;)Pi=Mi[--Ni],Mi[Ni]=null,Ii=Mi[--Ni],Mi[Ni]=null,Fi=Mi[--Ni],Mi[Ni]=null}function Vi(e,t){Mi[Ni++]=Fi,Mi[Ni++]=Ii,Mi[Ni++]=Pi,Fi=t.id,Ii=t.overflow,Pi=e}var Hi=null,Ui=null,Wi=!1,Gi=null,Ki=!1,qi=Error(i(519));function Ji(e){throw ea(Di(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),qi}function Yi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[_t]=e,t[vt]=r,n){case`dialog`:V(`cancel`,t),V(`close`,t);break;case`iframe`:case`object`:case`embed`:V(`load`,t);break;case`video`:case`audio`:for(n=0;n<Od.length;n++)V(Od[n],t);break;case`source`:V(`error`,t);break;case`img`:case`image`:case`link`:V(`error`,t),V(`load`,t);break;case`details`:V(`toggle`,t);break;case`input`:V(`invalid`,t),Zt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:V(`invalid`,t);break;case`textarea`:V(`invalid`,t),tn(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Ud(t.textContent,n)?(r.popover!=null&&(V(`beforetoggle`,t),V(`toggle`,t)),r.onScroll!=null&&V(`scroll`,t),r.onScrollEnd!=null&&V(`scrollend`,t),r.onClick!=null&&(t.onclick=dn),t=!0):t=!1,t||Ji(e,!0)}function Xi(e){for(Hi=e.return;Hi;)switch(Hi.tag){case 5:case 31:case 13:Ki=!1;return;case 27:case 3:Ki=!0;return;default:Hi=Hi.return}}function Zi(e){if(e!==Hi)return!1;if(!Wi)return Xi(e),Wi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||tf(e.type,e.memoizedProps)),n=!n),n&&Ui&&Ji(e),Xi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ui=Sf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ui=Sf(e)}else t===27?(t=Ui,uf(e.type)?(e=xf,xf=null,Ui=e):Ui=t):Ui=Hi?bf(e.stateNode.nextSibling):null;return!0}function Qi(){Ui=Hi=null,Wi=!1}function $i(){var e=Gi;return e!==null&&(cu===null?cu=e:cu.push.apply(cu,e),Gi=null),e}function ea(e){Gi===null?Gi=[e]:Gi.push(e)}var ta=pe(null),na=null,ra=null;function ia(e,t,n){he(ta,t._currentValue),t._currentValue=n}function aa(e){e._currentValue=ta.current,me(ta)}function oa(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 sa(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),oa(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),oa(s,n,e),s=null}else 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 ca(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;Mr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ye.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[up]:e.push(up))}a=a.return}e!==null&&sa(t,e,n,r),t.flags|=262144}function la(e){for(e=e.firstContext;e!==null;){if(!Mr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ua(e){na=e,ra=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function da(e){return pa(na,e)}function fa(e,t){return na===null&&ua(e),pa(e,t)}function pa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ra===null){if(e===null)throw Error(i(308));ra=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ra=ra.next=t;return n}var ma=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()})}},ha=t.unstable_scheduleCallback,ga=t.unstable_NormalPriority,_a={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function va(){return{controller:new ma,data:new Map,refCount:0}}function ya(e){e.refCount--,e.refCount===0&&ha(ga,function(){e.controller.abort()})}var ba=null,xa=0,A=0,Sa=null;function Ca(e,t){if(ba===null){var n=ba=[];xa=0,A=Sd(),Sa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return xa++,t.then(wa,wa),t}function wa(){if(--xa===0&&ba!==null){Sa!==null&&(Sa.status=`fulfilled`);var e=ba;ba=null,A=0,Sa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ta(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 Ea=E.S;E.S=function(e,t){B=Ie(),typeof t==`object`&&t&&typeof t.then==`function`&&Ca(e,t),Ea!==null&&Ea(e,t)};var Da=pe(null);function Oa(){var e=Da.current;return e===null?Jl.pooledCache:e}function ka(e,t){t===null?he(Da,Da.current):he(Da,t.pool)}function Aa(){var e=Oa();return e===null?null:{parent:_a._currentValue,pool:e}}var ja=Error(i(460)),Ma=Error(i(474)),Na=Error(i(542)),Pa={then:function(){}};function Fa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ia(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(dn,dn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ba(e),e;default:if(typeof t.status==`string`)t.then(dn,dn);else{if(e=Jl,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,Ba(e),e}throw Ra=t,ja}}function La(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ra=e,ja):e}}var Ra=null;function za(){if(Ra===null)throw Error(i(459));var e=Ra;return Ra=null,e}function Ba(e){if(e===ja||e===Na)throw Error(i(483))}var Va=null,Ha=0;function j(e){var t=Ha;return Ha+=1,Va===null&&(Va=[]),Ia(Va,e,t)}function Ua(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function M(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Wa(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=yi(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|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Ci(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===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===T&&La(i)===t.type)?(t=a(t,n.props),Ua(t,n),t.return=e,t):(t=xi(n.type,n.key,n.props,null,e.mode,r),Ua(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=Ti(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=Si(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=Ci(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=xi(t.type,t.key,t.props,null,e.mode,n),Ua(n,t),n.return=e,n;case v:return t=Ti(t,e.mode,n),t.return=e,t;case T:return t=La(t),f(e,t,n)}if(le(t)||oe(t))return t=Si(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,j(t),n);if(t.$$typeof===C)return f(e,fa(e,t),n);M(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 _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case T:return n=La(n),p(e,t,n,r)}if(le(n)||oe(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,j(n),r);if(n.$$typeof===C)return p(e,t,fa(e,n),r);M(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 _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case T:return r=La(r),m(e,t,n,r,i)}if(le(r)||oe(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,j(r),i);if(r.$$typeof===C)return m(e,t,n,fa(t,r),i);M(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),Wi&&Li(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 Wi&&Li(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(g.key===null?h:g.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)}),Wi&&Li(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),Wi&&Li(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 Wi&&Li(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(v.key===null?g:v.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)}),Wi&&Li(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&La(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ua(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===y?(c=Si(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=xi(o.type,o.key,o.props,null,e.mode,c),Ua(c,o),c.return=e,e=c)}return s(e);case v: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=Ti(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=La(o),b(e,r,o,c)}if(le(o))return h(e,r,o,c);if(oe(o)){if(l=oe(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,j(o),c);if(o.$$typeof===C)return b(e,r,fa(e,o),c);M(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=Ci(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ha=0;var i=b(e,t,n,r);return Va=null,i}catch(t){if(t===ja||t===Na)throw t;var a=_i(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ga=Wa(!0),Ka=Wa(!1),qa=!1;function Ja(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ya(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 Xa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Za(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ql&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=mi(e),pi(e,null,n),t}return ui(e,r,t,n),mi(e)}function Qa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ut(e,n)}}function $a(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 eo=!1;function to(){if(eo){var e=Sa;if(e!==null)throw e}}function no(e,t,n,r){eo=!1;var i=e.updateQueue;qa=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(z&f)===f:(r&f)===f){f!==0&&f===A&&(eo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:qa=!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),nu|=o,e.lanes=o,e.memoizedState=d}}function ro(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function io(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)ro(n[e],t)}var ao=pe(null),oo=pe(0);function N(e,t){e=eu,he(oo,e),he(ao,t),eu=e|t.baseLanes}function so(){he(oo,eu),he(ao,ao.current)}function co(){eu=oo.current,me(ao),me(oo)}var lo=pe(null),uo=null;function fo(e){var t=e.alternate;he(_o,_o.current&1),he(lo,e),uo===null&&(t===null||ao.current!==null||t.memoizedState!==null)&&(uo=e)}function po(e){he(_o,_o.current),he(lo,e),uo===null&&(uo=e)}function mo(e){e.tag===22?(he(_o,_o.current),he(lo,e),uo===null&&(uo=e)):ho(e)}function ho(){he(_o,_o.current),he(lo,lo.current)}function go(e){me(lo),uo===e&&(uo=null),me(_o)}var _o=pe(0);function vo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||_f(n)||vf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){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 yo=0,P=null,F=null,bo=null,xo=!1,So=!1,Co=!1,wo=0,To=0,Eo=null,Do=0;function Oo(){throw Error(i(321))}function ko(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Mr(e[n],t[n]))return!1;return!0}function Ao(e,t,n,r,i,a){return yo=a,P=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,E.H=e===null||e.memoizedState===null?Gs:Ks,Co=!1,a=n(r,i),Co=!1,So&&(a=Mo(t,n,r,i)),jo(e),a}function jo(e){E.H=Ws;var t=F!==null&&F.next!==null;if(yo=0,bo=F=P=null,xo=!1,To=0,Eo=null,t)throw Error(i(300));e===null||lc||(e=e.dependencies,e!==null&&la(e)&&(lc=!0))}function Mo(e,t,n,r){P=e;var a=0;do{if(So&&(Eo=null),To=0,So=!1,25<=a)throw Error(i(301));if(a+=1,bo=F=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}E.H=qs,o=t(n,r)}while(So);return o}function No(){var e=E.H,t=e.useState()[0];return t=typeof t.then==`function`?Ro(t):t,e=e.useState()[0],(F===null?null:F.memoizedState)!==e&&(P.flags|=1024),t}function Po(){var e=wo!==0;return wo=0,e}function Fo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function I(e){if(xo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}xo=!1}yo=0,bo=F=P=null,So=!1,To=wo=0,Eo=null}function Io(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return bo===null?P.memoizedState=bo=e:bo=bo.next=e,bo}function L(){if(F===null){var e=P.alternate;e=e===null?null:e.memoizedState}else e=F.next;var t=bo===null?P.memoizedState:bo.next;if(t!==null)bo=t,F=e;else{if(e===null)throw P.alternate===null?Error(i(467)):Error(i(310));F=e,e={memoizedState:F.memoizedState,baseState:F.baseState,baseQueue:F.baseQueue,queue:F.queue,next:null},bo===null?P.memoizedState=bo=e:bo=bo.next=e}return bo}function Lo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ro(e){var t=To;return To+=1,Eo===null&&(Eo=[]),e=Ia(Eo,e,t),t=P,(bo===null?t.memoizedState:bo.next)===null&&(t=t.alternate,E.H=t===null||t.memoizedState===null?Gs:Ks),e}function zo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Ro(e);if(e.$$typeof===C)return da(e)}throw Error(i(438,String(e)))}function Bo(e){var t=null,n=P.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=P.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=Lo(),P.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]=ie;return t.index++,n}function Vo(e,t){return typeof t==`function`?t(e):t}function Ho(e){return Uo(L(),F,e)}function Uo(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?(yo&f)===f:(z&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===A&&(d=!0);else if((yo&p)===p){u=u.next,p===A&&(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,P.lanes|=p,nu|=p;f=u.action,Co&&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,P.lanes|=f,nu|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Mr(o,e.memoizedState)&&(lc=!0,d&&(n=Sa,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 Wo(e){var t=L(),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);Mr(o,t.memoizedState)||(lc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Go(e,t,n){var r=P,a=L(),o=Wi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Mr((F||a).memoizedState,n);if(s&&(a.memoizedState=n,lc=!0),a=a.queue,gs(Jo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||bo!==null&&bo.memoizedState.tag&1){if(r.flags|=2048,ds(9,{destroy:void 0},qo.bind(null,r,a,n,t),null),Jl===null)throw Error(i(349));o||yo&127||Ko(r,t,n)}return n}function Ko(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=P.updateQueue,t===null?(t=Lo(),P.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function qo(e,t,n,r){t.value=n,t.getSnapshot=r,Yo(t)&&Xo(e)}function Jo(e,t,n){return n(function(){Yo(t)&&Xo(e)})}function Yo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Mr(e,n)}catch{return!0}}function Xo(e){var t=fi(e,2);t!==null&&Tu(t,e,2)}function Zo(e){var t=Io();if(typeof e==`function`){var n=e;if(e=n(),Co){qe(!0);try{n()}finally{qe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vo,lastRenderedState:e},t}function Qo(e,t,n,r){return e.baseState=n,Uo(e,F,typeof r==`function`?r:Vo)}function $o(e,t,n,r,a){if(Vs(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)}};E.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=E.T,o={};E.T=o;try{var s=n(i,r),c=E.S;c!==null&&c(o,s),ts(e,t,s)}catch(n){rs(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),E.T=a}}else try{a=n(i,r),ts(e,t,a)}catch(n){rs(e,t,n)}}function ts(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){ns(e,t,n)},function(n){return rs(e,t,n)}):ns(e,t,n)}function ns(e,t,n){t.status=`fulfilled`,t.value=n,is(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 rs(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,is(t),t=t.next;while(t!==r)}e.action=null}function is(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function as(e,t){return t}function os(e,t){if(Wi){var n=Jl.formState;if(n!==null){a:{var r=P;if(Wi){if(Ui){b:{for(var i=Ui,a=Ki;i.nodeType!==8;){if(!a){i=null;break b}if(i=bf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ui=bf(i.nextSibling),r=i.data===`F!`;break a}}Ji(r)}r=!1}r&&(t=n[0])}}return n=Io(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:t},n.queue=r,n=Rs.bind(null,P,r),r.dispatch=n,r=Zo(!1),a=Bs.bind(null,P,!1,r.queue),r=Io(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=$o.bind(null,P,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ss(e){return cs(L(),F,e)}function cs(e,t,n){if(t=Uo(e,t,as)[0],e=Ho(Vo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Ro(t)}catch(e){throw e===ja?Na:e}else r=t;t=L();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(P.flags|=2048,ds(9,{destroy:void 0},ls.bind(null,i,n),null)),[r,a,e]}function ls(e,t){e.action=t}function us(e){var t=L(),n=F;if(n!==null)return cs(t,n,e);L(),t=t.memoizedState,n=L();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ds(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=P.updateQueue,t===null&&(t=Lo(),P.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 fs(){return L().memoizedState}function ps(e,t,n,r){var i=Io();P.flags|=e,i.memoizedState=ds(1|t,{destroy:void 0},n,r===void 0?null:r)}function ms(e,t,n,r){var i=L();r=r===void 0?null:r;var a=i.memoizedState.inst;F!==null&&r!==null&&ko(r,F.memoizedState.deps)?i.memoizedState=ds(t,a,n,r):(P.flags|=e,i.memoizedState=ds(1|t,a,n,r))}function hs(e,t){ps(8390656,8,e,t)}function gs(e,t){ms(2048,8,e,t)}function _s(e){P.flags|=4;var t=P.updateQueue;if(t===null)t=Lo(),P.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function vs(e){var t=L().memoizedState;return _s({ref:t,nextImpl:e}),function(){if(ql&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ys(e,t){return ms(4,2,e,t)}function bs(e,t){return ms(4,4,e,t)}function xs(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 Ss(e,t,n){n=n==null?null:n.concat([e]),ms(4,4,xs.bind(null,t,e),n)}function Cs(){}function ws(e,t){var n=L();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&ko(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ts(e,t){var n=L();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&ko(t,r[1]))return r[0];if(r=e(),Co){qe(!0);try{e()}finally{qe(!1)}}return n.memoizedState=[r,t],r}function Es(e,t,n){return n===void 0||yo&1073741824&&!(z&261930)?e.memoizedState=t:(e.memoizedState=n,e=wu(),P.lanes|=e,nu|=e,n)}function Ds(e,t,n,r){return Mr(n,t)?n:ao.current===null?!(yo&42)||yo&1073741824&&!(z&261930)?(lc=!0,e.memoizedState=n):(e=wu(),P.lanes|=e,nu|=e,t):(e=Es(e,n,r),Mr(e,t)||(lc=!0),e)}function Os(e,t,n,r,i){var a=D.p;D.p=a!==0&&8>a?a:8;var o=E.T,s={};E.T=s,Bs(e,!1,t,n);try{var c=i(),l=E.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?zs(e,t,Ta(c,r),Cu(e)):zs(e,t,r,Cu(e))}catch(n){zs(e,t,{then:function(){},status:`rejected`,reason:n},Cu())}finally{D.p=a,o!==null&&s.types!==null&&(o.types=s.types),E.T=o}}function ks(){}function As(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=js(e).queue;Os(e,a,t,ue,n===null?ks:function(){return Ms(e),n(r)})}function js(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ue,baseState:ue,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vo,lastRenderedState:ue},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ms(e){var t=js(e);t.next===null&&(t=e.alternate.memoizedState),zs(e,t.next.queue,{},Cu())}function Ns(){return da(up)}function Ps(){return L().memoizedState}function Fs(){return L().memoizedState}function Is(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Cu();e=Xa(n);var r=Za(t,e,n);r!==null&&(Tu(r,t,n),Qa(r,t,n)),t={cache:va()},e.payload=t;return}t=t.return}}function Ls(e,t,n){var r=Cu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Vs(e)?Hs(t,n):(n=di(e,t,n,r),n!==null&&(Tu(n,e,r),Us(n,t,r)))}function Rs(e,t,n){zs(e,t,n,Cu())}function zs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Vs(e))Hs(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,Mr(s,o))return ui(e,t,i,0),Jl===null&&li(),!1}catch{}if(n=di(e,t,i,r),n!==null)return Tu(n,e,r),Us(n,t,r),!0}return!1}function Bs(e,t,n,r){if(r={lane:2,revertLane:Sd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Vs(e)){if(t)throw Error(i(479))}else t=di(e,n,r,2),t!==null&&Tu(t,e,2)}function Vs(e){var t=e.alternate;return e===P||t!==null&&t===P}function Hs(e,t){So=xo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Us(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ut(e,n)}}var Ws={readContext:da,use:zo,useCallback:Oo,useContext:Oo,useEffect:Oo,useImperativeHandle:Oo,useLayoutEffect:Oo,useInsertionEffect:Oo,useMemo:Oo,useReducer:Oo,useRef:Oo,useState:Oo,useDebugValue:Oo,useDeferredValue:Oo,useTransition:Oo,useSyncExternalStore:Oo,useId:Oo,useHostTransitionStatus:Oo,useFormState:Oo,useActionState:Oo,useOptimistic:Oo,useMemoCache:Oo,useCacheRefresh:Oo};Ws.useEffectEvent=Oo;var Gs={readContext:da,use:zo,useCallback:function(e,t){return Io().memoizedState=[e,t===void 0?null:t],e},useContext:da,useEffect:hs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ps(4194308,4,xs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ps(4194308,4,e,t)},useInsertionEffect:function(e,t){ps(4,2,e,t)},useMemo:function(e,t){var n=Io();t=t===void 0?null:t;var r=e();if(Co){qe(!0);try{e()}finally{qe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Io();if(n!==void 0){var i=n(t);if(Co){qe(!0);try{n(t)}finally{qe(!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=Ls.bind(null,P,e),[r.memoizedState,e]},useRef:function(e){var t=Io();return e={current:e},t.memoizedState=e},useState:function(e){e=Zo(e);var t=e.queue,n=Rs.bind(null,P,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Cs,useDeferredValue:function(e,t){return Es(Io(),e,t)},useTransition:function(){var e=Zo(!1);return e=Os.bind(null,P,e.queue,!0,!1),Io().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=P,a=Io();if(Wi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Jl===null)throw Error(i(349));z&127||Ko(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,hs(Jo.bind(null,r,o,e),[e]),r.flags|=2048,ds(9,{destroy:void 0},qo.bind(null,r,o,n,t),null),n},useId:function(){var e=Io(),t=Jl.identifierPrefix;if(Wi){var n=Ii,r=Fi;n=(r&~(1<<32-Je(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=wo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Do++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ns,useFormState:os,useActionState:os,useOptimistic:function(e){var t=Io();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Bs.bind(null,P,!0,n),n.dispatch=t,[e,t]},useMemoCache:Bo,useCacheRefresh:function(){return Io().memoizedState=Is.bind(null,P)},useEffectEvent:function(e){var t=Io(),n={impl:e};return t.memoizedState=n,function(){if(ql&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ks={readContext:da,use:zo,useCallback:ws,useContext:da,useEffect:gs,useImperativeHandle:Ss,useInsertionEffect:ys,useLayoutEffect:bs,useMemo:Ts,useReducer:Ho,useRef:fs,useState:function(){return Ho(Vo)},useDebugValue:Cs,useDeferredValue:function(e,t){return Ds(L(),F.memoizedState,e,t)},useTransition:function(){var e=Ho(Vo)[0],t=L().memoizedState;return[typeof e==`boolean`?e:Ro(e),t]},useSyncExternalStore:Go,useId:Ps,useHostTransitionStatus:Ns,useFormState:ss,useActionState:ss,useOptimistic:function(e,t){return Qo(L(),F,e,t)},useMemoCache:Bo,useCacheRefresh:Fs};Ks.useEffectEvent=vs;var qs={readContext:da,use:zo,useCallback:ws,useContext:da,useEffect:gs,useImperativeHandle:Ss,useInsertionEffect:ys,useLayoutEffect:bs,useMemo:Ts,useReducer:Wo,useRef:fs,useState:function(){return Wo(Vo)},useDebugValue:Cs,useDeferredValue:function(e,t){var n=L();return F===null?Es(n,e,t):Ds(n,F.memoizedState,e,t)},useTransition:function(){var e=Wo(Vo)[0],t=L().memoizedState;return[typeof e==`boolean`?e:Ro(e),t]},useSyncExternalStore:Go,useId:Ps,useHostTransitionStatus:Ns,useFormState:us,useActionState:us,useOptimistic:function(e,t){var n=L();return F===null?(n.baseState=e,[e,n.queue.dispatch]):Qo(n,F,e,t)},useMemoCache:Bo,useCacheRefresh:Fs};qs.useEffectEvent=vs;function Js(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ys={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Cu(),i=Xa(r);i.payload=t,n!=null&&(i.callback=n),t=Za(e,i,r),t!==null&&(Tu(t,e,r),Qa(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Cu(),i=Xa(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Za(e,i,r),t!==null&&(Tu(t,e,r),Qa(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Cu(),r=Xa(n);r.tag=2,t!=null&&(r.callback=t),t=Za(e,r,n),t!==null&&(Tu(t,e,n),Qa(t,e,n))}};function Xs(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?!Nr(n,r)||!Nr(i,a):!0}function Zs(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&&Ys.enqueueReplaceState(t,t.state,null)}function Qs(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=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function $s(e){ai(e)}function ec(e){console.error(e)}function tc(e){ai(e)}function nc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function rc(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 ic(e,t,n){return n=Xa(n),n.tag=3,n.payload={element:null},n.callback=function(){nc(e,t)},n}function ac(e){return e=Xa(e),e.tag=3,e}function oc(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(){rc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){rc(t,n,r),typeof i!=`function`&&(pu===null?pu=new Set([this]):pu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function sc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ca(t,n,a,!0),n=lo.current,n!==null){switch(n.tag){case 31:case 13:return uo===null?Lu():n.alternate===null&&tu===0&&(tu=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Pa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),nd(e,r,a)),!1;case 22:return n.flags|=65536,r===Pa?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)),nd(e,r,a)),!1}throw Error(i(435,n.tag))}return nd(e,r,a),Lu(),!1}if(Wi)return t=lo.current,t===null?(r!==qi&&(t=Error(i(423),{cause:r}),ea(Di(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Di(r,n),a=ic(e.stateNode,r,a),$a(e,a),tu!==4&&(tu=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==qi&&(e=Error(i(422),{cause:r}),ea(Di(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Di(o,n),su===null?su=[o]:su.push(o),tu!==4&&(tu=2),t===null)return!0;r=Di(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=ic(n.stateNode,r,e),$a(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`&&(pu===null||!pu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=ac(a),oc(a,e,n,r),$a(n,a),!1}n=n.return}while(n!==null);return!1}var cc=Error(i(461)),lc=!1;function uc(e,t,n,r){t.child=e===null?Ka(t,null,n,r):Ga(t,e.child,n,r)}function dc(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 ua(t),r=Ao(e,t,n,o,a,i),s=Po(),e!==null&&!lc?(Fo(e,t,i),Fc(e,t,i)):(Wi&&s&&zi(t),t.flags|=1,uc(e,t,r,i),t.child)}function fc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!vi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,pc(e,t,a,r,i)):(e=xi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Ic(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Nr:n,n(o,r)&&e.ref===t.ref)return Fc(e,t,i)}return t.flags|=1,e=yi(a,r),e.ref=t.ref,e.return=t,t.child=e}function pc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Nr(a,r)&&e.ref===t.ref){if(lc=!1,t.pendingProps=r=a,Ic(e,i))e.flags&131072&&(lc=!0);else return t.lanes=e.lanes,Fc(e,t,i)}}return xc(e,t,n,r,i)}function mc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return gc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ka(t,a===null?null:a.cachePool),a===null?so():N(t,a),mo(t);else return r=t.lanes=536870912,gc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ka(t,null),so(),ho(t)):(ka(t,a.cachePool),N(t,a),ho(t),t.memoizedState=null);return uc(e,t,i,n),t.child}function hc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function gc(e,t,n,r,i){var a=Oa();return a=a===null?null:{parent:_a._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ka(t,null),so(),mo(t),e!==null&&ca(e,t,r,!0),t.childLanes=i,null}function _c(e,t){return t=Ac({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function vc(e,t,n){return Ga(t,e.child,null,n),e=_c(t,t.pendingProps),e.flags|=2,go(t),t.memoizedState=null,e}function yc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(Wi){if(r.mode===`hidden`)return e=_c(t,r),t.lanes=536870912,hc(null,e);if(po(t),(e=Ui)?(e=gf(e,Ki),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Pi===null?null:{id:Fi,overflow:Ii},retryLane:536870912,hydrationErrors:null},n=wi(e),n.return=t,t.child=n,Hi=t,Ui=null)):e=null,e===null)throw Ji(t);return t.lanes=536870912,null}return _c(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(po(t),a){if(t.flags&256)t.flags&=-257,t=vc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(lc||ca(e,t,n,!1),a=(n&e.childLanes)!==0,lc||a){if(r=Jl,r!==null&&(s=dt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,fi(e,s),Tu(r,e,s),cc;Lu(),t=vc(e,t,n)}else e=o.treeContext,Ui=bf(s.nextSibling),Hi=t,Wi=!0,Gi=null,Ki=!1,e!==null&&Vi(t,e),t=_c(t,r),t.flags|=4096;return t}return e=yi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function bc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function xc(e,t,n,r,i){return ua(t),n=Ao(e,t,n,r,void 0,i),r=Po(),e!==null&&!lc?(Fo(e,t,i),Fc(e,t,i)):(Wi&&r&&zi(t),t.flags|=1,uc(e,t,n,i),t.child)}function Sc(e,t,n,r,i,a){return ua(t),t.updateQueue=null,n=Mo(t,r,n,i),jo(e),r=Po(),e!==null&&!lc?(Fo(e,t,a),Fc(e,t,a)):(Wi&&r&&zi(t),t.flags|=1,uc(e,t,n,a),t.child)}function Cc(e,t,n,r,i){if(ua(t),t.stateNode===null){var a=hi,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=Ys,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ja(t),o=n.contextType,a.context=typeof o==`object`&&o?da(o):hi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Js(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&&Ys.enqueueReplaceState(a,a.state,null),no(t,r,a,i),to(),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=Qs(n,s);a.props=c;var l=a.context,u=n.contextType;o=hi,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)&&Zs(t,a,r,o),qa=!1;var f=t.memoizedState;a.state=f,no(t,r,a,i),to(),l=t.memoizedState,s||f!==l||qa?(typeof d==`function`&&(Js(t,n,d,r),l=t.memoizedState),(c=qa||Xs(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,Ya(e,t),o=t.memoizedProps,u=Qs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=hi,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)&&Zs(t,a,r,c),qa=!1,f=t.memoizedState,a.state=f,no(t,r,a,i),to();var p=t.memoizedState;o!==d||f!==p||qa||e!==null&&e.dependencies!==null&&la(e.dependencies)?(typeof s==`function`&&(Js(t,n,s,r),p=t.memoizedState),(u=qa||Xs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&la(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,bc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ga(t,e.child,null,i),t.child=Ga(t,null,n,i)):uc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Fc(e,t,i),e}function wc(e,t,n,r){return Qi(),t.flags|=256,uc(e,t,n,r),t.child}var Tc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ec(e){return{baseLanes:e,cachePool:Aa()}}function Dc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=au),e}function Oc(e,t,n){var r=t.pendingProps,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(_o.current&2)),s&&(a=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(Wi){if(a?fo(t):ho(t),(e=Ui)?(e=gf(e,Ki),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Pi===null?null:{id:Fi,overflow:Ii},retryLane:536870912,hydrationErrors:null},n=wi(e),n.return=t,t.child=n,Hi=t,Ui=null)):e=null,e===null)throw Ji(t);return vf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(ho(t),a=t.mode,c=Ac({mode:`hidden`,children:c},a),r=Si(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=Ec(n),r.childLanes=Dc(e,s,n),t.memoizedState=Tc,hc(null,r)):(fo(t),kc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(fo(t),t.flags&=-257,t=jc(e,t,n)):t.memoizedState===null?(ho(t),c=r.fallback,a=t.mode,r=Ac({mode:`visible`,children:r.children},a),c=Si(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ga(t,e.child,null,n),r=t.child,r.memoizedState=Ec(n),r.childLanes=Dc(e,s,n),t.memoizedState=Tc,t=hc(null,r)):(ho(t),t.child=e.child,t.flags|=128,t=null);else if(fo(t),vf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,ea({value:r,source:null,stack:null}),t=jc(e,t,n)}else if(lc||ca(e,t,n,!1),s=(n&e.childLanes)!==0,lc||s){if(s=Jl,s!==null&&(r=dt(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,fi(e,r),Tu(s,e,r),cc;_f(c)||Lu(),t=jc(e,t,n)}else _f(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ui=bf(c.nextSibling),Hi=t,Wi=!0,Gi=null,Ki=!1,e!==null&&Vi(t,e),t=kc(t,r.children),t.flags|=4096);return t}return a?(ho(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=yi(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=Si(c,a,n,null),c.flags|=2):c=yi(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,hc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=Ec(n):(a=c.cachePool,a===null?a=Aa():(l=_a._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=Dc(e,s,n),t.memoizedState=Tc,hc(e.child,r)):(fo(t),n=e.child,e=n.sibling,n=yi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function kc(e,t){return t=Ac({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Ac(e,t){return e=_i(22,e,null,t),e.lanes=0,e}function jc(e,t,n){return Ga(t,e.child,null,n),e=kc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Mc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),oa(e.return,t,n)}function Nc(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 Pc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=_o.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,he(_o,o),uc(e,t,r,n),r=Wi?ji:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Mc(e,n,t);else if(e.tag===19)Mc(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`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&vo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Nc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&vo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Nc(t,!0,n,null,a,r);break;case`together`:Nc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Fc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),nu|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ca(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=yi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=yi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ic(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&la(e)))}function Lc(e,t,n){switch(t.tag){case 3:be(t,t.stateNode.containerInfo),ia(t,_a,e.memoizedState.cache),Qi();break;case 27:case 5:Se(t);break;case 4:be(t,t.stateNode.containerInfo);break;case 10:ia(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,po(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(fo(t),e=Fc(e,t,n),e===null?null:e.sibling):Oc(e,t,n):(fo(t),t.flags|=128,null);fo(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(ca(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Pc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),he(_o,_o.current),r)break;return null;case 22:return t.lanes=0,mc(e,t,n,t.pendingProps);case 24:ia(t,_a,e.memoizedState.cache)}return Fc(e,t,n)}function Rc(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)lc=!0;else{if(!Ic(e,n)&&!(t.flags&128))return lc=!1,Lc(e,t,n);lc=!!(e.flags&131072)}}else lc=!1,Wi&&t.flags&1048576&&Ri(t,ji,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=La(t.elementType),t.type=e,typeof e==`function`)vi(e)?(r=Qs(e,r),t.tag=1,t=Cc(null,t,e,r,n)):(t.tag=0,t=xc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=dc(null,t,e,r,n);break a}if(a===ne){t.tag=14,t=fc(null,t,e,r,n);break a}}throw t=ce(e)||e,Error(i(306,t,``))}}return t;case 0:return xc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Qs(r,t.pendingProps),Cc(e,t,r,a,n);case 3:a:{if(be(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ya(e,t),no(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ia(t,_a,r),r!==o.cache&&sa(t,[_a],n,!0),to(),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=wc(e,t,r,n);break a}if(r!==a){a=Di(Error(i(424)),t),ea(a),t=wc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ui=bf(e.firstChild),Hi=t,Wi=!0,Gi=null,Ki=!0,n=Ka(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Qi(),r===a){t=Fc(e,t,n);break a}uc(e,t,r,n)}t=t.child}return t;case 26:return bc(e,t),e===null?(n=Vf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Wi||(n=t.type,e=t.pendingProps,r=Qd(ve.current).createElement(n),r[_t]=t,r[vt]=e,Kd(r,n,e),At(r),t.stateNode=r):t.memoizedState=Vf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Se(t),e===null&&Wi&&(r=t.stateNode=wf(t.type,t.pendingProps,ve.current),Hi=t,Ki=!0,a=Ui,uf(t.type)?(xf=a,Ui=bf(r.firstChild)):Ui=a),uc(e,t,t.pendingProps.children,n),bc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Wi&&((a=r=Ui)&&(r=mf(r,t.type,t.pendingProps,Ki),r===null?a=!1:(t.stateNode=r,Hi=t,Ui=bf(r.firstChild),Ki=!1,a=!0)),a||Ji(t)),Se(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,tf(a,o)?r=null:s!==null&&tf(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Ao(e,t,No,null,null,n),up._currentValue=a),bc(e,t),uc(e,t,r,n),t.child;case 6:return e===null&&Wi&&((e=n=Ui)&&(n=hf(n,t.pendingProps,Ki),n===null?e=!1:(t.stateNode=n,Hi=t,Ui=null,e=!0)),e||Ji(t)),null;case 13:return Oc(e,t,n);case 4:return be(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ga(t,null,r,n):uc(e,t,r,n),t.child;case 11:return dc(e,t,t.type,t.pendingProps,n);case 7:return uc(e,t,t.pendingProps,n),t.child;case 8:return uc(e,t,t.pendingProps.children,n),t.child;case 12:return uc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,ia(t,t.type,r.value),uc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,ua(t),a=da(a),r=r(a),t.flags|=1,uc(e,t,r,n),t.child;case 14:return fc(e,t,t.type,t.pendingProps,n);case 15:return pc(e,t,t.type,t.pendingProps,n);case 19:return Pc(e,t,n);case 31:return yc(e,t,n);case 22:return mc(e,t,n,t.pendingProps);case 24:return ua(t),r=da(_a),e===null?(a=Oa(),a===null&&(a=Jl,o=va(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ja(t),ia(t,_a,a)):((e.lanes&n)!==0&&(Ya(e,t),no(t,null,null,n),to()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ia(t,_a,r),r!==a.cache&&sa(t,[_a],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ia(t,_a,r))),uc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function zc(e){e.flags|=4}function Bc(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Pu())e.flags|=8192;else throw Ra=Pa,Ma}}else e.flags&=-16777217}function Vc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!np(t)){if(Pu())e.flags|=8192;else throw Ra=Pa,Ma}}function Hc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:at(),e.lanes|=t,ou|=t)}function Uc(e,t){if(!Wi)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var 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}}function Wc(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&65011712,r|=i.flags&65011712,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 Gc(e,t,n){var r=t.pendingProps;switch(Bi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wc(t),null;case 1:return Wc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),aa(_a),xe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Zi(t)?zc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,$i())),Wc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(zc(t),o===null?(Wc(t),Bc(t,a,null,r,n)):(Wc(t),Vc(t,o))):o?o===e.memoizedState?(Wc(t),t.flags&=-16777217):(zc(t),Wc(t),Vc(t,o)):(e=e.memoizedProps,e!==r&&zc(t),Wc(t),Bc(t,a,e,r,n)),null;case 27:if(Ce(t),n=ve.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&zc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Wc(t),null}e=ge.current,Zi(t)?Yi(t,e):(e=wf(a,r,n),t.stateNode=e,zc(t))}return Wc(t),null;case 5:if(Ce(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&zc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Wc(t),null}if(o=ge.current,Zi(t))Yi(t,o);else{var s=Qd(ve.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[_t]=t,o[vt]=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(Kd(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&&zc(t)}}return Wc(t),Bc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&zc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ve.current,Zi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Hi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[_t]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Ud(e.nodeValue,n)),e||Ji(t,!0)}else e=Qd(e).createTextNode(r),e[_t]=t,t.stateNode=e}return Wc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Zi(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[_t]=t}else Qi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Wc(t),e=!1}else n=$i(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(go(t),t):(go(t),null);if(t.flags&128)throw Error(i(558))}return Wc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Zi(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[_t]=t}else Qi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Wc(t),a=!1}else a=$i(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(go(t),t):(go(t),null)}return go(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),Hc(t,t.updateQueue),Wc(t),null);case 4:return xe(),e===null&&Nd(t.stateNode.containerInfo),Wc(t),null;case 10:return aa(t.type),Wc(t),null;case 19:if(me(_o),r=t.memoizedState,r===null)return Wc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Uc(r,!1);else{if(tu!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=vo(e),o!==null){for(t.flags|=128,Uc(r,!1),e=o.updateQueue,t.updateQueue=e,Hc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)bi(n,e),n=n.sibling;return he(_o,_o.current&1|2),Wi&&Li(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ie()>du&&(t.flags|=128,a=!0,Uc(r,!1),t.lanes=4194304)}}else{if(!a){if(e=vo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Hc(t,e),Uc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Wi)return Wc(t),null}else 2*Ie()-r.renderingStartTime>du&&n!==536870912&&(t.flags|=128,a=!0,Uc(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)}return r.tail===null?(Wc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ie(),e.sibling=null,n=_o.current,he(_o,a?n&1|2:n&1),Wi&&Li(t,r.treeForkCount),e);case 22:case 23:return go(t),co(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Wc(t),t.subtreeFlags&6&&(t.flags|=8192)):Wc(t),n=t.updateQueue,n!==null&&Hc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&me(Da),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),aa(_a),Wc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Kc(e,t){switch(Bi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return aa(_a),xe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ce(t),null;case 31:if(t.memoizedState!==null){if(go(t),t.alternate===null)throw Error(i(340));Qi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(go(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Qi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return me(_o),null;case 4:return xe(),null;case 10:return aa(t.type),null;case 22:case 23:return go(t),co(),e!==null&&me(Da),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return aa(_a),null;case 25:return null;default:return null}}function qc(e,t){switch(Bi(t),t.tag){case 3:aa(_a),xe();break;case 26:case 27:case 5:Ce(t);break;case 4:xe();break;case 31:t.memoizedState!==null&&go(t);break;case 13:go(t);break;case 19:me(_o);break;case 10:aa(t.type);break;case 22:case 23:go(t),co(),e!==null&&me(Da);break;case 24:aa(_a)}}function Jc(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){td(t,t.return,e)}}function Yc(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){td(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){td(t,t.return,e)}}function Xc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{io(t,n)}catch(t){td(e,e.return,t)}}}function Zc(e,t,n){n.props=Qs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){td(e,t,n)}}function Qc(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:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){td(e,t,n)}}function $c(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){td(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){td(e,t,n)}else n.current=null}}function el(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){td(e,e.return,t)}}function tl(e,t,n){try{var r=e.stateNode;qd(r,e.type,n,t),r[vt]=t}catch(t){td(e,e.return,t)}}function nl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&uf(e.type)||e.tag===4}function rl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||nl(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&&uf(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 il(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=dn));else if(r!==4&&(r===27&&uf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(il(e,t,n),e=e.sibling;e!==null;)il(e,t,n),e=e.sibling}function al(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&uf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(al(e,t,n),e=e.sibling;e!==null;)al(e,t,n),e=e.sibling}function ol(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Kd(t,r,n),t[_t]=e,t[vt]=n}catch(t){td(e,e.return,t)}}var sl=!1,cl=!1,ll=!1,ul=typeof WeakSet==`function`?WeakSet:Set,dl=null;function fl(e,t){if(e=e.containerInfo,Xd=yp,e=Ir(e),Lr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Zd={focusedElem:e,selectionRange:n},yp=!1,dl=t;dl!==null;)if(t=dl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,dl=e;else for(;dl!==null;){switch(t=dl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Qs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){td(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)pf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:pf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,dl=e;break}dl=t.return}}function pl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Ol(e,n),r&4&&Jc(5,n);break;case 1:if(Ol(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){td(n,n.return,e)}else{var i=Qs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){td(n,n.return,e)}}}r&64&&Xc(n),r&512&&Qc(n,n.return);break;case 3:if(Ol(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{io(e,t)}catch(e){td(n,n.return,e)}}break;case 27:t===null&&r&4&&ol(n);case 26:case 5:Ol(e,n),t===null&&r&4&&el(n),r&512&&Qc(n,n.return);break;case 12:Ol(e,n);break;case 31:Ol(e,n),r&4&&yl(e,n);break;case 13:Ol(e,n),r&4&&bl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=ad.bind(null,n),yf(e,n))));break;case 22:if(r=n.memoizedState!==null||sl,!r){t=t!==null&&t.memoizedState!==null||cl,i=sl;var a=cl;sl=r,(cl=t)&&!a?Al(e,n,!!(n.subtreeFlags&8772)):Ol(e,n),sl=i,cl=a}break;case 30:break;default:Ol(e,n)}}function ml(e){var t=e.alternate;t!==null&&(e.alternate=null,ml(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Tt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var hl=null,gl=!1;function _l(e,t,n){for(n=n.child;n!==null;)vl(e,t,n),n=n.sibling}function vl(e,t,n){if(Ke&&typeof Ke.onCommitFiberUnmount==`function`)try{Ke.onCommitFiberUnmount(Ge,n)}catch{}switch(n.tag){case 26:cl||$c(n,t),_l(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:cl||$c(n,t);var r=hl,i=gl;uf(n.type)&&(hl=n.stateNode,gl=!1),_l(e,t,n),Tf(n.stateNode),hl=r,gl=i;break;case 5:cl||$c(n,t);case 6:if(r=hl,i=gl,hl=null,_l(e,t,n),hl=r,gl=i,hl!==null){if(gl)try{(hl.nodeType===9?hl.body:hl.nodeName===`HTML`?hl.ownerDocument.body:hl).removeChild(n.stateNode)}catch(e){td(n,t,e)}else try{hl.removeChild(n.stateNode)}catch(e){td(n,t,e)}}break;case 18:hl!==null&&(gl?(e=hl,df(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Gp(e)):df(hl,n.stateNode));break;case 4:r=hl,i=gl,hl=n.stateNode.containerInfo,gl=!0,_l(e,t,n),hl=r,gl=i;break;case 0:case 11:case 14:case 15:Yc(2,n,t),cl||Yc(4,n,t),_l(e,t,n);break;case 1:cl||($c(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Zc(n,t,r)),_l(e,t,n);break;case 21:_l(e,t,n);break;case 22:cl=(r=cl)||n.memoizedState!==null,_l(e,t,n),cl=r;break;default:_l(e,t,n)}}function yl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Gp(e)}catch(e){td(t,t.return,e)}}}function bl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Gp(e)}catch(e){td(t,t.return,e)}}function xl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ul),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ul),t;default:throw Error(i(435,e.tag))}}function Sl(e,t){var n=xl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=od.bind(null,e,t);t.then(r,r)}})}function Cl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(uf(c.type)){hl=c.stateNode,gl=!1;break a}break;case 5:hl=c.stateNode,gl=!1;break a;case 3:case 4:hl=c.stateNode.containerInfo,gl=!0;break a}c=c.return}if(hl===null)throw Error(i(160));vl(o,s,a),hl=null,gl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Tl(t,e),t=t.sibling}var wl=null;function Tl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Cl(t,e),El(e),r&4&&(Yc(3,e,e.return),Jc(3,e),Yc(5,e,e.return));break;case 1:Cl(t,e),El(e),r&512&&(cl||n===null||$c(n,n.return)),r&64&&sl&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=wl;if(Cl(t,e),El(e),r&512&&(cl||n===null||$c(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null){if(r===null){if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[wt]||o[_t]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Kd(o,r,n),o[_t]=e,At(o),r=o;break a;case`link`:var s=$f(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Kd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=$f(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Kd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[_t]=e,At(o),r=o}e.stateNode=r}else ep(a,e.type,e.stateNode)}else e.stateNode=Jf(a,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&tl(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?ep(a,e.type,e.stateNode):Jf(a,r,e.memoizedProps))}break;case 27:Cl(t,e),El(e),r&512&&(cl||n===null||$c(n,n.return)),n!==null&&r&4&&tl(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Cl(t,e),El(e),r&512&&(cl||n===null||$c(n,n.return)),e.flags&32){a=e.stateNode;try{nn(a,``)}catch(t){td(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,tl(e,a,n===null?a:n.memoizedProps)),r&1024&&(ll=!0);break;case 6:if(Cl(t,e),El(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){td(e,e.return,t)}}break;case 3:if(Qf=null,a=wl,wl=Of(t.containerInfo),Cl(t,e),wl=a,El(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Gp(t.containerInfo)}catch(t){td(e,e.return,t)}ll&&(ll=!1,Dl(e));break;case 4:r=wl,wl=Of(e.stateNode.containerInfo),Cl(t,e),El(e),wl=r;break;case 12:Cl(t,e),El(e);break;case 31:Cl(t,e),El(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Sl(e,r)));break;case 13:Cl(t,e),El(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(uu=Ie()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Sl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=sl,d=cl;if(sl=u||a,cl=d||l,Cl(t,e),cl=d,sl=u,El(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||sl||cl||kl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){td(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){td(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?ff(m,!0):ff(l.stateNode,!1)}catch(e){td(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,Sl(e,n))));break;case 19:Cl(t,e),El(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Sl(e,r)));break;case 30:break;case 21:break;default:Cl(t,e),El(e)}}function El(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(nl(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;al(e,rl(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(nn(o,``),n.flags&=-33),al(e,rl(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;il(e,rl(e),s);break;default:throw Error(i(161))}}catch(t){td(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Dl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Dl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ol(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)pl(e,t.alternate,t),t=t.sibling}function kl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Yc(4,t,t.return),kl(t);break;case 1:$c(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Zc(t,t.return,n),kl(t);break;case 27:Tf(t.stateNode);case 26:case 5:$c(t,t.return),kl(t);break;case 22:t.memoizedState===null&&kl(t);break;case 30:kl(t);break;default:kl(t)}e=e.sibling}}function Al(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Al(i,a,n),Jc(4,a);break;case 1:if(Al(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){td(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)ro(c[i],s)}catch(e){td(r,r.return,e)}}n&&o&64&&Xc(a),Qc(a,a.return);break;case 27:ol(a);case 26:case 5:Al(i,a,n),n&&r===null&&o&4&&el(a),Qc(a,a.return);break;case 12:Al(i,a,n);break;case 31:Al(i,a,n),n&&o&4&&yl(i,a);break;case 13:Al(i,a,n),n&&o&4&&bl(i,a);break;case 22:a.memoizedState===null&&Al(i,a,n),Qc(a,a.return);break;case 30:break;default:Al(i,a,n)}t=t.sibling}}function jl(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&&ya(n))}function Ml(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ya(e))}function Nl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Pl(e,t,n,r),t=t.sibling}function Pl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Nl(e,t,n,r),i&2048&&Jc(9,t);break;case 1:Nl(e,t,n,r);break;case 3:Nl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ya(e)));break;case 12:if(i&2048){Nl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){td(t,t.return,e)}}else Nl(e,t,n,r);break;case 31:Nl(e,t,n,r);break;case 13:Nl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Nl(e,t,n,r):(a._visibility|=2,Fl(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?Nl(e,t,n,r):Il(e,t),i&2048&&jl(o,t);break;case 24:Nl(e,t,n,r),i&2048&&Ml(t.alternate,t);break;default:Nl(e,t,n,r)}}function Fl(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:Fl(a,o,s,c,i),Jc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Fl(a,o,s,c,i)):u._visibility&2?Fl(a,o,s,c,i):Il(a,o),i&&l&2048&&jl(o.alternate,o);break;case 24:Fl(a,o,s,c,i),i&&l&2048&&Ml(o.alternate,o);break;default:Fl(a,o,s,c,i)}t=t.sibling}}function Il(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:Il(n,r),i&2048&&jl(r.alternate,r);break;case 24:Il(n,r),i&2048&&Ml(r.alternate,r);break;default:Il(n,r)}t=t.sibling}}var Ll=8192;function Rl(e,t,n){if(e.subtreeFlags&Ll)for(e=e.child;e!==null;)zl(e,t,n),e=e.sibling}function zl(e,t,n){switch(e.tag){case 26:Rl(e,t,n),e.flags&Ll&&e.memoizedState!==null&&rp(n,wl,e.memoizedState,e.memoizedProps);break;case 5:Rl(e,t,n);break;case 3:case 4:var r=wl;wl=Of(e.stateNode.containerInfo),Rl(e,t,n),wl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ll,Ll=16777216,Rl(e,t,n),Ll=r):Rl(e,t,n));break;default:Rl(e,t,n)}}function Bl(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 Vl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];dl=r,Wl(r,e)}Bl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Hl(e),e=e.sibling}function Hl(e){switch(e.tag){case 0:case 11:case 15:Vl(e),e.flags&2048&&Yc(9,e,e.return);break;case 3:Vl(e);break;case 12:Vl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ul(e)):Vl(e);break;default:Vl(e)}}function Ul(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];dl=r,Wl(r,e)}Bl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Yc(8,t,t.return),Ul(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ul(t));break;default:Ul(t)}e=e.sibling}}function Wl(e,t){for(;dl!==null;){var n=dl;switch(n.tag){case 0:case 11:case 15:Yc(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:ya(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,dl=r;else a:for(n=e;dl!==null;){r=dl;var i=r.sibling,a=r.return;if(ml(r),r===n){dl=null;break a}if(i!==null){i.return=a,dl=i;break a}dl=a}}}var Gl={getCacheForType:function(e){var t=da(_a),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return da(_a).controller.signal}},Kl=typeof WeakMap==`function`?WeakMap:Map,ql=0,Jl=null,R=null,z=0,Yl=0,Xl=null,Zl=!1,Ql=!1,$l=!1,eu=0,tu=0,nu=0,ru=0,iu=0,au=0,ou=0,su=null,cu=null,lu=!1,uu=0,B=0,du=1/0,fu=null,pu=null,mu=0,hu=null,gu=null,_u=0,vu=0,yu=null,bu=null,xu=0,Su=null;function Cu(){return ql&2&&z!==0?z&-z:E.T===null?mt():Sd()}function wu(){if(au===0){if(!(z&536870912)||Wi){var e=$e;$e<<=1,!($e&3932160)&&($e=262144),au=e}else au=536870912}return e=lo.current,e!==null&&(e.flags|=32),au}function Tu(e,t,n){(e===Jl&&(Yl===2||Yl===9)||e.cancelPendingCommit!==null)&&(Mu(e,0),ku(e,z,au,!1)),st(e,n),(!(ql&2)||e!==Jl)&&(e===Jl&&(!(ql&2)&&(ru|=n),tu===4&&ku(e,z,au,!1)),md(e))}function Eu(e,t,n){if(ql&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||rt(e,t),a=r?Bu(e,t):Ru(e,t,!0),o=r;do{if(a===0){Ql&&!r&&ku(e,t,0,!1);break}if(n=e.current.alternate,o&&!Ou(n)){a=Ru(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=su;var l=c.current.memoizedState.isDehydrated;if(l&&(Mu(c,s).flags|=256),s=Ru(c,s,!1),s!==2){if($l&&!l){c.errorRecoveryDisabledLanes|=o,ru|=o,a=4;break a}o=cu,cu=a,o!==null&&(cu===null?cu=o:cu.push.apply(cu,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Mu(e,0),ku(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)break;case 6:ku(r,t,au,!Zl);break a;case 2:cu=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=uu+300-Ie(),10<a)){if(ku(r,t,au,!Zl),nt(r,0,!0)!==0)break a;_u=t,r.timeoutHandle=af(Du.bind(null,r,n,cu,fu,lu,t,au,ru,ou,Zl,o,`Throttled`,-0,0),a);break a}Du(r,n,cu,fu,lu,t,au,ru,ou,Zl,o,null,-0,0)}break}while(1);md(e)}function Du(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:dn},zl(t,a,d);var m=(a&62914560)===a?uu-Ie():(a&4194048)===a?B-Ie():0;if(m=ap(d,m),m!==null){_u=a,e.cancelPendingCommit=m(qu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),ku(e,a,o,!l);return}}qu(e,t,a,n,r,i,o,s,c)}function Ou(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(!Mr(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 ku(e,t,n,r){t&=~iu,t&=~ru,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Je(i),o=1<<a;r[a]=-1,i&=~o}n!==0&<(e,n,t)}function Au(){return ql&6?!0:(hd(0,!1),!1)}function ju(){if(R!==null){if(Yl===0)var e=R.return;else e=R,ra=na=null,I(e),Va=null,Ha=0,e=R;for(;e!==null;)qc(e.alternate,e),e=e.return;R=null}}function Mu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,of(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),_u=0,ju(),Jl=e,R=n=yi(e.current,null),z=t,Yl=0,Xl=null,Zl=!1,Ql=rt(e,t),$l=!1,ou=au=iu=ru=nu=tu=0,cu=su=null,lu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Je(r),a=1<<i;t|=e[i],r&=~a}return eu=t,li(),n}function Nu(e,t){P=null,E.H=Ws,t===ja||t===Na?(t=za(),Yl=3):t===Ma?(t=za(),Yl=4):Yl=t===cc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Xl=t,R===null&&(tu=1,nc(e,Di(t,e.current)))}function Pu(){var e=lo.current;return e===null?!0:(z&4194048)===z?uo===null:(z&62914560)===z||z&536870912?e===uo:!1}function Fu(){var e=E.H;return E.H=Ws,e===null?Ws:e}function Iu(){var e=E.A;return E.A=Gl,e}function Lu(){tu=4,Zl||(z&4194048)!==z&&lo.current!==null||(Ql=!0),!(nu&134217727)&&!(ru&134217727)||Jl===null||ku(Jl,z,au,!1)}function Ru(e,t,n){var r=ql;ql|=2;var i=Fu(),a=Iu();(Jl!==e||z!==t)&&(fu=null,Mu(e,t)),t=!1;var o=tu;a:do try{if(Yl!==0&&R!==null){var s=R,c=Xl;switch(Yl){case 8:ju(),o=6;break a;case 3:case 2:case 9:case 6:lo.current===null&&(t=!0);var l=Yl;if(Yl=0,Xl=null,Wu(e,s,c,l),n&&Ql){o=0;break a}break;default:l=Yl,Yl=0,Xl=null,Wu(e,s,c,l)}}zu(),o=tu;break}catch(t){Nu(e,t)}while(1);return t&&e.shellSuspendCounter++,ra=na=null,ql=r,E.H=i,E.A=a,R===null&&(Jl=null,z=0,li()),o}function zu(){for(;R!==null;)Hu(R)}function Bu(e,t){var n=ql;ql|=2;var r=Fu(),a=Iu();Jl!==e||z!==t?(fu=null,du=Ie()+500,Mu(e,t)):Ql=rt(e,t);a:do try{if(Yl!==0&&R!==null){t=R;var o=Xl;b:switch(Yl){case 1:Yl=0,Xl=null,Wu(e,t,o,1);break;case 2:case 9:if(Fa(o)){Yl=0,Xl=null,Uu(t);break}t=function(){Yl!==2&&Yl!==9||Jl!==e||(Yl=7),md(e)},o.then(t,t);break a;case 3:Yl=7;break a;case 4:Yl=5;break a;case 7:Fa(o)?(Yl=0,Xl=null,Uu(t)):(Yl=0,Xl=null,Wu(e,t,o,7));break;case 5:var s=null;switch(R.tag){case 26:s=R.memoizedState;case 5:case 27:var c=R;if(s?np(s):c.stateNode.complete){Yl=0,Xl=null;var l=c.sibling;if(l!==null)R=l;else{var u=c.return;u===null?R=null:(R=u,Gu(u))}break b}}Yl=0,Xl=null,Wu(e,t,o,5);break;case 6:Yl=0,Xl=null,Wu(e,t,o,6);break;case 8:ju(),tu=6;break a;default:throw Error(i(462))}}Vu();break}catch(t){Nu(e,t)}while(1);return ra=na=null,E.H=r,E.A=a,ql=n,R===null?(Jl=null,z=0,li(),tu):0}function Vu(){for(;R!==null&&!Pe();)Hu(R)}function Hu(e){var t=Rc(e.alternate,e,eu);e.memoizedProps=e.pendingProps,t===null?Gu(e):R=t}function Uu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Sc(n,t,t.pendingProps,t.type,void 0,z);break;case 11:t=Sc(n,t,t.pendingProps,t.type.render,t.ref,z);break;case 5:I(t);default:qc(n,t),t=R=bi(t,eu),t=Rc(n,t,eu)}e.memoizedProps=e.pendingProps,t===null?Gu(e):R=t}function Wu(e,t,n,r){ra=na=null,I(t),Va=null,Ha=0;var i=t.return;try{if(sc(e,i,t,n,z)){tu=1,nc(e,Di(n,e.current)),R=null;return}}catch(t){if(i!==null)throw R=i,t;tu=1,nc(e,Di(n,e.current)),R=null;return}t.flags&32768?(Wi||r===1?e=!0:Ql||z&536870912?e=!1:(Zl=e=!0,(r===2||r===9||r===3||r===6)&&(r=lo.current,r!==null&&r.tag===13&&(r.flags|=16384))),Ku(t,e)):Gu(t)}function Gu(e){var t=e;do{if(t.flags&32768){Ku(t,Zl);return}e=t.return;var n=Gc(t.alternate,t,eu);if(n!==null){R=n;return}if(t=t.sibling,t!==null){R=t;return}R=t=e}while(t!==null);tu===0&&(tu=5)}function Ku(e,t){do{var n=Kc(e.alternate,e);if(n!==null){n.flags&=32767,R=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){R=e;return}R=e=n}while(e!==null);tu=6,R=null}function qu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Qu();while(mu!==0);if(ql&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=ci,ct(e,n,o,s,c,l),e===Jl&&(R=Jl=null,z=0),gu=t,hu=e,_u=n,vu=o,yu=a,bu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,sd(Be,function(){return $u(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=E.T,E.T=null,a=D.p,D.p=2,s=ql,ql|=4;try{fl(e,t,n)}finally{ql=s,D.p=a,E.T=r}}mu=1,Ju(),Yu(),Xu()}}function Ju(){if(mu===1){mu=0;var e=hu,t=gu,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=E.T,E.T=null;var r=D.p;D.p=2;var i=ql;ql|=4;try{Tl(t,e);var a=Zd,o=Ir(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Fr(s.ownerDocument.documentElement,s)){if(c!==null&&Lr(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 _=Pr(s,h),v=Pr(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}}yp=!!Xd,Zd=Xd=null}finally{ql=i,D.p=r,E.T=n}}e.current=t,mu=2}}function Yu(){if(mu===2){mu=0;var e=hu,t=gu,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=E.T,E.T=null;var r=D.p;D.p=2;var i=ql;ql|=4;try{pl(e,t.alternate,t)}finally{ql=i,D.p=r,E.T=n}}mu=3}}function Xu(){if(mu===4||mu===3){mu=0,Fe();var e=hu,t=gu,n=_u,r=bu;t.subtreeFlags&10256||t.flags&10256?mu=5:(mu=0,gu=hu=null,Zu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(pu=null),pt(n),t=t.stateNode,Ke&&typeof Ke.onCommitFiberRoot==`function`)try{Ke.onCommitFiberRoot(Ge,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=E.T,i=D.p,D.p=2,E.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{E.T=t,D.p=i}}_u&3&&Qu(),md(e),i=e.pendingLanes,n&261930&&i&42?e===Su?xu++:(xu=0,Su=e):xu=0,hd(0,!1)}}function Zu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ya(t)))}function Qu(){return Ju(),Yu(),Xu(),$u()}function $u(){if(mu!==5)return!1;var e=hu,t=vu;vu=0;var n=pt(_u),r=E.T,a=D.p;try{D.p=32>n?32:n,E.T=null,n=yu,yu=null;var o=hu,s=_u;if(mu=0,gu=hu=null,_u=0,ql&6)throw Error(i(331));var c=ql;if(ql|=4,Hl(o.current),Pl(o,o.current,s,n),ql=c,hd(0,!1),Ke&&typeof Ke.onPostCommitFiberRoot==`function`)try{Ke.onPostCommitFiberRoot(Ge,o)}catch{}return!0}finally{D.p=a,E.T=r,Zu(e,t)}}function ed(e,t,n){t=Di(n,t),t=ic(e.stateNode,t,2),e=Za(e,t,2),e!==null&&(st(e,2),md(e))}function td(e,t,n){if(e.tag===3)ed(e,e,n);else for(;t!==null;){if(t.tag===3){ed(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(pu===null||!pu.has(r))){e=Di(n,e),n=ac(2),r=Za(t,n,2),r!==null&&(oc(n,r,t,e),st(r,2),md(r));break}}t=t.return}}function nd(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Kl;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)||($l=!0,i.add(n),e=rd.bind(null,e,t,n),t.then(e,e))}function rd(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Jl===e&&(z&n)===n&&(tu===4||tu===3&&(z&62914560)===z&&300>Ie()-uu?!(ql&2)&&Mu(e,0):iu|=n,ou===z&&(ou=0)),md(e)}function id(e,t){t===0&&(t=at()),e=fi(e,t),e!==null&&(st(e,t),md(e))}function ad(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),id(e,n)}function od(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),id(e,n)}function sd(e,t){return Me(e,t)}var cd=null,ld=null,ud=!1,dd=!1,fd=!1,pd=0;function md(e){e!==ld&&e.next===null&&(ld===null?cd=ld=e:ld=ld.next=e),dd=!0,ud||(ud=!0,xd())}function hd(e,t){if(!fd&&dd){fd=!0;do for(var n=!1,r=cd;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-Je(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,bd(r,a))}else a=z,a=nt(r,r===Jl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||rt(r,a)||(n=!0,bd(r,a))}r=r.next}while(n);fd=!1}}function gd(){_d()}function _d(){dd=ud=!1;var e=0;pd!==0&&rf()&&(e=pd);for(var t=Ie(),n=null,r=cd;r!==null;){var i=r.next,a=vd(r,t);a===0?(r.next=null,n===null?cd=i:n.next=i,i===null&&(ld=n)):(n=r,(e!==0||a&3)&&(dd=!0)),r=i}mu!==0&&mu!==5||hd(e,!1),pd!==0&&(pd=0)}function vd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Je(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=it(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Jl,n=z,n=nt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Yl===2||Yl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ne(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||rt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ne(r),pt(n)){case 2:case 8:n=ze;break;case 32:n=Be;break;case 268435456:n=He;break;default:n=Be}return r=yd.bind(null,e),n=Me(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ne(r),e.callbackPriority=2,e.callbackNode=null,2}function yd(e,t){if(mu!==0&&mu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Qu()&&e.callbackNode!==n)return null;var r=z;return r=nt(e,e===Jl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Eu(e,r,t),vd(e,Ie()),e.callbackNode!=null&&e.callbackNode===n?yd.bind(null,e):null)}function bd(e,t){if(Qu())return null;Eu(e,t,!0)}function xd(){cf(function(){ql&6?Me(Re,gd):_d()})}function Sd(){if(pd===0){var e=A;e===0&&(e=Qe,Qe<<=1,!(Qe&261888)&&(Qe=256)),pd=e}return pd}function Cd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:un(``+e)}function wd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Td(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Cd((i[vt]||null).action),o=r.submitter;o&&(t=(t=o[vt]||null)?Cd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Mn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(pd!==0){var e=o?wd(i,o):new FormData(i);As(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?wd(i,o):new FormData(i),As(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Ed=0;Ed<ri.length;Ed++){var Dd=ri[Ed];ii(Dd.toLowerCase(),`on`+(Dd[0].toUpperCase()+Dd.slice(1)))}ii(Yr,`onAnimationEnd`),ii(Xr,`onAnimationIteration`),ii(Zr,`onAnimationStart`),ii(`dblclick`,`onDoubleClick`),ii(`focusin`,`onFocus`),ii(`focusout`,`onBlur`),ii(Qr,`onTransitionRun`),ii($r,`onTransitionStart`),ii(ei,`onTransitionCancel`),ii(ti,`onTransitionEnd`),Pt(`onMouseEnter`,[`mouseout`,`mouseover`]),Pt(`onMouseLeave`,[`mouseout`,`mouseover`]),Pt(`onPointerEnter`,[`pointerout`,`pointerover`]),Pt(`onPointerLeave`,[`pointerout`,`pointerover`]),Nt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Nt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Nt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Nt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Nt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Nt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Od=`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(` `),kd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Od));function Ad(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){ai(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){ai(e)}i.currentTarget=null,a=c}}}}function V(e,t){var n=t[bt];n===void 0&&(n=t[bt]=new Set);var r=e+`__bubble`;n.has(r)||(Pd(t,e,2,!1),n.add(r))}function jd(e,t,n){var r=0;t&&(r|=4),Pd(n,e,r,t)}var Md=`_reactListening`+Math.random().toString(36).slice(2);function Nd(e){if(!e[Md]){e[Md]=!0,jt.forEach(function(t){t!==`selectionchange`&&(kd.has(t)||jd(t,!1,e),jd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Md]||(t[Md]=!0,jd(`selectionchange`,!1,t))}}function Pd(e,t,n,r){switch(Ep(t)){case 2:var i=bp;break;case 8:i=xp;break;default:i=Sp}n=i.bind(null,t,n,e),i=void 0,!xn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Fd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var c=r.stateNode.containerInfo;if(c===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;c!==null;){if(o=Et(c),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue a}c=c.parentNode}}r=r.return}vn(function(){var r=a,i=pn(n),o=[];a:{var c=ni.get(e);if(c!==void 0){var l=Mn,u=e;switch(e){case`keypress`:if(Dn(n)===0)break a;case`keydown`:case`keyup`:l=Yn;break;case`focusin`:u=`focus`,l=Vn;break;case`focusout`:u=`blur`,l=Vn;break;case`beforeblur`:case`afterblur`:l=Vn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=zn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Bn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Zn;break;case Yr:case Xr:case Zr:l=Hn;break;case ti:l=Qn;break;case`scroll`:case`scrollend`:l=Pn;break;case`wheel`:l=$n;break;case`copy`:case`cut`:case`paste`:l=Un;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Xn;break;case`toggle`:case`beforetoggle`:l=er}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=yn(m,p),g!=null&&d.push(Id(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),o.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==fn&&(u=n.relatedTarget||n.fromElement)&&(Et(u)||u[yt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?Et(u):null,u!==null&&(f=s(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=zn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Xn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:Ot(l),h=u==null?c:Ot(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,Et(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Rd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&zd(o,c,l,d,!1),u!==null&&f!==null&&zd(o,f,u,d,!0)}}a:{if(c=r?Ot(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=br;else if(mr(c)){if(xr)v=Ar;else{v=Or;var y=Dr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&sn(r.elementType)&&(v=br):v=kr;if(v&&=v(e,r)){hr(o,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Qt(c,`number`,c.value)}switch(y=r?Ot(r):window,e){case`focusin`:(mr(y)||y.contentEditable===`true`)&&(zr=y,Br=r,Vr=null);break;case`focusout`:Vr=Br=zr=null;break;case`mousedown`:Hr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Hr=!1,Ur(o,n,i);break;case`selectionchange`:if(Rr)break;case`keydown`:case`keyup`:Ur(o,n,i)}var b;if(nr)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else ur?cr(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(ar&&n.locale!==`ko`&&(ur||x!==`onCompositionStart`?x===`onCompositionEnd`&&ur&&(b=En()):(Cn=i,wn=`value`in Cn?Cn.value:Cn.textContent,ur=!0)),y=Ld(r,x),0<y.length&&(x=new Wn(x,e,null,n,i),o.push({event:x,listeners:y}),b?x.data=b:(b=lr(n),b!==null&&(x.data=b)))),(b=ir?dr(e,n):fr(e,n))&&(x=Ld(r,`onBeforeInput`),0<x.length&&(y=new Wn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:y,listeners:x}),y.data=b)),Td(o,e,r,n,i)}Ad(o,t)})}function Id(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ld(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=yn(e,n),i!=null&&r.unshift(Id(e,i,a)),i=yn(e,t),i!=null&&r.push(Id(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Rd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function zd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=yn(n,a),l!=null&&o.unshift(Id(n,l,c))):i||(l=yn(n,a),l!=null&&o.push(Id(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Bd=/\r\n?/g,Vd=/\u0000|\uFFFD/g;function Hd(e){return(typeof e==`string`?e:``+e).replace(Bd,`
|
|
16
|
-
`).replace(Vd,``)}function Ud(e,t){return t=Hd(t),Hd(e)===t}function Wd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||nn(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&nn(e,``+r);break;case`className`:Bt(e,`class`,r);break;case`tabIndex`:Bt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Bt(e,n,r);break;case`style`:on(e,r,o);break;case`data`:if(t!==`object`){Bt(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=un(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Wd(e,t,`name`,a.name,a,null),Wd(e,t,`formEncType`,a.formEncType,a,null),Wd(e,t,`formMethod`,a.formMethod,a,null),Wd(e,t,`formTarget`,a.formTarget,a,null)):(Wd(e,t,`encType`,a.encType,a,null),Wd(e,t,`method`,a.method,a,null),Wd(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=un(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=dn);break;case`onScroll`:r!=null&&V(`scroll`,e);break;case`onScrollEnd`:r!=null&&V(`scrollend`,e);break;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));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=un(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`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`:V(`beforetoggle`,e),V(`toggle`,e),zt(e,`popover`,r);break;case`xlinkActuate`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Vt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Vt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:zt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=cn.get(n)||n,zt(e,n,r))}}function Gd(e,t,n,r,a,o){switch(n){case`style`:on(e,r,o);break;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));e.innerHTML=n}}break;case`children`:typeof r==`string`?nn(e,r):(typeof r==`number`||typeof r==`bigint`)&&nn(e,``+r);break;case`onScroll`:r!=null&&V(`scroll`,e);break;case`onScrollEnd`:r!=null&&V(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=dn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Mt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[vt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):zt(e,n,r)}}}function Kd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:V(`error`,e),V(`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:Wd(e,t,o,s,n,null)}}a&&Wd(e,t,`srcSet`,n.srcSet,n,null),r&&Wd(e,t,`src`,n.src,n,null);return;case`input`:V(`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:Wd(e,t,r,d,n,null)}}Zt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in V(`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:Wd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&$t(e,!!r,n,!0):$t(e,!!r,t,!1);return;case`textarea`:for(s in V(`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:Wd(e,t,s,c,n,null)}tn(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:Wd(e,t,l,r,n,null)}return;case`dialog`:V(`beforetoggle`,e),V(`toggle`,e),V(`cancel`,e),V(`close`,e);break;case`iframe`:case`object`:V(`load`,e);break;case`video`:case`audio`:for(r=0;r<Od.length;r++)V(Od[r],e);break;case`image`:V(`error`,e),V(`load`,e);break;case`details`:V(`toggle`,e);break;case`embed`:case`source`:case`link`:V(`error`,e),V(`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:Wd(e,t,u,r,n,null)}return;default:if(sn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Gd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Wd(e,t,c,r,n,null))}function qd(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)||Wd(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`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Wd(e,t,p,m,r,f)}}Xt(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)||Wd(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`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Wd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?$t(e,!!n,n?[]:``,!1):$t(e,!!n,t,!0)):$t(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Wd(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`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Wd(e,t,s,a,r,o)}en(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Wd(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`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Wd(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)&&Wd(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:Wd(e,t,u,p,r,m)}return;default:if(sn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Gd(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||Gd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Wd(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||Wd(e,t,f,p,r,m)}function Jd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Yd(){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&&Jd(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&&Jd(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 Xd=null,Zd=null;function Qd(e){return e.nodeType===9?e:e.ownerDocument}function $d(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 ef(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 tf(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 nf=null;function rf(){var e=window.event;return e&&e.type===`popstate`?e!==nf&&(nf=e,!0):(nf=null,!1)}var af=typeof setTimeout==`function`?setTimeout:void 0,of=typeof clearTimeout==`function`?clearTimeout:void 0,sf=typeof Promise==`function`?Promise:void 0,cf=typeof queueMicrotask==`function`?queueMicrotask:sf===void 0?af:function(e){return sf.resolve(null).then(e).catch(lf)};function lf(e){setTimeout(function(){throw e})}function uf(e){return e===`head`}function df(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),Gp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Tf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Tf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[wt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Tf(e.ownerDocument.body)}n=i}while(n);Gp(t)}function ff(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 pf(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`:pf(n),Tt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function mf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[wt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=bf(e.nextSibling),e===null)break}return null}function hf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=bf(e.nextSibling),e===null))return null;return e}function gf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=bf(e.nextSibling),e===null))return null;return e}function _f(e){return e.data===`$?`||e.data===`$~`}function vf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function yf(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 bf(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 xf=null;function Sf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return bf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Cf(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 wf(e,t,n){switch(t=Qd(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 Tf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Tt(e)}var Ef=new Map,Df=new Set;function Of(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var kf=D.d;D.d={f:Af,r:jf,D:Pf,C:Ff,L:If,m:Lf,X:zf,S:Rf,M:Bf};function Af(){var e=kf.f(),t=Au();return e||t}function jf(e){var t=Dt(e);t!==null&&t.tag===5&&t.type===`form`?Ms(t):kf.r(e)}var Mf=typeof document>`u`?null:document;function Nf(e,t,n){var r=Mf;if(r&&typeof t==`string`&&t){var i=Yt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Df.has(i)||(Df.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Kd(t,`link`,e),At(t),r.head.appendChild(t)))}}function Pf(e){kf.D(e),Nf(`dns-prefetch`,e,null)}function Ff(e,t){kf.C(e,t),Nf(`preconnect`,e,t)}function If(e,t,n){kf.L(e,t,n);var r=Mf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Yt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Yt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Yt(n.imageSizes)+`"]`)):i+=`[href="`+Yt(e)+`"]`;var a=i;switch(t){case`style`:a=Hf(e);break;case`script`:a=Kf(e)}Ef.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Ef.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Uf(a))||t===`script`&&r.querySelector(qf(a))||(t=r.createElement(`link`),Kd(t,`link`,e),At(t),r.head.appendChild(t)))}}function Lf(e,t){kf.m(e,t);var n=Mf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Yt(r)+`"][href="`+Yt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Kf(e)}if(!Ef.has(a)&&(e=h({rel:`modulepreload`,href:e},t),Ef.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(qf(a)))return}r=n.createElement(`link`),Kd(r,`link`,e),At(r),n.head.appendChild(r)}}}function Rf(e,t,n){kf.S(e,t,n);var r=Mf;if(r&&e){var i=kt(r).hoistableStyles,a=Hf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Uf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Ef.get(a))&&Xf(e,n);var c=o=r.createElement(`link`);At(c),Kd(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,Yf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function zf(e,t){kf.X(e,t);var n=Mf;if(n&&e){var r=kt(n).hoistableScripts,i=Kf(e),a=r.get(i);a||(a=n.querySelector(qf(i)),a||(e=h({src:e,async:!0},t),(t=Ef.get(i))&&Zf(e,t),a=n.createElement(`script`),At(a),Kd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Bf(e,t){kf.M(e,t);var n=Mf;if(n&&e){var r=kt(n).hoistableScripts,i=Kf(e),a=r.get(i);a||(a=n.querySelector(qf(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=Ef.get(i))&&Zf(e,t),a=n.createElement(`script`),At(a),Kd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Vf(e,t,n,r){var a=(a=ve.current)?Of(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`?(t=Hf(n.href),n=kt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,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=Hf(n.href);var o=kt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Uf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Ef.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Ef.set(e,n),o||Gf(a,e,n,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`?(t=Kf(n),n=kt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Hf(e){return`href="`+Yt(e)+`"`}function Uf(e){return`link[rel="stylesheet"][`+e+`]`}function Wf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Gf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Kd(t,`link`,n),At(t),e.head.appendChild(t))}function Kf(e){return`[src="`+Yt(e)+`"]`}function qf(e){return`script[async]`+e}function Jf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Yt(n.href)+`"]`);if(r)return t.instance=r,At(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),At(r),Kd(r,`style`,a),Yf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Hf(n.href);var o=e.querySelector(Uf(a));if(o)return t.state.loading|=4,t.instance=o,At(o),o;r=Wf(n),(a=Ef.get(a))&&Xf(r,a),o=(e.ownerDocument||e).createElement(`link`),At(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Kd(o,`link`,r),t.state.loading|=4,Yf(o,n.precedence,e),t.instance=o;case`script`:return o=Kf(n.src),(a=e.querySelector(qf(o)))?(t.instance=a,At(a),a):(r=n,(a=Ef.get(o))&&(r=h({},n),Zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),At(a),Kd(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,Yf(r,n.precedence,e));return t.instance}function Yf(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 Xf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Qf=null;function $f(e,t,n){if(Qf===null){var r=new Map,i=Qf=new Map;i.set(n,r)}else i=Qf,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[wt]||a[_t]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function ep(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function tp(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 np(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function rp(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=Hf(r.href),a=t.querySelector(Uf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=op.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,At(a);return}a=t.ownerDocument||t,r=Wf(r),(i=Ef.get(i))&&Xf(r,i),a=a.createElement(`link`),At(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Kd(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=op.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ip=0;function ap(e,t){return e.stylesheets&&e.count===0&&cp(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&cp(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ip===0&&(ip=62500*Yd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&cp(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ip?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function op(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)cp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var sp=null;function cp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,sp=new Map,t.forEach(lp,e),sp=null,op.call(e))}function lp(e,t){if(!(t.state.loading&4)){var n=sp.get(e);if(n)var r=n.get(null);else{n=new Map,sp.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=op.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 up={$$typeof:C,Provider:null,Consumer:null,_currentValue:ue,_currentValue2:ue,_threadCount:0};function dp(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ot(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ot(0),this.hiddenUpdates=ot(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function fp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new dp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=_i(3,null,null,t),e.current=a,a.stateNode=e,t=va(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ja(a),e}function pp(e){return e?(e=hi,e):hi}function mp(e,t,n,r,i,a){i=pp(i),r.context===null?r.context=i:r.pendingContext=i,r=Xa(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Za(e,r,t),n!==null&&(Tu(n,e,t),Qa(n,e,t))}function hp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function gp(e,t){hp(e,t),(e=e.alternate)&&hp(e,t)}function _p(e){if(e.tag===13||e.tag===31){var t=fi(e,67108864);t!==null&&Tu(t,e,67108864),gp(e,67108864)}}function vp(e){if(e.tag===13||e.tag===31){var t=Cu();t=ft(t);var n=fi(e,t);n!==null&&Tu(n,e,t),gp(e,t)}}var yp=!0;function bp(e,t,n,r){var i=E.T;E.T=null;var a=D.p;try{D.p=2,Sp(e,t,n,r)}finally{D.p=a,E.T=i}}function xp(e,t,n,r){var i=E.T;E.T=null;var a=D.p;try{D.p=8,Sp(e,t,n,r)}finally{D.p=a,E.T=i}}function Sp(e,t,n,r){if(yp){var i=Cp(r);if(i===null)Fd(e,t,r,wp,n),Fp(e,r);else if(Lp(i,e,t,n,r))r.stopPropagation();else if(Fp(e,r),t&4&&-1<Pp.indexOf(e)){for(;i!==null;){var a=Dt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=tt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Je(o);s.entanglements[1]|=c,o&=~c}md(a),!(ql&6)&&(du=Ie()+500,hd(0,!1))}}break;case 31:case 13:s=fi(a,2),s!==null&&Tu(s,a,2),Au(),gp(a,2)}if(a=Cp(r),a===null&&Fd(e,t,r,wp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Fd(e,t,r,null,n)}}function Cp(e){return e=pn(e),Tp(e)}var wp=null;function Tp(e){if(wp=null,e=Et(e),e!==null){var t=s(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=l(t),e!==null)return e;e=null}else if(n===31){if(e=d(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return wp=e,null}function Ep(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`resize`: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`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`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Le()){case Re:return 2;case ze:return 8;case Be:case Ve:return 32;case He:return 268435456;default:return 32}default:return 32}}var Dp=!1,Op=null,kp=null,Ap=null,jp=new Map,Mp=new Map,Np=[],Pp=`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 Fp(e,t){switch(e){case`focusin`:case`focusout`:Op=null;break;case`dragenter`:case`dragleave`:kp=null;break;case`mouseover`:case`mouseout`:Ap=null;break;case`pointerover`:case`pointerout`:jp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Mp.delete(t.pointerId)}}function Ip(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Dt(t),t!==null&&_p(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Lp(e,t,n,r,i){switch(t){case`focusin`:return Op=Ip(Op,e,t,n,r,i),!0;case`dragenter`:return kp=Ip(kp,e,t,n,r,i),!0;case`mouseover`:return Ap=Ip(Ap,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return jp.set(a,Ip(jp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Mp.set(a,Ip(Mp.get(a)||null,e,t,n,r,i)),!0}return!1}function Rp(e){var t=Et(e.target);if(t!==null){var n=s(t);if(n!==null){if(t=n.tag,t===13){if(t=l(n),t!==null){e.blockedOn=t,ht(e.priority,function(){vp(n)});return}}else if(t===31){if(t=d(n),t!==null){e.blockedOn=t,ht(e.priority,function(){vp(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 zp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Cp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);fn=r,n.target.dispatchEvent(r),fn=null}else return t=Dt(n),t!==null&&_p(t),e.blockedOn=n,!1;t.shift()}return!0}function Bp(e,t,n){zp(e)&&n.delete(t)}function Vp(){Dp=!1,Op!==null&&zp(Op)&&(Op=null),kp!==null&&zp(kp)&&(kp=null),Ap!==null&&zp(Ap)&&(Ap=null),jp.forEach(Bp),Mp.forEach(Bp)}function Hp(e,n){e.blockedOn===n&&(e.blockedOn=null,Dp||(Dp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Vp)))}var Up=null;function Wp(e){Up!==e&&(Up=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Up===e&&(Up=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(Tp(r||n)===null)continue;break}var a=Dt(n);a!==null&&(e.splice(t,3),t-=3,As(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Gp(e){function t(t){return Hp(t,e)}Op!==null&&Hp(Op,e),kp!==null&&Hp(kp,e),Ap!==null&&Hp(Ap,e),jp.forEach(t),Mp.forEach(t);for(var n=0;n<Np.length;n++){var r=Np[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Np.length&&(n=Np[0],n.blockedOn===null);)Rp(n),n.blockedOn===null&&Np.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[vt]||null;if(typeof a==`function`)o||Wp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[vt]||null)s=o.formAction;else if(Tp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Wp(n)}}}function Kp(){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 qp(e){this._internalRoot=e}Jp.prototype.render=qp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;mp(n,Cu(),e,t,null,null)},Jp.prototype.unmount=qp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;mp(e.current,2,null,e,null,null),Au(),t[yt]=null}};function Jp(e){this._internalRoot=e}Jp.prototype.unstable_scheduleHydration=function(e){if(e){var t=mt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Np.length&&t!==0&&t<Np[n].priority;n++);Np.splice(n,0,e),n===0&&Rp(e)}};var Yp=n.version;if(Yp!==`19.2.8`)throw Error(i(527,Yp,`19.2.8`));D.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=p(t),e=e===null?null:m(e),e=e===null?null:e.stateNode,e};var Xp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:E,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zp.isDisabled&&Zp.supportsFiber)try{Ge=Zp.inject(Xp),Ke=Zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=$s,s=ec,c=tc;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=fp(e,1,!1,null,null,n,r,null,o,s,c,Kp),e[yt]=t.current,Nd(e),new qp(t)}})),f=n(((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=d()})),p=globalThis.Buffer,m=p!=null&&typeof p.from==`function`,h=new Int8Array(256).fill(-1);for(let e=0;e<10;e++)h[48+e]=e;for(let e=0;e<6;e++)h[65+e]=10+e,h[97+e]=10+e;var g=class e{static zeros=`.0.00.000.0000.00000.000000.0000000.00000000.000000000.0000000000.00000000000.000000000000.0000000000000.00000000000000.000000000000000.0000000000000000.00000000000000000.000000000000000000.0000000000000000000.00000000000000000000.000000000000000000000.0000000000000000000000.00000000000000000000000.000000000000000000000000.0000000000000000000000000`.split(`.`);static groupSizes=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5];static groupBases=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];static wordSize=26;static WORD_SIZE_BIGINT=BigInt(e.wordSize);static WORD_MASK=(1n<<e.WORD_SIZE_BIGINT)-1n;static MAX_SAFE_INTEGER_BIGINT=BigInt(2**53-1);static MIN_SAFE_INTEGER_BIGINT=BigInt(-(2**53-1));static MAX_IMULN_ARG=67108863;static MAX_NUMBER_CONSTRUCTOR_MAG_BIGINT=(1n<<53n)-1n;static MAX_NOMINAL_WORD_LENGTH=1048576;_magnitude=0n;_sign=0;_nominalWordLength=1;red=null;get negative(){return this._sign}set negative(e){this.assert(e===0||e===1,`Negative property must be 0 or 1`);let t=+(e===1);this._sign=this._magnitude===0n?0:t}get _computedWordsArray(){if(this._magnitude===0n)return[0];let t=[],n=this._magnitude;for(;n>0n;)t.push(Number(n&e.WORD_MASK)),n>>=e.WORD_SIZE_BIGINT;return t.length>0?t:[0]}get words(){if(!Number.isSafeInteger(this._nominalWordLength)||this._nominalWordLength<1||this._nominalWordLength>e.MAX_NOMINAL_WORD_LENGTH)throw Error(`BigNumber word length exceeds the supported limit`);let t=this._computedWordsArray;if(this._nominalWordLength<=t.length)return t;let n=Array.from({length:this._nominalWordLength}).fill(0);for(let e=0;e<t.length;e++)n[e]=t[e];return n}set words(t){let n=this._sign,r=0n,i=t.length>0?t.length:1;for(let n=i-1;n>=0;n--){let i=t[n]??0;r=r<<e.WORD_SIZE_BIGINT|BigInt(i&Number(e.WORD_MASK))}this._magnitude=r,this._sign=n,this._nominalWordLength=i,this.normSign()}get length(){return Math.max(1,this._nominalWordLength)}static isBN(t){return t instanceof e||typeof t==`object`&&!!t&&t.constructor?.wordSize===e.wordSize&&Array.isArray(t.words)}static max(e,t){return e.cmp(t)>0?e:t}static min(e,t){return e.cmp(t)<0?e:t}constructor(e=0,t=10,n=`be`){if(e??=0,typeof e==`bigint`){this._initializeState(e<0n?-e:e,+(e<0n)),this.normSign();return}let r=t===`le`||t===`be`,i=r?10:t,a=r?t:n;if(typeof e==`number`){this.initNumber(e,a);return}if(Array.isArray(e)){this.initArray(e,a);return}if(typeof e==`string`){this._initFromString(e,i,a);return}e===0?this._initializeState(0n,0):this.assert(!1,`Unsupported input type for BigNumber constructor`)}_initFromString(e,t,n){t===`hex`&&(t=16),this.assert(typeof t==`number`&&t===Math.trunc(t)&&t>=2&&t<=36,`Base must be an integer between 2 and 36`);let r=e.toString().replace(/\s+/g,``),i=0,a=0;r.startsWith(`-`)?(i++,a=1):r.startsWith(`+`)&&i++;let o=r.substring(i);if(o.length===0){this._initializeState(0n,a===1&&r.startsWith(`-`)?1:0),this.normSign();return}t===16?this._initFromHexString(o,a,n):this._initFromNonHexString(o,t,a,n)}_initFromHexString(e,t,n){if(n===`le`){let n=[],r=e;r.length%2!=0&&(r=`0`+r);for(let e=0;e<r.length;e+=2){let t=r.substring(e,e+2),i=Number.parseInt(t,16);if(Number.isNaN(i))throw Error(`Invalid character in `+r);n.push(i)}this.initArray(n,`le`),this._sign=t,this.normSign()}else{let n;try{n=BigInt(`0x`+e)}catch{throw Error(`Invalid character in `+e)}this._initializeState(n,t),this.normSign()}}_initFromNonHexString(e,t,n,r){try{if(this._parseBaseString(e,t),this._sign=n,this.normSign(),r===`le`){let e=this._sign;this.initArray(this.toArray(`be`),`le`),this._sign=e,this.normSign()}}catch(e){let t=e;throw t.message.includes(`Invalid character in string`)||t.message.includes(`Invalid digit for base`)||t.message.startsWith(`Invalid character:`)?Error(`Invalid character`):t}}_bigIntToStringInBase(e,t){if(e===0n)return`0`;if(t<2||t>36)throw Error(`Base must be between 2 and 36`);let n=``,r=e>0n?e:-e,i=BigInt(t);for(;r>0n;)n=`0123456789abcdefghijklmnopqrstuvwxyz`[Number(r%i)]+n,r/=i;return n}_parseBaseString(t,n){this._magnitude=0n;let r=BigInt(n),i=e.groupSizes[n],a=BigInt(e.groupBases[n]);(i===0||a===0n)&&(i=Math.floor(Math.log(67108863)/Math.log(n)),i===0&&(i=1),a=r**BigInt(i));let o=0,s=t.length,c=s%i;if(c===0&&s>0&&(c=i),c>0){let e=t.substring(o,o+c);this._magnitude=BigInt(this._parseBaseWord(e,n)),o+=c}for(;o<s;){let e=t.substring(o,o+i),r=BigInt(this._parseBaseWord(e,n));this._magnitude=this._magnitude*a+r,o+=i}this._finishInitialization()}_parseBaseWord(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e.codePointAt(r),a;if(i>=48&&i<=57)a=i-48;else if(i>=65&&i<=90)a=i-65+10;else if(i>=97&&i<=122)a=i-97+10;else throw Error(`Invalid character: `+e[r]);if(a>=t)throw Error(`Invalid character`);n=n*t+a}return n}_initializeState(e,t){this._magnitude=e,this._sign=e===0n?0:t,this._finishInitialization()}_finishInitialization(){if(this._magnitude===0n)this._nominalWordLength=1,this._sign=0;else{let t=this._magnitude.toString(2).length;this._nominalWordLength=Math.max(1,Math.ceil(t/e.wordSize))}}assert(e,t=`Assertion failed`){if(!e)throw Error(t)}initNumber(t,n=`be`){if(this.assert(BigInt(Math.abs(t))<=e.MAX_NUMBER_CONSTRUCTOR_MAG_BIGINT,`The number is larger than 2 ^ 53 (unsafe)`),this.assert(t%1==0,`Number must be an integer for BigNumber conversion`),this._initializeState(BigInt(Math.abs(t)),+(t<0)),n===`le`){let e=this._sign,t=this.toArray(`be`);this.initArray(t,`le`),this._sign=e,this.normSign()}return this}initArray(e,t){if(e.length===0)return this._initializeState(0n,0),this;let n=0n;if(t===`be`)for(let t of e)n=n<<8n|BigInt(t&255);else for(let t=e.length-1;t>=0;t--)n=n<<8n|BigInt(e[t]&255);return this._initializeState(n,0),this}copy(e){e._magnitude=this._magnitude,e._sign=this._sign,e._nominalWordLength=this._nominalWordLength,e.red=this.red}static move(e,t){e._magnitude=t._magnitude,e._sign=t._sign,e._nominalWordLength=t._nominalWordLength,e.red=t.red}clone(){let t=new e(0n);return this.copy(t),t}expand(t){return this.assert(Number.isSafeInteger(t)&&t>=0&&t<=e.MAX_NOMINAL_WORD_LENGTH,`Expand size must be a non-negative safe integer within the supported word limit`),this._nominalWordLength=Math.max(this._nominalWordLength,t,1),this}strip(){return this._finishInitialization(),this.normSign()}normSign(){return this._magnitude===0n&&(this._sign=0),this}inspect(){return(this.red===null?`<BN: `:`<BN-R: `)+this.toString(16)+`>`}_getMinimalHex(){return this._magnitude===0n?`0`:this._magnitude.toString(16)}_toHexString(e){let t=this._getMinimalHex();if(e>1)for(t!==`0`&&t.length%2!=0&&(t=`0`+t);t.length%e!==0;)t=`0`+t;return(this.isNeg()?`-`:``)+t}toString(e=10,t=1){if(e===16||e===`hex`)return this._toHexString(t);if(typeof e!=`number`||e<2||e>36||e%1!=0)throw Error(`Base should be an integer between 2 and 36`);return this.toBaseString(e,t)}toBaseString(t,n){if(this._magnitude===0n)return e._paddedZero(n);let r=e.groupSizes[t],i=BigInt(e.groupBases[t]);(r===0||i===0n)&&(r=Math.floor(Math.log(2**53-1)/Math.log(t)),r===0&&(r=1),i=BigInt(t)**BigInt(r));let a=``,o=this._magnitude;for(;o>0n;){let e=o%i;o/=i;let n=this._bigIntToStringInBase(e,t);a=(o>0n?this._zeroPaddedChunk(n,r):n)+a}if(n>0)for(;a.length<n;)a=`0`+a;return(this._sign===1?`-`:``)+a}static _paddedZero(e){let t=`0`;if(e>1)for(;t.length<e;)t=`0`+t;return t}_zeroPaddedChunk(t,n){let r=n-t.length;return r<=0?t:r<e.zeros.length?e.zeros[r]+t:`0`.repeat(r)+t}toNumber(){let t=this._getSignedValue();if(t>e.MAX_SAFE_INTEGER_BIGINT||t<e.MIN_SAFE_INTEGER_BIGINT)throw Error(`Number can only safely store up to 53 bits`);return Number(t)}toBigInt(){return this._getSignedValue()}toJSON(){let e=this._getMinimalHex();return(this.isNeg()?`-`:``)+e}toArrayLikeGeneric(e,t){let n=this._magnitude,r=t?0:e.length-1,i=t?1:-1;for(let t of e){if(n===0n&&r>=0&&r<e.length)e[r]=0;else if(r>=0&&r<e.length)e[r]=Number(n&255n);else break;n>>=8n,r+=i}}toArray(e=`be`,t){this.strip();let n=this.byteLength(),r=t??Math.max(1,n);this.assert(n<=r,`byte array longer than desired length`),this.assert(r>0,`Requested array length <= 0`);let i=Array.from({length:r}).fill(0);return this._magnitude===0n&&r>0?i:this._magnitude===0n&&r===0?[]:(this.toArrayLikeGeneric(i,e===`le`),i)}bitLength(){return this._magnitude===0n?0:this._magnitude.toString(2).length}static toBitArray(e){let t=e.bitLength();if(t===0)return[];let n=Array.from({length:t}),r=e._magnitude;for(let e=0;e<t;e++)n[e]=(r>>BigInt(e)&1n)==0n?0:1;return n}toBitArray(){return e.toBitArray(this)}zeroBits(){if(this._magnitude===0n)return 0;let e=0,t=this._magnitude;for(;(t&1n)==0n&&t!==0n;)e++,t>>=1n;return e}byteLength(){return this._magnitude===0n?0:Math.ceil(this.bitLength()/8)}_getSignedValue(){return this._sign===1?-this._magnitude:this._magnitude}_setValueFromSigned(e){e<0n?(this._magnitude=-e,this._sign=1):(this._magnitude=e,this._sign=0),this._finishInitialization(),this.normSign()}toTwos(t){this.assert(t>=0);let n=BigInt(t),r=this._getSignedValue();this._sign===1&&this._magnitude!==0n&&(r=(1n<<n)+r);let i=(1n<<n)-1n;r&=i;let a=new e(0n);return a._initializeState(r,0),a}fromTwos(t){this.assert(t>=0);let n=BigInt(t),r=this._magnitude;if(t>0&&(r>>n-1n&1n)!=0n&&this._sign===0){let t=r-(1n<<n),i=new e(0n);return i._setValueFromSigned(t),i}return this.clone()}isNeg(){return this._sign===1&&this._magnitude!==0n}neg(){return this.clone().ineg()}ineg(){return this._magnitude!==0n&&(this._sign=this._sign===1?0:1),this}_iuop(e,t,n=!1){let r=t(this._magnitude,e._magnitude),i=this._nominalWordLength;return n&&(i=Math.max(this.length,e.length)),this._magnitude=r,this._finishInitialization(),n&&(this._nominalWordLength=Math.max(this._nominalWordLength,i)),this.strip()}iuor(e){return this._iuop(e,(e,t)=>e|t)}iuand(e){return this._iuop(e,(e,t)=>e&t)}iuxor(e){return this._iuop(e,(e,t)=>e^t,!0)}_iop(e,t,n=!1){return this.assert(this._sign===0&&e._sign===0),this._iuop(e,t,n)}ior(e){return this._iop(e,(e,t)=>e|t)}iand(e){return this._iop(e,(e,t)=>e&t)}ixor(e){return this._iop(e,(e,t)=>e^t,!0)}_uop_new(e,t){return this.length>=e.length?this.clone()[t](e):e.clone()[t](this)}or(e){return this.assert(this._sign===0&&e._sign===0),this._uop_new(e,`iuor`)}uor(e){return this._uop_new(e,`iuor`)}and(e){return this.assert(this._sign===0&&e._sign===0),this._uop_new(e,`iuand`)}uand(e){return this._uop_new(e,`iuand`)}xor(e){return this.assert(this._sign===0&&e._sign===0),this._uop_new(e,`iuxor`)}uxor(e){return this._uop_new(e,`iuxor`)}inotn(t){this.assert(typeof t==`number`&&t>=0);let n=(1n<<BigInt(t))-1n;this._magnitude=~this._magnitude&n;let r=t===0?1:Math.ceil(t/e.wordSize);return this._nominalWordLength=Math.max(1,r),this.strip(),this._nominalWordLength=Math.max(this._nominalWordLength,Math.max(1,r)),this}notn(e){return this.clone().inotn(e)}setn(t,n){this.assert(typeof t==`number`&&t>=0);let r=BigInt(t);n===1||n===!0?this._magnitude|=1n<<r:this._magnitude&=~(1n<<r);let i=Math.floor(t/e.wordSize)+1;return this._nominalWordLength=Math.max(this._nominalWordLength,i),this._finishInitialization(),this.strip()}iadd(e){return this._setValueFromSigned(this._getSignedValue()+e._getSignedValue()),this}add(t){let n=new e(0n);return n._setValueFromSigned(this._getSignedValue()+t._getSignedValue()),n}isub(e){return this._setValueFromSigned(this._getSignedValue()-e._getSignedValue()),this}sub(t){let n=new e(0n);return n._setValueFromSigned(this._getSignedValue()-t._getSignedValue()),n}mul(t){let n=new e(0n);return n._magnitude=this._magnitude*t._magnitude,n._sign=n._magnitude===0n?0:this._sign^t._sign,n._nominalWordLength=this.length+t.length,n.red=null,n.normSign()}imul(e){return this._magnitude*=e._magnitude,this._sign=this._magnitude===0n?0:this._sign^e._sign,this._nominalWordLength=this.length+e.length,this.red=null,this.normSign()}imuln(t){return this.assert(typeof t==`number`,`Assertion failed`),this.assert(Math.abs(t)<=e.MAX_IMULN_ARG,`Assertion failed`),this._setValueFromSigned(this._getSignedValue()*BigInt(t)),this}muln(e){return this.clone().imuln(e)}sqr(){let t=new e(0n);return t._magnitude=this._magnitude*this._magnitude,t._sign=0,t._nominalWordLength=this.length*2,t.red=null,t}isqr(){return this._magnitude*=this._magnitude,this._sign=0,this._nominalWordLength=this.length*2,this.red=null,this}pow(t){if(this.assert(t._sign===0,`Exponent for pow must be non-negative`),t.isZero())return new e(1n);let n=new e(1n),r=this.clone(),i=t.clone(),a=r.isNeg(),o=i.isOdd();for(a&&r.ineg();!i.isZero();)i.isOdd()&&n.imul(r),r.isqr(),i.iushrn(1);return a&&o&&n.ineg(),n}static normalizeNonNegativeBigInt(e,t){if(typeof e==`number`){if(!Number.isFinite(e)||!Number.isInteger(e)||e<0)throw Error(`${t} must be a non-negative integer`);return BigInt(e)}if(e<0n)throw Error(`${t} must be a non-negative integer`);return e}iushln(t){let n=e.normalizeNonNegativeBigInt(t,`Shift bits`);return n===0n?this:(this._magnitude<<=n,this._finishInitialization(),this.strip())}ishln(e){return this.assert(this._sign===0,`ishln requires positive number`),this.iushln(e)}iushrn(t,n,r){let i=e.normalizeNonNegativeBigInt(t,`Shift bits`);if(i===0n)return r?._initializeState(0n,0),this;if(r!=null){let e=(1n<<i)-1n,t=this._magnitude&e;r._initializeState(t,0)}return this._magnitude>>=i,this._finishInitialization(),this.strip()}ishrn(e,t,n){return this.assert(this._sign===0,`ishrn requires positive number`),this.iushrn(e,t,n)}shln(e){return this.clone().ishln(e)}ushln(e){return this.clone().iushln(e)}shrn(e){return this.clone().ishrn(e)}ushrn(e){return this.clone().iushrn(e)}testn(e){return this.assert(typeof e==`number`&&e>=0),(this._magnitude>>BigInt(e)&1n)!=0n}imaskn(t){this.assert(typeof t==`number`&&t>=0),this.assert(this._sign===0,`imaskn works only with positive numbers`);let n=BigInt(t),r=n===0n?0n:(1n<<n)-1n;this._magnitude&=r;let i=t===0?1:Math.max(1,Math.ceil(t/e.wordSize));return this._nominalWordLength=i,this._finishInitialization(),this._nominalWordLength=Math.max(this._nominalWordLength,i),this.strip()}maskn(e){return this.clone().imaskn(e)}iaddn(t){return this.assert(typeof t==`number`),this.assert(Math.abs(t)<=e.MAX_IMULN_ARG,`num is too large`),this._setValueFromSigned(this._getSignedValue()+BigInt(t)),this}_iaddn(e){return this.iaddn(e)}isubn(t){return this.assert(typeof t==`number`),this.assert(Math.abs(t)<=e.MAX_IMULN_ARG,`Assertion failed`),this._setValueFromSigned(this._getSignedValue()-BigInt(t)),this}addn(e){return this.clone().iaddn(e)}subn(e){return this.clone().isubn(e)}iabs(){return this._sign=0,this}abs(){return this.clone().iabs()}divmod(t,n,r){if(this.assert(!t.isZero(),`Division by zero`),this.isZero()){let t=new e(0n);return{div:n===`mod`?null:t,mod:n===`div`?null:t}}let i=this._getSignedValue(),a=t._getSignedValue(),o=n===`mod`?null:i/a,s=this._computeMod(i,a,n,r);return{div:this._bigNumberFromSigned(o),mod:this._bigNumberFromSigned(s)}}_computeMod(e,t,n,r){if(n===`div`)return null;let i=e%t;return r===!0&&i<0n&&(i+=t<0n?-t:t),i}_bigNumberFromSigned(t){if(t===null)return null;let n=new e(0n);return n._setValueFromSigned(t),n}div(e){return this.divmod(e,`div`,!1).div}mod(e){return this.divmod(e,`mod`,!1).mod}umod(e){return this.divmod(e,`mod`,!0).mod}divRound(t){this.assert(!t.isZero());let n=this._getSignedValue(),r=t._getSignedValue(),i=n/r,a=n%r;if(a===0n){let t=new e(0n);return t._setValueFromSigned(i),t}let o=a<0n?-a:a,s=r<0n?-r:r;o*2n>=s&&(n>0n&&r>0n||n<0n&&r<0n?i+=1n:i-=1n);let c=new e(0n);return c._setValueFromSigned(i),c}modrn(e){this.assert(e!==0,`Division by zero in modrn`);let t=BigInt(Math.abs(e));if(t===0n)throw Error(`Division by zero in modrn`);let n=this._magnitude%t;return Number(e<0?-n:n)}idivn(t){return this.assert(t!==0),this.assert(Math.abs(t)<=e.MAX_IMULN_ARG,`num is too large`),this._setValueFromSigned(this._getSignedValue()/BigInt(t)),this}divn(e){return this.clone().idivn(e)}egcd(t){this.assert(t._sign===0,`p must not be negative`),this.assert(!t.isZero(),`p must not be zero`);let n=this._getSignedValue(),r=t._magnitude,i=1n,a=0n,o=0n,s=1n;for(;r!==0n;){let e=n/r,t=r;r=n%r,n=t,t=a,a=i-e*a,i=t,t=s,s=o-e*s,o=t}let c=new e(0n);c._setValueFromSigned(i);let l=new e(0n);l._setValueFromSigned(o);let u=new e(0n);return u._initializeState(n<0n?-n:n,0),{a:c,b:l,gcd:u}}gcd(t){let n=this._magnitude,r=t._magnitude;if(n===0n){let t=new e(0n);return t._setValueFromSigned(r),t.iabs()}if(r===0n){let t=new e(0n);return t._setValueFromSigned(n),t.iabs()}for(;r!==0n;){let e=n%r;n=r,r=e}let i=new e(0n);return i._initializeState(n,0),i}invm(e){this.assert(!e.isZero()&&e._sign===0,`Modulus for invm must be positive and non-zero`);let t=this.egcd(e);if(!t.gcd.eqn(1))throw Error(`Inverse does not exist (numbers are not coprime).`);return t.a.umod(e)}isEven(){return this._magnitude%2n==0n}isOdd(){return this._magnitude%2n==1n}andln(e){return this.assert(e>=0),Number(this._magnitude&BigInt(e))}bincn(e){this.assert(typeof e==`number`&&e>=0);let t=1n<<BigInt(e);return this._setValueFromSigned(this._getSignedValue()+t),this}isZero(){return this._magnitude===0n}cmpn(t){this.assert(Math.abs(t)<=e.MAX_IMULN_ARG,`Number is too big`);let n=this._getSignedValue(),r=BigInt(t);return n<r?-1:+(n>r)}cmp(e){let t=this._getSignedValue(),n=e._getSignedValue();return t<n?-1:+(t>n)}ucmp(e){return this._magnitude<e._magnitude?-1:+(this._magnitude>e._magnitude)}gtn(e){return this.cmpn(e)===1}gt(e){return this.cmp(e)===1}gten(e){return this.cmpn(e)>=0}gte(e){return this.cmp(e)>=0}ltn(e){return this.cmpn(e)===-1}lt(e){return this.cmp(e)===-1}lten(e){return this.cmpn(e)<=0}lte(e){return this.cmp(e)<=0}eqn(e){return this.cmpn(e)===0}eq(e){return this.cmp(e)===0}toRed(e){return this.assert(this.red==null,`Already a number in reduction context`),this.assert(this._sign===0,`toRed works only with positives`),e.convertTo(this).forceRed(e)}fromRed(){return this.assert(this.red,`fromRed works only with numbers in reduction context`),this.red.convertFrom(this)}forceRed(e){return this.red=e,this}redAdd(e){return this.assert(this.red,`redAdd works only with red numbers`),this.red.add(this,e)}redIAdd(e){return this.assert(this.red,`redIAdd works only with red numbers`),this.red.iadd(this,e)}redSub(e){return this.assert(this.red,`redSub works only with red numbers`),this.red.sub(this,e)}redISub(e){return this.assert(this.red,`redISub works only with red numbers`),this.red.isub(this,e)}redShl(e){return this.assert(this.red,`redShl works only with red numbers`),this.red.shl(this,e)}redMul(e){return this.assert(this.red,`redMul works only with red numbers`),this.red.verify2(this,e),this.red.mul(this,e)}redIMul(e){return this.assert(this.red,`redIMul works only with red numbers`),this.red.verify2(this,e),this.red.imul(this,e)}redSqr(){return this.assert(this.red,`redSqr works only with red numbers`),this.red.verify1(this),this.red.sqr(this)}redISqr(){return this.assert(this.red,`redISqr works only with red numbers`),this.red.verify1(this),this.red.isqr(this)}redSqrt(){return this.assert(this.red,`redSqrt works only with red numbers`),this.red.verify1(this),this.red.sqrt(this)}redInvm(){return this.assert(this.red,`redInvm works only with red numbers`),this.red.verify1(this),this.red.invm(this)}redNeg(){return this.assert(this.red,`redNeg works only with red numbers`),this.red.verify1(this),this.red.neg(this)}redPow(e){return this.assert(this.red!=null&&e.red==null,`redPow(normalNum)`),this.red.verify1(this),this.red.pow(this,e)}static fromHex(t,n){let r=`be`;return(n===`little`||n===`le`)&&(r=`le`),new e(t,16,r)}toHex(e=0){if(this.isZero()&&e===0)return``;let t=this._getMinimalHex();t!==`0`&&t.length%2!=0&&(t=`0`+t);let n=e*2;for(;t.length<n;)t=`0`+t;return(this.isNeg()?`-`:``)+t}static fromJSON(t){return new e(t,16)}static fromNumber(t){return new e(t)}static fromString(t,n){return new e(t,n)}static fromSm(t,n=`big`){if(t.length===0)return new e(0n);let r=t.slice();n===`little`&&r.reverse();let i=0;r.length>0&&r[0]&128&&(i=1,r[0]&=127);let a;if(m)a=p.from(r).toString(`hex`);else{a=``;for(let e of r)a+=e<16?`0`+e.toString(16):e.toString(16)}let o=a.length===0?0n:BigInt(`0x`+a),s=new e(0n);return s._initializeState(o,i),s}toSm(e=`big`){if(this._magnitude===0n)return this._sign===1?[128]:[];let t=this._getMinimalHex();t.length%2!=0&&(t=`0`+t);let n=t.length/2,r=Array.from({length:n});for(let e=0,n=0;e<t.length;e+=2){let i=h[t.codePointAt(e)],a=h[t.codePointAt(e+1)];r[n++]=(i&15)<<4|a&15}let i;return this._sign===1?r[0]&128?i=[128,...r]:(i=r.slice(),i[0]|=128):i=r[0]&128?[0,...r]:r.slice(),e===`little`?i.reverse():i}static fromBits(t,n=!1){let r=t>>>24,i=t&8388607,a=!!(t&8388608);if(n&&a)throw Error(`negative bit set`);if(r===0&&i===0){if(a&&n)throw Error(`negative bit set for zero value`);return new e(0n)}let o=new e(i);return r<=3?o.iushrn((3-r)*8):o.iushln((r-3)*8),a&&o.ineg(),o}toBits(){if(this.strip(),this.isZero()&&!this.isNeg())return 0;let e=this.isNeg(),t=this.abs().toArray(`be`),n=0;for(;n<t.length-1&&t[n]===0;)n++;t=t.slice(n);let r=t.length,i;if(r===0)i=0;else if(r<=3){i=0;for(let e=0;e<r;e++)i=i<<8|t[e]}else i=t[0]<<16|t[1]<<8|t[2];i&8388608&&r<=255&&(i>>>=8,r++);let a=r<<24|i;return e&&(a|=8388608),a>>>0}static fromScriptNum(t,n=!1,r){if(r!==void 0&&t.length>r)throw Error(`script number overflow`);if(t.length===0)return new e(0n);if(n&&!(t.at(-1)&127)&&(t.length<=1||!(t.at(-2)&128)))throw Error(`non-minimally encoded script number`);return e.fromSm(t,`little`)}toScriptNum(){return this.toSm(`little`)}_invmp(t){this.assert(t._sign===0,`p must not be negative for _invmp`),this.assert(!t.isZero(),`p must not be zero for _invmp`);let n=this.umod(t),r=t.subn(2);if(n.red!==null)return n.redPow(r);let i=new e(1n),a=n.clone(),o=r.clone();for(;!o.isZero();)o.isOdd()&&(i=i.mul(a).umod(t)),a=a.sqr().umod(t),o.iushrn(1);return i}mulTo(e,t){return t._magnitude=this._magnitude*e._magnitude,t._sign=t._magnitude===0n?0:this._sign^e._sign,t._nominalWordLength=this.length+e.length,t.red=null,t.normSign(),t}},_=class{name;p;k;n;tmp;constructor(e,t){this.name=e,this.p=new g(t,16),this.n=this.p.bitLength(),this.k=new g(BigInt(1)).iushln(this.n).isub(this.p),this.tmp=this._tmp()}_tmp(){let e=new g(BigInt(0)),t=Math.ceil(this.n/g.wordSize);return e.expand(Math.max(1,t)),e}ireduce(e){let t=e,n;do this.split(t,this.tmp),this.imulK(t),t.iadd(this.tmp),n=t.bitLength();while(n>this.n);let r=n<this.n?-1:t.ucmp(this.p);return r===0?t.words=[0]:r>0&&t.isub(this.p),t.strip(),t}split(e,t){e.iushrn(this.n,0,t)}imulK(e){return e.imul(this.k)}},v=class extends _{constructor(){super(`k256`,`ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f`)}split(e,t){let n=4194303,r=e.words,i=e.length,a=Math.min(i,9),o=Array.from({length:a+ +(i>9)},()=>0);for(let e=0;e<a;e++)o[e]=r[e];let s=a;if(i<=9){let n=Array.from({length:s},()=>0);for(let e=0;e<s;++e)n[e]=o[e];t.words=n,e.words=[0];return}let c=r[9];o[s++]=c&n;let l=Array.from({length:s},()=>0);for(let e=0;e<s;++e)l[e]=o[e];t.words=l;let u=Array.from({length:Math.max(1,i-9)},()=>0),d=0;for(let e=10;e<i;e++){let t=Math.trunc(r[e]);d<u.length&&(u[d++]=(t&n)<<4|c>>>22),c=t}c>>>=22,d<u.length?u[d++]=c:c!==0&&u.length;let f=Array.from({length:d},()=>0);for(let e=0;e<d;++e)f[e]=u[e];e.words=f}imulK(e){let t=e.words,n=e.length,r=n+2,i=Array.from({length:r},()=>0);for(let e=0;e<n;e++)i[e]=t[e];let a=0;for(let e=0;e<r;e++){let t=Math.trunc(i[e]);a+=t*977,i[e]=a&67108863,a=t*64+Math.trunc(a/67108864)}return e.words=i,e}},y=class{prime;m;constructor(e){if(e===`k256`){let e=new v;this.m=e.p,this.prime=e}else this.assert(e.gtn(1),`modulus must be greater than 1`),this.m=e,this.prime=null}assert(e,t=`Assertion failed`){if(!e)throw Error(t)}verify1(e){this.assert(e.negative===0,`red works only with positives`),this.assert(e.red,`red works only with red numbers`)}verify2(e,t){this.assert((e.negative|t.negative)===0,`red works only with positives`),this.assert(e.red!=null&&e.red===t.red,`red works only with red numbers`)}imod(e){return this.prime==null?(g.move(e,e.umod(this.m).forceRed(this)),e):this.prime.ireduce(e).forceRed(this)}neg(e){return e.isZero()?e.clone():this.m.sub(e).forceRed(this)}add(e,t){this.verify2(e,t);let n=e.clone();return n.iadd(t),n.isub(this.m),n.isNeg()&&n.iadd(this.m),n}iadd(e,t){return this.verify2(e,t),e.iadd(t),e.isub(this.m),e.isNeg()&&e.iadd(this.m),e}sub(e,t){this.verify2(e,t);let n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n.forceRed(this)}isub(e,t){this.verify2(e,t);let n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n}shl(e,t){return this.verify1(e),this.imod(e.ushln(t))}imul(e,t){return this.verify2(e,t),this.imod(e.imul(t))}mul(e,t){return this.verify2(e,t),this.imod(e.mul(t))}isqr(e){return this.imul(e,e.clone())}sqr(e){return this.mul(e,e)}sqrt(e){if(e.isZero())return e.clone();let t=this.m.andln(3);if(this.assert(t%2==1),t===3){let t=this.m.add(new g(1)).iushrn(2);return this.pow(e,t)}let n=this.m.subn(1),r=0;for(;!n.isZero()&&n.andln(1)===0;)r++,n.iushrn(1);this.assert(!n.isZero());let i=new g(1).toRed(this),a=i.redNeg(),o=this.m.subn(1).iushrn(1),s=this.m.bitLength(),c=new g(2*s*s).toRed(this);for(;this.pow(c,o).cmp(a)!==0;)c.redIAdd(a);let l=this.pow(c,n),u=this.pow(e,n.addn(1).iushrn(1)),d=this.pow(e,n),f=r;for(;d.cmp(i)!==0;){let e=d,t=0;for(;e.cmp(i)!==0;)e=e.redSqr(),t++;this.assert(t<f);let n=this.pow(l,new g(1).iushln(f-t-1));u=u.redMul(n),l=n.redSqr(),d=d.redMul(l),f=t}return u}invm(e){let t=e._invmp(this.m);return t.negative===0?this.imod(t):(t.negative=0,this.imod(t).redNeg())}pow(e,t){if(this.verify1(e),t.isZero())return new g(1).toRed(this);let n=new g(1).toRed(this),r=e.clone(),i=t.bitLength();for(let e=i-1;e>=0;e--)n=this.sqr(n),t.testn(e)&&(n=this.mul(n,r));return n}convertTo(e){let t=e.umod(this.m);return t===e?t.clone():t}convertFrom(e){let t=e.clone();return t.red=null,t}},b=class extends y{shift;r;r2;rinv;minv;constructor(e){super(e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new g(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}convertTo(e){return this.imod(e.ushln(this.shift))}convertFrom(e){let t=this.imod(e.mul(this.rinv));return t.red=null,t}imul(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;let n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a.forceRed(this)}mul(e,t){if(e.isZero()||t.isZero())return new g(0).forceRed(this);let n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a.forceRed(this)}invm(e){return this.imod(e._invmp(this.m).mul(this.r2)).forceRed(this)}},x=/^[0-9a-fA-F]*$/;function S(e){if(typeof e!=`string`)throw TypeError(`Invalid hex string`);if(e.length!==0&&!x.test(e))throw Error(`Invalid hex string`)}function C(e){if(S(e),e.length===0)return``;let t=e.toLowerCase();return t.length%2!=0&&(t=`0`+t),t}var w=(e,t=`Hash assertion failed`)=>{if(!e)throw Error(t)},ee=class{pending=null;pendingTotal=0;blockSize;outSize;endian;_delta8;_delta32;padLength;hmacStrength;constructor(e,t,n,r){this.blockSize=e,this.outSize=t,this.hmacStrength=n,this.padLength=r/8,this.endian=`big`,this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}_update(e,t){throw Error(`Not implemented`)}_digest(){throw Error(`Not implemented`)}_digestHex(){throw Error(`Not implemented`)}update(e,t){if(e=ie(e,t),this.pending=this.pending==null?e:this.pending.concat(e),this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;let t=e.length%this._delta8;this.pending=e.slice(e.length-t,e.length),this.pending.length===0&&(this.pending=null),e=xe(e,0,e.length-t,this.endian);for(let t=0;t<e.length;t+=this._delta32)this._update(e,t)}return this}digest(){return this.update(this._pad()),w(this.pending===null),this._digest()}digestHex(){return this.update(this._pad()),w(this.pending===null),this._digestHex()}_pad(){let e=this.pendingTotal;if(!Number.isSafeInteger(e)||e<0)throw Error(`Message too long for this hash function`);let t=this._delta8,n=t-(e+this.padLength)%t,r=Array.from({length:n+this.padLength});r[0]=128;let i=1;for(;i<n;i++)r[i]=0;let a=this.padLength,o=1n<<BigInt(a*8),s=BigInt(e)*8n;if(s>=o)throw Error(`Message too long for this hash function`);if(this.endian===`big`){let e=Array.from({length:a});for(let t=a-1;t>=0;t--)e[t]=Number(s&255n),s>>=8n;for(let t=0;t<a;t++)r[i++]=e[t]}else for(let e=0;e<a;e++)r[i++]=Number(s&255n),s>>=8n;return r}};function te(e,t,n){let r=e.codePointAt(t);return r<128?(n.push(r),t):r<2048?(n.push(r>>6|192,r&63|128),t):r>65535?(n.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128),t+1):(n.push(r>>12|224,r>>6&63|128,r&63|128),t)}function ne(e){let t=[],n=0;for(;n<e.length;)n=te(e,n,t)+1;return t}function T(e){S(e);let t=C(e),n=[];for(let e=0;e<t.length;e+=2)n.push(Number.parseInt(t[e]+t[e+1],16));return n}function re(e){let t=[];for(let n=0;n<e.length;n++)t[n]=Math.trunc(e[n]);return t}function ie(e,t){return Array.isArray(e)?e.slice():e?typeof e==`string`?t===`hex`?T(e):ne(e):re(e):[]}function ae(e){return Jt(e)}function oe(e,t){let n=``;for(let r of e)t===`little`&&(r=ae(r)),n+=se(r.toString(16));return n}function se(e){return e.length===7?`0`+e:e.length===6?`00`+e:e.length===5?`000`+e:e.length===4?`0000`+e:e.length===3?`00000`+e:e.length===2?`000000`+e:e.length===1?`0000000`+e:e}var ce=typeof globalThis>`u`?void 0:globalThis.Buffer,le=ce!=null&&typeof ce.from==`function`,E=`0123456789abcdef`,D=Array.from({length:256});for(let e=0;e<D.length;e++)D[e]=E[e>>4&15]+E[e&15];function ue(e){if(le)return ce.from(e).toString(`hex`);let t=Array.from({length:e.length});for(let n=0;n<e.length;n++)t[n]=D[e[n]];return t.join(``)}var de=(()=>{let e=typeof globalThis>`u`?void 0:globalThis.process,t=e?.getBuiltinModule;if(typeof t==`function`)try{let n=t.call(e,`node:crypto`);if(n!=null)return n}catch{}})();function fe(e,t){return e instanceof Uint8Array?e:Array.isArray(e)?new Uint8Array(e):Uint8Array.from(ie(e,t))}function pe(e){return typeof e==`string`?fe(e,`hex`):fe(e)}function me(e,t,n){e==null?t?.update(n):e.update(n)}function he(e,t){return e==null?t==null?[]:Array.from(t.digest()):Array.from(e.digest())}function ge(e,t){return e==null?t==null?``:ue(t.digest()):e.digest(`hex`)}function _e(e){let t=de?.createHash;if(typeof t==`function`)try{return t(e)}catch{return}}function ve(e,t){let n=de?.createHmac;if(typeof n==`function`)try{return n(e,t)}catch{return}}function ye(e,t,n){let r=_e(e);if(r!=null)return r.update(fe(t,n)),r.digest()}function be(e,t,n,r){let i=ve(e,pe(t));if(i!=null)return i.update(fe(n,r)),i.digest()}function xe(e,t,n,r){let i=n-t;w(i%4==0);let a=Array.from({length:i/4});for(let n=0,i=t;n<a.length;n++,i+=4){let t;t=r===`big`?e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3]:e[i+3]<<24|e[i+2]<<16|e[i+1]<<8|e[i],a[n]=t>>>0}return a}function Se(e,t){let n=Array.from({length:e.length*4});for(let r=0,i=0;r<e.length;r++,i+=4){let a=e[r];t===`big`?(n[i]=a>>>24,n[i+1]=a>>>16&255,n[i+2]=a>>>8&255,n[i+3]=a&255):(n[i+3]=a>>>24,n[i+2]=a>>>16&255,n[i+1]=a>>>8&255,n[i]=a&255)}return n}function Ce(e,t){return e>>>t|e<<32-t}function we(e,t){return e<<t|e>>>32-t}function Te(e,t){return e+t>>>0}function Ee(e,t,n){return e+t+n>>>0}function De(e,t,n,r){return e+t+n+r>>>0}function Oe(e,t,n,r,i){return e+t+n+r+i>>>0}function ke(e,t,n,r){return e===0?Ae(t,n,r):e===1||e===3?Me(t,n,r):e===2?je(t,n,r):0}function Ae(e,t,n){return e&t^~e&n}function je(e,t,n){return e&t^e&n^t&n}function Me(e,t,n){return e^t^n}function Ne(e){return Ce(e,2)^Ce(e,13)^Ce(e,22)}function Pe(e){return Ce(e,6)^Ce(e,11)^Ce(e,25)}function Fe(e){return Ce(e,7)^Ce(e,18)^e>>>3}function Ie(e){return Ce(e,17)^Ce(e,19)^e>>>10}var Le=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],Re=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],ze=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],Be=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];function Ve(e,t,n,r){return e<=15?t^n^r:e<=31?t&n|~t&r:e<=47?(t|~n)^r:e<=63?t&r|n&~r:t^(n|~r)}function He(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function Ue(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}var We=class extends ee{h;constructor(){super(512,160,192,64),this.endian=`little`,this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian=`little`}_update(e,t){let n=this.h[0],r=this.h[1],i=this.h[2],a=this.h[3],o=this.h[4],s=n,c=r,l=i,u=a,d=o,f;for(let p=0;p<80;p++)f=Te(we(De(n,Ve(p,r,i,a),e[Le[p]+t],He(p)),ze[p]),o),n=o,o=a,a=we(i,10),i=r,r=f,f=Te(we(De(s,Ve(79-p,c,l,u),e[Re[p]+t],Ue(p)),Be[p]),d),s=d,d=u,u=we(l,10),l=c,c=f;f=Ee(this.h[1],i,u),this.h[1]=Ee(this.h[2],a,d),this.h[2]=Ee(this.h[3],o,s),this.h[3]=Ee(this.h[4],n,c),this.h[4]=Ee(this.h[0],r,l),this.h[0]=f}_digest(){return Se(this.h,`little`)}_digestHex(){return oe(this.h,`little`)}},Ge=class extends ee{h;W;k;constructor(){super(512,160,80,64),this.k=[1518500249,1859775393,2400959708,3395469782],this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array.from({length:80})}_update(e,t){let n=this.W;t??=0;let r=0;for(;r<16;r++)n[r]=e[t+r];for(;r<n.length;r++)n[r]=we(n[r-3]^n[r-8]^n[r-14]^n[r-16],1);let i=this.h[0],a=this.h[1],o=this.h[2],s=this.h[3],c=this.h[4];for(r=0;r<n.length;r++){let e=Math.trunc(r/20),t=Oe(we(i,5),ke(e,a,o,s),c,n[r],this.k[e]);c=s,s=o,o=we(a,30),a=i,i=t}this.h[0]=Te(this.h[0],i),this.h[1]=Te(this.h[1],a),this.h[2]=Te(this.h[2],o),this.h[3]=Te(this.h[3],s),this.h[4]=Te(this.h[4],c)}_digest(){return Se(this.h,`big`)}_digestHex(){return oe(this.h,`big`)}},Ke=class{h;native;blockSize=64;outSize=32;constructor(e){let t=pe(e);this.native=ve(`sha256`,t),this.native??(this.h=new qt(Rt,t))}update(e,t){return me(this.native,this.h,fe(e,t)),this}digest(){return he(this.native,this.h)}digestHex(){return ge(this.native,this.h)}},qe=class{h;native;blockSize=128;outSize=32;constructor(e){let t=pe(e);this.native=ve(`sha512`,t),this.native??(this.h=new qt(Kt,t))}update(e,t){return me(this.native,this.h,fe(e,t)),this}digest(){return he(this.native,this.h)}digestHex(){return ge(this.native,this.h)}};function Je(e,t){return ye(`sha256`,e,t)??new Lt().update(fe(e,t)).digest()}function Ye(e,t){return ye(`ripemd160`,e,t)}var Xe=(e,t)=>{let n=Ye(e,t);return n==null?new We().update(e,t).digest():Array.from(n)},Ze=(e,t)=>new Ge().update(e,t).digest(),Qe=(e,t)=>Array.from(Je(e,t)),$e=(e,t)=>Array.from(Je(Je(e,t))),et=(e,t)=>{let n=Je(e,t),r=Ye(n);return r==null?new We().update(n).digest():Array.from(r)},tt=(e,t,n)=>{let r=be(`sha256`,e,t,n);return r==null?new Ke(e).update(t,n).digest():Array.from(r)},nt=(e,t,n)=>{let r=be(`sha512`,e,t,n);return r==null?new qe(e).update(t,n).digest():Array.from(r)};function rt(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function it(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`positive integer expected, got ${e}`)}function at(e,...t){if(!rt(e))throw Error(`Uint8Array expected`);if(t.length>0&&!t.includes(e.length)){let n=t.join(`,`);throw Error(`Uint8Array expected of length ${n}, got length=${e.length}`)}}function ot(e){if(typeof e!=`function`||typeof e.create!=`function`)throw TypeError(`Hash should be wrapped by utils.createHasher`);it(e.outputLen),it(e.blockLen)}function st(e,t=!0){if(e.destroyed===!0)throw Error(`Hash instance has been destroyed`);if(t&&e.finished===!0)throw Error(`Hash#digest() has already been called`)}function ct(e,t){at(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least ${n}`)}function lt(...e){for(let t of e)t.fill(0)}function ut(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function dt(e){return typeof e==`string`&&(e=ft(e)),at(e),e}function ft(e){if(typeof e!=`string`)throw Error(`string expected`);return new Uint8Array(new TextEncoder().encode(e))}var pt=class{};function mt(e){let t=t=>e().update(dt(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}var ht=BigInt(2**32-1),gt=BigInt(32);function _t(e,t=!1){return t?{h:Number(e&ht),l:Number(e>>gt&ht)}:{h:Number(e>>gt&ht)|0,l:Number(e&ht)|0}}function vt(e,t=!1){let n=e.length,r=new Uint32Array(n),i=new Uint32Array(n);for(let a=0;a<n;a++){let{h:n,l:o}=_t(e[a],t);r[a]=n,i[a]=o}return[r,i]}var yt=(e,t,n)=>e>>>n,bt=(e,t,n)=>e<<32-n|t>>>n,xt=(e,t,n)=>e>>>n|t<<32-n,St=(e,t,n)=>e<<32-n|t>>>n,Ct=(e,t,n)=>e<<64-n|t>>>n-32,wt=(e,t,n)=>e>>>n-32|t<<64-n;function Tt(e,t,n,r){let i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:i|0}}var Et=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),Dt=(e,t,n,r)=>Math.trunc(t+n+r+Math.trunc(e/2**32)),Ot=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),kt=(e,t,n,r,i)=>Math.trunc(t+n+r+i+Math.trunc(e/2**32)),At=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0),jt=(e,t,n,r,i,a)=>t+n+r+i+a+(e/2**32|0)|0,Mt=class extends pt{blockLen;outputLen;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=ut(this.buffer)}update(e){st(this),e=dt(e),at(e);let{view:t,buffer:n,blockLen:r}=this,i=e.length;for(let a=0;a<i;){let o=Math.min(r-this.pos,i-a);if(o===r){let t=ut(e);for(;r<=i-a;a+=r)this.process(t,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){st(this),ct(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,lt(this.buffer.subarray(a)),this.padOffset>r-a&&(this.process(n,0),a=0);for(let e=a;e<r;e++)t[e]=0;Nt(n,r-8,BigInt(this.length*8),i),this.process(n,0);let o=ut(e),s=this.outputLen;if(s%4!=0)throw Error(`_sha2: outputLen should be aligned to 32bit`);let c=s/4,l=this.get();if(c>l.length)throw Error(`_sha2: outputLen bigger than state`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e??=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:n,length:r,finished:i,destroyed:a,pos:o}=this;return e.destroyed=a,e.finished=i,e.length=r,e.pos=o,r%t!==0&&e.buffer.set(n),e}clone(){return this._cloneInto()}};function Nt(e,t,n,r){if(typeof e.setBigUint64==`function`)return e.setBigUint64(t,n,r);let i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,s,r)}var Pt=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ft=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),It=new Uint32Array(64),Lt=class extends Mt{A=Pt[0]|0;B=Pt[1]|0;C=Pt[2]|0;D=Pt[3]|0;E=Pt[4]|0;F=Pt[5]|0;G=Pt[6]|0;H=Pt[7]|0;constructor(e=32){super(64,e,8,!1)}get(){let{A:e,B:t,C:n,D:r,E:i,F:a,G:o,H:s}=this;return[e,t,n,r,i,a,o,s]}set(...[e,t,n,r,i,a,o,s]){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=s|0}process(e,t){for(let n=0;n<16;n++,t+=4)It[n]=e.getUint32(t);for(let e=16;e<64;e++){let t=It[e-15],n=It[e-2],r=Fe(t),i=Ie(n);It[e]=Te(Te(r,It[e-7]),Te(i,It[e-16]))}let{A:n,B:r,C:i,D:a,E:o,F:s,G:c,H:l}=this;for(let e=0;e<64;e++){let t=Oe(l,Pe(o),Ae(o,s,c),Ft[e],It[e]),u=Te(Ne(n),je(n,r,i));l=c,c=s,s=o,o=Te(a,t),a=i,i=r,r=n,n=Te(t,u)}this.A=Te(this.A,n),this.B=Te(this.B,r),this.C=Te(this.C,i),this.D=Te(this.D,a),this.E=Te(this.E,o),this.F=Te(this.F,s),this.G=Te(this.G,c),this.H=Te(this.H,l)}roundClean(){lt(It)}destroy(){lt(this.buffer),this.set(0,0,0,0,0,0,0,0)}},Rt=mt(()=>new Lt),zt=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),Bt=vt(`0x428a2f98d728ae22.0x7137449123ef65cd.0xb5c0fbcfec4d3b2f.0xe9b5dba58189dbbc.0x3956c25bf348b538.0x59f111f1b605d019.0x923f82a4af194f9b.0xab1c5ed5da6d8118.0xd807aa98a3030242.0x12835b0145706fbe.0x243185be4ee4b28c.0x550c7dc3d5ffb4e2.0x72be5d74f27b896f.0x80deb1fe3b1696b1.0x9bdc06a725c71235.0xc19bf174cf692694.0xe49b69c19ef14ad2.0xefbe4786384f25e3.0x0fc19dc68b8cd5b5.0x240ca1cc77ac9c65.0x2de92c6f592b0275.0x4a7484aa6ea6e483.0x5cb0a9dcbd41fbd4.0x76f988da831153b5.0x983e5152ee66dfab.0xa831c66d2db43210.0xb00327c898fb213f.0xbf597fc7beef0ee4.0xc6e00bf33da88fc2.0xd5a79147930aa725.0x06ca6351e003826f.0x142929670a0e6e70.0x27b70a8546d22ffc.0x2e1b21385c26c926.0x4d2c6dfc5ac42aed.0x53380d139d95b3df.0x650a73548baf63de.0x766a0abb3c77b2a8.0x81c2c92e47edaee6.0x92722c851482353b.0xa2bfe8a14cf10364.0xa81a664bbc423001.0xc24b8b70d0f89791.0xc76c51a30654be30.0xd192e819d6ef5218.0xd69906245565a910.0xf40e35855771202a.0x106aa07032bbd1b8.0x19a4c116b8d2d0c8.0x1e376c085141ab53.0x2748774cdf8eeb99.0x34b0bcb5e19b48a8.0x391c0cb3c5c95a63.0x4ed8aa4ae3418acb.0x5b9cca4f7763e373.0x682e6ff3d6b2b8a3.0x748f82ee5defb2fc.0x78a5636f43172f60.0x84c87814a1f0ab72.0x8cc702081a6439ec.0x90befffa23631e28.0xa4506cebde82bde9.0xbef9a3f7b2c67915.0xc67178f2e372532b.0xca273eceea26619c.0xd186b8c721c0c207.0xeada7dd6cde0eb1e.0xf57d4f7fee6ed178.0x06f067aa72176fba.0x0a637dc5a2c898a6.0x113f9804bef90dae.0x1b710b35131c471b.0x28db77f523047d84.0x32caab7b40c72493.0x3c9ebe0a15c9bebc.0x431d67c49c100d4c.0x4cc5d4becb3e42b6.0x597f299cfc657e2a.0x5fcb6fab3ad6faec.0x6c44198c4a475817`.split(`.`).map(BigInt)),Vt=Bt[0],Ht=Bt[1],Ut=new Uint32Array(80),Wt=new Uint32Array(80),Gt=class extends Mt{Ah=zt[0]|0;Al=zt[1]|0;Bh=zt[2]|0;Bl=zt[3]|0;Ch=zt[4]|0;Cl=zt[5]|0;Dh=zt[6]|0;Dl=zt[7]|0;Eh=zt[8]|0;El=zt[9]|0;Fh=zt[10]|0;Fl=zt[11]|0;Gh=zt[12]|0;Gl=zt[13]|0;Hh=zt[14]|0;Hl=zt[15]|0;constructor(e=64){super(128,e,16,!1)}get(){let{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:a,Dh:o,Dl:s,Eh:c,El:l,Fh:u,Fl:d,Gh:f,Gl:p,Hh:m,Hl:h}=this;return[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]}set(...[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=r|0,this.Ch=i|0,this.Cl=a|0,this.Dh=o|0,this.Dl=s|0,this.Eh=c|0,this.El=l|0,this.Fh=u|0,this.Fl=d|0,this.Gh=f|0,this.Gl=p|0,this.Hh=m|0,this.Hl=h|0}process(e,t){for(let n=0;n<16;n++,t+=8)Ut[n]=e.getUint32(t),Wt[n]=e.getUint32(t+4);for(let e=16;e<80;e++){let t=Ut[e-15]|0,n=Wt[e-15]|0,r=xt(t,n,1)^xt(t,n,8)^yt(t,n,7),i=St(t,n,1)^St(t,n,8)^bt(t,n,7),a=Ut[e-2]|0,o=Wt[e-2]|0,s=xt(a,o,19)^Ct(a,o,61)^yt(a,o,6),c=Ot(i,St(a,o,19)^wt(a,o,61)^bt(a,o,6),Wt[e-7],Wt[e-16]),l=kt(c,r,s,Ut[e-7],Ut[e-16]);Ut[e]=l|0,Wt[e]=c|0}let{Ah:n,Al:r,Bh:i,Bl:a,Ch:o,Cl:s,Dh:c,Dl:l,Eh:u,El:d,Fh:f,Fl:p,Gh:m,Gl:h,Hh:g,Hl:_}=this;for(let e=0;e<80;e++){let t=xt(u,d,14)^xt(u,d,18)^Ct(u,d,41),v=St(u,d,14)^St(u,d,18)^wt(u,d,41),y=u&f^~u&m,b=d&p^~d&h,x=At(_,v,b,Ht[e],Wt[e]),S=jt(x,g,t,y,Vt[e],Ut[e]),C=x|0,w=xt(n,r,28)^Ct(n,r,34)^Ct(n,r,39),ee=St(n,r,28)^wt(n,r,34)^wt(n,r,39),te=n&i^n&o^i&o,ne=r&a^r&s^a&s;g=m|0,_=h|0,m=f|0,h=p|0,f=u|0,p=d|0,{h:u,l:d}=Tt(c|0,l|0,S|0,C|0),c=o|0,l=s|0,o=i|0,s=a|0,i=n|0,a=r|0;let T=Et(ee,ne,C);n=Dt(T,w,te,S),r=T|0}({h:n,l:r}=Tt(n,r,this.Ah,this.Al)),{h:i,l:a}=Tt(i,a,this.Bh,this.Bl),{h:o,l:s}=Tt(o,s,this.Ch,this.Cl),{h:c,l}=Tt(c,l,this.Dh,this.Dl),{h:u,l:d}=Tt(u,d,this.Eh,this.El),{h:f,l:p}=Tt(f,p,this.Fh,this.Fl),{h:m,l:h}=Tt(m,h,this.Gh,this.Gl),{h:g,l:_}=Tt(g,_,this.Hh,this.Hl),this.set(n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_)}roundClean(){lt(Ut,Wt)}destroy(){lt(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},Kt=mt(()=>new Gt),qt=class extends pt{oHash;iHash;blockLen;outputLen;finished=!1;destroyed=!1;constructor(e,t){super(),ot(e);let n=dt(t);if(this.iHash=e.create(),typeof this.iHash.update!=`function`)throw TypeError(`Expected instance of class which extends utils.Hash`);this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let r=this.blockLen,i=new Uint8Array(r);i.set(n.length>r?e.create().update(n).digest():n);for(let e=0;e<i.length;e++)i[e]^=54;this.iHash.update(i),this.oHash=e.create();for(let e=0;e<i.length;e++)i[e]^=106;this.oHash.update(i),lt(i)}update(e){return st(this),this.iHash.update(e),this}digestInto(e){st(this),at(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e??=Object.create(Object.getPrototypeOf(this),{});let{oHash:t,iHash:n,finished:r,destroyed:i,blockLen:a,outputLen:o}=this;return e=e,e.finished=r,e.destroyed=i,e.blockLen=a,e.outputLen=o,e.oHash=t._cloneInto(e.oHash??void 0),e.iHash=n._cloneInto(e.iHash??void 0),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};function Jt(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(e&255)<<24)>>>0}(()=>{let e=new ArrayBuffer(4),t=new Uint32Array(e),n=new Uint8Array(e);return t[0]=16909060,n[0]===4})();var Yt=class{buffer;pos;capacity;constructor(e,t=256){if(e!=null&&e.length>0){let n=e.reduce((e,t)=>e+t.length,0);t=Math.max(t,n)}if(this.buffer=new Uint8Array(t),this.pos=0,this.capacity=t,e!=null)for(let t of e)this.write(t)}getLength(){return this.pos}toUint8Array(){return this.buffer.slice(0,this.pos)}toArray(){return Array.from(this.toUint8Array())}toUint8ArrayZeroCopy(){return this.buffer.subarray(0,this.pos)}reserve(e){if(!Number.isSafeInteger(e)||e<0)throw RangeError(`WriterUint8Array reserve requires a non-negative safe integer`);this.ensureCapacity(e)}ensureCapacity(e){if(this.pos+e>this.capacity){let t=this.capacity*2;for(;this.pos+e>t;)t*=2;let n=new Uint8Array(t);n.set(this.buffer),this.buffer=n,this.capacity=t}}write(e){let t=e instanceof Uint8Array?e:new Uint8Array(e);return this.ensureCapacity(t.length),this.buffer.set(t,this.pos),this.pos+=t.length,this}writeReverse(e){let t=e instanceof Uint8Array?e:new Uint8Array(e);this.ensureCapacity(t.length);for(let e=t.length-1;e>=0;e--)this.buffer[this.pos]=t[e],this.pos+=1;return this}writeUInt8(e){return this.ensureCapacity(1),this.buffer[this.pos]=e&255,this.pos+=1,this}writeInt8(e){return this.writeUInt8(e),this}writeUInt16LE(e){return this.ensureCapacity(2),this.buffer[this.pos]=e&255,this.buffer[this.pos+1]=e>>8&255,this.pos+=2,this}writeUInt16BE(e){return this.ensureCapacity(2),this.buffer[this.pos]=e>>8&255,this.buffer[this.pos+1]=e&255,this.pos+=2,this}writeInt16LE(e){return this.writeUInt16LE(e&65535),this}writeInt16BE(e){return this.writeUInt16BE(e&65535),this}writeUInt32LE(e){return this.ensureCapacity(4),this.buffer[this.pos]=e&255,this.buffer[this.pos+1]=e>>8&255,this.buffer[this.pos+2]=e>>16&255,this.buffer[this.pos+3]=e>>24&255,this.pos+=4,this}writeUInt32BE(e){return this.ensureCapacity(4),this.buffer[this.pos]=e>>24&255,this.buffer[this.pos+1]=e>>16&255,this.buffer[this.pos+2]=e>>8&255,this.buffer[this.pos+3]=e&255,this.pos+=4,this}writeInt32LE(e){return this.writeUInt32LE(e>>>0),this}writeInt32BE(e){return this.writeUInt32BE(e>>>0),this}writeUInt64BEBn(e){let t=e.toArray(`be`,8);return this.write(t),this}writeUInt64LEBn(e){let t=e.toArray(`be`,8);return this.writeReverse(t),this}writeUInt64LE(e){let t=new g(e).toArray(`be`,8);return this.writeReverse(t),this}writeVarIntNum(e){let t=bn.varIntNum(e);return this.write(t),this}writeVarIntBn(e){let t=bn.varIntBn(e);return this.write(t),this}reset(){this.pos=0}},Xt=class e{bin;pos;length;static makeReader(t,n=0){if(t instanceof Uint8Array)return new e(t,n);if(Array.isArray(t))return new xn(t,n);throw Error(`ReaderUint8Array.makeReader: bin must be Uint8Array or number[]`)}constructor(e=new Uint8Array,t=0){if(e instanceof Uint8Array)this.bin=e;else if(Array.isArray(e))this.bin=new Uint8Array(e);else throw TypeError(`ReaderUint8Array constructor: bin must be Uint8Array or number[]`);this.pos=t,this.length=this.bin.length}eof(){return this.pos>=this.length}read(e=this.length){let t=this.pos,n=this.pos+e;return this.pos=n,this.bin.slice(t,n)}readView(e=this.length-this.pos){if(!Number.isSafeInteger(e)||e<0||this.pos+e>this.length)throw RangeError(`ReaderUint8Array read exceeds available data`);let t=this.pos;return this.pos+=e,this.bin.subarray(t,this.pos)}skip(e){if(!Number.isSafeInteger(e)||e<0||this.pos+e>this.length)throw RangeError(`ReaderUint8Array skip exceeds available data`);this.pos+=e}remaining(){return this.length-this.pos}readReverse(e=this.length){let t=new Uint8Array(e);for(let n=0;n<e;n++)t[n]=this.bin[this.pos+e-1-n];return this.pos+=e,t}readUInt8(){let e=this.bin[this.pos];return this.pos+=1,e}readInt8(){let e=this.bin[this.pos];return this.pos+=1,e&128?e-256:e}readUInt16BE(){let e=this.bin[this.pos]<<8|this.bin[this.pos+1];return this.pos+=2,e}readInt16BE(){let e=this.readUInt16BE();return e&32768?e-65536:e}readUInt16LE(){let e=this.bin[this.pos]|this.bin[this.pos+1]<<8;return this.pos+=2,e}readInt16LE(){let e=this.readUInt16LE();return e&32768?e-65536:e}readUInt32BE(){let e=this.bin[this.pos]*16777216+(this.bin[this.pos+1]<<16|this.bin[this.pos+2]<<8|this.bin[this.pos+3]);return this.pos+=4,e}readInt32BE(){let e=this.readUInt32BE();return e&2147483648?e-4294967296:e}readUInt32LE(){let e=(this.bin[this.pos]|this.bin[this.pos+1]<<8|this.bin[this.pos+2]<<16|this.bin[this.pos+3]<<24)>>>0;return this.pos+=4,e}readInt32LE(){let e=this.readUInt32LE();return e&2147483648?e-4294967296:e}readUInt64BEBn(){let e=new g(Array.from(this.bin.slice(this.pos,this.pos+8)));return this.pos+=8,e}readUInt64LEBn(){return new g(Array.from(this.readReverse(8)))}readInt64LEBn(){let e=new g(2).pow(new g(63)),t=new g(2).pow(new g(64)),n=new g(Array.from(this.readReverse(8)));return n.gte(e)&&(n=n.sub(t)),n}readVarIntNum(e=!0){let t=this.readUInt8(),n;switch(t){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:if(n=e?this.readInt64LEBn():this.readUInt64LEBn(),n.lte(new g(2).pow(new g(53))))return n.toNumber();throw Error(`number too large to retain precision - use readVarIntBn`);default:return t}}readVarInt(){switch(this.bin[this.pos]){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}}readVarIntBn(){let e=this.readUInt8();switch(e){case 253:return new g(this.readUInt16LE());case 254:return new g(this.readUInt32LE());case 255:return this.readUInt64LEBn();default:return new g(e)}}},Zt=globalThis.Buffer,Qt=Zt!=null&&typeof Zt.from==`function`,$t=`0123456789abcdef`,en=Array.from({length:256},()=>``);for(let e=0;e<256;e++)en[e]=$t[e>>4&15]+$t[e&15];var tn=e=>Qt?Zt.from(e).toString(`hex`):e.length===0?``:Array.from(e,e=>en[e&255]).join(``),nn=(e,t)=>e instanceof Uint8Array?e:typeof e==`string`&&t===`hex`?sn(e):new Uint8Array(rn(e,t)),rn=(e,t)=>{if(Array.isArray(e))return e.slice();if(e===void 0)return[];if(typeof e!=`string`)return Array.from(e,e=>Math.trunc(e));switch(t){case`hex`:return on(e);case`base64`:return un(e);default:return dn(e)}},an=new Int8Array(256).fill(-1);for(let e=0;e<10;e++)an[48+e]=e;for(let e=0;e<6;e++)an[65+e]=10+e,an[97+e]=10+e;var on=e=>Array.from(sn(e)),sn=e=>{S(e);let t=e.length%2==0?e:`0`+e;if(Qt){let e=Zt.from(t,`hex`);return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let n=new Uint8Array(t.length/2),r=0;for(let e=0;e<t.length;e+=2){let i=an[t.codePointAt(e)],a=an[t.codePointAt(e+1)];n[r++]=i<<4|a}return n},cn=e=>{if(typeof e!=`string`)throw TypeError(`msg must be a string`);let t=e.trim().replaceAll(/[\r\n\t\f\v ]+/g,``).replaceAll(`-`,`+`).replaceAll(`_`,`/`),n=t.indexOf(`=`);if(n===-1)return t;let r=t.slice(n);if(!/^={1,2}$/.test(r)||t.slice(0,n).includes(`=`))throw Error(`Invalid base64 padding`);return t.slice(0,n)},ln=(e,t)=>{if(e>=65&&e<=90)return e-65;if(e>=97&&e<=122)return e-97+26;if(e>=48&&e<=57)return e-48+52;if(e===43)return 62;if(e===47)return 63;throw Error(`Invalid base64 character at index ${t}`)};function un(e){let t=cn(e),n=[],r=0,i=0;for(let e=0;e<t.length;e++){let a=ln(t.codePointAt(e),e);for(r=r<<6|a,i+=6;i>=8;)i-=8,n.push(r>>i&255),r&=(1<<i)-1}return n}function dn(e){return Array.from(new TextEncoder().encode(e))}var fn=e=>new TextDecoder().decode(e instanceof Uint8Array?e:new Uint8Array(e)),pn=(e,t)=>{switch(t){case`hex`:return tn(e);case`utf8`:return fn(e);default:return e}};function mn(e){let t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,n=``,r=0;for(;r<e.length;r+=3){let i=e[r],a=r+1<e.length?e[r+1]:0,o=r+2<e.length?e[r+2]:0,s=i>>2,c=(i&3)<<4|a>>4,l=(a&15)<<2|o>>6,u=o&63;n+=t.charAt(s)+t.charAt(c),n+=r+1<e.length?t.charAt(l):`=`,n+=r+2<e.length?t.charAt(u):`=`}return n}var hn=`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`,gn=e=>{if(e===``||typeof e!=`string`)throw Error(`Expected base58 string but got “${e}”`);let t=e.match(/[^1-9A-HJ-NP-Za-km-z]/gmu);if(t!==null)throw Error(`Invalid base58 character “${t.join(``)}”`);let n=e.match(/^1+/gmu),r=n===null?0:n[0].length,i=(e.length-r)*(Math.log(58)/Math.log(256))+1>>>0;return[...new Uint8Array([...new Uint8Array(r),...Array.from(e).map(e=>hn.indexOf(e)).reduce((e,t)=>(e=e.map(e=>{let n=e*58+t;return t=n>>8,n}),e),new Uint8Array(i)).reverse().filter((e=>t=>e||=t)(!1))])]},_n=e=>{let t=Array.from({length:256},()=>-1);for(let e=0;e<58;++e)t[hn.codePointAt(e)]=e;let n=[];for(let r of e){let e=r;for(let r=0;r<n.length;++r){let i=(t[n[r]]<<8)+e,a=Math.trunc(i/58),o=i-a*58;n[r]=hn.codePointAt(o),e=a}for(;e!==0;){let t=Math.trunc(e/58),r=e-t*58;n.push(hn.codePointAt(r)),e=t}}for(let t of e)if(t===0)n.push(`1`.codePointAt(0));else break;return n.reverse(),String.fromCodePoint(...n)},vn=(e,t=[0])=>{let n=$e([...t,...e]);return n=[...t,...e,...n.slice(0,4)],_n(n)},yn=(e,t,n=1)=>{let r=gn(e),i=r.slice(0,n),a=r.slice(n,-4),o=[...i,...a];return o=$e(o),r.slice(-4).forEach((e,t)=>{if(e!==o[t])throw Error(`Invalid checksum`)}),t===`hex`&&(i=tn(i),a=tn(a)),{prefix:i,data:a}},bn=class e{bufs;length;constructor(e){this.bufs=e??[],this.length=0;for(let e of this.bufs)this.length+=e.length}getLength(){return this.length}toUint8Array(){let e=new Uint8Array(this.length),t=0;for(let n of this.bufs)e.set(n,t),t+=n.length;return e}toArray(){let e=this.length,t=Array.from({length:e},()=>0),n=0;for(let e of this.bufs)if(e instanceof Uint8Array)for(let r of e)t[n++]=r;else{let r=e;for(let e of r)t[n++]=e}return t}toHex(){return this.toArray().map(e=>e.toString(16).padStart(2,`0`)).join(``)}write(e){return this.bufs.push(e),this.length+=e.length,this}writeReverse(e){let t=Array.from({length:e.length},()=>0);for(let n=0;n<t.length;n++)t[n]=e[e.length-1-n];return this.write(t)}writeUInt8(e){let t=Array.from({length:1},()=>0);return t[0]=e&255,this.write(t),this}writeInt8(e){return this.writeUInt8(e)}writeUInt16BE(e){let t=[e>>8&255,e&255];return this.write(t)}writeInt16BE(e){return this.writeUInt16BE(e&65535)}writeUInt16LE(e){let t=[e&255,e>>8&255];return this.write(t)}writeInt16LE(e){return this.writeUInt16LE(e&65535)}writeUInt32BE(e){let t=[e>>24&255,e>>16&255,e>>8&255,e&255];return this.write(t)}writeInt32BE(e){return this.writeUInt32BE(e>>>0)}writeUInt32LE(e){let t=[e&255,e>>8&255,e>>16&255,e>>24&255];return this.write(t)}writeInt32LE(e){return this.writeUInt32LE(e>>>0)}writeUInt64BEBn(e){let t=e.toArray(`be`,8);return this.write(t),this}writeUInt64LEBn(e){let t=e.toArray(`be`,8);return this.writeReverse(t),this}writeUInt64LE(e){if(e===-1)this.write(Array.from({length:8},()=>255));else{let t=new g(e).toArray(`be`,8);this.writeReverse(t)}return this}writeVarIntNum(t){let n=e.varIntNum(t);return this.write(n),this}writeVarIntBn(t){let n=e.varIntBn(t);return this.write(n),this}static varIntNum(e){let t;if(e<0)return this.varIntBn(new g(e));if(e<253)t=[e];else if(e<65536)t=[253,e&255,e>>8&255];else if(e<4294967296)t=[254,e&255,e>>8&255,e>>16&255,e>>24&255];else{let n=e&4294967295,r=Math.floor(e/4294967296)&4294967295;t=[255,n&255,n>>8&255,n>>16&255,n>>24&255,r&255,r>>8&255,r>>16&255,r>>24&255]}return t}static varIntBn(t){let n;if(t.isNeg()&&(t=t.add(wn)),t.ltn(253))n=[t.toNumber()];else if(t.ltn(65536)){let e=t.toNumber();n=[253,e&255,e>>8&255]}else if(t.lt(new g(4294967296))){let e=t.toNumber();n=[254,e&255,e>>8&255,e>>16&255,e>>24&255]}else{let r=new e;r.writeUInt8(255),r.writeUInt64LEBn(t),n=r.toArray()}return n}},xn=class{bin;pos;length;constructor(e=[],t=0){this.bin=e,this.pos=t,this.length=e.length}eof(){return this.pos>=this.length}read(e=this.length){let t=this.pos,n=this.pos+e;return this.pos=n,this.bin.slice(t,n)}readReverse(e=this.length){let t=Array.from({length:e},()=>0);for(let n=0;n<e;n++)t[n]=this.bin[this.pos+e-1-n];return this.pos+=e,t}readUInt8(){let e=this.bin[this.pos];return this.pos+=1,e}readInt8(){let e=this.bin[this.pos];return this.pos+=1,e&128?e-256:e}readUInt16BE(){let e=this.bin[this.pos]<<8|this.bin[this.pos+1];return this.pos+=2,e}readInt16BE(){let e=this.readUInt16BE();return e&32768?e-65536:e}readUInt16LE(){let e=this.bin[this.pos]|this.bin[this.pos+1]<<8;return this.pos+=2,e}readInt16LE(){let e=this.readUInt16LE();return e&32768?e-65536:e}readUInt32BE(){let e=this.bin[this.pos]*16777216+(this.bin[this.pos+1]<<16|this.bin[this.pos+2]<<8|this.bin[this.pos+3]);return this.pos+=4,e}readInt32BE(){let e=this.readUInt32BE();return e&2147483648?e-4294967296:e}readUInt32LE(){let e=(this.bin[this.pos]|this.bin[this.pos+1]<<8|this.bin[this.pos+2]<<16|this.bin[this.pos+3]<<24)>>>0;return this.pos+=4,e}readInt32LE(){let e=this.readUInt32LE();return e&2147483648?e-4294967296:e}readUInt64BEBn(){let e=new g(this.bin.slice(this.pos,this.pos+8));return this.pos+=8,e}readUInt64LEBn(){return new g(this.readReverse(8))}readInt64LEBn(){let e=new g(this.readReverse(8));return e.gte(Cn)&&(e=e.sub(wn)),e}readVarIntNum(e=!0){let t=this.readUInt8(),n;switch(t){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:if(n=e?this.readInt64LEBn():this.readUInt64LEBn(),n.lte(new g(2).pow(new g(53))))return n.toNumber();throw Error(`number too large to retain precision - use readVarIntBn`);default:return t}}readVarInt(){switch(this.bin[this.pos]){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}}readVarIntBn(){let e=this.readUInt8();switch(e){case 253:return new g(this.readUInt16LE());case 254:return new g(this.readUInt32LE());case 255:return this.readUInt64LEBn();default:return new g(e)}}},Sn=e=>{if(e.length===0)return e;let t=e.at(-1);if(t&127)return e;if(e.length===1)return[];if(e.at(-2)&128)return e;for(let n=e.length-1;n>0;n--)if(e[n-1]!==0)return e[n-1]&128?(e[n]=t,e.slice(0,n+1)):(e[n-1]|=t,e.slice(0,n));return[]},Cn=new g(2).pow(new g(63)),wn=new g(2).pow(new g(64));function Tn(e,t=`Expected a valid value, but got undefined or null.`){if(e==null)throw Error(t);return e}var En;function Dn(e,t){let n=e.andln(3)+t&3;return n===3?-1:n}function On(e,t,n,r){if(!(n&1))return 0;let i=e.andln(7)+t&7;return(i===3||i===5)&&r===2?-n:n}function kn(e,t){return 2*e===t+1?1-e:e}var An=class e{p;red;redN;zero;one;two;g;n;a;b;tinv;zeroA;threeA;endo;_endoWnafT1;_endoWnafT2;_wnafT1;_wnafT2;_wnafT3;_wnafT4;_bitLength;static assert(e,t=`Elliptic curve assertion failed`){if(!e)throw Error(t)}getNAF(e,t,n){let r=Array.from({length:Math.max(e.bitLength(),n)+1},()=>0);r.fill(0);let i=1<<t+1,a=e.clone();for(let e=0;e<r.length;e++){let t,n=a.andln(i-1);a.isOdd()?(t=n>(i>>1)-1?(i>>1)-n:n,a.isubn(t)):t=0,r[e]=t,a.iushrn(1)}return r}getJSF(e,t){let n=[[],[]];e=e.clone(),t=t.clone();let r=0,i=0;for(;e.cmpn(-r)>0||t.cmpn(-i)>0;){let a=Dn(e,r),o=Dn(t,i),s=On(e,r,a,o);n[0].push(s);let c=On(t,i,o,a);n[1].push(c),r=kn(r,s),i=kn(i,c),e.iushrn(1),t.iushrn(1)}return n}static cachedProperty(e,t,n){let r=`_`+t;e.prototype[t]=function(){return this[r]===void 0&&(this[r]=n.call(this)),this[r]}}static parseBytes(e){return typeof e==`string`?rn(e,`hex`):e}static intFromLE(e){return new g(e,`hex`,`le`)}constructor(){if(En===void 0)En=this;else return En;let e={prime:`k256`,p:`ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f`,a:`0`,b:`7`,n:`ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141`,h:`1`,beta:`7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee`,lambda:`5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72`,basis:[{a:`3086d221a7d46bcde86c90e49284eb15`,b:`-e4437ed6010e88286f547fa90abfe4c3`},{a:`114ca50f7a8e2f3f657c1108d9d44cfd8`,b:`3086d221a7d46bcde86c90e49284eb15`}],gRed:!1,g:[`79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798`,`483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8`,{doubles:{step:4,points:[[`e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a`,`f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821`],[`8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508`,`11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf`],[`175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739`,`d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695`],[`363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640`,`4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9`],[`8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c`,`4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36`],[`723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda`,`96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f`],[`eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa`,`5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999`],[`100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0`,`cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09`],[`e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d`,`9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d`],[`feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d`,`e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088`],[`da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1`,`9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d`],[`53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0`,`5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8`],[`8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047`,`10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a`],[`385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862`,`283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453`],[`6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7`,`7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160`],[`3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd`,`56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0`],[`85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83`,`7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6`],[`948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a`,`53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589`],[`6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8`,`bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17`],[`e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d`,`4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda`],[`e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725`,`7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd`],[`213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754`,`4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2`],[`4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c`,`17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6`],[`fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6`,`6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f`],[`76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39`,`c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01`],[`c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891`,`893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3`],[`d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b`,`febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f`],[`b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03`,`2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7`],[`e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d`,`eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78`],[`a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070`,`7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1`],[`90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4`,`e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150`],[`8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da`,`662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82`],[`e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11`,`1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc`],[`8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e`,`efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b`],[`e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41`,`2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51`],[`b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef`,`67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45`],[`d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8`,`db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120`],[`324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d`,`648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84`],[`4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96`,`35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d`],[`9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd`,`ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d`],[`6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5`,`9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8`],[`a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266`,`40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8`],[`7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71`,`34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac`],[`928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac`,`c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f`],[`85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751`,`1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962`],[`ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e`,`493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907`],[`827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241`,`c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec`],[`eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3`,`be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d`],[`e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f`,`4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414`],[`1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19`,`aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd`],[`146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be`,`b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0`],[`fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9`,`6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811`],[`da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2`,`8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1`],[`a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13`,`7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c`],[`174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c`,`ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73`],[`959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba`,`2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd`],[`d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151`,`e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405`],[`64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073`,`d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589`],[`8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458`,`38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e`],[`13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b`,`69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27`],[`bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366`,`d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1`],[`8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa`,`40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482`],[`8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0`,`620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945`],[`dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787`,`7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573`],[`f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e`,`ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82`]]},naf:{wnd:7,points:[[`f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9`,`388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672`],[`2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4`,`d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6`],[`5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc`,`6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da`],[`acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe`,`cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37`],[`774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb`,`d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b`],[`f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8`,`ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81`],[`d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e`,`581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58`],[`defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34`,`4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77`],[`2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c`,`85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a`],[`352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5`,`321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c`],[`2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f`,`2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67`],[`9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714`,`73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402`],[`daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729`,`a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55`],[`c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db`,`2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482`],[`6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4`,`e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82`],[`1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5`,`b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396`],[`605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479`,`2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49`],[`62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d`,`80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf`],[`80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f`,`1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a`],[`7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb`,`d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7`],[`d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9`,`eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933`],[`49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963`,`758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a`],[`77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74`,`958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6`],[`f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530`,`e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37`],[`463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b`,`5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e`],[`f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247`,`cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6`],[`caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1`,`cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476`],[`2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120`,`4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40`],[`7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435`,`91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61`],[`754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18`,`673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683`],[`e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8`,`59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5`],[`186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb`,`3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b`],[`df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f`,`55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417`],[`5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143`,`efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868`],[`290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba`,`e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a`],[`af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45`,`f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6`],[`766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a`,`744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996`],[`59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e`,`c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e`],[`f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8`,`e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d`],[`7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c`,`30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2`],[`948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519`,`e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e`],[`7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab`,`100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437`],[`3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca`,`ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311`],[`d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf`,`8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4`],[`1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610`,`68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575`],[`733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4`,`f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d`],[`15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c`,`d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d`],[`a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940`,`edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629`],[`e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980`,`a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06`],[`311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3`,`66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374`],[`34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf`,`9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee`],[`f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63`,`4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1`],[`d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448`,`fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b`],[`32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf`,`5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661`],[`7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5`,`8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6`],[`ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6`,`8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e`],[`16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5`,`5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d`],[`eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99`,`f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc`],[`78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51`,`f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4`],[`494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5`,`42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c`],[`a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5`,`204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b`],[`c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997`,`4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913`],[`841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881`,`73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154`],[`5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5`,`39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865`],[`36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66`,`d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc`],[`336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726`,`ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224`],[`8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede`,`6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e`],[`1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94`,`60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6`],[`85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31`,`3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511`],[`29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51`,`b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b`],[`a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252`,`ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2`],[`4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5`,`cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c`],[`d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b`,`6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3`],[`ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4`,`322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d`],[`af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f`,`6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700`],[`e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889`,`2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4`],[`591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246`,`b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196`],[`11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984`,`998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4`],[`3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a`,`b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257`],[`cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030`,`bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13`],[`c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197`,`6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096`],[`c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593`,`c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38`],[`a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef`,`21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f`],[`347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38`,`60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448`],[`da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a`,`49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a`],[`c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111`,`5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4`],[`4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502`,`7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437`],[`3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea`,`be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7`],[`cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26`,`8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d`],[`b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986`,`39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a`],[`d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e`,`62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54`],[`48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4`,`25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77`],[`dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda`,`ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517`],[`6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859`,`cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10`],[`e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f`,`f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125`],[`eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c`,`6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e`],[`13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942`,`fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1`],[`ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a`,`1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2`],[`b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80`,`5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423`],[`ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d`,`438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8`],[`8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1`,`cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758`],[`52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63`,`c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375`],[`e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352`,`6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d`],[`7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193`,`ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec`],[`5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00`,`9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0`],[`32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58`,`ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c`],[`e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7`,`d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4`],[`8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8`,`c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f`],[`4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e`,`67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649`],[`3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d`,`cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826`],[`674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b`,`299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5`],[`d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f`,`f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87`],[`30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6`,`462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b`],[`be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297`,`62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc`],[`93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a`,`7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c`],[`b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c`,`ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f`],[`d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52`,`4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a`],[`d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb`,`bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46`],[`463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065`,`bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f`],[`7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917`,`603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03`],[`74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9`,`cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08`],[`30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3`,`553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8`],[`9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57`,`712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373`],[`176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66`,`ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3`],[`75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8`,`9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8`],[`809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721`,`9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1`],[`1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180`,`4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9`]]}}]};this.p=new g(e.p,16),this.red=new y(e.prime),this.zero=new g(0).toRed(this.red),this.one=new g(1).toRed(this.red),this.two=new g(2).toRed(this.red),this.n=new g(e.n,16),this.g=dr.fromJSON(e.g,e.gRed),this._wnafT1=Array.from({length:4},()=>void 0),this._wnafT2=Array.from({length:4},()=>void 0),this._wnafT3=Array.from({length:4},()=>void 0),this._wnafT4=Array.from({length:4},()=>void 0),this._bitLength=this.n.bitLength(),this.redN=this.n.toRed(this.red),this.a=new g(e.a,16).toRed(this.red),this.b=new g(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(e),this._endoWnafT1=Array.from({length:4},()=>void 0),this._endoWnafT2=Array.from({length:4},()=>void 0)}_getEndomorphism(e){if(!this.zeroA||this.p.modrn(3)!==1)return;let t=this._resolveEndomorphismBeta(e),n=this._resolveEndomorphismLambda(e,t);return{beta:t,lambda:n,basis:this._resolveEndomorphismBasis(e,n)}}_resolveEndomorphismBeta(e){if(e.beta!==void 0)return new g(e.beta,16).toRed(this.red);let t=this._getEndoRoots(this.p);if(t==null)throw Error(`Failed to get endomorphism roots for beta.`);return(t[0].cmp(t[1])<0?t[0]:t[1]).toRed(this.red)}_endomorphismLambdaMatches(e,t,n=!1){if(this.g==null)throw Error(`Curve generator point (g) is not defined.`);let r=this.g.mul(e)?.x,i=this.g.x==null?void 0:this.g.x.redMul(t);if(r==null||i==null){if(n)throw Error(`Lambda computation failed: g.mul(lambda).x or g.x.redMul(beta) is undefined.`);return!1}return r.cmp(i)===0}_resolveEndomorphismLambda(t,n){if(t.lambda!==void 0)return new g(t.lambda,16);let r=this._getEndoRoots(this.n);if(r==null)throw Error(`Failed to get endomorphism roots for lambda.`);return this._endomorphismLambdaMatches(r[0],n)?r[0]:(e.assert(this._endomorphismLambdaMatches(r[1],n,!0),`Lambda selection does not match computed beta.`),r[1])}_resolveEndomorphismBasis(e,t){return typeof e.basis!=`object`||e.basis===null?this._getEndoBasis(t):e.basis.map(e=>({a:new g(e.a,16),b:new g(e.b,16)}))}_getEndoRoots(e){let t=e===this.p?this.red:new b(e),n=new g(2).toRed(t).redInvm(),r=n.redNeg(),i=new g(3).toRed(t).redNeg().redSqrt().redMul(n);return[r.redAdd(i).fromRed(),r.redSub(i).fromRed()]}_getEndoBasis(e){let t=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=e,r=this.n.clone(),i=new g(1),a=new g(0),o=new g(0),s=new g(1),c,l,u,d,f,p,m=new g(0),h=0,_=new g(0),v=new g(0);for(;n.cmpn(0)!==0;){let e=r.div(n);_=r.sub(e.mul(n)),v=o.sub(e.mul(i));let f=s.sub(e.mul(a));if(u===void 0&&_.cmp(t)<0)c=m.neg(),l=i,u=_.neg(),d=v;else if(u!==void 0&&++h===2)break;m=_,r=n,n=_,o=i,i=v,s=a,a=f}if(c===void 0||l===void 0||u===void 0||d===void 0)throw Error(`Failed to compute Endo Basis values`);f=_.neg(),p=v;let y=u.sqr().add(d.sqr());return f.sqr().add(p.sqr()).cmp(y)>=0&&(f=c,p=l),u.negative!==0&&(u=u.neg(),d=d.neg()),f.negative!==0&&(f=f.neg(),p=p.neg()),[{a:u,b:d},{a:f,b:p}]}_endoSplit(e){if(this.endo==null)throw Error(`Endomorphism is not defined.`);let t=this.endo.basis,n=t[0],r=t[1],i=r.b.mul(e).divRound(this.n),a=n.b.neg().mul(e).divRound(this.n),o=i.mul(n.a),s=a.mul(r.a),c=i.mul(n.b),l=a.mul(r.b);return{k1:e.sub(o).sub(s),k2:c.add(l).neg()}}validate(e){if(e.inf)return!0;let t=e.x,n=e.y;if(t===null||n===null)throw Error(`Point coordinates cannot be null`);let r=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return n.redSqr().redISub(i).cmpn(0)===0}},jn=class{curve;type;precomputed;constructor(e){this.curve=new An,this.type=e,this.precomputed=null}},Mn=class e extends jn{x;y;z;zOne;constructor(e,t,n){super(`jacobian`),e===null&&t===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new g(0)):(g.isBN(e)||(e=new g(e,16)),this.x=e,g.isBN(t)||(t=new g(t,16)),this.y=t,g.isBN(n)||(n=new g(n,16)),this.z=n),this.x.red??(this.x=this.x.toRed(this.curve.red)),this.y.red??(this.y=this.y.toRed(this.curve.red)),this.z.red??(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.isInfinity()&&(this.x=this.curve.one,this.y=this.curve.one,this.z=new g(0).toRed(this.curve.red),this.zOne=!1)}toP(){if(this.isInfinity())return new dr(null,null);let e=this.z.redInvm(),t=e.redSqr();return new dr(this.x.redMul(t),this.y.redMul(t).redMul(e))}neg(){return new e(this.x,this.y.redNeg(),this.z)}add(t){if(this.isInfinity())return t;if(t.isInfinity())return this;let n=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(n),a=t.x.redMul(r),o=this.y.redMul(n.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),c=i.redSub(a),l=o.redSub(s);if(c.cmpn(0)===0)return l.cmpn(0)===0?this.dbl():new e(null,null,null);let u=c.redSqr(),d=u.redMul(c),f=i.redMul(u),p=l.redSqr().redIAdd(d).redISub(f).redISub(f),m=l.redMul(f.redISub(p)).redISub(o.redMul(d)),h=this.z.redMul(t.z).redMul(c);return new e(p,m,h)}mixedAdd(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;if(t.x===null||t.y===null)throw Error(`Point coordinates cannot be null`);let n=this.z.redSqr(),r=this.x,i=t.x.redMul(n),a=this.y,o=t.y.redMul(n).redMul(this.z),s=r.redSub(i),c=a.redSub(o);if(s.cmpn(0)===0)return c.cmpn(0)===0?this.dbl():new e(null,null,null);let l=s.redSqr(),u=l.redMul(s),d=r.redMul(l),f=c.redSqr().redIAdd(u).redISub(d).redISub(d),p=c.redMul(d.redISub(f)).redISub(a.redMul(u)),m=this.z.redMul(s);return new e(f,p,m)}dblp(e){if(e===0||this.isInfinity())return this;if(e===void 0)return this.dbl();let t=this;for(let n=0;n<e;n++)t=t.dbl();return t}dbl(){if(this.isInfinity())return this;let t,n,r;if(this.zOne){let e=this.x.redSqr(),i=this.y.redSqr(),a=i.redSqr(),o=this.x.redAdd(i).redSqr().redISub(e).redISub(a);o=o.redIAdd(o);let s=e.redAdd(e).redIAdd(e),c=s.redSqr().redISub(o).redISub(o),l=a.redIAdd(a);l=l.redIAdd(l),l=l.redIAdd(l),t=c,n=s.redMul(o.redISub(c)).redISub(l),r=this.y.redAdd(this.y)}else{let e=this.x.redSqr(),i=this.y.redSqr(),a=i.redSqr(),o=this.x.redAdd(i).redSqr().redISub(e).redISub(a);o=o.redIAdd(o);let s=e.redAdd(e).redIAdd(e),c=s.redSqr(),l=a.redIAdd(a);l=l.redIAdd(l),l=l.redIAdd(l),t=c.redISub(o).redISub(o),n=s.redMul(o.redISub(t)).redISub(l),r=this.y.redMul(this.z),r=r.redIAdd(r)}return new e(t,n,r)}eq(e){if(e.type===`affine`)return this.eq(e.toJ());if(this===e||(e=e,this.isInfinity()&&e.isInfinity()))return!0;if(this.isInfinity()!==e.isInfinity())return!1;let t=this.z.redSqr(),n=e.z.redSqr();if(this.x.redMul(n).redISub(e.x.redMul(t)).cmpn(0)!==0)return!1;let r=t.redMul(this.z),i=n.redMul(e.z);return this.y.redMul(i).redISub(e.y.redMul(r)).cmpn(0)===0}eqXToP(e){let t=this.z.redSqr(),n=e.toRed(this.curve?.red).redMul(t);if(this.x.cmp(n)===0)return!0;let r=e.clone();if(this.curve?.redN==null)throw Error(`Curve or redN is not initialized.`);let i=this.curve.redN.redMul(t);for(;r.cmp(this.curve.p)<0;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(i),this.x.cmp(n)===0)return!0}return!1}inspect(){return this.isInfinity()?`<EC JPoint Infinity>`:`<EC JPoint x: `+this.x.toString(16,2)+` y: `+this.y.toString(16,2)+` z: `+this.z.toString(16,2)+`>`}isInfinity(){return this.z.cmpn(0)===0}};function Nn(e,t,n){let r=-e,i=(t.X^n.X)&r,a=(t.Y^n.Y)&r,o=(t.Z^n.Z)&r;t.X^=i,n.X^=i,t.Y^=a,n.Y^=a,t.Z^=o,n.Z^=o}var Pn=0n,Fn=1n,In=2n,Ln=3n,Rn=4n,zn=8n,Bn=115792089237316195423570985008687907853269984665640564039457584007908834671663n,Vn=115792089237316195423570985008687907852837564279074904382605163141518161494337n,Hn=(1n<<256n)-1n;function Un(e){let t=e>>256n;return e=(e&Hn)+(t<<32n)+t*977n,t=e>>256n,e=(e&Hn)+(t<<32n)+t*977n,e>=115792089237316195423570985008687907853269984665640564039457584007908834671663n&&(e-=Bn),e}var Wn=e=>Un((e%Bn+Bn)%Bn),Gn=(e,t)=>e>=t?e-t:Bn-(t-e),O=(e,t)=>Un(e*t),Kn=(e,t)=>Un(e+t),qn=e=>{let t=Fn,n=Pn,r=Wn(e),i=Bn;for(;r>Fn;){let e=i/r;[t,n]=[n-t*e,t],[r,i]=[i-r*e,r]}return Wn(t)},Jn=e=>O(e,e),Yn=(e,t)=>{let n=1n;for(e=Wn(e);t>0n;)(t&1n)!=0n&&(n=O(n,e)),e=O(e,e),t>>=1n;return n},Xn=115792089237316195423570985008687907853269984665640564039457584007908834671664n>>2n,Zn=e=>{let t=Yn(e,Xn);return O(t,t)===Wn(e)?t:null},Qn=e=>g.isBN(e)?BigInt(`0x`+e.toString(16)):BigInt(typeof e==`string`?`0x`+e:Array.isArray(e)?`0x`+tn(e):e),$n=BigInt(`0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798`),er=BigInt(`0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8`),tr=new Map,nr=e=>{let{X:t,Y:n,Z:r}=e;if(n===0n)return{X:Pn,Y:Fn,Z:Pn};let i=O(n,n),a=O(Rn,O(t,i)),o=O(Ln,O(t,t)),s=Gn(O(o,o),O(In,a));return{X:s,Y:Gn(O(o,Gn(a,s)),O(zn,O(i,i))),Z:O(In,O(n,r))}},rr=(e,t)=>{if(e.Z===0n)return t;if(t.Z===0n)return e;let n=O(e.Z,e.Z),r=O(t.Z,t.Z),i=O(e.X,r),a=O(t.X,n),o=O(e.Y,O(r,t.Z)),s=O(t.Y,O(n,e.Z)),c=Gn(a,i),l=Gn(s,o);if(c===0n)return l===0n?nr(e):{X:Pn,Y:Fn,Z:Pn};let u=O(c,c),d=O(c,u),f=O(i,u),p=Gn(Gn(O(l,l),d),O(In,f));return{X:p,Y:Gn(O(l,Gn(f,p)),O(o,d)),Z:O(c,O(e.Z,t.Z))}},ir=e=>e.Z===0n?e:{X:e.X,Y:Bn-e.Y,Z:e.Z},ar=(e,t)=>{let n=`${e}:${t.x.toString(16)}:${t.y.toString(16)}`,r=tr.get(n);if(r!==void 0)return r;let i=Array.from({length:1<<e-1},()=>({X:Pn,Y:Fn,Z:Pn})),a={X:t.x,Y:t.y,Z:Fn};i[0]=a;let o=nr(a);for(let e=1;e<i.length;e++)i[e]=rr(i[e-1],o);return tr.set(n,i),i},or=(e,t)=>{let n=[],r=1n<<BigInt(t),i=r>>1n,a=e;for(;a>0n;){if((a&1n)==0n)n.push(0);else{let e=a&r-1n;e>i&&(e-=r),n.push(Number(e)),a-=e}a>>=Fn}return n},sr=(e,t,n=5)=>{let r=ar(n,t),i=or(e,n),a={X:Pn,Y:Fn,Z:Pn};for(let e=i.length-1;e>=0;e--){a=nr(a);let t=i[e];if(t!==0){let e=Math.abs(t)>>1,n=t>0?r[e]:ir(r[e]);a=rr(a,n)}}return a},cr=e=>{let t=e%Vn;return t<0n&&(t+=Vn),t},lr=(e,t)=>cr(e*t),ur=e=>{let t=1n,n=0n,r=cr(e),i=Vn;for(;r>1n;){let e=i/r;[t,n]=[n-t*e,t],[r,i]=[i-r*e,r]}return cr(t)},dr=class e extends jn{x;y;inf;static _assertOnCurve(e){if(!e.validate())throw Error(`Invalid point`);return e}static fromDER(t){if((t[0]===4||t[0]===6||t[0]===7)&&t.length-1==64){if(t[0]===6){if(t.at(-1)%2!=0)throw Error(`Point string value is wrong length`)}else if(t[0]===7&&t.at(-1)%2!=1)throw Error(`Point string value is wrong length`);let n=new e(t.slice(1,33),t.slice(33,65));return e._assertOnCurve(n)}if((t[0]===2||t[0]===3)&&t.length-1==32)return e._assertOnCurve(e.fromX(t.slice(1,33),t[0]===3));throw Error(`Unknown point format`)}static fromString(t){let n=rn(t,`hex`);return e._assertOnCurve(e.fromDER(n))}static fromX(t,n){let r=Qn(t);r=Wn(r);let i=Zn(Kn(O(Jn(r),r),7n));if(i===null)throw Error(`Invalid point`);let a=i;(a&1n)!=(n?1n:0n)&&(a=Gn(Bn,a));let o=new g(r.toString(16),16),s=new g(a.toString(16),16);return e._assertOnCurve(new e(o,s))}static fromJSON(t,n){typeof t==`string`&&(t=JSON.parse(t));let r=new e(t[0],t[1],n);if(r=e._assertOnCurve(r),typeof t[2]!=`object`||t[2]===null)return r;let i=t[2],a=t=>{let r=new e(t[0],t[1],n);return e._assertOnCurve(r)};return r.precomputed={beta:null,doubles:typeof i.doubles==`object`&&i.doubles!==null?{step:i.doubles.step,points:[r].concat(i.doubles.points.map(a))}:void 0,naf:typeof i.naf==`object`&&i.naf!==null?{wnd:i.naf.wnd,points:[r].concat(i.naf.points.map(a))}:void 0},r}constructor(e,t,n=!0){super(`affine`),this.precomputed=null,e===null&&t===null?(this.x=null,this.y=null,this.inf=!0):(g.isBN(e)||(e=new g(e,16)),this.x=e,g.isBN(t)||(t=new g(t,16)),this.y=t,n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red===null&&(this.x=this.x.toRed(this.curve.red)),this.y.red===null&&(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}validate(){if(this.inf||this.x==null||this.y==null)return!1;try{let e=BigInt(`0x`+this.x.fromRed().toString(16)),t=BigInt(`0x`+this.y.fromRed().toString(16));return O(t,t)===Kn(O(O(e,e),e),7n)}catch{return!1}}encode(e=!0,t){if(this.inf)return t===`hex`?`00`:[0];let n=this.curve.p.byteLength(),r=this.getX().toArray(`be`,n),i;return i=e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray(`be`,n)),t===`hex`?tn(i):i}toString(){return this.encode(!0,`hex`)}toJSON(){return this.precomputed==null?[this.x,this.y]:[this.x,this.y,typeof this.precomputed==`object`&&this.precomputed!==null?{doubles:this.precomputed.doubles==null?void 0:{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf==null?void 0:{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}:void 0]}inspect(){return this.isInfinity()?`<EC Point Infinity>`:`<EC Point x: `+(this.x?.fromRed()?.toString(16,2)??`undefined`)+` y: `+(this.y?.fromRed()?.toString(16,2)??`undefined`)+`>`}isInfinity(){return this.inf}add(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t)||this.x?.cmp(t.x??new g(0))===0)return new e(null,null);let n=rr({X:BigInt(`0x`+this.x.fromRed().toString(16)),Y:BigInt(`0x`+this.y.fromRed().toString(16)),Z:Fn},{X:BigInt(`0x`+t.x.fromRed().toString(16)),Y:BigInt(`0x`+t.y.fromRed().toString(16)),Z:Fn});if(n.Z===0n)return new e(null,null);let r=qn(n.Z),i=O(r,r),a=O(n.X,i),o=O(n.Y,O(i,r));return new e(a.toString(16),o.toString(16))}dbl(){if(this.inf)return this;if(this.x===null||this.y===null)throw Error(`Point coordinates cannot be null`);let t=BigInt(`0x`+this.x.fromRed().toString(16)),n=BigInt(`0x`+this.y.fromRed().toString(16));if(n===0n)return new e(null,null);let r=nr({X:t,Y:n,Z:Fn}),i=qn(r.Z),a=O(i,i),o=O(r.X,a),s=O(r.Y,O(a,i));return new e(o.toString(16),s.toString(16))}getX(){return(this.x??new g(0)).fromRed()}getY(){return(this.y??new g(0)).fromRed()}mul(t){if(g.isBN(t)||(t=new g(t,16)),t=t,this.inf)return this;let n=t.isNeg(),r=n?t.neg():t,i=BigInt(`0x`+r.toString(16));if(i=Wn(i),i===0n||i===0n)return new e(null,null);if(this.x===null||this.y===null)throw Error(`Point coordinates cannot be null`);let a,o;this===this.curve.g?(a=$n,o=er):(a=BigInt(`0x`+this.x.fromRed().toString(16)),o=BigInt(`0x`+this.y.fromRed().toString(16)));let s=sr(i,{x:a,y:o});if(s.Z===0n)return new e(null,null);let c=qn(s.Z),l=O(c,c),u=O(s.X,l),d=O(s.Y,O(l,c)),f=new g(u.toString(16),16),p=new g(d.toString(16),16),m=new e(f,p);return n?m.neg():m}mulCT(t){if(g.isBN(t)||(t=new g(t,16)),t=t,this.inf)return new e(null,null);let n=t.isNeg(),r=n?t.neg():t,i=BigInt(`0x`+r.toString(16));if(i=Wn(i),i===0n)return new e(null,null);let a=this===this.curve.g?$n:BigInt(`0x`+this.getX().toString(16)),o=this===this.curve.g?er:BigInt(`0x`+this.getY().toString(16)),s={X:0n,Y:1n,Z:0n},c={X:a,Y:o,Z:1n},l=i.toString(2);for(let e of l){let t=e===`1`?1n:0n;Nn(t,s,c),c=rr(s,c),s=nr(s),Nn(t,s,c)}if(s.Z===0n)return new e(null,null);let u=qn(s.Z),d=O(u,u),f=O(s.X,d),p=O(s.Y,O(d,u)),m=new e(f.toString(16),p.toString(16));return n?m.neg():m}mulAdd(e,t,n){let r=[this,t],i=[e,n];return this._endoWnafMulAdd(r,i)}jmulAdd(e,t,n){let r=[this,t],i=[e,n];return this._endoWnafMulAdd(r,i,!0)}eq(e){return this===e||this.inf===e.inf&&(this.inf||(this.x??new g(0)).cmp(e.x??new g(0))===0&&(this.y??new g(0)).cmp(e.y??new g(0))===0)}neg(t){if(this.inf)return this;let n=new e(this.x,(this.y??new g(0)).redNeg());if(t===!0&&this.precomputed!=null){let e=this.precomputed;n.precomputed={naf:e.naf==null?void 0:{wnd:e.naf.wnd,points:e.naf.points.map(e=>e.neg())},doubles:e.doubles==null?void 0:{step:e.doubles.step,points:e.doubles.points.map(e=>e.neg())},beta:void 0}}return n}dblp(e){let t;for(let n=0;n<e;n++)t=(t??this).dbl();return t??this}toJ(){return this.inf?new Mn(null,null,null):new Mn(this.x,this.y,this.curve.one)}_getBeta(){if(typeof this.curve.endo!=`object`)return;let t=this.precomputed;if(typeof t==`object`&&t&&typeof t.beta==`object`&&t.beta!==null)return t.beta;let n=new e((this.x??new g(0)).redMul(this.curve.endo.beta),this.y);if(t!=null){let r=this.curve,i=t=>{let n=t;if(n.x===null)throw Error(`p.x is null`);if(r.endo===void 0||r.endo===null)throw Error(`curve.endo is undefined`);return new e(n.x.redMul(r.endo.beta),n.y)};t.beta=n,n.precomputed={beta:null,naf:t.naf==null?void 0:{wnd:t.naf.wnd,points:t.naf.points.map(i)},doubles:t.doubles==null?void 0:{step:t.doubles.step,points:t.doubles.points.map(i)}}}return n}_fixedNafMul(e){if(typeof this.precomputed!=`object`||this.precomputed===null)throw Error(`_fixedNafMul requires precomputed values for the point`);let t=this._getDoubles(),n=this.curve.getNAF(e,1,this.curve._bitLength),r=(1<<t.step+1)-(t.step%2==0?2:1);r/=3;let i=[];for(let e=0;e<n.length;e+=t.step){let r=0;for(let i=e+t.step-1;i>=e;i--)r=(r<<1)+n[i];i.push(r)}let a=new Mn(null,null,null),o=new Mn(null,null,null);for(let e=r;e>0;e--){for(let n=0;n<i.length;n++){let r=i[n];r===e?o=o.mixedAdd(t.points[n]):r===-e&&(o=o.mixedAdd(t.points[n].neg()))}a=a.add(o)}return a.toP()}_prepareWnafWindows(e,t,n,r,i){for(let a=0;a<n;a++){let n=t[a]._getNAFPoints(e);r[a]=n.wnd,i[a]=n.points}}_combineWnafPair(e,t,n){let{points:r,coeffs:i,wndWidth:a,wnd:o,naf:s,currentMax:c}=n;if(a[e]!==1||a[t]!==1)return s[e]=this.curve.getNAF(i[e],a[e],this.curve._bitLength),s[t]=this.curve.getNAF(i[t],a[t],this.curve._bitLength),Math.max(c,s[e].length,s[t].length);let l=[r[e],null,null,r[t]],u=r[e].y??new g(0),d=r[t].y??new g(0);u.cmp(d)===0?(l[1]=r[e].add(r[t]),l[2]=r[e].toJ().mixedAdd(r[t].neg())):u.cmp(d.redNeg())===0?(l[1]=r[e].toJ().mixedAdd(r[t]),l[2]=r[e].add(r[t].neg())):(l[1]=r[e].toJ().mixedAdd(r[t]),l[2]=r[e].toJ().mixedAdd(r[t].neg()));let f=[-3,-1,-5,-7,0,7,5,1,3],p=this.curve.getJSF(i[e],i[t]),m=Math.max(c,p[0].length);s[e]=Array.from({length:m}),s[t]=Array.from({length:m});for(let n=0;n<m;n++){let r=Math.trunc(p[0][n]),i=Math.trunc(p[1][n]);s[e][n]=f[(r+1)*3+(i+1)],s[t][n]=0,o[e]=l}return m}_prepareWnafRepresentations(e,t,n,r,i,a){let o=0;for(let s=n-1;s>=1;s-=2)o=this._combineWnafPair(s-1,s,{points:e,coeffs:t,wndWidth:r,wnd:i,naf:a,currentMax:o});return o}_collectWnafStep(e,t,n,r){let i=e,a=0;for(;i>=0;){let e=!0;for(let a=0;a<t;a++)r[a]=new g(typeof n[a][i]==`number`?n[a][i]:0),r[a].isZero()||(e=!1);if(!e)break;a++,i--}return i>=0&&a++,{index:i,doubles:a}}_addWnafStep(e,t,n,r){let i=new g(1),a=new g(2),o=e;for(let e=0;e<t;e++){let t=n[e];if(t.cmpn(0)===0)continue;let s=t.isNeg()?r[e][t.neg().sub(i).div(a).toNumber()].neg():r[e][t.sub(i).div(a).toNumber()];o=s.type===`affine`?o.mixedAdd(s):o.add(s)}return o}_wnafMulAdd(e,t,n,r,i){let a=this.curve._wnafT1.length,o=Array.from({length:a}),s=Array.from({length:a},()=>[]),c=Array.from({length:a},()=>[]);this._prepareWnafWindows(e,t,r,o,s);let l=this._prepareWnafRepresentations(t,n,r,o,s,c),u=new Mn(null,null,null),d=this.curve._wnafT4,f=l;for(;f>=0;){let e=this._collectWnafStep(f,r,c,d);if(f=e.index,u=u.dblp(e.doubles),f<0)break;u=this._addWnafStep(u,r,d,s),f--}for(let e=0;e<r;e++)s[e]=[];return i===!0?u:u.toP()}_endoWnafMulAdd(t,n,r){let i=Array.from({length:t.length*2}),a=Array.from({length:t.length*2}),o=0;for(;o<t.length;o++){let r=this.curve._endoSplit(n[o]),s=t[o],c=s._getBeta()??new e(null,null);r.k1.negative!==0&&(r.k1.ineg(),s=s.neg(!0)),r.k2.negative!==0&&(r.k2.ineg(),c=c.neg(!0)),i[o*2]=s,i[o*2+1]=c,a[o*2]=r.k1,a[o*2+1]=r.k2}let s=this._wnafMulAdd(1,i,a,o*2,r);for(let e=0;e<o*2;e++)i[e]=null,a[e]=null;return s}_hasDoubles(e){if(this.precomputed==null)return!1;let t=this.precomputed.doubles;return typeof t==`object`&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)}_getDoubles(e,t){if(typeof this.precomputed==`object`&&this.precomputed!==null&&typeof this.precomputed.doubles==`object`&&this.precomputed.doubles!==null)return this.precomputed.doubles;let n=[this],r;for(let i=0;i<(t??0);i+=e??1){for(let t=0;t<(e??1);t++)r=(r??this).dbl();n.push(r)}return{step:e??1,points:n}}_getNAFPoints(e){if(typeof this.precomputed==`object`&&this.precomputed!==null&&typeof this.precomputed.naf==`object`&&this.precomputed.naf!==null)return this.precomputed.naf;let t=[this],n=(1<<e)-1,r=n===1?null:this.dbl();for(let e=1;e<n;e++)r!==null&&(t[e]=t[e-1].add(r));return{wnd:e,points:t}}},fr=class e extends dr{static fromPrivateKey(t){let n=new An().g.mul(t);return new e(n.x,n.y)}static fromString(t){let n=dr.fromString(t);return new e(n.x,n.y)}static fromDER(t){let n=dr.fromDER(t);return new e(n.x,n.y)}constructor(e,t=null,n=!0){if(e instanceof dr)super(e.getX(),e.getY());else{if(t===null&&n&&typeof e==`string`&&(e.length===66||e.length===130))throw Error(`You are using the "new PublicKey()" constructor with a DER hex string. You need to use "PublicKey.fromString()" instead.`);super(e,t,n)}}deriveSharedSecret(e){if(!this.validate())throw Error(`Public key not valid for ECDH secret derivation`);return this.mulCT(e)}verify(e,t,n){return Tr(new g(Qe(e,n),16),t,this)}toDER(e){return e===`hex`?this.encode(!0,e):this.encode(!0)}toHash(e){let t=et(this.encode(!0));return e===`hex`?tn(t):t}toAddress(e=[0]){if(typeof e==`string`){if(e===`testnet`||e===`test`)e=[111];else if(e===`mainnet`||e===`main`)e=[0];else throw Error(`Invalid prefix ${e}`)}return vn(this.toHash(),e)}deriveChild(t,n,r,i){let a;if(typeof i==`function`){let e=i(t,this);e===void 0?(a=this.deriveSharedSecret(t),typeof r==`function`&&r(t,this,a)):a=e}else a=this.deriveSharedSecret(t);let o=rn(n,`utf8`),s=tt(a.encode(!0),o),c=new An().g.mul(new g(s)),l=this.add(c);return new e(l.x,l.y)}static fromMsgHashAndCompactSignature(e,t,n){let r=rn(t,n);if(r.length!==65)throw Error(`Invalid Compact Signature`);let i=r[0];if(i<27||i>=35)throw Error(`Invalid Compact Byte`);let a=r[0]-27;return a>3&&(a-=4),new pr(new g(r.slice(1,33)),new g(r.slice(33,65))).RecoverPublicKey(a,e)}},pr=class e{r;s;static fromDER(t,n){let r=(e,t)=>{let n=e[t.place++];if(n&128)throw Error(`Invalid DER entity length`);return n};class i{place=0}t=rn(t,n);let a=new i;if(t[a.place++]!==48)throw Error(`Signature DER must start with 0x30`);if(r(t,a)+a.place!==t.length||t[a.place++]!==2)throw Error(`Signature DER invalid`);let o=r(t,a),s=t.slice(a.place,o+a.place);if(a.place+=o,t[a.place++]!==2)throw Error(`Signature DER invalid`);let c=r(t,a);if(t.length!==c+a.place)throw Error(`Invalid R-length in signature DER`);let l=t.slice(a.place,c+a.place);if(s[0]===0){if(s[1]&128)s=s.slice(1);else throw Error(`Invalid R-value in signature DER`)}if(l[0]===0){if(l[1]&128)l=l.slice(1);else throw Error(`Invalid S-value in signature DER`)}return new e(new g(s),new g(l))}static fromCompact(t,n){if(t=rn(t,n),t.length!==65)throw Error(`Invalid Compact Signature`);let r=t[0];if(r<27||r>=35)throw Error(`Invalid Compact Byte`);return new e(new g(t.slice(1,33)),new g(t.slice(33,65)))}constructor(e,t){this.r=e,this.s=t}verify(e,t,n){return Tr(new g(Qe(e,n),16),this,t)}toString(e){return this.toDER(e)}toDER(e){let t=(e,t)=>{if(t<128)e.push(t);else throw Error(`len must be < 0x80`)},n=e=>{let t=0,n=e.length-1;for(;e[t]===0&&!(e[t+1]&128)&&t<n;)t++;return t===0?e:e.slice(t)},r=this.r.toArray(),i=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),i[0]&128&&(i=[0].concat(i)),r=n(r),i=n(i);i[0]===0&&!(i[1]&128);)i=i.slice(1);let a=[2];t(a,r.length),a=a.concat(r),a.push(2),t(a,i.length);let o=a.concat(i),s=[48];return t(s,o.length),s=s.concat(o),e===`hex`?tn(s):e===`base64`?mn(s):s}toCompact(e,t,n){if(e<0||e>3)throw Error(`Invalid recovery param`);if(typeof t!=`boolean`)throw TypeError(`Invalid compressed param`);let r=27+e;t&&(r+=4);let i=[r];return i=i.concat(this.r.toArray(`be`,32)),i=i.concat(this.s.toArray(`be`,32)),n===`hex`?tn(i):n===`base64`?mn(i):i}RecoverPublicKey(e,t){let n=this.r,r=this.s,i=!!(e&1),a=e>>1,o=new An,s=o.n,c=o.g,l=a===0?n:n.add(s),u=dr.fromX(l,i);if(!u.mul(s).isInfinity())throw Error(`nR is not at infinity`);let d=t.neg().umod(s),f=n.invm(s),p=f.mul(r).umod(s),m=f.mul(d).umod(s),h=new fr(c.mul(m).add(u.mul(p)));return h.validate(),h}CalculateRecoveryFactor(e,t){for(let n=0;n<4;n++){let r;try{r=this.RecoverPublicKey(n,t)}catch{continue}if(e.eq(r))return n}throw Error(`Unable to find valid recovery factor`)}},mr=class{K;V;constructor(e,t){let n=rn(e,`hex`),r=rn(t,`hex`);if(n.length!==32)throw Error(`Entropy must be exactly 32 bytes (256 bits)`);if(r.length!==32)throw Error(`Nonce must be exactly 32 bytes (256 bits)`);let i=n.concat(r);this.K=Array.from({length:32}),this.V=Array.from({length:32});for(let e=0;e<32;e++)this.K[e]=0,this.V[e]=1;this.update(i)}hmac(){return new Ke(this.K)}update(e){let t=this.hmac().update(this.V).update([0]);e!==void 0&&(t=t.update(e)),this.K=t.digest(),this.V=this.hmac().update(this.V).digest(),e!==void 0&&(this.K=this.hmac().update(this.V).update([1]).update(e).digest(),this.V=this.hmac().update(this.V).digest())}generate(e){let t=[];for(;t.length<e;)this.V=this.hmac().update(this.V).digest(),t=t.concat(this.V);let n=t.slice(0,e);return this.update(),tn(n)}};function hr(e,t,n=new An){let r=e.byteLength()*8-n.n.bitLength();return r>0&&e.iushrn(r),t!==!0&&e.cmp(n.n)>=0?e.sub(n.n):e}function gr(e){let t=e.toArray(`be`),n=0n;for(let e of t)n=n<<8n|BigInt(e);return n}var _r=new An,vr=_r.n.byteLength(),yr=_r.n.subn(1),br=Vn>>1n;function xr(e,t,n){let r;if(r=typeof e==`function`?e(t):e!==void 0&&g.isBN(e)?e:new g(n.generate(vr),16),r==null)throw Error(`k is undefined`);return hr(r,!0)}function Sr(e,t){if(e)throw Error(t)}function Cr(e,t,n,r,i){if(e.cmpn(1)<0||e.cmp(yr)>0)return Sr(i,`Invalid fixed custom K value (must be >1 and <N-1)`);let a=_r.g.mulCT(e);if(a.isInfinity())return Sr(i,`Invalid fixed custom K value (k·G at infinity)`);let o=cr(BigInt(`0x`+a.getX().toString(16)));if(o===0n)return Sr(i,`Invalid fixed custom K value (r == 0)`);let s=lr(ur(BigInt(`0x`+e.toString(16))),cr(t+lr(o,n)));return s===0n?Sr(i,`Invalid fixed custom K value (s == 0)`):(r&&s>br&&(s=Vn-s),new pr(new g(o.toString(16),16),new g(s.toString(16),16)))}var wr=(e,t,n=!1,r)=>{let i=_r.n.bitLength();if(e.bitLength()>i)throw Error(`ECDSA message is too large: expected <= ${i} bits. Callers must hash messages before signing.`);e=hr(e);let a=gr(e),o=gr(t),s=new mr(t.toArray(`be`,vr),e.toArray(`be`,vr)),c=g.isBN(r);for(let e=0;;e++){let t=Cr(xr(r,e,s),a,o,n,c);if(t!=null)return t}},Tr=(e,t,n)=>{let r=_r.n.bitLength();if(e.bitLength()>r)return!1;let i=gr(e);if(n.x==null||n.y==null)throw Error(`Invalid public key: missing coordinates.`);let a={x:gr(n.x),y:gr(n.y)},{r:o,s}={r:gr(t.r),s:gr(t.s)},c=i;if(o<=0n||o>=115792089237316195423570985008687907852837564279074904382605163141518161494337n||s<=0n||s>=115792089237316195423570985008687907852837564279074904382605163141518161494337n)return!1;let l=ur(s);if(l===0n)return!1;let u=lr(c,l),d=lr(o,l),f=rr(sr(u,{x:$n,y:er}),sr(d,a));if(f.Z===0n)return!1;let p=qn(f.Z),m=O(p,p);return cr(O(f.X,m))===o},Er=class{_rand;getRandomValues(e,t){let n=new Uint8Array(t);return e.crypto.getRandomValues(n),Array.from(n)}constructor(){let e=()=>{throw Error(`No secure random number generator is available in this environment.`)};if(this._rand=e,typeof globalThis<`u`&&typeof globalThis.crypto?.getRandomValues==`function`){this._rand=e=>this.getRandomValues(globalThis,e);return}if(globalThis.self!==void 0&&typeof globalThis.self.crypto?.getRandomValues==`function`){this._rand=e=>this.getRandomValues(globalThis.self,e);return}if(globalThis.window!==void 0&&typeof globalThis.window.crypto?.getRandomValues==`function`){this._rand=e=>this.getRandomValues(globalThis.window,e);return}if(typeof process<`u`&&typeof process.getBuiltinModule==`function`){let e=process.getBuiltinModule(`node:crypto`);if(typeof e?.randomBytes==`function`){this._rand=t=>Array.from(e.randomBytes(t));return}}this._rand=e}generate(e){return this._rand(e)}},Dr=null,Or=e=>(Dr??=new Er,Dr.generate(e)),kr=class e{x;y;constructor(e,t){let n=new An().p;this.x=e.umod(n),this.y=t.umod(n)}toString(){return _n(this.x.toArray())+`.`+_n(this.y.toArray())}static fromString(t){let[n,r]=t.split(`.`);return new e(new g(gn(n)),new g(gn(r)))}},Ar=class e{points;threshold;constructor(e,t){this.points=e,this.threshold=t??e.length}static fromPrivateKey(t,n){let r=new An().p,i=[new kr(new g(0),new g(t.toArray()))];for(let e=1;e<n;e++){let e=new g(Or(32)).umod(r),t=new g(Or(32)).umod(r);i.push(new kr(e,t))}return new e(i)}valueAt(e){let t=new An().p,n=new g(0);for(let r=0;r<this.threshold;r++){let i=this.points[r].y;for(let n=0;n<this.threshold;n++)if(r!==n){let a=this.points[n].x,o=this.points[r].x,s=e.sub(a).umod(t),c=o.sub(a).umod(t).invm(t),l=s.mul(c).umod(t);i=i.mul(l).umod(t)}n=n.add(i).umod(t)}return n}},jr=class e{points;threshold;integrity;constructor(e,t,n){this.points=e,this.threshold=t,this.integrity=n}static fromBackupFormat(t){let n=0,r=``,i=t.map((e,t)=>{let i=e.split(`.`);if(i.length!==4)throw Error(`Invalid share format in share `+t.toString()+`. Expected format: "x.y.t.i" - received `+e);let[a,o,s,c]=i;if(s===void 0)throw Error(`Threshold not found in share `+t.toString());if(c===void 0)throw Error(`Integrity not found in share `+t.toString());let l=Number.parseInt(s,10);if(t!==0&&n!==l)throw Error(`Threshold mismatch in share `+t.toString());if(t!==0&&r!==c)throw Error(`Integrity mismatch in share `+t.toString());return n=l,r=c,kr.fromString([a,o].join(`.`))});return new e(i,n,r)}toBackupFormat(){return this.points.map(e=>e.toString()+`.`+this.threshold.toString()+`.`+this.integrity)}},Mr=class e extends g{static fromRandom(){return new e(Or(32))}static fromString(t,n=`hex`){return new e(super.fromString(t,n).toArray())}static fromHex(t){return new e(super.fromHex(t,`big`))}static fromWif(t,n=1){let r=yn(t,void 0,n);if(r.data.length!==33)throw Error(`Invalid WIF length`);if(r.data[32]!==1)throw Error(`Invalid WIF padding`);return new e(r.data.slice(0,32))}constructor(e=0,t=10,n=`be`,r=`apply`){if(e instanceof g?(super(),e.copy(this)):super(e,t,n),r!==`nocheck`){let e=this.checkInField();if(!e.inField){if(r===`error`)throw Error(`Input is out of field`);g.move(this,e.modN)}}}checkInField(){let e=new An,t=this.mod(e.n);return{inField:this.cmp(t)===0,modN:t}}isValid(){return this.checkInField().inField}sign(e,t,n=!0,r){return wr(new g(Qe(e,t),16),this,n,r)}verify(e,t,n){return Tr(new g(Qe(e,n),16),t,this.toPublicKey())}toPublicKey(){let e=new An().g.mulCT(this);return new fr(e.x,e.y)}toWif(e=[128]){if(!this.isValid())throw Error(`Value is out of field`);return vn([...this.toArray(`be`,32),1],e)}toAddress(e=[0]){return this.toPublicKey().toAddress(e)}toHex(){return super.toHex(32)}toString(e=`hex`,t=64){return super.toString(e,t)}deriveSharedSecret(e){if(!e.validate())throw Error(`Public key not valid for ECDH secret derivation`);return e.mulCT(this)}deriveChild(t,n,r,i){let a;if(typeof i==`function`){let e=i(this,t);e===void 0?(a=this.deriveSharedSecret(t),typeof r==`function`&&r(this,t,a)):a=e}else a=this.deriveSharedSecret(t);let o=rn(n,`utf8`),s=tt(a.encode(!0),o),c=new An;return new e(this.add(new g(s)).mod(c.n).toArray())}toKeyShares(e,t){if(typeof e!=`number`||typeof t!=`number`)throw TypeError(`threshold and totalShares must be numbers`);if(e<2)throw Error(`threshold must be at least 2`);if(t<2)throw Error(`totalShares must be at least 2`);if(e>t)throw Error(`threshold should be less than or equal to totalShares`);let n=Ar.fromPrivateKey(this,e),r=[],i=new Set,a=new An,o=Or(64);for(let e=0;e<t;e++){let t,s=0;do if(t=new g(nt(o,[e,s,...Or(32)])).umod(a.p),s++,s>5)throw Error(`Failed to generate unique x coordinate after 5 attempts`);while(t.isZero()||i.has(t.toString()));i.add(t.toString());let c=n.valueAt(t);r.push(new kr(t,c))}return new jr(r,e,this.toPublicKey().toHash(`hex`).slice(0,8))}toBackupShares(e,t){return this.toKeyShares(e,t).toBackupFormat()}static fromBackupShares(t){return e.fromKeyShares(jr.fromBackupFormat(t))}static fromKeyShares(t){let{points:n,threshold:r,integrity:i}=t;if(r<2)throw Error(`threshold must be at least 2`);if(n.length<r)throw Error(`At least ${r} shares are required to reconstruct the private key`);for(let e=0;e<r;e++)for(let t=e+1;t<r;t++)if(n[e].x.eq(n[t].x))throw Error(`Duplicate share detected, each must be unique.`);let a=new Ar(n,r),o=new e(a.valueAt(new g(0)).toArray());if(o.toPublicKey().toHash(`hex`).slice(0,8)!==i)throw Error(`Integrity hash mismatch`);return o}},Nr={OP_0:0,OP_FALSE:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_1:81,OP_TRUE:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SPLIT:127,OP_NUM2BIN:128,OP_BIN2NUM:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_NOP1:176,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP2:177,OP_CHECKSEQUENCEVERIFY:178,OP_NOP3:178,OP_SUBSTR:179,OP_NOP4:179,OP_LEFT:180,OP_NOP5:180,OP_RIGHT:181,OP_NOP6:181,OP_LSHIFTNUM:182,OP_NOP7:182,OP_RSHIFTNUM:183,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_NOP11:186,OP_NOP12:187,OP_NOP13:188,OP_NOP14:189,OP_NOP15:190,OP_NOP16:191,OP_NOP17:192,OP_NOP18:193,OP_NOP19:194,OP_NOP20:195,OP_NOP21:196,OP_NOP22:197,OP_NOP23:198,OP_NOP24:199,OP_NOP25:200,OP_NOP26:201,OP_NOP27:202,OP_NOP28:203,OP_NOP29:204,OP_NOP30:205,OP_NOP31:206,OP_NOP32:207,OP_NOP33:208,OP_NOP34:209,OP_NOP35:210,OP_NOP36:211,OP_NOP37:212,OP_NOP38:213,OP_NOP39:214,OP_NOP40:215,OP_NOP41:216,OP_NOP42:217,OP_NOP43:218,OP_NOP44:219,OP_NOP45:220,OP_NOP46:221,OP_NOP47:222,OP_NOP48:223,OP_NOP49:224,OP_NOP50:225,OP_NOP51:226,OP_NOP52:227,OP_NOP53:228,OP_NOP54:229,OP_NOP55:230,OP_NOP56:231,OP_NOP57:232,OP_NOP58:233,OP_NOP59:234,OP_NOP60:235,OP_NOP61:236,OP_NOP62:237,OP_NOP63:238,OP_NOP64:239,OP_NOP65:240,OP_NOP66:241,OP_NOP67:242,OP_NOP68:243,OP_NOP69:244,OP_NOP70:245,OP_NOP71:246,OP_NOP72:247,OP_NOP73:248,OP_NOP77:252,OP_SMALLDATA:249,OP_SMALLINTEGER:250,OP_PUBKEYS:251,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255},k=Nr;for(let e of Object.keys(Nr)){let t=Nr[e];k[t]??=e}var Pr=typeof globalThis>`u`?void 0:globalThis.Buffer;function Fr(e){let t=e.data?.length??0;if(t===0||e.op===k.OP_RETURN||e.op<k.OP_PUSHDATA1)return[e.op];if(e.op===k.OP_PUSHDATA1)return[e.op,t&255];if(e.op===k.OP_PUSHDATA2)return[e.op,t&255,t>>8&255];if(e.op===k.OP_PUSHDATA4){let n=t>>>0;return[e.op,n&255,n>>8&255,n>>16&255,n>>24&255]}}function Ir(e,t){let n=Fr(e),r=e.data??[];if(n==null||t.length!==n.length+r.length)return!1;for(let e=0;e<n.length;e++)if(t[e]!==n[e])return!1;for(let e=0;e<r.length;e++)if(t[n.length+e]!==r[e])return!1;return!0}var Lr=class e{_chunks;parsed;rawBytesCache;hexCache;static fromASM(t){let n=[],r=t.split(` `),i=0;for(;i<r.length;){let{chunk:t,advance:a}=e.parseASMToken(r,i);n.push(t),i+=a}return new e(n)}static pushdataOpCodeNum(e){return e>=0&&e<k.OP_PUSHDATA1?e:e<256?k.OP_PUSHDATA1:e<2**16?k.OP_PUSHDATA2:k.OP_PUSHDATA4}static parseASMToken(t,n){let r=t[n];if(r===`0`)return{chunk:{op:0},advance:1};if(r===`-1`)return{chunk:{op:k.OP_1NEGATE},advance:1};let i=r.startsWith(`OP_`)&&k[r]!==void 0,a=i?k[r]:0;if(a===k.OP_PUSHDATA1||a===k.OP_PUSHDATA2||a===k.OP_PUSHDATA4)return{chunk:{data:rn(t[n+2],`hex`),op:a},advance:3};if(!i){let t=r;t.length%2!=0&&(t=`0`+t);let n=rn(t,`hex`);if(pn(n,`hex`)!==t)throw Error(`invalid hex string in script`);return{chunk:{data:n,op:e.pushdataOpCodeNum(n.length)},advance:1}}return{chunk:{op:a},advance:1}}static fromHex(t){if(t.length===0)return e.fromBinary([]);if(t.length%2!=0)throw Error(`There is an uneven number of characters in the string which suggests it is not hex encoded.`);if(!/^[0-9a-fA-F]+$/.test(t))throw Error(`Some elements in this string are not hex encoded.`);let n=sn(t);return new e([],n,t.toLowerCase(),!1)}static fromBinary(t){let n=Uint8Array.from(t);return new e([],n,void 0,!1)}static fromBinaryView(t){return new e([],t,void 0,!1)}constructor(e=[],t,n,r=!0){this._chunks=e,this.parsed=r,this.rawBytesCache=t,this.hexCache=n}get chunks(){return this.ensureParsed(),this._chunks}set chunks(e){this._chunks=e,this.parsed=!0,this.invalidateSerializationCaches()}ensureParsed(){this.parsed||=(this._chunks=this.rawBytesCache==null?[]:e.parseChunks(this.rawBytesCache),!0)}toASM(){let e=``;for(let t of this.chunks)e+=this._chunkToString(t);return e.slice(1)}toHex(){if(this.hexCache!=null)return this.hexCache;this.rawBytesCache??=this.serializeChunksToBytes();let e=Pr==null?pn(Array.from(this.rawBytesCache),`hex`):Pr.from(this.rawBytesCache).toString(`hex`);return this.hexCache=e,e}toBinary(){return Array.from(this.toUint8Array())}toUint8Array(){return this.rawBytesCache??=this.serializeChunksToBytes(),this.rawBytesCache}writeScript(e){return this.invalidateSerializationCaches(),this.chunks=this.chunks.concat(e.chunks),this}writeOpCode(e){return this.invalidateSerializationCaches(),this.chunks.push({op:e}),this}setChunkOpCode(e,t){return this.invalidateSerializationCaches(),this.chunks[e]={op:t},this}writeBn(e){if(this.invalidateSerializationCaches(),e.cmpn(0)===k.OP_0)this.chunks.push({op:k.OP_0});else if(e.cmpn(-1)===0)this.chunks.push({op:k.OP_1NEGATE});else if(e.cmpn(1)>=0&&e.cmpn(16)<=0)this.chunks.push({op:e.toNumber()+k.OP_1-1});else{let t=e.toSm(`little`);this.writeBin(t)}return this}writeBin(e){this.invalidateSerializationCaches();let t,n=e.length>0?e:void 0;if(e.length>0&&e.length<k.OP_PUSHDATA1)t=e.length;else if(e.length===0)t=k.OP_0;else if(e.length<256)t=k.OP_PUSHDATA1;else if(e.length<2**16)t=k.OP_PUSHDATA2;else if(e.length<2**32)t=k.OP_PUSHDATA4;else throw Error(`You can't push that much data`);return this.chunks.push({data:n,op:t}),this}writeNumber(e){return this.invalidateSerializationCaches(),this.writeBn(new g(e)),this}removeCodeseparators(){let t=this.toUint8Array();return this.rawBytesCache=Uint8Array.from(e.removeOpcodeBytes(t,k.OP_CODESEPARATOR)),this.hexCache=void 0,this._chunks=[],this.parsed=!1,this}findAndDelete(e){this.invalidateSerializationCaches();let t=e.toUint8Array();if(t.length===0)return this;for(let e=0;e<this.chunks.length;)Ir(this.chunks[e],t)?this.chunks.splice(e,1):e++;return this}isPushOnly(){for(let e of this.chunks)if(e.op>k.OP_16)return!1;return!0}isLockingScript(){throw Error(`Not implemented`)}isUnlockingScript(){throw Error(`Not implemented`)}static computeSerializedLength(e){let t=0;for(let n of e){if(t+=1,n.data==null)continue;let e=n.data.length;if(n.op===k.OP_RETURN){t+=e;break}n.op<k.OP_PUSHDATA1?t+=e:n.op===k.OP_PUSHDATA1?t+=1+e:n.op===k.OP_PUSHDATA2?t+=2+e:n.op===k.OP_PUSHDATA4&&(t+=4+e)}return t}serializeChunksToBytes(){let t=this.chunks,n=e.computeSerializedLength(t),r=new Uint8Array(n),i=0;for(let n of t)if(r[i++]=n.op,n.data!=null){if(n.op===k.OP_RETURN){r.set(n.data,i);break}i=e.writeChunkData(r,i,n.op,n.data)}return r}invalidateSerializationCaches(){this.rawBytesCache=void 0,this.hexCache=void 0}static writeChunkData(e,t,n,r){let i=r.length;if(n<k.OP_PUSHDATA1)return e.set(r,t),t+i;if(n===k.OP_PUSHDATA1)return e[t++]=i&255,e.set(r,t),t+i;if(n===k.OP_PUSHDATA2)return e[t++]=i&255,e[t++]=i>>8&255,e.set(r,t),t+i;if(n===k.OP_PUSHDATA4){let n=i>>>0;return e[t++]=n&255,e[t++]=n>>8&255,e[t++]=n>>16&255,e[t++]=n>>24&255,e.set(r,t),t+i}return t}static readPushdataLength(e,t,n,r){if(e>0&&e<k.OP_PUSHDATA1)return{len:e,newPos:n,hasLength:!0};if(e===k.OP_PUSHDATA1){let e=n<r;return{len:e?t[n++]??0:0,newPos:n,hasLength:e}}if(e===k.OP_PUSHDATA2){let e=n+1<r;return{len:(t[n]??0)|(t[n+1]??0)<<8,newPos:Math.min(n+2,r),hasLength:e}}let i=n+3<r;return{len:((t[n]??0)|(t[n+1]??0)<<8|(t[n+2]??0)<<16|(t[n+3]??0)<<24)>>>0,newPos:Math.min(n+4,r),hasLength:i}}static parseChunks(t){let n=[],r=t.length,i=0,a=0;for(;i<r;){let o=t[i++]??0;if(o===k.OP_RETURN&&a===0){n.push({op:o,data:e.copyRange(t,i,r)});break}if(o===k.OP_IF||o===k.OP_NOTIF||o===k.OP_VERIF||o===k.OP_VERNOTIF?a++:o===k.OP_ENDIF&&a--,o>0&&o<=k.OP_PUSHDATA4){let{len:a,newPos:s,hasLength:c}=e.readPushdataLength(o,t,i,r);i=s;let l=Math.min(i+a,r),u=!c||l-i!==a;n.push({data:e.copyRange(t,i,l),op:o,invalidLength:u}),i=l}else n.push({op:o})}return n}static removeOpcodeBytes(t,n){let r=[],i=t.length,a=0;for(;a<i;){let o=a,s=t[a++]??0;if(s>0&&s<=k.OP_PUSHDATA4){let{len:c,newPos:l}=e.readPushdataLength(s,t,a,i);a=l;let u=Math.min(a+c,i);if(s!==n)for(let e=o;e<u;e++)r.push(t[e]??0);a=u}else s!==n&&r.push(s)}return r}static copyRange(e,t,n){let r=Math.max(n-t,0),i=Array.from({length:r},()=>0);for(let n=0;n<r;n++)i[n]=e[t+n]??0;return i}_chunkToString(e){let t=e.op,n=``;if(e.data===void 0){let e=k[t];n=`${n} ${e}`}else n=`${n} ${tn(e.data)}`;return n}},Rr=new Uint8Array,zr=Object.freeze(Array.from({length:32},()=>0));function Br(e,t){if(e.allInputs!=null)return e.allInputs;let n=[...e.otherInputs];return n.splice(e.inputIndex,0,t),n}function Vr(e,t,n,r){return r===t?n:e[r]}function Hr(e,t,n){let r=new bn;for(let i=0;i<e.length;i++){let a=Vr(e,t,n,i);if(a.sourceTXID==null){if(a.sourceTransaction==null)throw Error(`Missing sourceTransaction for input`);r.write(a.sourceTransaction.hash())}else r.writeReverse(rn(a.sourceTXID,`hex`));r.writeUInt32LE(a.sourceOutputIndex)}return $e(r.toUint8Array())}function Ur(e,t,n){let r=new bn;for(let i=0;i<e.length;i++){let a=Vr(e,t,n,i);r.writeUInt32LE(a.sequence??4294967295)}return $e(r.toUint8Array())}function Wr(e,t){e.writeUInt64LE(t.satoshis??0);let n=t.lockingScript?.toUint8Array()??Rr;e.writeVarIntNum(n.length),e.write(n)}function Gr(e,t){let n=new bn;if(t==null)for(let t of e)Wr(n,t);else{let r=e[t];if(r==null)throw Error(`Output at index ${t} does not exist`);Wr(n,r)}return $e(n.toUint8Array())}function Kr(e,t,n){if((e.scope&Yr.SIGHASH_ANYONECANPAY)!==0)return[...zr];if(e.cache?.hashPrevouts!=null)return e.cache.hashPrevouts;let r=Hr(t,e.inputIndex,n);return e.cache!=null&&(e.cache.hashPrevouts=r),r}function qr(e,t,n){let r=e.scope&31;if((e.scope&Yr.SIGHASH_ANYONECANPAY)!==0||r===Yr.SIGHASH_SINGLE||r===Yr.SIGHASH_NONE)return[...zr];if(e.cache?.hashSequence!=null)return e.cache.hashSequence;let i=Ur(t,e.inputIndex,n);return e.cache!=null&&(e.cache.hashSequence=i),i}function Jr(e){let t=e.scope&31;if(t!==Yr.SIGHASH_SINGLE&&t!==Yr.SIGHASH_NONE){if(e.cache?.hashOutputsAll!=null)return e.cache.hashOutputsAll;let t=Gr(e.outputs);return e.cache!=null&&(e.cache.hashOutputsAll=t),t}if(t!==Yr.SIGHASH_SINGLE||e.inputIndex>=e.outputs.length)return[...zr];let n=e.cache?.hashOutputsSingle?.get(e.inputIndex);if(n!=null)return n;let r=Gr(e.outputs,e.inputIndex);return e.cache!=null&&(e.cache.hashOutputsSingle??=new Map,e.cache.hashOutputsSingle.set(e.inputIndex,r)),r}var Yr=class e extends pr{static SIGHASH_ALL=1;static SIGHASH_NONE=2;static SIGHASH_SINGLE=3;static SIGHASH_CHRONICLE=32;static SIGHASH_FORKID=64;static SIGHASH_ANYONECANPAY=128;scope;static formatOTDA(t){let n=(t.scope&e.SIGHASH_ANYONECANPAY)===e.SIGHASH_ANYONECANPAY,r=(t.scope&31)===e.SIGHASH_SINGLE,i=(t.scope&31)===e.SIGHASH_NONE,a=(t.scope&31)===e.SIGHASH_ALL||!r&&!i,o=Lr.fromBinary(t.subscript.toBinary());o.removeCodeseparators();let s={sourceTXID:t.sourceTXID,sourceOutputIndex:t.sourceOutputIndex,sequence:t.inputSequence,script:o.toBinary()},c=new bn;function l(e){c.writeVarIntNum(e.length);for(let t of e)c.writeReverse(rn(t.sourceTXID,`hex`)),c.writeUInt32LE(t.sourceOutputIndex),c.writeVarIntNum(t.script.length),c.write(t.script),c.writeUInt32LE(t.sequence)}function u(e){c.writeVarIntNum(e.length);for(let t of e)c.writeUInt64LE(t.satoshis),c.writeVarIntNum(t.script.length),c.write(t.script)}c.writeInt32LE(t.transactionVersion);let d=new Lr().toBinary();if(n)n&&l([s]);else{let e=t.allInputs==null?t.otherInputs.map(e=>({sourceTXID:e.sourceTXID??e.sourceTransaction?.id(`hex`)??``,sourceOutputIndex:e.sourceOutputIndex,sequence:r||i?0:e.sequence??4294967295,script:d})):t.allInputs.map((e,n)=>n===t.inputIndex?s:{sourceTXID:e.sourceTXID??e.sourceTransaction?.id(`hex`)??``,sourceOutputIndex:e.sourceOutputIndex,sequence:r||i?0:e.sequence??4294967295,script:d});t.allInputs??e.splice(t.inputIndex,0,s),l(e)}if(a)u(t.outputs.map(e=>({satoshis:e.satoshis??0,script:e.lockingScript.toBinary()})));else if(r){let e=[];for(let n=0;n<t.inputIndex;n++)e.push({satoshis:-1,script:d});let n=t.outputs[t.inputIndex];n!==void 0&&e.push({satoshis:n.satoshis??0,script:n.lockingScript.toBinary()}),u(e)}else i&&u([]);return c.writeUInt32LE(t.lockTime),c.writeUInt32LE(t.scope>>>0),c.toUint8Array()}static formatBip143(e){let t={sourceTXID:e.sourceTXID,sourceOutputIndex:e.sourceOutputIndex,sequence:e.inputSequence},n=Br(e,t),r=Kr(e,n,t),i=qr(e,n,t),a=Jr(e),o=new bn;o.writeInt32LE(e.transactionVersion),o.write(r),o.write(i),o.writeReverse(rn(e.sourceTXID,`hex`)),o.writeUInt32LE(e.sourceOutputIndex);let s=e.subscript.toUint8Array();o.writeVarIntNum(s.length),o.write(s),o.writeUInt64LE(e.sourceSatoshis);let c=t.sequence??4294967295;return o.writeUInt32LE(c),o.write(a),o.writeUInt32LE(e.lockTime),o.writeUInt32LE(e.scope>>>0),o.toUint8Array()}static format(e){return Array.from(this.formatBytes(e))}static formatBytes(t){let n=(t.scope&e.SIGHASH_FORKID)!==0,r=t.ignoreChronicle!==!0&&(t.scope&e.SIGHASH_CHRONICLE)!==0;return n&&!r?e.formatBip143(t):!n||n&&r?e.formatOTDA(t):new Uint8Array}static usesOtdaSingleBug(t){let n=(t.scope&e.SIGHASH_FORKID)!==0,r=t.ignoreChronicle!==!0&&(t.scope&e.SIGHASH_CHRONICLE)!==0;return(!n||n&&r)&&(t.scope&31)===e.SIGHASH_SINGLE&&t.inputIndex>=t.outputs.length}static fromChecksigFormat(t){if(t.length===0){let t=new g(1),n=new g(1);return new e(t,n,1)}let n=t.at(-1),r=t.slice(0,-1),i=pr.fromDER(r);return new e(i.r,i.s,n)}constructor(e,t,n){super(e,t),this.scope=n}hasLowS(){return!(this.s.ltn(1)||this.s.gt(new g(`7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0`,`hex`)))}toChecksigFormat(){return[...this.toDER(),this.scope]}};function Xr(e,t,n){if(!(t instanceof Uint8Array))throw TypeError(`${e} returned a non-byte result`);if(n!==void 0&&t.length!==n)throw Error(`${e} returned ${t.length} bytes; expected ${n}`);return t}function Zr(){return globalThis}function Qr(e){let t=Zr().__bsvSdkAsyncCryptoBackendV1;if(t!==void 0){if(!t.isReady()){t.preload().catch(()=>{});return}return t.supportsCrypto(e)?t:void 0}}var $r=class extends Lr{isLockingScript(){return!0}isUnlockingScript(){return!1}},ei=class extends Lr{isLockingScript(){return!1}isUnlockingScript(){return!0}};function ti(e){return e==null?`null/undef`:e.length===void 0?`INVALID_STACK_ITEM`:tn(e)}var ni=class extends Error{txid;outputIndex;context;programCounter;stackState;altStackState;ifStackState;stackMem;altStackMem;constructor(e){let t=e.stackState.map(ti).join(`, `),n=e.altStackState.map(ti).join(`, `),r=`Context: ${e.context}, PC: ${e.programCounter}`,i=`Stack: [${t}] (len: ${e.stackState.length}, mem: ${e.stackMem})`,a=`AltStack: [${n}] (len: ${e.altStackState.length}, mem: ${e.altStackMem})`,o=`IfStack: [${e.ifStackState.join(`, `)}]`,s=`Script evaluation error: ${e.message}\nTXID: ${e.txid}, OutputIdx: ${e.outputIndex}\n${r}\n${i}\n${a}\n${o}`;super(s),this.name=this.constructor.name,this.txid=e.txid,this.outputIndex=e.outputIndex,this.context=e.context,this.programCounter=e.programCounter,this.stackState=e.stackState.map(e=>e.slice()),this.altStackState=e.altStackState.map(e=>e.slice()),this.ifStackState=e.ifStackState.slice(),this.stackMem=e.stackMem,this.altStackMem=e.altStackMem}},ri=class extends Error{resource;limit;attempted;constructor(e,t,n){let r={stack:`Stack memory usage`,"alt-stack":`Alt stack memory usage`,"element-size":`Script element allocation`}[e];super(`${r} has exceeded ${t} bytes`),this.resource=e,this.limit=t,this.attempted=n,this.name=`ScriptResourceLimitError`}};function ii(){return globalThis}function ai(){return ii().__bsvSdkScriptVerificationBackendV1}var oi=520,si=1e4,ci=500,li=4294967295n,ui=1e3,di=BigInt(2**31-1),fi=20,pi=2147483648,mi=Object.freeze(new g(-1).toScriptNum()),hi=Object.freeze(Array.from({length:17},(e,t)=>Object.freeze(new g(t).toScriptNum())));function gi(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function _i(e){return new g(+!!e)}function vi(e,t){return _i(e&&t)}function yi(e,t){return _i(e||t)}function bi(e,t){return e.cmp(t)<0?e:t}function xi(e,t){return e.cmp(t)>0?e:t}function Si(e,t=2**53-1){return!(e.length>t||e.length>0&&!(e.at(-1)&127)&&(e.length<=1||!(e.at(-2)&128)))}function Ci(e){if(e.length<9||e.length>73||e[0]!==48||e[1]!==e.length-3)return!1;let t=e[2],n=e[3];if(t!==2||n===0||5+n>=e.length)return!1;let r=4+n,i=e[r],a=e[r+1];if(i!==2||a===0||e[4]&128||n>1&&e[4]===0&&!(e[5]&128))return!1;let o=r+2;return!(e[o]&128||a>1&&e[o]===0&&!(e[o+1]&128)||n+a+7!==e.length)}function wi(e){let t=e.data,n=e.op;return Array.isArray(t)?t.length===0?n===k.OP_0:t.length===1&&t[0]>=1&&t[0]<=16?n===k.OP_1+(t[0]-1):t.length===1&&t[0]===129?n===k.OP_1NEGATE:t.length<=75?n===t.length:t.length<=255?n===k.OP_PUSHDATA1:t.length<=65535?n===k.OP_PUSHDATA2:!0:!0}var Ti=class{sourceTXID;sourceOutputIndex;sourceSatoshis;lockingScript;transactionVersion;otherInputs;allInputs;outputs;inputIndex;unlockingScript;inputSequence;lockTime;context;programCounter;lastCodeSeparator;stack;altStack;ifStack;elseStack;memoryLimit;hasExplicitMemoryLimit;stackMem;altStackMem;isRelaxedOverride;verifyFlags;executedOpCount;returningFromConditional;sigHashCache;ownsSigHashCache;constructor(e){if(this.sourceTXID=e.sourceTXID,this.sourceOutputIndex=e.sourceOutputIndex,this.sourceSatoshis=e.sourceSatoshis,this.lockingScript=e.lockingScript,this.transactionVersion=e.transactionVersion,this.otherInputs=e.otherInputs,this.allInputs=e.allInputs,this.outputs=e.outputs,this.inputIndex=e.inputIndex,this.unlockingScript=e.unlockingScript,this.inputSequence=e.inputSequence,this.lockTime=e.lockTime,this.hasExplicitMemoryLimit=e.memoryLimit!==void 0,this.memoryLimit=e.memoryLimit??1/0,this.isRelaxedOverride=e.isRelaxed===!0,e.verifyFlags===void 0)this.verifyFlags=void 0;else{let t=Array.isArray(e.verifyFlags)?e.verifyFlags:e.verifyFlags.split(`,`);this.verifyFlags=new Set(t.map(e=>e.trim()).filter(e=>e.length>0))}this.stack=[],this.altStack=[],this.ifStack=[],this.elseStack=[],this.stackMem=0,this.altStackMem=0,this.executedOpCount=0,this.returningFromConditional=!1,this.ownsSigHashCache=e.sigHashCache==null,this.sigHashCache=e.sigHashCache??{hashOutputsSingle:new Map},this.reset()}isRelaxed(){return this.isRelaxedOverride||this.transactionVersion>1}hasExplicitFlags(){return this.verifyFlags!==void 0}hasFlag(e){return this.verifyFlags?.has(e)===!0}isAfterGenesis(){return this.hasExplicitFlags()?this.hasFlag(`GENESIS`)||this.hasFlag(`UTXO_AFTER_GENESIS`)||this.hasFlag(`UTXO_AFTER_CHRONICLE`):this.isRelaxed()}isAfterChronicle(){return this.hasExplicitFlags()?this.hasFlag(`UTXO_AFTER_CHRONICLE`):this.isRelaxed()}shouldEnforceMinimalData(){return this.hasExplicitFlags()?this.hasFlag(`MINIMALDATA`):!this.isRelaxed()}shouldEnforceLowS(){return this.hasExplicitFlags()?this.hasFlag(`LOW_S`):!this.isRelaxed()}shouldEnforceNullDummy(){return this.hasExplicitFlags()?this.hasFlag(`NULLDUMMY`):!this.isRelaxed()}shouldEnforceSigPushOnly(){return this.hasExplicitFlags()?this.hasFlag(`SIGPUSHONLY`):!this.isRelaxed()}shouldEnforceCleanStack(){return this.hasExplicitFlags()?this.hasFlag(`CLEANSTACK`):!this.isRelaxed()}shouldEnforceDerSignatures(){return!this.hasExplicitFlags()||this.hasFlag(`DERSIG`)||this.hasFlag(`STRICTENC`)||this.hasFlag(`LOW_S`)||this.hasFlag(`SIGHASH_FORKID`)}shouldEnforceStrictEncoding(){return!this.hasExplicitFlags()||this.hasFlag(`STRICTENC`)||this.hasFlag(`SIGHASH_FORKID`)}scriptNumMaxSize(){if(this.hasExplicitFlags()&&!this.isAfterGenesis())return 4}maxPushSize(){return this.hasExplicitFlags()&&!this.isAfterGenesis()?oi:1/0}reset(){this.ownsSigHashCache&&(delete this.sigHashCache.hashPrevouts,delete this.sigHashCache.hashSequence,delete this.sigHashCache.hashOutputsAll,this.sigHashCache.hashOutputsSingle?.clear()),this.context=`UnlockingScript`,this.programCounter=0,this.lastCodeSeparator=null,this.stack=[],this.altStack=[],this.ifStack=[],this.elseStack=[],this.stackMem=0,this.altStackMem=0,this.executedOpCount=0,this.returningFromConditional=!1}ensureStackMem(e){if(this.stackMem+e>this.memoryLimit)throw new ri(`stack`,this.memoryLimit,this.stackMem+e)}ensureAltStackMem(e){if(this.altStackMem+e>this.memoryLimit)throw new ri(`alt-stack`,this.memoryLimit,this.altStackMem+e)}pushStack(e){this.ensureStackMem(e.length),this.stack.push(e),this.stackMem+=e.length}pushStackCopy(e){this.ensureStackMem(e.length);let t=e.slice();this.stack.push(t),this.stackMem+=t.length}popStack(){this.stack.length===0&&this.scriptEvaluationError(`Attempted to pop from an empty stack.`);let e=this.stack.pop();return e===void 0?(this.scriptEvaluationError(`Attempted to pop from an empty stack.`),[]):(this.stackMem-=e.length,e)}stackTop(e=-1){return(this.stack.length===0||this.stack.length<Math.abs(e)||e>=0&&e>=this.stack.length)&&this.scriptEvaluationError(`Stack underflow accessing element at index ${e}. Stack length is ${this.stack.length}.`),this.stack[this.stack.length+e]}requireStackItems(e,t){this.stack.length<e&&this.scriptEvaluationError(t)}requireAltStackItems(e,t){this.altStack.length<e&&this.scriptEvaluationError(t)}setStack(e){this.stack=e.map(e=>e.slice()),this.stackMem=this.stack.reduce((e,t)=>e+t.length,0)}clearAltStack(){this.altStack=[],this.altStackMem=0}pushAltStack(e){this.ensureAltStackMem(e.length),this.altStack.push(e),this.altStackMem+=e.length}popAltStack(){this.altStack.length===0&&this.scriptEvaluationError(`Attempted to pop from an empty alt stack.`);let e=this.altStack.pop();return e===void 0?(this.scriptEvaluationError(`Attempted to pop from an empty alt stack.`),[]):(this.altStackMem-=e.length,e)}readScriptNumber(e){try{return g.fromScriptNum(e,this.shouldEnforceMinimalData(),this.scriptNumMaxSize())}catch(e){let t=e instanceof Error?e.message:String(e);this.scriptEvaluationError(t)}return new g(0)}isDefinedHashType(e){let t=e&31;return t>=Yr.SIGHASH_ALL&&t<=Yr.SIGHASH_SINGLE}enforceSignatureHashType(e){this.shouldEnforceStrictEncoding()&&(this.isDefinedHashType(e.scope)||this.scriptEvaluationError(`The signature hash type is invalid.`),(e.scope&Yr.SIGHASH_CHRONICLE)!==0&&!this.isAfterChronicle()&&this.scriptEvaluationError(`The signature hash type is invalid before Chronicle.`))}enforceSignatureForkId(e){if(!this.hasExplicitFlags())return;let t=(e.scope&Yr.SIGHASH_FORKID)!==0;this.hasFlag(`SIGHASH_FORKID`)&&!t&&this.scriptEvaluationError(`The signature must use SIGHASH_FORKID.`),!this.hasFlag(`SIGHASH_FORKID`)&&!this.isAfterGenesis()&&t&&this.scriptEvaluationError(`The signature must not use SIGHASH_FORKID.`)}checkSignatureEncoding(e){if(e.length===0)return!0;let t=this.shouldEnforceDerSignatures();if(t&&!Ci(e))return this.scriptEvaluationError(`The signature format is invalid.`),!1;try{let t=Yr.fromChecksigFormat(e);if(this.enforceSignatureHashType(t),this.enforceSignatureForkId(t),this.shouldEnforceLowS()&&!t.hasLowS())return this.scriptEvaluationError(`The signature must have a low S value.`),!1}catch{if(t)return this.scriptEvaluationError(`The signature format is invalid.`),!1}return!0}parseChecksigSignature(e){try{return Yr.fromChecksigFormat(e)}catch(t){if(this.shouldEnforceDerSignatures())throw t;return this.parseLaxChecksigSignature(e)}}readLaxDERLength(e,t){let n=e[t.value++];if(n===void 0)throw Error(`Invalid DER length`);if(!(n&128))return n;let r=n&127;if(r===0||t.value+r>e.length)throw Error(`Invalid DER length`);let i=0;for(let n=0;n<r;n++)i=i<<8|(e[t.value++]??0);return i}parseLaxDERInteger(e,t,n){if(t.value>=n||e[t.value++]!==2)throw Error(`Invalid DER integer`);let r=this.readLaxDERLength(e,t);if(t.value+r>n)throw Error(`Invalid DER integer length`);let i=e.slice(t.value,t.value+r);for(t.value+=r;i.length>1&&i[0]===0;)i=i.slice(1);return i.length===0&&(i=[0]),new g(i)}parseLaxChecksigSignature(e){if(e.length===0)return Yr.fromChecksigFormat(e);let t=e.at(-1),n=e.slice(0,-1),r={value:0};if(n[r.value++]!==48)throw Error(`Signature DER must start with 0x30`);let i=this.readLaxDERLength(n,r),a=Math.min(r.value+i,n.length);return new Yr(this.parseLaxDERInteger(n,r,a),this.parseLaxDERInteger(n,r,a),t)}checkPublicKeyEncoding(e){if(!this.shouldEnforceStrictEncoding())return!0;if(e.length===0)return this.scriptEvaluationError(`Public key is empty.`),!1;if(e.length<33)return this.scriptEvaluationError(`The public key is too short, it must be at least 33 bytes.`),!1;if(e[0]===4){if(e.length!==65)return this.scriptEvaluationError(`The non-compressed public key must be 65 bytes.`),!1}else if(e[0]===2||e[0]===3){if(e.length!==33)return this.scriptEvaluationError(`The compressed public key must be 33 bytes.`),!1}else return this.scriptEvaluationError(`The public key is in an unknown format.`),!1;try{fr.fromDER(e)}catch{return this.scriptEvaluationError(`The public key is in an unknown format.`),!1}return!0}verifySignature(e,t,n){let r={sourceTXID:this.sourceTXID,sourceOutputIndex:this.sourceOutputIndex,sourceSatoshis:this.sourceSatoshis,transactionVersion:this.transactionVersion,otherInputs:this.otherInputs,allInputs:this.allInputs,outputs:this.outputs,inputIndex:this.inputIndex,subscript:n,inputSequence:this.inputSequence,lockTime:this.lockTime,scope:e.scope,cache:this.sigHashCache};return Tr(Yr.usesOtdaSingleBug(r)?new g([1,...Array.from({length:31},()=>0)]):new g($e(Yr.formatBytes(r))),e,t)}enforceStepResourceLimits(){if(this.stackMem>this.memoryLimit)throw new ri(`stack`,this.memoryLimit,this.stackMem);if(this.altStackMem>this.memoryLimit)throw new ri(`alt-stack`,this.memoryLimit,this.altStackMem)}currentScriptForStep(){return this.context===`UnlockingScript`&&this.programCounter>=this.unlockingScript.chunks.length&&(this.ifStack.length>0&&this.scriptEvaluationError(`Every OP_IF, OP_NOTIF, or OP_ELSE must be terminated with OP_ENDIF prior to the end of the unlocking script.`),this.clearAltStack(),this.ifStack=[],this.elseStack=[],this.returningFromConditional=!1,this.lastCodeSeparator=null,this.context=`LockingScript`,this.programCounter=0),this.context===`UnlockingScript`?this.unlockingScript:this.lockingScript}opcodeForOperation(e){let t=e.op;return t===void 0?(this.scriptEvaluationError(`Missing opcode in ${this.context} at pc=${this.programCounter}.`),0):(e.invalidLength===!0&&this.scriptEvaluationError(`Malformed push data in ${this.context} at pc=${this.programCounter}.`),Array.isArray(e.data)&&e.data.length>this.maxPushSize()&&this.scriptEvaluationError(`Data push > ${this.maxPushSize()} bytes (pc=${this.programCounter}).`),t)}enforceChronicleOnlyOpcode(e){this.hasExplicitFlags()&&!this.isAfterGenesis()&&!this.isAfterChronicle()&&(e===k.OP_2MUL||e===k.OP_2DIV||e===k.OP_VERIF||e===k.OP_VERNOTIF)&&this.scriptEvaluationError(`${k[e]} is disabled until Chronicle.`)}executeDataPush(e){this.shouldEnforceMinimalData()&&!wi(e)&&this.scriptEvaluationError(`This data is not minimally-encoded. (PC: ${this.programCounter})`),this.pushStack(Array.isArray(e.data)?e.data:[])}countExecutedOpcode(e,t){!t||e<=k.OP_16||(this.executedOpCount++,this.hasExplicitFlags()&&!this.isAfterGenesis()&&this.executedOpCount>ci&&this.scriptEvaluationError(`Script executed more than ${ci} opcodes.`))}skipUnavailablePreChronicleOpcode(e,t){return!this.hasExplicitFlags()||this.isAfterChronicle()?!1:t&&(e===k.OP_SUBSTR||e===k.OP_LEFT||e===k.OP_RIGHT||e===k.OP_LSHIFTNUM||e===k.OP_RSHIFTNUM)?(this.hasFlag(`DISCOURAGE_UPGRADABLE_NOPS`)&&this.scriptEvaluationError(`${k[e]} is discouraged by verification flags.`),this.programCounter++,!0):((t||!this.isAfterGenesis())&&(e===k.OP_2MUL||e===k.OP_2DIV)&&this.scriptEvaluationError(`${k[e]} is disabled until Chronicle.`),(t||!this.isAfterGenesis())&&(e===k.OP_VER||e===k.OP_VERIF||e===k.OP_VERNOTIF)&&this.scriptEvaluationError(`${k[e]} is disabled until Chronicle.`),!t&&this.isAfterGenesis()&&(e===k.OP_VERIF||e===k.OP_VERNOTIF)?(this.programCounter++,!0):!1)}enforceDiscouragedNop(e,t){t&&this.hasFlag(`DISCOURAGE_UPGRADABLE_NOPS`)&&(e===k.OP_NOP1||e===k.OP_CHECKLOCKTIMEVERIFY||e===k.OP_CHECKSEQUENCEVERIFY||e===k.OP_NOP9||e===k.OP_NOP10)&&this.scriptEvaluationError(`${k[e]} is discouraged by verification flags.`)}advanceAfterStep(e){this.returningFromConditional&&this.ifStack.length===0?this.programCounter=e.chunks.length:this.programCounter++,this.hasExplicitFlags()&&!this.isAfterGenesis()&&this.stack.length+this.altStack.length>ui&&this.scriptEvaluationError(`Stack item count has exceeded ${ui}.`)}step(){this.enforceStepResourceLimits();let e=this.currentScriptForStep();if(this.programCounter>=e.chunks.length)return!1;let t=e.chunks[this.programCounter],n=this.opcodeForOperation(t),r=!this.returningFromConditional&&!this.ifStack.includes(!1);if(this.enforceChronicleOnlyOpcode(n),r&&n>=0&&n<=k.OP_PUSHDATA4)this.executeDataPush(t);else if(r||n>=k.OP_IF&&n<=k.OP_ENDIF){let e,t,i,a,o,s,c,l,u,d,f,p,m,h,_,v,y,b,x,S,C,w,ee,te,ne,T;if(this.countExecutedOpcode(n,r),this.skipUnavailablePreChronicleOpcode(n,r))return!0;switch(this.enforceDiscouragedNop(n,r),n){case k.OP_VER:{let e=this.transactionVersion;this.pushStack([e&255,e>>>8&255,e>>>16&255,e>>>24&255]);break}case k.OP_SUBSTR:(()=>{this.stack.length<3&&this.scriptEvaluationError(`OP_SUBSTR requires at least three items to be on the stack.`);let t=this.readScriptNumber(this.popStack()).toNumber(),n=this.readScriptNumber(this.popStack()).toNumber();e=this.popStack();let r=e.length;(n<0||n>=r||t<0||t>r-n)&&this.scriptEvaluationError(`OP_SUBSTR offset (${n}) must be in range [0, ${r}) and length (${t}) must be in range [0, ${r-n}]`),this.pushStack(e.slice(n,n+t))})();break;case k.OP_LEFT:(()=>{this.stack.length<2&&this.scriptEvaluationError(`OP_LEFT requires at least two items to be on the stack.`);let t=this.readScriptNumber(this.popStack()).toNumber();e=this.popStack();let n=e.length;(t<0||t>n)&&this.scriptEvaluationError(`OP_LEFT length (${t}) must be in range [0, ${n}]`),this.pushStack(e.slice(0,t))})();break;case k.OP_RIGHT:(()=>{this.stack.length<2&&this.scriptEvaluationError(`OP_RIGHT requires at least two items to be on the stack.`);let t=this.readScriptNumber(this.popStack()).toNumber();e=this.popStack();let n=e.length;(t<0||t>n)&&this.scriptEvaluationError(`OP_RIGHT length (${t}) must be in range [0, ${n}]`),this.pushStack(e.slice(n-t))})();break;case k.OP_LSHIFTNUM:(()=>{this.stack.length<2&&this.scriptEvaluationError(`OP_LSHIFTNUM requires at least two items to be on the stack.`);let e=this.readScriptNumber(this.popStack()).toBigInt();e<0&&this.scriptEvaluationError(`OP_LSHIFTNUM bits to shift must not be negative.`);let t=new g(this.readScriptNumber(this.popStack()).toBigInt()<<e);this.pushStack(t.toScriptNum())})();break;case k.OP_RSHIFTNUM:(()=>{this.stack.length<2&&this.scriptEvaluationError(`OP_RSHIFTNUM requires at least two items to be on the stack.`);let e=this.readScriptNumber(this.popStack()).toBigInt();e<0&&this.scriptEvaluationError(`OP_RSHIFTNUM bits to shift must not be negative.`);let t=this.readScriptNumber(this.popStack()).toBigInt(),n;n=t<0?new g(-(-t>>e)):new g(t>>e),this.pushStack(n.toScriptNum())})();break;case k.OP_1NEGATE:this.pushStackCopy(mi);break;case k.OP_0:this.pushStackCopy(hi[0]);break;case k.OP_1:case k.OP_2:case k.OP_3:case k.OP_4:case k.OP_5:case k.OP_6:case k.OP_7:case k.OP_8:case k.OP_9:case k.OP_10:case k.OP_11:case k.OP_12:case k.OP_13:case k.OP_14:case k.OP_15:case k.OP_16:p=n-(k.OP_1-1),this.pushStackCopy(hi[p]);break;case k.OP_NOP:case k.OP_NOP1:case k.OP_CHECKLOCKTIMEVERIFY:break;case k.OP_CHECKSEQUENCEVERIFY:(()=>{if(this.hasFlag(`CHECKSEQUENCEVERIFY`)){this.stack.length<1&&this.scriptEvaluationError(`OP_CHECKSEQUENCEVERIFY requires at least one item to be on the stack.`);let e=0n;try{e=g.fromScriptNum(this.stackTop(),this.shouldEnforceMinimalData(),5).toBigInt()}catch{this.scriptEvaluationError(`OP_CHECKSEQUENCEVERIFY requires a minimally-encoded numeric lock time.`)}e<0n&&this.scriptEvaluationError(`OP_CHECKSEQUENCEVERIFY requires a non-negative lock time.`),Number(e&BigInt(pi))===0&&this.transactionVersion<2&&this.scriptEvaluationError(`OP_CHECKSEQUENCEVERIFY lock time is unsatisfied.`)}})();break;case k.OP_NOP9:case k.OP_NOP10:break;case k.OP_VERIF:case k.OP_VERNOTIF:(()=>{if(h=!1,r){if(this.stack.length<1&&this.scriptEvaluationError(`OP_VERIF and OP_VERNOTIF require at least one item on the stack when they are used!`),t=this.popStack(),t.length===4){let e=this.transactionVersion;i=[e&255,e>>>8&255,e>>>16&255,e>>>24&255],h=gi(t,i)}n===k.OP_VERNOTIF&&(h=!h)}this.ifStack.push(h),this.elseStack.push(!1)})();break;case k.OP_IF:case k.OP_NOTIF:h=!1,r&&(this.stack.length<1&&this.scriptEvaluationError(`OP_IF and OP_NOTIF require at least one item on the stack when they are used!`),e=this.popStack(),this.hasFlag(`MINIMALIF`)&&e.length>0&&(e.length!==1||e[0]!==1)&&this.scriptEvaluationError(`OP_IF and OP_NOTIF require minimal truth values.`),h=this.castToBool(e),n===k.OP_NOTIF&&(h=!h)),this.ifStack.push(h),this.elseStack.push(!1);break;case k.OP_ELSE:this.ifStack.length===0&&this.scriptEvaluationError(`OP_ELSE requires a preceeding OP_IF.`),this.hasExplicitFlags()&&this.isAfterGenesis()&&this.elseStack.at(-1)===!0&&this.scriptEvaluationError(`OP_ELSE may only be used once for each OP_IF or OP_NOTIF after Genesis.`),this.elseStack[this.elseStack.length-1]=!0,this.ifStack[this.ifStack.length-1]=this.ifStack.at(-1)!==!0;break;case k.OP_ENDIF:this.ifStack.length===0&&this.scriptEvaluationError(`OP_ENDIF requires a preceeding OP_IF.`),this.ifStack.pop(),this.elseStack.pop();break;case k.OP_VERIFY:this.stack.length<1&&this.scriptEvaluationError(`OP_VERIFY requires at least one item to be on the stack.`),t=this.stackTop(),h=this.castToBool(t),h||this.scriptEvaluationError(`OP_VERIFY requires the top stack value to be truthy.`),this.popStack();break;case k.OP_RETURN:this.hasExplicitFlags()&&!this.isAfterGenesis()&&this.scriptEvaluationError(`OP_RETURN is invalid before Genesis.`),this.ifStack.length>0?this.returningFromConditional=!0:(this.programCounter=this.context===`UnlockingScript`?this.unlockingScript.chunks.length:this.lockingScript.chunks.length,this.programCounter--);break;case k.OP_TOALTSTACK:this.requireStackItems(1,`OP_TOALTSTACK requires at oeast one item to be on the stack.`),this.pushAltStack(this.popStack());break;case k.OP_FROMALTSTACK:this.requireAltStackItems(1,`OP_FROMALTSTACK requires at least one item to be on the stack.`),this.pushStack(this.popAltStack());break;case k.OP_2DROP:this.requireStackItems(2,`OP_2DROP requires at least two items to be on the stack.`),this.popStack(),this.popStack();break;case k.OP_2DUP:this.requireStackItems(2,`OP_2DUP requires at least two items to be on the stack.`),t=this.stackTop(-2),i=this.stackTop(-1),this.pushStackCopy(t),this.pushStackCopy(i);break;case k.OP_3DUP:this.requireStackItems(3,`OP_3DUP requires at least three items to be on the stack.`),t=this.stackTop(-3),i=this.stackTop(-2),a=this.stackTop(-1),this.pushStackCopy(t),this.pushStackCopy(i),this.pushStackCopy(a);break;case k.OP_2OVER:this.requireStackItems(4,`OP_2OVER requires at least four items to be on the stack.`),t=this.stackTop(-4),i=this.stackTop(-3),this.pushStackCopy(t),this.pushStackCopy(i);break;case k.OP_2ROT:{this.requireStackItems(6,`OP_2ROT requires at least six items to be on the stack.`);let e=this.popStack(),t=this.popStack(),n=this.popStack(),r=this.popStack(),i=this.popStack(),a=this.popStack();this.pushStack(r),this.pushStack(n),this.pushStack(t),this.pushStack(e),this.pushStack(a),this.pushStack(i);break}case k.OP_2SWAP:{this.requireStackItems(4,`OP_2SWAP requires at least four items to be on the stack.`);let e=this.popStack(),t=this.popStack(),n=this.popStack(),r=this.popStack();this.pushStack(t),this.pushStack(e),this.pushStack(r),this.pushStack(n);break}case k.OP_IFDUP:this.requireStackItems(1,`OP_IFDUP requires at least one item to be on the stack.`),t=this.stackTop(),this.castToBool(t)&&this.pushStackCopy(t);break;case k.OP_DEPTH:this.pushStack(new g(this.stack.length).toScriptNum());break;case k.OP_DROP:this.requireStackItems(1,`OP_DROP requires at least one item to be on the stack.`),this.popStack();break;case k.OP_DUP:this.requireStackItems(1,`OP_DUP requires at least one item to be on the stack.`),this.pushStackCopy(this.stackTop());break;case k.OP_NIP:this.requireStackItems(2,`OP_NIP requires at least two items to be on the stack.`),i=this.popStack(),this.popStack(),this.pushStack(i);break;case k.OP_OVER:this.requireStackItems(2,`OP_OVER requires at least two items to be on the stack.`),this.pushStackCopy(this.stackTop(-2));break;case k.OP_PICK:case k.OP_ROLL:(()=>{this.requireStackItems(2,`${k[n]} requires at least two items to be on the stack.`),l=this.readScriptNumber(this.popStack());let e=l.toBigInt();(e<0n||e>=BigInt(this.stack.length))&&this.scriptEvaluationError(`${k[n]} requires the top stack element to be 0 or a positive number less than the current size of the stack.`);let t=Number(e),r=this.stack[this.stack.length-1-t];n===k.OP_ROLL?(this.stack.splice(this.stack.length-1-t,1),this.stackMem-=r.length,this.pushStack(r)):this.pushStackCopy(r)})();break;case k.OP_ROT:this.requireStackItems(3,`OP_ROT requires at least three items to be on the stack.`),c=this.popStack(),s=this.popStack(),o=this.popStack(),this.pushStack(s),this.pushStack(c),this.pushStack(o);break;case k.OP_SWAP:this.requireStackItems(2,`OP_SWAP requires at least two items to be on the stack.`),s=this.popStack(),o=this.popStack(),this.pushStack(s),this.pushStack(o);break;case k.OP_TUCK:this.requireStackItems(2,`OP_TUCK requires at least two items to be on the stack.`),t=this.stackTop(-1),this.ensureStackMem(t.length),this.stack.splice(-2,0,t.slice()),this.stackMem+=t.length;break;case k.OP_SIZE:this.requireStackItems(1,`OP_SIZE requires at least one item to be on the stack.`),this.pushStack(new g(this.stackTop().length).toScriptNum());break;case k.OP_AND:case k.OP_OR:case k.OP_XOR:(()=>{this.requireStackItems(2,`${k[n]} requires at least two items on the stack.`),i=this.popStack(),t=this.popStack(),t.length!==i.length&&this.scriptEvaluationError(`${k[n]} requires the top two stack items to be the same size.`);let e=Array.from({length:t.length},()=>0);for(let r=0;r<t.length;r++)n===k.OP_AND?e[r]=t[r]&i[r]:n===k.OP_OR?e[r]=t[r]|i[r]:e[r]=t[r]^i[r];this.pushStack(e)})();break;case k.OP_INVERT:(()=>{this.requireStackItems(1,`OP_INVERT requires at least one item to be on the stack.`),e=this.popStack();let t=Array.from({length:e.length},()=>0);for(let n=0;n<e.length;n++)t[n]=~e[n]&255;this.pushStack(t)})();break;case k.OP_LSHIFT:case k.OP_RSHIFT:(()=>{this.requireStackItems(2,`${k[n]} requires at least two items to be on the stack.`),d=this.readScriptNumber(this.popStack()),t=this.popStack();let e=d.toBigInt();if(e<0n&&this.scriptEvaluationError(`${k[n]} requires the top item on the stack not to be negative.`),t.length===0){this.pushStack([]);return}u=new g(t);let r;if(n===k.OP_LSHIFT){r=u.ushln(e);let n=new g(1).ushln(t.length*8).isubn(1);r=r.iand(n)}else r=u.ushrn(e);let i=r.toArray(`be`,t.length);this.pushStack(i)})();break;case k.OP_EQUAL:case k.OP_EQUALVERIFY:this.requireStackItems(2,`${k[n]} requires at least two items to be on the stack.`),i=this.popStack(),t=this.popStack(),h=gi(t,i),this.pushStack(h?[1]:[]),n===k.OP_EQUALVERIFY&&(h||this.scriptEvaluationError(`OP_EQUALVERIFY requires the top two stack items to be equal.`),this.popStack());break;case k.OP_1ADD:case k.OP_1SUB:case k.OP_2MUL:case k.OP_2DIV:case k.OP_NEGATE:case k.OP_ABS:case k.OP_NOT:case k.OP_0NOTEQUAL:(()=>{switch(this.requireStackItems(1,`${k[n]} requires at least one item to be on the stack.`),l=this.readScriptNumber(this.popStack()),n){case k.OP_1ADD:l=l.add(new g(1));break;case k.OP_1SUB:l=l.sub(new g(1));break;case k.OP_2MUL:l=l.mul(new g(2));break;case k.OP_2DIV:l=l.div(new g(2));break;case k.OP_NEGATE:l=l.neg();break;case k.OP_ABS:l.isNeg()&&(l=l.neg());break;case k.OP_NOT:l=new g(+(l.cmpn(0)===0));break;case k.OP_0NOTEQUAL:l=new g(l.cmpn(0)===0?0:1)}this.pushStack(l.toScriptNum())})();break;case k.OP_ADD:case k.OP_SUB:case k.OP_MUL:case k.OP_DIV:case k.OP_MOD:case k.OP_BOOLAND:case k.OP_BOOLOR:case k.OP_NUMEQUAL:case k.OP_NUMEQUALVERIFY:case k.OP_NUMNOTEQUAL:case k.OP_LESSTHAN:case k.OP_GREATERTHAN:case k.OP_LESSTHANOREQUAL:case k.OP_GREATERTHANOREQUAL:case k.OP_MIN:case k.OP_MAX:(()=>{this.requireStackItems(2,`${k[n]} requires at least two items to be on the stack.`),i=this.popStack(),t=this.popStack(),d=this.readScriptNumber(i),u=this.readScriptNumber(t);let e=(()=>{switch(n){case k.OP_MUL:return u.byteLength()+d.byteLength();case k.OP_ADD:case k.OP_SUB:return Math.max(u.byteLength(),d.byteLength())+1;default:return Math.max(u.byteLength(),d.byteLength())}})();this.ensureStackMem(e);let r=(()=>{switch(n){case k.OP_ADD:return u.add(d);case k.OP_SUB:return u.sub(d);case k.OP_MUL:return u.mul(d);case k.OP_DIV:return d.cmpn(0)===0&&this.scriptEvaluationError(`OP_DIV cannot divide by zero!`),u.div(d);case k.OP_MOD:return d.cmpn(0)===0&&this.scriptEvaluationError(`OP_MOD cannot divide by zero!`),u.mod(d);case k.OP_BOOLAND:return vi(u.cmpn(0)!==0,d.cmpn(0)!==0);case k.OP_BOOLOR:return yi(u.cmpn(0)!==0,d.cmpn(0)!==0);case k.OP_NUMEQUAL:case k.OP_NUMEQUALVERIFY:return _i(u.cmp(d)===0);case k.OP_NUMNOTEQUAL:return _i(u.cmp(d)!==0);case k.OP_LESSTHAN:return _i(u.cmp(d)<0);case k.OP_GREATERTHAN:return _i(u.cmp(d)>0);case k.OP_LESSTHANOREQUAL:return _i(u.cmp(d)<=0);case k.OP_GREATERTHANOREQUAL:return _i(u.cmp(d)>=0);case k.OP_MIN:return bi(u,d);case k.OP_MAX:return xi(u,d);default:return new g(0)}})();this.pushStack(r.toScriptNum()),n===k.OP_NUMEQUALVERIFY&&(this.castToBool(this.stackTop())||this.scriptEvaluationError(`OP_NUMEQUALVERIFY requires the top stack item to be truthy.`),this.popStack())})();break;case k.OP_WITHIN:this.requireStackItems(3,`OP_WITHIN requires at least three items to be on the stack.`),f=this.readScriptNumber(this.popStack()),d=this.readScriptNumber(this.popStack()),u=this.readScriptNumber(this.popStack()),h=u.cmp(d)>=0&&u.cmp(f)<0,this.pushStack(h?[1]:[]);break;case k.OP_RIPEMD160:case k.OP_SHA1:case k.OP_SHA256:case k.OP_HASH160:case k.OP_HASH256:(()=>{this.requireStackItems(1,`${k[n]} requires at least one item to be on the stack.`),e=this.popStack();let t=[];n===k.OP_RIPEMD160?t=Xe(e):n===k.OP_SHA1?t=Ze(e):n===k.OP_SHA256?t=Qe(e):n===k.OP_HASH160?t=et(e):n===k.OP_HASH256&&(t=$e(e)),this.pushStack(t)})();break;case k.OP_CODESEPARATOR:this.lastCodeSeparator=this.programCounter;break;case k.OP_CHECKSIG:case k.OP_CHECKSIGVERIFY:this.requireStackItems(2,`${k[n]} requires at least two items to be on the stack.`),b=this.popStack(),y=this.popStack(),(!this.checkSignatureEncoding(y)||!this.checkPublicKeyEncoding(b))&&this.scriptEvaluationError(`${k[n]} requires correct encoding for the public key and signature.`),_=(()=>{if(y.length===0)return!1;try{x=this.parseChecksigSignature(y);let e=(this.context===`UnlockingScript`?this.unlockingScript:this.lockingScript).chunks.slice(this.lastCodeSeparator===null?0:this.lastCodeSeparator+1);return this.context===`UnlockingScript`&&(e=e.concat(this.lockingScript.chunks)),v=new Lr(e),v.findAndDelete(new Lr().writeBin(y)),S=fr.fromDER(b),this.verifySignature(x,S,v)}catch{return!1}})(),!_&&this.hasFlag(`NULLFAIL`)&&y.length>0&&this.scriptEvaluationError(`${k[n]} requires failing signatures to be empty.`),this.pushStack(_?[1]:[]),n===k.OP_CHECKSIGVERIFY&&(_||this.scriptEvaluationError(`OP_CHECKSIGVERIFY requires that a valid signature is provided.`),this.popStack());break;case k.OP_CHECKMULTISIG:case k.OP_CHECKMULTISIGVERIFY:(()=>{C=1,this.stack.length<C&&this.scriptEvaluationError(`${k[n]} requires at least 1 item for nKeys.`);let e=this.readScriptNumber(this.stackTop(-C)).toBigInt(),t=this.hasExplicitFlags()&&!this.isAfterGenesis()?BigInt(fi):di;(e<0n||e>t)&&this.scriptEvaluationError(`${k[n]} requires a key count between 0 and ${t.toString()}.`),te=Number(e);let r=te;w=++C,C+=te,this.stack.length<C&&this.scriptEvaluationError(`${k[n]} stack too small for nKeys and keys. Need ${C}, have ${this.stack.length}.`);let i=this.readScriptNumber(this.stackTop(-C)).toBigInt();(i<0n||i>BigInt(te))&&this.scriptEvaluationError(`${k[n]} requires the number of signatures to be no greater than the number of keys.`),ne=Number(i);let a=ne;ee=++C,C+=ne,this.stack.length<C&&this.scriptEvaluationError(`${k[n]} stack too small for N, keys, M, sigs, and dummy. Need ${C}, have ${this.stack.length}.`),v=new Lr((this.context===`UnlockingScript`?this.unlockingScript:this.lockingScript).chunks.slice(this.lastCodeSeparator===null?0:this.lastCodeSeparator+1));let o=!1;for(let e=0;e<ne;e++)y=this.stackTop(-ee-e),y.length>0&&(o=!0),v.findAndDelete(new Lr().writeBin(y));(()=>{for(_=!0;_&&ne>0;){if(te===0){_=!1;break}if(y=this.stackTop(-ee),b=this.stackTop(-w),(!this.checkSignatureEncoding(y)||!this.checkPublicKeyEncoding(b))&&this.scriptEvaluationError(`${k[n]} requires correct encoding for the public key and signature.`),T=!1,y.length>0)try{x=this.parseChecksigSignature(y),S=fr.fromDER(b),T=this.verifySignature(x,S,v)}catch{T=!1}T&&(ee++,ne--),w++,te--,ne>te&&(_=!1)}})(),(()=>{!_&&this.hasFlag(`NULLFAIL`)&&o&&this.scriptEvaluationError(`${k[n]} requires failing signatures to be empty.`);let e=1+r+1+a+1-1;for(;e>0;)this.popStack(),e--;this.requireStackItems(1,`${k[n]} requires an extra item (dummy) to be on the stack.`);let t=this.popStack();this.shouldEnforceNullDummy()&&t.length>0&&this.scriptEvaluationError(`${k[n]} requires the extra stack item (dummy) to be empty.`),this.pushStack(_?[1]:[]),n===k.OP_CHECKMULTISIGVERIFY&&(_||this.scriptEvaluationError(`OP_CHECKMULTISIGVERIFY requires that a sufficient number of valid signatures are provided.`),this.popStack())})()})();break;case k.OP_CAT:(()=>{this.requireStackItems(2,`OP_CAT requires at least two items to be on the stack.`),i=this.popStack(),t=this.popStack();let e=t.concat(i);e.length>this.maxPushSize()&&this.scriptEvaluationError(`It's not currently possible to push data larger than ${this.maxPushSize()} bytes.`),this.pushStack(e)})();break;case k.OP_SPLIT:(()=>{this.requireStackItems(2,`OP_SPLIT requires at least two items to be on the stack.`);let e=this.popStack(),t=this.popStack(),n=this.readScriptNumber(e).toBigInt();(n<0n||n>BigInt(t.length))&&this.scriptEvaluationError(`OP_SPLIT requires the first stack item to be a non-negative number less than or equal to the size of the second-from-top stack item.`);let r=Number(n);this.pushStack(t.slice(0,r)),this.pushStack(t.slice(r))})();break;case k.OP_NUM2BIN:(()=>{this.requireStackItems(2,`OP_NUM2BIN requires at least two items to be on the stack.`);let e=this.readScriptNumber(this.popStack()).toBigInt(),t=this.maxPushSize();if((Number.isFinite(t)&&e>BigInt(t)||e<0n)&&this.scriptEvaluationError(`It's not currently possible to push data larger than ${t} bytes or negative size.`),e>li)throw new ri(`element-size`,li,e);m=Number(e);let n=this.popStack();if(n=Sn(n),n.length>m&&this.scriptEvaluationError(`OP_NUM2BIN requires that the size expressed in the top stack item is large enough to hold the value expressed in the second-from-top stack item.`),n.length===m){this.pushStack(n);return}let r=Array.from({length:m},()=>0),i=0;n.length>0&&(i=n.at(-1)&128,n[n.length-1]&=127);for(let e=0;e<n.length;e++)r[e]=n[e];i!==0&&(r[m-1]|=128),this.pushStack(r)})();break;case k.OP_BIN2NUM:(()=>{this.requireStackItems(1,`OP_BIN2NUM requires at least one item to be on the stack.`),t=this.popStack();let e=Sn(t);Si(e)||this.scriptEvaluationError(`OP_BIN2NUM requires that the resulting number is valid.`),this.pushStack(e)})();break;default:this.scriptEvaluationError(`Invalid opcode ${n} (pc=${this.programCounter}).`)}}return this.advanceAfterStep(e),!0}validate(e){let t=ai();return t?.verifySpendSync!==void 0&&(t.isReady?.()??!0)&&(e===void 0?t.shouldVerifySpend?.(this):t.shouldVerifySpend?.(this,e))!==!1?((e===void 0?t.verifySpendSync(this):t.verifySpendSync(this,e))||this.scriptEvaluationError(`The selected script-verification backend rejected the spend.`),!0):this.validateJavaScript()}validateJavaScript(){this.reset(),this.shouldEnforceSigPushOnly()&&!this.unlockingScript.isPushOnly()&&this.scriptEvaluationError(`Unlocking scripts can only contain push operations, and no other opcodes.`);let e=this.lockingScript,t=this.hasFlag(`P2SH`)&&!this.isAfterGenesis()&&this.isP2SHLockingScript(this.lockingScript);t&&!this.unlockingScript.isPushOnly()&&this.scriptEvaluationError(`P2SH unlocking scripts can only contain push operations.`),this.runScript(`UnlockingScript`);let n=this.stack.map(e=>e.slice());this.runScript(`LockingScript`),this.requireTruthyTopStack();try{if(t){n.length===0&&this.scriptEvaluationError(`P2SH evaluation requires a redeem script on the stack.`);let e=n.pop();if(e===void 0)return this.scriptEvaluationError(`P2SH evaluation requires a redeem script on the stack.`),!1;this.setStack(n);let t=Lr.fromBinary(e);this.lockingScript=new $r(t.chunks),this.runScript(`LockingScript`)}}finally{this.lockingScript=e}return this.shouldEnforceCleanStack()&&this.stack.length!==1&&this.scriptEvaluationError(`The clean stack rule requires exactly one item to be on the stack after script execution, found ${this.stack.length}.`),this.requireTruthyTopStack(),!0}async validateWith(e,t){return(t===void 0?e.shouldVerifySpend?.(this):e.shouldVerifySpend?.(this,t))===!1?this.validateJavaScript():t===void 0?await e.verifySpend(this):await e.verifySpend(this,t)}toTransactionUint8Array(){let e={sourceTXID:this.sourceTXID,sourceOutputIndex:this.sourceOutputIndex,unlockingScript:this.unlockingScript,sequence:this.inputSequence},t=this.allInputs??[...this.otherInputs.slice(0,this.inputIndex),e,...this.otherInputs.slice(this.inputIndex)];if(this.inputIndex<0||this.inputIndex>=t.length)throw RangeError(`Spend input index is out of range`);let n=new Yt;n.writeUInt32LE(this.transactionVersion),n.writeVarIntNum(t.length);for(let r=0;r<t.length;r++){let i=r===this.inputIndex?e:t[r],a=i.sourceTXID??i.sourceTransaction?.id(`hex`);if(a===void 0)throw Error(`Input ${r} is missing its source transaction ID`);if(i.unlockingScript===void 0)throw Error(`Input ${r} is missing its unlocking script`);n.writeReverse(rn(a,`hex`)),n.writeUInt32LE(i.sourceOutputIndex);let o=i.unlockingScript.toUint8Array();n.writeVarIntNum(o.length),n.write(o),n.writeUInt32LE(i.sequence??4294967295)}n.writeVarIntNum(this.outputs.length);for(let e of this.outputs){n.writeUInt64LE(e.satoshis??0);let t=e.lockingScript.toUint8Array();n.writeVarIntNum(t.length),n.write(t)}return n.writeUInt32LE(this.lockTime),n.toUint8Array()}runScript(e){this.context=e,this.programCounter=0,this.ifStack=[],this.elseStack=[],this.returningFromConditional=!1,this.clearAltStack(),this.lastCodeSeparator=null;let t=e===`UnlockingScript`?this.unlockingScript:this.lockingScript;for(this.hasExplicitFlags()&&!this.isAfterGenesis()&&t.toUint8Array().length>si&&this.scriptEvaluationError(`Script size exceeds ${si} bytes.`);this.programCounter<t.chunks.length;)this.step();this.ifStack.length>0&&this.scriptEvaluationError(`Every OP_IF, OP_NOTIF, or OP_ELSE must be terminated with OP_ENDIF prior to the end of the script.`),this.ifStack=[],this.elseStack=[],this.clearAltStack(),this.lastCodeSeparator=null}isP2SHLockingScript(e){let t=e.chunks;return t.length===3&&t[0].op===k.OP_HASH160&&t[1].op===20&&Array.isArray(t[1].data)&&t[1].data.length===20&&t[2].op===k.OP_EQUAL}requireTruthyTopStack(){this.stack.length===0?this.scriptEvaluationError(`The top stack element must be truthy after script evaluation (stack is empty).`):this.castToBool(this.stackTop())||this.scriptEvaluationError(`The top stack element must be truthy after script evaluation.`)}castToBool(e){if(e.length===0)return!1;for(let t=0;t<e.length;t++)if(e[t]!==0)return t!==e.length-1||e[t]!==128;return!1}scriptEvaluationError(e){throw new ni({message:e,txid:this.sourceTXID,outputIndex:this.sourceOutputIndex,context:this.context,programCounter:this.programCounter,stackState:this.stack,altStackState:this.altStack,ifStackState:this.ifStack,stackMem:this.stackMem,altStackMem:this.altStackMem})}};function Ei(e,t){let n=Yr.SIGHASH_FORKID;return e===`all`&&(n|=Yr.SIGHASH_ALL),e===`none`&&(n|=Yr.SIGHASH_NONE),e===`single`&&(n|=Yr.SIGHASH_SINGLE),t&&(n|=Yr.SIGHASH_ANYONECANPAY),n}function Di(e,t,n,r){let i=e.inputs[t],a=i.sourceTXID??i.sourceTransaction?.id(`hex`);if(a==null||a===void 0||a===``)throw Error(`The input sourceTXID or sourceTransaction is required for transaction signing.`);let o=n??i.sourceTransaction?.outputs[i.sourceOutputIndex].satoshis;if(o==null||o===void 0)throw Error(`The sourceSatoshis or input sourceTransaction is required for transaction signing.`);let s=r??i.sourceTransaction?.outputs[i.sourceOutputIndex].lockingScript;if(s==null)throw Error(`The lockingScript or input sourceTransaction is required for transaction signing.`);return{sourceTXID:a,sourceSatoshis:o,lockingScript:s,allInputs:e.inputs,get otherInputs(){return e.inputs.filter((e,n)=>n!==t)}}}function Oi(e){let{tx:t,inputIndex:n,signatureScope:r,sourceTXID:i,sourceSatoshis:a,lockingScript:o,otherInputs:s,allInputs:c,inputSequence:l}=e,u=t.inputs[n];return Yr.format({sourceTXID:i,sourceOutputIndex:Tn(u.sourceOutputIndex,`input.sourceOutputIndex must have value`),sourceSatoshis:a,transactionVersion:t.version,otherInputs:s??[],allInputs:c,inputIndex:n,outputs:t.outputs,inputSequence:l??Tn(u.sequence,`input.sequence must have value`),subscript:o,lockTime:t.lockTime,scope:r,cache:t.getSignatureHashCache()})}var ki=class{lock(e){let t;if(typeof e==`string`){let n=yn(e);if(n.prefix[0]!==0&&n.prefix[0]!==111)throw Error(`only P2PKH is supported`);t=n.data}else t=e;if(t.length!==20)throw Error(`P2PKH hash length must be 20 bytes`);return new $r([{op:k.OP_DUP},{op:k.OP_HASH160},{op:t.length,data:t},{op:k.OP_EQUALVERIFY},{op:k.OP_CHECKSIG}])}unlock(e,t=`all`,n=!1,r,i){return{sign:async(a,o)=>{let s=Ei(t,n),c=Di(a,o,r,i);r=c.sourceSatoshis,i=c.lockingScript;let l=Qe(Oi({tx:a,inputIndex:o,signatureScope:s,sourceTXID:c.sourceTXID,sourceSatoshis:c.sourceSatoshis,lockingScript:c.lockingScript,allInputs:c.allInputs})),u=Qr(`signDigest`),d=Qr(`publicKeyFromPrivate`),f=u===void 0&&d===void 0?void 0:Uint8Array.from(e.toArray(`be`,32)),p=u===void 0?e.sign(l):pr.fromDER(Array.from(Xr(`signDigest`,await u.signDigest(f,Uint8Array.from(Qe(l)))))),m=new Yr(p.r,p.s,s).toChecksigFormat(),h=d===void 0?e.toPublicKey().encode(!0):Array.from(Ai(await d.publicKeyFromPrivate(f)));return new ei([{op:m.length,data:m},{op:h.length,data:h}])},estimateLength:async()=>108}}};function Ai(e){let t=Xr(`publicKeyFromPrivate`,e,33);if(t[0]!==2&&t[0]!==3)throw Error(`publicKeyFromPrivate returned an invalid compressed public key`);return t}var ji=class{value;constructor(e){this.value=e}async computeFee(e){let t=e=>e>2**32?9:e>2**16?5:e>253?3:1,n=4;n+=t(e.inputs.length);for(let r=0;r<e.inputs.length;r++){let i=e.inputs[r];n+=40;let a;if(typeof i.unlockingScript==`object`)a=i.unlockingScript.toBinary().length;else if(typeof i.unlockingScriptTemplate==`object`)a=await i.unlockingScriptTemplate.estimateLength(e,r);else throw TypeError(`All inputs must have an unlocking script or an unlocking script template for sat/kb fee computation.`);n+=t(a),n+=a}n+=t(e.outputs.length);for(let r of e.outputs){n+=8;let e=r.lockingScript.toBinary().length;n+=t(e),n+=e}return n+=4,Math.ceil(n/1e3*this.value)}},Mi=class e extends ji{static ARC_POLICY_URL=`https://arc.gorillapool.io/v1/policy`;static instance=null;cachedRate=null;cacheTimestamp=0;cacheValidityMs;constructor(e=3e5){super(100),this.cacheValidityMs=e}static getInstance(t=3e5){return e.instance??=new e(t),e.instance}async fetchFeeRate(){let t=Date.now();if(this.cachedRate!==null&&t-this.cacheTimestamp<this.cacheValidityMs)return this.cachedRate;try{let n=await fetch(e.ARC_POLICY_URL);if(!n.ok)throw Error(`HTTP ${n.status}: ${n.statusText}`);let r=await n.json();if(!r.policy?.miningFee||typeof r.policy.miningFee.satoshis!=`number`||typeof r.policy.miningFee.bytes!=`number`)throw Error(`Invalid policy response format`);let i=r.policy.miningFee.satoshis/r.policy.miningFee.bytes*1e3;return this.cachedRate=i,this.cacheTimestamp=t,i}catch(e){return this.cachedRate===null?(console.warn(`Failed to fetch live fee rate, using default 100 sat/kb:`,e),100):(console.warn(`Failed to fetch live fee rate, using cached value:`,e),this.cachedRate)}}async computeFee(e){let t=await this.fetchFeeRate();return this.value=t,super.computeFee(e)}};function Ni(e,t,n,r){return new Promise((i,a)=>{let o=e.request(t,n,e=>{let t=``;e.on(`data`,e=>{t+=e}),e.on(`end`,()=>{let n=e.statusCode>=200&&e.statusCode<=299,r=e.headers[`content-type`],a=t!==``&&typeof r==`string`&&r.startsWith(`application/json`)?JSON.parse(t):t;i({status:e.statusCode,statusText:e.statusMessage,ok:n,data:a})})});o.on(`error`,e=>{a(e)}),n.data!==null&&n.data!==void 0&&o.write(r(n.data)),o.end()})}var Pi=class{https;constructor(e){this.https=e}async request(e,t){return await Ni(this.https,e,t,e=>JSON.stringify(e))}},Fi=class{fetch;constructor(e){this.fetch=e}async request(e,t){let n={method:t.method,headers:t.headers,body:JSON.stringify(t.data)},r=await this.fetch(e,n),i=r.headers.get(`Content-Type`)?.startsWith(`application/json`)??!1?await r.json():await r.text();return{ok:r.ok,status:r.status,statusText:r.statusText,data:i}}};function Ii(){let e={async request(...e){throw Error(`No method available to perform HTTP request`)}};if(globalThis.window!==void 0&&typeof globalThis.window.fetch==`function`)return new Fi(globalThis.window.fetch.bind(globalThis.window));if(typeof globalThis.fetch==`function`)return new Fi(globalThis.fetch.bind(globalThis));let t=typeof i==`function`?i:void 0;if(t===void 0)return e;try{return new Pi(t([`node`,`https`].join(`:`)))}catch{return e}}function Li(){return`ts-sdk-${tn(Or(16))}`}var Ri=new Set([`DOUBLE_SPEND_ATTEMPTED`,`REJECTED`,`INVALID`,`MALFORMED`,`MINED_IN_STALE_BLOCK`]);function zi(e){try{return e.toHexEF()}catch(t){if(t.message===`All inputs must have source transactions when serializing to EF format`)return e.toHex();throw t}}function Bi(e){let{txid:t,extraInfo:n,txStatus:r,competingTxs:i}=e,a=r?.toUpperCase(),o=n?.toUpperCase().includes(`ORPHAN`)||a?.includes(`ORPHAN`);if(Ri.has(a)||o){let e={status:`error`,code:r??`UNKNOWN`,txid:t,description:`${r??``} ${n??``}`.trim()};return i!=null&&(e.more={competingTxs:i}),e}let s={status:`success`,txid:t,message:`${r} ${n}`};return i!=null&&(s.competingTxs=i),s}function Vi(e){if(typeof e!=`string`)return e;try{return JSON.parse(e)}catch{return e}}function Hi(e,t){let n={status:`error`,code:typeof e==`number`||typeof e==`string`?e.toString():`ERR_UNKNOWN`,description:`Unknown error`},r=Vi(t);return typeof r!=`object`||!r?n:(n.more=r,`txid`in r&&typeof r.txid==`string`&&(n.txid=r.txid),`detail`in r&&typeof r.detail==`string`&&(n.description=r.detail),n)}function Ui(e){return{status:`error`,code:`500`,description:typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`?e.message:`Internal Server Error`}}var Wi=class{URL;apiKey;deploymentId;callbackUrl;callbackToken;headers;httpClient;constructor(e,t){if(this.URL=e,typeof t==`string`)this.apiKey=t,this.httpClient=Ii(),this.deploymentId=Li(),this.callbackToken=void 0,this.callbackUrl=void 0;else{let{apiKey:e,deploymentId:n,httpClient:r,callbackToken:i,callbackUrl:a,headers:o}=t??{};this.apiKey=e,this.httpClient=r??Ii(),this.deploymentId=n??Li(),this.callbackToken=i,this.callbackUrl=a,this.headers=o}}requestHeaders(){let e={"Content-Type":`application/json`,"XDeployment-ID":this.deploymentId};if(this.apiKey!=null&&this.apiKey!==``&&(e.Authorization=`Bearer ${this.apiKey}`),this.callbackUrl!=null&&this.callbackUrl!==``&&(e[`X-CallbackUrl`]=this.callbackUrl),this.callbackToken!=null&&this.callbackToken!==``&&(e[`X-CallbackToken`]=this.callbackToken),this.headers!=null)for(let t in this.headers)e[t]=this.headers[t];return e}async broadcast(e){let t={method:`POST`,headers:this.requestHeaders(),data:{rawTx:zi(e)}};try{let e=await this.httpClient.request(`${this.URL}/v1/tx`,t);return e.ok?Bi(e.data):Hi(e.status,e.data)}catch(e){return Ui(e)}}async broadcastMany(e){let t=e.map(e=>({rawTx:zi(e)})),n={method:`POST`,headers:this.requestHeaders(),data:t};try{return(await this.httpClient.request(`${this.URL}/v1/txs`,n)).data}catch(t){let n=Ui(t);return e.map(()=>n)}}};function Gi(e=!1,t={}){return new Wi(e?`https://testnet.arc.gorillapool.io`:`https://arc.gorillapool.io`,t)}var Ki=class{network;apiKey;URL;httpClient;constructor(e=`main`,t={}){let{apiKey:n,httpClient:r}=t;this.network=e,this.URL=`https://api.whatsonchain.com/v1/bsv/${e}`,this.httpClient=r??Ii(),this.apiKey=n??``}async isValidRootForHeight(e,t){let n={method:`GET`,headers:this.getHttpHeaders()},r=await this.httpClient.request(`${this.URL}/block/${t}/header`,n);if(r.ok){let{merkleroot:t}=r.data;return t===e}if(r.status===404)return!1;throw Error(`Failed to verify merkleroot for height ${t} because of an error: ${JSON.stringify(r.data)} `)}async currentHeight(){try{let e={method:`GET`,headers:this.getHttpHeaders()},t=await this.httpClient.request(`${this.URL}/block/headers`,e);if(t.ok)return t.data[0].height;throw Error(`Failed to get current height because of an error: ${JSON.stringify(t.data)} `)}catch(e){throw Error(`Failed to get current height because of an error: ${e instanceof Error?e.message:String(e)}`)}}getHttpHeaders(){let e={Accept:`application/json`};return typeof this.apiKey==`string`&&this.apiKey.trim()!==``&&(e.Authorization=this.apiKey),e}};function qi(){return new Ki}function Ji(e,t){return tn($e(rn((e??``)+(t??``),`hex`).reverse()).reverse())}function Yi(e,t,n,r){let i=r.get(e);if(i==null)return;if(i!==t)throw Error(`Mismatched roots`);let a=r.get(`${n}:0`);if(a==null)throw Error(`Mismatched roots`);return a}function Xi(e,t,n,r,i,a){if(t==null){if(a)return Ji(e,e);throw Error(`Missing hash for index ${r} at height ${i}`)}return t.duplicate===!0?Ji(e,e):n%2==1?Ji(t.hash,e):Ji(e,t.hash)}var Zi=class e{blockHeight;path;static fromHex(t){return e.fromBinary(rn(t,`hex`))}static fromReader(t,n=!0,r=!0){let i=t.readVarIntNum(),a=t.readUInt8(),o=Array.from({length:a}).fill(null).map(()=>[]),s,c,l;for(let e=0;e<a;e++){for(l=t.readVarIntNum();l>0;){c=t.readVarIntNum(),s=t.readUInt8();let n={offset:c};(s&1)==1?n.duplicate=!0:(s&2&&(n.txid=!0),n.hash=tn(t.read(32).reverse())),(!Array.isArray(o[e])||o[e].length===0)&&(o[e]=[]),o[e].push(n),l--}o[e].sort((e,t)=>e.offset-t.offset)}return new e(i,o,n,r)}static fromBinary(t,n=!0,r=!0){let i=new Xt(t);return e.fromReader(i,n,r)}static fromCoinbaseTxidAndHeight(t,n){return new e(n,[[{offset:0,hash:t,txid:!0}]])}constructor(e,t,n=!0,r=!0){this.blockHeight=e,this.path=t;let i=Array.from({length:this.path.length}).fill(0).map(()=>new Set);if(this.path.forEach((e,t)=>{if(e.length===0&&t===0)throw Error(`Empty level at height: ${t}`);let r=new Set;e.forEach(e=>{if(r.has(e.offset))throw Error(`Duplicate offset: ${e.offset}, at height: ${t}`);if(r.add(e.offset),t===0){if(e.duplicate!==!0)for(let t=1;t<this.path.length;t++)i[t].add(e.offset>>t^1)}else if(n&&!i[t].has(e.offset))throw Error(`Invalid offset: ${e.offset}, at height: ${t}, with legal offsets: ${Array.from(i[t],e=>e.toString()).join(`, `)}`)})}),!r)return;let a=this.path.map(e=>new Map(e.map(e=>[e.offset,e]))),o=new Map,s=new Map,c=this.path[0].reduce((e,t)=>Math.max(e,t.offset),0),l;this.path[0].forEach((e,t)=>{let n=this.computeRootCached(e.hash,a,o,s,c);if(t===0&&(l=n),l!==n)throw Error(`Mismatched roots`)})}toWriter(e){e.writeVarIntNum(this.blockHeight);let t=this.path.length;e.writeUInt8(t);for(let n=0;n<t;n++){let t=Object.keys(this.path[n]).length;e.writeVarIntNum(t);for(let t of this.path[n]){e.writeVarIntNum(t.offset);let n=0;t?.duplicate===!0&&(n|=1),t?.txid!==void 0&&t.txid!==null&&(n|=2),e.writeUInt8(n),n&1||e.write(rn(t.hash,`hex`).reverse())}}}toBinary(){let e=new bn;return this.toWriter(e),e.toArray()}toBinaryUint8Array(){let e=new Yt;return this.toWriter(e),e.toUint8Array()}toHex(){return tn(this.toBinaryUint8Array())}indexOf(e){let t=this.path[0].find(t=>t.hash===e);if(t==null)throw Error(`Transaction ID ${e} not found in the Merkle Path`);return t.offset}computeRootCached(e,t,n,r,i){if(typeof e!=`string`&&(e=this.path[0].find(e=>!!e.hash)?.hash),typeof e!=`string`)throw TypeError(`Transaction ID is undefined`);let a=this.indexOf(e);if(this.path.length===1&&this.path[0].length===1)return e;let o=Math.max(this.path.length,32-Math.clz32(i)),s=e;for(let e=0;e<o;e++){let c=`${e}:${a>>e}`,l=Yi(c,s,o,r);if(l!=null)return l;r.set(c,s);let u=a>>e^1,d=this.cachedFindLeaf(e,u,t,n,i);s=Xi(s,d,u,a,e,this.path.length===1&&a>>e===i>>e)}return r.set(`${o}:0`,s),s}nextRootHash(e,t,n,r){let i=t>>n^1,a=this.findOrComputeLeaf(n,i);if(a==null){if(this.path.length===1&&t>>n===r>>n)return Ji(e,e);throw Error(`Missing hash for index ${t} at height ${n}`)}return a.duplicate===!0?Ji(e,e):i%2==1?Ji(a.hash,e):Ji(e,a.hash)}computeRoot(e){if(typeof e!=`string`){let t=this.path[0].find(e=>!!e?.hash);if(t==null)throw Error(`No valid leaf found in the Merkle Path`);e=t.hash}if(typeof e!=`string`)throw TypeError(`Transaction ID is undefined`);let t=this.indexOf(e),n=e;if(this.path.length===1&&this.path[0].length===1)return n;let r=this.path[0].reduce((e,t)=>Math.max(e,t.offset),0),i=Math.max(this.path.length,32-Math.clz32(r));for(let e=0;e<i;e++)n=this.nextRootHash(n,t,e,r);return n}findOrComputeLeaf(e,t){let n=e=>tn($e(rn(e,`hex`).reverse()).reverse()),r=e<this.path.length?this.path[e].find(e=>e.offset===t):void 0;if(r!=null)return r;if(e===0)return;let i=e-1,a=t<<1,o=this.findOrComputeLeaf(i,a);if(o?.hash==null||o.hash===``)return;let s=this.findOrComputeLeaf(i,a+1);if(s?.hash==null)return s?.duplicate===!0||this.path.length===1&&a===this.path[0].reduce((e,t)=>Math.max(e,t.offset),0)>>i?{offset:t,hash:n(o.hash+o.hash)}:void 0;let c;return c=s.duplicate===!0?n(o.hash+o.hash):n((s.hash??``)+(o.hash??``)),r={offset:t,hash:c},r}async verify(e,t){let n=this.computeRoot(e);if(this.indexOf(e)===0){let e=await t.currentHeight();if(this.blockHeight+100>e)return!1}return await t.isValidRootForHeight(n,this.blockHeight)}combine(e){if(this.blockHeight!==e.blockHeight)throw Error(`You cannot combine paths which do not have the same block height.`);if(this.computeRoot()!==e.computeRoot())throw Error(`You cannot combine paths which do not have the same root.`);let t=[];for(let n=0;n<this.path.length;n++){t.push([]);for(let e of this.path[n])t[n].push(e);for(let r of e.path[n]){let e=t[n].find(e=>e.offset===r.offset);e===void 0?t[n].push(r):r?.txid!==void 0&&r?.txid!==null&&(e.txid=!0)}}this.path=t,this.trim()}trim(){let e=(e,t)=>{(t.length===0||t.at(-1)!==e)&&t.push(e)},t=(e,t)=>{for(let n=e.length;n>=0;n--){let r=this.path[t].findIndex(t=>t.offset===e[n]);r>=0&&this.path[t].splice(r,1)}},n=t=>{let n=[];for(let r of t)e(r>>1,n);return n},r=[],i=[];for(let e of this.path)e.sort((e,t)=>e.offset-t.offset);for(let t=0;t<this.path[0].length;t++){let n=this.path[0][t];if(n.txid===!0)e(n.offset>>1,r);else{let r=n.offset%2==1,a=this.path[0][t+(r?-1:1)];(a.txid===void 0||a.txid===null||!a.txid)&&e(a.offset,i)}}t(i,0);for(let e=1;e<this.path.length;e++)i=r,r=n(r),t(i,e)}cachedFindLeaf(e,t,n,r,i){let a=`${e}:${t}`;if(r.has(a))return r.get(a);let o=e=>tn($e(rn(e,`hex`).reverse()).reverse()),s=e<n.length?n[e].get(t):void 0;if(s!=null)return r.set(a,s),s;if(e===0){r.set(a,void 0);return}let c=e-1,l=t<<1,u=this.cachedFindLeaf(c,l,n,r,i);if(u?.hash==null||u.hash===``){r.set(a,void 0);return}let d=this.cachedFindLeaf(c,l+1,n,r,i);if(d?.hash==null){if(d?.duplicate===!0||this.path.length===1&&l===i>>c)return s={offset:t,hash:o(u.hash+u.hash)},r.set(a,s),s;r.set(a,void 0);return}return s={offset:t,hash:d.duplicate===!0?o(u.hash+u.hash):o((d.hash??``)+(u.hash??``))},r.set(a,s),s}extract(t){if(t.length===0)throw Error(`At least one txid must be provided to extract`);let n=this.computeRoot(),r=this.path[0].reduce((e,t)=>Math.max(e,t.offset),0),i=Math.max(this.path.length,32-Math.clz32(r)),a=this.createSourceLeafIndex(),o=new Map,s=this.createTxidToOffsetIndex(),c=this.createNeededLeafLevels(i);for(let e of t)this.collectExtractedLeaves(e,s,c,a,o,r,i);let l=new e(this.blockHeight,this.buildExtractedPath(c));l.trim();let u=l.computeRoot();if(u!==n)throw Error(`Extracted path root ${u} does not match original root ${n}`);return l}createSourceLeafIndex(){let e=Array.from({length:this.path.length});for(let t=0;t<this.path.length;t++){let n=new Map;for(let e of this.path[t])n.set(e.offset,e);e[t]=n}return e}createTxidToOffsetIndex(){let e=new Map;for(let t of this.path[0])t.hash!=null&&e.set(t.hash,t.offset);return e}createNeededLeafLevels(e){let t=Array.from({length:e});for(let n=0;n<e;n++)t[n]=new Map;return t}collectExtractedLeaves(e,t,n,r,i,a,o){let s=t.get(e);if(s===void 0)throw Error(`Transaction ID ${e} not found in the Merkle Path`);n[0].set(s,{offset:s,txid:!0,hash:e});let c=s^1;if(!n[0].has(c)){let e=this.cachedFindLeaf(0,c,r,i,a);e!=null&&n[0].set(c,e)}for(let e=1;e<o;e++){let t=s>>e^1;if(n[e].has(t))continue;let o=this.cachedFindLeaf(e,t,r,i,a);o==null?s>>e===a>>e&&n[e].set(t,{offset:t,duplicate:!0}):n[e].set(t,o)}}buildExtractedPath(e){return e.map(e=>Array.from(e.values()).sort((e,t)=>e.offset-t.offset))}},Qi=4022206465,$i=4022206466,ea=16843009,ta;(function(e){e[e.RAWTX=0]=`RAWTX`,e[e.RAWTX_AND_BUMP_INDEX=1]=`RAWTX_AND_BUMP_INDEX`,e[e.TXID_ONLY=2]=`TXID_ONLY`})(ta||={});function na(e,t){if(!Number.isSafeInteger(t)||t<0||e.pos+t>e.bin.length)throw RangeError(`Serialized transaction exceeds available BEEF data`);e instanceof Xt?e.skip(t):e.pos+=t}function ra(e){let t=e.pos;na(e,4);let n=e.readVarIntNum(!1),r=new Set;for(let t=0;t<n;t++)r.add(tn(e.readReverse(32))),na(e,4),na(e,e.readVarIntNum(!1)+4);let i=e.readVarIntNum(!1);for(let t=0;t<i;t++)na(e,8),na(e,e.readVarIntNum(!1));return na(e,4),{rawTx:e instanceof Xt?e.bin.subarray(t,e.pos):Uint8Array.from(e.bin.slice(t,e.pos)),inputTxids:Array.from(r)}}function ia(e){return ra(new Xt(e)).inputTxids}function aa(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var oa=class e{_bumpIndex;_tx;_rawTx;_txid;inputTxids=[];isValid=void 0;get bumpIndex(){return this._bumpIndex}set bumpIndex(e){this._bumpIndex=e,this.updateInputTxids()}get hasProof(){return this._bumpIndex!==void 0}get isTxidOnly(){return this._txid!==void 0&&this._txid!==null&&this._rawTx==null&&this._tx==null}get txid(){if(this._txid!==void 0&&this._txid!==null&&this._txid!==``)return this._txid;if(this._tx!=null)return this._txid=this._tx.id(`hex`),this._txid;if(this._rawTx!=null)return this._txid=tn($e(this._rawTx).reverse()),this._txid;throw Error(`Internal`)}get tx(){if(this._tx!=null)return this._tx;if(this._rawTx!=null)return this._tx=pa.fromBinaryView(this._rawTx),this._tx}get rawTx(){let e=this.rawTxUint8Array;return e==null?void 0:Array.from(e)}get rawTxUint8Array(){return this._tx==null||(this._rawTx==null?this._rawTx=this._tx.toUint8Array():this.syncRawTxFromTransaction()),this._rawTx}syncRawTxFromTransaction(){if(this._tx==null)return!1;let e=this._tx.toUint8Array();if(this._rawTx!=null)return e!==this._rawTx&&(this._rawTx=e,this._txid=this._tx.id(`hex`),this.updateInputTxids(),!0);let t=this._tx.id(`hex`),n=this._txid!=null&&this._txid!==t,r=this.inputTxids;return this._txid=t,this.updateInputTxids(),n||!aa(r,this.inputTxids)}constructor(e,t,n){if(typeof e==`string`)this._txid=e;else if(e instanceof Uint8Array)this._rawTx=e;else if(Array.isArray(e))this._rawTx=new Uint8Array(e);else if(e instanceof pa)this._tx=e;else throw TypeError(`Invalid transaction data type`);this._bumpIndex=t,this.hasProof?this.inputTxids=[]:n==null?this.updateInputTxids():this.inputTxids=n}static fromTx(t,n){return new e(t,n)}static fromRawTx(t,n){return new e(t,n)}static fromTxid(t,n){return new e(t,n)}updateInputTxids(){if(this.hasProof)this.inputTxids=[];else if(this._tx!=null){let e=new Set;for(let t of this._tx.inputs)t.sourceTXID!==void 0&&t.sourceTXID!==null&&t.sourceTXID!==``&&e.add(t.sourceTXID);this.inputTxids=Array.from(e)}else this.inputTxids=this._rawTx==null?[]:ia(this._rawTx)}toWriter(e,t){let n=t=>{e.writeUInt8(t)},r=()=>{if(this._txid==null)throw Error(`Transaction ID (_txid) is undefined`);e.writeReverse(rn(this._txid,`hex`))},i=()=>{let t=this.rawTxUint8Array;if(t==null)throw Error(`a valid serialized Transaction is expected`);e.write(t)};t===4022206466?this.isTxidOnly?(n(ta.TXID_ONLY),r()):this.bumpIndex===void 0?(n(ta.RAWTX),i()):(n(ta.RAWTX_AND_BUMP_INDEX),e.writeVarIntNum(this.bumpIndex),i()):(i(),this.bumpIndex===void 0?n(ta.RAWTX):(n(ta.RAWTX_AND_BUMP_INDEX),e.writeVarIntNum(this.bumpIndex)))}static fromReader(t,n){let r,i;if(n===4022206466){let n=t.readUInt8();if(n===ta.TXID_ONLY)i=e.fromTxid(tn(t.readReverse(32)));else{n===ta.RAWTX_AND_BUMP_INDEX&&(r=t.readVarIntNum());let{rawTx:a,inputTxids:o}=ra(t);i=new e(a,r,o)}}else{let{rawTx:n,inputTxids:a}=ra(t);r=t.readUInt8()===0?void 0:t.readVarIntNum(),i=new e(n,r,a)}return i}};function sa(e,t,n,r){if(t.path.length!==n)throw Error(`Mismatched roots`);for(let i=0;i<n;i++)ca(e[i],t.path[i],r)}function ca(e,t,n){for(let r of t){let t=e.get(r.offset);if(t==null){e.set(r.offset,r);continue}la(t,r,n)}}function la(e,t,n){if(n&&(e.hash!==t.hash||e.duplicate!==t.duplicate))throw Error(`Mismatched roots`);t.txid!=null&&(e.txid=!0)}function ua(e,t,n){for(let r of e.path[0])typeof r.hash==`string`&&n.set(r.hash,t)}var da=class e{bumps=[];txs=[];version=$i;atomicTxid=void 0;txidIndex=void 0;txPositionIndex=void 0;bumpIndexesByHeight=void 0;bumpIndexByTxid=void 0;rawBytesCache;hexCache;atomicBytesCache=new Map;atomicCacheTxs;atomicCacheBumps;atomicCacheVersion;rawCacheVersion;rawCacheTxs;rawCacheBumps;bumpState;needsSort=!0;sortResultCache;sortTxState;constructor(e=$i){this.version=e}invalidateSerializationCaches(){this.rawBytesCache=void 0,this.hexCache=void 0,this.atomicBytesCache.clear(),this.atomicCacheTxs=void 0,this.atomicCacheBumps=void 0,this.atomicCacheVersion=void 0,this.rawCacheVersion=void 0,this.rawCacheTxs=void 0,this.rawCacheBumps=void 0}captureSerializationState(){this.rawCacheVersion=this.version,this.rawCacheTxs=this.captureTransactionState(),this.rawCacheBumps=Array.from(this.bumps),this.captureBumpState()}captureTransactionState(){return this.txs.map(e=>({ref:e,bumpIndex:e._bumpIndex,rawTx:e._rawTx,tx:e._rawTx==null?e._tx:void 0,txid:e._rawTx==null&&e._tx==null?e._txid:void 0}))}transactionStateMatches(e){if(e?.length!==this.txs.length)return!1;for(let t=0;t<this.txs.length;t++){let n=this.txs[t],r=e[t];if(r.ref!==n||r.bumpIndex!==n._bumpIndex||r.rawTx!==n._rawTx||r.tx!==(n._rawTx==null?n._tx:void 0)||r.txid!==(n._rawTx==null&&n._tx==null?n._txid:void 0))return!1}return!0}captureBumpState(){this.bumpState=this.bumps.map(e=>({ref:e,blockHeight:e.blockHeight,levels:e.path.map(e=>({ref:e,leaves:e.map(e=>({ref:e,offset:e.offset,hash:e.hash,txid:e.txid,duplicate:e.duplicate}))}))}))}bumpLeafStateMatches(e,t){return t.ref===e&&t.offset===e.offset&&t.hash===e.hash&&t.txid===e.txid&&t.duplicate===e.duplicate}bumpLevelStateMatches(e,t){return t.ref===e&&t.leaves.length===e.length&&e.every((e,n)=>this.bumpLeafStateMatches(e,t.leaves[n]))}singleBumpStateMatches(e,t){return t.ref===e&&t.blockHeight===e.blockHeight&&t.levels.length===e.path.length&&e.path.every((e,n)=>this.bumpLevelStateMatches(e,t.levels[n]))}bumpStateMatches(){return this.bumpState?.length===this.bumps.length&&this.bumps.every((e,t)=>this.singleBumpStateMatches(e,this.bumpState[t]))}synchronizeNestedBumpMutations(){if(this.bumpState==null){this.captureBumpState();return}this.bumpStateMatches()||(this.invalidateSerializationCaches(),this.sortResultCache=void 0,this.sortTxState=void 0,this.needsSort=!0,this.invalidateBumpIndexes(),this.captureBumpState())}serializationCacheMatchesState(){if(this.rawBytesCache==null||this.rawCacheVersion!==this.version||!this.transactionStateMatches(this.rawCacheTxs)||this.rawCacheBumps?.length!==this.bumps.length)return!1;for(let e=0;e<this.bumps.length;e++)if(this.rawCacheBumps[e]!==this.bumps[e])return!1;return!0}markMutated(e=!0){this.invalidateSerializationCaches(),this.sortResultCache=void 0,this.sortTxState=void 0,e&&(this.needsSort=!0)}ensureSerializableState(){for(let e of this.txs)e.txid}synchronizeNestedTransactionMutations(){let e=!1;for(let t of this.txs)e=t.syncRawTxFromTransaction()||e;e&&(this.invalidateSerializationCaches(),this.sortResultCache=void 0,this.sortTxState=void 0,this.needsSort=!0,this.rebuildTxIndexes())}ensureSortedForSerialization(){this.needsSort&&this.sortTxs()}getSerializedBytes(){if(this.synchronizeNestedTransactionMutations(),this.synchronizeNestedBumpMutations(),this.serializationCacheMatchesState()&&this.rawBytesCache!=null)return this.rawBytesCache;this.invalidateSerializationCaches(),this.ensureSerializableState(),this.ensureSortedForSerialization();let e=new Yt;return this.toWriter(e),this.rawBytesCache=e.toUint8Array(),this.captureSerializationState(),this.rawBytesCache}getBeefForAtomic(e){this.synchronizeNestedTransactionMutations(),this.synchronizeNestedBumpMutations();let t=this.ensureTxidIndex(),n=t.get(e);if(n==null)throw Error(`${e} does not exist in this Beef`);let r=this.collectAtomicTransactions(n,t),i=this.copySelectedTransactions(r);return i.sortTxs(),i}getAtomicSerializedBytes(e){this.synchronizeNestedTransactionMutations(),this.synchronizeNestedBumpMutations(),this.atomicCacheVersion===this.version&&this.transactionStateMatches(this.atomicCacheTxs)&&this.atomicCacheBumps?.length===this.bumps.length&&this.bumps.every((e,t)=>this.atomicCacheBumps?.[t]===e)||this.atomicBytesCache.clear();let t=this.atomicBytesCache.get(e);if(t!=null)return t;let n=this.getBeefForAtomic(e).getSerializedBytes(),r=nn(e,`hex`),i=new Uint8Array(4+r.length+n.length);new DataView(i.buffer).setUint32(0,ea,!0);for(let e=0;e<r.length;e++)i[4+e]=r[r.length-1-e];return i.set(n,4+r.length),this.atomicBytesCache.set(e,i),this.atomicCacheTxs=this.captureTransactionState(),this.atomicCacheBumps=Array.from(this.bumps),this.atomicCacheVersion=this.version,i}collectAtomicTransactions(e,t){let n=new Set,r=[e];for(;r.length>0;){let e=r.pop();if(!(e==null||n.has(e))&&(n.add(e),!(this.hasMatchingBump(e)||e.isTxidOnly)))for(let n of e.inputTxids){let e=t.get(n);e!=null&&r.push(e)}}return n}hasMatchingBump(e){let t=e.bumpIndex;return t==null||!Number.isSafeInteger(t)||t<0||t>=this.bumps.length?!1:this.bumps[t]?.path[0]?.some(t=>t.hash===e.txid)??!1}copySelectedTransactions(t){let n=new e(this.version),r=new Map;for(let e of this.txs)t.has(e)&&this.hasMatchingBump(e)&&e.bumpIndex!=null&&(r.has(e.bumpIndex)||(r.set(e.bumpIndex,n.bumps.length),n.bumps.push(this.bumps[e.bumpIndex])));for(let e of this.txs){if(!t.has(e))continue;let i=e.bumpIndex==null?void 0:r.get(e.bumpIndex),a;a=e._rawTx==null?e._tx==null?oa.fromTxid(e.txid,i):oa.fromTx(e._tx,i):new oa(e._rawTx,i,Array.from(e.inputTxids)),n.txs.push(a)}return n}isAtomic(e=this.atomicTxid??``){if(this.synchronizeNestedTransactionMutations(),this.synchronizeNestedBumpMutations(),e.length===0)return!1;let t=this.ensureTxidIndex();if(t.size!==this.txs.length)return!1;let n=t.get(e);return n!=null&&this.collectAtomicTransactions(n,t).size===this.txs.length}findTxid(e){return this.synchronizeNestedTransactionMutations(),this.findTxidIndexed(e)}findTxidIndexed(e){return this.ensureTxidIndex().get(e)}ensureTxidIndex(){return(this.txidIndex==null||this.txPositionIndex==null)&&this.rebuildTxIndexes(),this.txidIndex}ensureTxPositionIndex(){return(this.txPositionIndex==null||this.txidIndex==null)&&this.rebuildTxIndexes(),this.txPositionIndex}rebuildTxIndexes(){this.txidIndex=new Map,this.txPositionIndex=new Map;for(let e=0;e<this.txs.length;e++){let t=this.txs[e];this.txidIndex.set(t.txid,t),this.txPositionIndex.set(t.txid,e)}}deleteFromIndex(e){this.txidIndex?.delete(e),this.txPositionIndex?.delete(e)}addToIndex(e,t=this.txs.length-1){this.txidIndex?.set(e.txid,e),this.txPositionIndex?.set(e.txid,t)}replaceOrAppendTx(e){let t=this.ensureTxPositionIndex().get(e.txid);t===void 0?(this.txs.push(e),this.addToIndex(e)):(this.txs[t]=e,this.addToIndex(e,t))}makeTxidOnly(e){let t=this.ensureTxPositionIndex().get(e);if(t===void 0)return;let n=this.txs[t];return n.isTxidOnly?n:(n=oa.fromTxid(e),this.txs[t]=n,this.addToIndex(n,t),this.tryToValidateBumpIndex(n),this.markMutated(!0),n)}findBump(e){this.synchronizeNestedBumpMutations();let t=this.ensureBumpTxidIndex().get(e);return t===void 0?void 0:this.bumps[t]}ensureBumpTxidIndex(){if(this.bumpIndexByTxid==null){this.bumpIndexByTxid=new Map;for(let e=0;e<this.bumps.length;e++)for(let t of this.bumps[e].path[0])typeof t.hash==`string`&&this.bumpIndexByTxid.set(t.hash,e)}return this.bumpIndexByTxid}ensureBumpHeightIndex(){if(this.bumpIndexesByHeight==null){this.bumpIndexesByHeight=new Map;for(let e=0;e<this.bumps.length;e++){let t=this.bumps[e],n=this.bumpIndexesByHeight.get(t.blockHeight)??[];n.push(e),this.bumpIndexesByHeight.set(t.blockHeight,n)}}return this.bumpIndexesByHeight}invalidateBumpIndexes(){this.bumpIndexesByHeight=void 0,this.bumpIndexByTxid=void 0}findTransactionForSigning(e){let t=this.findTxid(e);if(t?.tx!=null){for(let e of t.tx.inputs)if(e.sourceTransaction==null){let t=this.findTxidIndexed(Tn(e.sourceTXID,`sourceTXID must be valid`));t!=null&&(e.sourceTransaction=t.tx)}return t.tx}}findAtomicTransaction(e){let t=this.findTxid(e);if(t?.tx!=null)return this.addInputProof(t.tx),t.tx}addInputProof(e){let t=new Set,n=[e];for(;n.length>0;){let e=n.pop();if(e==null)continue;let r=e.id(`hex`);if(t.has(r))continue;t.add(r);let i=this.findBump(r);if(i!=null){e.merklePath=i;continue}for(let t of e.inputs)this.resolveInputSource(t),t.sourceTransaction!=null&&n.push(t.sourceTransaction)}}resolveInputSource(e){if(e.sourceTransaction==null){let t=this.findTxidIndexed(Tn(e.sourceTXID,`sourceTXID must be valid`));t!=null&&(e.sourceTransaction=t.tx)}}mergeBump(e){return this.synchronizeNestedTransactionMutations(),this.synchronizeNestedBumpMutations(),this.markMutated(!1),this.mergeBumpEntry(e)}mergeProvenTxs(e){if(e.length===0)return[];this.synchronizeNestedTransactionMutations(),this.synchronizeNestedBumpMutations(),this.markMutated(!0);let t=[];for(let n of e)t.push(this.mergeRawTxEntry(n.rawTx));let n=new Map;for(let t of e){let e=t.merklePath.blockHeight;n.set(e,(n.get(e)??0)+1)}let r=new Map;for(let t=0;t<e.length;t++){let i=e[t].merklePath,a=e[t].merkleRoot,o=n.get(i.blockHeight)===1?`${i.blockHeight}:single:${t}`:`${i.blockHeight}:${a??i.computeRoot()}`,s=r.get(o);s==null?r.set(o,{first:t,paths:[i],validateCombined:a!=null}):(s.paths.push(i),s.validateCombined=s.validateCombined||a!=null)}for(let e of[...r.values()].sort((e,t)=>e.first-t.first))this.mergeBumpEntry(this.combineCompatibleBumps(e.paths,e.validateCombined));return t}combineCompatibleBumps(e,t=!1){let n=e[0];if(e.length===1&&!t)return n;let r=n.path.map(e=>new Map(e.map(e=>[e.offset,e])));for(let i=1;i<e.length;i++)sa(r,e[i],n.path.length,t);let i=r.map(e=>[...e.values()]);if(t){let e=new Zi(n.blockHeight,i);return e.trim(),e}return n.path=i,n.trim(),n}mergeBumpEntry(e){let t=this.findOrInsertBump(e),n=this.bumps[t],r=this.ensureTxidIndex();for(let e of n.path[0]){if(typeof e.hash!=`string`)continue;let i=r.get(e.hash);i!=null&&i.bumpIndex==null&&this.tryMarkTxProvenByBump(i,n,t)}return t}findOrInsertBump(e){let t=this.ensureBumpHeightIndex(),n=this.ensureBumpTxidIndex(),r=t.get(e.blockHeight)??[];if(r.length>0){let t=e.computeRoot();for(let i of r)if(this.bumps[i].computeRoot()===t)return this.bumps[i].combine(e),ua(this.bumps[i],i,n),i}this.bumps.push(e);let i=this.bumps.length-1;return r.push(i),t.set(e.blockHeight,r),ua(e,i,n),i}tryMarkTxProvenByBump(e,t,n){let r=e.txid;for(let i of t.path[0])if(i.hash===r){e.bumpIndex=n,i.txid=!0;break}}mergeRawTx(e,t){return this.synchronizeNestedTransactionMutations(),this.markMutated(!0),this.mergeRawTxEntry(e,t)}mergeRawTxEntry(e,t){let n=new oa(e,t);return this.replaceOrAppendTx(n),this.tryToValidateBumpIndex(n),n}mergeTransactionEntry(e){let t=new oa(e,e.merklePath==null?void 0:this.mergeBumpEntry(e.merklePath));return this.replaceOrAppendTx(t),this.tryToValidateBumpIndex(t),t}queueSourceTransactions(e,t){for(let n=e.inputs.length-1;n>=0;n--){let r=e.inputs[n].sourceTransaction;r!=null&&t.push(r)}}mergeTransaction(e){return this.synchronizeNestedTransactionMutations(),this.markMutated(!0),this.mergeTransactionGraph(e)}mergeTransactionGraph(e){e.materializeSourceTXIDs();let t=e.id(`hex`),n=new Set,r=[e],i;for(;r.length>0;){let e=r.pop();if(e==null)continue;let a=e.id(`hex`);if(n.has(a))continue;n.add(a);let o=this.mergeTransactionEntry(e);a===t&&(i=o),o.bumpIndex===void 0&&this.queueSourceTransactions(e,r)}if(i==null)throw Error(`Failed to merge root transaction`);return i}removeExistingTxid(e){let t=this.ensureTxPositionIndex().get(e);t!==void 0&&(this.txs.splice(t,1),this.rebuildTxIndexes(),this.markMutated(!0))}mergeTxidOnly(e){let t=this.findTxid(e);return t??(t=new oa(e),this.txs.push(t),this.addToIndex(t),this.tryToValidateBumpIndex(t),this.markMutated(!0)),t}mergeBeefTx(e){let t=this.findTxid(e.txid);if(e.isTxidOnly&&t==null?t=this.mergeTxidOnly(e.txid):e._tx!=null&&(t==null||t.isTxidOnly)?t=this.mergeTransaction(e._tx):e._rawTx!=null&&(t==null||t.isTxidOnly)&&(t=this.mergeRawTx(e._rawTx)),t==null)throw Error(`Failed to merge BeefTx for txid: ${e.txid}`);return t}mergeBeefTxEntry(e){let t=this.findTxidIndexed(e.txid);if(e.isTxidOnly&&t==null?(t=oa.fromTxid(e.txid),this.txs.push(t),this.addToIndex(t),this.tryToValidateBumpIndex(t)):e._tx!=null&&(t==null||t.isTxidOnly)?t=this.mergeTransactionGraph(e._tx):e._rawTx!=null&&(t==null||t.isTxidOnly)&&(t=this.mergeRawTxEntry(e._rawTx)),t==null)throw Error(`Failed to merge BeefTx for txid: ${e.txid}`);return t}mergeBeef(t){let n=t instanceof e?t:e.fromBinary(t);this.synchronizeNestedTransactionMutations(),this.synchronizeNestedBumpMutations(),this.markMutated(!0);for(let e of n.bumps)this.mergeBumpEntry(e);for(let e of n.txs)this.mergeBeefTxEntry(e)}isValid(e){return this.verifyValid(e).valid}async verify(e,t){let n=this.verifyValid(t);if(!n.valid)return!1;for(let t of Object.keys(n.roots))if(!await e.isValidRootForHeight(n.roots[t],Number(t)))return!1;return!0}verifyValid(e){this.synchronizeNestedBumpMutations();let t={valid:!1,roots:{}};if(this.atomicTxid!=null&&!this.isAtomic(this.atomicTxid))return t;let n=this.sortTxs();if(this.hasDuplicateTxids()||n.missingInputs.length>0||n.notValid.length>0||n.txidOnly.length>0&&e!==!0||n.withMissingInputs.length>0)return t;let r={};return!this.collectTxidOnlyTxids(r,e)||!this.collectBumpTxids(r,t)||!this.verifyBumpIndexLeaves()||!this.verifyInputDependencies(r)||(t.valid=!0),t}hasDuplicateTxids(){let e=new Set;for(let t of this.txs){if(e.has(t.txid))return!0;e.add(t.txid)}return!1}collectTxidOnlyTxids(e,t){for(let n of this.txs)if(n.isTxidOnly){if(t!==!0)return!1;e[n.txid]=!0}return!0}collectBumpTxids(e,t){for(let n of this.bumps)for(let r of n.path[0])if(r.txid===!0&&typeof r.hash==`string`&&r.hash.length!==0&&(e[r.hash]=!0,!this.confirmComputedRoot(n,r.hash,t)))return!1;return!0}verifyBumpIndexLeaves(){for(let e of this.txs)if(e.bumpIndex!==void 0&&(!Number.isSafeInteger(e.bumpIndex)||e.bumpIndex<0||e.bumpIndex>=this.bumps.length||this.bumps[e.bumpIndex]?.path[0]?.find(t=>t.hash===e.txid)==null))return!1;return!0}verifyInputDependencies(e){for(let t of this.txs){for(let n of t.inputTxids)if(!e[n])return!1;e[t.txid]=!0}return!0}confirmComputedRoot(e,t,n){let r=e.computeRoot(t);return(n.roots[e.blockHeight]===void 0||n.roots[e.blockHeight]===``)&&(n.roots[e.blockHeight]=r),n.roots[e.blockHeight]===r}toWriter(e){e.writeUInt32LE(this.version),e.writeVarIntNum(this.bumps.length);for(let t of this.bumps)e.write(e instanceof Yt?t.toBinaryUint8Array():t.toBinary());e.writeVarIntNum(this.txs.length);for(let t of this.txs)t.toWriter(e,this.version)}toBinary(){return Array.from(this.getSerializedBytes())}toUint8Array(){return this.getSerializedBytes()}toBinaryAtomic(e){return Array.from(this.getAtomicSerializedBytes(e))}toUint8ArrayAtomic(e){return this.getAtomicSerializedBytes(e)}toHex(){let e=this.getSerializedBytes();if(this.hexCache!=null)return this.hexCache;let t=tn(e);return this.hexCache=t,t}static fromReader(t){let n=t.pos,r=t.readUInt32LE(),i,a=n;if(r===16843009&&(i=tn(t.readReverse(32)),a=t.pos,r=t.readUInt32LE()),r!==4022206465&&r!==4022206466)throw Error(`Serialized BEEF must start with ${Qi} or ${$i} but starts with ${r}`);let o=new e(r),s=t.readVarIntNum();for(let e=0;e<s;e++){let e=Zi.fromReader(t,!1);o.bumps.push(e)}let c=t.readVarIntNum();for(let e=0;e<c;e++){let e=oa.fromReader(t,r);o.txs.push(e)}return o.atomicTxid=i,t instanceof Xt&&(o.rawBytesCache=t.bin.subarray(a,t.pos),o.captureSerializationState()),o}static fromBinary(t){return e.fromReader(new Xt(Uint8Array.from(t)))}static fromBinaryView(t){let n=new Xt(t),r=e.fromReader(n);if(!n.eof())throw Error(`Serialized BEEF contains trailing data`);return r}static fromString(t,n=`hex`){let r=new Xt(nn(t,n));return e.fromReader(r)}tryToValidateBumpIndex(e){if(e.bumpIndex!==void 0)return!0;let t=e.txid,n=this.ensureBumpTxidIndex().get(t);if(n===void 0)return!1;e.bumpIndex=n;let r=this.bumps[n].path[0].find(e=>e.hash===t);return r!=null&&(r.txid=!0),!0}sortTxs(){if(this.synchronizeNestedTransactionMutations(),this.synchronizeNestedBumpMutations(),this.sortResultCache!=null&&this.sortTxStateMatches())return this.cloneSortResult(this.sortResultCache);this.sortResultCache=void 0,this.sortTxState=void 0;let e={},t={},n=[],r=[],i=this.partitionTxs(t,e,n,r),{txsMissingInputs:a,missingInputs:o,remaining:s}=this.separateMissingInputs(i,t);i=s;let c=this.topoSort(i,e,n);this.txs=a.concat(c).concat(r).concat(n),this.needsSort=!1,this.invalidateSerializationCaches(),this.rebuildTxIndexes();let l={missingInputs:Object.keys(o),notValid:c.map(e=>e.txid),valid:Object.keys(e),withMissingInputs:a.map(e=>e.txid),txidOnly:r.map(e=>e.txid)};return this.sortResultCache=l,this.captureSortTxState(),this.cloneSortResult(l)}captureSortTxState(){this.sortTxState=this.txs.map(e=>({ref:e,txid:e.txid,bumpIndex:e.bumpIndex,isTxidOnly:e.isTxidOnly,inputTxids:[...e.inputTxids]}))}sortTxStateMatches(){if(this.sortTxState?.length!==this.txs.length)return!1;for(let e=0;e<this.txs.length;e++){let t=this.txs[e],n=this.sortTxState[e];if(n.ref!==t||n.txid!==t.txid||n.bumpIndex!==t.bumpIndex||n.isTxidOnly!==t.isTxidOnly||n.inputTxids.length!==t.inputTxids.length)return!1;for(let e=0;e<t.inputTxids.length;e++)if(n.inputTxids[e]!==t.inputTxids[e])return!1}return!0}cloneSortResult(e){return{missingInputs:[...e.missingInputs],notValid:[...e.notValid],valid:[...e.valid],withMissingInputs:[...e.withMissingInputs],txidOnly:[...e.txidOnly]}}partitionTxs(e,t,n,r){let i=[];for(let a of this.txs)e[a.txid]=a,a.isValid=a.hasProof,a.isValid?(t[a.txid]=!0,n.push(a)):a.isTxidOnly&&a.inputTxids.length===0?(t[a.txid]=!0,r.push(a)):i.push(a);return i}separateMissingInputs(e,t){let n={},r=[],i=[];for(let a of e){let e=!1;for(let r of a.inputTxids)t[r]===void 0&&(n[r]=!0,e=!0);e?r.push(a):i.push(a)}return{txsMissingInputs:r,missingInputs:n,remaining:i}}topoSort(e,t,n){let{indegree:r,dependents:i,originalIndex:a,round:o}=this.buildTopoSortGraph(e,t),s=this.processTopoSortQueue(e,r,i,a,o);return this.appendTopoSortResult(e,s,o,t,n),e.filter(e=>!s.has(e.txid))}buildTopoSortGraph(e,t){let n=new Set(e.map(e=>e.txid)),r=new Map,i=new Map,a=new Map(e.map((e,t)=>[e.txid,t])),o=new Map;for(let a of e){let e=0;for(let r of a.inputTxids)if(!t[r]&&(e++,n.has(r))){let e=i.get(r)??[];e.push(a),i.set(r,e)}r.set(a.txid,e),o.set(a.txid,0)}return{indegree:r,dependents:i,originalIndex:a,round:o}}processTopoSortQueue(e,t,n,r,i){let a=e.filter(e=>t.get(e.txid)===0),o=new Set;for(let e of a)if(!o.has(e.txid)){o.add(e.txid);for(let o of n.get(e.txid)??[]){let n=(i.get(e.txid)??0)+ +((r.get(e.txid)??0)>(r.get(o.txid)??0));i.set(o.txid,Math.max(i.get(o.txid)??0,n));let s=(t.get(o.txid)??0)-1;t.set(o.txid,s),s===0&&a.push(o)}}return o}appendTopoSortResult(e,t,n,r,i){let a=[];for(let r of e){if(!t.has(r.txid))continue;let e=n.get(r.txid)??0,i=a[e]??[];i.push(r),a[e]=i}for(let e of a)for(let t of e??[])r[t.txid]=!0,i.push(t)}clone(){let t=new e;return t.version=this.version,t.bumps=Array.from(this.bumps),t.txs=Array.from(this.txs),t.txidIndex=void 0,t.txPositionIndex=void 0,t.bumpIndexesByHeight=void 0,t.bumpIndexByTxid=void 0,t.needsSort=this.needsSort,t.sortResultCache=this.sortResultCache==null?void 0:this.cloneSortResult(this.sortResultCache),t.sortResultCache!=null&&t.captureSortTxState(),t.hexCache=this.hexCache,t.rawBytesCache=this.rawBytesCache,t.rawBytesCache!=null&&t.captureSerializationState(),t}trimKnownTxids(e){let t=this.removeKnownTxidOnlyTxs(new Set(e));t=this.reindexBumps()||t,t&&this.markMutated(!0)}removeKnownTxidOnlyTxs(e){let t=this.txs.length;this.txs=this.txs.filter(t=>!(t.isTxidOnly&&e.has(t.txid)));let n=this.txs.length!==t;return n&&this.rebuildTxIndexes(),n}reindexBumps(){let e=new Set;for(let t of this.txs)t.bumpIndex!==void 0&&e.add(t.bumpIndex);if(e.size>=this.bumps.length)return!1;let t=new Map,n=0;for(let r=0;r<this.bumps.length;r++)e.has(r)&&(t.set(r,n),n++);this.bumps=this.bumps.filter((t,n)=>e.has(n));for(let e of this.txs){if(e.bumpIndex===void 0)continue;let n=t.get(e.bumpIndex);if(n===void 0)throw Error(`Internal error: bumpIndex ${e.bumpIndex} not found in indexMap`);e.bumpIndex=n}return this.invalidateBumpIndexes(),!0}getValidTxids(){return this.sortTxs().valid}toLogString(){let e=``;e+=`BEEF with ${this.bumps.length} BUMPS and ${this.txs.length} Transactions, isValid ${this.isValid().toString()}\n`;let t=-1;for(let n of this.bumps)t++,e+=` BUMP ${t}\n block: ${n.blockHeight}\n txids: [\n${n.path[0].filter(e=>e.txid===!0).map(e=>` '${e.hash??``}'`).join(`,
|
|
15
|
+
`+e.stack}}var Je=Object.prototype.hasOwnProperty,Ye=t.unstable_scheduleCallback,Xe=t.unstable_cancelCallback,Ze=t.unstable_shouldYield,Qe=t.unstable_requestPaint,$e=t.unstable_now,et=t.unstable_getCurrentPriorityLevel,tt=t.unstable_ImmediatePriority,nt=t.unstable_UserBlockingPriority,rt=t.unstable_NormalPriority,it=t.unstable_LowPriority,at=t.unstable_IdlePriority,ot=t.log,st=t.unstable_setDisableYieldValue,ct=null,lt=null;function ut(e){if(typeof ot==`function`&&st(e),lt&&typeof lt.setStrictMode==`function`)try{lt.setStrictMode(ct,e)}catch{}}var dt=Math.clz32?Math.clz32:mt,ft=Math.log,pt=Math.LN2;function mt(e){return e>>>=0,e===0?32:31-(ft(e)/pt|0)|0}var ht=256,gt=262144,_t=4194304;function vt(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 yt(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=vt(n))):i=vt(o):i=vt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=vt(n))):i=vt(o)):i=vt(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 bt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function xt(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-dt(n),i=1<<r;t|=e[r],n&=~i}return t}function St(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 Ct(){var e=_t;return _t<<=1,!(_t&62914560)&&(_t=4194304),e}function wt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Tt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Et(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-dt(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Dt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Dt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-dt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Ot(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-dt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function kt(e,t){var n=t&-t;return n=n&42?1:At(n),(n&(e.suspendedLanes|t))===0?n:0}function At(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 jt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Mt(){var e=T.p;return e===0?(e=window.event,e===void 0?32:Th(e.type)):e}function Nt(e,t){var n=T.p;try{return T.p=e,t()}finally{T.p=n}}var Pt=Math.random().toString(36).slice(2),Ft=`__reactFiber$`+Pt,It=`__reactProps$`+Pt,Lt=`__reactContainer$`+Pt,Rt=`__reactEvents$`+Pt,zt=`__reactListeners$`+Pt,Bt=`__reactHandles$`+Pt,Vt=`__reactResources$`+Pt,Ht=`__reactMarker$`+Pt,Ut=`__reactLoad$`+Pt;function Wt(e){delete e[Ft],delete e[It],delete e[zt],delete e[Bt]}function Gt(e){var t;if(t=e[Ft])return t;for(var n=e.parentNode;n;){if(t=n[Lt]||n[Ft]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=mm(e);e!==null;){if(n=e[Ft])return n;e=mm(e)}return t}e=n,n=e.parentNode}return null}function Kt(e){if(e=e[Ft]||e[Lt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function qt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Jt(e){var t=e[Vt];return t||=e[Vt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Yt(e){e[Ht]=!0}function Xt(e){e[Ut]=void 0}var Zt=new Set,Qt={};function $t(e,t){E(e,t),E(e+`Capture`,t)}function E(e,t){for(Qt[e]=t,e=0;e<t.length;e++)Zt.add(t[e])}var en=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]*$`),tn={},nn={};function rn(e){return Je.call(nn,e)?!0:Je.call(tn,e)?!1:en.test(e)?nn[e]=!0:(tn[e]=!0,!1)}var D=!1;function an(){var e=D;return D=!1,e}function on(e,t,n){if(rn(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 sn(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 cn(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 ln(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function un(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function dn(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 fn(e){if(!e._valueTracker){var t=un(e)?`checked`:`value`;e._valueTracker=dn(e,t,``+e[t])}}function pn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=un(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var mn=/[\n"\\]/g;function hn(e){return e.replace(mn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function gn(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=``+ln(t)):e.value!==``+ln(t)&&(e.value=``+ln(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):vn(e,ln(n)):o===`number`&&e.value==t?vn(e,ln(e.value)):vn(e,ln(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=``+ln(s):e.removeAttribute(`name`)}function _n(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)){fn(e);return}n=n==null?``:``+ln(n),t=t==null?n:``+ln(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),fn(e)}function vn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function yn(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=``+ln(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 bn(e,t,n){if(t!=null&&(t=``+ln(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+ln(n)}function xn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(o(92));if(Ee(r)){if(1<r.length)throw Error(o(93));r=r[0]}n=r}n??=``,t=n}n=ln(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),fn(e)}function Sn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Cn=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function wn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Cn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Tn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(o(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,D=!0);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&(wn(e,i,r),D=!0)}else for(var a in t)t.hasOwnProperty(a)&&wn(e,a,t[a])}function En(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 Dn=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`]]),On=/^[\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 kn(e){return On.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function An(){}var jn=null;function Mn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Nn=null,Pn=null;function Fn(e){var t=Kt(e);if(t&&(e=t.stateNode)){var n=e[It]||null;a:switch(e=t.stateNode,t.type){case`input`:if(gn(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="`+hn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[It]||null;if(!i)throw Error(o(90));gn(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&pn(r)}break a;case`textarea`:bn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&yn(e,!!n.multiple,t,!1)}}}var In=!1;function Ln(e,t,n){if(In)return e(t,n);In=!0;try{return e(t)}finally{if(In=!1,(Nn!==null||Pn!==null)&&(Zd(),Nn&&(t=Nn,e=Pn,Pn=Nn=null,Fn(t),e)))for(t=0;t<e.length;t++)Fn(e[t])}}function Rn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[It]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(o(231,t,typeof n));return n}var zn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),Bn=!1;if(zn)try{var Vn={};Object.defineProperty(Vn,"passive",{get:function(){Bn=!0}}),window.addEventListener(`test`,Vn,Vn),window.removeEventListener(`test`,Vn,Vn)}catch{Bn=!1}var Hn=null,O=null,Un=null;function Wn(){if(Un)return Un;var e,t=O,n=t.length,r,i=`value`in Hn?Hn.value:Hn.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 Un=i.slice(e,1<r?1-r:void 0)}function Gn(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 Kn(){return!0}function qn(){return!1}function Jn(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)?Kn:qn,this.isPropagationStopped=qn,this}return C(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=Kn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Kn)},persist:function(){},isPersistent:Kn}),t}var Yn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Xn=Jn(Yn),Zn=C({},Yn,{view:0,detail:0}),Qn=Jn(Zn),$n,er,tr,nr=C({},Zn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:pr,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!==tr&&(tr&&e.type===`mousemove`?($n=e.screenX-tr.screenX,er=e.screenY-tr.screenY):er=$n=0,tr=e),$n)},movementY:function(e){return`movementY`in e?e.movementY:er}}),rr=Jn(nr),ir=Jn(C({},nr,{dataTransfer:0})),ar=Jn(C({},Zn,{relatedTarget:0})),or=Jn(C({},Yn,{animationName:0,elapsedTime:0,pseudoElement:0})),sr=Jn(C({},Yn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),cr=Jn(C({},Yn,{data:0})),lr={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},ur={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`},dr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function fr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=dr[e])?!!t[e]:!1}function pr(){return fr}var mr=Jn(C({},Zn,{key:function(e){if(e.key){var t=lr[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Gn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?ur[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:pr,charCode:function(e){return e.type===`keypress`?Gn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Gn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),hr=Jn(C({},nr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),gr=Jn(C({},Yn,{submitter:0})),_r=Jn(C({},Zn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:pr})),vr=Jn(C({},Yn,{propertyName:0,elapsedTime:0,pseudoElement:0})),yr=Jn(C({},nr,{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})),br=Jn(C({},Yn,{newState:0,oldState:0,source:0})),xr=[9,13,27,32],Sr=zn&&`CompositionEvent`in window,Cr=null;zn&&`documentMode`in document&&(Cr=document.documentMode);var wr=zn&&`TextEvent`in window&&!Cr,Tr=zn&&(!Sr||Cr&&8<Cr&&11>=Cr),Er=` `,Dr=!1;function Or(e,t){switch(e){case`keyup`:return xr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function kr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Ar=!1;function k(e,t){switch(e){case`compositionend`:return kr(t);case`keypress`:return t.which===32?(Dr=!0,Er):null;case`textInput`:return e=t.data,e===Er&&Dr?null:e;default:return null}}function jr(e,t){if(Ar)return e===`compositionend`||!Sr&&Or(e,t)?(e=Wn(),Un=O=Hn=null,Ar=!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 Tr&&t.locale!==`ko`?null:t.data;default:return null}}var Mr={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 Nr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Mr[e.type]:t===`textarea`}function Pr(e,t,n,r){Nn?Pn?Pn.push(r):Pn=[r]:Nn=r,t=sp(t,`onChange`),0<t.length&&(n=new Xn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Fr=null,Ir=null;function Lr(e){ep(e,0)}function Rr(e){if(pn(qt(e)))return e}function zr(e,t){if(e===`change`)return t}var Br=!1;if(zn){var Vr;if(zn){var Hr=`oninput`in document;if(!Hr){var Ur=document.createElement(`div`);Ur.setAttribute(`oninput`,`return;`),Hr=typeof Ur.oninput==`function`}Vr=Hr}else Vr=!1;Br=Vr&&(!document.documentMode||9<document.documentMode)}function Wr(){Fr&&(Fr.detachEvent(`onpropertychange`,Gr),Ir=Fr=null)}function Gr(e){if(e.propertyName===`value`&&Rr(Ir)){var t=[];Pr(t,Ir,e,Mn(e)),Ln(Lr,t)}}function Kr(e,t,n){e===`focusin`?(Wr(),Fr=t,Ir=n,Fr.attachEvent(`onpropertychange`,Gr)):e===`focusout`&&Wr()}function qr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Rr(Ir)}function Jr(e,t){if(e===`click`)return Rr(t)}function Yr(e,t){if(e===`input`||e===`change`)return Rr(t)}function Xr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Zr=typeof Object.is==`function`?Object.is:Xr;function Qr(e,t){if(Zr(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(!Je.call(t,i)||!Zr(e[i],t[i]))return!1}return!0}function $r(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 ei(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ti(e,t){var n=ei(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=ei(n)}}function ni(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ni(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ri(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=$r(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=$r(e.document)}return t}function ii(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 ai=zn&&`documentMode`in document&&11>=document.documentMode,oi=null,si=null,ci=null,li=!1;function ui(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;li||oi==null||oi!==$r(r)||(r=oi,`selectionStart`in r&&ii(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}),ci&&Qr(ci,r)||(ci=r,r=sp(si,`onSelect`),0<r.length&&(t=new Xn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=oi)))}function di(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var fi={animationend:di(`Animation`,`AnimationEnd`),animationiteration:di(`Animation`,`AnimationIteration`),animationstart:di(`Animation`,`AnimationStart`),transitionrun:di(`Transition`,`TransitionRun`),transitionstart:di(`Transition`,`TransitionStart`),transitioncancel:di(`Transition`,`TransitionCancel`),transitionend:di(`Transition`,`TransitionEnd`)},pi={},mi={};zn&&(mi=document.createElement(`div`).style,`AnimationEvent`in window||(delete fi.animationend.animation,delete fi.animationiteration.animation,delete fi.animationstart.animation),`TransitionEvent`in window||delete fi.transitionend.transition);function hi(e){if(pi[e])return pi[e];if(!fi[e])return e;var t=fi[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in mi)return pi[e]=t[n];return e}var gi=hi(`animationend`),_i=hi(`animationiteration`),vi=hi(`animationstart`),yi=hi(`transitionrun`),bi=hi(`transitionstart`),xi=hi(`transitioncancel`),Si=hi(`transitionend`),Ci=new Map,wi=`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(` `);wi.push(`scrollEnd`);function Ti(e,t){Ci.set(e,t),$t(t,[e])}var Ei=0;function Di(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Md.identifierPrefix;var n=Ei++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function Oi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Bd;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 ki(e,t){return e=Oi(e),t=Oi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var Ai=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)},ji=[],Mi=0,Ni=0;function Pi(){for(var e=Mi,t=Ni=Mi=0;t<e;){var n=ji[t];ji[t++]=null;var r=ji[t];ji[t++]=null;var i=ji[t];ji[t++]=null;var a=ji[t];if(ji[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&&Ri(n,i,a)}}function Fi(e,t,n,r){ji[Mi++]=e,ji[Mi++]=t,ji[Mi++]=n,ji[Mi++]=r,Ni|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ii(e,t,n,r){return Fi(e,t,n,r),zi(e)}function Li(e,t){return Fi(e,null,null,t),zi(e)}function Ri(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-dt(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function zi(e){if(50<Vd)throw Vd=0,Hd=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Bi={};function Vi(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 Hi(e,t,n,r){return new Vi(e,t,n,r)}function Ui(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Wi(e,t){var n=e.alternate;return n===null?(n=Hi(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 Gi(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ki(e,t,n,r,i,a){var s=0;if(r=e,typeof r==`function`)Ui(r)&&(s=1);else if(typeof r==`string`)s=Ym(e,n,Ne.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case _e:return e=Hi(31,n,t,i),e.elementType=_e,e.lanes=a,e;case se:return qi(n.children,i,a,t);case ce:s=8,i|=24;break;case le:return e=Hi(12,n,t,i|2),e.elementType=le,e.lanes=a,e;case pe:return e=Hi(13,n,t,i),e.elementType=pe,e.lanes=a,e;case me:return e=Hi(19,n,t,i),e.elementType=me,e.lanes=a,e;case ve:case be:return e=i|32,e=Hi(30,n,t,e),e.elementType=be,e.lanes=a,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case de:s=10;break a;case ue:s=9;break a;case fe:s=11;break a;case he:s=14;break a;case ge:s=16,r=null;break a}s=29,n=Error(o(130,e===null?`null`:typeof e,``)),r=null}return t=Hi(s,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function qi(e,t,n,r){return e=Hi(7,e,r,t),e.lanes=n,e}function Ji(e,t,n){return e=Hi(6,e,null,t),e.lanes=n,e}function Yi(e){var t=Hi(18,null,null,0);return t.stateNode=e,t}function Xi(e,t,n){return t=Hi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Zi=new WeakMap;function Qi(e,t){if(typeof e==`object`&&e){var n=Zi.get(e);return n===void 0?(t={value:e,source:t,stack:qe(t)},Zi.set(e,t),t):n}return{value:e,source:t,stack:qe(t)}}var $i=[],ea=0,ta=null,na=0,ra=[],ia=0,aa=null,oa=1,sa=``;function ca(e,t){$i[ea++]=na,$i[ea++]=ta,ta=e,na=t}function la(e,t,n){ra[ia++]=oa,ra[ia++]=sa,ra[ia++]=aa,aa=e;var r=oa;e=sa;var i=32-dt(r)-1;r&=~(1<<i),n+=1;var a=32-dt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,oa=1<<32-dt(t)+i|n<<i|r,sa=a+e}else oa=1<<a|n<<i|r,sa=e}function ua(e){e.return!==null&&(ca(e,1),la(e,1,0))}function A(e){for(;e===ta;)ta=$i[--ea],$i[ea]=null,na=$i[--ea],$i[ea]=null;for(;e===aa;)aa=ra[--ia],ra[ia]=null,sa=ra[--ia],ra[ia]=null,oa=ra[--ia],ra[ia]=null}function da(e,t){ra[ia++]=oa,ra[ia++]=sa,ra[ia++]=aa,oa=t.id,sa=t.overflow,aa=e}var fa=null,pa=null,j=!1,ma=null,ha=!1,ga=Error(o(519));function _a(e){throw Ca(Qi(Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ga}function va(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Ft]=e,t[It]=r,n){case`dialog`:z(`cancel`,t),z(`close`,t);break;case`iframe`:case`object`:case`embed`:z(`load`,t);break;case`video`:case`audio`:for(n=0;n<Qf.length;n++)z(Qf[n],t);break;case`source`:z(`error`,t);break;case`img`:case`image`:case`link`:z(`error`,t),z(`load`,t);break;case`details`:z(`toggle`,t);break;case`input`:z(`invalid`,t),_n(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:z(`invalid`,t);break;case`textarea`:z(`invalid`,t),xn(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||fp(t.textContent,n)?(r.popover!=null&&(z(`beforetoggle`,t),z(`toggle`,t)),r.onScroll!=null&&z(`scroll`,t),r.onScrollEnd!=null&&z(`scrollend`,t),r.onClick!=null&&(t.onclick=An),t=!0):t=!1,t||_a(e,!0)}function ya(e){for(fa=e.return;fa;)switch(fa.tag){case 5:case 31:case 13:ha=!1;return;case 27:case 3:ha=!0;return;default:fa=fa.return}}function ba(e){if(e!==fa)return!1;if(!j)return ya(e),j=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Ep(e.type,e.memoizedProps)),n=!n),n&&pa&&_a(e),ya(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(317));pa=pm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(317));pa=pm(e)}else t===27?(t=pa,V(e.type)?(e=fm,fm=null,pa=e):pa=t):pa=fa?dm(e.stateNode.nextSibling):null;return!0}function xa(){pa=fa=null,j=!1}function Sa(){var e=ma;return e!==null&&(wd===null?wd=e:wd.push.apply(wd,e),ma=null),e}function Ca(e){ma===null?ma=[e]:ma.push(e)}var wa=Ae(null),Ta=null,Ea=null;function Da(e,t,n){Me(wa,t._currentValue),t._currentValue=n}function Oa(e){e._currentValue=wa.current,je(wa)}function ka(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 Aa(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){var s=i.child;a=a.firstContext;a:for(;a!==null;){var c=a;a=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),ka(a.return,n,e),r||(s=null);break a}a=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(o(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),ka(s,n,e),s=null}else i.tag===13&&i.memoizedState!==null&&i.memoizedState.dehydrated===null?(i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),ka(i.return,n,e),s=i.child,s=s===null?null:s.sibling):s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function ja(e,t,n,r){e=null;for(var i=t,a=!1;i!==null;){if(!a){if(i.flags&524288)a=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(o(387));if(s=s.memoizedProps,s!==null){var c=i.type;Zr(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===Ie.current){if(s=i.alternate,s===null)throw Error(o(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[lh]:e.push(lh))}i=i.return}return e!==null&&Aa(t,e,n,r),t.flags|=262144,e!==null}function Ma(e){for(e=e.firstContext;e!==null;){if(!Zr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Na(e){Ta=e,Ea=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Pa(e){return Ia(Ta,e)}function Fa(e,t){return Ta===null&&Na(e),Ia(e,t)}function Ia(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ea===null){if(e===null)throw Error(o(308));Ea=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ea=Ea.next=t;return n}var La=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()})}},Ra=t.unstable_scheduleCallback,za=t.unstable_NormalPriority,Ba={$$typeof:de,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Va(){return{controller:new La,data:new Map,refCount:0}}function Ha(e){e.refCount--,e.refCount===0&&Ra(za,function(){e.controller.abort()})}function Ua(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 M=null;function Wa(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ga=null,Ka=0,qa=0,Ja=null;function Ya(e,t){if(Ga===null){var n=Ga=[];Ka=0,qa=qf(),Ja={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ka++,t.then(Xa,Xa),t}function Xa(){if(--Ka===0&&(M=null,Ga!==null)){Ja!==null&&(Ja.status=`fulfilled`);var e=Ga;Ga=null,qa=0,Ja=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Za(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Qa=w.S;w.S=function(e,t){if(Dd=$e(),typeof t==`object`&&t&&typeof t.then==`function`&&Ya(e,t),M!==null)for(var n=Nf;n!==null;)Ua(n,M),n=n.next;if(n=e.types,n!==null){for(var r=Nf;r!==null;)Ua(r,n),r=r.next;if(qa!==0){r=M,r===null&&(r=M=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Qa!==null&&Qa(e,t)};var $a=Ae(null);function eo(){var e=$a.current;return e===null?ud.pooledCache:e}function to(e,t){t===null?Me($a,$a.current):Me($a,t.pool)}function no(){var e=eo();return e===null?null:{parent:Ba._currentValue,pool:e}}var ro=Error(o(460)),io=Error(o(474)),ao=Error(o(542)),oo={then:function(){}};function so(e){return e=e.status,e===`fulfilled`||e===`rejected`}function co(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(An,An),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,po(e),e===void 0&&!(`reason`in t)?Error(o(600)):e;default:if(typeof t.status==`string`)t.then(An,An);else{if(e=ud,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,po(e),e}throw uo=t,ro}}function lo(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(uo=e,ro):e}}var uo=null;function fo(){if(uo===null)throw Error(o(459));var e=uo;return uo=null,e}function po(e){if(e===ro||e===ao)throw Error(o(483))}var mo=null,ho=0;function go(e){var t=ho;return ho+=1,mo===null&&(mo=[]),co(mo,e,t)}function _o(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function vo(e,t){throw t.$$typeof===ie?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function yo(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 i(e,t){return e=Wi(e,t),e.index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Ji(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===se?(e=d(e,t,n.props.children,r,n.key),_o(e,n),e):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===ge&&lo(a)===t.type)?(t=i(t,n.props),_o(t,n),t.return=e,t):(t=Ki(n.type,n.key,n.props,null,e.mode,r),_o(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=Xi(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=qi(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Ji(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case ae:return n=Ki(t.type,t.key,t.props,null,e.mode,n),_o(n,t),n.return=e,n;case oe:return t=Xi(t,e.mode,n),t.return=e,t;case ge:return t=lo(t),f(e,t,n)}if(Ee(t)||Ce(t))return t=qi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,go(t),n);if(t.$$typeof===de)return f(e,Fa(e,t),n);vo(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 ae:return n.key===i?l(e,t,n,r):null;case oe:return n.key===i?u(e,t,n,r):null;case ge:return n=lo(n),p(e,t,n,r)}if(Ee(n)||Ce(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,go(n),r);if(n.$$typeof===de)return p(e,t,Fa(e,n),r);vo(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 ae:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case oe:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case ge:return r=lo(r),m(e,t,n,r,i)}if(Ee(r)||Ce(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,go(r),i);if(r.$$typeof===de)return m(e,t,n,Fa(t,r),i);vo(t,r)}return null}function h(i,o,s,c){for(var l=null,u=null,d=o,h=o=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),o=a(_,o,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),j&&ca(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(o=a(d,o,h),u===null?l=d:u.sibling=d,u=d);return j&&ca(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),o=a(g,o,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),j&&ca(i,h),l}function g(i,s,c,l){if(c==null)throw Error(o(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=a(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),j&&ca(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=a(v,s,g),d===null?u=v:d.sibling=v,d=v);return j&&ca(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=a(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),j&&ca(i,g),u}function _(e,r,a,c){if(typeof a==`object`&&a&&a.type===se&&a.key===null&&a.props.ref===void 0&&(a=a.props.children),typeof a==`object`&&a){switch(a.$$typeof){case ae:a:{for(var l=a.key;r!==null;){if(r.key===l){if(l=a.type,l===se){if(r.tag===7){n(e,r.sibling),c=i(r,a.props.children),_o(c,a),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ge&&lo(l)===r.type){n(e,r.sibling),c=i(r,a.props),_o(c,a),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}a.type===se?(c=qi(a.props.children,e.mode,c,a.key),_o(c,a),c.return=e,e=c):(c=Ki(a.type,a.key,a.props,null,e.mode,c),_o(c,a),c.return=e,e=c)}return s(e);case oe:a:{for(l=a.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===a.containerInfo&&r.stateNode.implementation===a.implementation){n(e,r.sibling),c=i(r,a.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Xi(a,e.mode,c),c.return=e,e=c}return s(e);case ge:return a=lo(a),_(e,r,a,c)}if(Ee(a))return h(e,r,a,c);if(Ce(a)){if(l=Ce(a),typeof l!=`function`)throw Error(o(150));return a=l.call(a),g(e,r,a,c)}if(typeof a.then==`function`)return _(e,r,go(a),c);if(a.$$typeof===de)return _(e,r,Fa(e,a),c);vo(e,a)}return typeof a==`string`&&a!==``||typeof a==`number`||typeof a==`bigint`?(a=``+a,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,a),c.return=e,e=c):(n(e,r),c=Ji(a,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ho=0;var i=_(e,t,n,r);return mo=null,i}catch(t){if(t===ro||t===ao)throw t;var a=Hi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var bo=yo(!0),xo=yo(!1),So=!1;function Co(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function N(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 wo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function To(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,I&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=zi(e),Ri(e,null,n),t}return Fi(e,r,t,n),zi(e)}function Eo(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,Ot(e,n)}}function Do(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 Oo=!1;function ko(){if(Oo){var e=Ja;if(e!==null)throw e}}function Ao(e,t,n,r){Oo=!1;var i=e.updateQueue;So=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(R&f)===f:(r&f)===f){f!==0&&f===qa&&(Oo=!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=C({},d,f);break a;case 2:So=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),vd|=o,e.lanes=o,e.memoizedState=d}}function jo(e,t){if(typeof e!=`function`)throw Error(o(191,e));e.call(t)}function P(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)jo(n[e],t)}var Mo=Ae(null),No=Ae(0);function Po(e,t){e=gd,Me(No,e),Me(Mo,t),gd=e|t.baseLanes}function Fo(){Me(No,gd),Me(Mo,Mo.current)}function Io(){gd=No.current,je(Mo),je(No)}var Lo=Ae(null),Ro=null;function zo(e){var t=e.alternate;Me(Wo,Wo.current&1),Me(Lo,e),Ro===null&&(t===null||Mo.current!==null||t.memoizedState!==null)&&(Ro=e)}function Bo(e){Me(Wo,Wo.current),Me(Lo,e),Ro===null&&(Ro=e)}function Vo(e){e.tag===22?(Me(Wo,Wo.current),Me(Lo,e),Ro===null&&(Ro=e)):Ho()}function Ho(){Me(Wo,Wo.current),Me(Lo,Lo.current)}function Uo(e){je(Lo),Ro===e&&(Ro=null),je(Wo)}var Wo=Ae(0);function Go(e,t){Me(Lo,Lo.current),Me(Wo,t)}function Ko(e){je(Wo),je(Lo),Ro===e&&(Ro=null)}function qo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||cm(n)||lm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Jo=0,F=null,Yo=null,Xo=null,Zo=!1,Qo=!1,$o=!1,es=0,ts=0,ns=null,rs=0;function is(){throw Error(o(321))}function as(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Zr(e[n],t[n]))return!1;return!0}function os(e,t,n,r,i,a){return Jo=a,F=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,w.H=e===null||e.memoizedState===null?Cc:wc,$o=!1,a=n(r,i),$o=!1,Qo&&(a=cs(t,n,r,i)),ss(e),a}function ss(e){w.H=Sc;var t=Yo!==null&&Yo.next!==null;if(Jo=0,Xo=Yo=F=null,Zo=!1,ts=0,ns=null,t)throw Error(o(300));e===null||Vc||(e=e.dependencies,e!==null&&Ma(e)&&(Vc=!0))}function cs(e,t,n,r){F=e;var i=0;do{if(Qo&&(ns=null),ts=0,Qo=!1,25<=i)throw Error(o(301));if(i+=1,Xo=Yo=null,e.updateQueue!=null){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}w.H=Tc,a=t(n,r)}while(Qo);return a}function ls(){var e=w.H,t=e.useState()[0];return t=typeof t.then==`function`?gs(t):t,e=e.useState()[0],(Yo===null?null:Yo.memoizedState)!==e&&(F.flags|=1024),t}function us(){var e=es!==0;return es=0,e}function ds(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function fs(e){if(Zo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Zo=!1}Jo=0,Xo=Yo=F=null,Qo=!1,ts=es=0,ns=null}function ps(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Xo===null?F.memoizedState=Xo=e:Xo=Xo.next=e,Xo}function ms(){if(Yo===null){var e=F.alternate;e=e===null?null:e.memoizedState}else e=Yo.next;var t=Xo===null?F.memoizedState:Xo.next;if(t!==null)Xo=t,Yo=e;else{if(e===null)throw F.alternate===null?Error(o(467)):Error(o(310));Yo=e,e={memoizedState:Yo.memoizedState,baseState:Yo.baseState,baseQueue:Yo.baseQueue,queue:Yo.queue,next:null},Xo===null?F.memoizedState=Xo=e:Xo=Xo.next=e}return Xo}function hs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function gs(e){var t=ts;return ts+=1,ns===null&&(ns=[]),e=co(ns,e,t),t=F,(Xo===null?t.memoizedState:Xo.next)===null&&(t=t.alternate,w.H=t===null||t.memoizedState===null?Cc:wc),e}function _s(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return gs(e);if(e.$$typeof===xe)return;if(e.$$typeof===de)return Pa(e)}throw Error(o(438,String(e)))}function vs(e){var t=null,n=F.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=F.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=hs(),F.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]=ye;return t.index++,n}function ys(e,t){return typeof t==`function`?t(e):t}function bs(e){return xs(ms(),Yo,e)}function xs(e,t,n){var r=e.queue;if(r===null)throw Error(o(311));r.lastRenderedReducer=n;var i=e.baseQueue,a=r.pending;if(a!==null){if(i!==null){var s=i.next;i.next=a.next,a.next=s}t.baseQueue=i=a,r.pending=null}if(a=e.baseState,i===null)e.memoizedState=a;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Jo&f)===f:(R&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===qa&&(d=!0);else if((Jo&p)===p){u=u.next,p===qa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=a):l=l.next=f,F.lanes|=p,vd|=p;f=u.action,$o&&n(a,f),a=u.hasEagerState?u.eagerState:n(a,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=a):l=l.next=p,F.lanes|=f,vd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=a:l.next=c,!Zr(a,e.memoizedState)&&(Vc=!0,d&&(n=Ja,n!==null)))throw n;e.memoizedState=a,e.baseState=s,e.baseQueue=l,r.lastRenderedState=a}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Ss(e){var t=ms(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do a=e(a,s.action),s=s.next;while(s!==i);Zr(a,t.memoizedState)||(Vc=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function Cs(e,t,n){var r=F,i=ms(),a=j;if(a){if(n===void 0)throw Error(o(407));n=n()}else n=t();var s=!Zr((Yo||i).memoizedState,n);if(s&&(i.memoizedState=n,Vc=!0),i=i.queue,Js(Es.bind(null,r,i,e),[e]),e=i.getSnapshot!==t||s||Xo!==null&&!!(Xo.memoizedState.tag&1),Us(e?9:8,{destroy:void 0},Ts.bind(null,r,i,n,t),null),e){if(r.flags|=2048,ud===null)throw Error(o(349));a||Jo&127||ws(r,t,n)}return n}function ws(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=F.updateQueue,t===null?(t=hs(),F.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ts(e,t,n,r){t.value=n,t.getSnapshot=r,Ds(t)&&Os(e)}function Es(e,t,n){return n(function(){Ds(t)&&Os(e)})}function Ds(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Zr(e,n)}catch{return!0}}function Os(e){var t=Li(e,2);t!==null&&Kd(t,e,2)}function ks(e){var t=ps();if(typeof e==`function`){var n=e;if(e=n(),$o){ut(!0);try{n()}finally{ut(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ys,lastRenderedState:e},t}function As(e,t,n,r){return e.baseState=n,xs(e,Yo,typeof r==`function`?r:ys)}function js(e,t,n,r,i){if(yc(e))throw Error(o(485));if(e=t.action,e!==null){var a={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){a.listeners.push(e)}};w.T===null?a.isTransition=!1:n(!0),r(a),n=t.pending,n===null?(a.next=t.pending=a,Ms(t,a)):(a.next=n.next,t.pending=n.next=a)}}function Ms(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=w.T,o={};o.types=a===null?null:a.types,w.T=o;try{var s=n(i,r),c=w.S;c!==null&&c(o,s),Ns(e,t,s)}catch(n){Fs(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),w.T=a}}else try{a=n(i,r),Ns(e,t,a)}catch(n){Fs(e,t,n)}}function Ns(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ps(e,t,n)},function(n){return Fs(e,t,n)}):Ps(e,t,n)}function Ps(e,t,n){t.status=`fulfilled`,t.value=n,Is(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ms(e,n)))}function Fs(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Is(t),t=t.next;while(t!==r)}e.action=null}function Is(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ls(e,t){return t}function Rs(e,t){if(j){var n=ud.formState;if(n!==null){a:{var r=F;if(j){if(pa){b:{for(var i=pa,a=ha;i.nodeType!==8;){if(!a){i=null;break b}if(i=dm(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){pa=dm(i.nextSibling),r=i.data===`F!`;break a}}_a(r)}r=!1}r&&(t=n[0])}}return n=ps(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ls,lastRenderedState:t},n.queue=r,n=gc.bind(null,F,r),r.dispatch=n,r=ks(!1),a=vc.bind(null,F,!1,r.queue),r=ps(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=js.bind(null,F,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function zs(e){return Bs(ms(),Yo,e)}function Bs(e,t,n){if(t=xs(e,t,Ls)[0],e=bs(ys)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=gs(t)}catch(e){throw e===ro?ao:e}else r=t;t=ms();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(F.flags|=2048,Us(9,{destroy:void 0},Vs.bind(null,i,n),null)),[r,a,e]}function Vs(e,t){e.action=t}function Hs(e){var t=ms(),n=Yo;if(n!==null)return Bs(t,n,e);ms(),t=t.memoizedState,n=ms();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Us(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=F.updateQueue,t===null&&(t=hs(),F.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 Ws(){return ms().memoizedState}function Gs(e,t,n,r){var i=ps();F.flags|=e,i.memoizedState=Us(1|t,{destroy:void 0},n,r===void 0?null:r)}function Ks(e,t,n,r){var i=ms();r=r===void 0?null:r;var a=i.memoizedState.inst;Yo!==null&&r!==null&&as(r,Yo.memoizedState.deps)?i.memoizedState=Us(t,a,n,r):(F.flags|=e,i.memoizedState=Us(1|t,a,n,r))}function qs(e,t){Gs(8390656,8,e,t)}function Js(e,t){Ks(2048,8,e,t)}function Ys(e){F.flags|=4;var t=F.updateQueue;if(t===null)t=hs(),F.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Xs(e){var t=ms().memoizedState;return Ys({ref:t,nextImpl:e}),function(){if(I&2)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function Zs(e,t){return Ks(4,2,e,t)}function Qs(e,t){return Ks(4,4,e,t)}function $s(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 ec(e,t,n){n=n==null?null:n.concat([e]),Ks(4,4,$s.bind(null,t,e),n)}function tc(){}function nc(e,t){var n=ms();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&as(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function rc(e,t){var n=ms();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&as(t,r[1]))return r[0];if(r=e(),$o){ut(!0);try{e()}finally{ut(!1)}}return n.memoizedState=[r,t],r}function ic(e,t,n){return n===void 0||Jo&1073741824&&!(R&261930)?e.memoizedState=t:(e.memoizedState=n,e=Wd(),F.lanes|=e,vd|=e,n)}function ac(e,t,n,r){return Zr(n,t)?n:Mo.current===null?!(Jo&106)||Jo&1073741824&&!(R&261930)?(Vc=!0,e.memoizedState=n):(e=Wd(),F.lanes|=e,vd|=e,t):(e=ic(e,n,r),Zr(e,t)||(Vc=!0),e)}function oc(e,t,n,r,i){var a=T.p;T.p=a!==0&&8>a?a:8;var o=w.T,s={};s.types=o===null?null:o.types,w.T=s,vc(e,!1,t,n);try{var c=i(),l=w.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?_c(e,t,Za(c,r),Ud(e)):_c(e,t,r,Ud(e))}catch(n){_c(e,t,{then:function(){},status:`rejected`,reason:n},Ud())}finally{T.p=a,o!==null&&s.types!==null&&(o.types=s.types),w.T=o}}function sc(){}function cc(e,t,n,r){if(e.tag!==5)throw Error(o(476));var i=lc(e).queue;oc(e,i,t,De,n===null?sc:function(){return uc(e),n(r)})}function lc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:De,baseState:De,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ys,lastRenderedState:De},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ys,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function uc(e){var t=lc(e);t.next===null&&(t=e.alternate.memoizedState),_c(e,t.next.queue,{},Ud())}function dc(){return Pa(lh)}function fc(){return ms().memoizedState}function pc(){return ms().memoizedState}function mc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ud();e=wo(n);var r=To(t,e,n);r!==null&&(Kd(r,t,n),Eo(r,t,n)),t={cache:Va()},e.payload=t;return}t=t.return}}function hc(e,t,n){var r=Ud();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},yc(e)?bc(t,n):(n=Ii(e,t,n,r),n!==null&&(Kd(n,e,r),xc(n,t,r)))}function gc(e,t,n){_c(e,t,n,Ud())}function _c(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(yc(e))bc(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,Zr(s,o))return Fi(e,t,i,0),ud===null&&Pi(),!1}catch{}if(n=Ii(e,t,i,r),n!==null)return Kd(n,e,r),xc(n,t,r),!0}return!1}function vc(e,t,n,r){if(r={lane:2,revertLane:qf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},yc(e)){if(t)throw Error(o(479))}else t=Ii(e,n,r,2),t!==null&&Kd(t,e,2)}function yc(e){var t=e.alternate;return e===F||t!==null&&t===F}function bc(e,t){Qo=Zo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function xc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ot(e,n)}}var Sc={readContext:Pa,use:_s,useCallback:is,useContext:is,useEffect:is,useImperativeHandle:is,useLayoutEffect:is,useInsertionEffect:is,useMemo:is,useReducer:is,useRef:is,useState:is,useDebugValue:is,useDeferredValue:is,useTransition:is,useSyncExternalStore:is,useId:is,useHostTransitionStatus:is,useFormState:is,useActionState:is,useOptimistic:is,useMemoCache:is,useCacheRefresh:is,useEffectEvent:is},Cc={readContext:Pa,use:_s,useCallback:function(e,t){return ps().memoizedState=[e,t===void 0?null:t],e},useContext:Pa,useEffect:qs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Gs(4194308,4,$s.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Gs(4194308,4,e,t)},useInsertionEffect:function(e,t){Gs(4,2,e,t)},useMemo:function(e,t){var n=ps();t=t===void 0?null:t;var r=e();if($o){ut(!0);try{e()}finally{ut(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ps();if(n!==void 0){var i=n(t);if($o){ut(!0);try{n(t)}finally{ut(!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=hc.bind(null,F,e),[r.memoizedState,e]},useRef:function(e){var t=ps();return e={current:e},t.memoizedState=e},useState:function(e){e=ks(e);var t=e.queue,n=gc.bind(null,F,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:tc,useDeferredValue:function(e,t){return ic(ps(),e,t)},useTransition:function(){var e=ks(!1);return e=oc.bind(null,F,e.queue,!0,!1),ps().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=F,i=ps();if(j){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),ud===null)throw Error(o(349));R&127||ws(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,qs(Es.bind(null,r,a,e),[e]),r.flags|=2048,Us(9,{destroy:void 0},Ts.bind(null,r,a,n,t),null),n},useId:function(){var e=ps(),t=ud.identifierPrefix;if(j){var n=sa,r=oa;n=(r&~(1<<32-dt(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=es++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=rs++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:dc,useFormState:Rs,useActionState:Rs,useOptimistic:function(e){var t=ps();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=vc.bind(null,F,!0,n),n.dispatch=t,[e,t]},useMemoCache:vs,useCacheRefresh:function(){return ps().memoizedState=mc.bind(null,F)},useEffectEvent:function(e){var t=ps(),n={impl:e};return t.memoizedState=n,function(){if(I&2)throw Error(o(440));return n.impl.apply(void 0,arguments)}}},wc={readContext:Pa,use:_s,useCallback:nc,useContext:Pa,useEffect:Js,useImperativeHandle:ec,useInsertionEffect:Zs,useLayoutEffect:Qs,useMemo:rc,useReducer:bs,useRef:Ws,useState:function(){return bs(ys)},useDebugValue:tc,useDeferredValue:function(e,t){return ac(ms(),Yo.memoizedState,e,t)},useTransition:function(){var e=bs(ys)[0],t=ms().memoizedState;return[typeof e==`boolean`?e:gs(e),t]},useSyncExternalStore:Cs,useId:fc,useHostTransitionStatus:dc,useFormState:zs,useActionState:zs,useOptimistic:function(e,t){return As(ms(),Yo,e,t)},useMemoCache:vs,useCacheRefresh:pc,useEffectEvent:Xs},Tc={readContext:Pa,use:_s,useCallback:nc,useContext:Pa,useEffect:Js,useImperativeHandle:ec,useInsertionEffect:Zs,useLayoutEffect:Qs,useMemo:rc,useReducer:Ss,useRef:Ws,useState:function(){return Ss(ys)},useDebugValue:tc,useDeferredValue:function(e,t){var n=ms();return Yo===null?ic(n,e,t):ac(n,Yo.memoizedState,e,t)},useTransition:function(){var e=Ss(ys)[0],t=ms().memoizedState;return[typeof e==`boolean`?e:gs(e),t]},useSyncExternalStore:Cs,useId:fc,useHostTransitionStatus:dc,useFormState:Hs,useActionState:Hs,useOptimistic:function(e,t){var n=ms();return Yo===null?(n.baseState=e,[e,n.queue.dispatch]):As(n,Yo,e,t)},useMemoCache:vs,useCacheRefresh:pc,useEffectEvent:Xs};function Ec(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:C({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Dc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Ud(),i=wo(r);i.payload=t,n!=null&&(i.callback=n),t=To(e,i,r),t!==null&&(Kd(t,e,r),Eo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Ud(),i=wo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=To(e,i,r),t!==null&&(Kd(t,e,r),Eo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ud(),r=wo(n);r.tag=2,t!=null&&(r.callback=t),t=To(e,r,n),t!==null&&(Kd(t,e,n),Eo(t,e,n))}};function Oc(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?!Qr(n,r)||!Qr(i,a):!0}function kc(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&&Dc.enqueueReplaceState(t,t.state,null)}function Ac(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=C({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function jc(e){Ai(e)}function Mc(e){console.error(e)}function Nc(e){Ai(e)}function Pc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Fc(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 Ic(e,t,n){return n=wo(n),n.tag=3,n.payload={element:null},n.callback=function(){Pc(e,t)},n}function Lc(e){return e=wo(e),e.tag=3,e}function Rc(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(){Fc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Fc(t,n,r),typeof i!=`function`&&(Ad===null?Ad=new Set([this]):Ad.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function zc(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ja(t,n,i,!0),n=Lo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Ro===null?af():n.alternate===null&&_d===0&&(_d=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===oo?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Df(e,r,i)),!1;case 22:return n.flags|=65536,r===oo?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)),Df(e,r,i)),!1}throw Error(o(435,n.tag))}return Df(e,r,i),af(),!1}if(j)return t=Lo.current,t===null?(r!==ga&&(t=Error(o(423),{cause:r}),Ca(Qi(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=Qi(r,n),i=Ic(e.stateNode,r,i),Do(e,i),_d!==4&&(_d=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==ga&&(e=Error(o(422),{cause:r}),Ca(Qi(e,n)))),!1;var a=Error(o(520),{cause:r});if(a=Qi(a,n),Cd===null?Cd=[a]:Cd.push(a),_d!==4&&(_d=2),t===null)return!0;r=Qi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Ic(n.stateNode,r,e),Do(n,e),!1;case 1:if(t=n.type,a=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||a!==null&&typeof a.componentDidCatch==`function`&&(Ad===null||!Ad.has(a))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Lc(i),Rc(i,e,n,r),Do(n,i),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Bc=Error(o(461)),Vc=!1;function Hc(e,t,n,r){t.child=e===null?xo(t,null,n,r):bo(t,e.child,n,r)}function Uc(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 Na(t),r=os(e,t,n,o,a,i),s=us(),e!==null&&!Vc?(ds(e,t,i),_l(e,t,i)):(j&&s&&ua(t),t.flags|=1,Hc(e,t,r,i),t.child)}function Wc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Ui(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Gc(e,t,a,r,i)):(e=Ki(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!vl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Qr:n,n(o,r)&&e.ref===t.ref)return _l(e,t,i)}return t.flags|=1,e=Wi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Gc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Qr(a,r)&&e.ref===t.ref){if(Vc=!1,t.pendingProps=r=a,vl(e,i))e.flags&131072&&(Vc=!0);else return t.lanes=e.lanes,_l(e,t,i)}}return $c(e,t,n,r,i)}function Kc(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 Jc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&to(t,a===null?null:a.cachePool),a===null?Fo():Po(t,a),Vo(t);else return r=t.lanes=536870912,Jc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&to(t,null),Fo(),Ho()):(to(t,a.cachePool),Po(t,a),Ho(),t.memoizedState=null);return Hc(e,t,i,n),t.child}function qc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Jc(e,t,n,r,i){var a=eo();return a=a===null?null:{parent:Ba._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&to(t,null),Fo(),Vo(t),e!==null&&ja(e,t,r,!0),t.childLanes=i,null}function Yc(e,t){return t=cl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Xc(e,t,n){return bo(t,e.child,null,n),e=Yc(t,t.pendingProps),e.flags|=2,Uo(t),t.memoizedState=null,e}function Zc(e,t,n){var r=t.pendingProps,i=!!(t.flags&128);if(t.flags&=-129,e===null){if(j){if(r.mode===`hidden`)return e=Yc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},qc(null,e);if(Bo(t),(e=pa)?(e=sm(e,ha),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:aa===null?null:{id:oa,overflow:sa},retryLane:536870912,hydrationErrors:null},n=Yi(e),n.return=t,t.child=n,fa=t,pa=null)):e=null,e===null)throw _a(t);return t.lanes=536870912,null}return Yc(t,r)}var a=e.memoizedState;if(a!==null){var s=a.dehydrated;if(Bo(t),i){if(t.flags&256)t.flags&=-257,t=Xc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558))}else if(Vc||ja(e,t,n,!1),i=(n&e.childLanes)!==0,Vc||i){if(Mo.current===null){if(r=ud,r!==null&&(s=kt(r,n),s!==0&&s!==a.retryLane))throw a.retryLane=s,Li(e,s),Kd(r,e,s),Bc;af()}t=Xc(e,t,n)}else e=a.treeContext,pa=dm(s.nextSibling),fa=t,j=!0,ma=null,ha=!1,e!==null&&da(t,e),t=Yc(t,r),t.flags|=134221824;return t}return e=Wi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Qc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(o(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function $c(e,t,n,r,i){return Na(t),n=os(e,t,n,r,void 0,i),r=us(),e!==null&&!Vc?(ds(e,t,i),_l(e,t,i)):(j&&r&&ua(t),t.flags|=1,Hc(e,t,n,i),t.child)}function el(e,t,n,r,i,a){return Na(t),t.updateQueue=null,n=cs(t,r,n,i),ss(e),r=us(),e!==null&&!Vc?(ds(e,t,a),_l(e,t,a)):(j&&r&&ua(t),t.flags|=1,Hc(e,t,n,a),t.child)}function tl(e,t,n,r,i){if(Na(t),t.stateNode===null){var a=Bi,o=n.contextType;typeof o==`object`&&o&&(a=Pa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Dc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Co(t),o=n.contextType,a.context=typeof o==`object`&&o?Pa(o):Bi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Ec(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&&Dc.enqueueReplaceState(a,a.state,null),Ao(t,r,a,i),ko(),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=Ac(n,s);a.props=c;var l=a.context,u=n.contextType;o=Bi,typeof u==`object`&&u&&(o=Pa(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)&&kc(t,a,r,o),So=!1;var f=t.memoizedState;a.state=f,Ao(t,r,a,i),ko(),l=t.memoizedState,s||f!==l||So?(typeof d==`function`&&(Ec(t,n,d,r),l=t.memoizedState),(c=So||Oc(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,N(e,t),o=t.memoizedProps,u=Ac(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Bi,typeof l==`object`&&l&&(c=Pa(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)&&kc(t,a,r,c),So=!1,f=t.memoizedState,a.state=f,Ao(t,r,a,i),ko();var p=t.memoizedState;o!==d||f!==p||So||e!==null&&e.dependencies!==null&&Ma(e.dependencies)?(typeof s==`function`&&(Ec(t,n,s,r),p=t.memoizedState),(u=So||Oc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ma(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,Qc(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=bo(t,e.child,null,i),t.child=bo(t,null,n,i)):Hc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=_l(e,t,i),e}function nl(e,t,n,r){return xa(),t.flags|=256,Hc(e,t,n,r),t.child}var rl={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function il(e){return{baseLanes:e,cachePool:no()}}function al(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=xd),e}function ol(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Wo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(j){if(i?zo(t):Ho(),(e=pa)?(e=sm(e,ha),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:aa===null?null:{id:oa,overflow:sa},retryLane:536870912,hydrationErrors:null},n=Yi(e),n.return=t,t.child=n,fa=t,pa=null)):e=null,e===null)throw _a(t);return t.lanes=lm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Ho(),i=t.mode,a=cl({mode:`hidden`,children:a},i),r=qi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=il(n),r.childLanes=al(e,o,n),t.memoizedState=rl,qc(null,r)):(zo(t),sl(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return ul(e,t,a,o,r,c,s,n)}return i?(Ho(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Wi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=qi(i,a,n,null),i.flags|=2):i=Wi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,qc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=il(n):(a=i.cachePool,a===null?a=no():(s=Ba._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=al(e,o,n),t.memoizedState=rl,qc(e.child,r)):(zo(t),n=e.child,e=n.sibling,n=Wi(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 sl(e,t){return t=cl({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function cl(e,t){return e=Hi(22,e,null,t),e.lanes=0,e}function ll(e,t,n){return bo(t,e.child,null,n),e=sl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ul(e,t,n,r,i,a,s,c){if(n)return t.flags&256?(zo(t),t.flags&=-257,ll(e,t,c)):t.memoizedState===null?(Ho(),a=i.fallback,s=t.mode,i=cl({mode:`visible`,children:i.children},s),a=qi(a,s,c,null),a.flags|=2,i.return=t,a.return=t,i.sibling=a,t.child=i,bo(t,e.child,null,c),i=t.child,i.memoizedState=il(c),i.childLanes=al(e,r,c),t.memoizedState=rl,qc(null,i)):(Ho(),t.child=e.child,t.flags|=128,null);if(zo(t),lm(a)){if(r=a.nextSibling&&a.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(i=Error(o(419)),i.stack=``,i.digest=r,Ca({value:i,source:null,stack:null})),ll(e,t,c)}if(Vc||ja(e,t,c,!1),r=(c&e.childLanes)!==0,Vc||r){if(Mo.current!==null)return ll(e,t,c);if(r=ud,r!==null&&(i=kt(r,c),i!==0&&i!==s.retryLane))throw s.retryLane=i,Li(e,i),Kd(r,e,i),Bc;return cm(a)||af(),ll(e,t,c)}return cm(a)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,pa=dm(a.nextSibling),fa=t,j=!0,ma=null,ha=!1,e!==null&&da(t,e),t=sl(t,i.children),t.flags|=134221824,t)}function dl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ka(e.return,t,n)}function fl(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&qo(n)===null&&(t=e),e=e.sibling}return t}function pl(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 ml(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 hl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Wo.current;if(t.flags&128)return Go(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Go(t,o),i===`backwards`&&e!==null?(ml(e),Hc(e,t,r,n),ml(e)):Hc(e,t,r,n),r=j?na:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&dl(e,n,t);else if(e.tag===19)dl(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=fl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,ml(t)),pl(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&&qo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}pl(t,!0,n,null,a,r);break;case`together`:pl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=fl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),pl(t,!1,i,n,a,r)}return t.child}function gl(e,t,n){var r=t.pendingProps;return Da(t,t.type,r.value),Hc(e,t,r.children,n),t.child}function _l(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),vd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ja(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,n=Wi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Wi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function vl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Ma(e)))}function yl(e,t,n){switch(t.tag){case 3:Le(t,t.stateNode.containerInfo),Da(t,Ba,e.memoizedState.cache),xa();break;case 27:case 5:ze(t);break;case 4:Le(t,t.stateNode.containerInfo);break;case 10:Da(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Bo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return zo(t),t.flags|=128,null;r=ja(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?ol(e,t,n):(zo(t),e=_l(e,t,n),e===null?null:e.sibling)}zo(t);break;case 19:if(t.flags&128)return hl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(ja(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return hl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Go(t,Wo.current),r)break;return null;case 22:return t.lanes=0,Kc(e,t,n,t.pendingProps);case 24:Da(t,Ba,e.memoizedState.cache)}return _l(e,t,n)}function bl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Vc=!0;else{if(!vl(e,n)&&!(t.flags&128))return Vc=!1,yl(e,t,n);Vc=!!(e.flags&131072)}}else Vc=!1,j&&t.flags&1048576&&la(t,na,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=lo(t.elementType),t.type=e,typeof e==`function`)Ui(e)?(r=Ac(e,r),t.tag=1,t=tl(null,t,e,r,n)):(t.tag=0,t=$c(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===fe){t.tag=11,t=Uc(null,t,e,r,n);break a}if(i===he){t.tag=14,t=Wc(null,t,e,r,n);break a}if(i===de){t.tag=10,t.type=e,t=gl(null,t,n);break a}}throw t=Te(e)||e,Error(o(306,t,``))}}return t;case 0:return $c(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=Ac(r,t.pendingProps),tl(e,t,r,i,n);case 3:a:{if(Le(t,t.stateNode.containerInfo),e===null)throw Error(o(387));r=t.pendingProps;var a=t.memoizedState;i=a.element,N(e,t),Ao(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Da(t,Ba,r),r!==a.cache&&Aa(t,[Ba],n,!0),ko(),r=s.element,a.isDehydrated){if(a={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=nl(e,t,r,n);break a}if(r!==i){i=Qi(Error(o(424)),t),Ca(i),t=nl(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(pa=dm(e.firstChild),fa=t,j=!0,ma=null,ha=!0,n=xo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(xa(),r===i){t=_l(e,t,n);break a}Hc(e,t,r,n)}t=t.child}return t;case 26:return Qc(e,t),e===null?(n=Fm(t.type,null,t.pendingProps,null))?t.memoizedState=n:j||(t.stateNode=Tp(t.type,t.pendingProps,Fe.current,t)):t.memoizedState=Fm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ze(t),e===null&&j&&(r=t.stateNode=_m(t.type,t.pendingProps,Fe.current),fa=t,ha=!0,i=pa,V(t.type)?(fm=i,pa=dm(r.firstChild)):pa=i),Hc(e,t,t.pendingProps.children,n),Qc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&j&&((i=r=pa)&&(r=Z(r,t.type,t.pendingProps,ha),r===null?i=!1:(t.stateNode=r,fa=t,pa=dm(r.firstChild),ha=!1,i=!0)),i||_a(t)),ze(t),i=t.type,a=t.pendingProps,s=e===null?null:e.memoizedProps,r=a.children,Ep(i,a)?r=null:s!==null&&Ep(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=os(e,t,ls,null,null,n),lh._currentValue=i),Qc(e,t),Hc(e,t,r,n),t.child;case 6:return e===null&&j&&((e=n=pa)&&(n=om(n,t.pendingProps,ha),n===null?e=!1:(t.stateNode=n,fa=t,pa=null,e=!0)),e||_a(t)),null;case 13:return ol(e,t,n);case 4:return Le(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=bo(t,null,r,n):Hc(e,t,r,n),t.child;case 11:return Uc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Qc(e,t),Hc(e,t,r,n),t.child;case 8:return Hc(e,t,t.pendingProps.children,n),t.child;case 12:return Hc(e,t,t.pendingProps.children,n),t.child;case 10:return gl(e,t,n);case 9:return i=t.type._context,r=t.pendingProps.children,Na(t),i=Pa(i),r=r(i),t.flags|=1,Hc(e,t,r,n),t.child;case 14:return Wc(e,t,t.type,t.pendingProps,n);case 15:return Gc(e,t,t.type,t.pendingProps,n);case 19:return hl(e,t,n);case 31:return Zc(e,t,n);case 22:return Kc(e,t,n,t.pendingProps);case 24:return Na(t),r=Pa(Ba),e===null?(i=eo(),i===null&&(i=ud,a=Va(),i.pooledCache=a,a.refCount++,a!==null&&(i.pooledCacheLanes|=n),i=a),t.memoizedState={parent:r,cache:i},Co(t),Da(t,Ba,i)):((e.lanes&n)!==0&&(N(e,t),Ao(t,null,null,n),ko()),i=e.memoizedState,a=t.memoizedState,i.parent===r?(r=a.cache,Da(t,Ba,r),r!==i.cache&&Aa(t,[Ba],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Da(t,Ba,r))),Hc(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:j&&ua(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Qc(e,t),Hc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function xl(e){e.flags|=4}function Sl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Xm(t,r):Xm(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(tf())e.flags|=8192;else throw uo=oo,io}}else e.flags&=-16777217}function Cl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Zm(t)){if(tf())e.flags|=8192;else throw uo=oo,io}}function wl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ct(),e.lanes|=t,Sd|=t)}function Tl(e,t){if(!j)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 El(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 Dl(e,t,n){var r=t.pendingProps;switch(A(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return El(t),null;case 1:return El(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Oa(Ba),Re(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ba(t)?xl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Sa())),El(t),null;case 26:var i=t.type,a=t.memoizedState;return e===null?(xl(t),a===null?(El(t),Sl(t,i,null,r,n)):(El(t),Cl(t,a))):a?a===e.memoizedState?(El(t),t.flags&=-16777217):(xl(t),El(t),Cl(t,a)):(e=e.memoizedProps,e!==r&&xl(t),El(t),Sl(t,i,e,r,n)),null;case 27:if(Be(t),n=Fe.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&xl(t);else{if(!r){if(t.stateNode===null)throw Error(o(166));return El(t),t.subtreeFlags&=-33554433,null}e=Ne.current,ba(t)?va(t,e):(e=_m(i,r,n),t.stateNode=e,xl(t))}return El(t),t.subtreeFlags&=-33554433,null;case 5:if(Be(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&xl(t);else{if(!r){if(t.stateNode===null)throw Error(o(166));return El(t),t.subtreeFlags&=-33554433,null}if(a=Ne.current,ba(t))va(t,a);else{var s=Sp(Fe.current);switch(a){case 1:a=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:a=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:a=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:a=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:a=s.createElement(`div`),a.innerHTML=`<script><\/script>`,a=a.removeChild(a.firstChild);break;case`select`:a=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?a.multiple=!0:r.size&&(a.size=r.size);break;default:a=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}a[Ft]=t,a[It]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)a.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=a;a:switch(hp(a,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&xl(t)}}return El(t),t.subtreeFlags&=-33554433,Sl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&xl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(o(166));if(e=Fe.current,ba(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=fa,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[Ft]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||fp(e.nodeValue,n)),e||_a(t,!0)}else e=Sp(e).createTextNode(r),e[Ft]=t,t.stateNode=e}return El(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ba(t),n!==null){if(e===null){if(!r)throw Error(o(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(557));e[Ft]=t}else xa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;El(t),e=!1}else n=Sa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Uo(t),t):(Uo(t),null);if(t.flags&128)throw Error(o(558))}return El(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=ba(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(o(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(o(317));i[Ft]=t}else xa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;El(t),i=!1}else i=Sa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Uo(t),t):(Uo(t),null)}return Uo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),wl(t,t.updateQueue),El(t),null);case 4:return Re(),e===null&&rp(t.stateNode.containerInfo),t.flags|=67108864,El(t),null;case 10:return Oa(t.type),El(t),null;case 19:if(Ko(t),r=t.memoizedState,r===null)return El(t),null;if(i=!!(t.flags&128),a=r.rendering,a===null){if(i)Tl(r,!1);else{if(_d!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=qo(e),a!==null){for(t.flags|=128,Tl(r,!1),e=a.updateQueue,t.updateQueue=e,wl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Gi(n,e),n=n.sibling;return Go(t,Wo.current&1|2),j&&ca(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&$e()>Od&&(t.flags|=128,i=!0,Tl(r,!1),t.lanes=4194304)}}else{if(!i){if(e=qo(a),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,wl(t,e),Tl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!a.alternate&&!j)return El(t),null}else 2*$e()-r.renderingStartTime>Od&&n!==536870912&&(t.flags|=128,i=!0,Tl(r,!1),t.lanes=4194304)}r.isBackwards?(a.sibling=t.child,t.child=a):(e=r.last,e===null?t.child=a:e.sibling=a,r.last=a)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=$e(),e.sibling=null,a=Wo.current,a=i?a&1|2:a&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||j?Go(t,a):(n=a,Me(Lo,t),Me(Wo,n),Ro===null&&(Ro=t)),j&&ca(t,r.treeForkCount),e}return El(t),null;case 22:case 23:return Uo(t),Io(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(El(t),t.subtreeFlags&6&&(t.flags|=8192)):El(t),n=t.updateQueue,n!==null&&wl(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&&je($a),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Oa(Ba),El(t),null;case 25:return null;case 30:return t.flags|=33554432,El(t),null}throw Error(o(156,t.tag))}function Ol(e,t){switch(A(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Oa(Ba),Re(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Be(t),null;case 31:if(t.memoizedState!==null){if(Uo(t),t.alternate===null)throw Error(o(340));xa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Uo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));xa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ko(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 Re(),null;case 10:return Oa(t.type),null;case 22:case 23:return Uo(t),Io(),e!==null&&je($a),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Oa(Ba),null;case 25:return null;default:return null}}function kl(e,t){switch(A(t),t.tag){case 3:Oa(Ba),Re();break;case 26:case 27:case 5:Be(t);break;case 4:Re();break;case 31:t.memoizedState!==null&&Uo(t);break;case 13:Uo(t);break;case 19:Ko(t);break;case 10:Oa(t.type);break;case 22:case 23:Uo(t),Io(),e!==null&&je($a);break;case 24:Oa(Ba)}}function Al(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){Ef(t,t.return,e)}}function jl(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){Ef(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Ef(t,t.return,e)}}function Ml(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{P(t,n)}catch(t){Ef(e,e.return,t)}}}function Nl(e,t,n){n.props=Ac(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ef(e,t,n)}}function Pl(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=Di(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=U(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Gp(e);h(e.child,!1,nm,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){Ef(e,t,n)}}function Fl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Ef(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){Ef(e,t,n)}else n.current=null}}function Il(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++)rm(e.stateNode,t[n])}function Ll(e){for(var t=e.return;t!==null&&(Bl(t)&&rm(e.stateNode,t.stateNode),!zl(t));)t=t.return}function Rl(e){for(var t=e.return;t!==null&&(Bl(t)&&im(e.stateNode,t.stateNode),!zl(t));)t=t.return}function zl(e){return e.tag===5||e.tag===3||e.tag===27}function Bl(e){return e&&e.tag===7&&e.stateNode!==null}function Vl(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){Ef(e,e.return,t)}}function Hl(e,t,n){try{var r=e.stateNode;_p(r,e.type,n,t),r[It]=t}catch(t){Ef(e,e.return,t)}}function Ul(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&V(e.type)||e.tag===4}function Wl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ul(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&&V(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 Gl(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=An)),Il(e,r),D=!0;else if(i!==4&&(i===27&&(Il(e,r),r=null,V(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Gl(e,t,n,r),e=e.sibling;e!==null;)Gl(e,t,n,r),e=e.sibling}function Kl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Il(e,r),D=!0;else if(i!==4&&(i===27&&(Il(e,r),r=null,V(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Kl(e,t,n,r),e=e.sibling;e!==null;)Kl(e,t,n,r),e=e.sibling}function ql(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);hp(t,r,n),t[Ft]=e,t[It]=n}catch(t){Ef(e,e.return,t)}}var Jl=!1,Yl=null;function Xl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Jl=!0)}var Zl=null;function Ql(){var e=Zl;return Zl=null,e}var $l=0;function eu(e,t,n,r,i){return $l=0,tu(e.child,t,n,r,i)}function tu(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=zp(o);r.push(s),s.view&&(a=!0)}else a||zp(o).view&&(a=!0);Jl=!0,Lp(o,$l===0?t:t+`_`+$l,n),$l++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||tu(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function nu(e,t){for(;e!==null;)e.tag===5?H(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||nu(e.child,t)),e=e.sibling}function ru(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(ru(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(o(544));var n=t.name;t=ki(t.default,t.share),t!==`none`&&(eu(e,n,t,null,!1)||nu(e.child,!1))}e=e.sibling}}function iu(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=Di(r,n),a=ki(r.default,n.paired?r.share:r.enter);a===`none`?ru(e):eu(e,i,a,null,!1)?(ru(e),n.paired||t||Gd(e,r.onEnter)):nu(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)iu(e,t),e=e.sibling;else ru(e)}function au(e){if(Yl!==null&&Yl.size!==0){var t=Yl;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=ki(n.default,n.share);if(a!==`none`&&(eu(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Gd(e,n.onShare)):nu(e.child,!1)),t.delete(r),t.size===0)break}}}au(e)}e=e.sibling}}}function ou(e){if(e.tag===30){var t=e.memoizedProps,n=Di(t,e.stateNode),r=Yl===null?void 0:Yl.get(n),i=ki(t.default,r===void 0?t.exit:t.share);i!==`none`&&(eu(e,n,i,null,!1)?r===void 0?Gd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Yl.delete(n),Gd(e,t.onShare)):nu(e.child,!1)),Yl!==null&&au(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ou(e),e=e.sibling;else Yl!==null&&au(e)}function su(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=Di(t,e.stateNode);t=ki(t.default,t.update),e.flags&=-5,t!==`none`&&eu(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&su(e);e=e.sibling}}function cu(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,nu(e.child,!1))}cu(e)}e=e.sibling}}function lu(e){if(e.tag===30)e.stateNode.paired=null,nu(e.child,!1),cu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)lu(e),e=e.sibling;else cu(e)}function uu(e){for(e=e.child;e!==null;)e.tag===30?nu(e.child,!1):e.subtreeFlags&33554432&&uu(e),e=e.sibling}function du(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&$l<a.length){var l=a[$l],u=zp(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&&Lp(c,$l===0?n:n+`_`+$l,i),s&&e.flags&4||(Zl===null&&(Zl=[]),Zl.push(c,$l===0?r:r+`_`+$l,t.memoizedProps)),$l++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:du(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function fu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=Di(n,r),a=ki(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Bp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;$l=0,i=du(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Gd(e,n.onUpdate))}else e.subtreeFlags&33554432&&fu(e,t);e=e.sibling}}var pu=!1,mu=!1,hu=!1,gu=!1,_u=typeof WeakSet==`function`?WeakSet:Set,vu=null,yu=!1,bu=!1,xu=!1,Su=!1;function Cu(e,t,n){if(e=e.containerInfo,bp=vh,e=ri(e),ii(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(xp={focusedElem:e,selectionRange:r},vh=!1,n=(n&335544064)===n,vu=t,t=n?9270:1024;vu!==null;){if(e=vu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&ou(r[a]);if(e.alternate===null&&e.flags&2)n&&Xl(e),wu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&ou(r),wu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Xl(e),wu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,vu=r):(n&&su(e),wu(n))}}Yl=null}function wu(e){for(;vu!==null;){var t=vu,n=e,r=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(i&1024&&r!==null){n=void 0,i=r.memoizedProps,r=r.memoizedState;var a=t.stateNode;try{var s=Ac(t.type,i);n=a.getSnapshotBeforeUpdate(s,r),a.__reactInternalSnapshotBeforeUpdate=n}catch(e){Ef(t,t.return,e)}}break;case 3:if(i&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)am(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:am(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=Di(r.memoizedProps,r.stateNode),i=t.memoizedProps,i=ki(i.default,i.update),i!==`none`&&eu(r,n,i,r.memoizedState=[],!0));break;default:if(i&1024)throw Error(o(163))}if(r=t.sibling,r!==null){r.return=t.return,vu=r;break}vu=t.return}}function Tu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Gu(e,n),r&4&&Al(5,n);break;case 1:if(Gu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Ef(n,n.return,e)}else{var i=Ac(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ef(n,n.return,e)}}}r&64&&Ml(n),r&512&&Pl(n,n.return);break;case 3:if(Gu(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{P(e,t)}catch(e){Ef(n,n.return,e)}}break;case 27:t===null&&r&4&&ql(n);case 26:case 5:Gu(e,n),t===null&&r&4&&Vl(n),r&512&&Pl(n,n.return);break;case 12:Gu(e,n);break;case 31:Gu(e,n),r&4&&Pu(e,n);break;case 13:Gu(e,n),r&4&&Fu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Af.bind(null,n),um(e,n))));break;case 22:if(r=n.memoizedState!==null||pu,!r){var a=t!==null&&t.memoizedState!==null||mu;t=pu,i=mu,pu=r,(mu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),qu(e,n,r)):Gu(e,n),pu=t,mu=i}break;case 30:Gu(e,n),r&512&&Pl(n,n.return);break;case 7:r&512&&Pl(n,n.return);default:Gu(e,n)}}function Eu(e,t){for(e=e.child;e!==null;)Du(e,t),e=e.sibling}function Du(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){Ef(e,e.return,t)}Ou(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,D=!0}catch(t){Ef(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Ip(s,!0):Ip(e.stateNode,!1)}catch(t){Ef(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&Eu(e,t);break;default:Eu(e,t)}}function Ou(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:Du(n,r);break a;case 22:n.memoizedState===null&&Ou(n,r);break a;default:Ou(n,r)}}e=e.sibling}}function ku(e){var t=e.alternate;t!==null&&(e.alternate=null,ku(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Wt(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 Au=null,ju=!1;function Mu(e,t,n){for(n=n.child;n!==null;)Nu(e,t,n),n=n.sibling}function Nu(e,t,n){if(lt&&typeof lt.onCommitFiberUnmount==`function`)try{lt.onCommitFiberUnmount(ct,n)}catch{}switch(n.tag){case 26:mu||Fl(n,t),Mu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!mu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:mu||Fl(n,t),Rl(n);var r=Au,i=ju;V(n.type)&&(Au=n.stateNode,ju=!1),Mu(e,t,n),vm(n.stateNode,n.type,n.memoizedProps),Au=r,ju=i;break;case 5:mu||Fl(n,t),Rl(n);case 6:if(n.tag===6&&Rl(n),r=Au,i=ju,Au=null,Mu(e,t,n),Au=r,ju=i,Au!==null){if(ju)try{(Au.nodeType===9?Au.body:Au.nodeName===`HTML`?Au.ownerDocument.body:Au).removeChild(n.stateNode),D=!0}catch(e){Ef(n,t,e)}else try{Au.removeChild(n.stateNode),D=!0}catch(e){Ef(n,t,e)}}break;case 18:Au!==null&&(ju?(e=Au,Fp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Wh(e)):Fp(Au,n.stateNode));break;case 4:r=Au,i=ju,Au=n.stateNode.containerInfo,ju=!0,Mu(e,t,n),Au=r,ju=i;break;case 0:case 11:case 14:case 15:jl(2,n,t),mu||jl(4,n,t),Mu(e,t,n);break;case 1:mu||(Fl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Nl(n,t,r)),Mu(e,t,n);break;case 21:Mu(e,t,n);break;case 22:mu=(r=mu)||n.memoizedState!==null,Mu(e,t,n),mu=r;break;case 30:Fl(n,t),Mu(e,t,n);break;case 7:mu||Fl(n,t),Mu(e,t,n);break;default:Mu(e,t,n)}}function Pu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Wh(e)}catch(e){Ef(t,t.return,e)}}}function Fu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Wh(e)}catch(e){Ef(t,t.return,e)}}function Iu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new _u),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new _u),t;default:throw Error(o(435,e.tag))}}function Lu(e,t){var n=Iu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=jf.bind(null,e,t);t.then(r,r)}})}function Ru(e,t,n){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var a=r[i],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(V(l.type)){Au=l.stateNode,ju=!1;break a}break;case 5:Au=l.stateNode,ju=!1;break a;case 3:case 4:Au=l.stateNode.containerInfo,ju=!0;break a}l=l.return}if(Au===null)throw Error(o(160));Nu(s,c,a),Au=null,ju=!1,s=a.alternate,s!==null&&(s.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Bu(t,e,n),t=t.sibling}var zu=null;function Bu(e,t,n){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(i&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var a=0;a<r.length;a++){var s=r[a];s.ref.impl=s.nextImpl}Ru(t,e,n),Vu(e),i&4&&(jl(3,e,e.return),Al(3,e),jl(5,e,e.return));break;case 1:Ru(t,e,n),Vu(e),i&512&&(mu||r===null||Fl(r,r.return)),i&64&&pu&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(a=zu,Ru(t,e,n),Vu(e),i&512&&(mu||r===null||Fl(r,r.return)),i&4){if(i=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(pu)e.stateNode=Tp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,i=a.ownerDocument||a;b:switch(t){case`title`:r=i.getElementsByTagName(`title`)[0],(!r||r[Ht]||r[Ft]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=i.createElement(t),i.head.insertBefore(r,i.querySelector(`head > title`))),hp(r,t,n),r[Ft]=e,Yt(r),t=r;break a;case`link`:if(a=qm(`link`,`href`,i).get(t+(n.href||``))){for(s=0;s<a.length;s++)if(r=a[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){a.splice(s,1);break b}}r=i.createElement(t),hp(r,t,n),i.head.appendChild(r);break;case`meta`:if(a=qm(`meta`,`content`,i).get(t+(n.content||``))){for(s=0;s<a.length;s++)if(r=a[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){a.splice(s,1);break b}}r=i.createElement(t),hp(r,t,n),i.head.appendChild(r);break;default:throw Error(o(468,t))}r[Ft]=e,Yt(r),t=r}e.stateNode=t}}else pu||Jm(a,e.type,e.stateNode)}else e.stateNode=Hm(a,n,e.memoizedProps)}else i===n?n===null&&e.stateNode!==null&&Hl(e,e.memoizedProps,r.memoizedProps):(i===null?(t=r.stateNode,t===null||mu||t.parentNode.removeChild(t)):i.count--,n===null?pu||Jm(a,e.type,e.stateNode):Hm(a,n,e.memoizedProps))}break;case 27:Ru(t,e,n),Vu(e),i&512&&(mu||r===null||Fl(r,r.return)),r!==null&&i&4&&Hl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(a=hu,hu=!1,Ru(t,e,n),hu=a,Vu(e),i&512&&(mu||r===null||Fl(r,r.return)),e.flags&32){t=e.stateNode;try{Sn(t,``),D=!0}catch(t){Ef(e,e.return,t)}}i&4&&e.stateNode!=null&&(t=e.memoizedProps,Hl(e,t,r===null?t:r.memoizedProps)),i&1024&&(gu=!0);break;case 6:if(Ru(t,e,n),Vu(e),i&4){if(e.stateNode===null)throw Error(o(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,D=!0}catch(t){Ef(e,e.return,t)}}break;case 3:if(D=!1,Km=null,a=zu,zu=Sm(t.containerInfo),Ru(t,e,n),zu=a,Vu(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Wh(t.containerInfo)}catch(t){Ef(e,e.return,t)}gu&&(gu=!1,Hu(e)),D=!1;break;case 4:i=hu,hu=pu,r=an(),a=zu,zu=Sm(e.stateNode.containerInfo),Ru(t,e,n),Vu(e),zu=a,D&&bu&&(xu=!0),D=r,hu=i;break;case 12:Ru(t,e,n),Vu(e);break;case 31:Ru(t,e,n),Vu(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Lu(e,t)));break;case 13:Ru(t,e,n),Vu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(Ed=$e()),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Lu(e,t)));break;case 22:a=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=pu,l=mu,u=hu;pu=c||a,hu=u||a,mu=l||s,Ru(t,e,n),mu=l,hu=u,pu=c,Vu(e),i&8192&&(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,!a||r===null||s||pu||mu||(t=s||mu,n=pu,r=mu,pu=a||pu,mu=t,Ku(e,2),pu=n,mu=r),!a&&hu||Eu(e,a)),i&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Lu(e,n))));break;case 19:Ru(t,e,n),Vu(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Lu(e,t)));break;case 30:i&512&&(mu||r===null||Fl(r,r.return)),i=an(),a=bu,s=(n&335544064)===n,c=e.memoizedProps,bu=s&&ki(c.default,c.update)!==`none`,Ru(t,e,n),Vu(e),s&&r!==null&&D&&(e.flags|=4),bu=a,D=i;break;case 21:break;case 7:i&512&&(mu||r===null||Fl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Ru(t,e,n),Vu(e)}}function Vu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Ul(r)){n=r;break}r=r.return}r=null;for(var i=e.return;i!==null;){if(Bl(i)){var a=i.stateNode;r===null?r=[a]:r.push(a)}if(zl(i))break;i=i.return}var s=r;if(n==null)throw Error(o(160));switch(n.tag){case 27:var c=n.stateNode;Kl(e,Wl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(Sn(l,``),n.flags&=-33),Kl(e,Wl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Gl(e,Wl(e),u,s);break;default:throw Error(o(161))}}catch(t){Ef(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Hu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Hu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,vh=!0,t.reset(),vh=!1),e=e.sibling}}function Uu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Wu(t,e),t=t.sibling;else fu(t,!1)}function Wu(e,t){var n=e.alternate;if(n===null)iu(e,!1);else switch(e.tag){case 3:if(Su=yu=!1,Ql(),Uu(t,e),!yu&&!xu){if(e=Zl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];H(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),Su=!0}Zl=null;break;case 5:Uu(t,e);break;case 4:r=yu,yu=!1,Uu(t,e),yu&&(xu=!0),yu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Uu(t,e):iu(e,!1));break;case 30:r=yu,i=Ql(),yu=!1,Uu(t,e),yu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=Di(a,o),o=Di(n.memoizedProps,o);var s=ki(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,$l=0,t=du(e,n,t,o,s,a,!0),$l!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Gd(e,e.memoizedProps.onUpdate),Zl=i):i!==null&&(i.push.apply(i,Zl),Zl=i),yu=e.flags&32?!0:r;break;default:Uu(t,e)}}function Gu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Tu(e,t.alternate,t),t=t.sibling}function Ku(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:jl(4,n,n.return),Ku(n,r);break;case 1:Fl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Nl(n,n.return,i),Ku(n,r);break;case 27:r&2&&vm(n.stateNode,n.type,n.memoizedProps);case 5:Fl(n,n.return),n.tag!==5&&n.tag!==27||Rl(n),Ku(n,r);break;case 6:Rl(n);break;case 26:Fl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||mu||i.parentNode.removeChild(i),Ku(n,r);break;case 22:n.memoizedState===null&&Ku(n,r);break;case 30:Fl(n,n.return),Ku(n,r);break;case 7:Fl(n,n.return);default:Ku(n,r)}e=e.sibling}}function qu(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:qu(i,a,n),Al(4,a);break;case 1:if(qu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Ef(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++)jo(l[i],c)}catch(e){Ef(r,r.return,e)}}s&&o&64&&Ml(a),Pl(a,a.return);break;case 27:n&2&&ql(a);case 5:a.tag!==5&&a.tag!==27||Ll(a),qu(i,a,n),s&&r===null&&o&4&&Vl(a),Pl(a,a.return);break;case 6:Ll(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||pu||Jm(Sm(c.ownerDocument),a.type,c),qu(i,a,n),s&&r===null&&o&4&&Vl(a),Pl(a,a.return);break;case 12:qu(i,a,n);break;case 31:qu(i,a,n),s&&o&4&&Pu(i,a);break;case 13:qu(i,a,n),s&&o&4&&Fu(i,a);break;case 22:a.memoizedState===null&&qu(i,a,n),Pl(a,a.return);break;case 30:qu(i,a,n),Pl(a,a.return);break;case 7:Pl(a,a.return);default:qu(i,a,n)}t=t.sibling}}function Ju(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&&Ha(n))}function Yu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ha(e))}function Xu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Zu(e,t,n,r),t=t.sibling;else i&&uu(t)}function Zu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&lu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Xu(e,t,n,r),a&2048&&Al(9,t);break;case 1:Xu(e,t,n,r);break;case 3:Xu(e,t,n,r),i&&Su&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Ha(a)));break;case 12:if(a&2048){Xu(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){Ef(t,t.return,e)}}else Xu(e,t,n,r);break;case 31:Xu(e,t,n,r);break;case 13:Xu(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&&lu(t),o._visibility&2?Xu(e,t,n,r):(o._visibility|=2,Qu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&lu(s),o._visibility&2?Xu(e,t,n,r):$u(e,t)),a&2048&&Ju(s,t);break;case 24:Xu(e,t,n,r),a&2048&&Yu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(nu(a.child,!0),nu(t.child,!0))),Xu(e,t,n,r);break;default:Xu(e,t,n,r)}}function Qu(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:Qu(a,o,s,c,i),Al(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Qu(a,o,s,c,i)):u._visibility&2?Qu(a,o,s,c,i):$u(a,o),i&&l&2048&&Ju(o.alternate,o);break;case 24:Qu(a,o,s,c,i),i&&l&2048&&Yu(o.alternate,o);break;default:Qu(a,o,s,c,i)}t=t.sibling}}function $u(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:$u(n,r),i&2048&&Ju(r.alternate,r);break;case 24:$u(n,r),i&2048&&Yu(r.alternate,r);break;default:$u(n,r)}t=t.sibling}}var ed=8192;function td(e,t,n){if(e.subtreeFlags&ed)for(e=e.child;e!==null;)nd(e,t,n),e=e.sibling}function nd(e,t,n){switch(e.tag){case 26:td(e,t,n),e.flags&ed&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&$m(n,e)):eh(n,zu,e.memoizedState,e.memoizedProps));break;case 5:td(e,t,n),e.flags&ed&&(e=e.stateNode,(t&335544128)===t&&$m(n,e));break;case 3:case 4:var r=zu;zu=Sm(e.stateNode.containerInfo),td(e,t,n),zu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=ed,ed=16777216,td(e,t,n),ed=r):td(e,t,n));break;case 30:if((e.flags&ed)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Yl===null&&(Yl=new Map),Yl.set(r,i)}td(e,t,n);break;default:td(e,t,n)}}function rd(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 id(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];vu=r,sd(r,e)}rd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ad(e),e=e.sibling}function ad(e){switch(e.tag){case 0:case 11:case 15:id(e),e.flags&2048&&jl(9,e,e.return);break;case 3:id(e);break;case 12:id(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,od(e)):id(e);break;default:id(e)}}function od(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];vu=r,sd(r,e)}rd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:jl(8,t,t.return),od(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,od(t));break;default:od(t)}e=e.sibling}}function sd(e,t){for(;vu!==null;){var n=vu;switch(n.tag){case 0:case 11:case 15:jl(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:Ha(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,vu=r;else a:for(n=e;vu!==null;){r=vu;var i=r.sibling,a=r.return;if(ku(r),r===n){vu=null;break a}if(i!==null){i.return=a,vu=i;break a}vu=a}}}var cd={getCacheForType:function(e){var t=Pa(Ba),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Pa(Ba).controller.signal}},ld=typeof WeakMap==`function`?WeakMap:Map,I=0,ud=null,L=null,R=0,dd=0,fd=null,pd=!1,md=!1,hd=!1,gd=0,_d=0,vd=0,yd=0,bd=0,xd=0,Sd=0,Cd=null,wd=null,Td=!1,Ed=0,Dd=0,Od=1/0,kd=null,Ad=null,jd=0,Md=null,Nd=null,Pd=0,Fd=0,Id=null,Ld=null,Rd=null,zd=null,Bd=null,Vd=0,Hd=null;function Ud(){return I&2&&R!==0?R&-R:w.T===null?Mt():qf()}function Wd(){if(xd===0){if(!(R&536870912)||j){var e=gt;gt<<=1,!(gt&3932160)&&(gt=262144),xd=e}else xd=536870912}return e=Lo.current,e!==null&&(e.flags|=32),xd}function Gd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=U(Di(e.memoizedProps,n))),zd===null&&(zd=[]),zd.push(t.bind(null,r))}}function Kd(e,t,n){(e===ud&&(dd===2||dd===9)||e.cancelPendingCommit!==null)&&($d(e,0),Xd(e,R,xd,!1)),Tt(e,n),(!(I&2)||e!==ud)&&(e===ud&&(!(I&2)&&(yd|=n),_d===4&&Xd(e,R,xd,!1)),zf(e))}function qd(e,t,n){if(I&6)throw Error(o(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||bt(e,t),i=r?cf(e,t):of(e,t,!0),a=r;do{if(i===0){md&&!r&&Xd(e,t,0,!1);break}if(n=e.current.alternate,a&&!Yd(n)){i=of(e,t,!1),a=!1;continue}if(i===2){if(a=t,e.errorRecoveryDisabledLanes&a)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;i=Cd;var l=c.current.memoizedState.isDehydrated;if(l&&($d(c,s).flags|=256),s=of(c,s,!1),s!==2&&s!==6){if(hd&&!l){c.errorRecoveryDisabledLanes|=a,yd|=a,i=4;break a}a=wd,wd=i,a!==null&&(wd===null?wd=a:wd.push.apply(wd,a))}i=s}if(a=!1,i!==2)continue}}if(i===1){$d(e,0),Xd(e,t,0,!0);break}a:{switch(r=e,a=i,a){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Xd(r,t,xd,!pd);break a;case 2:wd=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(i=Ed+300-$e(),10<i)){if(Xd(r,t,xd,!pd),yt(r,0,!0)!==0)break a;Pd=t,r.timeoutHandle=kp(Jd.bind(null,r,n,wd,kd,Td,t,xd,yd,Sd,pd,a,`Throttled`,-0,0),i);break a}Jd(r,n,wd,kd,Td,t,xd,yd,Sd,pd,a,null,-0,0)}break}while(1);zf(e)}function Jd(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:An},Yl=null,nd(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=ih.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?Ed-$e():(a&4194048)===a?Dd-$e():0,m=nh(d,m),m!==null)){Pd=a,e.cancelPendingCommit=m(hf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Xd(e,a,o,!l);return}hf(e,t,a,n,r,i,o,s,c,l,u,d)}function Yd(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(!Zr(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 Xd(e,t,n,r){t=xt(e,t),t&=~bd,t&=~yd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-dt(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Dt(e,n,t)}function Zd(){return I&6?!0:(Bf(0,!1),!1)}function Qd(){if(L!==null){if(dd===0)var e=L.return;else e=L,Ea=Ta=null,fs(e),mo=null,ho=0,e=L;for(;e!==null;)kl(e.alternate,e),e=e.return;L=null}}function $d(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Ap(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Pd=0,Qd(),ud=e,L=n=Wi(e.current,null),R=t,dd=0,fd=null,pd=!1,md=bt(e,t),hd=!1,Sd=xd=bd=yd=vd=_d=0,wd=Cd=null,Td=!1,gd=xt(e,t),Pi(),n}function ef(e,t){F=null,w.H=Sc,t===ro||t===ao?(t=fo(),dd=3):t===io?(t=fo(),dd=4):dd=t===Bc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,fd=t,L===null&&(_d=1,Pc(e,Qi(t,e.current)))}function tf(){var e=Lo.current;return e===null?!0:(R&4194048)===R?Ro===null:(R&62914560)===R||R&536870912?e===Ro:!1}function nf(){var e=w.H;return w.H=Sc,e===null?Sc:e}function rf(){var e=w.A;return w.A=cd,e}function af(){_d=4,pd||(R&4194048)!==R&&Lo.current!==null||(md=!0),!(vd&134217727)&&!(yd&134217727)||ud===null||Xd(ud,R,xd,!1)}function of(e,t,n){var r=I;I|=2;var i=nf(),a=rf();(ud!==e||R!==t)&&(kd=null,$d(e,t)),t=!1;var o=_d;a:do try{if(dd!==0&&L!==null){var s=L,c=fd;switch(dd){case 8:Qd(),o=6;break a;case 3:case 2:case 9:case 6:Lo.current===null&&(t=!0);var l=dd;if(dd=0,fd=null,ff(e,s,c,l),n&&md){o=0;break a}break;default:l=dd,dd=0,fd=null,ff(e,s,c,l)}}sf(),o=_d;break}catch(t){ef(e,t)}while(1);return t&&e.shellSuspendCounter++,Ea=Ta=null,I=r,w.H=i,w.A=a,L===null&&(ud=null,R=0,Pi()),o}function sf(){for(;L!==null;)uf(L)}function cf(e,t){var n=I;I|=2;var r=nf(),i=rf();ud!==e||R!==t?(kd=null,Od=$e()+500,$d(e,t)):md=bt(e,t);a:do try{if(dd!==0&&L!==null){t=L;var a=fd;b:switch(dd){case 1:dd=0,fd=null,ff(e,t,a,1);break;case 2:case 9:if(so(a)){dd=0,fd=null,df(t);break}t=function(){dd!==2&&dd!==9||ud!==e||(dd=7),zf(e)},a.then(t,t);break a;case 3:dd=7;break a;case 4:dd=5;break a;case 7:so(a)?(dd=0,fd=null,df(t)):(dd=0,fd=null,ff(e,t,a,7));break;case 5:var s=null;switch(L.tag){case 26:s=L.memoizedState;case 5:case 27:var c=L;if(s?Zm(s):c.stateNode.complete){dd=0,fd=null;var l=c.sibling;if(l!==null)L=l;else{var u=c.return;u===null?L=null:(L=u,pf(u))}break b}}dd=0,fd=null,ff(e,t,a,5);break;case 6:dd=0,fd=null,ff(e,t,a,6);break;case 8:Qd(),_d=6;break a;default:throw Error(o(462))}}lf();break}catch(t){ef(e,t)}while(1);return Ea=Ta=null,w.H=r,w.A=i,I=n,L===null?(ud=null,R=0,Pi(),_d):0}function lf(){for(;L!==null&&!Ze();)uf(L)}function uf(e){var t=bl(e.alternate,e,gd);e.memoizedProps=e.pendingProps,t===null?pf(e):L=t}function df(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=el(n,t,t.pendingProps,t.type,void 0,R);break;case 11:t=el(n,t,t.pendingProps,t.type.render,t.ref,R);break;case 5:fs(t);var r=t;r===fa&&(j?(ya(r),r.tag===5&&r.stateNode!=null&&(pa=r.stateNode)):(ya(r),j=!0));default:kl(n,t),t=L=Gi(t,gd),t=bl(n,t,gd)}e.memoizedProps=e.pendingProps,t===null?pf(e):L=t}function ff(e,t,n,r){Ea=Ta=null,fs(t),mo=null,ho=0;var i=t.return;try{if(zc(e,i,t,n,R)){_d=1,Pc(e,Qi(n,e.current)),L=null;return}}catch(t){if(i!==null)throw L=i,t;_d=1,Pc(e,Qi(n,e.current)),L=null;return}t.flags&32768?(j||r===1?e=!0:md||R&536870912?e=!1:(pd=e=!0,(r===2||r===9||r===3||r===6)&&(r=Lo.current,r!==null&&r.tag===13&&(r.flags|=16384))),mf(t,e)):pf(t)}function pf(e){var t=e;do{if(t.flags&32768){mf(t,pd);return}e=t.return;var n=Dl(t.alternate,t,gd);if(n!==null){L=n;return}if(t=t.sibling,t!==null){L=t;return}L=t=e}while(t!==null);_d===0&&(_d=5)}function mf(e,t){do{var n=Ol(e.alternate,e);if(n!==null){n.flags&=32767,L=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){L=e;return}L=e=n}while(e!==null);_d=6,L=null}function hf(e,t,n,r,i,a,s,c,l,u,d,f){e.cancelPendingCommit=null;do Cf();while(jd!==0);if(I&6)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));e===ud&&(L=ud=null,R=0),Nd=t,Md=e,Pd=n,Id=i,Ld=r,gf(e,t,n,s,c,l,f)}}function gf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Fd=s,s|=Ni,Et(e,n,s,r,i,a),zd=null,(n&335544064)===n?(Bd=Wa(e),r=10262):(Bd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Mf(rt,function(){return wf(),null})):(e.callbackNode=null,e.callbackPriority=0),Jl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=w.T,w.T=null,i=T.p,T.p=2,a=I,I|=4;try{Cu(e,t,n)}finally{I=a,T.p=i,w.T=r}}jd=1,Jl?Rd=Up(o,e.containerInfo,Bd,yf,bf,vf,xf,wf,_f,null,null):(yf(),bf(),xf())}function _f(e){if(jd!==0){var t=Md.onRecoverableError;t(e,{componentStack:null})}}function vf(){jd===3&&(jd=0,Wu(Nd,Md),jd=4)}function yf(){if(jd===1){jd=0;var e=Md,t=Nd,n=Pd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=w.T,w.T=null;var i=T.p;T.p=2;var a=I;I|=4;try{bu=xu=!1,Bu(t,e,n),n=xp;var o=ri(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&ni(s.ownerDocument.documentElement,s)){if(c!==null&&ii(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 _=ti(s,h),v=ti(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}vh=!!bp,xp=bp=null}finally{I=a,T.p=i,w.T=r}}e.current=t,jd=2}}function bf(){if(jd===2){jd=0;var e=Md,t=Nd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=w.T,w.T=null;var r=T.p;T.p=2;var i=I;I|=4;try{Tu(e,t.alternate,t)}finally{I=i,T.p=r,w.T=n}}jd=3}}function xf(){if(jd===4||jd===3){jd=0;var e=Rd;Rd=null,Qe();var t=Md,n=Nd,r=Pd,i=Ld,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?jd=5:(jd=0,Nd=Md=null,Sf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Ad=null),jt(r),n=n.stateNode,lt&&typeof lt.onCommitFiberRoot==`function`)try{lt.onCommitFiberRoot(ct,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=w.T,a=T.p,T.p=2,w.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{w.T=n,T.p=a}}if(i=zd,o=Bd,Bd=null,i!==null&&(zd=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);Pd&3&&Cf(),zf(t),a=t.pendingLanes,r&261930&&a&42?t===Hd?Vd++:(Vd=0,Hd=t):(Vd=0,Hd=null),Bf(0,!1)}}function Sf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ha(t)))}function Cf(){return Rd!==null&&(Rd.skipTransition(),Rd=null),yf(),bf(),xf(),wf()}function wf(){if(jd!==5)return!1;var e=Md,t=Fd;Fd=0;var n=jt(Pd),r=w.T,i=T.p;try{T.p=32>n?32:n,w.T=null,n=Id,Id=null;var a=Md,s=Pd;if(jd=0,Nd=Md=null,Pd=0,I&6)throw Error(o(331));var c=I;if(I|=4,ad(a.current),Zu(a,a.current,s,n),I=c,Bf(0,!1),lt&&typeof lt.onPostCommitFiberRoot==`function`)try{lt.onPostCommitFiberRoot(ct,a)}catch{}return!0}finally{T.p=i,w.T=r,Sf(e,t)}}function Tf(e,t,n){t=Qi(n,t),t=Ic(e.stateNode,t,2),e=To(e,t,2),e!==null&&(Tt(e,2),zf(e))}function Ef(e,t,n){if(e.tag===3)Tf(e,e,n);else for(;t!==null;){if(t.tag===3){Tf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Ad===null||!Ad.has(r))){e=Qi(n,e),n=Lc(2),r=To(t,n,2),r!==null&&(Rc(n,r,t,e),Tt(r,2),zf(r));break}}t=t.return}}function Df(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new ld;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)||(hd=!0,i.add(n),e=Of.bind(null,e,t,n),t.then(e,e))}function Of(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ud===e&&(R&n)===n&&(_d===4||_d===3&&(R&62914560)===R&&300>$e()-Ed?I&2?bd|=n:$d(e,0):bd|=n,Sd===R&&(Sd=0)),zf(e)}function kf(e,t){t===0&&(t=Ct()),e=Li(e,t),e!==null&&(Tt(e,t),zf(e))}function Af(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),kf(e,n)}function jf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(o(314))}r!==null&&r.delete(t),kf(e,n)}function Mf(e,t){return Ye(e,t)}var Nf=null,Pf=null,Ff=!1,If=!1,Lf=!1,Rf=0;function zf(e){e!==Pf&&e.next===null&&(Pf===null?Nf=Pf=e:Pf=Pf.next=e),If=!0,Ff||(Ff=!0,Kf())}function Bf(e,t){if(!Lf&&If){Lf=!0;do for(var n=!1,r=Nf;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-dt(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Gf(r,a))}else a=R,a=yt(r,r===ud?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||bt(r,a)||(n=!0,Gf(r,a))}r=r.next}while(n);Lf=!1}}function Vf(){Hf()}function Hf(){If=Ff=!1;var e=0;Rf!==0&&Op()&&(e=Rf);for(var t=$e(),n=null,r=Nf;r!==null;){var i=r.next,a=Uf(r,t);a===0?(r.next=null,n===null?Nf=i:n.next=i,i===null&&(Pf=n)):(n=r,(e!==0||a&3)&&(If=!0)),r=i}jd!==0&&jd!==5||Bf(e,!1),Rf!==0&&(Rf=0)}function Uf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-dt(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=St(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=ud,n=R,n=yt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(dd===2||dd===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Xe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||bt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Xe(r),jt(n)){case 2:case 8:n=nt;break;case 32:n=rt;break;case 268435456:n=at;break;default:n=rt}return r=Wf.bind(null,e),n=Ye(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Xe(r),e.callbackPriority=2,e.callbackNode=null,2}function Wf(e,t){if(jd!==0&&jd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Cf()&&e.callbackNode!==n)return null;var r=R;return r=yt(e,e===ud?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(qd(e,r,t),Uf(e,$e()),e.callbackNode!=null&&e.callbackNode===n?Wf.bind(null,e):null)}function Gf(e,t){if(Cf())return null;qd(e,t,!0)}function Kf(){Np(function(){I&6?Ye(tt,Vf):Hf()})}function qf(){if(Rf===0){var e=qa;e===0&&(e=ht,ht<<=1,!(ht&261888)&&(ht=256)),Rf=e}return Rf}function Jf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:kn(e)}function Yf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Jf((i[It]||null).action),o=r.submitter;o&&(t=(t=o[It]||null)?Jf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Xn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Rf!==0){var e=new FormData(i,o);cc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),cc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Xf=0;Xf<wi.length;Xf++){var Zf=wi[Xf];Ti(Zf.toLowerCase(),`on`+(Zf[0].toUpperCase()+Zf.slice(1)))}Ti(gi,`onAnimationEnd`),Ti(_i,`onAnimationIteration`),Ti(vi,`onAnimationStart`),Ti(`dblclick`,`onDoubleClick`),Ti(`focusin`,`onFocus`),Ti(`focusout`,`onBlur`),Ti(yi,`onTransitionRun`),Ti(bi,`onTransitionStart`),Ti(xi,`onTransitionCancel`),Ti(Si,`onTransitionEnd`),E(`onMouseEnter`,[`mouseout`,`mouseover`]),E(`onMouseLeave`,[`mouseout`,`mouseover`]),E(`onPointerEnter`,[`pointerout`,`pointerover`]),E(`onPointerLeave`,[`pointerout`,`pointerover`]),$t(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),$t(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),$t(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),$t(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),$t(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),$t(`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(` `),$f=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Qf));function ep(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){Ai(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){Ai(e)}i.currentTarget=null,a=c}}}}function z(e,t){var n=t[Rt];n===void 0&&(n=t[Rt]=new Set);var r=e+`__bubble`;n.has(r)||(ip(t,e,2,!1),n.add(r))}function tp(e,t,n){var r=0;t&&(r|=4),ip(n,e,r,t)}var np=`_reactListening`+Math.random().toString(36).slice(2);function rp(e){if(!e[np]){e[np]=!0,Zt.forEach(function(t){t!==`selectionchange`&&($f.has(t)||tp(t,!1,e),tp(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[np]||(t[np]=!0,tp(`selectionchange`,!1,t))}}function ip(e,t,n,r){switch(Th(t)){case 2:var i=yh;break;case 8:i=bh;break;default:i=xh}n=i.bind(null,t,n,e),i=void 0,!Bn||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 ap(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;s!==null;){if(o=Gt(s),o===null)return;if(c=o.tag,c===5||c===6||c===26||c===27){r=a=o;continue a}s=s.parentNode}}r=r.return}Ln(function(){var r=a,i=Mn(n),o=[];a:{var s=Ci.get(e);if(s!==void 0){var c=Xn,u=e;switch(e){case`keypress`:if(Gn(n)===0)break a;case`keydown`:case`keyup`:c=mr;break;case`focusin`:u=`focus`,c=ar;break;case`focusout`:u=`blur`,c=ar;break;case`beforeblur`:case`afterblur`:c=ar;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:c=rr;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=ir;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=_r;break;case gi:case _i:case vi:c=or;break;case Si:c=vr;break;case`scroll`:case`scrollend`:c=Qn;break;case`wheel`:c=yr;break;case`copy`:case`cut`:case`paste`:c=sr;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=hr;break;case`submit`:c=gr;break;case`toggle`:case`beforetoggle`:c=br}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?s===null?null:s+`Capture`:s;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=Rn(m,p),g!=null&&d.push(op(m,g,h))),f)break;m=m.return}0<d.length&&(s=new c(s,u,null,n,i),o.push({event:s,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,s=e===`mouseout`||e===`pointerout`,c&&n!==jn&&(u=n.relatedTarget||n.fromElement)&&(Gt(u)||u[Lt]))break a;(s||c)&&(u=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,s?(c=n.relatedTarget||n.toElement,s=r,c=c?Gt(c):null,c!==null&&(f=l(c),d=c.tag,c!==f||d!==5&&d!==27&&d!==6)&&(c=null)):(s=null,c=r),s!==c&&(d=rr,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=hr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=s==null?u:qt(s),h=c==null?u:qt(c),u=new d(g,m+`leave`,s,n,i),u.target=f,u.relatedTarget=h,g=null,Gt(i)===r&&(d=new d(p,m+`enter`,c,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=s&&c?re(s,c,B):null,s!==null&&cp(o,u,s,d,!1),c!==null&&f!==null&&cp(o,f,c,d,!0)))}a:{if(s=r?qt(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var _=zr;else if(Nr(s)){if(Br)_=Yr;else{_=qr;var v=Kr}}else c=s.nodeName,!c||c.toLowerCase()!==`input`||s.type!==`checkbox`&&s.type!==`radio`?r&&En(r.elementType)&&(_=zr):_=Jr;if(_&&=_(e,r)){Pr(o,_,n,i);break a}v&&v(e,s,r)}switch(v=r?qt(r):window,e){case`focusin`:(Nr(v)||v.contentEditable===`true`)&&(oi=v,si=r,ci=null);break;case`focusout`:ci=si=oi=null;break;case`mousedown`:li=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:li=!1,ui(o,n,i);break;case`selectionchange`:if(ai)break;case`keydown`:case`keyup`:ui(o,n,i)}var y;if(Sr)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 Ar?Or(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(Tr&&n.locale!==`ko`&&(Ar||b!==`onCompositionStart`?b===`onCompositionEnd`&&Ar&&(y=Wn()):(Hn=i,O=`value`in Hn?Hn.value:Hn.textContent,Ar=!0)),v=sp(r,b),0<v.length&&(b=new cr(b,e,null,n,i),o.push({event:b,listeners:v}),y?b.data=y:(y=kr(n),y!==null&&(b.data=y)))),(y=wr?k(e,n):jr(e,n))&&(b=sp(r,`onBeforeInput`),0<b.length&&(v=new cr(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:v,listeners:b}),v.data=y)),Yf(o,e,r,n,i)}ep(o,t)})}function op(e,t,n){return{instance:e,listener:t,currentTarget:n}}function sp(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=Rn(e,n),i!=null&&r.unshift(op(e,i,a)),i=Rn(e,t),i!=null&&r.push(op(e,i,a))),e.tag===3)return r;e=e.return}return[]}function B(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function cp(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=Rn(n,a),l!=null&&o.unshift(op(n,l,c))):i||(l=Rn(n,a),l!=null&&o.push(op(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var lp=/\r\n?/g,up=/\u0000|\uFFFD/g;function dp(e){return(typeof e==`string`?e:``+e).replace(lp,`
|
|
16
|
+
`).replace(up,``)}function fp(e,t){return t=dp(t),dp(e)===t}function pp(e,t,n,r,i,a){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||Sn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&Sn(e,``+r);else return;break;case`className`:sn(e,`class`,r);break;case`tabIndex`:sn(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:sn(e,n,r);break;case`style`:Tn(e,r,a);return;case`data`:if(t!==`object`){sn(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=kn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof a==`function`&&(n===`formAction`?(t!==`input`&&pp(e,t,`name`,i.name,i,null),pp(e,t,`formEncType`,i.formEncType,i,null),pp(e,t,`formMethod`,i.formMethod,i,null),pp(e,t,`formTarget`,i.formTarget,i,null)):(pp(e,t,`encType`,i.encType,i,null),pp(e,t,`method`,i.method,i,null),pp(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=kn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=An);return;case`onScroll`:r!=null&&z(`scroll`,e);return;case`onScrollEnd`:r!=null&&z(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(o(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(o(60));a?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=kn(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`:z(`beforetoggle`,e),z(`toggle`,e),on(e,`popover`,r);break;case`xlinkActuate`:cn(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:cn(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:cn(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:cn(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:cn(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:cn(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:cn(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:cn(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:cn(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:on(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=Dn.get(n)||n,on(e,n,r);else return}D=!0}function mp(e,t,n,r,i,a){switch(n){case`style`:Tn(e,r,a);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(o(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(o(60));a?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)Sn(e,r);else if(typeof r==`number`||typeof r==`bigint`)Sn(e,``+r);else return;break;case`onScroll`:r!=null&&z(`scroll`,e);return;case`onScrollEnd`:r!=null&&z(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=An);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Qt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),a=n.slice(2,i?n.length-7:void 0),t=e[It]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(a,t,i),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(a,r,i);break a}D=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):on(e,n,r)}return}D=!0}function hp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:z(`error`,e),z(`load`,e);var r=!1,i=!1,a;for(a in n)if(n.hasOwnProperty(a)){var s=n[a];if(s!=null)switch(a){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(o(137,t));default:pp(e,t,a,s,n,null)}}i&&pp(e,t,`srcSet`,n.srcSet,n,null),r&&pp(e,t,`src`,n.src,n,null);return;case`input`:z(`invalid`,e);var c=a=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:a=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(o(137,t));break;default:pp(e,t,r,d,n,null)}}_n(e,a,c,l,u,s,i,!1);return;case`select`:for(i in z(`invalid`,e),r=s=a=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:a=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:pp(e,t,i,c,n,null)}t=a,n=s,e.multiple=!!r,t==null?n!=null&&yn(e,!!r,n,!0):yn(e,!!r,t,!1);return;case`textarea`:for(s in z(`invalid`,e),a=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:a=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(o(91));break;default:pp(e,t,s,c,n,null)}xn(e,r,i,a);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:pp(e,t,l,r,n,null)}return;case`dialog`:z(`beforetoggle`,e),z(`toggle`,e),z(`cancel`,e),z(`close`,e);break;case`iframe`:case`object`:z(`load`,e);break;case`video`:case`audio`:for(r=0;r<Qf.length;r++)z(Qf[r],e);break;case`image`:z(`error`,e),z(`load`,e);break;case`details`:z(`toggle`,e);break;case`embed`:case`source`:case`link`:z(`error`,e),z(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(o(137,t));default:pp(e,t,u,r,n,null)}return;default:if(En(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&mp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&pp(e,t,c,r,n,null))}var gp={};function _p(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,a=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||pp(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&&(D=!0),a=m;break;case`name`:m!==f&&(D=!0),i=m;break;case`checked`:m!==f&&(D=!0),u=m;break;case`defaultChecked`:m!==f&&(D=!0),d=m;break;case`value`:m!==f&&(D=!0),s=m;break;case`defaultValue`:m!==f&&(D=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(o(137,t));break;default:m!==f&&pp(e,t,p,m,r,f)}}gn(e,s,c,l,u,d,a,i);return;case`select`:for(a in m=s=c=p=null,n)if(l=n[a],n.hasOwnProperty(a)&&l!=null)switch(a){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(a)||pp(e,t,a,null,r,l)}for(i in r)if(a=r[i],l=n[i],r.hasOwnProperty(i)&&(a!=null||l!=null))switch(i){case`value`:a!==l&&(D=!0),p=a;break;case`defaultValue`:a!==l&&(D=!0),c=a;break;case`multiple`:a!==l&&(D=!0),s=a;default:a!==l&&pp(e,t,i,a,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?yn(e,!!n,n?[]:``,!1):yn(e,!!n,t,!0)):yn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:pp(e,t,c,null,r,i)}for(s in r)if(i=r[s],a=n[s],r.hasOwnProperty(s)&&(i!=null||a!=null))switch(s){case`value`:i!==a&&(D=!0),p=i;break;case`defaultValue`:i!==a&&(D=!0),m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(o(91));break;default:i!==a&&pp(e,t,s,i,r,a)}bn(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:pp(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&&(D=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:pp(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)&&pp(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(o(137,t));break;default:pp(e,t,u,p,r,m)}return;default:if(En(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&mp(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||mp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&pp(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||pp(e,t,f,p,r,m)}function vp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function yp(){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&&vp(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&&vp(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 bp=null,xp=null;function Sp(e){return e.nodeType===9?e:e.ownerDocument}function Cp(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 wp(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 Tp(e,t,n,r){return n=Sp(n).createElement(e),n[Ft]=r,n[It]=t,hp(n,e,t),Yt(n),n}function Ep(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 Dp=null;function Op(){var e=window.event;return e&&e.type===`popstate`?e!==Dp&&(Dp=e,!0):(Dp=null,!1)}var kp=typeof setTimeout==`function`?setTimeout:void 0,Ap=typeof clearTimeout==`function`?clearTimeout:void 0,jp=typeof Promise==`function`?Promise:void 0,Mp=typeof requestAnimationFrame==`function`?requestAnimationFrame:kp,Np=typeof queueMicrotask==`function`?queueMicrotask:jp===void 0?kp:function(e){return jp.resolve(null).then(e).catch(Pp)};function Pp(e){setTimeout(function(){throw e})}function V(e){return e===`head`}function Fp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Wh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)ym(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,ym(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Ht]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&ym(e.ownerDocument.body)}n=i}while(n);Wh(t)}function Ip(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 Lp(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 H(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 Rp(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 zp(e){return Rp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Bp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Rp(t,n,e)}function Vp(e){return e.documentElement.clientHeight}function Hp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Up(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`&&(Vp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=Qm(f),u>th){s.length=o;break}f=new Promise(Hp.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 Wp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Wp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:C({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Wp.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},Wp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function U(e){return{name:e,group:new Wp(`group`,e),imagePair:new Wp(`image-pair`,e),old:new Wp(`old`,e),new:new Wp(`new`,e)}}function Gp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Gp.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(G(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=W(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),h(this._fragmentFiber.child,!1,Kp,e,s,r)}this._eventListeners=a}};function Kp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Gp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=G(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=W(i.optionsOrUseCapture),h(this._fragmentFiber.child,!1,qp,e,n,i),r.splice(t,1),a!==null&&a()}};function qp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function W(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 G(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}Gp.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,W(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,W(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Gp.prototype.focus=function(e){h(this._fragmentFiber.child,!0,K,e,void 0,void 0)};function K(e,t){return e.tag!==6&&(e=b(e),hm(e,t))}Gp.prototype.focusLast=function(e){var t=[];h(this._fragmentFiber.child,!0,Yp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!K(t[n],e);n--);};function Yp(e,t){return t.push(e),!1}Gp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=Sp(e).activeElement,e!==null&&h(this._fragmentFiber.child,!1,q,e,void 0,void 0))};function q(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Gp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),h(this._fragmentFiber.child,!1,Xp,e,void 0,void 0)};function Xp(e,t){return e.tag!==6&&(e=b(e),t.observe(e),!1)}Gp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),h(this._fragmentFiber.child,!1,Zp,e,void 0,void 0);for(var n=t=0;n<Qp.length;n++){var r=Qp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Qp[t++]=r}Qp.length=t}};function Zp(e,t){return e.tag!==6&&(e=b(e),t.unobserve(e),!1)}var Qp=[],$p=!1;function em(e,t,n){Qp.push({fragmentInstance:e,observer:t,instance:n}),$p||($p=!0,gm(function(){$p=!1;var e=Qp;Qp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Gp.prototype.getClientRects=function(){var e=[];return h(this._fragmentFiber.child,!1,J,e,void 0,void 0),e};function J(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}Gp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Gp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];h(this._fragmentFiber.child,!1,Yp,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||tm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function tm(e,t,n,r,i){var a=Gt(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=re(n,a,S),t===null?t=!1:(h(t,!0,x,a,n),a=ee,ee=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=re(r,a,S),t===null?t=!1:(h(t,!0,ne,a,r),a=ee,te=ee=null,t=a!==null)),t):!1}function Y(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)}Gp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(o(566));var t=[];h(this._fragmentFiber.child,!1,Yp,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),Y(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var i=t[r];i.tag===6?(i=b(i),Y(i,n)):b(i).scrollIntoView(e),r+=n?-1:1}};function nm(e,t){return e=b(e),X(e,t),!1}function X(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function rm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,W(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Qp.length;i++){var a=Qp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Qp[r++]=a)}Qp.length=r,n.observe(e)}),X(e,t))}function im(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,W(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?em(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function am(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`:am(n),Wt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function Z(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[Ht])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=dm(e.nextSibling),e===null)break}return null}function om(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=dm(e.nextSibling),e===null))return null;return e}function sm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=dm(e.nextSibling),e===null))return null;return e}function cm(e){return e.data===`$?`||e.data===`$~`}function lm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function um(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function dm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var fm=null;function pm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return dm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function mm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function hm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function gm(e){Mp(function(){Mp(function(t){return e(t)})})}function _m(e,t,n){switch(t=Sp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(o(452));return e;case`head`:if(e=t.head,!e)throw Error(o(453));return e;case`body`:if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function vm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&pp(e,t,r,null,gp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===An&&(e.onclick=null),Wt(e)}function ym(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Wt(e)}var bm=new Map,xm=new Set;function Sm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Cm=T.d;T.d={f:wm,r:Tm,D:Om,C:km,L:Am,m:jm,X:Nm,S:Mm,M:Pm};function wm(){var e=Cm.f(),t=Zd();return e||t}function Tm(e){var t=Kt(e);t!==null&&t.tag===5&&t.type===`form`?uc(t):Cm.r(e)}var Em=typeof document>`u`?null:document;function Dm(e,t,n){var r=Em;if(r&&typeof t==`string`&&t){var i=hn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),xm.has(i)||(xm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),hp(t,`link`,e),Yt(t),r.head.appendChild(t)))}}function Om(e){Cm.D(e),Dm(`dns-prefetch`,e,null)}function km(e,t){Cm.C(e,t),Dm(`preconnect`,e,t)}function Am(e,t,n){Cm.L(e,t,n);var r=Em;if(r&&e&&t){var i=`link[rel="preload"][as="`+hn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+hn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+hn(n.imageSizes)+`"]`)):i+=`[href="`+hn(e)+`"]`;var a=i;switch(t){case`style`:a=Im(e);break;case`script`:a=Bm(e)}if(!(bm.has(a)||(e=C({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),bm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Lm(a))||t===`script`&&r.querySelector(Vm(a))))){var o=r.createElement(`link`);hp(o,`link`,e),t===`style`&&(o[Ut]=!0,o.onload=o.onerror=function(){Xt(o)}),Yt(o),r.head.appendChild(o)}}}function jm(e,t){Cm.m(e,t);var n=Em;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+hn(r)+`"][href="`+hn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Bm(e)}if(!bm.has(a)&&(e=C({rel:`modulepreload`,href:e},t),bm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Vm(a)))return}r=n.createElement(`link`),hp(r,`link`,e),Yt(r),n.head.appendChild(r)}}}function Mm(e,t,n){Cm.S(e,t,n);var r=Em;if(r&&e){var i=Jt(r).hoistableStyles,a=Im(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Lm(a)))s.loading=5;else{e=C({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=bm.get(a))&&Wm(e,n);var c=o=r.createElement(`link`);Yt(c),hp(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Um(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Nm(e,t){Cm.X(e,t);var n=Em;if(n&&e){var r=Jt(n).hoistableScripts,i=Bm(e),a=r.get(i);a||(a=n.querySelector(Vm(i)),a||(e=C({src:e,async:!0},t),(t=bm.get(i))&&Gm(e,t),a=n.createElement(`script`),Yt(a),hp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pm(e,t){Cm.M(e,t);var n=Em;if(n&&e){var r=Jt(n).hoistableScripts,i=Bm(e),a=r.get(i);a||(a=n.querySelector(Vm(i)),a||(e=C({src:e,async:!0,type:`module`},t),(t=bm.get(i))&&Gm(e,t),a=n.createElement(`script`),Yt(a),hp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Fm(e,t,n,r){var i=(i=Fe.current)?Sm(i):null;if(!i)throw Error(o(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Im(n.href),t=Jt(i).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Im(n.href);var a=Jt(i).hoistableStyles,s=a.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},a.set(e,s),(a=i.querySelector(Lm(e)))?a._p||(s.instance=a,s.state.loading=5):(a=bm.get(e),a||(a={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},bm.set(e,a)),zm(i,e,a,s.state))),t&&r===null)throw Error(o(528,``));return s}if(t&&r!==null)throw Error(o(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Bm(n),t=Jt(i).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Im(e){return`href="`+hn(e)+`"`}function Lm(e){return`link[rel="stylesheet"][`+e+`]`}function Rm(e){return C({},e,{"data-precedence":e.precedence,precedence:null})}function zm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Ut]){r.loading=1;return}}else t=e.createElement(`link`),t[Ut]=!0,t.onload=t.onerror=Xt.bind(null,t),hp(t,`link`,n),Yt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Bm(e){return`[src="`+hn(e)+`"]`}function Vm(e){return`script[async]`+e}function Hm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+hn(n.href)+`"]`);if(r)return t.instance=r,Yt(r),r;var i=C({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Yt(r),hp(r,`style`,i),Um(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Im(n.href);var a=e.querySelector(Lm(i));if(a)return t.state.loading|=4,t.instance=a,Yt(a),a;r=Rm(n),(i=bm.get(i))&&Wm(r,i),a=(e.ownerDocument||e).createElement(`link`),Yt(a);var s=a;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),hp(a,`link`,r),t.state.loading|=4,Um(a,n.precedence,e),t.instance=a;case`script`:return a=Bm(n.src),(i=e.querySelector(Vm(a)))?(t.instance=i,Yt(i),i):(r=n,(i=bm.get(a))&&(r=C({},n),Gm(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),Yt(i),hp(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(o(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Um(r,n.precedence,e));return t.instance}function Um(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Wm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Gm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Km=null;function qm(e,t,n){if(Km===null){var r=new Map,i=Km=new Map;i.set(n,r)}else i=Km,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Ht]||a[Ft]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Jm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Ym(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Xm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Zm(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Qm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function $m(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Qm(t),e.suspenseyImages.push(t)),e=ah.bind(e),t.decode().then(e,e))}function eh(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Im(r.href),a=t.querySelector(Lm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ih.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Yt(a);return}a=t.ownerDocument||t,r=Rm(r),(i=bm.get(i))&&Wm(r,i),a=a.createElement(`link`),Yt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),hp(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=ih.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var th=0;function nh(e,t){return e.stylesheets&&e.count===0&&sh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&sh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&th===0&&(th=62500*yp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&sh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>th?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function rh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)sh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function ih(){this.count--,rh(this)}function ah(){this.imgCount--,rh(this)}var oh=null;function sh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,oh=new Map,t.forEach(ch,e),oh=null,ih.call(e))}function ch(e,t){if(!(t.state.loading&4)){var n=oh.get(e);if(n)var r=n.get(null);else{n=new Map,oh.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=ih.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var lh={$$typeof:de,Provider:null,Consumer:null,_currentValue:De,_currentValue2:De,_threadCount:0};function uh(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=wt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wt(0),this.hiddenUpdates=wt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function dh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new uh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Hi(3,null,null,t),e.current=a,a.stateNode=e,t=Va(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Co(a),e}function fh(e){return e?(e=Bi,e):Bi}function ph(e,t,n,r,i,a){i=fh(i),r.context===null?r.context=i:r.pendingContext=i,r=wo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=To(e,r,t),n!==null&&(Kd(n,e,t),Eo(n,e,t))}function mh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function hh(e,t){mh(e,t),(e=e.alternate)&&mh(e,t)}function gh(e){if(e.tag===13||e.tag===31){var t=Li(e,67108864);t!==null&&Kd(t,e,67108864),hh(e,67108864)}}function _h(e){if(e.tag===13||e.tag===31){var t=Ud();t=At(t);var n=Li(e,t);n!==null&&Kd(n,e,t),hh(e,t)}}var vh=!0;function yh(e,t,n,r){var i=w.T;w.T=null;var a=T.p;try{T.p=2,xh(e,t,n,r)}finally{T.p=a,w.T=i}}function bh(e,t,n,r){var i=w.T;w.T=null;var a=T.p;try{T.p=8,xh(e,t,n,r)}finally{T.p=a,w.T=i}}function xh(e,t,n,r){if(vh){var i=Sh(r);if(i===null)ap(e,t,r,Ch,n),Ph(e,r);else if(Ih(i,e,t,n,r))r.stopPropagation();else if(Ph(e,r),t&4&&-1<Nh.indexOf(e)){for(;i!==null;){var a=Kt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=vt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-dt(o);s.entanglements[1]|=c,o&=~c}zf(a),!(I&6)&&(Od=$e()+500,Bf(0,!1))}}break;case 31:case 13:s=Li(a,2),s!==null&&Kd(s,a,2),Zd(),hh(a,2)}if(a=Sh(r),a===null&&ap(e,t,r,Ch,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else ap(e,t,r,null,n)}}function Sh(e){return e=Mn(e),wh(e)}var Ch=null;function wh(e){if(Ch=null,e=Gt(e),e!==null){var t=l(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=u(t),e!==null)return e;e=null}else if(n===31){if(e=d(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ch=e,null}function Th(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(et()){case tt:return 2;case nt:return 8;case rt:case it:return 32;case at:return 268435456;default:return 32}default:return 32}}var Eh=!1,Dh=null,Oh=null,kh=null,Ah=new Map,jh=new Map,Mh=[],Nh=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Ph(e,t){switch(e){case`focusin`:case`focusout`:Dh=null;break;case`dragenter`:case`dragleave`:Oh=null;break;case`mouseover`:case`mouseout`:kh=null;break;case`pointerover`:case`pointerout`:Ah.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:jh.delete(t.pointerId)}}function Fh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Kt(t),t!==null&&gh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ih(e,t,n,r,i){switch(t){case`focusin`:return Dh=Fh(Dh,e,t,n,r,i),!0;case`dragenter`:return Oh=Fh(Oh,e,t,n,r,i),!0;case`mouseover`:return kh=Fh(kh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Ah.set(a,Fh(Ah.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,jh.set(a,Fh(jh.get(a)||null,e,t,n,r,i)),!0}return!1}function Lh(e){var t=Gt(e.target);if(t!==null){var n=l(t);if(n!==null){if(t=n.tag,t===13){if(t=u(n),t!==null){e.blockedOn=t,Nt(e.priority,function(){_h(n)});return}}else if(t===31){if(t=d(n),t!==null){e.blockedOn=t,Nt(e.priority,function(){_h(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Rh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Sh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);jn=r,n.target.dispatchEvent(r),jn=null}else return t=Kt(n),t!==null&&gh(t),e.blockedOn=n,!1;t.shift()}return!0}function zh(e,t,n){Rh(e)&&n.delete(t)}function Bh(){Eh=!1,Dh!==null&&Rh(Dh)&&(Dh=null),Oh!==null&&Rh(Oh)&&(Oh=null),kh!==null&&Rh(kh)&&(kh=null),Ah.forEach(zh),jh.forEach(zh)}function Vh(e,n){e.blockedOn===n&&(e.blockedOn=null,Eh||(Eh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Bh)))}var Hh=null;function Uh(e){Hh!==e&&(Hh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Hh===e&&(Hh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(wh(r||n)===null)continue;break}var a=Kt(n);a!==null&&(e.splice(t,3),t-=3,cc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Wh(e){function t(t){return Vh(t,e)}Dh!==null&&Vh(Dh,e),Oh!==null&&Vh(Oh,e),kh!==null&&Vh(kh,e),Ah.forEach(t),jh.forEach(t);for(var n=0;n<Mh.length;n++){var r=Mh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Mh.length&&(n=Mh[0],n.blockedOn===null);)Lh(n),n.blockedOn===null&&Mh.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[It]||null;if(typeof a==`function`)o||Uh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[It]||null)s=o.formAction;else if(wh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Uh(n)}}}function Gh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Kh(e){this._internalRoot=e}qh.prototype.render=Kh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current;ph(n,Ud(),e,t,null,null)},qh.prototype.unmount=Kh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ph(e.current,2,null,e,null,null),Zd(),t[Lt]=null}};function qh(e){this._internalRoot=e}qh.prototype.unstable_scheduleHydration=function(e){if(e){var t=Mt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Mh.length&&t!==0&&t<Mh[n].priority;n++);Mh.splice(n,0,e),n===0&&Lh(e)}};var Jh=n.version;if(Jh!==`19.3.0`)throw Error(o(527,Jh,`19.3.0`));T.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(o(188)):(e=Object.keys(e).join(`,`),Error(o(268,e)));return e=p(t),e=e===null?null:m(e),e=e===null?null:e.stateNode,e};var Yh={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:w,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Xh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xh.isDisabled&&Xh.supportsFiber)try{ct=Xh.inject(Yh),lt=Xh}catch{}}e.createRoot=function(e,t){if(!c(e))throw Error(o(299));var n=!1,r=``,i=jc,a=Mc,s=Nc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=dh(e,1,!1,null,null,n,r,null,i,a,s,Gh),e[Lt]=t.current,rp(e),new Kh(t)}})),l=e(((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=c()})),u=globalThis.Buffer,d=u!=null&&typeof u.from==`function`,f=new Int8Array(256).fill(-1);for(let e=0;e<10;e++)f[48+e]=e;for(let e=0;e<6;e++)f[65+e]=10+e,f[97+e]=10+e;var p=class e{static zeros=`.0.00.000.0000.00000.000000.0000000.00000000.000000000.0000000000.00000000000.000000000000.0000000000000.00000000000000.000000000000000.0000000000000000.00000000000000000.000000000000000000.0000000000000000000.00000000000000000000.000000000000000000000.0000000000000000000000.00000000000000000000000.000000000000000000000000.0000000000000000000000000`.split(`.`);static groupSizes=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5];static groupBases=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];static wordSize=26;static WORD_SIZE_BIGINT=BigInt(e.wordSize);static WORD_MASK=(1n<<e.WORD_SIZE_BIGINT)-1n;static MAX_SAFE_INTEGER_BIGINT=BigInt(2**53-1);static MIN_SAFE_INTEGER_BIGINT=BigInt(-(2**53-1));static MAX_IMULN_ARG=67108863;static MAX_NUMBER_CONSTRUCTOR_MAG_BIGINT=(1n<<53n)-1n;static MAX_NOMINAL_WORD_LENGTH=1048576;_magnitude=0n;_sign=0;_nominalWordLength=1;red=null;get negative(){return this._sign}set negative(e){this.assert(e===0||e===1,`Negative property must be 0 or 1`);let t=+(e===1);this._sign=this._magnitude===0n?0:t}get _computedWordsArray(){if(this._magnitude===0n)return[0];let t=[],n=this._magnitude;for(;n>0n;)t.push(Number(n&e.WORD_MASK)),n>>=e.WORD_SIZE_BIGINT;return t.length>0?t:[0]}get words(){if(!Number.isSafeInteger(this._nominalWordLength)||this._nominalWordLength<1||this._nominalWordLength>e.MAX_NOMINAL_WORD_LENGTH)throw Error(`BigNumber word length exceeds the supported limit`);let t=this._computedWordsArray;if(this._nominalWordLength<=t.length)return t;let n=Array.from({length:this._nominalWordLength}).fill(0);for(let e=0;e<t.length;e++)n[e]=t[e];return n}set words(t){let n=this._sign,r=0n,i=t.length>0?t.length:1;for(let n=i-1;n>=0;n--){let i=t[n]??0;r=r<<e.WORD_SIZE_BIGINT|BigInt(i&Number(e.WORD_MASK))}this._magnitude=r,this._sign=n,this._nominalWordLength=i,this.normSign()}get length(){return Math.max(1,this._nominalWordLength)}static isBN(t){return t instanceof e||typeof t==`object`&&!!t&&t.constructor?.wordSize===e.wordSize&&Array.isArray(t.words)}static max(e,t){return e.cmp(t)>0?e:t}static min(e,t){return e.cmp(t)<0?e:t}constructor(e=0,t=10,n=`be`){if(e??=0,typeof e==`bigint`){this._initializeState(e<0n?-e:e,+(e<0n)),this.normSign();return}let r=t===`le`||t===`be`,i=r?10:t,a=r?t:n;if(typeof e==`number`){this.initNumber(e,a);return}if(Array.isArray(e)){this.initArray(e,a);return}if(typeof e==`string`){this._initFromString(e,i,a);return}e===0?this._initializeState(0n,0):this.assert(!1,`Unsupported input type for BigNumber constructor`)}_initFromString(e,t,n){t===`hex`&&(t=16),this.assert(typeof t==`number`&&t===Math.trunc(t)&&t>=2&&t<=36,`Base must be an integer between 2 and 36`);let r=e.toString().replace(/\s+/g,``),i=0,a=0;r.startsWith(`-`)?(i++,a=1):r.startsWith(`+`)&&i++;let o=r.substring(i);if(o.length===0){this._initializeState(0n,a===1&&r.startsWith(`-`)?1:0),this.normSign();return}t===16?this._initFromHexString(o,a,n):this._initFromNonHexString(o,t,a,n)}_initFromHexString(e,t,n){if(n===`le`){let n=[],r=e;r.length%2!=0&&(r=`0`+r);for(let e=0;e<r.length;e+=2){let t=r.substring(e,e+2),i=Number.parseInt(t,16);if(Number.isNaN(i))throw Error(`Invalid character in `+r);n.push(i)}this.initArray(n,`le`),this._sign=t,this.normSign()}else{let n;try{n=BigInt(`0x`+e)}catch{throw Error(`Invalid character in `+e)}this._initializeState(n,t),this.normSign()}}_initFromNonHexString(e,t,n,r){try{if(this._parseBaseString(e,t),this._sign=n,this.normSign(),r===`le`){let e=this._sign;this.initArray(this.toArray(`be`),`le`),this._sign=e,this.normSign()}}catch(e){let t=e;throw t.message.includes(`Invalid character in string`)||t.message.includes(`Invalid digit for base`)||t.message.startsWith(`Invalid character:`)?Error(`Invalid character`):t}}_bigIntToStringInBase(e,t){if(e===0n)return`0`;if(t<2||t>36)throw Error(`Base must be between 2 and 36`);let n=``,r=e>0n?e:-e,i=BigInt(t);for(;r>0n;)n=`0123456789abcdefghijklmnopqrstuvwxyz`[Number(r%i)]+n,r/=i;return n}_parseBaseString(t,n){this._magnitude=0n;let r=BigInt(n),i=e.groupSizes[n],a=BigInt(e.groupBases[n]);(i===0||a===0n)&&(i=Math.floor(Math.log(67108863)/Math.log(n)),i===0&&(i=1),a=r**BigInt(i));let o=0,s=t.length,c=s%i;if(c===0&&s>0&&(c=i),c>0){let e=t.substring(o,o+c);this._magnitude=BigInt(this._parseBaseWord(e,n)),o+=c}for(;o<s;){let e=t.substring(o,o+i),r=BigInt(this._parseBaseWord(e,n));this._magnitude=this._magnitude*a+r,o+=i}this._finishInitialization()}_parseBaseWord(e,t){let n=0;for(let r=0;r<e.length;r++){let i=e.codePointAt(r),a;if(i>=48&&i<=57)a=i-48;else if(i>=65&&i<=90)a=i-65+10;else if(i>=97&&i<=122)a=i-97+10;else throw Error(`Invalid character: `+e[r]);if(a>=t)throw Error(`Invalid character`);n=n*t+a}return n}_initializeState(e,t){this._magnitude=e,this._sign=e===0n?0:t,this._finishInitialization()}_finishInitialization(){if(this._magnitude===0n)this._nominalWordLength=1,this._sign=0;else{let t=this._magnitude.toString(2).length;this._nominalWordLength=Math.max(1,Math.ceil(t/e.wordSize))}}assert(e,t=`Assertion failed`){if(!e)throw Error(t)}initNumber(t,n=`be`){if(this.assert(BigInt(Math.abs(t))<=e.MAX_NUMBER_CONSTRUCTOR_MAG_BIGINT,`The number is larger than 2 ^ 53 (unsafe)`),this.assert(t%1==0,`Number must be an integer for BigNumber conversion`),this._initializeState(BigInt(Math.abs(t)),+(t<0)),n===`le`){let e=this._sign,t=this.toArray(`be`);this.initArray(t,`le`),this._sign=e,this.normSign()}return this}initArray(e,t){if(e.length===0)return this._initializeState(0n,0),this;let n=0n;if(t===`be`)for(let t of e)n=n<<8n|BigInt(t&255);else for(let t=e.length-1;t>=0;t--)n=n<<8n|BigInt(e[t]&255);return this._initializeState(n,0),this}copy(e){e._magnitude=this._magnitude,e._sign=this._sign,e._nominalWordLength=this._nominalWordLength,e.red=this.red}static move(e,t){e._magnitude=t._magnitude,e._sign=t._sign,e._nominalWordLength=t._nominalWordLength,e.red=t.red}clone(){let t=new e(0n);return this.copy(t),t}expand(t){return this.assert(Number.isSafeInteger(t)&&t>=0&&t<=e.MAX_NOMINAL_WORD_LENGTH,`Expand size must be a non-negative safe integer within the supported word limit`),this._nominalWordLength=Math.max(this._nominalWordLength,t,1),this}strip(){return this._finishInitialization(),this.normSign()}normSign(){return this._magnitude===0n&&(this._sign=0),this}inspect(){return(this.red===null?`<BN: `:`<BN-R: `)+this.toString(16)+`>`}_getMinimalHex(){return this._magnitude===0n?`0`:this._magnitude.toString(16)}_toHexString(e){let t=this._getMinimalHex();if(e>1)for(t!==`0`&&t.length%2!=0&&(t=`0`+t);t.length%e!==0;)t=`0`+t;return(this.isNeg()?`-`:``)+t}toString(e=10,t=1){if(e===16||e===`hex`)return this._toHexString(t);if(typeof e!=`number`||e<2||e>36||e%1!=0)throw Error(`Base should be an integer between 2 and 36`);return this.toBaseString(e,t)}toBaseString(t,n){if(this._magnitude===0n)return e._paddedZero(n);let r=e.groupSizes[t],i=BigInt(e.groupBases[t]);(r===0||i===0n)&&(r=Math.floor(Math.log(2**53-1)/Math.log(t)),r===0&&(r=1),i=BigInt(t)**BigInt(r));let a=``,o=this._magnitude;for(;o>0n;){let e=o%i;o/=i;let n=this._bigIntToStringInBase(e,t);a=(o>0n?this._zeroPaddedChunk(n,r):n)+a}if(n>0)for(;a.length<n;)a=`0`+a;return(this._sign===1?`-`:``)+a}static _paddedZero(e){let t=`0`;if(e>1)for(;t.length<e;)t=`0`+t;return t}_zeroPaddedChunk(t,n){let r=n-t.length;return r<=0?t:r<e.zeros.length?e.zeros[r]+t:`0`.repeat(r)+t}toNumber(){let t=this._getSignedValue();if(t>e.MAX_SAFE_INTEGER_BIGINT||t<e.MIN_SAFE_INTEGER_BIGINT)throw Error(`Number can only safely store up to 53 bits`);return Number(t)}toBigInt(){return this._getSignedValue()}toJSON(){let e=this._getMinimalHex();return(this.isNeg()?`-`:``)+e}toArrayLikeGeneric(e,t){let n=this._magnitude,r=t?0:e.length-1,i=t?1:-1;for(let t of e){if(n===0n&&r>=0&&r<e.length)e[r]=0;else if(r>=0&&r<e.length)e[r]=Number(n&255n);else break;n>>=8n,r+=i}}toArray(e=`be`,t){this.strip();let n=this.byteLength(),r=t??Math.max(1,n);this.assert(n<=r,`byte array longer than desired length`),this.assert(r>0,`Requested array length <= 0`);let i=Array.from({length:r}).fill(0);return this._magnitude===0n&&r>0?i:this._magnitude===0n&&r===0?[]:(this.toArrayLikeGeneric(i,e===`le`),i)}bitLength(){return this._magnitude===0n?0:this._magnitude.toString(2).length}static toBitArray(e){let t=e.bitLength();if(t===0)return[];let n=Array.from({length:t}),r=e._magnitude;for(let e=0;e<t;e++)n[e]=(r>>BigInt(e)&1n)==0n?0:1;return n}toBitArray(){return e.toBitArray(this)}zeroBits(){if(this._magnitude===0n)return 0;let e=0,t=this._magnitude;for(;(t&1n)==0n&&t!==0n;)e++,t>>=1n;return e}byteLength(){return this._magnitude===0n?0:Math.ceil(this.bitLength()/8)}_getSignedValue(){return this._sign===1?-this._magnitude:this._magnitude}_setValueFromSigned(e){e<0n?(this._magnitude=-e,this._sign=1):(this._magnitude=e,this._sign=0),this._finishInitialization(),this.normSign()}toTwos(t){this.assert(t>=0);let n=BigInt(t),r=this._getSignedValue();this._sign===1&&this._magnitude!==0n&&(r=(1n<<n)+r);let i=(1n<<n)-1n;r&=i;let a=new e(0n);return a._initializeState(r,0),a}fromTwos(t){this.assert(t>=0);let n=BigInt(t),r=this._magnitude;if(t>0&&(r>>n-1n&1n)!=0n&&this._sign===0){let t=r-(1n<<n),i=new e(0n);return i._setValueFromSigned(t),i}return this.clone()}isNeg(){return this._sign===1&&this._magnitude!==0n}neg(){return this.clone().ineg()}ineg(){return this._magnitude!==0n&&(this._sign=this._sign===1?0:1),this}_iuop(e,t,n=!1){let r=t(this._magnitude,e._magnitude),i=this._nominalWordLength;return n&&(i=Math.max(this.length,e.length)),this._magnitude=r,this._finishInitialization(),n&&(this._nominalWordLength=Math.max(this._nominalWordLength,i)),this.strip()}iuor(e){return this._iuop(e,(e,t)=>e|t)}iuand(e){return this._iuop(e,(e,t)=>e&t)}iuxor(e){return this._iuop(e,(e,t)=>e^t,!0)}_iop(e,t,n=!1){return this.assert(this._sign===0&&e._sign===0),this._iuop(e,t,n)}ior(e){return this._iop(e,(e,t)=>e|t)}iand(e){return this._iop(e,(e,t)=>e&t)}ixor(e){return this._iop(e,(e,t)=>e^t,!0)}_uop_new(e,t){return this.length>=e.length?this.clone()[t](e):e.clone()[t](this)}or(e){return this.assert(this._sign===0&&e._sign===0),this._uop_new(e,`iuor`)}uor(e){return this._uop_new(e,`iuor`)}and(e){return this.assert(this._sign===0&&e._sign===0),this._uop_new(e,`iuand`)}uand(e){return this._uop_new(e,`iuand`)}xor(e){return this.assert(this._sign===0&&e._sign===0),this._uop_new(e,`iuxor`)}uxor(e){return this._uop_new(e,`iuxor`)}inotn(t){this.assert(typeof t==`number`&&t>=0);let n=(1n<<BigInt(t))-1n;this._magnitude=~this._magnitude&n;let r=t===0?1:Math.ceil(t/e.wordSize);return this._nominalWordLength=Math.max(1,r),this.strip(),this._nominalWordLength=Math.max(this._nominalWordLength,Math.max(1,r)),this}notn(e){return this.clone().inotn(e)}setn(t,n){this.assert(typeof t==`number`&&t>=0);let r=BigInt(t);n===1||n===!0?this._magnitude|=1n<<r:this._magnitude&=~(1n<<r);let i=Math.floor(t/e.wordSize)+1;return this._nominalWordLength=Math.max(this._nominalWordLength,i),this._finishInitialization(),this.strip()}iadd(e){return this._setValueFromSigned(this._getSignedValue()+e._getSignedValue()),this}add(t){let n=new e(0n);return n._setValueFromSigned(this._getSignedValue()+t._getSignedValue()),n}isub(e){return this._setValueFromSigned(this._getSignedValue()-e._getSignedValue()),this}sub(t){let n=new e(0n);return n._setValueFromSigned(this._getSignedValue()-t._getSignedValue()),n}mul(t){let n=new e(0n);return n._magnitude=this._magnitude*t._magnitude,n._sign=n._magnitude===0n?0:this._sign^t._sign,n._nominalWordLength=this.length+t.length,n.red=null,n.normSign()}imul(e){return this._magnitude*=e._magnitude,this._sign=this._magnitude===0n?0:this._sign^e._sign,this._nominalWordLength=this.length+e.length,this.red=null,this.normSign()}imuln(t){return this.assert(typeof t==`number`,`Assertion failed`),this.assert(Math.abs(t)<=e.MAX_IMULN_ARG,`Assertion failed`),this._setValueFromSigned(this._getSignedValue()*BigInt(t)),this}muln(e){return this.clone().imuln(e)}sqr(){let t=new e(0n);return t._magnitude=this._magnitude*this._magnitude,t._sign=0,t._nominalWordLength=this.length*2,t.red=null,t}isqr(){return this._magnitude*=this._magnitude,this._sign=0,this._nominalWordLength=this.length*2,this.red=null,this}pow(t){if(this.assert(t._sign===0,`Exponent for pow must be non-negative`),t.isZero())return new e(1n);let n=new e(1n),r=this.clone(),i=t.clone(),a=r.isNeg(),o=i.isOdd();for(a&&r.ineg();!i.isZero();)i.isOdd()&&n.imul(r),r.isqr(),i.iushrn(1);return a&&o&&n.ineg(),n}static normalizeNonNegativeBigInt(e,t){if(typeof e==`number`){if(!Number.isFinite(e)||!Number.isInteger(e)||e<0)throw Error(`${t} must be a non-negative integer`);return BigInt(e)}if(e<0n)throw Error(`${t} must be a non-negative integer`);return e}iushln(t){let n=e.normalizeNonNegativeBigInt(t,`Shift bits`);return n===0n?this:(this._magnitude<<=n,this._finishInitialization(),this.strip())}ishln(e){return this.assert(this._sign===0,`ishln requires positive number`),this.iushln(e)}iushrn(t,n,r){let i=e.normalizeNonNegativeBigInt(t,`Shift bits`);if(i===0n)return r?._initializeState(0n,0),this;if(r!=null){let e=(1n<<i)-1n,t=this._magnitude&e;r._initializeState(t,0)}return this._magnitude>>=i,this._finishInitialization(),this.strip()}ishrn(e,t,n){return this.assert(this._sign===0,`ishrn requires positive number`),this.iushrn(e,t,n)}shln(e){return this.clone().ishln(e)}ushln(e){return this.clone().iushln(e)}shrn(e){return this.clone().ishrn(e)}ushrn(e){return this.clone().iushrn(e)}testn(e){return this.assert(typeof e==`number`&&e>=0),(this._magnitude>>BigInt(e)&1n)!=0n}imaskn(t){this.assert(typeof t==`number`&&t>=0),this.assert(this._sign===0,`imaskn works only with positive numbers`);let n=BigInt(t),r=n===0n?0n:(1n<<n)-1n;this._magnitude&=r;let i=t===0?1:Math.max(1,Math.ceil(t/e.wordSize));return this._nominalWordLength=i,this._finishInitialization(),this._nominalWordLength=Math.max(this._nominalWordLength,i),this.strip()}maskn(e){return this.clone().imaskn(e)}iaddn(t){return this.assert(typeof t==`number`),this.assert(Math.abs(t)<=e.MAX_IMULN_ARG,`num is too large`),this._setValueFromSigned(this._getSignedValue()+BigInt(t)),this}_iaddn(e){return this.iaddn(e)}isubn(t){return this.assert(typeof t==`number`),this.assert(Math.abs(t)<=e.MAX_IMULN_ARG,`Assertion failed`),this._setValueFromSigned(this._getSignedValue()-BigInt(t)),this}addn(e){return this.clone().iaddn(e)}subn(e){return this.clone().isubn(e)}iabs(){return this._sign=0,this}abs(){return this.clone().iabs()}divmod(t,n,r){if(this.assert(!t.isZero(),`Division by zero`),this.isZero()){let t=new e(0n);return{div:n===`mod`?null:t,mod:n===`div`?null:t}}let i=this._getSignedValue(),a=t._getSignedValue(),o=n===`mod`?null:i/a,s=this._computeMod(i,a,n,r);return{div:this._bigNumberFromSigned(o),mod:this._bigNumberFromSigned(s)}}_computeMod(e,t,n,r){if(n===`div`)return null;let i=e%t;return r===!0&&i<0n&&(i+=t<0n?-t:t),i}_bigNumberFromSigned(t){if(t===null)return null;let n=new e(0n);return n._setValueFromSigned(t),n}div(e){return this.divmod(e,`div`,!1).div}mod(e){return this.divmod(e,`mod`,!1).mod}umod(e){return this.divmod(e,`mod`,!0).mod}divRound(t){this.assert(!t.isZero());let n=this._getSignedValue(),r=t._getSignedValue(),i=n/r,a=n%r;if(a===0n){let t=new e(0n);return t._setValueFromSigned(i),t}let o=a<0n?-a:a,s=r<0n?-r:r;o*2n>=s&&(n>0n&&r>0n||n<0n&&r<0n?i+=1n:i-=1n);let c=new e(0n);return c._setValueFromSigned(i),c}modrn(e){this.assert(e!==0,`Division by zero in modrn`);let t=BigInt(Math.abs(e));if(t===0n)throw Error(`Division by zero in modrn`);let n=this._magnitude%t;return Number(e<0?-n:n)}idivn(t){return this.assert(t!==0),this.assert(Math.abs(t)<=e.MAX_IMULN_ARG,`num is too large`),this._setValueFromSigned(this._getSignedValue()/BigInt(t)),this}divn(e){return this.clone().idivn(e)}egcd(t){this.assert(t._sign===0,`p must not be negative`),this.assert(!t.isZero(),`p must not be zero`);let n=this._getSignedValue(),r=t._magnitude,i=1n,a=0n,o=0n,s=1n;for(;r!==0n;){let e=n/r,t=r;r=n%r,n=t,t=a,a=i-e*a,i=t,t=s,s=o-e*s,o=t}let c=new e(0n);c._setValueFromSigned(i);let l=new e(0n);l._setValueFromSigned(o);let u=new e(0n);return u._initializeState(n<0n?-n:n,0),{a:c,b:l,gcd:u}}gcd(t){let n=this._magnitude,r=t._magnitude;if(n===0n){let t=new e(0n);return t._setValueFromSigned(r),t.iabs()}if(r===0n){let t=new e(0n);return t._setValueFromSigned(n),t.iabs()}for(;r!==0n;){let e=n%r;n=r,r=e}let i=new e(0n);return i._initializeState(n,0),i}invm(e){this.assert(!e.isZero()&&e._sign===0,`Modulus for invm must be positive and non-zero`);let t=this.egcd(e);if(!t.gcd.eqn(1))throw Error(`Inverse does not exist (numbers are not coprime).`);return t.a.umod(e)}isEven(){return this._magnitude%2n==0n}isOdd(){return this._magnitude%2n==1n}andln(e){return this.assert(e>=0),Number(this._magnitude&BigInt(e))}bincn(e){this.assert(typeof e==`number`&&e>=0);let t=1n<<BigInt(e);return this._setValueFromSigned(this._getSignedValue()+t),this}isZero(){return this._magnitude===0n}cmpn(t){this.assert(Math.abs(t)<=e.MAX_IMULN_ARG,`Number is too big`);let n=this._getSignedValue(),r=BigInt(t);return n<r?-1:+(n>r)}cmp(e){let t=this._getSignedValue(),n=e._getSignedValue();return t<n?-1:+(t>n)}ucmp(e){return this._magnitude<e._magnitude?-1:+(this._magnitude>e._magnitude)}gtn(e){return this.cmpn(e)===1}gt(e){return this.cmp(e)===1}gten(e){return this.cmpn(e)>=0}gte(e){return this.cmp(e)>=0}ltn(e){return this.cmpn(e)===-1}lt(e){return this.cmp(e)===-1}lten(e){return this.cmpn(e)<=0}lte(e){return this.cmp(e)<=0}eqn(e){return this.cmpn(e)===0}eq(e){return this.cmp(e)===0}toRed(e){return this.assert(this.red==null,`Already a number in reduction context`),this.assert(this._sign===0,`toRed works only with positives`),e.convertTo(this).forceRed(e)}fromRed(){return this.assert(this.red,`fromRed works only with numbers in reduction context`),this.red.convertFrom(this)}forceRed(e){return this.red=e,this}redAdd(e){return this.assert(this.red,`redAdd works only with red numbers`),this.red.add(this,e)}redIAdd(e){return this.assert(this.red,`redIAdd works only with red numbers`),this.red.iadd(this,e)}redSub(e){return this.assert(this.red,`redSub works only with red numbers`),this.red.sub(this,e)}redISub(e){return this.assert(this.red,`redISub works only with red numbers`),this.red.isub(this,e)}redShl(e){return this.assert(this.red,`redShl works only with red numbers`),this.red.shl(this,e)}redMul(e){return this.assert(this.red,`redMul works only with red numbers`),this.red.verify2(this,e),this.red.mul(this,e)}redIMul(e){return this.assert(this.red,`redIMul works only with red numbers`),this.red.verify2(this,e),this.red.imul(this,e)}redSqr(){return this.assert(this.red,`redSqr works only with red numbers`),this.red.verify1(this),this.red.sqr(this)}redISqr(){return this.assert(this.red,`redISqr works only with red numbers`),this.red.verify1(this),this.red.isqr(this)}redSqrt(){return this.assert(this.red,`redSqrt works only with red numbers`),this.red.verify1(this),this.red.sqrt(this)}redInvm(){return this.assert(this.red,`redInvm works only with red numbers`),this.red.verify1(this),this.red.invm(this)}redNeg(){return this.assert(this.red,`redNeg works only with red numbers`),this.red.verify1(this),this.red.neg(this)}redPow(e){return this.assert(this.red!=null&&e.red==null,`redPow(normalNum)`),this.red.verify1(this),this.red.pow(this,e)}static fromHex(t,n){let r=`be`;return(n===`little`||n===`le`)&&(r=`le`),new e(t,16,r)}toHex(e=0){if(this.isZero()&&e===0)return``;let t=this._getMinimalHex();t!==`0`&&t.length%2!=0&&(t=`0`+t);let n=e*2;for(;t.length<n;)t=`0`+t;return(this.isNeg()?`-`:``)+t}static fromJSON(t){return new e(t,16)}static fromNumber(t){return new e(t)}static fromString(t,n){return new e(t,n)}static fromSm(t,n=`big`){if(t.length===0)return new e(0n);let r=t.slice();n===`little`&&r.reverse();let i=0;r.length>0&&r[0]&128&&(i=1,r[0]&=127);let a;if(d)a=u.from(r).toString(`hex`);else{a=``;for(let e of r)a+=e<16?`0`+e.toString(16):e.toString(16)}let o=a.length===0?0n:BigInt(`0x`+a),s=new e(0n);return s._initializeState(o,i),s}toSm(e=`big`){if(this._magnitude===0n)return this._sign===1?[128]:[];let t=this._getMinimalHex();t.length%2!=0&&(t=`0`+t);let n=t.length/2,r=Array.from({length:n});for(let e=0,n=0;e<t.length;e+=2){let i=f[t.codePointAt(e)],a=f[t.codePointAt(e+1)];r[n++]=(i&15)<<4|a&15}let i;return this._sign===1?r[0]&128?i=[128,...r]:(i=r.slice(),i[0]|=128):i=r[0]&128?[0,...r]:r.slice(),e===`little`?i.reverse():i}static fromBits(t,n=!1){let r=t>>>24,i=t&8388607,a=!!(t&8388608);if(n&&a)throw Error(`negative bit set`);if(r===0&&i===0){if(a&&n)throw Error(`negative bit set for zero value`);return new e(0n)}let o=new e(i);return r<=3?o.iushrn((3-r)*8):o.iushln((r-3)*8),a&&o.ineg(),o}toBits(){if(this.strip(),this.isZero()&&!this.isNeg())return 0;let e=this.isNeg(),t=this.abs().toArray(`be`),n=0;for(;n<t.length-1&&t[n]===0;)n++;t=t.slice(n);let r=t.length,i;if(r===0)i=0;else if(r<=3){i=0;for(let e=0;e<r;e++)i=i<<8|t[e]}else i=t[0]<<16|t[1]<<8|t[2];i&8388608&&r<=255&&(i>>>=8,r++);let a=r<<24|i;return e&&(a|=8388608),a>>>0}static fromScriptNum(t,n=!1,r){if(r!==void 0&&t.length>r)throw Error(`script number overflow`);if(t.length===0)return new e(0n);if(n&&!(t.at(-1)&127)&&(t.length<=1||!(t.at(-2)&128)))throw Error(`non-minimally encoded script number`);return e.fromSm(t,`little`)}toScriptNum(){return this.toSm(`little`)}_invmp(t){this.assert(t._sign===0,`p must not be negative for _invmp`),this.assert(!t.isZero(),`p must not be zero for _invmp`);let n=this.umod(t),r=t.subn(2);if(n.red!==null)return n.redPow(r);let i=new e(1n),a=n.clone(),o=r.clone();for(;!o.isZero();)o.isOdd()&&(i=i.mul(a).umod(t)),a=a.sqr().umod(t),o.iushrn(1);return i}mulTo(e,t){return t._magnitude=this._magnitude*e._magnitude,t._sign=t._magnitude===0n?0:this._sign^e._sign,t._nominalWordLength=this.length+e.length,t.red=null,t.normSign(),t}},m=class{name;p;k;n;tmp;constructor(e,t){this.name=e,this.p=new p(t,16),this.n=this.p.bitLength(),this.k=new p(BigInt(1)).iushln(this.n).isub(this.p),this.tmp=this._tmp()}_tmp(){let e=new p(BigInt(0)),t=Math.ceil(this.n/p.wordSize);return e.expand(Math.max(1,t)),e}ireduce(e){let t=e,n;do this.split(t,this.tmp),this.imulK(t),t.iadd(this.tmp),n=t.bitLength();while(n>this.n);let r=n<this.n?-1:t.ucmp(this.p);return r===0?t.words=[0]:r>0&&t.isub(this.p),t.strip(),t}split(e,t){e.iushrn(this.n,0,t)}imulK(e){return e.imul(this.k)}},h=class extends m{constructor(){super(`k256`,`ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f`)}split(e,t){let n=4194303,r=e.words,i=e.length,a=Math.min(i,9),o=Array.from({length:a+ +(i>9)},()=>0);for(let e=0;e<a;e++)o[e]=r[e];let s=a;if(i<=9){let n=Array.from({length:s},()=>0);for(let e=0;e<s;++e)n[e]=o[e];t.words=n,e.words=[0];return}let c=r[9];o[s++]=c&n;let l=Array.from({length:s},()=>0);for(let e=0;e<s;++e)l[e]=o[e];t.words=l;let u=Array.from({length:Math.max(1,i-9)},()=>0),d=0;for(let e=10;e<i;e++){let t=Math.trunc(r[e]);d<u.length&&(u[d++]=(t&n)<<4|c>>>22),c=t}c>>>=22,d<u.length?u[d++]=c:c!==0&&u.length;let f=Array.from({length:d},()=>0);for(let e=0;e<d;++e)f[e]=u[e];e.words=f}imulK(e){let t=e.words,n=e.length,r=n+2,i=Array.from({length:r},()=>0);for(let e=0;e<n;e++)i[e]=t[e];let a=0;for(let e=0;e<r;e++){let t=Math.trunc(i[e]);a+=t*977,i[e]=a&67108863,a=t*64+Math.trunc(a/67108864)}return e.words=i,e}},g=class{prime;m;constructor(e){if(e===`k256`){let e=new h;this.m=e.p,this.prime=e}else this.assert(e.gtn(1),`modulus must be greater than 1`),this.m=e,this.prime=null}assert(e,t=`Assertion failed`){if(!e)throw Error(t)}verify1(e){this.assert(e.negative===0,`red works only with positives`),this.assert(e.red,`red works only with red numbers`)}verify2(e,t){this.assert((e.negative|t.negative)===0,`red works only with positives`),this.assert(e.red!=null&&e.red===t.red,`red works only with red numbers`)}imod(e){return this.prime==null?(p.move(e,e.umod(this.m).forceRed(this)),e):this.prime.ireduce(e).forceRed(this)}neg(e){return e.isZero()?e.clone():this.m.sub(e).forceRed(this)}add(e,t){this.verify2(e,t);let n=e.clone();return n.iadd(t),n.isub(this.m),n.isNeg()&&n.iadd(this.m),n}iadd(e,t){return this.verify2(e,t),e.iadd(t),e.isub(this.m),e.isNeg()&&e.iadd(this.m),e}sub(e,t){this.verify2(e,t);let n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n.forceRed(this)}isub(e,t){this.verify2(e,t);let n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n}shl(e,t){return this.verify1(e),this.imod(e.ushln(t))}imul(e,t){return this.verify2(e,t),this.imod(e.imul(t))}mul(e,t){return this.verify2(e,t),this.imod(e.mul(t))}isqr(e){return this.imul(e,e.clone())}sqr(e){return this.mul(e,e)}sqrt(e){if(e.isZero())return e.clone();let t=this.m.andln(3);if(this.assert(t%2==1),t===3){let t=this.m.add(new p(1)).iushrn(2);return this.pow(e,t)}let n=this.m.subn(1),r=0;for(;!n.isZero()&&n.andln(1)===0;)r++,n.iushrn(1);this.assert(!n.isZero());let i=new p(1).toRed(this),a=i.redNeg(),o=this.m.subn(1).iushrn(1),s=this.m.bitLength(),c=new p(2*s*s).toRed(this);for(;this.pow(c,o).cmp(a)!==0;)c.redIAdd(a);let l=this.pow(c,n),u=this.pow(e,n.addn(1).iushrn(1)),d=this.pow(e,n),f=r;for(;d.cmp(i)!==0;){let e=d,t=0;for(;e.cmp(i)!==0;)e=e.redSqr(),t++;this.assert(t<f);let n=this.pow(l,new p(1).iushln(f-t-1));u=u.redMul(n),l=n.redSqr(),d=d.redMul(l),f=t}return u}invm(e){let t=e._invmp(this.m);return t.negative===0?this.imod(t):(t.negative=0,this.imod(t).redNeg())}pow(e,t){if(this.verify1(e),t.isZero())return new p(1).toRed(this);let n=new p(1).toRed(this),r=e.clone(),i=t.bitLength();for(let e=i-1;e>=0;e--)n=this.sqr(n),t.testn(e)&&(n=this.mul(n,r));return n}convertTo(e){let t=e.umod(this.m);return t===e?t.clone():t}convertFrom(e){let t=e.clone();return t.red=null,t}},_=class extends g{shift;r;r2;rinv;minv;constructor(e){super(e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new p(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}convertTo(e){return this.imod(e.ushln(this.shift))}convertFrom(e){let t=this.imod(e.mul(this.rinv));return t.red=null,t}imul(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;let n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a.forceRed(this)}mul(e,t){if(e.isZero()||t.isZero())return new p(0).forceRed(this);let n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a.forceRed(this)}invm(e){return this.imod(e._invmp(this.m).mul(this.r2)).forceRed(this)}},v=/^[0-9a-fA-F]*$/;function y(e){if(typeof e!=`string`)throw TypeError(`Invalid hex string`);if(e.length!==0&&!v.test(e))throw Error(`Invalid hex string`)}function b(e){if(y(e),e.length===0)return``;let t=e.toLowerCase();return t.length%2!=0&&(t=`0`+t),t}var ee=(e,t=`Hash assertion failed`)=>{if(!e)throw Error(t)},te=class{pending=null;pendingTotal=0;blockSize;outSize;endian;_delta8;_delta32;padLength;hmacStrength;constructor(e,t,n,r){this.blockSize=e,this.outSize=t,this.hmacStrength=n,this.padLength=r/8,this.endian=`big`,this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}_update(e,t){throw Error(`Not implemented`)}_digest(){throw Error(`Not implemented`)}_digestHex(){throw Error(`Not implemented`)}update(e,t){if(e=C(e,t),this.pending=this.pending==null?e:this.pending.concat(e),this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;let t=e.length%this._delta8;this.pending=e.slice(e.length-t,e.length),this.pending.length===0&&(this.pending=null),e=Se(e,0,e.length-t,this.endian);for(let t=0;t<e.length;t+=this._delta32)this._update(e,t)}return this}digest(){return this.update(this._pad()),ee(this.pending===null),this._digest()}digestHex(){return this.update(this._pad()),ee(this.pending===null),this._digestHex()}_pad(){let e=this.pendingTotal;if(!Number.isSafeInteger(e)||e<0)throw Error(`Message too long for this hash function`);let t=this._delta8,n=t-(e+this.padLength)%t,r=Array.from({length:n+this.padLength});r[0]=128;let i=1;for(;i<n;i++)r[i]=0;let a=this.padLength,o=1n<<BigInt(a*8),s=BigInt(e)*8n;if(s>=o)throw Error(`Message too long for this hash function`);if(this.endian===`big`){let e=Array.from({length:a});for(let t=a-1;t>=0;t--)e[t]=Number(s&255n),s>>=8n;for(let t=0;t<a;t++)r[i++]=e[t]}else for(let e=0;e<a;e++)r[i++]=Number(s&255n),s>>=8n;return r}};function x(e,t,n){let r=e.codePointAt(t);return r<128?(n.push(r),t):r<2048?(n.push(r>>6|192,r&63|128),t):r>65535?(n.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128),t+1):(n.push(r>>12|224,r>>6&63|128,r&63|128),t)}function ne(e){let t=[],n=0;for(;n<e.length;)n=x(e,n,t)+1;return t}function S(e){y(e);let t=b(e),n=[];for(let e=0;e<t.length;e+=2)n.push(Number.parseInt(t[e]+t[e+1],16));return n}function re(e){let t=[];for(let n=0;n<e.length;n++)t[n]=Math.trunc(e[n]);return t}function C(e,t){return Array.isArray(e)?e.slice():e?typeof e==`string`?t===`hex`?S(e):ne(e):re(e):[]}function ie(e){return qt(e)}function ae(e,t){let n=``;for(let r of e)t===`little`&&(r=ie(r)),n+=oe(r.toString(16));return n}function oe(e){return e.length===7?`0`+e:e.length===6?`00`+e:e.length===5?`000`+e:e.length===4?`0000`+e:e.length===3?`00000`+e:e.length===2?`000000`+e:e.length===1?`0000000`+e:e}var se=typeof globalThis>`u`?void 0:globalThis.Buffer,ce=se!=null&&typeof se.from==`function`,le=`0123456789abcdef`,ue=Array.from({length:256});for(let e=0;e<ue.length;e++)ue[e]=le[e>>4&15]+le[e&15];function de(e){if(ce)return se.from(e).toString(`hex`);let t=Array.from({length:e.length});for(let n=0;n<e.length;n++)t[n]=ue[e[n]];return t.join(``)}var fe=(()=>{let e=typeof globalThis>`u`?void 0:globalThis.process,t=e?.getBuiltinModule;if(typeof t==`function`)try{let n=t.call(e,`node:crypto`);if(n!=null)return n}catch{}})();function pe(e,t){return e instanceof Uint8Array?e:Array.isArray(e)?new Uint8Array(e):Uint8Array.from(C(e,t))}function me(e){return typeof e==`string`?pe(e,`hex`):pe(e)}function he(e,t,n){e==null?t?.update(n):e.update(n)}function ge(e,t){return e==null?t==null?[]:Array.from(t.digest()):Array.from(e.digest())}function _e(e,t){return e==null?t==null?``:de(t.digest()):e.digest(`hex`)}function ve(e){let t=fe?.createHash;if(typeof t==`function`)try{return t(e)}catch{return}}function ye(e,t){let n=fe?.createHmac;if(typeof n==`function`)try{return n(e,t)}catch{return}}function be(e,t,n){let r=ve(e);if(r!=null)return r.update(pe(t,n)),r.digest()}function xe(e,t,n,r){let i=ye(e,me(t));if(i!=null)return i.update(pe(n,r)),i.digest()}function Se(e,t,n,r){let i=n-t;ee(i%4==0);let a=Array.from({length:i/4});for(let n=0,i=t;n<a.length;n++,i+=4){let t;t=r===`big`?e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3]:e[i+3]<<24|e[i+2]<<16|e[i+1]<<8|e[i],a[n]=t>>>0}return a}function Ce(e,t){let n=Array.from({length:e.length*4});for(let r=0,i=0;r<e.length;r++,i+=4){let a=e[r];t===`big`?(n[i]=a>>>24,n[i+1]=a>>>16&255,n[i+2]=a>>>8&255,n[i+3]=a&255):(n[i+3]=a>>>24,n[i+2]=a>>>16&255,n[i+1]=a>>>8&255,n[i]=a&255)}return n}function we(e,t){return e>>>t|e<<32-t}function Te(e,t){return e<<t|e>>>32-t}function Ee(e,t){return e+t>>>0}function w(e,t,n){return e+t+n>>>0}function T(e,t,n,r){return e+t+n+r>>>0}function De(e,t,n,r,i){return e+t+n+r+i>>>0}function Oe(e,t,n,r){return e===0?ke(t,n,r):e===1||e===3?je(t,n,r):e===2?Ae(t,n,r):0}function ke(e,t,n){return e&t^~e&n}function Ae(e,t,n){return e&t^e&n^t&n}function je(e,t,n){return e^t^n}function Me(e){return we(e,2)^we(e,13)^we(e,22)}function Ne(e){return we(e,6)^we(e,11)^we(e,25)}function Pe(e){return we(e,7)^we(e,18)^e>>>3}function Fe(e){return we(e,17)^we(e,19)^e>>>10}var Ie=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],Le=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],Re=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],ze=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];function Be(e,t,n,r){return e<=15?t^n^r:e<=31?t&n|~t&r:e<=47?(t|~n)^r:e<=63?t&r|n&~r:t^(n|~r)}function Ve(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function He(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}var Ue=class extends te{h;constructor(){super(512,160,192,64),this.endian=`little`,this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian=`little`}_update(e,t){let n=this.h[0],r=this.h[1],i=this.h[2],a=this.h[3],o=this.h[4],s=n,c=r,l=i,u=a,d=o,f;for(let p=0;p<80;p++)f=Ee(Te(T(n,Be(p,r,i,a),e[Ie[p]+t],Ve(p)),Re[p]),o),n=o,o=a,a=Te(i,10),i=r,r=f,f=Ee(Te(T(s,Be(79-p,c,l,u),e[Le[p]+t],He(p)),ze[p]),d),s=d,d=u,u=Te(l,10),l=c,c=f;f=w(this.h[1],i,u),this.h[1]=w(this.h[2],a,d),this.h[2]=w(this.h[3],o,s),this.h[3]=w(this.h[4],n,c),this.h[4]=w(this.h[0],r,l),this.h[0]=f}_digest(){return Ce(this.h,`little`)}_digestHex(){return ae(this.h,`little`)}},We=class extends te{h;W;k;constructor(){super(512,160,80,64),this.k=[1518500249,1859775393,2400959708,3395469782],this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array.from({length:80})}_update(e,t){let n=this.W;t??=0;let r=0;for(;r<16;r++)n[r]=e[t+r];for(;r<n.length;r++)n[r]=Te(n[r-3]^n[r-8]^n[r-14]^n[r-16],1);let i=this.h[0],a=this.h[1],o=this.h[2],s=this.h[3],c=this.h[4];for(r=0;r<n.length;r++){let e=Math.trunc(r/20),t=De(Te(i,5),Oe(e,a,o,s),c,n[r],this.k[e]);c=s,s=o,o=Te(a,30),a=i,i=t}this.h[0]=Ee(this.h[0],i),this.h[1]=Ee(this.h[1],a),this.h[2]=Ee(this.h[2],o),this.h[3]=Ee(this.h[3],s),this.h[4]=Ee(this.h[4],c)}_digest(){return Ce(this.h,`big`)}_digestHex(){return ae(this.h,`big`)}},Ge=class{h;native;blockSize=64;outSize=32;constructor(e){let t=me(e);this.native=ye(`sha256`,t),this.native??(this.h=new Kt(Lt,t))}update(e,t){return he(this.native,this.h,pe(e,t)),this}digest(){return ge(this.native,this.h)}digestHex(){return _e(this.native,this.h)}},Ke=class{h;native;blockSize=128;outSize=32;constructor(e){let t=me(e);this.native=ye(`sha512`,t),this.native??(this.h=new Kt(Gt,t))}update(e,t){return he(this.native,this.h,pe(e,t)),this}digest(){return ge(this.native,this.h)}digestHex(){return _e(this.native,this.h)}};function qe(e,t){return be(`sha256`,e,t)??new It().update(pe(e,t)).digest()}function Je(e,t){return be(`ripemd160`,e,t)}var Ye=(e,t)=>{let n=Je(e,t);return n==null?new Ue().update(e,t).digest():Array.from(n)},Xe=(e,t)=>new We().update(e,t).digest(),Ze=(e,t)=>Array.from(qe(e,t)),Qe=(e,t)=>Array.from(qe(qe(e,t))),$e=(e,t)=>{let n=qe(e,t),r=Je(n);return r==null?new Ue().update(n).digest():Array.from(r)},et=(e,t,n)=>{let r=xe(`sha256`,e,t,n);return r==null?new Ge(e).update(t,n).digest():Array.from(r)},tt=(e,t,n)=>{let r=xe(`sha512`,e,t,n);return r==null?new Ke(e).update(t,n).digest():Array.from(r)};function nt(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function rt(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`positive integer expected, got ${e}`)}function it(e,...t){if(!nt(e))throw Error(`Uint8Array expected`);if(t.length>0&&!t.includes(e.length)){let n=t.join(`,`);throw Error(`Uint8Array expected of length ${n}, got length=${e.length}`)}}function at(e){if(typeof e!=`function`||typeof e.create!=`function`)throw TypeError(`Hash should be wrapped by utils.createHasher`);rt(e.outputLen),rt(e.blockLen)}function ot(e,t=!0){if(e.destroyed===!0)throw Error(`Hash instance has been destroyed`);if(t&&e.finished===!0)throw Error(`Hash#digest() has already been called`)}function st(e,t){it(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least ${n}`)}function ct(...e){for(let t of e)t.fill(0)}function lt(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function ut(e){return typeof e==`string`&&(e=dt(e)),it(e),e}function dt(e){if(typeof e!=`string`)throw Error(`string expected`);return new Uint8Array(new TextEncoder().encode(e))}var ft=class{};function pt(e){let t=t=>e().update(ut(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}var mt=BigInt(2**32-1),ht=BigInt(32);function gt(e,t=!1){return t?{h:Number(e&mt),l:Number(e>>ht&mt)}:{h:Number(e>>ht&mt)|0,l:Number(e&mt)|0}}function _t(e,t=!1){let n=e.length,r=new Uint32Array(n),i=new Uint32Array(n);for(let a=0;a<n;a++){let{h:n,l:o}=gt(e[a],t);r[a]=n,i[a]=o}return[r,i]}var vt=(e,t,n)=>e>>>n,yt=(e,t,n)=>e<<32-n|t>>>n,bt=(e,t,n)=>e>>>n|t<<32-n,xt=(e,t,n)=>e<<32-n|t>>>n,St=(e,t,n)=>e<<64-n|t>>>n-32,Ct=(e,t,n)=>e>>>n-32|t<<64-n;function wt(e,t,n,r){let i=(t>>>0)+(r>>>0);return{h:e+n+(i/2**32|0)|0,l:i|0}}var Tt=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),Et=(e,t,n,r)=>Math.trunc(t+n+r+Math.trunc(e/2**32)),Dt=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0),Ot=(e,t,n,r,i)=>Math.trunc(t+n+r+i+Math.trunc(e/2**32)),kt=(e,t,n,r,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(i>>>0),At=(e,t,n,r,i,a)=>t+n+r+i+a+(e/2**32|0)|0,jt=class extends ft{blockLen;outputLen;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.buffer=new Uint8Array(e),this.view=lt(this.buffer)}update(e){ot(this),e=ut(e),it(e);let{view:t,buffer:n,blockLen:r}=this,i=e.length;for(let a=0;a<i;){let o=Math.min(r-this.pos,i-a);if(o===r){let t=lt(e);for(;r<=i-a;a+=r)this.process(t,a);continue}n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){ot(this),st(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,ct(this.buffer.subarray(a)),this.padOffset>r-a&&(this.process(n,0),a=0);for(let e=a;e<r;e++)t[e]=0;Mt(n,r-8,BigInt(this.length*8),i),this.process(n,0);let o=lt(e),s=this.outputLen;if(s%4!=0)throw Error(`_sha2: outputLen should be aligned to 32bit`);let c=s/4,l=this.get();if(c>l.length)throw Error(`_sha2: outputLen bigger than state`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e??=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:n,length:r,finished:i,destroyed:a,pos:o}=this;return e.destroyed=a,e.finished=i,e.length=r,e.pos=o,r%t!==0&&e.buffer.set(n),e}clone(){return this._cloneInto()}};function Mt(e,t,n,r){if(typeof e.setBigUint64==`function`)return e.setBigUint64(t,n,r);let i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,s,r)}var Nt=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Pt=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Ft=new Uint32Array(64),It=class extends jt{A=Nt[0]|0;B=Nt[1]|0;C=Nt[2]|0;D=Nt[3]|0;E=Nt[4]|0;F=Nt[5]|0;G=Nt[6]|0;H=Nt[7]|0;constructor(e=32){super(64,e,8,!1)}get(){let{A:e,B:t,C:n,D:r,E:i,F:a,G:o,H:s}=this;return[e,t,n,r,i,a,o,s]}set(...[e,t,n,r,i,a,o,s]){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=s|0}process(e,t){for(let n=0;n<16;n++,t+=4)Ft[n]=e.getUint32(t);for(let e=16;e<64;e++){let t=Ft[e-15],n=Ft[e-2],r=Pe(t),i=Fe(n);Ft[e]=Ee(Ee(r,Ft[e-7]),Ee(i,Ft[e-16]))}let{A:n,B:r,C:i,D:a,E:o,F:s,G:c,H:l}=this;for(let e=0;e<64;e++){let t=De(l,Ne(o),ke(o,s,c),Pt[e],Ft[e]),u=Ee(Me(n),Ae(n,r,i));l=c,c=s,s=o,o=Ee(a,t),a=i,i=r,r=n,n=Ee(t,u)}this.A=Ee(this.A,n),this.B=Ee(this.B,r),this.C=Ee(this.C,i),this.D=Ee(this.D,a),this.E=Ee(this.E,o),this.F=Ee(this.F,s),this.G=Ee(this.G,c),this.H=Ee(this.H,l)}roundClean(){ct(Ft)}destroy(){ct(this.buffer),this.set(0,0,0,0,0,0,0,0)}},Lt=pt(()=>new It),Rt=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),zt=_t(`0x428a2f98d728ae22.0x7137449123ef65cd.0xb5c0fbcfec4d3b2f.0xe9b5dba58189dbbc.0x3956c25bf348b538.0x59f111f1b605d019.0x923f82a4af194f9b.0xab1c5ed5da6d8118.0xd807aa98a3030242.0x12835b0145706fbe.0x243185be4ee4b28c.0x550c7dc3d5ffb4e2.0x72be5d74f27b896f.0x80deb1fe3b1696b1.0x9bdc06a725c71235.0xc19bf174cf692694.0xe49b69c19ef14ad2.0xefbe4786384f25e3.0x0fc19dc68b8cd5b5.0x240ca1cc77ac9c65.0x2de92c6f592b0275.0x4a7484aa6ea6e483.0x5cb0a9dcbd41fbd4.0x76f988da831153b5.0x983e5152ee66dfab.0xa831c66d2db43210.0xb00327c898fb213f.0xbf597fc7beef0ee4.0xc6e00bf33da88fc2.0xd5a79147930aa725.0x06ca6351e003826f.0x142929670a0e6e70.0x27b70a8546d22ffc.0x2e1b21385c26c926.0x4d2c6dfc5ac42aed.0x53380d139d95b3df.0x650a73548baf63de.0x766a0abb3c77b2a8.0x81c2c92e47edaee6.0x92722c851482353b.0xa2bfe8a14cf10364.0xa81a664bbc423001.0xc24b8b70d0f89791.0xc76c51a30654be30.0xd192e819d6ef5218.0xd69906245565a910.0xf40e35855771202a.0x106aa07032bbd1b8.0x19a4c116b8d2d0c8.0x1e376c085141ab53.0x2748774cdf8eeb99.0x34b0bcb5e19b48a8.0x391c0cb3c5c95a63.0x4ed8aa4ae3418acb.0x5b9cca4f7763e373.0x682e6ff3d6b2b8a3.0x748f82ee5defb2fc.0x78a5636f43172f60.0x84c87814a1f0ab72.0x8cc702081a6439ec.0x90befffa23631e28.0xa4506cebde82bde9.0xbef9a3f7b2c67915.0xc67178f2e372532b.0xca273eceea26619c.0xd186b8c721c0c207.0xeada7dd6cde0eb1e.0xf57d4f7fee6ed178.0x06f067aa72176fba.0x0a637dc5a2c898a6.0x113f9804bef90dae.0x1b710b35131c471b.0x28db77f523047d84.0x32caab7b40c72493.0x3c9ebe0a15c9bebc.0x431d67c49c100d4c.0x4cc5d4becb3e42b6.0x597f299cfc657e2a.0x5fcb6fab3ad6faec.0x6c44198c4a475817`.split(`.`).map(BigInt)),Bt=zt[0],Vt=zt[1],Ht=new Uint32Array(80),Ut=new Uint32Array(80),Wt=class extends jt{Ah=Rt[0]|0;Al=Rt[1]|0;Bh=Rt[2]|0;Bl=Rt[3]|0;Ch=Rt[4]|0;Cl=Rt[5]|0;Dh=Rt[6]|0;Dl=Rt[7]|0;Eh=Rt[8]|0;El=Rt[9]|0;Fh=Rt[10]|0;Fl=Rt[11]|0;Gh=Rt[12]|0;Gl=Rt[13]|0;Hh=Rt[14]|0;Hl=Rt[15]|0;constructor(e=64){super(128,e,16,!1)}get(){let{Ah:e,Al:t,Bh:n,Bl:r,Ch:i,Cl:a,Dh:o,Dl:s,Eh:c,El:l,Fh:u,Fl:d,Gh:f,Gl:p,Hh:m,Hl:h}=this;return[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]}set(...[e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h]){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=r|0,this.Ch=i|0,this.Cl=a|0,this.Dh=o|0,this.Dl=s|0,this.Eh=c|0,this.El=l|0,this.Fh=u|0,this.Fl=d|0,this.Gh=f|0,this.Gl=p|0,this.Hh=m|0,this.Hl=h|0}process(e,t){for(let n=0;n<16;n++,t+=8)Ht[n]=e.getUint32(t),Ut[n]=e.getUint32(t+4);for(let e=16;e<80;e++){let t=Ht[e-15]|0,n=Ut[e-15]|0,r=bt(t,n,1)^bt(t,n,8)^vt(t,n,7),i=xt(t,n,1)^xt(t,n,8)^yt(t,n,7),a=Ht[e-2]|0,o=Ut[e-2]|0,s=bt(a,o,19)^St(a,o,61)^vt(a,o,6),c=Dt(i,xt(a,o,19)^Ct(a,o,61)^yt(a,o,6),Ut[e-7],Ut[e-16]),l=Ot(c,r,s,Ht[e-7],Ht[e-16]);Ht[e]=l|0,Ut[e]=c|0}let{Ah:n,Al:r,Bh:i,Bl:a,Ch:o,Cl:s,Dh:c,Dl:l,Eh:u,El:d,Fh:f,Fl:p,Gh:m,Gl:h,Hh:g,Hl:_}=this;for(let e=0;e<80;e++){let t=bt(u,d,14)^bt(u,d,18)^St(u,d,41),v=xt(u,d,14)^xt(u,d,18)^Ct(u,d,41),y=u&f^~u&m,b=d&p^~d&h,ee=kt(_,v,b,Vt[e],Ut[e]),te=At(ee,g,t,y,Bt[e],Ht[e]),x=ee|0,ne=bt(n,r,28)^St(n,r,34)^St(n,r,39),S=xt(n,r,28)^Ct(n,r,34)^Ct(n,r,39),re=n&i^n&o^i&o,C=r&a^r&s^a&s;g=m|0,_=h|0,m=f|0,h=p|0,f=u|0,p=d|0,{h:u,l:d}=wt(c|0,l|0,te|0,x|0),c=o|0,l=s|0,o=i|0,s=a|0,i=n|0,a=r|0;let ie=Tt(S,C,x);n=Et(ie,ne,re,te),r=ie|0}({h:n,l:r}=wt(n,r,this.Ah,this.Al)),{h:i,l:a}=wt(i,a,this.Bh,this.Bl),{h:o,l:s}=wt(o,s,this.Ch,this.Cl),{h:c,l}=wt(c,l,this.Dh,this.Dl),{h:u,l:d}=wt(u,d,this.Eh,this.El),{h:f,l:p}=wt(f,p,this.Fh,this.Fl),{h:m,l:h}=wt(m,h,this.Gh,this.Gl),{h:g,l:_}=wt(g,_,this.Hh,this.Hl),this.set(n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_)}roundClean(){ct(Ht,Ut)}destroy(){ct(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},Gt=pt(()=>new Wt),Kt=class extends ft{oHash;iHash;blockLen;outputLen;finished=!1;destroyed=!1;constructor(e,t){super(),at(e);let n=ut(t);if(this.iHash=e.create(),typeof this.iHash.update!=`function`)throw TypeError(`Expected instance of class which extends utils.Hash`);this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let r=this.blockLen,i=new Uint8Array(r);i.set(n.length>r?e.create().update(n).digest():n);for(let e=0;e<i.length;e++)i[e]^=54;this.iHash.update(i),this.oHash=e.create();for(let e=0;e<i.length;e++)i[e]^=106;this.oHash.update(i),ct(i)}update(e){return ot(this),this.iHash.update(e),this}digestInto(e){ot(this),it(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e??=Object.create(Object.getPrototypeOf(this),{});let{oHash:t,iHash:n,finished:r,destroyed:i,blockLen:a,outputLen:o}=this;return e=e,e.finished=r,e.destroyed=i,e.blockLen=a,e.outputLen=o,e.oHash=t._cloneInto(e.oHash??void 0),e.iHash=n._cloneInto(e.iHash??void 0),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};function qt(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(e&255)<<24)>>>0}(()=>{let e=new ArrayBuffer(4),t=new Uint32Array(e),n=new Uint8Array(e);return t[0]=16909060,n[0]===4})();var Jt=class{buffer;pos;capacity;constructor(e,t=256){if(e!=null&&e.length>0){let n=e.reduce((e,t)=>e+t.length,0);t=Math.max(t,n)}if(this.buffer=new Uint8Array(t),this.pos=0,this.capacity=t,e!=null)for(let t of e)this.write(t)}getLength(){return this.pos}toUint8Array(){return this.buffer.slice(0,this.pos)}toArray(){return Array.from(this.toUint8Array())}toUint8ArrayZeroCopy(){return this.buffer.subarray(0,this.pos)}reserve(e){if(!Number.isSafeInteger(e)||e<0)throw RangeError(`WriterUint8Array reserve requires a non-negative safe integer`);this.ensureCapacity(e)}ensureCapacity(e){if(this.pos+e>this.capacity){let t=this.capacity*2;for(;this.pos+e>t;)t*=2;let n=new Uint8Array(t);n.set(this.buffer),this.buffer=n,this.capacity=t}}write(e){let t=e instanceof Uint8Array?e:new Uint8Array(e);return this.ensureCapacity(t.length),this.buffer.set(t,this.pos),this.pos+=t.length,this}writeReverse(e){let t=e instanceof Uint8Array?e:new Uint8Array(e);this.ensureCapacity(t.length);for(let e=t.length-1;e>=0;e--)this.buffer[this.pos]=t[e],this.pos+=1;return this}writeUInt8(e){return this.ensureCapacity(1),this.buffer[this.pos]=e&255,this.pos+=1,this}writeInt8(e){return this.writeUInt8(e),this}writeUInt16LE(e){return this.ensureCapacity(2),this.buffer[this.pos]=e&255,this.buffer[this.pos+1]=e>>8&255,this.pos+=2,this}writeUInt16BE(e){return this.ensureCapacity(2),this.buffer[this.pos]=e>>8&255,this.buffer[this.pos+1]=e&255,this.pos+=2,this}writeInt16LE(e){return this.writeUInt16LE(e&65535),this}writeInt16BE(e){return this.writeUInt16BE(e&65535),this}writeUInt32LE(e){return this.ensureCapacity(4),this.buffer[this.pos]=e&255,this.buffer[this.pos+1]=e>>8&255,this.buffer[this.pos+2]=e>>16&255,this.buffer[this.pos+3]=e>>24&255,this.pos+=4,this}writeUInt32BE(e){return this.ensureCapacity(4),this.buffer[this.pos]=e>>24&255,this.buffer[this.pos+1]=e>>16&255,this.buffer[this.pos+2]=e>>8&255,this.buffer[this.pos+3]=e&255,this.pos+=4,this}writeInt32LE(e){return this.writeUInt32LE(e>>>0),this}writeInt32BE(e){return this.writeUInt32BE(e>>>0),this}writeUInt64BEBn(e){let t=e.toArray(`be`,8);return this.write(t),this}writeUInt64LEBn(e){let t=e.toArray(`be`,8);return this.writeReverse(t),this}writeUInt64LE(e){let t=new p(e).toArray(`be`,8);return this.writeReverse(t),this}writeVarIntNum(e){let t=_n.varIntNum(e);return this.write(t),this}writeVarIntBn(e){let t=_n.varIntBn(e);return this.write(t),this}reset(){this.pos=0}},Yt=class e{bin;pos;length;static makeReader(t,n=0){if(t instanceof Uint8Array)return new e(t,n);if(Array.isArray(t))return new vn(t,n);throw Error(`ReaderUint8Array.makeReader: bin must be Uint8Array or number[]`)}constructor(e=new Uint8Array,t=0){if(e instanceof Uint8Array)this.bin=e;else if(Array.isArray(e))this.bin=new Uint8Array(e);else throw TypeError(`ReaderUint8Array constructor: bin must be Uint8Array or number[]`);this.pos=t,this.length=this.bin.length}eof(){return this.pos>=this.length}read(e=this.length){let t=this.pos,n=this.pos+e;return this.pos=n,this.bin.slice(t,n)}readView(e=this.length-this.pos){if(!Number.isSafeInteger(e)||e<0||this.pos+e>this.length)throw RangeError(`ReaderUint8Array read exceeds available data`);let t=this.pos;return this.pos+=e,this.bin.subarray(t,this.pos)}skip(e){if(!Number.isSafeInteger(e)||e<0||this.pos+e>this.length)throw RangeError(`ReaderUint8Array skip exceeds available data`);this.pos+=e}remaining(){return this.length-this.pos}readReverse(e=this.length){let t=new Uint8Array(e);for(let n=0;n<e;n++)t[n]=this.bin[this.pos+e-1-n];return this.pos+=e,t}readUInt8(){let e=this.bin[this.pos];return this.pos+=1,e}readInt8(){let e=this.bin[this.pos];return this.pos+=1,e&128?e-256:e}readUInt16BE(){let e=this.bin[this.pos]<<8|this.bin[this.pos+1];return this.pos+=2,e}readInt16BE(){let e=this.readUInt16BE();return e&32768?e-65536:e}readUInt16LE(){let e=this.bin[this.pos]|this.bin[this.pos+1]<<8;return this.pos+=2,e}readInt16LE(){let e=this.readUInt16LE();return e&32768?e-65536:e}readUInt32BE(){let e=this.bin[this.pos]*16777216+(this.bin[this.pos+1]<<16|this.bin[this.pos+2]<<8|this.bin[this.pos+3]);return this.pos+=4,e}readInt32BE(){let e=this.readUInt32BE();return e&2147483648?e-4294967296:e}readUInt32LE(){let e=(this.bin[this.pos]|this.bin[this.pos+1]<<8|this.bin[this.pos+2]<<16|this.bin[this.pos+3]<<24)>>>0;return this.pos+=4,e}readInt32LE(){let e=this.readUInt32LE();return e&2147483648?e-4294967296:e}readUInt64BEBn(){let e=new p(Array.from(this.bin.slice(this.pos,this.pos+8)));return this.pos+=8,e}readUInt64LEBn(){return new p(Array.from(this.readReverse(8)))}readInt64LEBn(){let e=new p(2).pow(new p(63)),t=new p(2).pow(new p(64)),n=new p(Array.from(this.readReverse(8)));return n.gte(e)&&(n=n.sub(t)),n}readVarIntNum(e=!0){let t=this.readUInt8(),n;switch(t){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:if(n=e?this.readInt64LEBn():this.readUInt64LEBn(),n.lte(new p(2).pow(new p(53))))return n.toNumber();throw Error(`number too large to retain precision - use readVarIntBn`);default:return t}}readVarInt(){switch(this.bin[this.pos]){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}}readVarIntBn(){let e=this.readUInt8();switch(e){case 253:return new p(this.readUInt16LE());case 254:return new p(this.readUInt32LE());case 255:return this.readUInt64LEBn();default:return new p(e)}}},Xt=globalThis.Buffer,Zt=Xt!=null&&typeof Xt.from==`function`,Qt=`0123456789abcdef`,$t=Array.from({length:256},()=>``);for(let e=0;e<256;e++)$t[e]=Qt[e>>4&15]+Qt[e&15];var E=e=>Zt?Xt.from(e).toString(`hex`):e.length===0?``:Array.from(e,e=>$t[e&255]).join(``),en=(e,t)=>e instanceof Uint8Array?e:typeof e==`string`&&t===`hex`?D(e):new Uint8Array(tn(e,t)),tn=(e,t)=>{if(Array.isArray(e))return e.slice();if(e===void 0)return[];if(typeof e!=`string`)return Array.from(e,e=>Math.trunc(e));switch(t){case`hex`:return rn(e);case`base64`:return sn(e);default:return cn(e)}},nn=new Int8Array(256).fill(-1);for(let e=0;e<10;e++)nn[48+e]=e;for(let e=0;e<6;e++)nn[65+e]=10+e,nn[97+e]=10+e;var rn=e=>Array.from(D(e)),D=e=>{y(e);let t=e.length%2==0?e:`0`+e;if(Zt){let e=Xt.from(t,`hex`);return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let n=new Uint8Array(t.length/2),r=0;for(let e=0;e<t.length;e+=2){let i=nn[t.codePointAt(e)],a=nn[t.codePointAt(e+1)];n[r++]=i<<4|a}return n},an=e=>{if(typeof e!=`string`)throw TypeError(`msg must be a string`);let t=e.trim().replaceAll(/[\r\n\t\f\v ]+/g,``).replaceAll(`-`,`+`).replaceAll(`_`,`/`),n=t.indexOf(`=`);if(n===-1)return t;let r=t.slice(n);if(!/^={1,2}$/.test(r)||t.slice(0,n).includes(`=`))throw Error(`Invalid base64 padding`);return t.slice(0,n)},on=(e,t)=>{if(e>=65&&e<=90)return e-65;if(e>=97&&e<=122)return e-97+26;if(e>=48&&e<=57)return e-48+52;if(e===43)return 62;if(e===47)return 63;throw Error(`Invalid base64 character at index ${t}`)};function sn(e){let t=an(e),n=[],r=0,i=0;for(let e=0;e<t.length;e++){let a=on(t.codePointAt(e),e);for(r=r<<6|a,i+=6;i>=8;)i-=8,n.push(r>>i&255),r&=(1<<i)-1}return n}function cn(e){return Array.from(new TextEncoder().encode(e))}var ln=e=>new TextDecoder().decode(e instanceof Uint8Array?e:new Uint8Array(e)),un=(e,t)=>{switch(t){case`hex`:return E(e);case`utf8`:return ln(e);default:return e}};function dn(e){let t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,n=``,r=0;for(;r<e.length;r+=3){let i=e[r],a=r+1<e.length?e[r+1]:0,o=r+2<e.length?e[r+2]:0,s=i>>2,c=(i&3)<<4|a>>4,l=(a&15)<<2|o>>6,u=o&63;n+=t.charAt(s)+t.charAt(c),n+=r+1<e.length?t.charAt(l):`=`,n+=r+2<e.length?t.charAt(u):`=`}return n}var fn=`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`,pn=e=>{if(e===``||typeof e!=`string`)throw Error(`Expected base58 string but got “${e}”`);let t=e.match(/[^1-9A-HJ-NP-Za-km-z]/gmu);if(t!==null)throw Error(`Invalid base58 character “${t.join(``)}”`);let n=e.match(/^1+/gmu),r=n===null?0:n[0].length,i=(e.length-r)*(Math.log(58)/Math.log(256))+1>>>0;return[...new Uint8Array([...new Uint8Array(r),...Array.from(e).map(e=>fn.indexOf(e)).reduce((e,t)=>(e=e.map(e=>{let n=e*58+t;return t=n>>8,n}),e),new Uint8Array(i)).reverse().filter((e=>t=>e||=t)(!1))])]},mn=e=>{let t=Array.from({length:256},()=>-1);for(let e=0;e<58;++e)t[fn.codePointAt(e)]=e;let n=[];for(let r of e){let e=r;for(let r=0;r<n.length;++r){let i=(t[n[r]]<<8)+e,a=Math.trunc(i/58),o=i-a*58;n[r]=fn.codePointAt(o),e=a}for(;e!==0;){let t=Math.trunc(e/58),r=e-t*58;n.push(fn.codePointAt(r)),e=t}}for(let t of e)if(t===0)n.push(`1`.codePointAt(0));else break;return n.reverse(),String.fromCodePoint(...n)},hn=(e,t=[0])=>{let n=Qe([...t,...e]);return n=[...t,...e,...n.slice(0,4)],mn(n)},gn=(e,t,n=1)=>{let r=pn(e),i=r.slice(0,n),a=r.slice(n,-4),o=[...i,...a];return o=Qe(o),r.slice(-4).forEach((e,t)=>{if(e!==o[t])throw Error(`Invalid checksum`)}),t===`hex`&&(i=E(i),a=E(a)),{prefix:i,data:a}},_n=class e{bufs;length;constructor(e){this.bufs=e??[],this.length=0;for(let e of this.bufs)this.length+=e.length}getLength(){return this.length}toUint8Array(){let e=new Uint8Array(this.length),t=0;for(let n of this.bufs)e.set(n,t),t+=n.length;return e}toArray(){let e=this.length,t=Array.from({length:e},()=>0),n=0;for(let e of this.bufs)if(e instanceof Uint8Array)for(let r of e)t[n++]=r;else{let r=e;for(let e of r)t[n++]=e}return t}toHex(){return this.toArray().map(e=>e.toString(16).padStart(2,`0`)).join(``)}write(e){return this.bufs.push(e),this.length+=e.length,this}writeReverse(e){let t=Array.from({length:e.length},()=>0);for(let n=0;n<t.length;n++)t[n]=e[e.length-1-n];return this.write(t)}writeUInt8(e){let t=Array.from({length:1},()=>0);return t[0]=e&255,this.write(t),this}writeInt8(e){return this.writeUInt8(e)}writeUInt16BE(e){let t=[e>>8&255,e&255];return this.write(t)}writeInt16BE(e){return this.writeUInt16BE(e&65535)}writeUInt16LE(e){let t=[e&255,e>>8&255];return this.write(t)}writeInt16LE(e){return this.writeUInt16LE(e&65535)}writeUInt32BE(e){let t=[e>>24&255,e>>16&255,e>>8&255,e&255];return this.write(t)}writeInt32BE(e){return this.writeUInt32BE(e>>>0)}writeUInt32LE(e){let t=[e&255,e>>8&255,e>>16&255,e>>24&255];return this.write(t)}writeInt32LE(e){return this.writeUInt32LE(e>>>0)}writeUInt64BEBn(e){let t=e.toArray(`be`,8);return this.write(t),this}writeUInt64LEBn(e){let t=e.toArray(`be`,8);return this.writeReverse(t),this}writeUInt64LE(e){if(e===-1)this.write(Array.from({length:8},()=>255));else{let t=new p(e).toArray(`be`,8);this.writeReverse(t)}return this}writeVarIntNum(t){let n=e.varIntNum(t);return this.write(n),this}writeVarIntBn(t){let n=e.varIntBn(t);return this.write(n),this}static varIntNum(e){let t;if(e<0)return this.varIntBn(new p(e));if(e<253)t=[e];else if(e<65536)t=[253,e&255,e>>8&255];else if(e<4294967296)t=[254,e&255,e>>8&255,e>>16&255,e>>24&255];else{let n=e&4294967295,r=Math.floor(e/4294967296)&4294967295;t=[255,n&255,n>>8&255,n>>16&255,n>>24&255,r&255,r>>8&255,r>>16&255,r>>24&255]}return t}static varIntBn(t){let n;if(t.isNeg()&&(t=t.add(xn)),t.ltn(253))n=[t.toNumber()];else if(t.ltn(65536)){let e=t.toNumber();n=[253,e&255,e>>8&255]}else if(t.lt(new p(4294967296))){let e=t.toNumber();n=[254,e&255,e>>8&255,e>>16&255,e>>24&255]}else{let r=new e;r.writeUInt8(255),r.writeUInt64LEBn(t),n=r.toArray()}return n}},vn=class{bin;pos;length;constructor(e=[],t=0){this.bin=e,this.pos=t,this.length=e.length}eof(){return this.pos>=this.length}read(e=this.length){let t=this.pos,n=this.pos+e;return this.pos=n,this.bin.slice(t,n)}readReverse(e=this.length){let t=Array.from({length:e},()=>0);for(let n=0;n<e;n++)t[n]=this.bin[this.pos+e-1-n];return this.pos+=e,t}readUInt8(){let e=this.bin[this.pos];return this.pos+=1,e}readInt8(){let e=this.bin[this.pos];return this.pos+=1,e&128?e-256:e}readUInt16BE(){let e=this.bin[this.pos]<<8|this.bin[this.pos+1];return this.pos+=2,e}readInt16BE(){let e=this.readUInt16BE();return e&32768?e-65536:e}readUInt16LE(){let e=this.bin[this.pos]|this.bin[this.pos+1]<<8;return this.pos+=2,e}readInt16LE(){let e=this.readUInt16LE();return e&32768?e-65536:e}readUInt32BE(){let e=this.bin[this.pos]*16777216+(this.bin[this.pos+1]<<16|this.bin[this.pos+2]<<8|this.bin[this.pos+3]);return this.pos+=4,e}readInt32BE(){let e=this.readUInt32BE();return e&2147483648?e-4294967296:e}readUInt32LE(){let e=(this.bin[this.pos]|this.bin[this.pos+1]<<8|this.bin[this.pos+2]<<16|this.bin[this.pos+3]<<24)>>>0;return this.pos+=4,e}readInt32LE(){let e=this.readUInt32LE();return e&2147483648?e-4294967296:e}readUInt64BEBn(){let e=new p(this.bin.slice(this.pos,this.pos+8));return this.pos+=8,e}readUInt64LEBn(){return new p(this.readReverse(8))}readInt64LEBn(){let e=new p(this.readReverse(8));return e.gte(bn)&&(e=e.sub(xn)),e}readVarIntNum(e=!0){let t=this.readUInt8(),n;switch(t){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:if(n=e?this.readInt64LEBn():this.readUInt64LEBn(),n.lte(new p(2).pow(new p(53))))return n.toNumber();throw Error(`number too large to retain precision - use readVarIntBn`);default:return t}}readVarInt(){switch(this.bin[this.pos]){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}}readVarIntBn(){let e=this.readUInt8();switch(e){case 253:return new p(this.readUInt16LE());case 254:return new p(this.readUInt32LE());case 255:return this.readUInt64LEBn();default:return new p(e)}}},yn=e=>{if(e.length===0)return e;let t=e.at(-1);if(t&127)return e;if(e.length===1)return[];if(e.at(-2)&128)return e;for(let n=e.length-1;n>0;n--)if(e[n-1]!==0)return e[n-1]&128?(e[n]=t,e.slice(0,n+1)):(e[n-1]|=t,e.slice(0,n));return[]},bn=new p(2).pow(new p(63)),xn=new p(2).pow(new p(64));function Sn(e,t=`Expected a valid value, but got undefined or null.`){if(e==null)throw Error(t);return e}var Cn;function wn(e,t){let n=e.andln(3)+t&3;return n===3?-1:n}function Tn(e,t,n,r){if(!(n&1))return 0;let i=e.andln(7)+t&7;return(i===3||i===5)&&r===2?-n:n}function En(e,t){return 2*e===t+1?1-e:e}var Dn=class e{p;red;redN;zero;one;two;g;n;a;b;tinv;zeroA;threeA;endo;_endoWnafT1;_endoWnafT2;_wnafT1;_wnafT2;_wnafT3;_wnafT4;_bitLength;static assert(e,t=`Elliptic curve assertion failed`){if(!e)throw Error(t)}getNAF(e,t,n){let r=Array.from({length:Math.max(e.bitLength(),n)+1},()=>0);r.fill(0);let i=1<<t+1,a=e.clone();for(let e=0;e<r.length;e++){let t,n=a.andln(i-1);a.isOdd()?(t=n>(i>>1)-1?(i>>1)-n:n,a.isubn(t)):t=0,r[e]=t,a.iushrn(1)}return r}getJSF(e,t){let n=[[],[]];e=e.clone(),t=t.clone();let r=0,i=0;for(;e.cmpn(-r)>0||t.cmpn(-i)>0;){let a=wn(e,r),o=wn(t,i),s=Tn(e,r,a,o);n[0].push(s);let c=Tn(t,i,o,a);n[1].push(c),r=En(r,s),i=En(i,c),e.iushrn(1),t.iushrn(1)}return n}static cachedProperty(e,t,n){let r=`_`+t;e.prototype[t]=function(){return this[r]===void 0&&(this[r]=n.call(this)),this[r]}}static parseBytes(e){return typeof e==`string`?tn(e,`hex`):e}static intFromLE(e){return new p(e,`hex`,`le`)}constructor(){if(Cn===void 0)Cn=this;else return Cn;let e={prime:`k256`,p:`ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f`,a:`0`,b:`7`,n:`ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141`,h:`1`,beta:`7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee`,lambda:`5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72`,basis:[{a:`3086d221a7d46bcde86c90e49284eb15`,b:`-e4437ed6010e88286f547fa90abfe4c3`},{a:`114ca50f7a8e2f3f657c1108d9d44cfd8`,b:`3086d221a7d46bcde86c90e49284eb15`}],gRed:!1,g:[`79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798`,`483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8`,{doubles:{step:4,points:[[`e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a`,`f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821`],[`8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508`,`11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf`],[`175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739`,`d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695`],[`363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640`,`4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9`],[`8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c`,`4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36`],[`723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda`,`96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f`],[`eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa`,`5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999`],[`100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0`,`cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09`],[`e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d`,`9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d`],[`feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d`,`e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088`],[`da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1`,`9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d`],[`53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0`,`5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8`],[`8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047`,`10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a`],[`385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862`,`283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453`],[`6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7`,`7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160`],[`3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd`,`56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0`],[`85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83`,`7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6`],[`948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a`,`53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589`],[`6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8`,`bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17`],[`e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d`,`4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda`],[`e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725`,`7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd`],[`213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754`,`4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2`],[`4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c`,`17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6`],[`fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6`,`6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f`],[`76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39`,`c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01`],[`c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891`,`893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3`],[`d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b`,`febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f`],[`b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03`,`2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7`],[`e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d`,`eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78`],[`a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070`,`7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1`],[`90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4`,`e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150`],[`8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da`,`662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82`],[`e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11`,`1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc`],[`8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e`,`efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b`],[`e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41`,`2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51`],[`b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef`,`67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45`],[`d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8`,`db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120`],[`324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d`,`648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84`],[`4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96`,`35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d`],[`9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd`,`ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d`],[`6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5`,`9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8`],[`a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266`,`40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8`],[`7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71`,`34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac`],[`928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac`,`c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f`],[`85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751`,`1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962`],[`ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e`,`493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907`],[`827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241`,`c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec`],[`eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3`,`be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d`],[`e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f`,`4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414`],[`1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19`,`aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd`],[`146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be`,`b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0`],[`fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9`,`6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811`],[`da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2`,`8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1`],[`a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13`,`7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c`],[`174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c`,`ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73`],[`959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba`,`2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd`],[`d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151`,`e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405`],[`64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073`,`d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589`],[`8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458`,`38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e`],[`13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b`,`69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27`],[`bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366`,`d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1`],[`8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa`,`40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482`],[`8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0`,`620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945`],[`dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787`,`7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573`],[`f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e`,`ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82`]]},naf:{wnd:7,points:[[`f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9`,`388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672`],[`2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4`,`d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6`],[`5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc`,`6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da`],[`acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe`,`cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37`],[`774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb`,`d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b`],[`f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8`,`ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81`],[`d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e`,`581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58`],[`defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34`,`4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77`],[`2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c`,`85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a`],[`352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5`,`321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c`],[`2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f`,`2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67`],[`9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714`,`73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402`],[`daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729`,`a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55`],[`c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db`,`2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482`],[`6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4`,`e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82`],[`1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5`,`b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396`],[`605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479`,`2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49`],[`62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d`,`80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf`],[`80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f`,`1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a`],[`7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb`,`d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7`],[`d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9`,`eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933`],[`49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963`,`758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a`],[`77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74`,`958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6`],[`f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530`,`e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37`],[`463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b`,`5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e`],[`f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247`,`cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6`],[`caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1`,`cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476`],[`2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120`,`4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40`],[`7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435`,`91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61`],[`754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18`,`673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683`],[`e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8`,`59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5`],[`186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb`,`3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b`],[`df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f`,`55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417`],[`5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143`,`efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868`],[`290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba`,`e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a`],[`af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45`,`f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6`],[`766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a`,`744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996`],[`59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e`,`c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e`],[`f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8`,`e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d`],[`7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c`,`30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2`],[`948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519`,`e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e`],[`7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab`,`100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437`],[`3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca`,`ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311`],[`d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf`,`8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4`],[`1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610`,`68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575`],[`733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4`,`f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d`],[`15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c`,`d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d`],[`a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940`,`edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629`],[`e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980`,`a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06`],[`311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3`,`66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374`],[`34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf`,`9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee`],[`f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63`,`4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1`],[`d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448`,`fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b`],[`32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf`,`5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661`],[`7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5`,`8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6`],[`ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6`,`8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e`],[`16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5`,`5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d`],[`eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99`,`f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc`],[`78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51`,`f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4`],[`494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5`,`42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c`],[`a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5`,`204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b`],[`c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997`,`4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913`],[`841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881`,`73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154`],[`5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5`,`39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865`],[`36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66`,`d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc`],[`336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726`,`ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224`],[`8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede`,`6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e`],[`1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94`,`60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6`],[`85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31`,`3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511`],[`29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51`,`b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b`],[`a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252`,`ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2`],[`4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5`,`cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c`],[`d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b`,`6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3`],[`ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4`,`322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d`],[`af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f`,`6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700`],[`e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889`,`2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4`],[`591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246`,`b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196`],[`11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984`,`998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4`],[`3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a`,`b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257`],[`cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030`,`bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13`],[`c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197`,`6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096`],[`c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593`,`c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38`],[`a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef`,`21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f`],[`347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38`,`60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448`],[`da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a`,`49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a`],[`c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111`,`5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4`],[`4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502`,`7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437`],[`3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea`,`be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7`],[`cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26`,`8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d`],[`b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986`,`39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a`],[`d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e`,`62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54`],[`48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4`,`25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77`],[`dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda`,`ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517`],[`6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859`,`cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10`],[`e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f`,`f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125`],[`eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c`,`6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e`],[`13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942`,`fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1`],[`ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a`,`1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2`],[`b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80`,`5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423`],[`ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d`,`438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8`],[`8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1`,`cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758`],[`52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63`,`c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375`],[`e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352`,`6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d`],[`7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193`,`ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec`],[`5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00`,`9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0`],[`32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58`,`ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c`],[`e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7`,`d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4`],[`8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8`,`c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f`],[`4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e`,`67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649`],[`3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d`,`cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826`],[`674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b`,`299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5`],[`d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f`,`f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87`],[`30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6`,`462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b`],[`be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297`,`62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc`],[`93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a`,`7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c`],[`b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c`,`ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f`],[`d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52`,`4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a`],[`d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb`,`bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46`],[`463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065`,`bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f`],[`7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917`,`603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03`],[`74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9`,`cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08`],[`30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3`,`553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8`],[`9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57`,`712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373`],[`176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66`,`ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3`],[`75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8`,`9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8`],[`809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721`,`9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1`],[`1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180`,`4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9`]]}}]};this.p=new p(e.p,16),this.red=new g(e.prime),this.zero=new p(0).toRed(this.red),this.one=new p(1).toRed(this.red),this.two=new p(2).toRed(this.red),this.n=new p(e.n,16),this.g=cr.fromJSON(e.g,e.gRed),this._wnafT1=Array.from({length:4},()=>void 0),this._wnafT2=Array.from({length:4},()=>void 0),this._wnafT3=Array.from({length:4},()=>void 0),this._wnafT4=Array.from({length:4},()=>void 0),this._bitLength=this.n.bitLength(),this.redN=this.n.toRed(this.red),this.a=new p(e.a,16).toRed(this.red),this.b=new p(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(e),this._endoWnafT1=Array.from({length:4},()=>void 0),this._endoWnafT2=Array.from({length:4},()=>void 0)}_getEndomorphism(e){if(!this.zeroA||this.p.modrn(3)!==1)return;let t=this._resolveEndomorphismBeta(e),n=this._resolveEndomorphismLambda(e,t);return{beta:t,lambda:n,basis:this._resolveEndomorphismBasis(e,n)}}_resolveEndomorphismBeta(e){if(e.beta!==void 0)return new p(e.beta,16).toRed(this.red);let t=this._getEndoRoots(this.p);if(t==null)throw Error(`Failed to get endomorphism roots for beta.`);return(t[0].cmp(t[1])<0?t[0]:t[1]).toRed(this.red)}_endomorphismLambdaMatches(e,t,n=!1){if(this.g==null)throw Error(`Curve generator point (g) is not defined.`);let r=this.g.mul(e)?.x,i=this.g.x==null?void 0:this.g.x.redMul(t);if(r==null||i==null){if(n)throw Error(`Lambda computation failed: g.mul(lambda).x or g.x.redMul(beta) is undefined.`);return!1}return r.cmp(i)===0}_resolveEndomorphismLambda(t,n){if(t.lambda!==void 0)return new p(t.lambda,16);let r=this._getEndoRoots(this.n);if(r==null)throw Error(`Failed to get endomorphism roots for lambda.`);return this._endomorphismLambdaMatches(r[0],n)?r[0]:(e.assert(this._endomorphismLambdaMatches(r[1],n,!0),`Lambda selection does not match computed beta.`),r[1])}_resolveEndomorphismBasis(e,t){return typeof e.basis!=`object`||e.basis===null?this._getEndoBasis(t):e.basis.map(e=>({a:new p(e.a,16),b:new p(e.b,16)}))}_getEndoRoots(e){let t=e===this.p?this.red:new _(e),n=new p(2).toRed(t).redInvm(),r=n.redNeg(),i=new p(3).toRed(t).redNeg().redSqrt().redMul(n);return[r.redAdd(i).fromRed(),r.redSub(i).fromRed()]}_getEndoBasis(e){let t=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=e,r=this.n.clone(),i=new p(1),a=new p(0),o=new p(0),s=new p(1),c,l,u,d,f,m,h=new p(0),g=0,_=new p(0),v=new p(0);for(;n.cmpn(0)!==0;){let e=r.div(n);_=r.sub(e.mul(n)),v=o.sub(e.mul(i));let f=s.sub(e.mul(a));if(u===void 0&&_.cmp(t)<0)c=h.neg(),l=i,u=_.neg(),d=v;else if(u!==void 0&&++g===2)break;h=_,r=n,n=_,o=i,i=v,s=a,a=f}if(c===void 0||l===void 0||u===void 0||d===void 0)throw Error(`Failed to compute Endo Basis values`);f=_.neg(),m=v;let y=u.sqr().add(d.sqr());return f.sqr().add(m.sqr()).cmp(y)>=0&&(f=c,m=l),u.negative!==0&&(u=u.neg(),d=d.neg()),f.negative!==0&&(f=f.neg(),m=m.neg()),[{a:u,b:d},{a:f,b:m}]}_endoSplit(e){if(this.endo==null)throw Error(`Endomorphism is not defined.`);let t=this.endo.basis,n=t[0],r=t[1],i=r.b.mul(e).divRound(this.n),a=n.b.neg().mul(e).divRound(this.n),o=i.mul(n.a),s=a.mul(r.a),c=i.mul(n.b),l=a.mul(r.b);return{k1:e.sub(o).sub(s),k2:c.add(l).neg()}}validate(e){if(e.inf)return!0;let t=e.x,n=e.y;if(t===null||n===null)throw Error(`Point coordinates cannot be null`);let r=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(r).redIAdd(this.b);return n.redSqr().redISub(i).cmpn(0)===0}},On=class{curve;type;precomputed;constructor(e){this.curve=new Dn,this.type=e,this.precomputed=null}},kn=class e extends On{x;y;z;zOne;constructor(e,t,n){super(`jacobian`),e===null&&t===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new p(0)):(p.isBN(e)||(e=new p(e,16)),this.x=e,p.isBN(t)||(t=new p(t,16)),this.y=t,p.isBN(n)||(n=new p(n,16)),this.z=n),this.x.red??(this.x=this.x.toRed(this.curve.red)),this.y.red??(this.y=this.y.toRed(this.curve.red)),this.z.red??(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.isInfinity()&&(this.x=this.curve.one,this.y=this.curve.one,this.z=new p(0).toRed(this.curve.red),this.zOne=!1)}toP(){if(this.isInfinity())return new cr(null,null);let e=this.z.redInvm(),t=e.redSqr();return new cr(this.x.redMul(t),this.y.redMul(t).redMul(e))}neg(){return new e(this.x,this.y.redNeg(),this.z)}add(t){if(this.isInfinity())return t;if(t.isInfinity())return this;let n=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(n),a=t.x.redMul(r),o=this.y.redMul(n.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),c=i.redSub(a),l=o.redSub(s);if(c.cmpn(0)===0)return l.cmpn(0)===0?this.dbl():new e(null,null,null);let u=c.redSqr(),d=u.redMul(c),f=i.redMul(u),p=l.redSqr().redIAdd(d).redISub(f).redISub(f),m=l.redMul(f.redISub(p)).redISub(o.redMul(d)),h=this.z.redMul(t.z).redMul(c);return new e(p,m,h)}mixedAdd(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;if(t.x===null||t.y===null)throw Error(`Point coordinates cannot be null`);let n=this.z.redSqr(),r=this.x,i=t.x.redMul(n),a=this.y,o=t.y.redMul(n).redMul(this.z),s=r.redSub(i),c=a.redSub(o);if(s.cmpn(0)===0)return c.cmpn(0)===0?this.dbl():new e(null,null,null);let l=s.redSqr(),u=l.redMul(s),d=r.redMul(l),f=c.redSqr().redIAdd(u).redISub(d).redISub(d),p=c.redMul(d.redISub(f)).redISub(a.redMul(u)),m=this.z.redMul(s);return new e(f,p,m)}dblp(e){if(e===0||this.isInfinity())return this;if(e===void 0)return this.dbl();let t=this;for(let n=0;n<e;n++)t=t.dbl();return t}dbl(){if(this.isInfinity())return this;let t,n,r;if(this.zOne){let e=this.x.redSqr(),i=this.y.redSqr(),a=i.redSqr(),o=this.x.redAdd(i).redSqr().redISub(e).redISub(a);o=o.redIAdd(o);let s=e.redAdd(e).redIAdd(e),c=s.redSqr().redISub(o).redISub(o),l=a.redIAdd(a);l=l.redIAdd(l),l=l.redIAdd(l),t=c,n=s.redMul(o.redISub(c)).redISub(l),r=this.y.redAdd(this.y)}else{let e=this.x.redSqr(),i=this.y.redSqr(),a=i.redSqr(),o=this.x.redAdd(i).redSqr().redISub(e).redISub(a);o=o.redIAdd(o);let s=e.redAdd(e).redIAdd(e),c=s.redSqr(),l=a.redIAdd(a);l=l.redIAdd(l),l=l.redIAdd(l),t=c.redISub(o).redISub(o),n=s.redMul(o.redISub(t)).redISub(l),r=this.y.redMul(this.z),r=r.redIAdd(r)}return new e(t,n,r)}eq(e){if(e.type===`affine`)return this.eq(e.toJ());if(this===e||(e=e,this.isInfinity()&&e.isInfinity()))return!0;if(this.isInfinity()!==e.isInfinity())return!1;let t=this.z.redSqr(),n=e.z.redSqr();if(this.x.redMul(n).redISub(e.x.redMul(t)).cmpn(0)!==0)return!1;let r=t.redMul(this.z),i=n.redMul(e.z);return this.y.redMul(i).redISub(e.y.redMul(r)).cmpn(0)===0}eqXToP(e){let t=this.z.redSqr(),n=e.toRed(this.curve?.red).redMul(t);if(this.x.cmp(n)===0)return!0;let r=e.clone();if(this.curve?.redN==null)throw Error(`Curve or redN is not initialized.`);let i=this.curve.redN.redMul(t);for(;r.cmp(this.curve.p)<0;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(i),this.x.cmp(n)===0)return!0}return!1}inspect(){return this.isInfinity()?`<EC JPoint Infinity>`:`<EC JPoint x: `+this.x.toString(16,2)+` y: `+this.y.toString(16,2)+` z: `+this.z.toString(16,2)+`>`}isInfinity(){return this.z.cmpn(0)===0}};function An(e,t,n){let r=-e,i=(t.X^n.X)&r,a=(t.Y^n.Y)&r,o=(t.Z^n.Z)&r;t.X^=i,n.X^=i,t.Y^=a,n.Y^=a,t.Z^=o,n.Z^=o}var jn=0n,Mn=1n,Nn=2n,Pn=3n,Fn=4n,In=8n,Ln=115792089237316195423570985008687907853269984665640564039457584007908834671663n,Rn=115792089237316195423570985008687907852837564279074904382605163141518161494337n,zn=(1n<<256n)-1n;function Bn(e){let t=e>>256n;return e=(e&zn)+(t<<32n)+t*977n,t=e>>256n,e=(e&zn)+(t<<32n)+t*977n,e>=115792089237316195423570985008687907853269984665640564039457584007908834671663n&&(e-=Ln),e}var Vn=e=>Bn((e%Ln+Ln)%Ln),Hn=(e,t)=>e>=t?e-t:Ln-(t-e),O=(e,t)=>Bn(e*t),Un=(e,t)=>Bn(e+t),Wn=e=>{let t=Mn,n=jn,r=Vn(e),i=Ln;for(;r>Mn;){let e=i/r;[t,n]=[n-t*e,t],[r,i]=[i-r*e,r]}return Vn(t)},Gn=e=>O(e,e),Kn=(e,t)=>{let n=1n;for(e=Vn(e);t>0n;)(t&1n)!=0n&&(n=O(n,e)),e=O(e,e),t>>=1n;return n},qn=115792089237316195423570985008687907853269984665640564039457584007908834671664n>>2n,Jn=e=>{let t=Kn(e,qn);return O(t,t)===Vn(e)?t:null},Yn=e=>p.isBN(e)?BigInt(`0x`+e.toString(16)):BigInt(typeof e==`string`?`0x`+e:Array.isArray(e)?`0x`+E(e):e),Xn=BigInt(`0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798`),Zn=BigInt(`0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8`),Qn=new Map,$n=e=>{let{X:t,Y:n,Z:r}=e;if(n===0n)return{X:jn,Y:Mn,Z:jn};let i=O(n,n),a=O(Fn,O(t,i)),o=O(Pn,O(t,t)),s=Hn(O(o,o),O(Nn,a));return{X:s,Y:Hn(O(o,Hn(a,s)),O(In,O(i,i))),Z:O(Nn,O(n,r))}},er=(e,t)=>{if(e.Z===0n)return t;if(t.Z===0n)return e;let n=O(e.Z,e.Z),r=O(t.Z,t.Z),i=O(e.X,r),a=O(t.X,n),o=O(e.Y,O(r,t.Z)),s=O(t.Y,O(n,e.Z)),c=Hn(a,i),l=Hn(s,o);if(c===0n)return l===0n?$n(e):{X:jn,Y:Mn,Z:jn};let u=O(c,c),d=O(c,u),f=O(i,u),p=Hn(Hn(O(l,l),d),O(Nn,f));return{X:p,Y:Hn(O(l,Hn(f,p)),O(o,d)),Z:O(c,O(e.Z,t.Z))}},tr=e=>e.Z===0n?e:{X:e.X,Y:Ln-e.Y,Z:e.Z},nr=(e,t)=>{let n=`${e}:${t.x.toString(16)}:${t.y.toString(16)}`,r=Qn.get(n);if(r!==void 0)return r;let i=Array.from({length:1<<e-1},()=>({X:jn,Y:Mn,Z:jn})),a={X:t.x,Y:t.y,Z:Mn};i[0]=a;let o=$n(a);for(let e=1;e<i.length;e++)i[e]=er(i[e-1],o);return Qn.set(n,i),i},rr=(e,t)=>{let n=[],r=1n<<BigInt(t),i=r>>1n,a=e;for(;a>0n;){if((a&1n)==0n)n.push(0);else{let e=a&r-1n;e>i&&(e-=r),n.push(Number(e)),a-=e}a>>=Mn}return n},ir=(e,t,n=5)=>{let r=nr(n,t),i=rr(e,n),a={X:jn,Y:Mn,Z:jn};for(let e=i.length-1;e>=0;e--){a=$n(a);let t=i[e];if(t!==0){let e=Math.abs(t)>>1,n=t>0?r[e]:tr(r[e]);a=er(a,n)}}return a},ar=e=>{let t=e%Rn;return t<0n&&(t+=Rn),t},or=(e,t)=>ar(e*t),sr=e=>{let t=1n,n=0n,r=ar(e),i=Rn;for(;r>1n;){let e=i/r;[t,n]=[n-t*e,t],[r,i]=[i-r*e,r]}return ar(t)},cr=class e extends On{x;y;inf;static _assertOnCurve(e){if(!e.validate())throw Error(`Invalid point`);return e}static fromDER(t){if((t[0]===4||t[0]===6||t[0]===7)&&t.length-1==64){if(t[0]===6){if(t.at(-1)%2!=0)throw Error(`Point string value is wrong length`)}else if(t[0]===7&&t.at(-1)%2!=1)throw Error(`Point string value is wrong length`);let n=new e(t.slice(1,33),t.slice(33,65));return e._assertOnCurve(n)}if((t[0]===2||t[0]===3)&&t.length-1==32)return e._assertOnCurve(e.fromX(t.slice(1,33),t[0]===3));throw Error(`Unknown point format`)}static fromString(t){let n=tn(t,`hex`);return e._assertOnCurve(e.fromDER(n))}static fromX(t,n){let r=Yn(t);r=Vn(r);let i=Jn(Un(O(Gn(r),r),7n));if(i===null)throw Error(`Invalid point`);let a=i;(a&1n)!=(n?1n:0n)&&(a=Hn(Ln,a));let o=new p(r.toString(16),16),s=new p(a.toString(16),16);return e._assertOnCurve(new e(o,s))}static fromJSON(t,n){typeof t==`string`&&(t=JSON.parse(t));let r=new e(t[0],t[1],n);if(r=e._assertOnCurve(r),typeof t[2]!=`object`||t[2]===null)return r;let i=t[2],a=t=>{let r=new e(t[0],t[1],n);return e._assertOnCurve(r)};return r.precomputed={beta:null,doubles:typeof i.doubles==`object`&&i.doubles!==null?{step:i.doubles.step,points:[r].concat(i.doubles.points.map(a))}:void 0,naf:typeof i.naf==`object`&&i.naf!==null?{wnd:i.naf.wnd,points:[r].concat(i.naf.points.map(a))}:void 0},r}constructor(e,t,n=!0){super(`affine`),this.precomputed=null,e===null&&t===null?(this.x=null,this.y=null,this.inf=!0):(p.isBN(e)||(e=new p(e,16)),this.x=e,p.isBN(t)||(t=new p(t,16)),this.y=t,n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red===null&&(this.x=this.x.toRed(this.curve.red)),this.y.red===null&&(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}validate(){if(this.inf||this.x==null||this.y==null)return!1;try{let e=BigInt(`0x`+this.x.fromRed().toString(16)),t=BigInt(`0x`+this.y.fromRed().toString(16));return O(t,t)===Un(O(O(e,e),e),7n)}catch{return!1}}encode(e=!0,t){if(this.inf)return t===`hex`?`00`:[0];let n=this.curve.p.byteLength(),r=this.getX().toArray(`be`,n),i;return i=e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray(`be`,n)),t===`hex`?E(i):i}toString(){return this.encode(!0,`hex`)}toJSON(){return this.precomputed==null?[this.x,this.y]:[this.x,this.y,typeof this.precomputed==`object`&&this.precomputed!==null?{doubles:this.precomputed.doubles==null?void 0:{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf==null?void 0:{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}:void 0]}inspect(){return this.isInfinity()?`<EC Point Infinity>`:`<EC Point x: `+(this.x?.fromRed()?.toString(16,2)??`undefined`)+` y: `+(this.y?.fromRed()?.toString(16,2)??`undefined`)+`>`}isInfinity(){return this.inf}add(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t)||this.x?.cmp(t.x??new p(0))===0)return new e(null,null);let n=er({X:BigInt(`0x`+this.x.fromRed().toString(16)),Y:BigInt(`0x`+this.y.fromRed().toString(16)),Z:Mn},{X:BigInt(`0x`+t.x.fromRed().toString(16)),Y:BigInt(`0x`+t.y.fromRed().toString(16)),Z:Mn});if(n.Z===0n)return new e(null,null);let r=Wn(n.Z),i=O(r,r),a=O(n.X,i),o=O(n.Y,O(i,r));return new e(a.toString(16),o.toString(16))}dbl(){if(this.inf)return this;if(this.x===null||this.y===null)throw Error(`Point coordinates cannot be null`);let t=BigInt(`0x`+this.x.fromRed().toString(16)),n=BigInt(`0x`+this.y.fromRed().toString(16));if(n===0n)return new e(null,null);let r=$n({X:t,Y:n,Z:Mn}),i=Wn(r.Z),a=O(i,i),o=O(r.X,a),s=O(r.Y,O(a,i));return new e(o.toString(16),s.toString(16))}getX(){return(this.x??new p(0)).fromRed()}getY(){return(this.y??new p(0)).fromRed()}mul(t){if(p.isBN(t)||(t=new p(t,16)),t=t,this.inf)return this;let n=t.isNeg(),r=n?t.neg():t,i=BigInt(`0x`+r.toString(16));if(i=Vn(i),i===0n||i===0n)return new e(null,null);if(this.x===null||this.y===null)throw Error(`Point coordinates cannot be null`);let a,o;this===this.curve.g?(a=Xn,o=Zn):(a=BigInt(`0x`+this.x.fromRed().toString(16)),o=BigInt(`0x`+this.y.fromRed().toString(16)));let s=ir(i,{x:a,y:o});if(s.Z===0n)return new e(null,null);let c=Wn(s.Z),l=O(c,c),u=O(s.X,l),d=O(s.Y,O(l,c)),f=new p(u.toString(16),16),m=new p(d.toString(16),16),h=new e(f,m);return n?h.neg():h}mulCT(t){if(p.isBN(t)||(t=new p(t,16)),t=t,this.inf)return new e(null,null);let n=t.isNeg(),r=n?t.neg():t,i=BigInt(`0x`+r.toString(16));if(i=Vn(i),i===0n)return new e(null,null);let a=this===this.curve.g?Xn:BigInt(`0x`+this.getX().toString(16)),o=this===this.curve.g?Zn:BigInt(`0x`+this.getY().toString(16)),s={X:0n,Y:1n,Z:0n},c={X:a,Y:o,Z:1n},l=i.toString(2);for(let e of l){let t=e===`1`?1n:0n;An(t,s,c),c=er(s,c),s=$n(s),An(t,s,c)}if(s.Z===0n)return new e(null,null);let u=Wn(s.Z),d=O(u,u),f=O(s.X,d),m=O(s.Y,O(d,u)),h=new e(f.toString(16),m.toString(16));return n?h.neg():h}mulAdd(e,t,n){let r=[this,t],i=[e,n];return this._endoWnafMulAdd(r,i)}jmulAdd(e,t,n){let r=[this,t],i=[e,n];return this._endoWnafMulAdd(r,i,!0)}eq(e){return this===e||this.inf===e.inf&&(this.inf||(this.x??new p(0)).cmp(e.x??new p(0))===0&&(this.y??new p(0)).cmp(e.y??new p(0))===0)}neg(t){if(this.inf)return this;let n=new e(this.x,(this.y??new p(0)).redNeg());if(t===!0&&this.precomputed!=null){let e=this.precomputed;n.precomputed={naf:e.naf==null?void 0:{wnd:e.naf.wnd,points:e.naf.points.map(e=>e.neg())},doubles:e.doubles==null?void 0:{step:e.doubles.step,points:e.doubles.points.map(e=>e.neg())},beta:void 0}}return n}dblp(e){let t;for(let n=0;n<e;n++)t=(t??this).dbl();return t??this}toJ(){return this.inf?new kn(null,null,null):new kn(this.x,this.y,this.curve.one)}_getBeta(){if(typeof this.curve.endo!=`object`)return;let t=this.precomputed;if(typeof t==`object`&&t&&typeof t.beta==`object`&&t.beta!==null)return t.beta;let n=new e((this.x??new p(0)).redMul(this.curve.endo.beta),this.y);if(t!=null){let r=this.curve,i=t=>{let n=t;if(n.x===null)throw Error(`p.x is null`);if(r.endo===void 0||r.endo===null)throw Error(`curve.endo is undefined`);return new e(n.x.redMul(r.endo.beta),n.y)};t.beta=n,n.precomputed={beta:null,naf:t.naf==null?void 0:{wnd:t.naf.wnd,points:t.naf.points.map(i)},doubles:t.doubles==null?void 0:{step:t.doubles.step,points:t.doubles.points.map(i)}}}return n}_fixedNafMul(e){if(typeof this.precomputed!=`object`||this.precomputed===null)throw Error(`_fixedNafMul requires precomputed values for the point`);let t=this._getDoubles(),n=this.curve.getNAF(e,1,this.curve._bitLength),r=(1<<t.step+1)-(t.step%2==0?2:1);r/=3;let i=[];for(let e=0;e<n.length;e+=t.step){let r=0;for(let i=e+t.step-1;i>=e;i--)r=(r<<1)+n[i];i.push(r)}let a=new kn(null,null,null),o=new kn(null,null,null);for(let e=r;e>0;e--){for(let n=0;n<i.length;n++){let r=i[n];r===e?o=o.mixedAdd(t.points[n]):r===-e&&(o=o.mixedAdd(t.points[n].neg()))}a=a.add(o)}return a.toP()}_prepareWnafWindows(e,t,n,r,i){for(let a=0;a<n;a++){let n=t[a]._getNAFPoints(e);r[a]=n.wnd,i[a]=n.points}}_combineWnafPair(e,t,n){let{points:r,coeffs:i,wndWidth:a,wnd:o,naf:s,currentMax:c}=n;if(a[e]!==1||a[t]!==1)return s[e]=this.curve.getNAF(i[e],a[e],this.curve._bitLength),s[t]=this.curve.getNAF(i[t],a[t],this.curve._bitLength),Math.max(c,s[e].length,s[t].length);let l=[r[e],null,null,r[t]],u=r[e].y??new p(0),d=r[t].y??new p(0);u.cmp(d)===0?(l[1]=r[e].add(r[t]),l[2]=r[e].toJ().mixedAdd(r[t].neg())):u.cmp(d.redNeg())===0?(l[1]=r[e].toJ().mixedAdd(r[t]),l[2]=r[e].add(r[t].neg())):(l[1]=r[e].toJ().mixedAdd(r[t]),l[2]=r[e].toJ().mixedAdd(r[t].neg()));let f=[-3,-1,-5,-7,0,7,5,1,3],m=this.curve.getJSF(i[e],i[t]),h=Math.max(c,m[0].length);s[e]=Array.from({length:h}),s[t]=Array.from({length:h});for(let n=0;n<h;n++){let r=Math.trunc(m[0][n]),i=Math.trunc(m[1][n]);s[e][n]=f[(r+1)*3+(i+1)],s[t][n]=0,o[e]=l}return h}_prepareWnafRepresentations(e,t,n,r,i,a){let o=0;for(let s=n-1;s>=1;s-=2)o=this._combineWnafPair(s-1,s,{points:e,coeffs:t,wndWidth:r,wnd:i,naf:a,currentMax:o});return o}_collectWnafStep(e,t,n,r){let i=e,a=0;for(;i>=0;){let e=!0;for(let a=0;a<t;a++)r[a]=new p(typeof n[a][i]==`number`?n[a][i]:0),r[a].isZero()||(e=!1);if(!e)break;a++,i--}return i>=0&&a++,{index:i,doubles:a}}_addWnafStep(e,t,n,r){let i=new p(1),a=new p(2),o=e;for(let e=0;e<t;e++){let t=n[e];if(t.cmpn(0)===0)continue;let s=t.isNeg()?r[e][t.neg().sub(i).div(a).toNumber()].neg():r[e][t.sub(i).div(a).toNumber()];o=s.type===`affine`?o.mixedAdd(s):o.add(s)}return o}_wnafMulAdd(e,t,n,r,i){let a=this.curve._wnafT1.length,o=Array.from({length:a}),s=Array.from({length:a},()=>[]),c=Array.from({length:a},()=>[]);this._prepareWnafWindows(e,t,r,o,s);let l=this._prepareWnafRepresentations(t,n,r,o,s,c),u=new kn(null,null,null),d=this.curve._wnafT4,f=l;for(;f>=0;){let e=this._collectWnafStep(f,r,c,d);if(f=e.index,u=u.dblp(e.doubles),f<0)break;u=this._addWnafStep(u,r,d,s),f--}for(let e=0;e<r;e++)s[e]=[];return i===!0?u:u.toP()}_endoWnafMulAdd(t,n,r){let i=Array.from({length:t.length*2}),a=Array.from({length:t.length*2}),o=0;for(;o<t.length;o++){let r=this.curve._endoSplit(n[o]),s=t[o],c=s._getBeta()??new e(null,null);r.k1.negative!==0&&(r.k1.ineg(),s=s.neg(!0)),r.k2.negative!==0&&(r.k2.ineg(),c=c.neg(!0)),i[o*2]=s,i[o*2+1]=c,a[o*2]=r.k1,a[o*2+1]=r.k2}let s=this._wnafMulAdd(1,i,a,o*2,r);for(let e=0;e<o*2;e++)i[e]=null,a[e]=null;return s}_hasDoubles(e){if(this.precomputed==null)return!1;let t=this.precomputed.doubles;return typeof t==`object`&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)}_getDoubles(e,t){if(typeof this.precomputed==`object`&&this.precomputed!==null&&typeof this.precomputed.doubles==`object`&&this.precomputed.doubles!==null)return this.precomputed.doubles;let n=[this],r;for(let i=0;i<(t??0);i+=e??1){for(let t=0;t<(e??1);t++)r=(r??this).dbl();n.push(r)}return{step:e??1,points:n}}_getNAFPoints(e){if(typeof this.precomputed==`object`&&this.precomputed!==null&&typeof this.precomputed.naf==`object`&&this.precomputed.naf!==null)return this.precomputed.naf;let t=[this],n=(1<<e)-1,r=n===1?null:this.dbl();for(let e=1;e<n;e++)r!==null&&(t[e]=t[e-1].add(r));return{wnd:e,points:t}}},lr=class e extends cr{static fromPrivateKey(t){let n=new Dn().g.mul(t);return new e(n.x,n.y)}static fromString(t){let n=cr.fromString(t);return new e(n.x,n.y)}static fromDER(t){let n=cr.fromDER(t);return new e(n.x,n.y)}constructor(e,t=null,n=!0){if(e instanceof cr)super(e.getX(),e.getY());else{if(t===null&&n&&typeof e==`string`&&(e.length===66||e.length===130))throw Error(`You are using the "new PublicKey()" constructor with a DER hex string. You need to use "PublicKey.fromString()" instead.`);super(e,t,n)}}deriveSharedSecret(e){if(!this.validate())throw Error(`Public key not valid for ECDH secret derivation`);return this.mulCT(e)}verify(e,t,n){return Sr(new p(Ze(e,n),16),t,this)}toDER(e){return e===`hex`?this.encode(!0,e):this.encode(!0)}toHash(e){let t=$e(this.encode(!0));return e===`hex`?E(t):t}toAddress(e=[0]){if(typeof e==`string`){if(e===`testnet`||e===`test`)e=[111];else if(e===`mainnet`||e===`main`)e=[0];else throw Error(`Invalid prefix ${e}`)}return hn(this.toHash(),e)}deriveChild(t,n,r,i){let a;if(typeof i==`function`){let e=i(t,this);e===void 0?(a=this.deriveSharedSecret(t),typeof r==`function`&&r(t,this,a)):a=e}else a=this.deriveSharedSecret(t);let o=tn(n,`utf8`),s=et(a.encode(!0),o),c=new Dn().g.mul(new p(s)),l=this.add(c);return new e(l.x,l.y)}static fromMsgHashAndCompactSignature(e,t,n){let r=tn(t,n);if(r.length!==65)throw Error(`Invalid Compact Signature`);let i=r[0];if(i<27||i>=35)throw Error(`Invalid Compact Byte`);let a=r[0]-27;return a>3&&(a-=4),new ur(new p(r.slice(1,33)),new p(r.slice(33,65))).RecoverPublicKey(a,e)}},ur=class e{r;s;static fromDER(t,n){let r=(e,t)=>{let n=e[t.place++];if(n&128)throw Error(`Invalid DER entity length`);return n};class i{place=0}t=tn(t,n);let a=new i;if(t[a.place++]!==48)throw Error(`Signature DER must start with 0x30`);if(r(t,a)+a.place!==t.length||t[a.place++]!==2)throw Error(`Signature DER invalid`);let o=r(t,a),s=t.slice(a.place,o+a.place);if(a.place+=o,t[a.place++]!==2)throw Error(`Signature DER invalid`);let c=r(t,a);if(t.length!==c+a.place)throw Error(`Invalid R-length in signature DER`);let l=t.slice(a.place,c+a.place);if(s[0]===0){if(s[1]&128)s=s.slice(1);else throw Error(`Invalid R-value in signature DER`)}if(l[0]===0){if(l[1]&128)l=l.slice(1);else throw Error(`Invalid S-value in signature DER`)}return new e(new p(s),new p(l))}static fromCompact(t,n){if(t=tn(t,n),t.length!==65)throw Error(`Invalid Compact Signature`);let r=t[0];if(r<27||r>=35)throw Error(`Invalid Compact Byte`);return new e(new p(t.slice(1,33)),new p(t.slice(33,65)))}constructor(e,t){this.r=e,this.s=t}verify(e,t,n){return Sr(new p(Ze(e,n),16),this,t)}toString(e){return this.toDER(e)}toDER(e){let t=(e,t)=>{if(t<128)e.push(t);else throw Error(`len must be < 0x80`)},n=e=>{let t=0,n=e.length-1;for(;e[t]===0&&!(e[t+1]&128)&&t<n;)t++;return t===0?e:e.slice(t)},r=this.r.toArray(),i=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),i[0]&128&&(i=[0].concat(i)),r=n(r),i=n(i);i[0]===0&&!(i[1]&128);)i=i.slice(1);let a=[2];t(a,r.length),a=a.concat(r),a.push(2),t(a,i.length);let o=a.concat(i),s=[48];return t(s,o.length),s=s.concat(o),e===`hex`?E(s):e===`base64`?dn(s):s}toCompact(e,t,n){if(e<0||e>3)throw Error(`Invalid recovery param`);if(typeof t!=`boolean`)throw TypeError(`Invalid compressed param`);let r=27+e;t&&(r+=4);let i=[r];return i=i.concat(this.r.toArray(`be`,32)),i=i.concat(this.s.toArray(`be`,32)),n===`hex`?E(i):n===`base64`?dn(i):i}RecoverPublicKey(e,t){let n=this.r,r=this.s,i=!!(e&1),a=e>>1,o=new Dn,s=o.n,c=o.g,l=a===0?n:n.add(s),u=cr.fromX(l,i);if(!u.mul(s).isInfinity())throw Error(`nR is not at infinity`);let d=t.neg().umod(s),f=n.invm(s),p=f.mul(r).umod(s),m=f.mul(d).umod(s),h=new lr(c.mul(m).add(u.mul(p)));return h.validate(),h}CalculateRecoveryFactor(e,t){for(let n=0;n<4;n++){let r;try{r=this.RecoverPublicKey(n,t)}catch{continue}if(e.eq(r))return n}throw Error(`Unable to find valid recovery factor`)}},dr=class{K;V;constructor(e,t){let n=tn(e,`hex`),r=tn(t,`hex`);if(n.length!==32)throw Error(`Entropy must be exactly 32 bytes (256 bits)`);if(r.length!==32)throw Error(`Nonce must be exactly 32 bytes (256 bits)`);let i=n.concat(r);this.K=Array.from({length:32}),this.V=Array.from({length:32});for(let e=0;e<32;e++)this.K[e]=0,this.V[e]=1;this.update(i)}hmac(){return new Ge(this.K)}update(e){let t=this.hmac().update(this.V).update([0]);e!==void 0&&(t=t.update(e)),this.K=t.digest(),this.V=this.hmac().update(this.V).digest(),e!==void 0&&(this.K=this.hmac().update(this.V).update([1]).update(e).digest(),this.V=this.hmac().update(this.V).digest())}generate(e){let t=[];for(;t.length<e;)this.V=this.hmac().update(this.V).digest(),t=t.concat(this.V);let n=t.slice(0,e);return this.update(),E(n)}};function fr(e,t,n=new Dn){let r=e.byteLength()*8-n.n.bitLength();return r>0&&e.iushrn(r),t!==!0&&e.cmp(n.n)>=0?e.sub(n.n):e}function pr(e){let t=e.toArray(`be`),n=0n;for(let e of t)n=n<<8n|BigInt(e);return n}var mr=new Dn,hr=mr.n.byteLength(),gr=mr.n.subn(1),_r=Rn>>1n;function vr(e,t,n){let r;if(r=typeof e==`function`?e(t):e!==void 0&&p.isBN(e)?e:new p(n.generate(hr),16),r==null)throw Error(`k is undefined`);return fr(r,!0)}function yr(e,t){if(e)throw Error(t)}function br(e,t,n,r,i){if(e.cmpn(1)<0||e.cmp(gr)>0)return yr(i,`Invalid fixed custom K value (must be >1 and <N-1)`);let a=mr.g.mulCT(e);if(a.isInfinity())return yr(i,`Invalid fixed custom K value (k·G at infinity)`);let o=ar(BigInt(`0x`+a.getX().toString(16)));if(o===0n)return yr(i,`Invalid fixed custom K value (r == 0)`);let s=or(sr(BigInt(`0x`+e.toString(16))),ar(t+or(o,n)));return s===0n?yr(i,`Invalid fixed custom K value (s == 0)`):(r&&s>_r&&(s=Rn-s),new ur(new p(o.toString(16),16),new p(s.toString(16),16)))}var xr=(e,t,n=!1,r)=>{let i=mr.n.bitLength();if(e.bitLength()>i)throw Error(`ECDSA message is too large: expected <= ${i} bits. Callers must hash messages before signing.`);e=fr(e);let a=pr(e),o=pr(t),s=new dr(t.toArray(`be`,hr),e.toArray(`be`,hr)),c=p.isBN(r);for(let e=0;;e++){let t=br(vr(r,e,s),a,o,n,c);if(t!=null)return t}},Sr=(e,t,n)=>{let r=mr.n.bitLength();if(e.bitLength()>r)return!1;let i=pr(e);if(n.x==null||n.y==null)throw Error(`Invalid public key: missing coordinates.`);let a={x:pr(n.x),y:pr(n.y)},{r:o,s}={r:pr(t.r),s:pr(t.s)},c=i;if(o<=0n||o>=115792089237316195423570985008687907852837564279074904382605163141518161494337n||s<=0n||s>=115792089237316195423570985008687907852837564279074904382605163141518161494337n)return!1;let l=sr(s);if(l===0n)return!1;let u=or(c,l),d=or(o,l),f=er(ir(u,{x:Xn,y:Zn}),ir(d,a));if(f.Z===0n)return!1;let p=Wn(f.Z),m=O(p,p);return ar(O(f.X,m))===o},Cr=class{_rand;getRandomValues(e,t){let n=new Uint8Array(t);return e.crypto.getRandomValues(n),Array.from(n)}constructor(){let e=()=>{throw Error(`No secure random number generator is available in this environment.`)};if(this._rand=e,typeof globalThis<`u`&&typeof globalThis.crypto?.getRandomValues==`function`){this._rand=e=>this.getRandomValues(globalThis,e);return}if(globalThis.self!==void 0&&typeof globalThis.self.crypto?.getRandomValues==`function`){this._rand=e=>this.getRandomValues(globalThis.self,e);return}if(globalThis.window!==void 0&&typeof globalThis.window.crypto?.getRandomValues==`function`){this._rand=e=>this.getRandomValues(globalThis.window,e);return}if(typeof process<`u`&&typeof process.getBuiltinModule==`function`){let e=process.getBuiltinModule(`node:crypto`);if(typeof e?.randomBytes==`function`){this._rand=t=>Array.from(e.randomBytes(t));return}}this._rand=e}generate(e){return this._rand(e)}},wr=null,Tr=e=>(wr??=new Cr,wr.generate(e)),Er=class e{x;y;constructor(e,t){let n=new Dn().p;this.x=e.umod(n),this.y=t.umod(n)}toString(){return mn(this.x.toArray())+`.`+mn(this.y.toArray())}static fromString(t){let[n,r]=t.split(`.`);return new e(new p(pn(n)),new p(pn(r)))}},Dr=class e{points;threshold;constructor(e,t){this.points=e,this.threshold=t??e.length}static fromPrivateKey(t,n){let r=new Dn().p,i=[new Er(new p(0),new p(t.toArray()))];for(let e=1;e<n;e++){let e=new p(Tr(32)).umod(r),t=new p(Tr(32)).umod(r);i.push(new Er(e,t))}return new e(i)}valueAt(e){let t=new Dn().p,n=new p(0);for(let r=0;r<this.threshold;r++){let i=this.points[r].y;for(let n=0;n<this.threshold;n++)if(r!==n){let a=this.points[n].x,o=this.points[r].x,s=e.sub(a).umod(t),c=o.sub(a).umod(t).invm(t),l=s.mul(c).umod(t);i=i.mul(l).umod(t)}n=n.add(i).umod(t)}return n}},Or=class e{points;threshold;integrity;constructor(e,t,n){this.points=e,this.threshold=t,this.integrity=n}static fromBackupFormat(t){let n=0,r=``,i=t.map((e,t)=>{let i=e.split(`.`);if(i.length!==4)throw Error(`Invalid share format in share `+t.toString()+`. Expected format: "x.y.t.i" - received `+e);let[a,o,s,c]=i;if(s===void 0)throw Error(`Threshold not found in share `+t.toString());if(c===void 0)throw Error(`Integrity not found in share `+t.toString());let l=Number.parseInt(s,10);if(t!==0&&n!==l)throw Error(`Threshold mismatch in share `+t.toString());if(t!==0&&r!==c)throw Error(`Integrity mismatch in share `+t.toString());return n=l,r=c,Er.fromString([a,o].join(`.`))});return new e(i,n,r)}toBackupFormat(){return this.points.map(e=>e.toString()+`.`+this.threshold.toString()+`.`+this.integrity)}},kr=class e extends p{static fromRandom(){return new e(Tr(32))}static fromString(t,n=`hex`){return new e(super.fromString(t,n).toArray())}static fromHex(t){return new e(super.fromHex(t,`big`))}static fromWif(t,n=1){let r=gn(t,void 0,n);if(r.data.length!==33)throw Error(`Invalid WIF length`);if(r.data[32]!==1)throw Error(`Invalid WIF padding`);return new e(r.data.slice(0,32))}constructor(e=0,t=10,n=`be`,r=`apply`){if(e instanceof p?(super(),e.copy(this)):super(e,t,n),r!==`nocheck`){let e=this.checkInField();if(!e.inField){if(r===`error`)throw Error(`Input is out of field`);p.move(this,e.modN)}}}checkInField(){let e=new Dn,t=this.mod(e.n);return{inField:this.cmp(t)===0,modN:t}}isValid(){return this.checkInField().inField}sign(e,t,n=!0,r){return xr(new p(Ze(e,t),16),this,n,r)}verify(e,t,n){return Sr(new p(Ze(e,n),16),t,this.toPublicKey())}toPublicKey(){let e=new Dn().g.mulCT(this);return new lr(e.x,e.y)}toWif(e=[128]){if(!this.isValid())throw Error(`Value is out of field`);return hn([...this.toArray(`be`,32),1],e)}toAddress(e=[0]){return this.toPublicKey().toAddress(e)}toHex(){return super.toHex(32)}toString(e=`hex`,t=64){return super.toString(e,t)}deriveSharedSecret(e){if(!e.validate())throw Error(`Public key not valid for ECDH secret derivation`);return e.mulCT(this)}deriveChild(t,n,r,i){let a;if(typeof i==`function`){let e=i(this,t);e===void 0?(a=this.deriveSharedSecret(t),typeof r==`function`&&r(this,t,a)):a=e}else a=this.deriveSharedSecret(t);let o=tn(n,`utf8`),s=et(a.encode(!0),o),c=new Dn;return new e(this.add(new p(s)).mod(c.n).toArray())}toKeyShares(e,t){if(typeof e!=`number`||typeof t!=`number`)throw TypeError(`threshold and totalShares must be numbers`);if(e<2)throw Error(`threshold must be at least 2`);if(t<2)throw Error(`totalShares must be at least 2`);if(e>t)throw Error(`threshold should be less than or equal to totalShares`);let n=Dr.fromPrivateKey(this,e),r=[],i=new Set,a=new Dn,o=Tr(64);for(let e=0;e<t;e++){let t,s=0;do if(t=new p(tt(o,[e,s,...Tr(32)])).umod(a.p),s++,s>5)throw Error(`Failed to generate unique x coordinate after 5 attempts`);while(t.isZero()||i.has(t.toString()));i.add(t.toString());let c=n.valueAt(t);r.push(new Er(t,c))}return new Or(r,e,this.toPublicKey().toHash(`hex`).slice(0,8))}toBackupShares(e,t){return this.toKeyShares(e,t).toBackupFormat()}static fromBackupShares(t){return e.fromKeyShares(Or.fromBackupFormat(t))}static fromKeyShares(t){let{points:n,threshold:r,integrity:i}=t;if(r<2)throw Error(`threshold must be at least 2`);if(n.length<r)throw Error(`At least ${r} shares are required to reconstruct the private key`);for(let e=0;e<r;e++)for(let t=e+1;t<r;t++)if(n[e].x.eq(n[t].x))throw Error(`Duplicate share detected, each must be unique.`);let a=new Dr(n,r),o=new e(a.valueAt(new p(0)).toArray());if(o.toPublicKey().toHash(`hex`).slice(0,8)!==i)throw Error(`Integrity hash mismatch`);return o}},Ar={OP_0:0,OP_FALSE:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_1:81,OP_TRUE:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SPLIT:127,OP_NUM2BIN:128,OP_BIN2NUM:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_NOP1:176,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP2:177,OP_CHECKSEQUENCEVERIFY:178,OP_NOP3:178,OP_SUBSTR:179,OP_NOP4:179,OP_LEFT:180,OP_NOP5:180,OP_RIGHT:181,OP_NOP6:181,OP_LSHIFTNUM:182,OP_NOP7:182,OP_RSHIFTNUM:183,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_NOP11:186,OP_NOP12:187,OP_NOP13:188,OP_NOP14:189,OP_NOP15:190,OP_NOP16:191,OP_NOP17:192,OP_NOP18:193,OP_NOP19:194,OP_NOP20:195,OP_NOP21:196,OP_NOP22:197,OP_NOP23:198,OP_NOP24:199,OP_NOP25:200,OP_NOP26:201,OP_NOP27:202,OP_NOP28:203,OP_NOP29:204,OP_NOP30:205,OP_NOP31:206,OP_NOP32:207,OP_NOP33:208,OP_NOP34:209,OP_NOP35:210,OP_NOP36:211,OP_NOP37:212,OP_NOP38:213,OP_NOP39:214,OP_NOP40:215,OP_NOP41:216,OP_NOP42:217,OP_NOP43:218,OP_NOP44:219,OP_NOP45:220,OP_NOP46:221,OP_NOP47:222,OP_NOP48:223,OP_NOP49:224,OP_NOP50:225,OP_NOP51:226,OP_NOP52:227,OP_NOP53:228,OP_NOP54:229,OP_NOP55:230,OP_NOP56:231,OP_NOP57:232,OP_NOP58:233,OP_NOP59:234,OP_NOP60:235,OP_NOP61:236,OP_NOP62:237,OP_NOP63:238,OP_NOP64:239,OP_NOP65:240,OP_NOP66:241,OP_NOP67:242,OP_NOP68:243,OP_NOP69:244,OP_NOP70:245,OP_NOP71:246,OP_NOP72:247,OP_NOP73:248,OP_NOP77:252,OP_SMALLDATA:249,OP_SMALLINTEGER:250,OP_PUBKEYS:251,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255},k=Ar;for(let e of Object.keys(Ar)){let t=Ar[e];k[t]??=e}var jr=typeof globalThis>`u`?void 0:globalThis.Buffer;function Mr(e){let t=e.data?.length??0;if(t===0||e.op===k.OP_RETURN||e.op<k.OP_PUSHDATA1)return[e.op];if(e.op===k.OP_PUSHDATA1)return[e.op,t&255];if(e.op===k.OP_PUSHDATA2)return[e.op,t&255,t>>8&255];if(e.op===k.OP_PUSHDATA4){let n=t>>>0;return[e.op,n&255,n>>8&255,n>>16&255,n>>24&255]}}function Nr(e,t){let n=Mr(e),r=e.data??[];if(n==null||t.length!==n.length+r.length)return!1;for(let e=0;e<n.length;e++)if(t[e]!==n[e])return!1;for(let e=0;e<r.length;e++)if(t[n.length+e]!==r[e])return!1;return!0}var Pr=class e{_chunks;parsed;rawBytesCache;hexCache;static fromASM(t){let n=[],r=t.split(` `),i=0;for(;i<r.length;){let{chunk:t,advance:a}=e.parseASMToken(r,i);n.push(t),i+=a}return new e(n)}static pushdataOpCodeNum(e){return e>=0&&e<k.OP_PUSHDATA1?e:e<256?k.OP_PUSHDATA1:e<2**16?k.OP_PUSHDATA2:k.OP_PUSHDATA4}static parseASMToken(t,n){let r=t[n];if(r===`0`)return{chunk:{op:0},advance:1};if(r===`-1`)return{chunk:{op:k.OP_1NEGATE},advance:1};let i=r.startsWith(`OP_`)&&k[r]!==void 0,a=i?k[r]:0;if(a===k.OP_PUSHDATA1||a===k.OP_PUSHDATA2||a===k.OP_PUSHDATA4)return{chunk:{data:tn(t[n+2],`hex`),op:a},advance:3};if(!i){let t=r;t.length%2!=0&&(t=`0`+t);let n=tn(t,`hex`);if(un(n,`hex`)!==t)throw Error(`invalid hex string in script`);return{chunk:{data:n,op:e.pushdataOpCodeNum(n.length)},advance:1}}return{chunk:{op:a},advance:1}}static fromHex(t){if(t.length===0)return e.fromBinary([]);if(t.length%2!=0)throw Error(`There is an uneven number of characters in the string which suggests it is not hex encoded.`);if(!/^[0-9a-fA-F]+$/.test(t))throw Error(`Some elements in this string are not hex encoded.`);let n=D(t);return new e([],n,t.toLowerCase(),!1)}static fromBinary(t){let n=Uint8Array.from(t);return new e([],n,void 0,!1)}static fromBinaryView(t){return new e([],t,void 0,!1)}constructor(e=[],t,n,r=!0){this._chunks=e,this.parsed=r,this.rawBytesCache=t,this.hexCache=n}get chunks(){return this.ensureParsed(),this._chunks}set chunks(e){this._chunks=e,this.parsed=!0,this.invalidateSerializationCaches()}ensureParsed(){this.parsed||=(this._chunks=this.rawBytesCache==null?[]:e.parseChunks(this.rawBytesCache),!0)}toASM(){let e=``;for(let t of this.chunks)e+=this._chunkToString(t);return e.slice(1)}toHex(){if(this.hexCache!=null)return this.hexCache;this.rawBytesCache??=this.serializeChunksToBytes();let e=jr==null?un(Array.from(this.rawBytesCache),`hex`):jr.from(this.rawBytesCache).toString(`hex`);return this.hexCache=e,e}toBinary(){return Array.from(this.toUint8Array())}toUint8Array(){return this.rawBytesCache??=this.serializeChunksToBytes(),this.rawBytesCache}writeScript(e){return this.invalidateSerializationCaches(),this.chunks=this.chunks.concat(e.chunks),this}writeOpCode(e){return this.invalidateSerializationCaches(),this.chunks.push({op:e}),this}setChunkOpCode(e,t){return this.invalidateSerializationCaches(),this.chunks[e]={op:t},this}writeBn(e){if(this.invalidateSerializationCaches(),e.cmpn(0)===k.OP_0)this.chunks.push({op:k.OP_0});else if(e.cmpn(-1)===0)this.chunks.push({op:k.OP_1NEGATE});else if(e.cmpn(1)>=0&&e.cmpn(16)<=0)this.chunks.push({op:e.toNumber()+k.OP_1-1});else{let t=e.toSm(`little`);this.writeBin(t)}return this}writeBin(e){this.invalidateSerializationCaches();let t,n=e.length>0?e:void 0;if(e.length>0&&e.length<k.OP_PUSHDATA1)t=e.length;else if(e.length===0)t=k.OP_0;else if(e.length<256)t=k.OP_PUSHDATA1;else if(e.length<2**16)t=k.OP_PUSHDATA2;else if(e.length<2**32)t=k.OP_PUSHDATA4;else throw Error(`You can't push that much data`);return this.chunks.push({data:n,op:t}),this}writeNumber(e){return this.invalidateSerializationCaches(),this.writeBn(new p(e)),this}removeCodeseparators(){let t=this.toUint8Array();return this.rawBytesCache=Uint8Array.from(e.removeOpcodeBytes(t,k.OP_CODESEPARATOR)),this.hexCache=void 0,this._chunks=[],this.parsed=!1,this}findAndDelete(e){this.invalidateSerializationCaches();let t=e.toUint8Array();if(t.length===0)return this;for(let e=0;e<this.chunks.length;)Nr(this.chunks[e],t)?this.chunks.splice(e,1):e++;return this}isPushOnly(){for(let e of this.chunks)if(e.op>k.OP_16)return!1;return!0}isLockingScript(){throw Error(`Not implemented`)}isUnlockingScript(){throw Error(`Not implemented`)}static computeSerializedLength(e){let t=0;for(let n of e){if(t+=1,n.data==null)continue;let e=n.data.length;if(n.op===k.OP_RETURN){t+=e;break}n.op<k.OP_PUSHDATA1?t+=e:n.op===k.OP_PUSHDATA1?t+=1+e:n.op===k.OP_PUSHDATA2?t+=2+e:n.op===k.OP_PUSHDATA4&&(t+=4+e)}return t}serializeChunksToBytes(){let t=this.chunks,n=e.computeSerializedLength(t),r=new Uint8Array(n),i=0;for(let n of t)if(r[i++]=n.op,n.data!=null){if(n.op===k.OP_RETURN){r.set(n.data,i);break}i=e.writeChunkData(r,i,n.op,n.data)}return r}invalidateSerializationCaches(){this.rawBytesCache=void 0,this.hexCache=void 0}static writeChunkData(e,t,n,r){let i=r.length;if(n<k.OP_PUSHDATA1)return e.set(r,t),t+i;if(n===k.OP_PUSHDATA1)return e[t++]=i&255,e.set(r,t),t+i;if(n===k.OP_PUSHDATA2)return e[t++]=i&255,e[t++]=i>>8&255,e.set(r,t),t+i;if(n===k.OP_PUSHDATA4){let n=i>>>0;return e[t++]=n&255,e[t++]=n>>8&255,e[t++]=n>>16&255,e[t++]=n>>24&255,e.set(r,t),t+i}return t}static readPushdataLength(e,t,n,r){if(e>0&&e<k.OP_PUSHDATA1)return{len:e,newPos:n,hasLength:!0};if(e===k.OP_PUSHDATA1){let e=n<r;return{len:e?t[n++]??0:0,newPos:n,hasLength:e}}if(e===k.OP_PUSHDATA2){let e=n+1<r;return{len:(t[n]??0)|(t[n+1]??0)<<8,newPos:Math.min(n+2,r),hasLength:e}}let i=n+3<r;return{len:((t[n]??0)|(t[n+1]??0)<<8|(t[n+2]??0)<<16|(t[n+3]??0)<<24)>>>0,newPos:Math.min(n+4,r),hasLength:i}}static parseChunks(t){let n=[],r=t.length,i=0,a=0;for(;i<r;){let o=t[i++]??0;if(o===k.OP_RETURN&&a===0){n.push({op:o,data:e.copyRange(t,i,r)});break}if(o===k.OP_IF||o===k.OP_NOTIF||o===k.OP_VERIF||o===k.OP_VERNOTIF?a++:o===k.OP_ENDIF&&a--,o>0&&o<=k.OP_PUSHDATA4){let{len:a,newPos:s,hasLength:c}=e.readPushdataLength(o,t,i,r);i=s;let l=Math.min(i+a,r),u=!c||l-i!==a;n.push({data:e.copyRange(t,i,l),op:o,invalidLength:u}),i=l}else n.push({op:o})}return n}static removeOpcodeBytes(t,n){let r=[],i=t.length,a=0;for(;a<i;){let o=a,s=t[a++]??0;if(s>0&&s<=k.OP_PUSHDATA4){let{len:c,newPos:l}=e.readPushdataLength(s,t,a,i);a=l;let u=Math.min(a+c,i);if(s!==n)for(let e=o;e<u;e++)r.push(t[e]??0);a=u}else s!==n&&r.push(s)}return r}static copyRange(e,t,n){let r=Math.max(n-t,0),i=Array.from({length:r},()=>0);for(let n=0;n<r;n++)i[n]=e[t+n]??0;return i}_chunkToString(e){let t=e.op,n=``;if(e.data===void 0){let e=k[t];n=`${n} ${e}`}else n=`${n} ${E(e.data)}`;return n}},Fr=new Uint8Array,Ir=Object.freeze(Array.from({length:32},()=>0));function Lr(e,t){if(e.allInputs!=null)return e.allInputs;let n=[...e.otherInputs];return n.splice(e.inputIndex,0,t),n}function Rr(e,t,n,r){return r===t?n:e[r]}function zr(e,t,n){let r=new _n;for(let i=0;i<e.length;i++){let a=Rr(e,t,n,i);if(a.sourceTXID==null){if(a.sourceTransaction==null)throw Error(`Missing sourceTransaction for input`);r.write(a.sourceTransaction.hash())}else r.writeReverse(tn(a.sourceTXID,`hex`));r.writeUInt32LE(a.sourceOutputIndex)}return Qe(r.toUint8Array())}function Br(e,t,n){let r=new _n;for(let i=0;i<e.length;i++){let a=Rr(e,t,n,i);r.writeUInt32LE(a.sequence??4294967295)}return Qe(r.toUint8Array())}function Vr(e,t){e.writeUInt64LE(t.satoshis??0);let n=t.lockingScript?.toUint8Array()??Fr;e.writeVarIntNum(n.length),e.write(n)}function Hr(e,t){let n=new _n;if(t==null)for(let t of e)Vr(n,t);else{let r=e[t];if(r==null)throw Error(`Output at index ${t} does not exist`);Vr(n,r)}return Qe(n.toUint8Array())}function Ur(e,t,n){if((e.scope&Kr.SIGHASH_ANYONECANPAY)!==0)return[...Ir];if(e.cache?.hashPrevouts!=null)return e.cache.hashPrevouts;let r=zr(t,e.inputIndex,n);return e.cache!=null&&(e.cache.hashPrevouts=r),r}function Wr(e,t,n){let r=e.scope&31;if((e.scope&Kr.SIGHASH_ANYONECANPAY)!==0||r===Kr.SIGHASH_SINGLE||r===Kr.SIGHASH_NONE)return[...Ir];if(e.cache?.hashSequence!=null)return e.cache.hashSequence;let i=Br(t,e.inputIndex,n);return e.cache!=null&&(e.cache.hashSequence=i),i}function Gr(e){let t=e.scope&31;if(t!==Kr.SIGHASH_SINGLE&&t!==Kr.SIGHASH_NONE){if(e.cache?.hashOutputsAll!=null)return e.cache.hashOutputsAll;let t=Hr(e.outputs);return e.cache!=null&&(e.cache.hashOutputsAll=t),t}if(t!==Kr.SIGHASH_SINGLE||e.inputIndex>=e.outputs.length)return[...Ir];let n=e.cache?.hashOutputsSingle?.get(e.inputIndex);if(n!=null)return n;let r=Hr(e.outputs,e.inputIndex);return e.cache!=null&&(e.cache.hashOutputsSingle??=new Map,e.cache.hashOutputsSingle.set(e.inputIndex,r)),r}var Kr=class e extends ur{static SIGHASH_ALL=1;static SIGHASH_NONE=2;static SIGHASH_SINGLE=3;static SIGHASH_CHRONICLE=32;static SIGHASH_FORKID=64;static SIGHASH_ANYONECANPAY=128;scope;static formatOTDA(t){let n=(t.scope&e.SIGHASH_ANYONECANPAY)===e.SIGHASH_ANYONECANPAY,r=(t.scope&31)===e.SIGHASH_SINGLE,i=(t.scope&31)===e.SIGHASH_NONE,a=(t.scope&31)===e.SIGHASH_ALL||!r&&!i,o=Pr.fromBinary(t.subscript.toBinary());o.removeCodeseparators();let s={sourceTXID:t.sourceTXID,sourceOutputIndex:t.sourceOutputIndex,sequence:t.inputSequence,script:o.toBinary()},c=new _n;function l(e){c.writeVarIntNum(e.length);for(let t of e)c.writeReverse(tn(t.sourceTXID,`hex`)),c.writeUInt32LE(t.sourceOutputIndex),c.writeVarIntNum(t.script.length),c.write(t.script),c.writeUInt32LE(t.sequence)}function u(e){c.writeVarIntNum(e.length);for(let t of e)c.writeUInt64LE(t.satoshis),c.writeVarIntNum(t.script.length),c.write(t.script)}c.writeInt32LE(t.transactionVersion);let d=new Pr().toBinary();if(n)n&&l([s]);else{let e=t.allInputs==null?t.otherInputs.map(e=>({sourceTXID:e.sourceTXID??e.sourceTransaction?.id(`hex`)??``,sourceOutputIndex:e.sourceOutputIndex,sequence:r||i?0:e.sequence??4294967295,script:d})):t.allInputs.map((e,n)=>n===t.inputIndex?s:{sourceTXID:e.sourceTXID??e.sourceTransaction?.id(`hex`)??``,sourceOutputIndex:e.sourceOutputIndex,sequence:r||i?0:e.sequence??4294967295,script:d});t.allInputs??e.splice(t.inputIndex,0,s),l(e)}if(a)u(t.outputs.map(e=>({satoshis:e.satoshis??0,script:e.lockingScript.toBinary()})));else if(r){let e=[];for(let n=0;n<t.inputIndex;n++)e.push({satoshis:-1,script:d});let n=t.outputs[t.inputIndex];n!==void 0&&e.push({satoshis:n.satoshis??0,script:n.lockingScript.toBinary()}),u(e)}else i&&u([]);return c.writeUInt32LE(t.lockTime),c.writeUInt32LE(t.scope>>>0),c.toUint8Array()}static formatBip143(e){let t={sourceTXID:e.sourceTXID,sourceOutputIndex:e.sourceOutputIndex,sequence:e.inputSequence},n=Lr(e,t),r=Ur(e,n,t),i=Wr(e,n,t),a=Gr(e),o=new _n;o.writeInt32LE(e.transactionVersion),o.write(r),o.write(i),o.writeReverse(tn(e.sourceTXID,`hex`)),o.writeUInt32LE(e.sourceOutputIndex);let s=e.subscript.toUint8Array();o.writeVarIntNum(s.length),o.write(s),o.writeUInt64LE(e.sourceSatoshis);let c=t.sequence??4294967295;return o.writeUInt32LE(c),o.write(a),o.writeUInt32LE(e.lockTime),o.writeUInt32LE(e.scope>>>0),o.toUint8Array()}static format(e){return Array.from(this.formatBytes(e))}static formatBytes(t){let n=(t.scope&e.SIGHASH_FORKID)!==0,r=t.ignoreChronicle!==!0&&(t.scope&e.SIGHASH_CHRONICLE)!==0;return n&&!r?e.formatBip143(t):!n||n&&r?e.formatOTDA(t):new Uint8Array}static usesOtdaSingleBug(t){let n=(t.scope&e.SIGHASH_FORKID)!==0,r=t.ignoreChronicle!==!0&&(t.scope&e.SIGHASH_CHRONICLE)!==0;return(!n||n&&r)&&(t.scope&31)===e.SIGHASH_SINGLE&&t.inputIndex>=t.outputs.length}static fromChecksigFormat(t){if(t.length===0){let t=new p(1),n=new p(1);return new e(t,n,1)}let n=t.at(-1),r=t.slice(0,-1),i=ur.fromDER(r);return new e(i.r,i.s,n)}constructor(e,t,n){super(e,t),this.scope=n}hasLowS(){return!(this.s.ltn(1)||this.s.gt(new p(`7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0`,`hex`)))}toChecksigFormat(){return[...this.toDER(),this.scope]}};function qr(e,t,n){if(!(t instanceof Uint8Array))throw TypeError(`${e} returned a non-byte result`);if(n!==void 0&&t.length!==n)throw Error(`${e} returned ${t.length} bytes; expected ${n}`);return t}function Jr(){return globalThis}function Yr(e){let t=Jr().__bsvSdkAsyncCryptoBackendV1;if(t!==void 0){if(!t.isReady()){t.preload().catch(()=>{});return}return t.supportsCrypto(e)?t:void 0}}var Xr=class extends Pr{isLockingScript(){return!0}isUnlockingScript(){return!1}},Zr=class extends Pr{isLockingScript(){return!1}isUnlockingScript(){return!0}};function Qr(e){return e==null?`null/undef`:e.length===void 0?`INVALID_STACK_ITEM`:E(e)}var $r=class extends Error{txid;outputIndex;context;programCounter;stackState;altStackState;ifStackState;stackMem;altStackMem;constructor(e){let t=e.stackState.map(Qr).join(`, `),n=e.altStackState.map(Qr).join(`, `),r=`Context: ${e.context}, PC: ${e.programCounter}`,i=`Stack: [${t}] (len: ${e.stackState.length}, mem: ${e.stackMem})`,a=`AltStack: [${n}] (len: ${e.altStackState.length}, mem: ${e.altStackMem})`,o=`IfStack: [${e.ifStackState.join(`, `)}]`,s=`Script evaluation error: ${e.message}\nTXID: ${e.txid}, OutputIdx: ${e.outputIndex}\n${r}\n${i}\n${a}\n${o}`;super(s),this.name=this.constructor.name,this.txid=e.txid,this.outputIndex=e.outputIndex,this.context=e.context,this.programCounter=e.programCounter,this.stackState=e.stackState.map(e=>e.slice()),this.altStackState=e.altStackState.map(e=>e.slice()),this.ifStackState=e.ifStackState.slice(),this.stackMem=e.stackMem,this.altStackMem=e.altStackMem}},ei=class extends Error{resource;limit;attempted;constructor(e,t,n){let r={stack:`Stack memory usage`,"alt-stack":`Alt stack memory usage`,"element-size":`Script element allocation`}[e];super(`${r} has exceeded ${t} bytes`),this.resource=e,this.limit=t,this.attempted=n,this.name=`ScriptResourceLimitError`}};function ti(){return globalThis}function ni(){return ti().__bsvSdkScriptVerificationBackendV1}var ri=520,ii=1e4,ai=500,oi=4294967295n,si=1e3,ci=BigInt(2**31-1),li=20,ui=2147483648,di=Object.freeze(new p(-1).toScriptNum()),fi=Object.freeze(Array.from({length:17},(e,t)=>Object.freeze(new p(t).toScriptNum())));function pi(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function mi(e){return new p(+!!e)}function hi(e,t){return mi(e&&t)}function gi(e,t){return mi(e||t)}function _i(e,t){return e.cmp(t)<0?e:t}function vi(e,t){return e.cmp(t)>0?e:t}function yi(e,t=2**53-1){return!(e.length>t||e.length>0&&!(e.at(-1)&127)&&(e.length<=1||!(e.at(-2)&128)))}function bi(e){if(e.length<9||e.length>73||e[0]!==48||e[1]!==e.length-3)return!1;let t=e[2],n=e[3];if(t!==2||n===0||5+n>=e.length)return!1;let r=4+n,i=e[r],a=e[r+1];if(i!==2||a===0||e[4]&128||n>1&&e[4]===0&&!(e[5]&128))return!1;let o=r+2;return!(e[o]&128||a>1&&e[o]===0&&!(e[o+1]&128)||n+a+7!==e.length)}function xi(e){let t=e.data,n=e.op;return Array.isArray(t)?t.length===0?n===k.OP_0:t.length===1&&t[0]>=1&&t[0]<=16?n===k.OP_1+(t[0]-1):t.length===1&&t[0]===129?n===k.OP_1NEGATE:t.length<=75?n===t.length:t.length<=255?n===k.OP_PUSHDATA1:t.length<=65535?n===k.OP_PUSHDATA2:!0:!0}var Si=class{sourceTXID;sourceOutputIndex;sourceSatoshis;lockingScript;transactionVersion;otherInputs;allInputs;outputs;inputIndex;unlockingScript;inputSequence;lockTime;context;programCounter;lastCodeSeparator;stack;altStack;ifStack;elseStack;memoryLimit;hasExplicitMemoryLimit;stackMem;altStackMem;isRelaxedOverride;verifyFlags;executedOpCount;returningFromConditional;sigHashCache;ownsSigHashCache;constructor(e){if(this.sourceTXID=e.sourceTXID,this.sourceOutputIndex=e.sourceOutputIndex,this.sourceSatoshis=e.sourceSatoshis,this.lockingScript=e.lockingScript,this.transactionVersion=e.transactionVersion,this.otherInputs=e.otherInputs,this.allInputs=e.allInputs,this.outputs=e.outputs,this.inputIndex=e.inputIndex,this.unlockingScript=e.unlockingScript,this.inputSequence=e.inputSequence,this.lockTime=e.lockTime,this.hasExplicitMemoryLimit=e.memoryLimit!==void 0,this.memoryLimit=e.memoryLimit??1/0,this.isRelaxedOverride=e.isRelaxed===!0,e.verifyFlags===void 0)this.verifyFlags=void 0;else{let t=Array.isArray(e.verifyFlags)?e.verifyFlags:e.verifyFlags.split(`,`);this.verifyFlags=new Set(t.map(e=>e.trim()).filter(e=>e.length>0))}this.stack=[],this.altStack=[],this.ifStack=[],this.elseStack=[],this.stackMem=0,this.altStackMem=0,this.executedOpCount=0,this.returningFromConditional=!1,this.ownsSigHashCache=e.sigHashCache==null,this.sigHashCache=e.sigHashCache??{hashOutputsSingle:new Map},this.reset()}isRelaxed(){return this.isRelaxedOverride||this.transactionVersion>1}hasExplicitFlags(){return this.verifyFlags!==void 0}hasFlag(e){return this.verifyFlags?.has(e)===!0}isAfterGenesis(){return this.hasExplicitFlags()?this.hasFlag(`GENESIS`)||this.hasFlag(`UTXO_AFTER_GENESIS`)||this.hasFlag(`UTXO_AFTER_CHRONICLE`):this.isRelaxed()}isAfterChronicle(){return this.hasExplicitFlags()?this.hasFlag(`UTXO_AFTER_CHRONICLE`):this.isRelaxed()}shouldEnforceMinimalData(){return this.hasExplicitFlags()?this.hasFlag(`MINIMALDATA`):!this.isRelaxed()}shouldEnforceLowS(){return this.hasExplicitFlags()?this.hasFlag(`LOW_S`):!this.isRelaxed()}shouldEnforceNullDummy(){return this.hasExplicitFlags()?this.hasFlag(`NULLDUMMY`):!this.isRelaxed()}shouldEnforceSigPushOnly(){return this.hasExplicitFlags()?this.hasFlag(`SIGPUSHONLY`):!this.isRelaxed()}shouldEnforceCleanStack(){return this.hasExplicitFlags()?this.hasFlag(`CLEANSTACK`):!this.isRelaxed()}shouldEnforceDerSignatures(){return!this.hasExplicitFlags()||this.hasFlag(`DERSIG`)||this.hasFlag(`STRICTENC`)||this.hasFlag(`LOW_S`)||this.hasFlag(`SIGHASH_FORKID`)}shouldEnforceStrictEncoding(){return!this.hasExplicitFlags()||this.hasFlag(`STRICTENC`)||this.hasFlag(`SIGHASH_FORKID`)}scriptNumMaxSize(){if(this.hasExplicitFlags()&&!this.isAfterGenesis())return 4}maxPushSize(){return this.hasExplicitFlags()&&!this.isAfterGenesis()?ri:1/0}reset(){this.ownsSigHashCache&&(delete this.sigHashCache.hashPrevouts,delete this.sigHashCache.hashSequence,delete this.sigHashCache.hashOutputsAll,this.sigHashCache.hashOutputsSingle?.clear()),this.context=`UnlockingScript`,this.programCounter=0,this.lastCodeSeparator=null,this.stack=[],this.altStack=[],this.ifStack=[],this.elseStack=[],this.stackMem=0,this.altStackMem=0,this.executedOpCount=0,this.returningFromConditional=!1}ensureStackMem(e){if(this.stackMem+e>this.memoryLimit)throw new ei(`stack`,this.memoryLimit,this.stackMem+e)}ensureAltStackMem(e){if(this.altStackMem+e>this.memoryLimit)throw new ei(`alt-stack`,this.memoryLimit,this.altStackMem+e)}pushStack(e){this.ensureStackMem(e.length),this.stack.push(e),this.stackMem+=e.length}pushStackCopy(e){this.ensureStackMem(e.length);let t=e.slice();this.stack.push(t),this.stackMem+=t.length}popStack(){this.stack.length===0&&this.scriptEvaluationError(`Attempted to pop from an empty stack.`);let e=this.stack.pop();return e===void 0?(this.scriptEvaluationError(`Attempted to pop from an empty stack.`),[]):(this.stackMem-=e.length,e)}stackTop(e=-1){return(this.stack.length===0||this.stack.length<Math.abs(e)||e>=0&&e>=this.stack.length)&&this.scriptEvaluationError(`Stack underflow accessing element at index ${e}. Stack length is ${this.stack.length}.`),this.stack[this.stack.length+e]}requireStackItems(e,t){this.stack.length<e&&this.scriptEvaluationError(t)}requireAltStackItems(e,t){this.altStack.length<e&&this.scriptEvaluationError(t)}setStack(e){this.stack=e.map(e=>e.slice()),this.stackMem=this.stack.reduce((e,t)=>e+t.length,0)}clearAltStack(){this.altStack=[],this.altStackMem=0}pushAltStack(e){this.ensureAltStackMem(e.length),this.altStack.push(e),this.altStackMem+=e.length}popAltStack(){this.altStack.length===0&&this.scriptEvaluationError(`Attempted to pop from an empty alt stack.`);let e=this.altStack.pop();return e===void 0?(this.scriptEvaluationError(`Attempted to pop from an empty alt stack.`),[]):(this.altStackMem-=e.length,e)}readScriptNumber(e){try{return p.fromScriptNum(e,this.shouldEnforceMinimalData(),this.scriptNumMaxSize())}catch(e){let t=e instanceof Error?e.message:String(e);this.scriptEvaluationError(t)}return new p(0)}isDefinedHashType(e){let t=e&31;return t>=Kr.SIGHASH_ALL&&t<=Kr.SIGHASH_SINGLE}enforceSignatureHashType(e){this.shouldEnforceStrictEncoding()&&(this.isDefinedHashType(e.scope)||this.scriptEvaluationError(`The signature hash type is invalid.`),(e.scope&Kr.SIGHASH_CHRONICLE)!==0&&!this.isAfterChronicle()&&this.scriptEvaluationError(`The signature hash type is invalid before Chronicle.`))}enforceSignatureForkId(e){if(!this.hasExplicitFlags())return;let t=(e.scope&Kr.SIGHASH_FORKID)!==0;this.hasFlag(`SIGHASH_FORKID`)&&!t&&this.scriptEvaluationError(`The signature must use SIGHASH_FORKID.`),!this.hasFlag(`SIGHASH_FORKID`)&&!this.isAfterGenesis()&&t&&this.scriptEvaluationError(`The signature must not use SIGHASH_FORKID.`)}checkSignatureEncoding(e){if(e.length===0)return!0;let t=this.shouldEnforceDerSignatures();if(t&&!bi(e))return this.scriptEvaluationError(`The signature format is invalid.`),!1;try{let t=Kr.fromChecksigFormat(e);if(this.enforceSignatureHashType(t),this.enforceSignatureForkId(t),this.shouldEnforceLowS()&&!t.hasLowS())return this.scriptEvaluationError(`The signature must have a low S value.`),!1}catch{if(t)return this.scriptEvaluationError(`The signature format is invalid.`),!1}return!0}parseChecksigSignature(e){try{return Kr.fromChecksigFormat(e)}catch(t){if(this.shouldEnforceDerSignatures())throw t;return this.parseLaxChecksigSignature(e)}}readLaxDERLength(e,t){let n=e[t.value++];if(n===void 0)throw Error(`Invalid DER length`);if(!(n&128))return n;let r=n&127;if(r===0||t.value+r>e.length)throw Error(`Invalid DER length`);let i=0;for(let n=0;n<r;n++)i=i<<8|(e[t.value++]??0);return i}parseLaxDERInteger(e,t,n){if(t.value>=n||e[t.value++]!==2)throw Error(`Invalid DER integer`);let r=this.readLaxDERLength(e,t);if(t.value+r>n)throw Error(`Invalid DER integer length`);let i=e.slice(t.value,t.value+r);for(t.value+=r;i.length>1&&i[0]===0;)i=i.slice(1);return i.length===0&&(i=[0]),new p(i)}parseLaxChecksigSignature(e){if(e.length===0)return Kr.fromChecksigFormat(e);let t=e.at(-1),n=e.slice(0,-1),r={value:0};if(n[r.value++]!==48)throw Error(`Signature DER must start with 0x30`);let i=this.readLaxDERLength(n,r),a=Math.min(r.value+i,n.length);return new Kr(this.parseLaxDERInteger(n,r,a),this.parseLaxDERInteger(n,r,a),t)}checkPublicKeyEncoding(e){if(!this.shouldEnforceStrictEncoding())return!0;if(e.length===0)return this.scriptEvaluationError(`Public key is empty.`),!1;if(e.length<33)return this.scriptEvaluationError(`The public key is too short, it must be at least 33 bytes.`),!1;if(e[0]===4){if(e.length!==65)return this.scriptEvaluationError(`The non-compressed public key must be 65 bytes.`),!1}else if(e[0]===2||e[0]===3){if(e.length!==33)return this.scriptEvaluationError(`The compressed public key must be 33 bytes.`),!1}else return this.scriptEvaluationError(`The public key is in an unknown format.`),!1;try{lr.fromDER(e)}catch{return this.scriptEvaluationError(`The public key is in an unknown format.`),!1}return!0}verifySignature(e,t,n){let r={sourceTXID:this.sourceTXID,sourceOutputIndex:this.sourceOutputIndex,sourceSatoshis:this.sourceSatoshis,transactionVersion:this.transactionVersion,otherInputs:this.otherInputs,allInputs:this.allInputs,outputs:this.outputs,inputIndex:this.inputIndex,subscript:n,inputSequence:this.inputSequence,lockTime:this.lockTime,scope:e.scope,cache:this.sigHashCache};return Sr(Kr.usesOtdaSingleBug(r)?new p([1,...Array.from({length:31},()=>0)]):new p(Qe(Kr.formatBytes(r))),e,t)}enforceStepResourceLimits(){if(this.stackMem>this.memoryLimit)throw new ei(`stack`,this.memoryLimit,this.stackMem);if(this.altStackMem>this.memoryLimit)throw new ei(`alt-stack`,this.memoryLimit,this.altStackMem)}currentScriptForStep(){return this.context===`UnlockingScript`&&this.programCounter>=this.unlockingScript.chunks.length&&(this.ifStack.length>0&&this.scriptEvaluationError(`Every OP_IF, OP_NOTIF, or OP_ELSE must be terminated with OP_ENDIF prior to the end of the unlocking script.`),this.clearAltStack(),this.ifStack=[],this.elseStack=[],this.returningFromConditional=!1,this.lastCodeSeparator=null,this.context=`LockingScript`,this.programCounter=0),this.context===`UnlockingScript`?this.unlockingScript:this.lockingScript}opcodeForOperation(e){let t=e.op;return t===void 0?(this.scriptEvaluationError(`Missing opcode in ${this.context} at pc=${this.programCounter}.`),0):(e.invalidLength===!0&&this.scriptEvaluationError(`Malformed push data in ${this.context} at pc=${this.programCounter}.`),Array.isArray(e.data)&&e.data.length>this.maxPushSize()&&this.scriptEvaluationError(`Data push > ${this.maxPushSize()} bytes (pc=${this.programCounter}).`),t)}enforceChronicleOnlyOpcode(e){this.hasExplicitFlags()&&!this.isAfterGenesis()&&!this.isAfterChronicle()&&(e===k.OP_2MUL||e===k.OP_2DIV||e===k.OP_VERIF||e===k.OP_VERNOTIF)&&this.scriptEvaluationError(`${k[e]} is disabled until Chronicle.`)}executeDataPush(e){this.shouldEnforceMinimalData()&&!xi(e)&&this.scriptEvaluationError(`This data is not minimally-encoded. (PC: ${this.programCounter})`),this.pushStack(Array.isArray(e.data)?e.data:[])}countExecutedOpcode(e,t){!t||e<=k.OP_16||(this.executedOpCount++,this.hasExplicitFlags()&&!this.isAfterGenesis()&&this.executedOpCount>ai&&this.scriptEvaluationError(`Script executed more than ${ai} opcodes.`))}skipUnavailablePreChronicleOpcode(e,t){return!this.hasExplicitFlags()||this.isAfterChronicle()?!1:t&&(e===k.OP_SUBSTR||e===k.OP_LEFT||e===k.OP_RIGHT||e===k.OP_LSHIFTNUM||e===k.OP_RSHIFTNUM)?(this.hasFlag(`DISCOURAGE_UPGRADABLE_NOPS`)&&this.scriptEvaluationError(`${k[e]} is discouraged by verification flags.`),this.programCounter++,!0):((t||!this.isAfterGenesis())&&(e===k.OP_2MUL||e===k.OP_2DIV)&&this.scriptEvaluationError(`${k[e]} is disabled until Chronicle.`),(t||!this.isAfterGenesis())&&(e===k.OP_VER||e===k.OP_VERIF||e===k.OP_VERNOTIF)&&this.scriptEvaluationError(`${k[e]} is disabled until Chronicle.`),!t&&this.isAfterGenesis()&&(e===k.OP_VERIF||e===k.OP_VERNOTIF)?(this.programCounter++,!0):!1)}enforceDiscouragedNop(e,t){t&&this.hasFlag(`DISCOURAGE_UPGRADABLE_NOPS`)&&(e===k.OP_NOP1||e===k.OP_CHECKLOCKTIMEVERIFY||e===k.OP_CHECKSEQUENCEVERIFY||e===k.OP_NOP9||e===k.OP_NOP10)&&this.scriptEvaluationError(`${k[e]} is discouraged by verification flags.`)}advanceAfterStep(e){this.returningFromConditional&&this.ifStack.length===0?this.programCounter=e.chunks.length:this.programCounter++,this.hasExplicitFlags()&&!this.isAfterGenesis()&&this.stack.length+this.altStack.length>si&&this.scriptEvaluationError(`Stack item count has exceeded ${si}.`)}step(){this.enforceStepResourceLimits();let e=this.currentScriptForStep();if(this.programCounter>=e.chunks.length)return!1;let t=e.chunks[this.programCounter],n=this.opcodeForOperation(t),r=!this.returningFromConditional&&!this.ifStack.includes(!1);if(this.enforceChronicleOnlyOpcode(n),r&&n>=0&&n<=k.OP_PUSHDATA4)this.executeDataPush(t);else if(r||n>=k.OP_IF&&n<=k.OP_ENDIF){let e,t,i,a,o,s,c,l,u,d,f,m,h,g,_,v,y,b,ee,te,x,ne,S,re,C,ie;if(this.countExecutedOpcode(n,r),this.skipUnavailablePreChronicleOpcode(n,r))return!0;switch(this.enforceDiscouragedNop(n,r),n){case k.OP_VER:{let e=this.transactionVersion;this.pushStack([e&255,e>>>8&255,e>>>16&255,e>>>24&255]);break}case k.OP_SUBSTR:(()=>{this.stack.length<3&&this.scriptEvaluationError(`OP_SUBSTR requires at least three items to be on the stack.`);let t=this.readScriptNumber(this.popStack()).toNumber(),n=this.readScriptNumber(this.popStack()).toNumber();e=this.popStack();let r=e.length;(n<0||n>=r||t<0||t>r-n)&&this.scriptEvaluationError(`OP_SUBSTR offset (${n}) must be in range [0, ${r}) and length (${t}) must be in range [0, ${r-n}]`),this.pushStack(e.slice(n,n+t))})();break;case k.OP_LEFT:(()=>{this.stack.length<2&&this.scriptEvaluationError(`OP_LEFT requires at least two items to be on the stack.`);let t=this.readScriptNumber(this.popStack()).toNumber();e=this.popStack();let n=e.length;(t<0||t>n)&&this.scriptEvaluationError(`OP_LEFT length (${t}) must be in range [0, ${n}]`),this.pushStack(e.slice(0,t))})();break;case k.OP_RIGHT:(()=>{this.stack.length<2&&this.scriptEvaluationError(`OP_RIGHT requires at least two items to be on the stack.`);let t=this.readScriptNumber(this.popStack()).toNumber();e=this.popStack();let n=e.length;(t<0||t>n)&&this.scriptEvaluationError(`OP_RIGHT length (${t}) must be in range [0, ${n}]`),this.pushStack(e.slice(n-t))})();break;case k.OP_LSHIFTNUM:(()=>{this.stack.length<2&&this.scriptEvaluationError(`OP_LSHIFTNUM requires at least two items to be on the stack.`);let e=this.readScriptNumber(this.popStack()).toBigInt();e<0&&this.scriptEvaluationError(`OP_LSHIFTNUM bits to shift must not be negative.`);let t=new p(this.readScriptNumber(this.popStack()).toBigInt()<<e);this.pushStack(t.toScriptNum())})();break;case k.OP_RSHIFTNUM:(()=>{this.stack.length<2&&this.scriptEvaluationError(`OP_RSHIFTNUM requires at least two items to be on the stack.`);let e=this.readScriptNumber(this.popStack()).toBigInt();e<0&&this.scriptEvaluationError(`OP_RSHIFTNUM bits to shift must not be negative.`);let t=this.readScriptNumber(this.popStack()).toBigInt(),n;n=t<0?new p(-(-t>>e)):new p(t>>e),this.pushStack(n.toScriptNum())})();break;case k.OP_1NEGATE:this.pushStackCopy(di);break;case k.OP_0:this.pushStackCopy(fi[0]);break;case k.OP_1:case k.OP_2:case k.OP_3:case k.OP_4:case k.OP_5:case k.OP_6:case k.OP_7:case k.OP_8:case k.OP_9:case k.OP_10:case k.OP_11:case k.OP_12:case k.OP_13:case k.OP_14:case k.OP_15:case k.OP_16:m=n-(k.OP_1-1),this.pushStackCopy(fi[m]);break;case k.OP_NOP:case k.OP_NOP1:case k.OP_CHECKLOCKTIMEVERIFY:break;case k.OP_CHECKSEQUENCEVERIFY:(()=>{if(this.hasFlag(`CHECKSEQUENCEVERIFY`)){this.stack.length<1&&this.scriptEvaluationError(`OP_CHECKSEQUENCEVERIFY requires at least one item to be on the stack.`);let e=0n;try{e=p.fromScriptNum(this.stackTop(),this.shouldEnforceMinimalData(),5).toBigInt()}catch{this.scriptEvaluationError(`OP_CHECKSEQUENCEVERIFY requires a minimally-encoded numeric lock time.`)}e<0n&&this.scriptEvaluationError(`OP_CHECKSEQUENCEVERIFY requires a non-negative lock time.`),Number(e&BigInt(ui))===0&&this.transactionVersion<2&&this.scriptEvaluationError(`OP_CHECKSEQUENCEVERIFY lock time is unsatisfied.`)}})();break;case k.OP_NOP9:case k.OP_NOP10:break;case k.OP_VERIF:case k.OP_VERNOTIF:(()=>{if(g=!1,r){if(this.stack.length<1&&this.scriptEvaluationError(`OP_VERIF and OP_VERNOTIF require at least one item on the stack when they are used!`),t=this.popStack(),t.length===4){let e=this.transactionVersion;i=[e&255,e>>>8&255,e>>>16&255,e>>>24&255],g=pi(t,i)}n===k.OP_VERNOTIF&&(g=!g)}this.ifStack.push(g),this.elseStack.push(!1)})();break;case k.OP_IF:case k.OP_NOTIF:g=!1,r&&(this.stack.length<1&&this.scriptEvaluationError(`OP_IF and OP_NOTIF require at least one item on the stack when they are used!`),e=this.popStack(),this.hasFlag(`MINIMALIF`)&&e.length>0&&(e.length!==1||e[0]!==1)&&this.scriptEvaluationError(`OP_IF and OP_NOTIF require minimal truth values.`),g=this.castToBool(e),n===k.OP_NOTIF&&(g=!g)),this.ifStack.push(g),this.elseStack.push(!1);break;case k.OP_ELSE:this.ifStack.length===0&&this.scriptEvaluationError(`OP_ELSE requires a preceeding OP_IF.`),this.hasExplicitFlags()&&this.isAfterGenesis()&&this.elseStack.at(-1)===!0&&this.scriptEvaluationError(`OP_ELSE may only be used once for each OP_IF or OP_NOTIF after Genesis.`),this.elseStack[this.elseStack.length-1]=!0,this.ifStack[this.ifStack.length-1]=this.ifStack.at(-1)!==!0;break;case k.OP_ENDIF:this.ifStack.length===0&&this.scriptEvaluationError(`OP_ENDIF requires a preceeding OP_IF.`),this.ifStack.pop(),this.elseStack.pop();break;case k.OP_VERIFY:this.stack.length<1&&this.scriptEvaluationError(`OP_VERIFY requires at least one item to be on the stack.`),t=this.stackTop(),g=this.castToBool(t),g||this.scriptEvaluationError(`OP_VERIFY requires the top stack value to be truthy.`),this.popStack();break;case k.OP_RETURN:this.hasExplicitFlags()&&!this.isAfterGenesis()&&this.scriptEvaluationError(`OP_RETURN is invalid before Genesis.`),this.ifStack.length>0?this.returningFromConditional=!0:(this.programCounter=this.context===`UnlockingScript`?this.unlockingScript.chunks.length:this.lockingScript.chunks.length,this.programCounter--);break;case k.OP_TOALTSTACK:this.requireStackItems(1,`OP_TOALTSTACK requires at oeast one item to be on the stack.`),this.pushAltStack(this.popStack());break;case k.OP_FROMALTSTACK:this.requireAltStackItems(1,`OP_FROMALTSTACK requires at least one item to be on the stack.`),this.pushStack(this.popAltStack());break;case k.OP_2DROP:this.requireStackItems(2,`OP_2DROP requires at least two items to be on the stack.`),this.popStack(),this.popStack();break;case k.OP_2DUP:this.requireStackItems(2,`OP_2DUP requires at least two items to be on the stack.`),t=this.stackTop(-2),i=this.stackTop(-1),this.pushStackCopy(t),this.pushStackCopy(i);break;case k.OP_3DUP:this.requireStackItems(3,`OP_3DUP requires at least three items to be on the stack.`),t=this.stackTop(-3),i=this.stackTop(-2),a=this.stackTop(-1),this.pushStackCopy(t),this.pushStackCopy(i),this.pushStackCopy(a);break;case k.OP_2OVER:this.requireStackItems(4,`OP_2OVER requires at least four items to be on the stack.`),t=this.stackTop(-4),i=this.stackTop(-3),this.pushStackCopy(t),this.pushStackCopy(i);break;case k.OP_2ROT:{this.requireStackItems(6,`OP_2ROT requires at least six items to be on the stack.`);let e=this.popStack(),t=this.popStack(),n=this.popStack(),r=this.popStack(),i=this.popStack(),a=this.popStack();this.pushStack(r),this.pushStack(n),this.pushStack(t),this.pushStack(e),this.pushStack(a),this.pushStack(i);break}case k.OP_2SWAP:{this.requireStackItems(4,`OP_2SWAP requires at least four items to be on the stack.`);let e=this.popStack(),t=this.popStack(),n=this.popStack(),r=this.popStack();this.pushStack(t),this.pushStack(e),this.pushStack(r),this.pushStack(n);break}case k.OP_IFDUP:this.requireStackItems(1,`OP_IFDUP requires at least one item to be on the stack.`),t=this.stackTop(),this.castToBool(t)&&this.pushStackCopy(t);break;case k.OP_DEPTH:this.pushStack(new p(this.stack.length).toScriptNum());break;case k.OP_DROP:this.requireStackItems(1,`OP_DROP requires at least one item to be on the stack.`),this.popStack();break;case k.OP_DUP:this.requireStackItems(1,`OP_DUP requires at least one item to be on the stack.`),this.pushStackCopy(this.stackTop());break;case k.OP_NIP:this.requireStackItems(2,`OP_NIP requires at least two items to be on the stack.`),i=this.popStack(),this.popStack(),this.pushStack(i);break;case k.OP_OVER:this.requireStackItems(2,`OP_OVER requires at least two items to be on the stack.`),this.pushStackCopy(this.stackTop(-2));break;case k.OP_PICK:case k.OP_ROLL:(()=>{this.requireStackItems(2,`${k[n]} requires at least two items to be on the stack.`),l=this.readScriptNumber(this.popStack());let e=l.toBigInt();(e<0n||e>=BigInt(this.stack.length))&&this.scriptEvaluationError(`${k[n]} requires the top stack element to be 0 or a positive number less than the current size of the stack.`);let t=Number(e),r=this.stack[this.stack.length-1-t];n===k.OP_ROLL?(this.stack.splice(this.stack.length-1-t,1),this.stackMem-=r.length,this.pushStack(r)):this.pushStackCopy(r)})();break;case k.OP_ROT:this.requireStackItems(3,`OP_ROT requires at least three items to be on the stack.`),c=this.popStack(),s=this.popStack(),o=this.popStack(),this.pushStack(s),this.pushStack(c),this.pushStack(o);break;case k.OP_SWAP:this.requireStackItems(2,`OP_SWAP requires at least two items to be on the stack.`),s=this.popStack(),o=this.popStack(),this.pushStack(s),this.pushStack(o);break;case k.OP_TUCK:this.requireStackItems(2,`OP_TUCK requires at least two items to be on the stack.`),t=this.stackTop(-1),this.ensureStackMem(t.length),this.stack.splice(-2,0,t.slice()),this.stackMem+=t.length;break;case k.OP_SIZE:this.requireStackItems(1,`OP_SIZE requires at least one item to be on the stack.`),this.pushStack(new p(this.stackTop().length).toScriptNum());break;case k.OP_AND:case k.OP_OR:case k.OP_XOR:(()=>{this.requireStackItems(2,`${k[n]} requires at least two items on the stack.`),i=this.popStack(),t=this.popStack(),t.length!==i.length&&this.scriptEvaluationError(`${k[n]} requires the top two stack items to be the same size.`);let e=Array.from({length:t.length},()=>0);for(let r=0;r<t.length;r++)n===k.OP_AND?e[r]=t[r]&i[r]:n===k.OP_OR?e[r]=t[r]|i[r]:e[r]=t[r]^i[r];this.pushStack(e)})();break;case k.OP_INVERT:(()=>{this.requireStackItems(1,`OP_INVERT requires at least one item to be on the stack.`),e=this.popStack();let t=Array.from({length:e.length},()=>0);for(let n=0;n<e.length;n++)t[n]=~e[n]&255;this.pushStack(t)})();break;case k.OP_LSHIFT:case k.OP_RSHIFT:(()=>{this.requireStackItems(2,`${k[n]} requires at least two items to be on the stack.`),d=this.readScriptNumber(this.popStack()),t=this.popStack();let e=d.toBigInt();if(e<0n&&this.scriptEvaluationError(`${k[n]} requires the top item on the stack not to be negative.`),t.length===0){this.pushStack([]);return}u=new p(t);let r;if(n===k.OP_LSHIFT){r=u.ushln(e);let n=new p(1).ushln(t.length*8).isubn(1);r=r.iand(n)}else r=u.ushrn(e);let i=r.toArray(`be`,t.length);this.pushStack(i)})();break;case k.OP_EQUAL:case k.OP_EQUALVERIFY:this.requireStackItems(2,`${k[n]} requires at least two items to be on the stack.`),i=this.popStack(),t=this.popStack(),g=pi(t,i),this.pushStack(g?[1]:[]),n===k.OP_EQUALVERIFY&&(g||this.scriptEvaluationError(`OP_EQUALVERIFY requires the top two stack items to be equal.`),this.popStack());break;case k.OP_1ADD:case k.OP_1SUB:case k.OP_2MUL:case k.OP_2DIV:case k.OP_NEGATE:case k.OP_ABS:case k.OP_NOT:case k.OP_0NOTEQUAL:(()=>{switch(this.requireStackItems(1,`${k[n]} requires at least one item to be on the stack.`),l=this.readScriptNumber(this.popStack()),n){case k.OP_1ADD:l=l.add(new p(1));break;case k.OP_1SUB:l=l.sub(new p(1));break;case k.OP_2MUL:l=l.mul(new p(2));break;case k.OP_2DIV:l=l.div(new p(2));break;case k.OP_NEGATE:l=l.neg();break;case k.OP_ABS:l.isNeg()&&(l=l.neg());break;case k.OP_NOT:l=new p(+(l.cmpn(0)===0));break;case k.OP_0NOTEQUAL:l=new p(l.cmpn(0)===0?0:1)}this.pushStack(l.toScriptNum())})();break;case k.OP_ADD:case k.OP_SUB:case k.OP_MUL:case k.OP_DIV:case k.OP_MOD:case k.OP_BOOLAND:case k.OP_BOOLOR:case k.OP_NUMEQUAL:case k.OP_NUMEQUALVERIFY:case k.OP_NUMNOTEQUAL:case k.OP_LESSTHAN:case k.OP_GREATERTHAN:case k.OP_LESSTHANOREQUAL:case k.OP_GREATERTHANOREQUAL:case k.OP_MIN:case k.OP_MAX:(()=>{this.requireStackItems(2,`${k[n]} requires at least two items to be on the stack.`),i=this.popStack(),t=this.popStack(),d=this.readScriptNumber(i),u=this.readScriptNumber(t);let e=(()=>{switch(n){case k.OP_MUL:return u.byteLength()+d.byteLength();case k.OP_ADD:case k.OP_SUB:return Math.max(u.byteLength(),d.byteLength())+1;default:return Math.max(u.byteLength(),d.byteLength())}})();this.ensureStackMem(e);let r=(()=>{switch(n){case k.OP_ADD:return u.add(d);case k.OP_SUB:return u.sub(d);case k.OP_MUL:return u.mul(d);case k.OP_DIV:return d.cmpn(0)===0&&this.scriptEvaluationError(`OP_DIV cannot divide by zero!`),u.div(d);case k.OP_MOD:return d.cmpn(0)===0&&this.scriptEvaluationError(`OP_MOD cannot divide by zero!`),u.mod(d);case k.OP_BOOLAND:return hi(u.cmpn(0)!==0,d.cmpn(0)!==0);case k.OP_BOOLOR:return gi(u.cmpn(0)!==0,d.cmpn(0)!==0);case k.OP_NUMEQUAL:case k.OP_NUMEQUALVERIFY:return mi(u.cmp(d)===0);case k.OP_NUMNOTEQUAL:return mi(u.cmp(d)!==0);case k.OP_LESSTHAN:return mi(u.cmp(d)<0);case k.OP_GREATERTHAN:return mi(u.cmp(d)>0);case k.OP_LESSTHANOREQUAL:return mi(u.cmp(d)<=0);case k.OP_GREATERTHANOREQUAL:return mi(u.cmp(d)>=0);case k.OP_MIN:return _i(u,d);case k.OP_MAX:return vi(u,d);default:return new p(0)}})();this.pushStack(r.toScriptNum()),n===k.OP_NUMEQUALVERIFY&&(this.castToBool(this.stackTop())||this.scriptEvaluationError(`OP_NUMEQUALVERIFY requires the top stack item to be truthy.`),this.popStack())})();break;case k.OP_WITHIN:this.requireStackItems(3,`OP_WITHIN requires at least three items to be on the stack.`),f=this.readScriptNumber(this.popStack()),d=this.readScriptNumber(this.popStack()),u=this.readScriptNumber(this.popStack()),g=u.cmp(d)>=0&&u.cmp(f)<0,this.pushStack(g?[1]:[]);break;case k.OP_RIPEMD160:case k.OP_SHA1:case k.OP_SHA256:case k.OP_HASH160:case k.OP_HASH256:(()=>{this.requireStackItems(1,`${k[n]} requires at least one item to be on the stack.`),e=this.popStack();let t=[];n===k.OP_RIPEMD160?t=Ye(e):n===k.OP_SHA1?t=Xe(e):n===k.OP_SHA256?t=Ze(e):n===k.OP_HASH160?t=$e(e):n===k.OP_HASH256&&(t=Qe(e)),this.pushStack(t)})();break;case k.OP_CODESEPARATOR:this.lastCodeSeparator=this.programCounter;break;case k.OP_CHECKSIG:case k.OP_CHECKSIGVERIFY:this.requireStackItems(2,`${k[n]} requires at least two items to be on the stack.`),b=this.popStack(),y=this.popStack(),(!this.checkSignatureEncoding(y)||!this.checkPublicKeyEncoding(b))&&this.scriptEvaluationError(`${k[n]} requires correct encoding for the public key and signature.`),_=(()=>{if(y.length===0)return!1;try{ee=this.parseChecksigSignature(y);let e=(this.context===`UnlockingScript`?this.unlockingScript:this.lockingScript).chunks.slice(this.lastCodeSeparator===null?0:this.lastCodeSeparator+1);return this.context===`UnlockingScript`&&(e=e.concat(this.lockingScript.chunks)),v=new Pr(e),v.findAndDelete(new Pr().writeBin(y)),te=lr.fromDER(b),this.verifySignature(ee,te,v)}catch{return!1}})(),!_&&this.hasFlag(`NULLFAIL`)&&y.length>0&&this.scriptEvaluationError(`${k[n]} requires failing signatures to be empty.`),this.pushStack(_?[1]:[]),n===k.OP_CHECKSIGVERIFY&&(_||this.scriptEvaluationError(`OP_CHECKSIGVERIFY requires that a valid signature is provided.`),this.popStack());break;case k.OP_CHECKMULTISIG:case k.OP_CHECKMULTISIGVERIFY:(()=>{x=1,this.stack.length<x&&this.scriptEvaluationError(`${k[n]} requires at least 1 item for nKeys.`);let e=this.readScriptNumber(this.stackTop(-x)).toBigInt(),t=this.hasExplicitFlags()&&!this.isAfterGenesis()?BigInt(li):ci;(e<0n||e>t)&&this.scriptEvaluationError(`${k[n]} requires a key count between 0 and ${t.toString()}.`),re=Number(e);let r=re;ne=++x,x+=re,this.stack.length<x&&this.scriptEvaluationError(`${k[n]} stack too small for nKeys and keys. Need ${x}, have ${this.stack.length}.`);let i=this.readScriptNumber(this.stackTop(-x)).toBigInt();(i<0n||i>BigInt(re))&&this.scriptEvaluationError(`${k[n]} requires the number of signatures to be no greater than the number of keys.`),C=Number(i);let a=C;S=++x,x+=C,this.stack.length<x&&this.scriptEvaluationError(`${k[n]} stack too small for N, keys, M, sigs, and dummy. Need ${x}, have ${this.stack.length}.`),v=new Pr((this.context===`UnlockingScript`?this.unlockingScript:this.lockingScript).chunks.slice(this.lastCodeSeparator===null?0:this.lastCodeSeparator+1));let o=!1;for(let e=0;e<C;e++)y=this.stackTop(-S-e),y.length>0&&(o=!0),v.findAndDelete(new Pr().writeBin(y));(()=>{for(_=!0;_&&C>0;){if(re===0){_=!1;break}if(y=this.stackTop(-S),b=this.stackTop(-ne),(!this.checkSignatureEncoding(y)||!this.checkPublicKeyEncoding(b))&&this.scriptEvaluationError(`${k[n]} requires correct encoding for the public key and signature.`),ie=!1,y.length>0)try{ee=this.parseChecksigSignature(y),te=lr.fromDER(b),ie=this.verifySignature(ee,te,v)}catch{ie=!1}ie&&(S++,C--),ne++,re--,C>re&&(_=!1)}})(),(()=>{!_&&this.hasFlag(`NULLFAIL`)&&o&&this.scriptEvaluationError(`${k[n]} requires failing signatures to be empty.`);let e=1+r+1+a+1-1;for(;e>0;)this.popStack(),e--;this.requireStackItems(1,`${k[n]} requires an extra item (dummy) to be on the stack.`);let t=this.popStack();this.shouldEnforceNullDummy()&&t.length>0&&this.scriptEvaluationError(`${k[n]} requires the extra stack item (dummy) to be empty.`),this.pushStack(_?[1]:[]),n===k.OP_CHECKMULTISIGVERIFY&&(_||this.scriptEvaluationError(`OP_CHECKMULTISIGVERIFY requires that a sufficient number of valid signatures are provided.`),this.popStack())})()})();break;case k.OP_CAT:(()=>{this.requireStackItems(2,`OP_CAT requires at least two items to be on the stack.`),i=this.popStack(),t=this.popStack();let e=t.concat(i);e.length>this.maxPushSize()&&this.scriptEvaluationError(`It's not currently possible to push data larger than ${this.maxPushSize()} bytes.`),this.pushStack(e)})();break;case k.OP_SPLIT:(()=>{this.requireStackItems(2,`OP_SPLIT requires at least two items to be on the stack.`);let e=this.popStack(),t=this.popStack(),n=this.readScriptNumber(e).toBigInt();(n<0n||n>BigInt(t.length))&&this.scriptEvaluationError(`OP_SPLIT requires the first stack item to be a non-negative number less than or equal to the size of the second-from-top stack item.`);let r=Number(n);this.pushStack(t.slice(0,r)),this.pushStack(t.slice(r))})();break;case k.OP_NUM2BIN:(()=>{this.requireStackItems(2,`OP_NUM2BIN requires at least two items to be on the stack.`);let e=this.readScriptNumber(this.popStack()).toBigInt(),t=this.maxPushSize();if((Number.isFinite(t)&&e>BigInt(t)||e<0n)&&this.scriptEvaluationError(`It's not currently possible to push data larger than ${t} bytes or negative size.`),e>oi)throw new ei(`element-size`,oi,e);h=Number(e);let n=this.popStack();if(n=yn(n),n.length>h&&this.scriptEvaluationError(`OP_NUM2BIN requires that the size expressed in the top stack item is large enough to hold the value expressed in the second-from-top stack item.`),n.length===h){this.pushStack(n);return}let r=Array.from({length:h},()=>0),i=0;n.length>0&&(i=n.at(-1)&128,n[n.length-1]&=127);for(let e=0;e<n.length;e++)r[e]=n[e];i!==0&&(r[h-1]|=128),this.pushStack(r)})();break;case k.OP_BIN2NUM:(()=>{this.requireStackItems(1,`OP_BIN2NUM requires at least one item to be on the stack.`),t=this.popStack();let e=yn(t);yi(e)||this.scriptEvaluationError(`OP_BIN2NUM requires that the resulting number is valid.`),this.pushStack(e)})();break;default:this.scriptEvaluationError(`Invalid opcode ${n} (pc=${this.programCounter}).`)}}return this.advanceAfterStep(e),!0}validate(e){let t=ni();return t?.verifySpendSync!==void 0&&(t.isReady?.()??!0)&&(e===void 0?t.shouldVerifySpend?.(this):t.shouldVerifySpend?.(this,e))!==!1?((e===void 0?t.verifySpendSync(this):t.verifySpendSync(this,e))||this.scriptEvaluationError(`The selected script-verification backend rejected the spend.`),!0):this.validateJavaScript()}validateJavaScript(){this.reset(),this.shouldEnforceSigPushOnly()&&!this.unlockingScript.isPushOnly()&&this.scriptEvaluationError(`Unlocking scripts can only contain push operations, and no other opcodes.`);let e=this.lockingScript,t=this.hasFlag(`P2SH`)&&!this.isAfterGenesis()&&this.isP2SHLockingScript(this.lockingScript);t&&!this.unlockingScript.isPushOnly()&&this.scriptEvaluationError(`P2SH unlocking scripts can only contain push operations.`),this.runScript(`UnlockingScript`);let n=this.stack.map(e=>e.slice());this.runScript(`LockingScript`),this.requireTruthyTopStack();try{if(t){n.length===0&&this.scriptEvaluationError(`P2SH evaluation requires a redeem script on the stack.`);let e=n.pop();if(e===void 0)return this.scriptEvaluationError(`P2SH evaluation requires a redeem script on the stack.`),!1;this.setStack(n);let t=Pr.fromBinary(e);this.lockingScript=new Xr(t.chunks),this.runScript(`LockingScript`)}}finally{this.lockingScript=e}return this.shouldEnforceCleanStack()&&this.stack.length!==1&&this.scriptEvaluationError(`The clean stack rule requires exactly one item to be on the stack after script execution, found ${this.stack.length}.`),this.requireTruthyTopStack(),!0}async validateWith(e,t){return(t===void 0?e.shouldVerifySpend?.(this):e.shouldVerifySpend?.(this,t))===!1?this.validateJavaScript():t===void 0?await e.verifySpend(this):await e.verifySpend(this,t)}toTransactionUint8Array(){let e={sourceTXID:this.sourceTXID,sourceOutputIndex:this.sourceOutputIndex,unlockingScript:this.unlockingScript,sequence:this.inputSequence},t=this.allInputs??[...this.otherInputs.slice(0,this.inputIndex),e,...this.otherInputs.slice(this.inputIndex)];if(this.inputIndex<0||this.inputIndex>=t.length)throw RangeError(`Spend input index is out of range`);let n=new Jt;n.writeUInt32LE(this.transactionVersion),n.writeVarIntNum(t.length);for(let r=0;r<t.length;r++){let i=r===this.inputIndex?e:t[r],a=i.sourceTXID??i.sourceTransaction?.id(`hex`);if(a===void 0)throw Error(`Input ${r} is missing its source transaction ID`);if(i.unlockingScript===void 0)throw Error(`Input ${r} is missing its unlocking script`);n.writeReverse(tn(a,`hex`)),n.writeUInt32LE(i.sourceOutputIndex);let o=i.unlockingScript.toUint8Array();n.writeVarIntNum(o.length),n.write(o),n.writeUInt32LE(i.sequence??4294967295)}n.writeVarIntNum(this.outputs.length);for(let e of this.outputs){n.writeUInt64LE(e.satoshis??0);let t=e.lockingScript.toUint8Array();n.writeVarIntNum(t.length),n.write(t)}return n.writeUInt32LE(this.lockTime),n.toUint8Array()}runScript(e){this.context=e,this.programCounter=0,this.ifStack=[],this.elseStack=[],this.returningFromConditional=!1,this.clearAltStack(),this.lastCodeSeparator=null;let t=e===`UnlockingScript`?this.unlockingScript:this.lockingScript;for(this.hasExplicitFlags()&&!this.isAfterGenesis()&&t.toUint8Array().length>ii&&this.scriptEvaluationError(`Script size exceeds ${ii} bytes.`);this.programCounter<t.chunks.length;)this.step();this.ifStack.length>0&&this.scriptEvaluationError(`Every OP_IF, OP_NOTIF, or OP_ELSE must be terminated with OP_ENDIF prior to the end of the script.`),this.ifStack=[],this.elseStack=[],this.clearAltStack(),this.lastCodeSeparator=null}isP2SHLockingScript(e){let t=e.chunks;return t.length===3&&t[0].op===k.OP_HASH160&&t[1].op===20&&Array.isArray(t[1].data)&&t[1].data.length===20&&t[2].op===k.OP_EQUAL}requireTruthyTopStack(){this.stack.length===0?this.scriptEvaluationError(`The top stack element must be truthy after script evaluation (stack is empty).`):this.castToBool(this.stackTop())||this.scriptEvaluationError(`The top stack element must be truthy after script evaluation.`)}castToBool(e){if(e.length===0)return!1;for(let t=0;t<e.length;t++)if(e[t]!==0)return t!==e.length-1||e[t]!==128;return!1}scriptEvaluationError(e){throw new $r({message:e,txid:this.sourceTXID,outputIndex:this.sourceOutputIndex,context:this.context,programCounter:this.programCounter,stackState:this.stack,altStackState:this.altStack,ifStackState:this.ifStack,stackMem:this.stackMem,altStackMem:this.altStackMem})}};function Ci(e,t){let n=Kr.SIGHASH_FORKID;return e===`all`&&(n|=Kr.SIGHASH_ALL),e===`none`&&(n|=Kr.SIGHASH_NONE),e===`single`&&(n|=Kr.SIGHASH_SINGLE),t&&(n|=Kr.SIGHASH_ANYONECANPAY),n}function wi(e,t,n,r){let i=e.inputs[t],a=i.sourceTXID??i.sourceTransaction?.id(`hex`);if(a==null||a===void 0||a===``)throw Error(`The input sourceTXID or sourceTransaction is required for transaction signing.`);let o=n??i.sourceTransaction?.outputs[i.sourceOutputIndex].satoshis;if(o==null||o===void 0)throw Error(`The sourceSatoshis or input sourceTransaction is required for transaction signing.`);let s=r??i.sourceTransaction?.outputs[i.sourceOutputIndex].lockingScript;if(s==null)throw Error(`The lockingScript or input sourceTransaction is required for transaction signing.`);return{sourceTXID:a,sourceSatoshis:o,lockingScript:s,allInputs:e.inputs,get otherInputs(){return e.inputs.filter((e,n)=>n!==t)}}}function Ti(e){let{tx:t,inputIndex:n,signatureScope:r,sourceTXID:i,sourceSatoshis:a,lockingScript:o,otherInputs:s,allInputs:c,inputSequence:l}=e,u=t.inputs[n];return Kr.format({sourceTXID:i,sourceOutputIndex:Sn(u.sourceOutputIndex,`input.sourceOutputIndex must have value`),sourceSatoshis:a,transactionVersion:t.version,otherInputs:s??[],allInputs:c,inputIndex:n,outputs:t.outputs,inputSequence:l??Sn(u.sequence,`input.sequence must have value`),subscript:o,lockTime:t.lockTime,scope:r,cache:t.getSignatureHashCache()})}var Ei=class{lock(e){let t;if(typeof e==`string`){let n=gn(e);if(n.prefix[0]!==0&&n.prefix[0]!==111)throw Error(`only P2PKH is supported`);t=n.data}else t=e;if(t.length!==20)throw Error(`P2PKH hash length must be 20 bytes`);return new Xr([{op:k.OP_DUP},{op:k.OP_HASH160},{op:t.length,data:t},{op:k.OP_EQUALVERIFY},{op:k.OP_CHECKSIG}])}unlock(e,t=`all`,n=!1,r,i){return{sign:async(a,o)=>{let s=Ci(t,n),c=wi(a,o,r,i);r=c.sourceSatoshis,i=c.lockingScript;let l=Ze(Ti({tx:a,inputIndex:o,signatureScope:s,sourceTXID:c.sourceTXID,sourceSatoshis:c.sourceSatoshis,lockingScript:c.lockingScript,allInputs:c.allInputs})),u=Yr(`signDigest`),d=Yr(`publicKeyFromPrivate`),f=u===void 0&&d===void 0?void 0:Uint8Array.from(e.toArray(`be`,32)),p=u===void 0?e.sign(l):ur.fromDER(Array.from(qr(`signDigest`,await u.signDigest(f,Uint8Array.from(Ze(l)))))),m=new Kr(p.r,p.s,s).toChecksigFormat(),h=d===void 0?e.toPublicKey().encode(!0):Array.from(Di(await d.publicKeyFromPrivate(f)));return new Zr([{op:m.length,data:m},{op:h.length,data:h}])},estimateLength:async()=>108}}};function Di(e){let t=qr(`publicKeyFromPrivate`,e,33);if(t[0]!==2&&t[0]!==3)throw Error(`publicKeyFromPrivate returned an invalid compressed public key`);return t}var Oi=class{value;constructor(e){this.value=e}async computeFee(e){let t=e=>e>2**32?9:e>2**16?5:e>253?3:1,n=4;n+=t(e.inputs.length);for(let r=0;r<e.inputs.length;r++){let i=e.inputs[r];n+=40;let a;if(typeof i.unlockingScript==`object`)a=i.unlockingScript.toBinary().length;else if(typeof i.unlockingScriptTemplate==`object`)a=await i.unlockingScriptTemplate.estimateLength(e,r);else throw TypeError(`All inputs must have an unlocking script or an unlocking script template for sat/kb fee computation.`);n+=t(a),n+=a}n+=t(e.outputs.length);for(let r of e.outputs){n+=8;let e=r.lockingScript.toBinary().length;n+=t(e),n+=e}return n+=4,Math.ceil(n/1e3*this.value)}},ki=class e extends Oi{static ARC_POLICY_URL=`https://arc.gorillapool.io/v1/policy`;static instance=null;cachedRate=null;cacheTimestamp=0;cacheValidityMs;constructor(e=3e5){super(100),this.cacheValidityMs=e}static getInstance(t=3e5){return e.instance??=new e(t),e.instance}async fetchFeeRate(){let t=Date.now();if(this.cachedRate!==null&&t-this.cacheTimestamp<this.cacheValidityMs)return this.cachedRate;try{let n=await fetch(e.ARC_POLICY_URL);if(!n.ok)throw Error(`HTTP ${n.status}: ${n.statusText}`);let r=await n.json();if(!r.policy?.miningFee||typeof r.policy.miningFee.satoshis!=`number`||typeof r.policy.miningFee.bytes!=`number`)throw Error(`Invalid policy response format`);let i=r.policy.miningFee.satoshis/r.policy.miningFee.bytes*1e3;return this.cachedRate=i,this.cacheTimestamp=t,i}catch(e){return this.cachedRate===null?(console.warn(`Failed to fetch live fee rate, using default 100 sat/kb:`,e),100):(console.warn(`Failed to fetch live fee rate, using cached value:`,e),this.cachedRate)}}async computeFee(e){let t=await this.fetchFeeRate();return this.value=t,super.computeFee(e)}};function Ai(e,t,n,r){return new Promise((i,a)=>{let o=e.request(t,n,e=>{let t=``;e.on(`data`,e=>{t+=e}),e.on(`end`,()=>{let n=e.statusCode>=200&&e.statusCode<=299,r=e.headers[`content-type`],a=t!==``&&typeof r==`string`&&r.startsWith(`application/json`)?JSON.parse(t):t;i({status:e.statusCode,statusText:e.statusMessage,ok:n,data:a})})});o.on(`error`,e=>{a(e)}),n.data!==null&&n.data!==void 0&&o.write(r(n.data)),o.end()})}var ji=class{https;constructor(e){this.https=e}async request(e,t){return await Ai(this.https,e,t,e=>JSON.stringify(e))}},Mi=class{fetch;constructor(e){this.fetch=e}async request(e,t){let n={method:t.method,headers:t.headers,body:JSON.stringify(t.data)},r=await this.fetch(e,n),i=r.headers.get(`Content-Type`)?.startsWith(`application/json`)??!1?await r.json():await r.text();return{ok:r.ok,status:r.status,statusText:r.statusText,data:i}}};function Ni(){let e={async request(...e){throw Error(`No method available to perform HTTP request`)}};if(globalThis.window!==void 0&&typeof globalThis.window.fetch==`function`)return new Mi(globalThis.window.fetch.bind(globalThis.window));if(typeof globalThis.fetch==`function`)return new Mi(globalThis.fetch.bind(globalThis));let n=typeof t==`function`?t:void 0;if(n===void 0)return e;try{return new ji(n([`node`,`https`].join(`:`)))}catch{return e}}function Pi(){return`ts-sdk-${E(Tr(16))}`}var Fi=new Set([`DOUBLE_SPEND_ATTEMPTED`,`REJECTED`,`INVALID`,`MALFORMED`,`MINED_IN_STALE_BLOCK`]);function Ii(e){try{return e.toHexEF()}catch(t){if(t.message===`All inputs must have source transactions when serializing to EF format`)return e.toHex();throw t}}function Li(e){let{txid:t,extraInfo:n,txStatus:r,competingTxs:i}=e,a=r?.toUpperCase(),o=n?.toUpperCase().includes(`ORPHAN`)||a?.includes(`ORPHAN`);if(Fi.has(a)||o){let e={status:`error`,code:r??`UNKNOWN`,txid:t,description:`${r??``} ${n??``}`.trim()};return i!=null&&(e.more={competingTxs:i}),e}let s={status:`success`,txid:t,message:`${r} ${n}`};return i!=null&&(s.competingTxs=i),s}function Ri(e){if(typeof e!=`string`)return e;try{return JSON.parse(e)}catch{return e}}function zi(e,t){let n={status:`error`,code:typeof e==`number`||typeof e==`string`?e.toString():`ERR_UNKNOWN`,description:`Unknown error`},r=Ri(t);return typeof r!=`object`||!r?n:(n.more=r,`txid`in r&&typeof r.txid==`string`&&(n.txid=r.txid),`detail`in r&&typeof r.detail==`string`&&(n.description=r.detail),n)}function Bi(e){return{status:`error`,code:`500`,description:typeof e==`object`&&e&&`message`in e&&typeof e.message==`string`?e.message:`Internal Server Error`}}var Vi=class{URL;apiKey;deploymentId;callbackUrl;callbackToken;headers;httpClient;constructor(e,t){if(this.URL=e,typeof t==`string`)this.apiKey=t,this.httpClient=Ni(),this.deploymentId=Pi(),this.callbackToken=void 0,this.callbackUrl=void 0;else{let{apiKey:e,deploymentId:n,httpClient:r,callbackToken:i,callbackUrl:a,headers:o}=t??{};this.apiKey=e,this.httpClient=r??Ni(),this.deploymentId=n??Pi(),this.callbackToken=i,this.callbackUrl=a,this.headers=o}}requestHeaders(){let e={"Content-Type":`application/json`,"XDeployment-ID":this.deploymentId};if(this.apiKey!=null&&this.apiKey!==``&&(e.Authorization=`Bearer ${this.apiKey}`),this.callbackUrl!=null&&this.callbackUrl!==``&&(e[`X-CallbackUrl`]=this.callbackUrl),this.callbackToken!=null&&this.callbackToken!==``&&(e[`X-CallbackToken`]=this.callbackToken),this.headers!=null)for(let t in this.headers)e[t]=this.headers[t];return e}async broadcast(e){let t={method:`POST`,headers:this.requestHeaders(),data:{rawTx:Ii(e)}};try{let e=await this.httpClient.request(`${this.URL}/v1/tx`,t);return e.ok?Li(e.data):zi(e.status,e.data)}catch(e){return Bi(e)}}async broadcastMany(e){let t=e.map(e=>({rawTx:Ii(e)})),n={method:`POST`,headers:this.requestHeaders(),data:t};try{return(await this.httpClient.request(`${this.URL}/v1/txs`,n)).data}catch(t){let n=Bi(t);return e.map(()=>n)}}};function Hi(e=!1,t={}){return new Vi(e?`https://testnet.arc.gorillapool.io`:`https://arc.gorillapool.io`,t)}var Ui=class{network;apiKey;URL;httpClient;constructor(e=`main`,t={}){let{apiKey:n,httpClient:r}=t;this.network=e,this.URL=`https://api.whatsonchain.com/v1/bsv/${e}`,this.httpClient=r??Ni(),this.apiKey=n??``}async isValidRootForHeight(e,t){let n={method:`GET`,headers:this.getHttpHeaders()},r=await this.httpClient.request(`${this.URL}/block/${t}/header`,n);if(r.ok){let{merkleroot:t}=r.data;return t===e}if(r.status===404)return!1;throw Error(`Failed to verify merkleroot for height ${t} because of an error: ${JSON.stringify(r.data)} `)}async currentHeight(){try{let e={method:`GET`,headers:this.getHttpHeaders()},t=await this.httpClient.request(`${this.URL}/block/headers`,e);if(t.ok)return t.data[0].height;throw Error(`Failed to get current height because of an error: ${JSON.stringify(t.data)} `)}catch(e){throw Error(`Failed to get current height because of an error: ${e instanceof Error?e.message:String(e)}`)}}getHttpHeaders(){let e={Accept:`application/json`};return typeof this.apiKey==`string`&&this.apiKey.trim()!==``&&(e.Authorization=this.apiKey),e}};function Wi(){return new Ui}function Gi(e,t){return E(Qe(tn((e??``)+(t??``),`hex`).reverse()).reverse())}function Ki(e,t,n,r){let i=r.get(e);if(i==null)return;if(i!==t)throw Error(`Mismatched roots`);let a=r.get(`${n}:0`);if(a==null)throw Error(`Mismatched roots`);return a}function qi(e,t,n,r,i,a){if(t==null){if(a)return Gi(e,e);throw Error(`Missing hash for index ${r} at height ${i}`)}return t.duplicate===!0?Gi(e,e):n%2==1?Gi(t.hash,e):Gi(e,t.hash)}var Ji=class e{blockHeight;path;static fromHex(t){return e.fromBinary(tn(t,`hex`))}static fromReader(t,n=!0,r=!0){let i=t.readVarIntNum(),a=t.readUInt8(),o=Array.from({length:a}).fill(null).map(()=>[]),s,c,l;for(let e=0;e<a;e++){for(l=t.readVarIntNum();l>0;){c=t.readVarIntNum(),s=t.readUInt8();let n={offset:c};(s&1)==1?n.duplicate=!0:(s&2&&(n.txid=!0),n.hash=E(t.read(32).reverse())),(!Array.isArray(o[e])||o[e].length===0)&&(o[e]=[]),o[e].push(n),l--}o[e].sort((e,t)=>e.offset-t.offset)}return new e(i,o,n,r)}static fromBinary(t,n=!0,r=!0){let i=new Yt(t);return e.fromReader(i,n,r)}static fromCoinbaseTxidAndHeight(t,n){return new e(n,[[{offset:0,hash:t,txid:!0}]])}constructor(e,t,n=!0,r=!0){this.blockHeight=e,this.path=t;let i=Array.from({length:this.path.length}).fill(0).map(()=>new Set);if(this.path.forEach((e,t)=>{if(e.length===0&&t===0)throw Error(`Empty level at height: ${t}`);let r=new Set;e.forEach(e=>{if(r.has(e.offset))throw Error(`Duplicate offset: ${e.offset}, at height: ${t}`);if(r.add(e.offset),t===0){if(e.duplicate!==!0)for(let t=1;t<this.path.length;t++)i[t].add(e.offset>>t^1)}else if(n&&!i[t].has(e.offset))throw Error(`Invalid offset: ${e.offset}, at height: ${t}, with legal offsets: ${Array.from(i[t],e=>e.toString()).join(`, `)}`)})}),!r)return;let a=this.path.map(e=>new Map(e.map(e=>[e.offset,e]))),o=new Map,s=new Map,c=this.path[0].reduce((e,t)=>Math.max(e,t.offset),0),l;this.path[0].forEach((e,t)=>{let n=this.computeRootCached(e.hash,a,o,s,c);if(t===0&&(l=n),l!==n)throw Error(`Mismatched roots`)})}toWriter(e){e.writeVarIntNum(this.blockHeight);let t=this.path.length;e.writeUInt8(t);for(let n=0;n<t;n++){let t=Object.keys(this.path[n]).length;e.writeVarIntNum(t);for(let t of this.path[n]){e.writeVarIntNum(t.offset);let n=0;t?.duplicate===!0&&(n|=1),t?.txid!==void 0&&t.txid!==null&&(n|=2),e.writeUInt8(n),n&1||e.write(tn(t.hash,`hex`).reverse())}}}toBinary(){let e=new _n;return this.toWriter(e),e.toArray()}toBinaryUint8Array(){let e=new Jt;return this.toWriter(e),e.toUint8Array()}toHex(){return E(this.toBinaryUint8Array())}indexOf(e){let t=this.path[0].find(t=>t.hash===e);if(t==null)throw Error(`Transaction ID ${e} not found in the Merkle Path`);return t.offset}computeRootCached(e,t,n,r,i){if(typeof e!=`string`&&(e=this.path[0].find(e=>!!e.hash)?.hash),typeof e!=`string`)throw TypeError(`Transaction ID is undefined`);let a=this.indexOf(e);if(this.path.length===1&&this.path[0].length===1)return e;let o=Math.max(this.path.length,32-Math.clz32(i)),s=e;for(let e=0;e<o;e++){let c=`${e}:${a>>e}`,l=Ki(c,s,o,r);if(l!=null)return l;r.set(c,s);let u=a>>e^1,d=this.cachedFindLeaf(e,u,t,n,i);s=qi(s,d,u,a,e,this.path.length===1&&a>>e===i>>e)}return r.set(`${o}:0`,s),s}nextRootHash(e,t,n,r){let i=t>>n^1,a=this.findOrComputeLeaf(n,i);if(a==null){if(this.path.length===1&&t>>n===r>>n)return Gi(e,e);throw Error(`Missing hash for index ${t} at height ${n}`)}return a.duplicate===!0?Gi(e,e):i%2==1?Gi(a.hash,e):Gi(e,a.hash)}computeRoot(e){if(typeof e!=`string`){let t=this.path[0].find(e=>!!e?.hash);if(t==null)throw Error(`No valid leaf found in the Merkle Path`);e=t.hash}if(typeof e!=`string`)throw TypeError(`Transaction ID is undefined`);let t=this.indexOf(e),n=e;if(this.path.length===1&&this.path[0].length===1)return n;let r=this.path[0].reduce((e,t)=>Math.max(e,t.offset),0),i=Math.max(this.path.length,32-Math.clz32(r));for(let e=0;e<i;e++)n=this.nextRootHash(n,t,e,r);return n}findOrComputeLeaf(e,t){let n=e=>E(Qe(tn(e,`hex`).reverse()).reverse()),r=e<this.path.length?this.path[e].find(e=>e.offset===t):void 0;if(r!=null)return r;if(e===0)return;let i=e-1,a=t<<1,o=this.findOrComputeLeaf(i,a);if(o?.hash==null||o.hash===``)return;let s=this.findOrComputeLeaf(i,a+1);if(s?.hash==null)return s?.duplicate===!0||this.path.length===1&&a===this.path[0].reduce((e,t)=>Math.max(e,t.offset),0)>>i?{offset:t,hash:n(o.hash+o.hash)}:void 0;let c;return c=s.duplicate===!0?n(o.hash+o.hash):n((s.hash??``)+(o.hash??``)),r={offset:t,hash:c},r}async verify(e,t){let n=this.computeRoot(e);if(this.indexOf(e)===0){let e=await t.currentHeight();if(this.blockHeight+100>e)return!1}return await t.isValidRootForHeight(n,this.blockHeight)}combine(e){if(this.blockHeight!==e.blockHeight)throw Error(`You cannot combine paths which do not have the same block height.`);if(this.computeRoot()!==e.computeRoot())throw Error(`You cannot combine paths which do not have the same root.`);let t=[];for(let n=0;n<this.path.length;n++){t.push([]);for(let e of this.path[n])t[n].push(e);for(let r of e.path[n]){let e=t[n].find(e=>e.offset===r.offset);e===void 0?t[n].push(r):r?.txid!==void 0&&r?.txid!==null&&(e.txid=!0)}}this.path=t,this.trim()}trim(){let e=(e,t)=>{(t.length===0||t.at(-1)!==e)&&t.push(e)},t=(e,t)=>{for(let n=e.length;n>=0;n--){let r=this.path[t].findIndex(t=>t.offset===e[n]);r>=0&&this.path[t].splice(r,1)}},n=t=>{let n=[];for(let r of t)e(r>>1,n);return n},r=[],i=[];for(let e of this.path)e.sort((e,t)=>e.offset-t.offset);for(let t=0;t<this.path[0].length;t++){let n=this.path[0][t];if(n.txid===!0)e(n.offset>>1,r);else{let r=n.offset%2==1,a=this.path[0][t+(r?-1:1)];(a.txid===void 0||a.txid===null||!a.txid)&&e(a.offset,i)}}t(i,0);for(let e=1;e<this.path.length;e++)i=r,r=n(r),t(i,e)}cachedFindLeaf(e,t,n,r,i){let a=`${e}:${t}`;if(r.has(a))return r.get(a);let o=e=>E(Qe(tn(e,`hex`).reverse()).reverse()),s=e<n.length?n[e].get(t):void 0;if(s!=null)return r.set(a,s),s;if(e===0){r.set(a,void 0);return}let c=e-1,l=t<<1,u=this.cachedFindLeaf(c,l,n,r,i);if(u?.hash==null||u.hash===``){r.set(a,void 0);return}let d=this.cachedFindLeaf(c,l+1,n,r,i);if(d?.hash==null){if(d?.duplicate===!0||this.path.length===1&&l===i>>c)return s={offset:t,hash:o(u.hash+u.hash)},r.set(a,s),s;r.set(a,void 0);return}return s={offset:t,hash:d.duplicate===!0?o(u.hash+u.hash):o((d.hash??``)+(u.hash??``))},r.set(a,s),s}extract(t){if(t.length===0)throw Error(`At least one txid must be provided to extract`);let n=this.computeRoot(),r=this.path[0].reduce((e,t)=>Math.max(e,t.offset),0),i=Math.max(this.path.length,32-Math.clz32(r)),a=this.createSourceLeafIndex(),o=new Map,s=this.createTxidToOffsetIndex(),c=this.createNeededLeafLevels(i);for(let e of t)this.collectExtractedLeaves(e,s,c,a,o,r,i);let l=new e(this.blockHeight,this.buildExtractedPath(c));l.trim();let u=l.computeRoot();if(u!==n)throw Error(`Extracted path root ${u} does not match original root ${n}`);return l}createSourceLeafIndex(){let e=Array.from({length:this.path.length});for(let t=0;t<this.path.length;t++){let n=new Map;for(let e of this.path[t])n.set(e.offset,e);e[t]=n}return e}createTxidToOffsetIndex(){let e=new Map;for(let t of this.path[0])t.hash!=null&&e.set(t.hash,t.offset);return e}createNeededLeafLevels(e){let t=Array.from({length:e});for(let n=0;n<e;n++)t[n]=new Map;return t}collectExtractedLeaves(e,t,n,r,i,a,o){let s=t.get(e);if(s===void 0)throw Error(`Transaction ID ${e} not found in the Merkle Path`);n[0].set(s,{offset:s,txid:!0,hash:e});let c=s^1;if(!n[0].has(c)){let e=this.cachedFindLeaf(0,c,r,i,a);e!=null&&n[0].set(c,e)}for(let e=1;e<o;e++){let t=s>>e^1;if(n[e].has(t))continue;let o=this.cachedFindLeaf(e,t,r,i,a);o==null?s>>e===a>>e&&n[e].set(t,{offset:t,duplicate:!0}):n[e].set(t,o)}}buildExtractedPath(e){return e.map(e=>Array.from(e.values()).sort((e,t)=>e.offset-t.offset))}},Yi=4022206465,Xi=4022206466,Zi=16843009,Qi;(function(e){e[e.RAWTX=0]=`RAWTX`,e[e.RAWTX_AND_BUMP_INDEX=1]=`RAWTX_AND_BUMP_INDEX`,e[e.TXID_ONLY=2]=`TXID_ONLY`})(Qi||={});function $i(e,t){if(!Number.isSafeInteger(t)||t<0||e.pos+t>e.bin.length)throw RangeError(`Serialized transaction exceeds available BEEF data`);e instanceof Yt?e.skip(t):e.pos+=t}function ea(e){let t=e.pos;$i(e,4);let n=e.readVarIntNum(!1),r=new Set;for(let t=0;t<n;t++)r.add(E(e.readReverse(32))),$i(e,4),$i(e,e.readVarIntNum(!1)+4);let i=e.readVarIntNum(!1);for(let t=0;t<i;t++)$i(e,8),$i(e,e.readVarIntNum(!1));return $i(e,4),{rawTx:e instanceof Yt?e.bin.subarray(t,e.pos):Uint8Array.from(e.bin.slice(t,e.pos)),inputTxids:Array.from(r)}}function ta(e){return ea(new Yt(e)).inputTxids}function na(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}var ra=class e{_bumpIndex;_tx;_rawTx;_txid;inputTxids=[];isValid=void 0;get bumpIndex(){return this._bumpIndex}set bumpIndex(e){this._bumpIndex=e,this.updateInputTxids()}get hasProof(){return this._bumpIndex!==void 0}get isTxidOnly(){return this._txid!==void 0&&this._txid!==null&&this._rawTx==null&&this._tx==null}get txid(){if(this._txid!==void 0&&this._txid!==null&&this._txid!==``)return this._txid;if(this._tx!=null)return this._txid=this._tx.id(`hex`),this._txid;if(this._rawTx!=null)return this._txid=E(Qe(this._rawTx).reverse()),this._txid;throw Error(`Internal`)}get tx(){if(this._tx!=null)return this._tx;if(this._rawTx!=null)return this._tx=ua.fromBinaryView(this._rawTx),this._tx}get rawTx(){let e=this.rawTxUint8Array;return e==null?void 0:Array.from(e)}get rawTxUint8Array(){return this._tx==null||(this._rawTx==null?this._rawTx=this._tx.toUint8Array():this.syncRawTxFromTransaction()),this._rawTx}syncRawTxFromTransaction(){if(this._tx==null)return!1;let e=this._tx.toUint8Array();if(this._rawTx!=null)return e!==this._rawTx&&(this._rawTx=e,this._txid=this._tx.id(`hex`),this.updateInputTxids(),!0);let t=this._tx.id(`hex`),n=this._txid!=null&&this._txid!==t,r=this.inputTxids;return this._txid=t,this.updateInputTxids(),n||!na(r,this.inputTxids)}constructor(e,t,n){if(typeof e==`string`)this._txid=e;else if(e instanceof Uint8Array)this._rawTx=e;else if(Array.isArray(e))this._rawTx=new Uint8Array(e);else if(e instanceof ua)this._tx=e;else throw TypeError(`Invalid transaction data type`);this._bumpIndex=t,this.hasProof?this.inputTxids=[]:n==null?this.updateInputTxids():this.inputTxids=n}static fromTx(t,n){return new e(t,n)}static fromRawTx(t,n){return new e(t,n)}static fromTxid(t,n){return new e(t,n)}updateInputTxids(){if(this.hasProof)this.inputTxids=[];else if(this._tx!=null){let e=new Set;for(let t of this._tx.inputs)t.sourceTXID!==void 0&&t.sourceTXID!==null&&t.sourceTXID!==``&&e.add(t.sourceTXID);this.inputTxids=Array.from(e)}else this.inputTxids=this._rawTx==null?[]:ta(this._rawTx)}toWriter(e,t){let n=t=>{e.writeUInt8(t)},r=()=>{if(this._txid==null)throw Error(`Transaction ID (_txid) is undefined`);e.writeReverse(tn(this._txid,`hex`))},i=()=>{let t=this.rawTxUint8Array;if(t==null)throw Error(`a valid serialized Transaction is expected`);e.write(t)};t===4022206466?this.isTxidOnly?(n(Qi.TXID_ONLY),r()):this.bumpIndex===void 0?(n(Qi.RAWTX),i()):(n(Qi.RAWTX_AND_BUMP_INDEX),e.writeVarIntNum(this.bumpIndex),i()):(i(),this.bumpIndex===void 0?n(Qi.RAWTX):(n(Qi.RAWTX_AND_BUMP_INDEX),e.writeVarIntNum(this.bumpIndex)))}static fromReader(t,n){let r,i;if(n===4022206466){let n=t.readUInt8();if(n===Qi.TXID_ONLY)i=e.fromTxid(E(t.readReverse(32)));else{n===Qi.RAWTX_AND_BUMP_INDEX&&(r=t.readVarIntNum());let{rawTx:a,inputTxids:o}=ea(t);i=new e(a,r,o)}}else{let{rawTx:n,inputTxids:a}=ea(t);r=t.readUInt8()===0?void 0:t.readVarIntNum(),i=new e(n,r,a)}return i}};function ia(e,t,n,r){if(t.path.length!==n)throw Error(`Mismatched roots`);for(let i=0;i<n;i++)aa(e[i],t.path[i],r)}function aa(e,t,n){for(let r of t){let t=e.get(r.offset);if(t==null){e.set(r.offset,r);continue}oa(t,r,n)}}function oa(e,t,n){if(n&&(e.hash!==t.hash||e.duplicate!==t.duplicate))throw Error(`Mismatched roots`);t.txid!=null&&(e.txid=!0)}function sa(e,t,n){for(let r of e.path[0])typeof r.hash==`string`&&n.set(r.hash,t)}var ca=class e{bumps=[];txs=[];version=Xi;atomicTxid=void 0;txidIndex=void 0;txPositionIndex=void 0;bumpIndexesByHeight=void 0;bumpIndexByTxid=void 0;rawBytesCache;hexCache;atomicBytesCache=new Map;atomicCacheTxs;atomicCacheBumps;atomicCacheVersion;rawCacheVersion;rawCacheTxs;rawCacheBumps;bumpState;needsSort=!0;sortResultCache;sortTxState;constructor(e=Xi){this.version=e}invalidateSerializationCaches(){this.rawBytesCache=void 0,this.hexCache=void 0,this.atomicBytesCache.clear(),this.atomicCacheTxs=void 0,this.atomicCacheBumps=void 0,this.atomicCacheVersion=void 0,this.rawCacheVersion=void 0,this.rawCacheTxs=void 0,this.rawCacheBumps=void 0}captureSerializationState(){this.rawCacheVersion=this.version,this.rawCacheTxs=this.captureTransactionState(),this.rawCacheBumps=Array.from(this.bumps),this.captureBumpState()}captureTransactionState(){return this.txs.map(e=>({ref:e,bumpIndex:e._bumpIndex,rawTx:e._rawTx,tx:e._rawTx==null?e._tx:void 0,txid:e._rawTx==null&&e._tx==null?e._txid:void 0}))}transactionStateMatches(e){if(e?.length!==this.txs.length)return!1;for(let t=0;t<this.txs.length;t++){let n=this.txs[t],r=e[t];if(r.ref!==n||r.bumpIndex!==n._bumpIndex||r.rawTx!==n._rawTx||r.tx!==(n._rawTx==null?n._tx:void 0)||r.txid!==(n._rawTx==null&&n._tx==null?n._txid:void 0))return!1}return!0}captureBumpState(){this.bumpState=this.bumps.map(e=>({ref:e,blockHeight:e.blockHeight,levels:e.path.map(e=>({ref:e,leaves:e.map(e=>({ref:e,offset:e.offset,hash:e.hash,txid:e.txid,duplicate:e.duplicate}))}))}))}bumpLeafStateMatches(e,t){return t.ref===e&&t.offset===e.offset&&t.hash===e.hash&&t.txid===e.txid&&t.duplicate===e.duplicate}bumpLevelStateMatches(e,t){return t.ref===e&&t.leaves.length===e.length&&e.every((e,n)=>this.bumpLeafStateMatches(e,t.leaves[n]))}singleBumpStateMatches(e,t){return t.ref===e&&t.blockHeight===e.blockHeight&&t.levels.length===e.path.length&&e.path.every((e,n)=>this.bumpLevelStateMatches(e,t.levels[n]))}bumpStateMatches(){return this.bumpState?.length===this.bumps.length&&this.bumps.every((e,t)=>this.singleBumpStateMatches(e,this.bumpState[t]))}synchronizeNestedBumpMutations(){if(this.bumpState==null){this.captureBumpState();return}this.bumpStateMatches()||(this.invalidateSerializationCaches(),this.sortResultCache=void 0,this.sortTxState=void 0,this.needsSort=!0,this.invalidateBumpIndexes(),this.captureBumpState())}serializationCacheMatchesState(){if(this.rawBytesCache==null||this.rawCacheVersion!==this.version||!this.transactionStateMatches(this.rawCacheTxs)||this.rawCacheBumps?.length!==this.bumps.length)return!1;for(let e=0;e<this.bumps.length;e++)if(this.rawCacheBumps[e]!==this.bumps[e])return!1;return!0}markMutated(e=!0){this.invalidateSerializationCaches(),this.sortResultCache=void 0,this.sortTxState=void 0,e&&(this.needsSort=!0)}ensureSerializableState(){for(let e of this.txs)e.txid}synchronizeNestedTransactionMutations(){let e=!1;for(let t of this.txs)e=t.syncRawTxFromTransaction()||e;e&&(this.invalidateSerializationCaches(),this.sortResultCache=void 0,this.sortTxState=void 0,this.needsSort=!0,this.rebuildTxIndexes())}ensureSortedForSerialization(){this.needsSort&&this.sortTxs()}getSerializedBytes(){if(this.synchronizeNestedTransactionMutations(),this.synchronizeNestedBumpMutations(),this.serializationCacheMatchesState()&&this.rawBytesCache!=null)return this.rawBytesCache;this.invalidateSerializationCaches(),this.ensureSerializableState(),this.ensureSortedForSerialization();let e=new Jt;return this.toWriter(e),this.rawBytesCache=e.toUint8Array(),this.captureSerializationState(),this.rawBytesCache}getBeefForAtomic(e){this.synchronizeNestedTransactionMutations(),this.synchronizeNestedBumpMutations();let t=this.ensureTxidIndex(),n=t.get(e);if(n==null)throw Error(`${e} does not exist in this Beef`);let r=this.collectAtomicTransactions(n,t),i=this.copySelectedTransactions(r);return i.sortTxs(),i}getAtomicSerializedBytes(e){this.synchronizeNestedTransactionMutations(),this.synchronizeNestedBumpMutations(),this.atomicCacheVersion===this.version&&this.transactionStateMatches(this.atomicCacheTxs)&&this.atomicCacheBumps?.length===this.bumps.length&&this.bumps.every((e,t)=>this.atomicCacheBumps?.[t]===e)||this.atomicBytesCache.clear();let t=this.atomicBytesCache.get(e);if(t!=null)return t;let n=this.getBeefForAtomic(e).getSerializedBytes(),r=en(e,`hex`),i=new Uint8Array(4+r.length+n.length);new DataView(i.buffer).setUint32(0,Zi,!0);for(let e=0;e<r.length;e++)i[4+e]=r[r.length-1-e];return i.set(n,4+r.length),this.atomicBytesCache.set(e,i),this.atomicCacheTxs=this.captureTransactionState(),this.atomicCacheBumps=Array.from(this.bumps),this.atomicCacheVersion=this.version,i}collectAtomicTransactions(e,t){let n=new Set,r=[e];for(;r.length>0;){let e=r.pop();if(!(e==null||n.has(e))&&(n.add(e),!(this.hasMatchingBump(e)||e.isTxidOnly)))for(let n of e.inputTxids){let e=t.get(n);e!=null&&r.push(e)}}return n}hasMatchingBump(e){let t=e.bumpIndex;return t==null||!Number.isSafeInteger(t)||t<0||t>=this.bumps.length?!1:this.bumps[t]?.path[0]?.some(t=>t.hash===e.txid)??!1}copySelectedTransactions(t){let n=new e(this.version),r=new Map;for(let e of this.txs)t.has(e)&&this.hasMatchingBump(e)&&e.bumpIndex!=null&&(r.has(e.bumpIndex)||(r.set(e.bumpIndex,n.bumps.length),n.bumps.push(this.bumps[e.bumpIndex])));for(let e of this.txs){if(!t.has(e))continue;let i=e.bumpIndex==null?void 0:r.get(e.bumpIndex),a;a=e._rawTx==null?e._tx==null?ra.fromTxid(e.txid,i):ra.fromTx(e._tx,i):new ra(e._rawTx,i,Array.from(e.inputTxids)),n.txs.push(a)}return n}isAtomic(e=this.atomicTxid??``){if(this.synchronizeNestedTransactionMutations(),this.synchronizeNestedBumpMutations(),e.length===0)return!1;let t=this.ensureTxidIndex();if(t.size!==this.txs.length)return!1;let n=t.get(e);return n!=null&&this.collectAtomicTransactions(n,t).size===this.txs.length}findTxid(e){return this.synchronizeNestedTransactionMutations(),this.findTxidIndexed(e)}findTxidIndexed(e){return this.ensureTxidIndex().get(e)}ensureTxidIndex(){return(this.txidIndex==null||this.txPositionIndex==null)&&this.rebuildTxIndexes(),this.txidIndex}ensureTxPositionIndex(){return(this.txPositionIndex==null||this.txidIndex==null)&&this.rebuildTxIndexes(),this.txPositionIndex}rebuildTxIndexes(){this.txidIndex=new Map,this.txPositionIndex=new Map;for(let e=0;e<this.txs.length;e++){let t=this.txs[e];this.txidIndex.set(t.txid,t),this.txPositionIndex.set(t.txid,e)}}deleteFromIndex(e){this.txidIndex?.delete(e),this.txPositionIndex?.delete(e)}addToIndex(e,t=this.txs.length-1){this.txidIndex?.set(e.txid,e),this.txPositionIndex?.set(e.txid,t)}replaceOrAppendTx(e){let t=this.ensureTxPositionIndex().get(e.txid);t===void 0?(this.txs.push(e),this.addToIndex(e)):(this.txs[t]=e,this.addToIndex(e,t))}makeTxidOnly(e){let t=this.ensureTxPositionIndex().get(e);if(t===void 0)return;let n=this.txs[t];return n.isTxidOnly?n:(n=ra.fromTxid(e),this.txs[t]=n,this.addToIndex(n,t),this.tryToValidateBumpIndex(n),this.markMutated(!0),n)}findBump(e){this.synchronizeNestedBumpMutations();let t=this.ensureBumpTxidIndex().get(e);return t===void 0?void 0:this.bumps[t]}ensureBumpTxidIndex(){if(this.bumpIndexByTxid==null){this.bumpIndexByTxid=new Map;for(let e=0;e<this.bumps.length;e++)for(let t of this.bumps[e].path[0])typeof t.hash==`string`&&this.bumpIndexByTxid.set(t.hash,e)}return this.bumpIndexByTxid}ensureBumpHeightIndex(){if(this.bumpIndexesByHeight==null){this.bumpIndexesByHeight=new Map;for(let e=0;e<this.bumps.length;e++){let t=this.bumps[e],n=this.bumpIndexesByHeight.get(t.blockHeight)??[];n.push(e),this.bumpIndexesByHeight.set(t.blockHeight,n)}}return this.bumpIndexesByHeight}invalidateBumpIndexes(){this.bumpIndexesByHeight=void 0,this.bumpIndexByTxid=void 0}findTransactionForSigning(e){let t=this.findTxid(e);if(t?.tx!=null){for(let e of t.tx.inputs)if(e.sourceTransaction==null){let t=this.findTxidIndexed(Sn(e.sourceTXID,`sourceTXID must be valid`));t!=null&&(e.sourceTransaction=t.tx)}return t.tx}}findAtomicTransaction(e){let t=this.findTxid(e);if(t?.tx!=null)return this.addInputProof(t.tx),t.tx}addInputProof(e){let t=new Set,n=[e];for(;n.length>0;){let e=n.pop();if(e==null)continue;let r=e.id(`hex`);if(t.has(r))continue;t.add(r);let i=this.findBump(r);if(i!=null){e.merklePath=i;continue}for(let t of e.inputs)this.resolveInputSource(t),t.sourceTransaction!=null&&n.push(t.sourceTransaction)}}resolveInputSource(e){if(e.sourceTransaction==null){let t=this.findTxidIndexed(Sn(e.sourceTXID,`sourceTXID must be valid`));t!=null&&(e.sourceTransaction=t.tx)}}mergeBump(e){return this.synchronizeNestedTransactionMutations(),this.synchronizeNestedBumpMutations(),this.markMutated(!1),this.mergeBumpEntry(e)}mergeProvenTxs(e){if(e.length===0)return[];this.synchronizeNestedTransactionMutations(),this.synchronizeNestedBumpMutations(),this.markMutated(!0);let t=[];for(let n of e)t.push(this.mergeRawTxEntry(n.rawTx));let n=new Map;for(let t of e){let e=t.merklePath.blockHeight;n.set(e,(n.get(e)??0)+1)}let r=new Map;for(let t=0;t<e.length;t++){let i=e[t].merklePath,a=e[t].merkleRoot,o=n.get(i.blockHeight)===1?`${i.blockHeight}:single:${t}`:`${i.blockHeight}:${a??i.computeRoot()}`,s=r.get(o);s==null?r.set(o,{first:t,paths:[i],validateCombined:a!=null}):(s.paths.push(i),s.validateCombined=s.validateCombined||a!=null)}for(let e of[...r.values()].sort((e,t)=>e.first-t.first))this.mergeBumpEntry(this.combineCompatibleBumps(e.paths,e.validateCombined));return t}combineCompatibleBumps(e,t=!1){let n=e[0];if(e.length===1&&!t)return n;let r=n.path.map(e=>new Map(e.map(e=>[e.offset,e])));for(let i=1;i<e.length;i++)ia(r,e[i],n.path.length,t);let i=r.map(e=>[...e.values()]);if(t){let e=new Ji(n.blockHeight,i);return e.trim(),e}return n.path=i,n.trim(),n}mergeBumpEntry(e){let t=this.findOrInsertBump(e),n=this.bumps[t],r=this.ensureTxidIndex();for(let e of n.path[0]){if(typeof e.hash!=`string`)continue;let i=r.get(e.hash);i!=null&&i.bumpIndex==null&&this.tryMarkTxProvenByBump(i,n,t)}return t}findOrInsertBump(e){let t=this.ensureBumpHeightIndex(),n=this.ensureBumpTxidIndex(),r=t.get(e.blockHeight)??[];if(r.length>0){let t=e.computeRoot();for(let i of r)if(this.bumps[i].computeRoot()===t)return this.bumps[i].combine(e),sa(this.bumps[i],i,n),i}this.bumps.push(e);let i=this.bumps.length-1;return r.push(i),t.set(e.blockHeight,r),sa(e,i,n),i}tryMarkTxProvenByBump(e,t,n){let r=e.txid;for(let i of t.path[0])if(i.hash===r){e.bumpIndex=n,i.txid=!0;break}}mergeRawTx(e,t){return this.synchronizeNestedTransactionMutations(),this.markMutated(!0),this.mergeRawTxEntry(e,t)}mergeRawTxEntry(e,t){let n=new ra(e,t);return this.replaceOrAppendTx(n),this.tryToValidateBumpIndex(n),n}mergeTransactionEntry(e){let t=new ra(e,e.merklePath==null?void 0:this.mergeBumpEntry(e.merklePath));return this.replaceOrAppendTx(t),this.tryToValidateBumpIndex(t),t}queueSourceTransactions(e,t){for(let n=e.inputs.length-1;n>=0;n--){let r=e.inputs[n].sourceTransaction;r!=null&&t.push(r)}}mergeTransaction(e){return this.synchronizeNestedTransactionMutations(),this.markMutated(!0),this.mergeTransactionGraph(e)}mergeTransactionGraph(e){e.materializeSourceTXIDs();let t=e.id(`hex`),n=new Set,r=[e],i;for(;r.length>0;){let e=r.pop();if(e==null)continue;let a=e.id(`hex`);if(n.has(a))continue;n.add(a);let o=this.mergeTransactionEntry(e);a===t&&(i=o),o.bumpIndex===void 0&&this.queueSourceTransactions(e,r)}if(i==null)throw Error(`Failed to merge root transaction`);return i}removeExistingTxid(e){let t=this.ensureTxPositionIndex().get(e);t!==void 0&&(this.txs.splice(t,1),this.rebuildTxIndexes(),this.markMutated(!0))}mergeTxidOnly(e){let t=this.findTxid(e);return t??(t=new ra(e),this.txs.push(t),this.addToIndex(t),this.tryToValidateBumpIndex(t),this.markMutated(!0)),t}mergeBeefTx(e){let t=this.findTxid(e.txid);if(e.isTxidOnly&&t==null?t=this.mergeTxidOnly(e.txid):e._tx!=null&&(t==null||t.isTxidOnly)?t=this.mergeTransaction(e._tx):e._rawTx!=null&&(t==null||t.isTxidOnly)&&(t=this.mergeRawTx(e._rawTx)),t==null)throw Error(`Failed to merge BeefTx for txid: ${e.txid}`);return t}mergeBeefTxEntry(e){let t=this.findTxidIndexed(e.txid);if(e.isTxidOnly&&t==null?(t=ra.fromTxid(e.txid),this.txs.push(t),this.addToIndex(t),this.tryToValidateBumpIndex(t)):e._tx!=null&&(t==null||t.isTxidOnly)?t=this.mergeTransactionGraph(e._tx):e._rawTx!=null&&(t==null||t.isTxidOnly)&&(t=this.mergeRawTxEntry(e._rawTx)),t==null)throw Error(`Failed to merge BeefTx for txid: ${e.txid}`);return t}mergeBeef(t){let n=t instanceof e?t:e.fromBinary(t);this.synchronizeNestedTransactionMutations(),this.synchronizeNestedBumpMutations(),this.markMutated(!0);for(let e of n.bumps)this.mergeBumpEntry(e);for(let e of n.txs)this.mergeBeefTxEntry(e)}isValid(e){return this.verifyValid(e).valid}async verify(e,t){let n=this.verifyValid(t);if(!n.valid)return!1;for(let t of Object.keys(n.roots))if(!await e.isValidRootForHeight(n.roots[t],Number(t)))return!1;return!0}verifyValid(e){this.synchronizeNestedBumpMutations();let t={valid:!1,roots:{}};if(this.atomicTxid!=null&&!this.isAtomic(this.atomicTxid))return t;let n=this.sortTxs();if(this.hasDuplicateTxids()||n.missingInputs.length>0||n.notValid.length>0||n.txidOnly.length>0&&e!==!0||n.withMissingInputs.length>0)return t;let r={};return!this.collectTxidOnlyTxids(r,e)||!this.collectBumpTxids(r,t)||!this.verifyBumpIndexLeaves()||!this.verifyInputDependencies(r)||(t.valid=!0),t}hasDuplicateTxids(){let e=new Set;for(let t of this.txs){if(e.has(t.txid))return!0;e.add(t.txid)}return!1}collectTxidOnlyTxids(e,t){for(let n of this.txs)if(n.isTxidOnly){if(t!==!0)return!1;e[n.txid]=!0}return!0}collectBumpTxids(e,t){for(let n of this.bumps)for(let r of n.path[0])if(r.txid===!0&&typeof r.hash==`string`&&r.hash.length!==0&&(e[r.hash]=!0,!this.confirmComputedRoot(n,r.hash,t)))return!1;return!0}verifyBumpIndexLeaves(){for(let e of this.txs)if(e.bumpIndex!==void 0&&(!Number.isSafeInteger(e.bumpIndex)||e.bumpIndex<0||e.bumpIndex>=this.bumps.length||this.bumps[e.bumpIndex]?.path[0]?.find(t=>t.hash===e.txid)==null))return!1;return!0}verifyInputDependencies(e){for(let t of this.txs){for(let n of t.inputTxids)if(!e[n])return!1;e[t.txid]=!0}return!0}confirmComputedRoot(e,t,n){let r=e.computeRoot(t);return(n.roots[e.blockHeight]===void 0||n.roots[e.blockHeight]===``)&&(n.roots[e.blockHeight]=r),n.roots[e.blockHeight]===r}toWriter(e){e.writeUInt32LE(this.version),e.writeVarIntNum(this.bumps.length);for(let t of this.bumps)e.write(e instanceof Jt?t.toBinaryUint8Array():t.toBinary());e.writeVarIntNum(this.txs.length);for(let t of this.txs)t.toWriter(e,this.version)}toBinary(){return Array.from(this.getSerializedBytes())}toUint8Array(){return this.getSerializedBytes()}toBinaryAtomic(e){return Array.from(this.getAtomicSerializedBytes(e))}toUint8ArrayAtomic(e){return this.getAtomicSerializedBytes(e)}toHex(){let e=this.getSerializedBytes();if(this.hexCache!=null)return this.hexCache;let t=E(e);return this.hexCache=t,t}static fromReader(t){let n=t.pos,r=t.readUInt32LE(),i,a=n;if(r===16843009&&(i=E(t.readReverse(32)),a=t.pos,r=t.readUInt32LE()),r!==4022206465&&r!==4022206466)throw Error(`Serialized BEEF must start with ${Yi} or ${Xi} but starts with ${r}`);let o=new e(r),s=t.readVarIntNum();for(let e=0;e<s;e++){let e=Ji.fromReader(t,!1);o.bumps.push(e)}let c=t.readVarIntNum();for(let e=0;e<c;e++){let e=ra.fromReader(t,r);o.txs.push(e)}return o.atomicTxid=i,t instanceof Yt&&(o.rawBytesCache=t.bin.subarray(a,t.pos),o.captureSerializationState()),o}static fromBinary(t){return e.fromReader(new Yt(Uint8Array.from(t)))}static fromBinaryView(t){let n=new Yt(t),r=e.fromReader(n);if(!n.eof())throw Error(`Serialized BEEF contains trailing data`);return r}static fromString(t,n=`hex`){let r=new Yt(en(t,n));return e.fromReader(r)}tryToValidateBumpIndex(e){if(e.bumpIndex!==void 0)return!0;let t=e.txid,n=this.ensureBumpTxidIndex().get(t);if(n===void 0)return!1;e.bumpIndex=n;let r=this.bumps[n].path[0].find(e=>e.hash===t);return r!=null&&(r.txid=!0),!0}sortTxs(){if(this.synchronizeNestedTransactionMutations(),this.synchronizeNestedBumpMutations(),this.sortResultCache!=null&&this.sortTxStateMatches())return this.cloneSortResult(this.sortResultCache);this.sortResultCache=void 0,this.sortTxState=void 0;let e={},t={},n=[],r=[],i=this.partitionTxs(t,e,n,r),{txsMissingInputs:a,missingInputs:o,remaining:s}=this.separateMissingInputs(i,t);i=s;let c=this.topoSort(i,e,n);this.txs=a.concat(c).concat(r).concat(n),this.needsSort=!1,this.invalidateSerializationCaches(),this.rebuildTxIndexes();let l={missingInputs:Object.keys(o),notValid:c.map(e=>e.txid),valid:Object.keys(e),withMissingInputs:a.map(e=>e.txid),txidOnly:r.map(e=>e.txid)};return this.sortResultCache=l,this.captureSortTxState(),this.cloneSortResult(l)}captureSortTxState(){this.sortTxState=this.txs.map(e=>({ref:e,txid:e.txid,bumpIndex:e.bumpIndex,isTxidOnly:e.isTxidOnly,inputTxids:[...e.inputTxids]}))}sortTxStateMatches(){if(this.sortTxState?.length!==this.txs.length)return!1;for(let e=0;e<this.txs.length;e++){let t=this.txs[e],n=this.sortTxState[e];if(n.ref!==t||n.txid!==t.txid||n.bumpIndex!==t.bumpIndex||n.isTxidOnly!==t.isTxidOnly||n.inputTxids.length!==t.inputTxids.length)return!1;for(let e=0;e<t.inputTxids.length;e++)if(n.inputTxids[e]!==t.inputTxids[e])return!1}return!0}cloneSortResult(e){return{missingInputs:[...e.missingInputs],notValid:[...e.notValid],valid:[...e.valid],withMissingInputs:[...e.withMissingInputs],txidOnly:[...e.txidOnly]}}partitionTxs(e,t,n,r){let i=[];for(let a of this.txs)e[a.txid]=a,a.isValid=a.hasProof,a.isValid?(t[a.txid]=!0,n.push(a)):a.isTxidOnly&&a.inputTxids.length===0?(t[a.txid]=!0,r.push(a)):i.push(a);return i}separateMissingInputs(e,t){let n={},r=[],i=[];for(let a of e){let e=!1;for(let r of a.inputTxids)t[r]===void 0&&(n[r]=!0,e=!0);e?r.push(a):i.push(a)}return{txsMissingInputs:r,missingInputs:n,remaining:i}}topoSort(e,t,n){let{indegree:r,dependents:i,originalIndex:a,round:o}=this.buildTopoSortGraph(e,t),s=this.processTopoSortQueue(e,r,i,a,o);return this.appendTopoSortResult(e,s,o,t,n),e.filter(e=>!s.has(e.txid))}buildTopoSortGraph(e,t){let n=new Set(e.map(e=>e.txid)),r=new Map,i=new Map,a=new Map(e.map((e,t)=>[e.txid,t])),o=new Map;for(let a of e){let e=0;for(let r of a.inputTxids)if(!t[r]&&(e++,n.has(r))){let e=i.get(r)??[];e.push(a),i.set(r,e)}r.set(a.txid,e),o.set(a.txid,0)}return{indegree:r,dependents:i,originalIndex:a,round:o}}processTopoSortQueue(e,t,n,r,i){let a=e.filter(e=>t.get(e.txid)===0),o=new Set;for(let e of a)if(!o.has(e.txid)){o.add(e.txid);for(let o of n.get(e.txid)??[]){let n=(i.get(e.txid)??0)+ +((r.get(e.txid)??0)>(r.get(o.txid)??0));i.set(o.txid,Math.max(i.get(o.txid)??0,n));let s=(t.get(o.txid)??0)-1;t.set(o.txid,s),s===0&&a.push(o)}}return o}appendTopoSortResult(e,t,n,r,i){let a=[];for(let r of e){if(!t.has(r.txid))continue;let e=n.get(r.txid)??0,i=a[e]??[];i.push(r),a[e]=i}for(let e of a)for(let t of e??[])r[t.txid]=!0,i.push(t)}clone(){let t=new e;return t.version=this.version,t.bumps=Array.from(this.bumps),t.txs=Array.from(this.txs),t.txidIndex=void 0,t.txPositionIndex=void 0,t.bumpIndexesByHeight=void 0,t.bumpIndexByTxid=void 0,t.needsSort=this.needsSort,t.sortResultCache=this.sortResultCache==null?void 0:this.cloneSortResult(this.sortResultCache),t.sortResultCache!=null&&t.captureSortTxState(),t.hexCache=this.hexCache,t.rawBytesCache=this.rawBytesCache,t.rawBytesCache!=null&&t.captureSerializationState(),t}trimKnownTxids(e){let t=this.removeKnownTxidOnlyTxs(new Set(e));t=this.reindexBumps()||t,t&&this.markMutated(!0)}removeKnownTxidOnlyTxs(e){let t=this.txs.length;this.txs=this.txs.filter(t=>!(t.isTxidOnly&&e.has(t.txid)));let n=this.txs.length!==t;return n&&this.rebuildTxIndexes(),n}reindexBumps(){let e=new Set;for(let t of this.txs)t.bumpIndex!==void 0&&e.add(t.bumpIndex);if(e.size>=this.bumps.length)return!1;let t=new Map,n=0;for(let r=0;r<this.bumps.length;r++)e.has(r)&&(t.set(r,n),n++);this.bumps=this.bumps.filter((t,n)=>e.has(n));for(let e of this.txs){if(e.bumpIndex===void 0)continue;let n=t.get(e.bumpIndex);if(n===void 0)throw Error(`Internal error: bumpIndex ${e.bumpIndex} not found in indexMap`);e.bumpIndex=n}return this.invalidateBumpIndexes(),!0}getValidTxids(){return this.sortTxs().valid}toLogString(){let e=``;e+=`BEEF with ${this.bumps.length} BUMPS and ${this.txs.length} Transactions, isValid ${this.isValid().toString()}\n`;let t=-1;for(let n of this.bumps)t++,e+=` BUMP ${t}\n block: ${n.blockHeight}\n txids: [\n${n.path[0].filter(e=>e.txid===!0).map(e=>` '${e.hash??``}'`).join(`,
|
|
17
17
|
`)}\n ]\n`;t=-1;for(let n of this.txs)if(t++,e+=` TX ${t}\n txid: ${n.txid}\n`,n.bumpIndex!==void 0&&(e+=` bumpIndex: ${n.bumpIndex}\n`),n.isTxidOnly?e+=` txidOnly
|
|
18
18
|
`:e+=` rawTx length=${n.rawTx?.length??0}\n`,n.inputTxids.length>0){let t=n.inputTxids.map(e=>` '${e}'`).join(`,
|
|
19
|
-
`);e+=` inputs: [\n${t}\n ]\n`}return e}addComputedLeaves(){for(let e of this.bumps)for(let t=1;t<e.path.length;t++)this.addComputedLeavesForRow(e,t)}addComputedLeavesForRow(e,t){let n=e=>tn($e(rn(e,`hex`).reverse()).reverse());for(let r of e.path[t-1]){if(typeof r.hash!=`string`||r.offset&1)continue;let i=e.path[t-1].find(e=>e.offset===r.offset+1);if(i===void 0||typeof i.hash!=`string`)continue;let a=r.offset>>1;e.path[t].every(e=>e.offset!==a)&&e.path[t].push({offset:a,hash:n(i.hash+r.hash)})}}},fa=943816,pa=class e{version;inputs;outputs;lockTime;metadata;merklePath;cachedHash;cachedIdHex;rawBytesCache;efBytesCache;hexCache;activeSignatureHashCache;rawCacheState;getSignatureHashCache(){return this.activeSignatureHashCache??{hashOutputsSingle:new Map}}completeSourceTransaction(e,t,n){for(let t of e.inputs)t.sourceTXID==null&&t.sourceTransaction!=null&&(t.sourceTXID=t.sourceTransaction.id(`hex`));t.delete(e),n.add(e)}scheduleSourceTransactions(e,t,n,r){if(t.has(e))throw Error(`Cyclic source transaction graph`);t.add(e),r.push({tx:e,expanded:!0});for(let t=e.inputs.length-1;t>=0;t--){let i=e.inputs[t].sourceTransaction;e.inputs[t].sourceTXID==null&&i!=null&&!n.has(i)&&r.push({tx:i,expanded:!1})}}materializeSourceTXIDs(){let e=new Set,t=new Set,n=[{tx:this,expanded:!1}];for(;n.length>0;){let r=n.pop();if(r!=null&&!e.has(r.tx)){if(r.expanded){this.completeSourceTransaction(r.tx,t,e);continue}this.scheduleSourceTransactions(r.tx,t,e,n)}}}static fromBEEF(t,n){let{tx:r}=e.fromAnyBeef(t,n);return r}static fromBEEFView(t,n){let{tx:r}=e.fromAnyBeef(t,n,!0);return r}static fromAtomicBEEF(t){let{tx:n,txid:r,beef:i}=e.fromAnyBeef(t);if(r!==i.atomicTxid)throw i.atomicTxid==null?Error(`beef must conform to BRC-95 and must contain the subject txid.`):Error(`Transaction with TXID ${i.atomicTxid} not found in BEEF data.`);if(!i.isAtomic(r))throw Error(`Atomic BEEF contains unrelated transaction data.`);return n}static fromAtomicBEEFView(t){let{tx:n,txid:r,beef:i}=e.fromAnyBeef(t,void 0,!0);if(r!==i.atomicTxid)throw i.atomicTxid==null?Error(`beef must conform to BRC-95 and must contain the subject txid.`):Error(`Transaction with TXID ${i.atomicTxid} not found in BEEF data.`);if(!i.isAtomic(r))throw Error(`Atomic BEEF contains unrelated transaction data.`);return n}static fromAnyBeef(e,t,n=!1){let r=n&&e instanceof Uint8Array?da.fromBinaryView(e):da.fromBinary(e);if(r.txs.length<1)throw Error(`beef must include at least one transaction.`);let i=r.txs.at(-1);if(i==null)throw Error(`beef must include at least one transaction.`);let a=t??r.atomicTxid??i.txid,o=r.findAtomicTransaction(a);if(o==null)throw Error(t==null?`beef does not contain transaction for atomic txid.`:`Transaction with TXID ${String(a)} not found in BEEF data.`);return{tx:o,beef:r,txid:a}}static fromEF(t){let n=Xt.makeReader(t),r=n.readUInt32LE();if(tn(n.read(6))!==`0000000000ef`)throw Error(`Invalid EF marker`);let i=n.readVarIntNum(),a=[];for(let t=0;t<i;t++){let t=tn(n.readReverse(32)),r=n.readUInt32LE(),i=n.readVarIntNum(),o=n.read(i),s=ei.fromBinary(o),c=n.readUInt32LE(),l=n.readUInt64LEBn().toNumber(),u=n.readVarIntNum(),d=n.read(u),f=$r.fromBinary(d),p=new e(void 0,[],[],void 0);p.outputs=Array.from({length:r+1}).fill(null),p.outputs[r]={satoshis:l,lockingScript:f},a.push({sourceTransaction:p,sourceTXID:t,sourceOutputIndex:r,unlockingScript:s,sequence:c})}let o=n.readVarIntNum(),s=[];for(let e=0;e<o;e++){let e=n.readUInt64LEBn().toNumber(),t=n.readVarIntNum(),r=n.read(t),i=$r.fromBinary(r);s.push({satoshis:e,lockingScript:i})}let c=n.readUInt32LE();return new e(r,a,s,c)}static parseScriptOffsets(e){let t=Xt.makeReader(e),n=[],r=[];t.pos+=4;let i=t.readVarIntNum();for(let e=0;e<i;e++){t.pos+=36;let r=t.readVarIntNum();n.push({vin:e,offset:t.pos,length:r}),t.pos+=r+4}let a=t.readVarIntNum();for(let e=0;e<a;e++){t.pos+=8;let n=t.readVarIntNum();r.push({vout:e,offset:t.pos,length:n}),t.pos+=n}return{inputs:n,outputs:r}}static fromReader(t){return e.fromReaderInternal(t,!1)}static fromReaderInternal(t,n){let r=t.readUInt32LE(),i=t.readVarIntNum(),a=[];for(let e=0;e<i;e++){let e=tn(t.readReverse(32)),r=t.readUInt32LE(),i=t.readVarIntNum(),o=n&&t instanceof Xt?t.readView(i):t.read(i),s=n&&o instanceof Uint8Array?ei.fromBinaryView(o):ei.fromBinary(o),c=t.readUInt32LE();a.push({sourceTXID:e,sourceOutputIndex:r,unlockingScript:s,sequence:c})}let o=t.readVarIntNum(),s=[];for(let e=0;e<o;e++){let e=t.readUInt64LEBn().toNumber(),r=t.readVarIntNum(),i=n&&t instanceof Xt?t.readView(r):t.read(r),a=n&&i instanceof Uint8Array?$r.fromBinaryView(i):$r.fromBinary(i);s.push({satoshis:e,lockingScript:a})}let c=t.readUInt32LE();return new e(r,a,s,c)}static fromBinary(t){let n=Uint8Array.from(t),r=new Xt(n),i=e.fromReaderInternal(r,!0);return i.rawBytesCache=n,i.captureSerializationState(),i}static fromBinaryView(t){let n=new Xt(t),r=e.fromReaderInternal(n,!0);if(!n.eof())throw Error(`Serialized transaction contains trailing data`);return r.rawBytesCache=t,r.captureSerializationState(),r}static fromHex(t){let n=nn(t,`hex`),r=new Xt(n),i=e.fromReaderInternal(r,!0);return i.rawBytesCache=n,i.hexCache=tn(n),i.captureSerializationState(),i}static fromHexEF(t){return e.fromEF(nn(t,`hex`))}static fromHexBEEF(t,n){return e.fromBEEF(rn(t,`hex`),n)}constructor(e=1,t=[],n=[],r=0,i=new Map,a){this.version=e,this.inputs=t,this.outputs=n,this.lockTime=r,this.metadata=i,this.merklePath=a}invalidateSerializationCaches(){this.cachedHash=void 0,this.cachedIdHex=void 0,this.rawBytesCache=void 0,this.efBytesCache=void 0,this.hexCache=void 0,this.rawCacheState=void 0}sourceTransactionId(e){return e.sourceTXID==null?e.sourceTransaction?.id(`hex`):void 0}captureSerializationState(){this.rawCacheState={version:this.version,lockTime:this.lockTime,inputs:this.inputs.map(e=>{let t=e.sourceTransaction?.outputs[e.sourceOutputIndex];return{ref:e,sourceTXID:e.sourceTXID,sourceTransactionId:this.sourceTransactionId(e),sourceOutputIndex:e.sourceOutputIndex,sequence:e.sequence,unlockingScript:e.unlockingScript,unlockingScriptBytes:e.unlockingScript?.toUint8Array(),sourceOutput:t,sourceSatoshis:t?.satoshis,sourceLockingScript:t?.lockingScript,sourceLockingScriptBytes:t?.lockingScript.toUint8Array()}}),outputs:this.outputs.map(e=>({ref:e,satoshis:e.satoshis,lockingScript:e.lockingScript,lockingScriptBytes:e.lockingScript.toUint8Array()}))}}serializationCacheMatchesState(){let e=this.rawCacheState;if(e?.version!==this.version||e.lockTime!==this.lockTime||e.inputs.length!==this.inputs.length||e.outputs.length!==this.outputs.length)return!1;for(let t=0;t<this.inputs.length;t++){let n=this.inputs[t],r=e.inputs[t],i=n.sourceTransaction?.outputs[n.sourceOutputIndex];if(r.ref!==n||r.sourceTXID!==n.sourceTXID||r.sourceTransactionId!==this.sourceTransactionId(n)||r.sourceOutputIndex!==n.sourceOutputIndex||r.sequence!==n.sequence||r.unlockingScript!==n.unlockingScript||r.unlockingScriptBytes!==n.unlockingScript?.toUint8Array()||r.sourceOutput!==i||r.sourceSatoshis!==i?.satoshis||r.sourceLockingScript!==i?.lockingScript||r.sourceLockingScriptBytes!==i?.lockingScript.toUint8Array())return!1}for(let t=0;t<this.outputs.length;t++){let n=this.outputs[t],r=e.outputs[t];if(r.ref!==n||r.satoshis!==n.satoshis||r.lockingScript!==n.lockingScript||r.lockingScriptBytes!==n.lockingScript.toUint8Array())return!1}return!0}addInput(e){if(e.sourceTXID===void 0&&e.sourceTransaction===void 0)throw TypeError(`A reference to an an input transaction is required. If the input transaction itself cannot be referenced, its TXID must still be provided.`);e.sequence??=4294967295,this.invalidateSerializationCaches(),this.inputs.push(e)}addOutput(e){if(this.invalidateSerializationCaches(),e.change!==!0){if(e.satoshis===void 0)throw TypeError(`either satoshis must be defined or change must be set to true`);if(e.satoshis<0)throw Error(`satoshis must be a positive integer or zero`)}if(e.lockingScript==null)throw Error(`lockingScript must be defined`);this.outputs.push(e)}addP2PKHOutput(e,t){let n=new ki().lock(e);if(t===void 0)return this.addOutput({lockingScript:n,change:!0});this.addOutput({lockingScript:n,satoshis:t})}updateMetadata(e){this.metadata={...this.metadata,...e}}async fee(e=Mi.getInstance(),t=`equal`){if(this.invalidateSerializationCaches(),typeof e==`number`){let t=e;e={computeFee:async()=>t}}let n=await e.computeFee(this),r=this.calculateChange(n);if(r<=0){this.outputs=this.outputs.filter(e=>e.change!==!0);return}this.distributeChange(r,t)}calculateChange(e){let t=0;for(let e of this.inputs){if(typeof e.sourceTransaction!=`object`)throw TypeError(`Source transactions are required for all inputs during fee computation`);t+=e.sourceTransaction.outputs[e.sourceOutputIndex].satoshis??0}t-=e;for(let e of this.outputs)e.change!==!0&&e.satoshis!==void 0&&(t-=e.satoshis);return t}distributeChange(e,t){let n=0,r=this.outputs.filter(e=>e.change);if(t===`random`?n=this.distributeRandomChange(e,r):t===`equal`&&(n=this.distributeEqualChange(e,r)),n<e){let t=this.outputs.at(-1);t.satoshis===void 0?t.satoshis=e-n:t.satoshis+=e-n}}distributeRandomChange(e,t){let n=0,r=e,i=Array.from({length:t.length}).fill(1);r-=t.length,n+=t.length;for(let e=0;e<t.length-1;e++){let t=this.benfordNumber(0,r);i[e]=i[e]+t,n+=t,r-=t}for(let e of this.outputs)e.change===!0&&(e.satoshis=i.shift());return n}distributeEqualChange(e,t){let n=0,r=Math.floor(e/t.length);for(let e of t)n+=r,e.satoshis=r;return n}benfordNumber(e,t){let n=Or(1)[0]%9+1;return Math.floor(e+(t-e)*Math.log10(1+1/n)/Math.log10(10))}getFee(){let e=0;for(let t of this.inputs){if(typeof t.sourceTransaction!=`object`)throw TypeError(`Source transactions or sourceSatoshis are required for all inputs to calculate fee`);e+=t.sourceTransaction.outputs[t.sourceOutputIndex].satoshis??0}let t=0;for(let e of this.outputs)t+=e.satoshis??0;return e-t}async sign(e={}){this.invalidateSerializationCaches();for(let e of this.outputs)if(e.satoshis===void 0)throw e.change===!0?Error(`There are still change outputs with uncomputed amounts. Use the fee() method to compute the change amounts and transaction fees prior to signing.`):Error(`One or more transaction outputs is missing an amount. Ensure all output amounts are provided before signing.`);this.materializeSourceTXIDs();let t=this.activeSignatureHashCache;this.activeSignatureHashCache={hashOutputsSingle:new Map};let n;try{n=await Promise.all(this.inputs.map(async(t,n)=>e.skipExistingSignatures===!0&&this.inputs[n].unlockingScript!=null?this.inputs[n].unlockingScript:typeof this.inputs[n].unlockingScriptTemplate==`object`?await this.inputs[n]?.unlockingScriptTemplate?.sign(this,n):await Promise.resolve(void 0)))}finally{this.activeSignatureHashCache=t}for(let e=0,t=this.inputs.length;e<t;e++)typeof this.inputs[e].unlockingScriptTemplate==`object`&&(this.inputs[e].unlockingScript=n[e]);this.invalidateSerializationCaches()}async broadcast(e=Gi()){return await e.broadcast(this)}writeTransactionBody(e){e.writeUInt32LE(this.version),e.writeVarIntNum(this.inputs.length);for(let t of this.inputs){if(t.sourceTXID===void 0){if(t.sourceTransaction==null)throw Error(`sourceTransaction is undefined`);e.write(t.sourceTransaction.hash())}else e.writeReverse(rn(t.sourceTXID,`hex`));if(e.writeUInt32LE(t.sourceOutputIndex),t.unlockingScript==null)throw Error(`unlockingScript is undefined`);let n=t.unlockingScript.toUint8Array();e.writeVarIntNum(n.length),e.write(n),e.writeUInt32LE(t.sequence??4294967295)}e.writeVarIntNum(this.outputs.length);for(let t of this.outputs){e.writeUInt64LE(t.satoshis??0);let n=t.lockingScript.toUint8Array();e.writeVarIntNum(n.length),e.write(n)}e.writeUInt32LE(this.lockTime)}buildSerializedBytes(){let e=new Yt;return this.writeTransactionBody(e),e.toUint8Array()}getSerializedBytes(){return(this.rawBytesCache==null||!this.serializationCacheMatchesState())&&(this.invalidateSerializationCaches(),this.rawBytesCache=this.buildSerializedBytes(),this.captureSerializationState()),this.rawBytesCache}toBinary(){return Array.from(this.getSerializedBytes())}toUint8Array(){return this.getSerializedBytes()}writeEF(e){e.writeUInt32LE(this.version),e.write([0,0,0,0,0,239]),e.writeVarIntNum(this.inputs.length);for(let t of this.inputs){if(t.sourceTransaction===void 0)throw TypeError(`All inputs must have source transactions when serializing to EF format`);if(t.sourceTXID===void 0?e.write(t.sourceTransaction.hash()):e.write(rn(t.sourceTXID,`hex`).reverse()),e.writeUInt32LE(t.sourceOutputIndex),t.unlockingScript==null)throw Error(`unlockingScript is undefined`);let n=t.unlockingScript.toUint8Array();e.writeVarIntNum(n.length),e.write(n),e.writeUInt32LE(t.sequence??4294967295),e.writeUInt64LE(t.sourceTransaction.outputs[t.sourceOutputIndex].satoshis??0);let r=t.sourceTransaction.outputs[t.sourceOutputIndex].lockingScript.toUint8Array();e.writeVarIntNum(r.length),e.write(r)}e.writeVarIntNum(this.outputs.length);for(let t of this.outputs){e.writeUInt64LE(t.satoshis??0);let n=t.lockingScript.toUint8Array();e.writeVarIntNum(n.length),e.write(n)}e.writeUInt32LE(this.lockTime)}toEF(){return Array.from(this.getEFBytes())}toEFUint8Array(){return this.toEFBinary()}getEFBytes(){if(this.efBytesCache==null||!this.serializationCacheMatchesState()){this.invalidateSerializationCaches();let e=new Yt;this.writeEF(e),this.efBytesCache=e.toUint8Array(),this.captureSerializationState()}return this.efBytesCache}toEFBinary(){return this.getEFBytes()}toHexEF(){return tn(this.toEFBinary())}toHex(){let e=this.getSerializedBytes();if(this.hexCache!=null)return this.hexCache;let t=tn(e);return this.hexCache=t,t}toHexBEEF(){return tn(this.toBEEF())}toHexAtomicBEEF(){return tn(this.toAtomicBEEF())}hash(e){let t=this.getSerializedBytes();return this.cachedHash??=$e(t),e===`hex`?tn(this.cachedHash):Array.from(this.cachedHash)}id(e){if(this.getSerializedBytes(),e===`hex`&&this.cachedIdHex!=null)return this.cachedIdHex;let t=[...this.hash()];return t.reverse(),e===`hex`?(this.cachedIdHex=tn(t),this.cachedIdHex):t}async completeVerificationFromMerklePath(e,t,n,r,i,a){if(typeof e.merklePath!=`object`)return!1;if(t)return i.add(e),!0;if(await e.merklePath.verify(r(),n))return a.add(r()),!0;throw Error(`Invalid merkle path for transaction ${r()}`)}async verifyTransactionFee(t,n,r){if(n===void 0)return;if(t===void 0)throw Error(`Transaction is undefined`);let i=e.fromEF(t.toEF());if(delete i.outputs[0].satoshis,i.outputs[0].change=!0,await i.fee(n),t.getFee()<i.getFee())throw Error(`Verification failed because the transaction ${r()} has an insufficient fee and has not been mined.`)}queueSourceTransactionForVerification(e,t,n){if(n.scriptsOnly){!n.verifiedTransactions.has(e)&&!n.queuedTransactions.has(e)&&(n.txQueue.push(e),n.queuedTransactions.add(e));return}!n.verifiedTxids.has(t)&&!n.queuedTxids.has(t)&&(n.txQueue.push(e),n.queuedTxids.add(t))}verifyTransactionInputs(e,t,n,r){let i=0,a={hashOutputsSingle:new Map};for(let o=0;o<e.inputs.length;o++){let s=e.inputs[o];if(typeof s.sourceTransaction!=`object`)throw TypeError(`Verification failed because the input at index ${o} of transaction ${n()} is missing an associated source transaction. This source transaction is required for transaction verification because there is no merkle proof for the transaction spending a UTXO it contains.`);if(typeof s.unlockingScript!=`object`)throw TypeError(`Verification failed because the input at index ${o} of transaction ${n()} is missing an associated unlocking script. This script is required for transaction verification because there is no merkle proof for the transaction spending the UTXO.`);let c=s.sourceTransaction,l=c.outputs[s.sourceOutputIndex];i+=l.satoshis??0;let u=r.scriptsOnly&&s.sourceTXID!==void 0?s.sourceTXID:c.id(`hex`);if(this.queueSourceTransactionForVerification(c,u,r),s.sourceTXID??=u,!t&&!new Ti({sourceTXID:s.sourceTXID,sourceOutputIndex:s.sourceOutputIndex,lockingScript:l.lockingScript,sourceSatoshis:l.satoshis??0,transactionVersion:e.version,otherInputs:[],allInputs:e.inputs,unlockingScript:s.unlockingScript,inputSequence:s.sequence??4294967295,inputIndex:o,outputs:e.outputs,lockTime:e.lockTime,memoryLimit:r.memoryLimit,sigHashCache:a}).validateJavaScript())return{valid:!1,inputTotal:i}}return{valid:!0,inputTotal:i}}totalVerifiedOutputs(e){let t=0;for(let n of e.outputs){if(typeof n.satoshis!=`number`)throw TypeError(`Every output must have a defined amount during transaction verification.`);t+=n.satoshis}return t}async verifyQueuedScripts(e,t){if(e.length===0||t===void 0)return;let n=t.verifyScriptsBatch===void 0?await Promise.all(e.map(async e=>await t.verifyScripts(e))):await t.verifyScriptsBatch(e);if(n.length!==e.length)throw Error(`Script verifier returned an invalid batch result count`);let r=n.findIndex(e=>!e);if(r>=0)throw Error(`Script verification failed for transaction ${e[r].tx.id(`hex`)}`)}isTransactionAlreadyVerified(e,t,n){return n.scriptsOnly?n.verifiedTransactions.has(e):n.verifiedTxids.has(t())}async verifyUnminedTransaction(e,t,n){let{feeModel:r,memoryLimit:i,selectedVerifier:a,verifierQueue:o}=n;await this.verifyTransactionFee(e,r,t);let s={tx:e,blockHeight:fa,consensus:!0,...i===void 0?{}:{memoryLimit:i}},c=a!==void 0&&(i===void 0||a.supportsMemoryLimit===!0)&&(a.shouldVerifyScripts?.(s)??!0),l=this.verifyTransactionInputs(e,c,t,n);return!l.valid||(c&&o.push(s),this.totalVerifiedOutputs(e)>l.inputTotal)?!1:(n.scriptsOnly?n.verifiedTransactions.add(e):n.verifiedTxids.add(t()),!0)}async verify(e=qi(),t,n,r){let i=e===`scripts only`,a=r??ai();i||this.materializeSourceTXIDs();let o=new Set,s=new Set,c=[this],l=new Set;i||l.add(this.id(`hex`));let u=new Set(c),d=[],f={scriptsOnly:i,memoryLimit:n,txQueue:c,queuedTransactions:u,queuedTxids:l,verifiedTransactions:s,verifiedTxids:o,feeModel:t,selectedVerifier:a,verifierQueue:d},p=0;for(;p<c.length;){let t=c[p++],n,r=()=>(n??=t.id(`hex`),n);if(!this.isTransactionAlreadyVerified(t,r,f)&&!await this.completeVerificationFromMerklePath(t,i,e,r,s,o)&&!await this.verifyUnminedTransaction(t,r,f))return!1}return await this.verifyQueuedScripts(d,a),!0}writeSerializedBEEF(e,t){this.materializeSourceTXIDs(),e.writeUInt32LE(Qi);let{bumps:n,txs:r}=this.collectBEEFTransactions(t);e.writeVarIntNum(n.length);let i=this.reserveBEEFWriter(e,n,r);for(let t=0;t<n.length;t++)e.write(i?.[t]??n[t].toBinary());e.writeVarIntNum(r.length);for(let t of r)e.write(t.tx.toUint8Array()),typeof t.pathIndex==`number`?(e.writeUInt8(1),e.writeVarIntNum(t.pathIndex)):e.writeUInt8(0)}collectBEEFTransactions(e){let t=[],n=new Map,r=new Map,i=[],a=new Set,o=new Set,s=[{tx:this,expanded:!1}];for(;s.length>0;){let c=s.pop();if(c!=null){if(c.expanded){this.appendBEEFTransaction(c.tx,a,i,t,n,r);continue}this.scheduleBEEFTransaction(c.tx,e,o,s)}}return{bumps:t,txs:i}}appendBEEFTransaction(e,t,n,r,i,a){let o=e.id(`hex`);if(t.has(o))return;let s={tx:e};e.merklePath!=null&&(s.pathIndex=this.getBEEFPathIndex(e.merklePath,r,i,a)),t.add(o),n.push(s)}scheduleBEEFTransaction(e,t,n,r){let i=e.id(`hex`);if(!n.has(i)&&(n.add(i),r.push({tx:e,expanded:!0}),e.merklePath==null))for(let n of e.inputs){let e=n.sourceTransaction;if(e!=null)r.push({tx:e,expanded:!1});else if(t===!1)throw Error(`A required source transaction is missing!`)}}getBEEFPathIndex(e,t,n,r){let i=n.get(e);if(i!==void 0)return i;let a=`${e.blockHeight}:${e.computeRoot()}`,o=r.get(a);if(o!==void 0)return t[o].combine(e),n.set(e,o),o;let s=t.length;return t.push(e),n.set(e,s),r.set(a,s),s}reserveBEEFWriter(e,t,n){let r;if(e instanceof Yt){r=t.map(e=>e.toBinaryUint8Array());let i=16;for(let e of r)i+=e.length;for(let e of n)i+=e.tx.toUint8Array().length+10;e.reserve(i)}return r}toBEEF(e){let t=new bn;return this.writeSerializedBEEF(t,e),t.toArray()}toBEEFUint8Array(e){let t=new Yt;return this.writeSerializedBEEF(t,e),t.toArray()}toBEEFBytes(e){let t=new Yt;return this.writeSerializedBEEF(t,e),t.toUint8Array()}toAtomicBEEF(e){this.materializeSourceTXIDs();let t=[1,1,1,1],n=this.hash(),r=this.toBEEF(e);return t.concat(n,r)}toAtomicBEEFUint8Array(e){this.materializeSourceTXIDs();let t=new Yt;t.write([1,1,1,1]);let n=this.hash();return t.write(n),this.writeSerializedBEEF(t,e),t.toUint8Array()}async completeWithWallet(t,n,r,i){let a=this.inputs.length,o=this.outputs.length,s=n??`Transaction with ${a} input(s) and ${o} output(s)`,c=this.inputs.some(e=>e.unlockingScriptTemplate!=null),l=await this.buildWalletActionArgs(s,c),u=c?await this.completeWalletTemplateAction(t,l,r,i):await this.completeWalletScriptAction(t,l,r,i),d=e.fromAtomicBEEF(u);this.version=d.version,this.inputs=d.inputs,this.outputs=d.outputs,this.lockTime=d.lockTime,this.merklePath=d.merklePath,this.invalidateSerializationCaches(),this.metadata={...this.metadata,...d.metadata}}async buildWalletActionArgs(e,t){let n={description:e,inputs:[],outputs:[],lockTime:this.lockTime,version:this.version};this.materializeSourceTXIDs();let r=new da;for(let e=0;e<this.inputs.length;e++){let i=this.inputs[e];if(i.sourceTransaction==null)throw Error(`All inputs must have a sourceTransaction when using completeWithWallet`);r.mergeTransaction(i.sourceTransaction),n.inputs.push(await this.buildWalletInputArg(i,e,t))}return this.inputs.length>0&&(n.inputBEEF=r.toUint8Array()),n.outputs=this.outputs.map(e=>({satoshis:e.satoshis,lockingScript:e.lockingScript.toHex(),outputDescription:`Output from source transaction`})),Array.isArray(this.metadata?.labels)&&(n.labels=this.metadata.labels),n}async buildWalletInputArg(e,t,n){let r={outpoint:`${e.sourceTransaction.id(`hex`)}.${e.sourceOutputIndex}`,inputDescription:`Input from source transaction`,sequenceNumber:e.sequence};if(!n){if(e.unlockingScript==null)throw Error(`All inputs must have an unlockingScript when using completeWithWallet`);return r.unlockingScript=e.unlockingScript.toHex(),r}if(e.unlockingScriptTemplate!=null)r.unlockingScriptLength=await e.unlockingScriptTemplate.estimateLength(this,t);else if(e.unlockingScript!=null)r.unlockingScript=e.unlockingScript.toHex();else throw Error(`Input ${t} must have either an unlockingScript or unlockingScriptTemplate`);return r}async completeWalletTemplateAction(t,n,r,i){n.options={...i,signAndProcess:!1};let{signableTransaction:a}=await t.createAction(n,r);if(a==null)throw Error(`Wallet createAction did not return signableTransaction`);let o=e.fromBEEF(a.tx),s=await this.buildWalletSpends(o),c=i==null?void 0:{acceptDelayedBroadcast:i.acceptDelayedBroadcast,returnTXIDOnly:i.returnTXIDOnly,noSend:i.noSend,sendWith:i.sendWith},l=await t.signAction({reference:a.reference,spends:s,options:c},r);if(l.tx==null)throw Error(`Wallet signAction did not return transaction data`);return l.tx}async buildWalletSpends(e){let t={};for(let n=0;n<this.inputs.length;n++){let r=this.inputs[n];if(r.unlockingScriptTemplate!=null){let i=await r.unlockingScriptTemplate.sign(e,n);t[n]={unlockingScript:i.toHex()}}else r.unlockingScript!=null&&(t[n]={unlockingScript:r.unlockingScript.toHex()})}return t}async completeWalletScriptAction(e,t,n,r){r!=null&&(t.options=r);let{tx:i}=await e.createAction(t,n);if(i==null)throw Error(`Wallet createAction did not return transaction data`);return i}preimage(e,t,n){if(e??=0,t??=Yr.SIGHASH_FORKID|Yr.SIGHASH_ALL,e<0||e>=this.inputs.length)throw Error(`Invalid input index`);let r=t&240;if(r!==224&&r!==192&&r!==64)throw Error(`FORKID must be set`);let i=t&15;if(i<1||i>3)throw Error(`Invalid signature coverage, must be all, none or single`);let a=this.inputs[e];if(a.sourceTransaction==null)throw Error(`Source transaction is required`);let o=a.sourceTransaction.outputs[a.sourceOutputIndex];if(o==null)throw Error(`Source transaction's output at index ${a.sourceOutputIndex} is required`);return Yr.format({sourceTXID:a.sourceTXID??a.sourceTransaction.id(`hex`),sourceOutputIndex:a.sourceOutputIndex,sourceSatoshis:o.satoshis,transactionVersion:this.version,otherInputs:[],allInputs:this.inputs,inputIndex:e,outputs:this.outputs,inputSequence:a.sequence??4294967295,subscript:n??o.lockingScript,lockTime:this.lockTime,scope:t})}},ma=r({BIGINT_FORMAT_RANGES:()=>ko,CONSTANT_CATCH:()=>Fo,Class:()=>jo,NUMBER_FORMAT_RANGES:()=>Oo,aborted:()=>Qa,allowsEval:()=>wo,assert:()=>ba,assertEqual:()=>ha,assertIs:()=>va,assertNever:()=>ya,assertNotEqual:()=>ga,assignProp:()=>ka,attachSchema:()=>no,base64ToUint8Array:()=>lo,base64urlToUint8Array:()=>fo,cached:()=>Ca,captureStackTrace:()=>Co,cleanEnum:()=>co,cleanRegex:()=>Ta,clone:()=>Ha,cloneDef:()=>ja,codePointLength:()=>ao,constantCatch:()=>xo,createTransparentProxy:()=>Ua,defineLazy:()=>Da,defineLazyInternal:()=>F,esc:()=>Fa,escapeRegex:()=>Va,explicitlyAborted:()=>$a,extend:()=>qa,finalizeIssue:()=>ro,floatSafeRemainder:()=>Ea,getElementAtPath:()=>Ma,getEnumValues:()=>xa,getLengthableOrigin:()=>oo,getParsedType:()=>To,getSizableOrigin:()=>io,hexToUint8Array:()=>mo,hide:()=>vo,installLazyProp:()=>bo,isObject:()=>La,isPlainObject:()=>Ra,issue:()=>so,joinValues:()=>A,jsonStringifyReplacer:()=>Sa,members:()=>go,merge:()=>Ya,mergeDefs:()=>Aa,normalizeParams:()=>j,nullish:()=>wa,numKeys:()=>Ba,objectClone:()=>Oa,omit:()=>Ka,optionalKeys:()=>Wa,own:()=>_o,parsedType:()=>N,partial:()=>Xa,pick:()=>Ga,prefixIssues:()=>eo,primitiveTypes:()=>Do,promiseAllObject:()=>Na,propertyKeyTypes:()=>Eo,randomString:()=>Pa,required:()=>Za,safeExtend:()=>Ja,shallowClone:()=>za,slugify:()=>Ia,stringifyPrimitive:()=>M,toZod:()=>_a,uint8ArrayToBase64:()=>uo,uint8ArrayToBase64url:()=>po,uint8ArrayToHex:()=>ho,unwrapMessage:()=>to});function ha(e){return e}function ga(e){return e}function _a(){return e=>e}function va(e){}function ya(e){throw Error(`Unexpected value in exhaustive check`)}function ba(e){}function xa(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function A(e,t=`|`){return e.map(e=>M(e)).join(t)}function Sa(e,t){return typeof t==`bigint`?t.toString():t}function Ca(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function wa(e){return e==null}function Ta(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Ea(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function Da(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==So)return r===void 0&&(r=So,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Oa(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function ka(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Aa(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function ja(e){return Aa(e._zod.def)}function Ma(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function Na(e){let t=Object.keys(e),n=t.map(t=>e[t]);return Promise.all(n).then(e=>{let n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n})}function Pa(e=10){let t=``;for(let n=0;n<e;n++)t+=`abcdefghijklmnopqrstuvwxyz`[Math.floor(Math.random()*26)];return t}function Fa(e){return JSON.stringify(e)}function Ia(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}function La(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ra(e){if(La(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return La(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function za(e){return Ra(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Ba(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function Va(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Ha(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function j(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Ua(e){let t;return new Proxy({},{get(n,r,i){return t??=e(),Reflect.get(t,r,i)},set(n,r,i,a){return t??=e(),Reflect.set(t,r,i,a)},has(n,r){return t??=e(),Reflect.has(t,r)},deleteProperty(n,r){return t??=e(),Reflect.deleteProperty(t,r)},ownKeys(n){return t??=e(),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??=e(),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??=e(),Reflect.defineProperty(t,r,i)}})}function M(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function Wa(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}function Ga(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return Ha(e,Aa(e._zod.def,{get shape(){let e={};for(let r of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,r))throw Error(`Unrecognized key: "${String(r)}"`);t[r]&&ka(e,r,n.shape[r])}return ka(this,`shape`,e),e},checks:[]}))}function Ka(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return Ha(e,Aa(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,e))throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&delete r[e]}return ka(this,`shape`,r),r},checks:[]}))}function qa(e,t){if(!Ra(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Ha(e,Aa(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ka(this,`shape`,n),n}}))}function Ja(e,t){if(!Ra(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Ha(e,Aa(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ka(this,`shape`,n),n}}))}function Ya(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return Ha(e,Aa(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return ka(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function Xa(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);return Ha(t,Aa(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(r,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t of Reflect.ownKeys(r))i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return ka(this,`shape`,i),i},checks:[]}))}function Za(e,t,n){return Ha(t,Aa(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(i,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t of Reflect.ownKeys(r))i[t]=new e({type:`nonoptional`,innerType:r[t]});return ka(this,`shape`,i),i}}))}function Qa(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function $a(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function eo(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function to(e){return typeof e==`string`?e:e?.message}function no(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function ro(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:to(e.inst?._zod.def?.error?.(e))??to(a?.(e))??to(t?.error?.(e))??to(n.customError?.(e))??to(n.localeError?.(e))??`Invalid input`,{inst:s,schema:c,continue:l,input:u,...d}=e;return d.path??=[],d.message=o,t?.reportInput&&(d.input=u),d}function io(e){return e instanceof Set?`set`:e instanceof Map?`map`:e instanceof File?`file`:`unknown`}function ao(e){let t=e.length;if(!Ao.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function oo(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function N(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function so(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function co(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function lo(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function uo(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function fo(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);return lo(t+`=`.repeat((4-t.length%4)%4))}function po(e){return uo(e).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function mo(e){let t=e.replace(/^0x/,``);if(t.length%2!=0)throw Error(`Invalid hex string length`);let n=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)n[e/2]=Number.parseInt(t.slice(e,e+2),16);return n}function ho(e){return Array.from(e).map(e=>e.toString(16).padStart(2,`0`)).join(``)}function go(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):yo(e,n,r.value)}}function _o(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function vo(e,t,n){return _o(e,t,n,!1)}function yo(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:_o(this,t,n.bind(this))},set(e){_o(this,t,e)}})}function P(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}function F(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&Mo!==e._zod){Mo=void 0;return}Mo=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,Po);let e=No;No=!1;try{let r=n(this);return No?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),No||=e,r}catch(n){throw delete this[t],No||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}function bo(e,t,n,r){let i=P(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}function xo(e){let t=()=>e;return t[Fo]=!0,t}var So,Co,wo,To,Eo,Do,Oo,ko,Ao,jo,Mo,No,Po,Fo,I=t((()=>{Ko(),So=Symbol(`evaluating`),Co=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{},wo=Ca(()=>{if(Go.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}}),To=e=>{let t=typeof e;switch(t){case`undefined`:return`undefined`;case`string`:return`string`;case`number`:return Number.isNaN(e)?`nan`:`number`;case`boolean`:return`boolean`;case`function`:return`function`;case`bigint`:return`bigint`;case`symbol`:return`symbol`;case`object`:return Array.isArray(e)?`array`:e===null?`null`:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?`promise`:typeof Map<`u`&&e instanceof Map?`map`:typeof Set<`u`&&e instanceof Set?`set`:typeof Date<`u`&&e instanceof Date?`date`:typeof File<`u`&&e instanceof File?`file`:`object`;default:throw Error(`Unknown data type: ${t}`)}},Eo=new Set([`string`,`number`,`symbol`]),Do=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]),Oo={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ko={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]},Ao=/[\uD800-\uDBFF]/,jo=class{constructor(...e){}},No=!1,Po={configurable:!0,get(){No=!0}},Fo=`~constantCatch`}));function Io(e){let t=Vo;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Vo=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function L(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){Bo.value=new a(r);try{Object.defineProperty(n,"_zod",Bo)}finally{Bo.value=void 0}}if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),go(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?Io(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}function Lo(e){return e&&Object.assign(Go,e),Go}var Ro,zo,Bo,Vo,Ho,Uo,Wo,Go,Ko=t((()=>{I(),zo=Object.freeze({status:`aborted`}),Bo={value:void 0,enumerable:!1},Vo=`captureStackTrace`in Error?Error:null,Ho=Symbol(`zod_brand`),Uo=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Wo=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},(Ro=globalThis).__zod_globalConfig??(Ro.__zod_globalConfig={}),Go=globalThis.__zod_globalConfig}));function qo(){let e=this._zod;return e.message??=JSON.stringify(e.def,Sa,2),e.message}function Jo(e){this._zod.message=e}function Yo(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function Xo(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Yo(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Zo(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function Qo(e,t=e=>e.message){let n={errors:[]},r=(e,i=[])=>{var a;for(let o of e.issues)if(o.code===`invalid_union`&&o.errors.length)o.errors.map(e=>r({issues:e},[...i,...o.path]));else if(o.code===`invalid_key`)r({issues:o.issues},[...i,...o.path]);else if(o.code===`invalid_element`)r({issues:o.issues},[...i,...o.path]);else{let e=[...i,...o.path];if(e.length===0){n.errors.push(t(o));continue}let r=n,s=0;for(;s<e.length;){let n=e[s],i=s===e.length-1;typeof n==`string`?(r.properties??(r.properties={}),Object.prototype.hasOwnProperty.call(r.properties,n)||Object.defineProperty(r.properties,n,{value:{errors:[]},enumerable:!0,writable:!0,configurable:!0}),r=r.properties[n]):(r.items??(r.items=[]),(a=r.items)[n]??(a[n]={errors:[]}),r=r.items[n]),i&&r.errors.push(t(o)),s++}}};return r(e),n}function $o(e){let t=[],n=e.map(e=>typeof e==`object`?e.key:e);for(let e of n)typeof e==`number`?t.push(`[${e}]`):typeof e==`symbol`?t.push(`[${JSON.stringify(String(e))}]`):/[^\w$]/.test(e)?t.push(`[${JSON.stringify(e)}]`):(t.length&&t.push(`.`),t.push(e));return t.join(``)}function es(e){let t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${$o(e.path)}`);return t.join(`
|
|
20
|
-
`)}var ts,ns,rs,is,as,os,ss,cs=t((()=>{Ko(),I(),ts={get:qo,set:Jo,enumerable:!0,configurable:!0},ns={value:void 0,enumerable:!1},rs={value:void 0,enumerable:!1},is=new WeakSet([Object.prototype,Error.prototype]),as=(e,t)=>{e.name=`$ZodError`,ns.value=e._zod,Object.defineProperty(e,"_zod",ns),rs.value=t,Object.defineProperty(e,"issues",rs),ns.value=void 0,rs.value=void 0,Object.defineProperty(e,"message",ts);let n=Object.getPrototypeOf(e);is.has(n)||(is.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},os=L(`$ZodError`,as),ss=L(`$ZodError`,as,void 0,{Parent:Error})}));function ls(e,t){return{callee:t?.callee??e,Err:t?.Err}}function us(e,t,n){let r=n?{...n,async:!1}:{async:!1},i=e._zod.bag.fallbackRun,a;if(i?(r[bs]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new Uo;return a.issues.length===0}var ds,fs,ps,ms,hs,gs,_s,vs,ys,bs,xs,Ss,Cs,ws,Ts,Es,Ds,Os,ks,As,js,Ms,Ns,Ps,Fs,Is,Ls,Rs,zs=t((()=>{Ko(),cs(),I(),ds=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Uo;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>ro(e,o,Lo())));throw Co(n,a?.callee??t),n}return s.value};return t},fs=ds(ss),ps=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>ro(e,o,Lo())));throw Co(n,a?.callee??t),n}return s.value};return t},ms=ps(ss),hs=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Uo;return a.issues.length?{success:!1,error:new(e??os)(a.issues.map(e=>ro(e,i,Lo())))}:{success:!0,data:a.value}},gs=hs(ss),_s=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>ro(e,i,Lo())))}:{success:!0,data:a.value}},vs=_s(ss),ys=Symbol.for(`zod.compile.invalid`),bs=Symbol.for(`zod.compile.fallback`),xs=((e,t,n)=>{let r=e._zod.bag.validator;return r!==void 0&&r(t)!==ys||us(e,t,n)}),Ss=async(e,t,n)=>{let r=n?{...n,async:!0}:{async:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},Cs=e=>{let t=ds(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,ls(n,a))};return n},ws=Cs(ss),Ts=e=>{let t=ds(e),n=(e,r,i,a)=>t(e,r,i,ls(n,a));return n},Es=Ts(ss),Ds=e=>{let t=ps(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,ls(n,a))};return n},Os=Ds(ss),ks=e=>{let t=ps(e),n=async(e,r,i,a)=>await t(e,r,i,ls(n,a));return n},As=ks(ss),js=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return hs(e)(t,n,i)},Ms=js(ss),Ns=e=>(t,n,r)=>hs(e)(t,n,r),Ps=Ns(ss),Fs=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return _s(e)(t,n,i)},Is=Fs(ss),Ls=e=>async(t,n,r)=>_s(e)(t,n,r),Rs=Ls(ss)})),Bs=r({base64:()=>bc,base64url:()=>xc,bigint:()=>Ac,boolean:()=>Nc,browserEmail:()=>pc,cidrv4:()=>vc,cidrv6:()=>yc,creditCard:()=>Ec,cuid:()=>Ys,cuid2:()=>Xs,date:()=>Oc,datetime:()=>Ks,domain:()=>Cc,duration:()=>tc,e164:()=>Tc,email:()=>cc,emoji:()=>Hs,extendedDuration:()=>nc,guid:()=>rc,hex:()=>Rc,hostname:()=>Sc,html5Email:()=>lc,httpProtocol:()=>wc,idnEmail:()=>fc,integer:()=>jc,ipv4:()=>hc,ipv6:()=>gc,ksuid:()=>$s,lowercase:()=>Ic,mac:()=>_c,md5_base64:()=>Bc,md5_base64url:()=>Vc,md5_hex:()=>zc,nanoid:()=>ec,nanoidOfLength:()=>Vs,null:()=>Pc,number:()=>Mc,rfc5322Email:()=>uc,sha1_base64:()=>Uc,sha1_base64url:()=>Wc,sha1_hex:()=>Hc,sha256_base64:()=>Kc,sha256_base64url:()=>qc,sha256_hex:()=>Gc,sha384_base64:()=>Yc,sha384_base64url:()=>Xc,sha384_hex:()=>Jc,sha512_base64:()=>Qc,sha512_base64url:()=>$c,sha512_hex:()=>Zc,string:()=>kc,time:()=>Gs,ulid:()=>Zs,undefined:()=>Fc,unicodeEmail:()=>dc,uppercase:()=>Lc,uuid:()=>ic,uuid4:()=>ac,uuid6:()=>oc,uuid7:()=>sc,xid:()=>Qs});function Vs(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}function Hs(){return new RegExp(mc,`u`)}function Us(e){return RegExp(`^${e}$`)}function Ws(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Gs(e){return RegExp(`^${Ws(e)}$`)}function Ks(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Ws({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Ws({precision:e.precision})}`:n;return RegExp(`^${Dc}T(?:${r})$`)}function qs(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Js(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var Ys,Xs,Zs,Qs,$s,ec,tc,nc,rc,ic,ac,oc,sc,cc,lc,uc,dc,fc,pc,mc,hc,gc,_c,vc,yc,bc,xc,Sc,Cc,wc,Tc,Ec,Dc,Oc,kc,Ac,jc,Mc,Nc,Pc,Fc,Ic,Lc,Rc,zc,Bc,Vc,Hc,Uc,Wc,Gc,Kc,qc,Jc,Yc,Xc,Zc,Qc,$c,el=t((()=>{I(),Ys=/^[cC][0-9a-z]{6,}$/,Xs=/^[0-9a-z]+$/,Zs=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Qs=/^[0-9a-vA-V]{20}$/,$s=/^[A-Za-z0-9]{27}$/,ec=/^[a-zA-Z0-9_-]{21}$/,tc=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,nc=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,rc=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ic=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,ac=ic(4),oc=ic(6),sc=ic(7),cc=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,lc=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,uc=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,dc=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,fc=dc,pc=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,mc=`^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`,hc=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,gc=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,_c=e=>{let t=Va(e??`:`);return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},vc=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,yc=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,bc=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,xc=/^[A-Za-z0-9_-]*$/,Sc=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Cc=/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,wc=/^https?$/,Tc=/^\+[1-9]\d{6,14}$/,Ec=/^\d(?:[ -]?\d){11,18}$/,Dc=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,Oc=Us(Dc),kc=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Ac=/^-?\d+n?$/,jc=/^-?\d+$/,Mc=/^-?\d+(?:\.\d+)?$/,Nc=/^(?:true|false)$/i,Pc=/^null$/i,Fc=/^undefined$/i,Ic=/^[^A-Z]*$/,Lc=/^[^a-z]*$/,Rc=/^[0-9a-fA-F]*$/,zc=/^[0-9a-fA-F]{32}$/,Bc=qs(22,`==`),Vc=Js(22),Hc=/^[0-9a-fA-F]{40}$/,Uc=qs(27,`=`),Wc=Js(27),Gc=/^[0-9a-fA-F]{64}$/,Kc=qs(43,`=`),qc=Js(43),Jc=/^[0-9a-fA-F]{96}$/,Yc=qs(64,``),Xc=Js(64),Zc=/^[0-9a-fA-F]{128}$/,Qc=qs(86,`==`),$c=Js(86)}));function tl(e,t,n){e.issues.length&&t.issues.push(...eo(n,e.issues))}var nl,rl,il,al,ol,sl,cl,ll,ul,dl,fl,pl,ml,hl,gl,_l,vl,yl,bl,xl,Sl,Cl,wl,Tl,El,Dl=t((()=>{Ko(),el(),I(),nl=L(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),rl=e=>{let t=e.value;return!wa(t)&&t.size!==void 0},il=e=>{let t=e.value;return!wa(t)&&t.length!==void 0},al={number:`number`,bigint:`bigint`,object:`date`},ol=L(`$ZodCheckLessThan`,(e,t)=>{nl.init(e,t);let n=al[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:al[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),sl=L(`$ZodCheckGreaterThan`,(e,t)=>{nl.init(e,t);let n=al[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:al[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),cl=L(`$ZodCheckMultipleOf`,(e,t)=>{nl.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):Ea(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),ll=L(`$ZodCheckNumberFormat`,(e,t)=>{nl.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Oo[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=jc)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),ul=L(`$ZodCheckBigIntFormat`,(e,t)=>{nl.init(e,t);let[n,r]=ko[t.format];e._zod.onattach.push(e=>{let i=e._zod.bag;i.format=t.format,i.minimum=n,i.maximum=r}),e._zod.check=i=>{let a=i.value;a<n&&i.issues.push({origin:`bigint`,input:a,code:`too_small`,minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>r&&i.issues.push({origin:`bigint`,input:a,code:`too_big`,maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),dl=L(`$ZodCheckMaxSize`,(e,t)=>{var n;nl.init(e,t),(n=e._zod.def).when??(n.when=rl),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;r.size<=t.maximum||n.issues.push({origin:io(r),code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),fl=L(`$ZodCheckMinSize`,(e,t)=>{var n;nl.init(e,t),(n=e._zod.def).when??(n.when=rl),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;r.size>=t.minimum||n.issues.push({origin:io(r),code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),pl=L(`$ZodCheckSizeEquals`,(e,t)=>{var n;nl.init(e,t),(n=e._zod.def).when??(n.when=rl),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=n=>{let r=n.value,i=r.size;if(i===t.size)return;let a=i>t.size;n.issues.push({origin:io(r),...a?{code:`too_big`,maximum:t.size}:{code:`too_small`,minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ml=L(`$ZodCheckMaxLength`,(e,t)=>{var n;nl.init(e,t),(n=e._zod.def).when??(n.when=il),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?ao(r):i)<=t.maximum)return;let a=oo(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),hl=L(`$ZodCheckMinLength`,(e,t)=>{var n;nl.init(e,t),(n=e._zod.def).when??(n.when=il),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?ao(r):i)>=t.minimum)return;let a=oo(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),gl=L(`$ZodCheckLengthEquals`,(e,t)=>{var n;nl.init(e,t),(n=e._zod.def).when??(n.when=il),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?ao(r):i;if(a===t.length)return;let o=oo(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),_l=L(`$ZodCheckStringFormat`,(e,t)=>{var n,r;nl.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),vl=L(`$ZodCheckRegex`,(e,t)=>{_l.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),yl=L(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Ic,_l.init(e,t)}),bl=L(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Lc,_l.init(e,t)}),xl=L(`$ZodCheckIncludes`,(e,t)=>{nl.init(e,t);let n=Va(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Sl=L(`$ZodCheckStartsWith`,(e,t)=>{nl.init(e,t);let n=RegExp(`^${Va(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Cl=L(`$ZodCheckEndsWith`,(e,t)=>{nl.init(e,t);let n=RegExp(`.*${Va(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),wl=L(`$ZodCheckProperty`,(e,t)=>{nl.init(e,t),e._zod.check=e=>{let n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(n=>tl(n,e,t.property));tl(n,e,t.property)}}),Tl=L(`$ZodCheckMimeType`,(e,t)=>{nl.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:`invalid_value`,values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),El=L(`$ZodCheckOverwrite`,(e,t)=>{nl.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}})})),Ol,kl=t((()=>{Ol=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
19
|
+
`);e+=` inputs: [\n${t}\n ]\n`}return e}addComputedLeaves(){for(let e of this.bumps)for(let t=1;t<e.path.length;t++)this.addComputedLeavesForRow(e,t)}addComputedLeavesForRow(e,t){let n=e=>E(Qe(tn(e,`hex`).reverse()).reverse());for(let r of e.path[t-1]){if(typeof r.hash!=`string`||r.offset&1)continue;let i=e.path[t-1].find(e=>e.offset===r.offset+1);if(i===void 0||typeof i.hash!=`string`)continue;let a=r.offset>>1;e.path[t].every(e=>e.offset!==a)&&e.path[t].push({offset:a,hash:n(i.hash+r.hash)})}}},la=943816,ua=class e{version;inputs;outputs;lockTime;metadata;merklePath;cachedHash;cachedIdHex;rawBytesCache;efBytesCache;hexCache;activeSignatureHashCache;rawCacheState;getSignatureHashCache(){return this.activeSignatureHashCache??{hashOutputsSingle:new Map}}completeSourceTransaction(e,t,n){for(let t of e.inputs)t.sourceTXID==null&&t.sourceTransaction!=null&&(t.sourceTXID=t.sourceTransaction.id(`hex`));t.delete(e),n.add(e)}scheduleSourceTransactions(e,t,n,r){if(t.has(e))throw Error(`Cyclic source transaction graph`);t.add(e),r.push({tx:e,expanded:!0});for(let t=e.inputs.length-1;t>=0;t--){let i=e.inputs[t].sourceTransaction;e.inputs[t].sourceTXID==null&&i!=null&&!n.has(i)&&r.push({tx:i,expanded:!1})}}materializeSourceTXIDs(){let e=new Set,t=new Set,n=[{tx:this,expanded:!1}];for(;n.length>0;){let r=n.pop();if(r!=null&&!e.has(r.tx)){if(r.expanded){this.completeSourceTransaction(r.tx,t,e);continue}this.scheduleSourceTransactions(r.tx,t,e,n)}}}static fromBEEF(t,n){let{tx:r}=e.fromAnyBeef(t,n);return r}static fromBEEFView(t,n){let{tx:r}=e.fromAnyBeef(t,n,!0);return r}static fromAtomicBEEF(t){let{tx:n,txid:r,beef:i}=e.fromAnyBeef(t);if(r!==i.atomicTxid)throw i.atomicTxid==null?Error(`beef must conform to BRC-95 and must contain the subject txid.`):Error(`Transaction with TXID ${i.atomicTxid} not found in BEEF data.`);if(!i.isAtomic(r))throw Error(`Atomic BEEF contains unrelated transaction data.`);return n}static fromAtomicBEEFView(t){let{tx:n,txid:r,beef:i}=e.fromAnyBeef(t,void 0,!0);if(r!==i.atomicTxid)throw i.atomicTxid==null?Error(`beef must conform to BRC-95 and must contain the subject txid.`):Error(`Transaction with TXID ${i.atomicTxid} not found in BEEF data.`);if(!i.isAtomic(r))throw Error(`Atomic BEEF contains unrelated transaction data.`);return n}static fromAnyBeef(e,t,n=!1){let r=n&&e instanceof Uint8Array?ca.fromBinaryView(e):ca.fromBinary(e);if(r.txs.length<1)throw Error(`beef must include at least one transaction.`);let i=r.txs.at(-1);if(i==null)throw Error(`beef must include at least one transaction.`);let a=t??r.atomicTxid??i.txid,o=r.findAtomicTransaction(a);if(o==null)throw Error(t==null?`beef does not contain transaction for atomic txid.`:`Transaction with TXID ${String(a)} not found in BEEF data.`);return{tx:o,beef:r,txid:a}}static fromEF(t){let n=Yt.makeReader(t),r=n.readUInt32LE();if(E(n.read(6))!==`0000000000ef`)throw Error(`Invalid EF marker`);let i=n.readVarIntNum(),a=[];for(let t=0;t<i;t++){let t=E(n.readReverse(32)),r=n.readUInt32LE(),i=n.readVarIntNum(),o=n.read(i),s=Zr.fromBinary(o),c=n.readUInt32LE(),l=n.readUInt64LEBn().toNumber(),u=n.readVarIntNum(),d=n.read(u),f=Xr.fromBinary(d),p=new e(void 0,[],[],void 0);p.outputs=Array.from({length:r+1}).fill(null),p.outputs[r]={satoshis:l,lockingScript:f},a.push({sourceTransaction:p,sourceTXID:t,sourceOutputIndex:r,unlockingScript:s,sequence:c})}let o=n.readVarIntNum(),s=[];for(let e=0;e<o;e++){let e=n.readUInt64LEBn().toNumber(),t=n.readVarIntNum(),r=n.read(t),i=Xr.fromBinary(r);s.push({satoshis:e,lockingScript:i})}let c=n.readUInt32LE();return new e(r,a,s,c)}static parseScriptOffsets(e){let t=Yt.makeReader(e),n=[],r=[];t.pos+=4;let i=t.readVarIntNum();for(let e=0;e<i;e++){t.pos+=36;let r=t.readVarIntNum();n.push({vin:e,offset:t.pos,length:r}),t.pos+=r+4}let a=t.readVarIntNum();for(let e=0;e<a;e++){t.pos+=8;let n=t.readVarIntNum();r.push({vout:e,offset:t.pos,length:n}),t.pos+=n}return{inputs:n,outputs:r}}static fromReader(t){return e.fromReaderInternal(t,!1)}static fromReaderInternal(t,n){let r=t.readUInt32LE(),i=t.readVarIntNum(),a=[];for(let e=0;e<i;e++){let e=E(t.readReverse(32)),r=t.readUInt32LE(),i=t.readVarIntNum(),o=n&&t instanceof Yt?t.readView(i):t.read(i),s=n&&o instanceof Uint8Array?Zr.fromBinaryView(o):Zr.fromBinary(o),c=t.readUInt32LE();a.push({sourceTXID:e,sourceOutputIndex:r,unlockingScript:s,sequence:c})}let o=t.readVarIntNum(),s=[];for(let e=0;e<o;e++){let e=t.readUInt64LEBn().toNumber(),r=t.readVarIntNum(),i=n&&t instanceof Yt?t.readView(r):t.read(r),a=n&&i instanceof Uint8Array?Xr.fromBinaryView(i):Xr.fromBinary(i);s.push({satoshis:e,lockingScript:a})}let c=t.readUInt32LE();return new e(r,a,s,c)}static fromBinary(t){let n=Uint8Array.from(t),r=new Yt(n),i=e.fromReaderInternal(r,!0);return i.rawBytesCache=n,i.captureSerializationState(),i}static fromBinaryView(t){let n=new Yt(t),r=e.fromReaderInternal(n,!0);if(!n.eof())throw Error(`Serialized transaction contains trailing data`);return r.rawBytesCache=t,r.captureSerializationState(),r}static fromHex(t){let n=en(t,`hex`),r=new Yt(n),i=e.fromReaderInternal(r,!0);return i.rawBytesCache=n,i.hexCache=E(n),i.captureSerializationState(),i}static fromHexEF(t){return e.fromEF(en(t,`hex`))}static fromHexBEEF(t,n){return e.fromBEEF(tn(t,`hex`),n)}constructor(e=1,t=[],n=[],r=0,i=new Map,a){this.version=e,this.inputs=t,this.outputs=n,this.lockTime=r,this.metadata=i,this.merklePath=a}invalidateSerializationCaches(){this.cachedHash=void 0,this.cachedIdHex=void 0,this.rawBytesCache=void 0,this.efBytesCache=void 0,this.hexCache=void 0,this.rawCacheState=void 0}sourceTransactionId(e){return e.sourceTXID==null?e.sourceTransaction?.id(`hex`):void 0}captureSerializationState(){this.rawCacheState={version:this.version,lockTime:this.lockTime,inputs:this.inputs.map(e=>{let t=e.sourceTransaction?.outputs[e.sourceOutputIndex];return{ref:e,sourceTXID:e.sourceTXID,sourceTransactionId:this.sourceTransactionId(e),sourceOutputIndex:e.sourceOutputIndex,sequence:e.sequence,unlockingScript:e.unlockingScript,unlockingScriptBytes:e.unlockingScript?.toUint8Array(),sourceOutput:t,sourceSatoshis:t?.satoshis,sourceLockingScript:t?.lockingScript,sourceLockingScriptBytes:t?.lockingScript.toUint8Array()}}),outputs:this.outputs.map(e=>({ref:e,satoshis:e.satoshis,lockingScript:e.lockingScript,lockingScriptBytes:e.lockingScript.toUint8Array()}))}}serializationCacheMatchesState(){let e=this.rawCacheState;if(e?.version!==this.version||e.lockTime!==this.lockTime||e.inputs.length!==this.inputs.length||e.outputs.length!==this.outputs.length)return!1;for(let t=0;t<this.inputs.length;t++){let n=this.inputs[t],r=e.inputs[t],i=n.sourceTransaction?.outputs[n.sourceOutputIndex];if(r.ref!==n||r.sourceTXID!==n.sourceTXID||r.sourceTransactionId!==this.sourceTransactionId(n)||r.sourceOutputIndex!==n.sourceOutputIndex||r.sequence!==n.sequence||r.unlockingScript!==n.unlockingScript||r.unlockingScriptBytes!==n.unlockingScript?.toUint8Array()||r.sourceOutput!==i||r.sourceSatoshis!==i?.satoshis||r.sourceLockingScript!==i?.lockingScript||r.sourceLockingScriptBytes!==i?.lockingScript.toUint8Array())return!1}for(let t=0;t<this.outputs.length;t++){let n=this.outputs[t],r=e.outputs[t];if(r.ref!==n||r.satoshis!==n.satoshis||r.lockingScript!==n.lockingScript||r.lockingScriptBytes!==n.lockingScript.toUint8Array())return!1}return!0}addInput(e){if(e.sourceTXID===void 0&&e.sourceTransaction===void 0)throw TypeError(`A reference to an an input transaction is required. If the input transaction itself cannot be referenced, its TXID must still be provided.`);e.sequence??=4294967295,this.invalidateSerializationCaches(),this.inputs.push(e)}addOutput(e){if(this.invalidateSerializationCaches(),e.change!==!0){if(e.satoshis===void 0)throw TypeError(`either satoshis must be defined or change must be set to true`);if(e.satoshis<0)throw Error(`satoshis must be a positive integer or zero`)}if(e.lockingScript==null)throw Error(`lockingScript must be defined`);this.outputs.push(e)}addP2PKHOutput(e,t){let n=new Ei().lock(e);if(t===void 0)return this.addOutput({lockingScript:n,change:!0});this.addOutput({lockingScript:n,satoshis:t})}updateMetadata(e){this.metadata={...this.metadata,...e}}async fee(e=ki.getInstance(),t=`equal`){if(this.invalidateSerializationCaches(),typeof e==`number`){let t=e;e={computeFee:async()=>t}}let n=await e.computeFee(this),r=this.calculateChange(n);if(r<=0){this.outputs=this.outputs.filter(e=>e.change!==!0);return}this.distributeChange(r,t)}calculateChange(e){let t=0;for(let e of this.inputs){if(typeof e.sourceTransaction!=`object`)throw TypeError(`Source transactions are required for all inputs during fee computation`);t+=e.sourceTransaction.outputs[e.sourceOutputIndex].satoshis??0}t-=e;for(let e of this.outputs)e.change!==!0&&e.satoshis!==void 0&&(t-=e.satoshis);return t}distributeChange(e,t){let n=0,r=this.outputs.filter(e=>e.change);if(t===`random`?n=this.distributeRandomChange(e,r):t===`equal`&&(n=this.distributeEqualChange(e,r)),n<e){let t=this.outputs.at(-1);t.satoshis===void 0?t.satoshis=e-n:t.satoshis+=e-n}}distributeRandomChange(e,t){let n=0,r=e,i=Array.from({length:t.length}).fill(1);r-=t.length,n+=t.length;for(let e=0;e<t.length-1;e++){let t=this.benfordNumber(0,r);i[e]=i[e]+t,n+=t,r-=t}for(let e of this.outputs)e.change===!0&&(e.satoshis=i.shift());return n}distributeEqualChange(e,t){let n=0,r=Math.floor(e/t.length);for(let e of t)n+=r,e.satoshis=r;return n}benfordNumber(e,t){let n=Tr(1)[0]%9+1;return Math.floor(e+(t-e)*Math.log10(1+1/n)/Math.log10(10))}getFee(){let e=0;for(let t of this.inputs){if(typeof t.sourceTransaction!=`object`)throw TypeError(`Source transactions or sourceSatoshis are required for all inputs to calculate fee`);e+=t.sourceTransaction.outputs[t.sourceOutputIndex].satoshis??0}let t=0;for(let e of this.outputs)t+=e.satoshis??0;return e-t}async sign(e={}){this.invalidateSerializationCaches();for(let e of this.outputs)if(e.satoshis===void 0)throw e.change===!0?Error(`There are still change outputs with uncomputed amounts. Use the fee() method to compute the change amounts and transaction fees prior to signing.`):Error(`One or more transaction outputs is missing an amount. Ensure all output amounts are provided before signing.`);this.materializeSourceTXIDs();let t=this.activeSignatureHashCache;this.activeSignatureHashCache={hashOutputsSingle:new Map};let n;try{n=await Promise.all(this.inputs.map(async(t,n)=>e.skipExistingSignatures===!0&&this.inputs[n].unlockingScript!=null?this.inputs[n].unlockingScript:typeof this.inputs[n].unlockingScriptTemplate==`object`?await this.inputs[n]?.unlockingScriptTemplate?.sign(this,n):await Promise.resolve(void 0)))}finally{this.activeSignatureHashCache=t}for(let e=0,t=this.inputs.length;e<t;e++)typeof this.inputs[e].unlockingScriptTemplate==`object`&&(this.inputs[e].unlockingScript=n[e]);this.invalidateSerializationCaches()}async broadcast(e=Hi()){return await e.broadcast(this)}writeTransactionBody(e){e.writeUInt32LE(this.version),e.writeVarIntNum(this.inputs.length);for(let t of this.inputs){if(t.sourceTXID===void 0){if(t.sourceTransaction==null)throw Error(`sourceTransaction is undefined`);e.write(t.sourceTransaction.hash())}else e.writeReverse(tn(t.sourceTXID,`hex`));if(e.writeUInt32LE(t.sourceOutputIndex),t.unlockingScript==null)throw Error(`unlockingScript is undefined`);let n=t.unlockingScript.toUint8Array();e.writeVarIntNum(n.length),e.write(n),e.writeUInt32LE(t.sequence??4294967295)}e.writeVarIntNum(this.outputs.length);for(let t of this.outputs){e.writeUInt64LE(t.satoshis??0);let n=t.lockingScript.toUint8Array();e.writeVarIntNum(n.length),e.write(n)}e.writeUInt32LE(this.lockTime)}buildSerializedBytes(){let e=new Jt;return this.writeTransactionBody(e),e.toUint8Array()}getSerializedBytes(){return(this.rawBytesCache==null||!this.serializationCacheMatchesState())&&(this.invalidateSerializationCaches(),this.rawBytesCache=this.buildSerializedBytes(),this.captureSerializationState()),this.rawBytesCache}toBinary(){return Array.from(this.getSerializedBytes())}toUint8Array(){return this.getSerializedBytes()}writeEF(e){e.writeUInt32LE(this.version),e.write([0,0,0,0,0,239]),e.writeVarIntNum(this.inputs.length);for(let t of this.inputs){if(t.sourceTransaction===void 0)throw TypeError(`All inputs must have source transactions when serializing to EF format`);if(t.sourceTXID===void 0?e.write(t.sourceTransaction.hash()):e.write(tn(t.sourceTXID,`hex`).reverse()),e.writeUInt32LE(t.sourceOutputIndex),t.unlockingScript==null)throw Error(`unlockingScript is undefined`);let n=t.unlockingScript.toUint8Array();e.writeVarIntNum(n.length),e.write(n),e.writeUInt32LE(t.sequence??4294967295),e.writeUInt64LE(t.sourceTransaction.outputs[t.sourceOutputIndex].satoshis??0);let r=t.sourceTransaction.outputs[t.sourceOutputIndex].lockingScript.toUint8Array();e.writeVarIntNum(r.length),e.write(r)}e.writeVarIntNum(this.outputs.length);for(let t of this.outputs){e.writeUInt64LE(t.satoshis??0);let n=t.lockingScript.toUint8Array();e.writeVarIntNum(n.length),e.write(n)}e.writeUInt32LE(this.lockTime)}toEF(){return Array.from(this.getEFBytes())}toEFUint8Array(){return this.toEFBinary()}getEFBytes(){if(this.efBytesCache==null||!this.serializationCacheMatchesState()){this.invalidateSerializationCaches();let e=new Jt;this.writeEF(e),this.efBytesCache=e.toUint8Array(),this.captureSerializationState()}return this.efBytesCache}toEFBinary(){return this.getEFBytes()}toHexEF(){return E(this.toEFBinary())}toHex(){let e=this.getSerializedBytes();if(this.hexCache!=null)return this.hexCache;let t=E(e);return this.hexCache=t,t}toHexBEEF(){return E(this.toBEEF())}toHexAtomicBEEF(){return E(this.toAtomicBEEF())}hash(e){let t=this.getSerializedBytes();return this.cachedHash??=Qe(t),e===`hex`?E(this.cachedHash):Array.from(this.cachedHash)}id(e){if(this.getSerializedBytes(),e===`hex`&&this.cachedIdHex!=null)return this.cachedIdHex;let t=[...this.hash()];return t.reverse(),e===`hex`?(this.cachedIdHex=E(t),this.cachedIdHex):t}async completeVerificationFromMerklePath(e,t,n,r,i,a){if(typeof e.merklePath!=`object`)return!1;if(t)return i.add(e),!0;if(await e.merklePath.verify(r(),n))return a.add(r()),!0;throw Error(`Invalid merkle path for transaction ${r()}`)}async verifyTransactionFee(t,n,r){if(n===void 0)return;if(t===void 0)throw Error(`Transaction is undefined`);let i=e.fromEF(t.toEF());if(delete i.outputs[0].satoshis,i.outputs[0].change=!0,await i.fee(n),t.getFee()<i.getFee())throw Error(`Verification failed because the transaction ${r()} has an insufficient fee and has not been mined.`)}queueSourceTransactionForVerification(e,t,n){if(n.scriptsOnly){!n.verifiedTransactions.has(e)&&!n.queuedTransactions.has(e)&&(n.txQueue.push(e),n.queuedTransactions.add(e));return}!n.verifiedTxids.has(t)&&!n.queuedTxids.has(t)&&(n.txQueue.push(e),n.queuedTxids.add(t))}verifyTransactionInputs(e,t,n,r){let i=0,a={hashOutputsSingle:new Map};for(let o=0;o<e.inputs.length;o++){let s=e.inputs[o];if(typeof s.sourceTransaction!=`object`)throw TypeError(`Verification failed because the input at index ${o} of transaction ${n()} is missing an associated source transaction. This source transaction is required for transaction verification because there is no merkle proof for the transaction spending a UTXO it contains.`);if(typeof s.unlockingScript!=`object`)throw TypeError(`Verification failed because the input at index ${o} of transaction ${n()} is missing an associated unlocking script. This script is required for transaction verification because there is no merkle proof for the transaction spending the UTXO.`);let c=s.sourceTransaction,l=c.outputs[s.sourceOutputIndex];i+=l.satoshis??0;let u=r.scriptsOnly&&s.sourceTXID!==void 0?s.sourceTXID:c.id(`hex`);if(this.queueSourceTransactionForVerification(c,u,r),s.sourceTXID??=u,!t&&!new Si({sourceTXID:s.sourceTXID,sourceOutputIndex:s.sourceOutputIndex,lockingScript:l.lockingScript,sourceSatoshis:l.satoshis??0,transactionVersion:e.version,otherInputs:[],allInputs:e.inputs,unlockingScript:s.unlockingScript,inputSequence:s.sequence??4294967295,inputIndex:o,outputs:e.outputs,lockTime:e.lockTime,memoryLimit:r.memoryLimit,sigHashCache:a}).validateJavaScript())return{valid:!1,inputTotal:i}}return{valid:!0,inputTotal:i}}totalVerifiedOutputs(e){let t=0;for(let n of e.outputs){if(typeof n.satoshis!=`number`)throw TypeError(`Every output must have a defined amount during transaction verification.`);t+=n.satoshis}return t}async verifyQueuedScripts(e,t){if(e.length===0||t===void 0)return;let n=t.verifyScriptsBatch===void 0?await Promise.all(e.map(async e=>await t.verifyScripts(e))):await t.verifyScriptsBatch(e);if(n.length!==e.length)throw Error(`Script verifier returned an invalid batch result count`);let r=n.findIndex(e=>!e);if(r>=0)throw Error(`Script verification failed for transaction ${e[r].tx.id(`hex`)}`)}isTransactionAlreadyVerified(e,t,n){return n.scriptsOnly?n.verifiedTransactions.has(e):n.verifiedTxids.has(t())}async verifyUnminedTransaction(e,t,n){let{feeModel:r,memoryLimit:i,selectedVerifier:a,verifierQueue:o}=n;await this.verifyTransactionFee(e,r,t);let s={tx:e,blockHeight:la,consensus:!0,...i===void 0?{}:{memoryLimit:i}},c=a!==void 0&&(i===void 0||a.supportsMemoryLimit===!0)&&(a.shouldVerifyScripts?.(s)??!0),l=this.verifyTransactionInputs(e,c,t,n);return!l.valid||(c&&o.push(s),this.totalVerifiedOutputs(e)>l.inputTotal)?!1:(n.scriptsOnly?n.verifiedTransactions.add(e):n.verifiedTxids.add(t()),!0)}async verify(e=Wi(),t,n,r){let i=e===`scripts only`,a=r??ni();i||this.materializeSourceTXIDs();let o=new Set,s=new Set,c=[this],l=new Set;i||l.add(this.id(`hex`));let u=new Set(c),d=[],f={scriptsOnly:i,memoryLimit:n,txQueue:c,queuedTransactions:u,queuedTxids:l,verifiedTransactions:s,verifiedTxids:o,feeModel:t,selectedVerifier:a,verifierQueue:d},p=0;for(;p<c.length;){let t=c[p++],n,r=()=>(n??=t.id(`hex`),n);if(!this.isTransactionAlreadyVerified(t,r,f)&&!await this.completeVerificationFromMerklePath(t,i,e,r,s,o)&&!await this.verifyUnminedTransaction(t,r,f))return!1}return await this.verifyQueuedScripts(d,a),!0}writeSerializedBEEF(e,t){this.materializeSourceTXIDs(),e.writeUInt32LE(Yi);let{bumps:n,txs:r}=this.collectBEEFTransactions(t);e.writeVarIntNum(n.length);let i=this.reserveBEEFWriter(e,n,r);for(let t=0;t<n.length;t++)e.write(i?.[t]??n[t].toBinary());e.writeVarIntNum(r.length);for(let t of r)e.write(t.tx.toUint8Array()),typeof t.pathIndex==`number`?(e.writeUInt8(1),e.writeVarIntNum(t.pathIndex)):e.writeUInt8(0)}collectBEEFTransactions(e){let t=[],n=new Map,r=new Map,i=[],a=new Set,o=new Set,s=[{tx:this,expanded:!1}];for(;s.length>0;){let c=s.pop();if(c!=null){if(c.expanded){this.appendBEEFTransaction(c.tx,a,i,t,n,r);continue}this.scheduleBEEFTransaction(c.tx,e,o,s)}}return{bumps:t,txs:i}}appendBEEFTransaction(e,t,n,r,i,a){let o=e.id(`hex`);if(t.has(o))return;let s={tx:e};e.merklePath!=null&&(s.pathIndex=this.getBEEFPathIndex(e.merklePath,r,i,a)),t.add(o),n.push(s)}scheduleBEEFTransaction(e,t,n,r){let i=e.id(`hex`);if(!n.has(i)&&(n.add(i),r.push({tx:e,expanded:!0}),e.merklePath==null))for(let n of e.inputs){let e=n.sourceTransaction;if(e!=null)r.push({tx:e,expanded:!1});else if(t===!1)throw Error(`A required source transaction is missing!`)}}getBEEFPathIndex(e,t,n,r){let i=n.get(e);if(i!==void 0)return i;let a=`${e.blockHeight}:${e.computeRoot()}`,o=r.get(a);if(o!==void 0)return t[o].combine(e),n.set(e,o),o;let s=t.length;return t.push(e),n.set(e,s),r.set(a,s),s}reserveBEEFWriter(e,t,n){let r;if(e instanceof Jt){r=t.map(e=>e.toBinaryUint8Array());let i=16;for(let e of r)i+=e.length;for(let e of n)i+=e.tx.toUint8Array().length+10;e.reserve(i)}return r}toBEEF(e){let t=new _n;return this.writeSerializedBEEF(t,e),t.toArray()}toBEEFUint8Array(e){let t=new Jt;return this.writeSerializedBEEF(t,e),t.toArray()}toBEEFBytes(e){let t=new Jt;return this.writeSerializedBEEF(t,e),t.toUint8Array()}toAtomicBEEF(e){this.materializeSourceTXIDs();let t=[1,1,1,1],n=this.hash(),r=this.toBEEF(e);return t.concat(n,r)}toAtomicBEEFUint8Array(e){this.materializeSourceTXIDs();let t=new Jt;t.write([1,1,1,1]);let n=this.hash();return t.write(n),this.writeSerializedBEEF(t,e),t.toUint8Array()}async completeWithWallet(t,n,r,i){let a=this.inputs.length,o=this.outputs.length,s=n??`Transaction with ${a} input(s) and ${o} output(s)`,c=this.inputs.some(e=>e.unlockingScriptTemplate!=null),l=await this.buildWalletActionArgs(s,c),u=c?await this.completeWalletTemplateAction(t,l,r,i):await this.completeWalletScriptAction(t,l,r,i),d=e.fromAtomicBEEF(u);this.version=d.version,this.inputs=d.inputs,this.outputs=d.outputs,this.lockTime=d.lockTime,this.merklePath=d.merklePath,this.invalidateSerializationCaches(),this.metadata={...this.metadata,...d.metadata}}async buildWalletActionArgs(e,t){let n={description:e,inputs:[],outputs:[],lockTime:this.lockTime,version:this.version};this.materializeSourceTXIDs();let r=new ca;for(let e=0;e<this.inputs.length;e++){let i=this.inputs[e];if(i.sourceTransaction==null)throw Error(`All inputs must have a sourceTransaction when using completeWithWallet`);r.mergeTransaction(i.sourceTransaction),n.inputs.push(await this.buildWalletInputArg(i,e,t))}return this.inputs.length>0&&(n.inputBEEF=r.toUint8Array()),n.outputs=this.outputs.map(e=>({satoshis:e.satoshis,lockingScript:e.lockingScript.toHex(),outputDescription:`Output from source transaction`})),Array.isArray(this.metadata?.labels)&&(n.labels=this.metadata.labels),n}async buildWalletInputArg(e,t,n){let r={outpoint:`${e.sourceTransaction.id(`hex`)}.${e.sourceOutputIndex}`,inputDescription:`Input from source transaction`,sequenceNumber:e.sequence};if(!n){if(e.unlockingScript==null)throw Error(`All inputs must have an unlockingScript when using completeWithWallet`);return r.unlockingScript=e.unlockingScript.toHex(),r}if(e.unlockingScriptTemplate!=null)r.unlockingScriptLength=await e.unlockingScriptTemplate.estimateLength(this,t);else if(e.unlockingScript!=null)r.unlockingScript=e.unlockingScript.toHex();else throw Error(`Input ${t} must have either an unlockingScript or unlockingScriptTemplate`);return r}async completeWalletTemplateAction(t,n,r,i){n.options={...i,signAndProcess:!1};let{signableTransaction:a}=await t.createAction(n,r);if(a==null)throw Error(`Wallet createAction did not return signableTransaction`);let o=e.fromBEEF(a.tx),s=await this.buildWalletSpends(o),c=i==null?void 0:{acceptDelayedBroadcast:i.acceptDelayedBroadcast,returnTXIDOnly:i.returnTXIDOnly,noSend:i.noSend,sendWith:i.sendWith},l=await t.signAction({reference:a.reference,spends:s,options:c},r);if(l.tx==null)throw Error(`Wallet signAction did not return transaction data`);return l.tx}async buildWalletSpends(e){let t={};for(let n=0;n<this.inputs.length;n++){let r=this.inputs[n];if(r.unlockingScriptTemplate!=null){let i=await r.unlockingScriptTemplate.sign(e,n);t[n]={unlockingScript:i.toHex()}}else r.unlockingScript!=null&&(t[n]={unlockingScript:r.unlockingScript.toHex()})}return t}async completeWalletScriptAction(e,t,n,r){r!=null&&(t.options=r);let{tx:i}=await e.createAction(t,n);if(i==null)throw Error(`Wallet createAction did not return transaction data`);return i}preimage(e,t,n){if(e??=0,t??=Kr.SIGHASH_FORKID|Kr.SIGHASH_ALL,e<0||e>=this.inputs.length)throw Error(`Invalid input index`);let r=t&240;if(r!==224&&r!==192&&r!==64)throw Error(`FORKID must be set`);let i=t&15;if(i<1||i>3)throw Error(`Invalid signature coverage, must be all, none or single`);let a=this.inputs[e];if(a.sourceTransaction==null)throw Error(`Source transaction is required`);let o=a.sourceTransaction.outputs[a.sourceOutputIndex];if(o==null)throw Error(`Source transaction's output at index ${a.sourceOutputIndex} is required`);return Kr.format({sourceTXID:a.sourceTXID??a.sourceTransaction.id(`hex`),sourceOutputIndex:a.sourceOutputIndex,sourceSatoshis:o.satoshis,transactionVersion:this.version,otherInputs:[],allInputs:this.inputs,inputIndex:e,outputs:this.outputs,inputSequence:a.sequence??4294967295,subscript:n??o.lockingScript,lockTime:this.lockTime,scope:t})}},A=a(),da=l(),fa=Object.defineProperty,pa=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),j=(e,t)=>{let n={};for(var r in e)fa(n,r,{get:e[r],enumerable:!0});return t&&fa(n,Symbol.toStringTag,{value:`Module`}),n},ma=new Set([`https://json-schema.org/draft/2019-09/schema`,`http://json-schema.org/draft/2019-09/schema`]);function ha(e){return typeof e==`string`&&ma.has(e.replace(/#$/,``))}function ga(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function _a(e,t=`|`){return e.map(e=>Wa(e)).join(t)}function va(e,t){return typeof t==`bigint`?t.toString():t}var ya=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function ba(e){return new ya(e)}function xa(e){return e==null}function Sa(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Ca(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}var wa=Symbol(`evaluating`);function Ta(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==wa)return r===void 0&&(r=wa,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Ea(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Da(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function Oa(e){return Da(e._zod.def)??e._zod.def.shape}function ka(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return Ea(this,t,e),e},enumerable:!0,configurable:!0})}function Aa(e,t,n){t in e?Ea(e,t,n):e[t]=n}function ja(e,t,n,r){let i=Oa(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?ka(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):Aa(e,a,r?r(n.value,a):n.value))}}function Ma(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?ka(e,n,()=>t[n]):Aa(e,n,r.value))}}function Na(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Pa(e){return JSON.stringify(e)}function Fa(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Ia=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function La(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Ra=ba(()=>{if(Po.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function za(e){if(La(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return La(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function Ba(e){return za(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var Va=new Set([`string`,`number`,`symbol`]);function Ha(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Ua(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function M(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Wa(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function Ga(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var Ka={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},qa={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function Ja(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return ja(i,e,Ya(e,t)),Ua(e,Na(n,{shape:i,checks:[]}))}function Ya(e,t){let n=Oa(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function Xa(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(Ya(e,t)),a={};return ja(a,e,Reflect.ownKeys(Oa(e)).filter(e=>!i.has(e))),Ua(e,Na(n,{shape:a,checks:[]}))}function Za(e,t){if(!za(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=Oa(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Ua(e,Na(e._zod.def,{shape:Qa(e,t)}))}function Qa(e,t){let n={};return ja(n,e,Reflect.ownKeys(Oa(e))),Ma(n,t),n}function $a(e,t){if(!za(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Ua(e,Na(e._zod.def,{shape:Qa(e,t)}))}function eo(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return ja(n,e,Reflect.ownKeys(Oa(e))),ja(n,t,Reflect.ownKeys(Oa(t))),Ua(e,Na(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function to(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(Ya(t,n)):void 0,o={};return ja(o,t,Reflect.ownKeys(Oa(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),Ua(t,Na(t._zod.def,{shape:o,checks:[]}))}function no(e,t,n){let r=n?new Set(Ya(t,n)):void 0,i={};return ja(i,t,Reflect.ownKeys(Oa(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),Ua(t,Na(t._zod.def,{shape:i}))}function ro(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function io(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function ao(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function oo(e){return typeof e==`string`?e:e?.message}function so(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function co(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:oo(e.inst?._zod.def?.error?.(e))??oo(a?.(e))??oo(t?.error?.(e))??oo(n.customError?.(e))??oo(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var lo=/[\uD800-\uDBFF]/;function uo(e){let t=e.length;if(!lo.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function fo(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function po(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function mo(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function ho(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):yo(e,n,r.value)}for(let n of Object.getOwnPropertySymbols(t))yo(e,n,t[n])}function go(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function _o(e,t,n){return go(e,t,n,!1)}function vo(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return go(this,n,r(this))},set(e){go(this,n,e)}})}return t}function yo(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:go(this,t,n.bind(this))},set(e){go(this,t,e)}})}function bo(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var xo,So=!1,Co={configurable:!0,get(){So=!0}};function N(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&xo!==e._zod){xo=void 0;return}xo=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,Co);let e=So;So=!1;try{let r=n(this);return So?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),So||=e,r}catch(n){throw delete this[t],So||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}function wo(e,t,n,r){let i=bo(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var To=`~constantCatch`;function Eo(e){let t=()=>e;return t[To]=!0,t}var Do,Oo=Object.freeze({status:`aborted`}),ko={value:void 0,enumerable:!1},Ao=`captureStackTrace`in Error?Error:null;function jo(e){let t=Ao;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Ao=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function P(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){ko.value=new a(r);try{Object.defineProperty(n,"_zod",ko)}finally{ko.value=void 0}}if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),ho(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?jo(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var Mo=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},No=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Do=globalThis).__zod_globalConfig??(Do.__zod_globalConfig={});var Po=globalThis.__zod_globalConfig;function Fo(e){return e&&Object.assign(Po,e),Po}function Io(){let e=this._zod;return e.message??=JSON.stringify(e.def,va,2),e.message}function Lo(e){this._zod.message=e}var Ro={get:Io,set:Lo,enumerable:!0,configurable:!0},zo={value:void 0,enumerable:!1},Bo=new WeakSet([Object.prototype,Error.prototype]),Vo=(e,t)=>{e.name=`$ZodError`,zo.value=t,Object.defineProperty(e,"issues",zo),zo.value=void 0,Object.defineProperty(e,"message",Ro);let n=Object.getPrototypeOf(e);Bo.has(n)||(Bo.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},Ho=P(`$ZodError`,Vo);P(`$ZodError`,Vo,void 0,{Parent:Error});function Uo(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function Wo(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Uo(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Go(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function Ko(e,t){return{callee:t?.callee??e,Err:t?.Err}}var qo=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Mo;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>co(e,o,Fo())));throw Ia(n,a?.callee??t),n}return s.value};return t},Jo=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>co(e,o,Fo())));throw Ia(n,a?.callee??t),n}return s.value};return t},F=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Mo;return a.issues.length?Yo(e,a.issues,i):{success:!0,data:a.value}};function Yo(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>co(e,n,Fo()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var Xo=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?Yo(e,a.issues,i):{success:!0,data:a.value}},Zo=Symbol.for(`zod.compile.invalid`),Qo=Symbol.for(`zod.compile.fallback`),$o=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Zo)return!0;if(r.definite===!0&&n===void 0)return!1}return es(e,t,n)});function es(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[Qo]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new Mo;return a.issues.length===0}var ts=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},ns=e=>{let t=qo(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,Ko(n,a))};return n},rs=e=>{let t=qo(e),n=(e,r,i,a)=>t(e,r,i,Ko(n,a));return n},is=e=>{let t=Jo(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,Ko(n,a))};return n},as=e=>{let t=Jo(e),n=async(e,r,i,a)=>await t(e,r,i,Ko(n,a));return n},os=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return F(e)(t,n,i)},ss=e=>(t,n,r)=>F(e)(t,n,r),cs=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Xo(e)(t,n,i)},ls=e=>async(t,n,r)=>Xo(e)(t,n,r),us=/^[cC][0-9a-z]{6,}$/,ds=/^[0-9a-z]+$/,fs=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,ps=/^[0-9a-vA-V]{20}$/,ms=/^[A-Za-z0-9]{27}$/,hs=/^[a-zA-Z0-9_-]{21}$/;function gs(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var _s=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,vs=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ys=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,bs=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,xs=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function Ss(){return new RegExp(xs,`u`)}var Cs=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ws=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Ts=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Es=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ds=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Os=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,ks=/^https?$/,As=/^\+[1-9]\d{6,14}$/,js=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function Ms(e){return RegExp(`^${e}$`)}var Ns=Ms(js);function Ps(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Fs(e){return RegExp(`^${Ps(e)}$`)}function Is(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Ps({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Ps({precision:e.precision})}`:n;return RegExp(`^${js}T(?:${r})$`)}var Ls=/^[\s\S]{0,}$/,Rs=/^-?\d+$/,zs=/^-?\d+(?:\.\d+)?$/,Bs=/^(?:true|false)$/i,Vs=/^null$/i,Hs=/^undefined$/i,Us=/^[^A-Z]*$/,Ws=/^[^a-z]*$/,Gs=P(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ks=e=>{let t=e.value;return!xa(t)&&t.length!==void 0},qs={number:`number`,bigint:`bigint`,object:`date`},Js=P(`$ZodCheckLessThan`,(e,t)=>{Gs.init(e,t);let n=qs[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:qs[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ys=P(`$ZodCheckGreaterThan`,(e,t)=>{Gs.init(e,t);let n=qs[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:qs[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Xs=P(`$ZodCheckMultipleOf`,(e,t)=>{Gs.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):Ca(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Zs=P(`$ZodCheckNumberFormat`,(e,t)=>{Gs.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Ka[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),Qs=P(`$ZodCheckMaxLength`,(e,t)=>{var n;Gs.init(e,t),(n=e._zod.def).when??(n.when=Ks),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?uo(r):i)<=t.maximum)return;let a=fo(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),$s=P(`$ZodCheckMinLength`,(e,t)=>{var n;Gs.init(e,t),(n=e._zod.def).when??(n.when=Ks),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?uo(r):i)>=t.minimum)return;let a=fo(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ec=P(`$ZodCheckLengthEquals`,(e,t)=>{var n;Gs.init(e,t),(n=e._zod.def).when??(n.when=Ks),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?uo(r):i;if(a===t.length)return;let o=fo(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),tc=P(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Gs.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),nc=P(`$ZodCheckRegex`,(e,t)=>{tc.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),rc=P(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Us,tc.init(e,t)}),ic=P(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Ws,tc.init(e,t)}),ac=P(`$ZodCheckIncludes`,(e,t)=>{Gs.init(e,t);let n=Ha(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),oc=P(`$ZodCheckStartsWith`,(e,t)=>{Gs.init(e,t);let n=RegExp(`^${Ha(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),sc=P(`$ZodCheckEndsWith`,(e,t)=>{Gs.init(e,t);let n=RegExp(`.*${Ha(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),cc=P(`$ZodCheckOverwrite`,(e,t)=>{Gs.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),lc=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
21
20
|
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
|
|
22
|
-
`)}\n};`)(...Object.values(this.closed))}}})),Al,jl=t((()=>{Al={major:4,minor:5,patch:4}}));function Ml(e){return{validate:t=>{try{return du(gs(e,t))}catch{return vs(e,t).then(du)}},vendor:`zod`,version:1}}function Nl(e,t){if(!t.normalize&&t.protocol?.source===wc.source&&!/^https?:\/\//i.test(e))return 1;try{return new URL(e)}catch{return 2}}function Pl(e){return e.replace(_u,``)}function Fl(e,t){return t.lastIndex=0,t.test(e.hostname)}function Il(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}function Ll(e){if(!ju.test(e))return!1;try{return new URL(`http://[${e}]`),!0}catch{return!1}}function Rl(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Ll(n)}function zl(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}function Bl(e){if(!xc.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return zl(t.padEnd(Math.ceil(t.length/4)*4,`=`))}function Vl(e){let t=e.length,n=1,r=0;for(;t;){let i=+e[--t];n^=1,r+=n?[0,2,4,6,8,1,3,5,7,9][i]:i}return r%10==0}function Hl(e){return Ec.test(e)?Vl(e.replace(zu,``)):!1}function Ul(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}function Wl(e,t,n){e.issues.length&&t.issues.push(...eo(n,e.issues)),t.value[n]=e.value}function Gl(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...eo(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}}function Kl(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:rd,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=Wa(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function ql(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin,d=c.optout;for(let i in t){if(s.has(i))continue;if(i===`__proto__`){l===`never`&&o.push(i);continue}if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Gl(e,n,i,t,u,d))):Gl(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}function Jl(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Qa(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ro(e,r,Lo())))}),t)}function R(e,t,n,r){let i=[];for(let t=0;t<e.length;t++)e[t].issues.length===0&&i.push(t);return i.length===1?(t.value=e[i[0]].value,t):(i.length===0?t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ro(e,r,Lo())))}):t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:[],inclusive:!1,matches:i}),t)}function z(e,t){let n=e._zod,r=n.bag.optionsMap;if(!r){r=new Map;let{options:e,discriminator:t}=n.def;for(let n of e)for(let e of n._zod.propValues?.[t]??[])r.has(e)||r.set(e,n);n.bag.optionsMap=r}return r.get(t)}function Yl(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ra(e)&&Ra(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=Yl(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Yl(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Xl(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=Yl(t.value,n.value);if(!c.valid){if(Qa(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}function Zl(e,t){for(let n=e.length-1;n>=0;n--)if(!(t===`optin`?e[n]._zod.optin!==void 0:e[n]._zod.optout===`optional`))return n+1;return 0}function Ql(e,t,n){e.issues.length&&t.issues.push(...eo(n,e.issues)),t.value[n]=e.value}function $l(e,t,n,r,i){for(let a=0;a<n.length;a++){let o=e[a],s=a<r.length;if(!s&&a>=i&&n[a]._zod.optin===`optional`){t.value.length=a;break}if(o.issues.length){if(!s&&a>=i){t.value.length=a;break}t.issues.push(...eo(a,o.issues))}t.value[a]=o.value}for(let e=t.value.length-1;e>=r.length&&n[e]._zod.optout===`optional`&&t.value[e]===void 0;e--)t.value.length=e;return t}function eu(e,t,n,r,i,a,o){e.issues.length&&(Eo.has(typeof r)?n.issues.push(...eo(r,e.issues)):n.issues.push({code:`invalid_key`,origin:`map`,input:i,inst:a,issues:e.issues.map(e=>ro(e,o,Lo()))})),t.issues.length&&(Eo.has(typeof r)?n.issues.push(...eo(r,t.issues)):n.issues.push({origin:`map`,code:`invalid_element`,input:i,inst:a,key:r,issues:t.issues.map(e=>ro(e,o,Lo()))})),n.value.set(e.value,t.value)}function tu(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}function nu(e,t){return e.value=t.issues.length?void 0:t.value,e}function ru(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function iu(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function au(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>ro(e,r,Lo()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}function ou(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}function su(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||`forward`)===`forward`){let r=t.transform(e.value,e);return r instanceof Promise?r.then(r=>cu(e,r,t.out,n)):cu(e,r,t.out,n)}{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(r=>cu(e,r,t.in,n)):cu(e,r,t.in,n)}}function cu(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}function lu(e){return e.memo||(e.value=Object.freeze(e.value)),e}function uu(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(so(e))}}var B,du,fu,pu,mu,hu,gu,_u,vu,yu,bu,xu,Su,Cu,wu,Tu,Eu,Du,Ou,ku,Au,ju,Mu,Nu,Pu,Fu,Iu,Lu,Ru,zu,Bu,Vu,Hu,Uu,Wu,Gu,Ku,qu,Ju,Yu,Xu,Zu,Qu,$u,ed,td,nd,rd,id,ad,od,sd,cd,ld,ud,dd,fd,pd,md,hd,gd,_d,vd,yd,bd,xd,Sd,Cd,wd,Td,Ed,Dd,Od,kd,Ad,V,jd,Md,Nd,Pd,Fd,Id=t((()=>{Dl(),Ko(),kl(),zs(),el(),I(),jl(),B=L(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Al;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=Qa(t),a;for(let o of n){if(o._zod.def.when){if($a(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new Uo;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(no(t.issues,n,e),i||=Qa(t,n))});else{if(t.issues.length===n)continue;no(t.issues,n,e),i||=Qa(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(Qa(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new Uo;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new Uo;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return vo(this,`~standard`,Ml(this))},set"~standard"(e){_o(this,`~standard`,e)}}),du=e=>e.success?{value:e.data}:{issues:e.error?.issues},fu=L(`$ZodString`,(e,t)=>{B.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??kc(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),pu=L(`$ZodStringFormat`,(e,t)=>{_l.init(e,t),fu.init(e,t)}),mu=L(`$ZodGUID`,(e,t)=>{t.pattern??=rc,pu.init(e,t)}),hu=L(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=ic(e)}else t.pattern??=ic();pu.init(e,t)}),gu=L(`$ZodEmail`,(e,t)=>{t.pattern??=cc,pu.init(e,t)}),_u=/[\t\n\r]/g,vu=L(`$ZodURL`,(e,t)=>{pu.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=Nl(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}t.hostname&&!Fl(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!Il(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:Pl(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),yu=L(`$ZodEmoji`,(e,t)=>{t.pattern??=Hs(),pu.init(e,t)}),bu=L(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?ec:Vs(t.length),pu.init(e,t)}),xu=L(`$ZodCUID`,(e,t)=>{t.pattern??=Ys,pu.init(e,t)}),Su=L(`$ZodCUID2`,(e,t)=>{t.pattern??=Xs,pu.init(e,t)}),Cu=L(`$ZodULID`,(e,t)=>{t.pattern??=Zs,pu.init(e,t)}),wu=L(`$ZodXID`,(e,t)=>{t.pattern??=Qs,pu.init(e,t)}),Tu=L(`$ZodKSUID`,(e,t)=>{t.pattern??=$s,pu.init(e,t)}),Eu=L(`$ZodISODateTime`,(e,t)=>{t.pattern??=Ks(t),pu.init(e,t),(t.local||t.precision===-1)&&(e._zod.bag.laxFormat=!0,e._zod.onattach.push(e=>{e._zod.bag.laxFormat=!0}))}),Du=L(`$ZodISODate`,(e,t)=>{t.pattern??=Oc,pu.init(e,t)}),Ou=L(`$ZodISOTime`,(e,t)=>{t.pattern??=Gs(t),pu.init(e,t)}),ku=L(`$ZodISODuration`,(e,t)=>{t.pattern??=tc,pu.init(e,t)}),Au=L(`$ZodIPv4`,(e,t)=>{t.pattern??=hc,pu.init(e,t),e._zod.bag.format=`ipv4`}),ju=/^[0-9a-fA-F:.]+$/,Mu=L(`$ZodIPv6`,(e,t)=>{t.pattern??=gc,pu.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{Ll(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Nu=L(`$ZodMAC`,(e,t)=>{t.pattern??=_c(t.delimiter),pu.init(e,t),e._zod.bag.format=`mac`}),Pu=L(`$ZodCIDRv4`,(e,t)=>{t.pattern??=vc,pu.init(e,t)}),Fu=L(`$ZodCIDRv6`,(e,t)=>{t.pattern??=yc,pu.init(e,t),e._zod.check=n=>{Rl(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}),Iu=L(`$ZodBase64`,(e,t)=>{t.pattern??=bc,pu.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{zl(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),Lu=L(`$ZodBase64URL`,(e,t)=>{t.pattern??=xc,pu.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{Bl(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Ru=L(`$ZodE164`,(e,t)=>{t.pattern??=Tc,pu.init(e,t)}),zu=/[- ]/g,Bu=L(`$ZodCreditCard`,(e,t)=>{t.pattern??=Ec,pu.init(e,t),e._zod.check=n=>{Hl(n.value)||n.issues.push({code:`invalid_format`,format:`credit_card`,input:n.value,inst:e,continue:!t.abort})}}),Vu=L(`$ZodJWT`,(e,t)=>{pu.init(e,t),e._zod.check=n=>{Ul(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Hu=L(`$ZodCustomStringFormat`,(e,t)=>{pu.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:`invalid_format`,format:t.format,input:n.value,inst:e,continue:!t.abort})}}),Uu=L(`$ZodNumber`,(e,t)=>{B.init(e,t),e._zod.pattern=e._zod.bag.pattern??Mc,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Wu=L(`$ZodNumberFormat`,(e,t)=>{ll.init(e,t),Uu.init(e,t)}),Gu=L(`$ZodBoolean`,(e,t)=>{B.init(e,t),e._zod.pattern=Nc,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Ku=L(`$ZodBigInt`,(e,t)=>{B.init(e,t),e._zod.pattern=Ac,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value==`bigint`||n.issues.push({expected:`bigint`,code:`invalid_type`,input:n.value,inst:e}),n}}),qu=L(`$ZodBigIntFormat`,(e,t)=>{ul.init(e,t),Ku.init(e,t)}),Ju=L(`$ZodSymbol`,(e,t)=>{B.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return typeof r==`symbol`||t.issues.push({expected:`symbol`,code:`invalid_type`,input:r,inst:e}),t}}),Yu=L(`$ZodUndefined`,(e,t)=>{B.init(e,t),e._zod.pattern=Fc,e._zod.values=new Set([void 0]),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),Xu=L(`$ZodNull`,(e,t)=>{B.init(e,t),e._zod.pattern=Pc,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),Zu=L(`$ZodAny`,(e,t)=>{B.init(e,t),e._zod.parse=e=>e}),Qu=L(`$ZodUnknown`,(e,t)=>{B.init(e,t),e._zod.parse=e=>e}),$u=L(`$ZodNever`,(e,t)=>{B.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),ed=L(`$ZodVoid`,(e,t)=>{B.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`void`,code:`invalid_type`,input:r,inst:e}),t}}),td=L(`$ZodDate`,(e,t)=>{B.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let i=n.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||n.issues.push({expected:`date`,code:`invalid_type`,input:i,...a?{received:`Invalid Date`}:{},inst:e}),n}}),nd=L(`$ZodArray`,(e,t)=>{B.init(e,t);let n=Go.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[];for(let e=0;e<a.length;e++){let n=a[e],s=t.element._zod.run({value:n,issues:[]},i);s instanceof Promise?o.push(s.then(t=>Wl(t,r,e))):Wl(s,r,e)}return o.length?Promise.all(o).then(()=>r):r}}),rd=[],id=new WeakMap,ad=L(`$ZodObject`,(e,t)=>{if(B.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;id.set(t,e),Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),id.set(t,n),n}})}let n=Ca(()=>Kl(t));F(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||ka(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let r=La,i=t.catchall,a,o=Go.memoizer;o?.attach(e),e._zod.parse=(t,s)=>{a??=n.value;let c=t.value;if(!r(c))return t.issues.push({expected:`object`,code:`invalid_type`,input:c,inst:e}),t;t.value=o?o.alloc(e,t,{},s):{};let l=[],u=a.shape;for(let e of a.allKeys){if(e===`__proto__`)continue;let n=u[e],r=n._zod.optin,i=n._zod.optout,a=n._zod.run({value:c[e],issues:[]},s);a instanceof Promise?l.push(a.then(n=>Gl(n,t,e,c,r,i))):Gl(a,t,e,c,r,i)}return i?ql(l,c,t,s,n.value,e):l.length?Promise.all(l).then(()=>t):t}}),od=L(`$ZodObjectJIT`,(e,t)=>{ad.init(e,t);let n=e._zod.parse,r=Ca(()=>Kl(t)),i=Go.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new Ol([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
|
|
21
|
+
`)}\n};`)(...Object.values(this.closed))}},uc={major:4,minor:6,patch:1},dc=P(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=uc;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=ro(t),a;for(let o of n){if(o._zod.def.when){if(io(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new Mo;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(so(t.issues,n,e),i||=ro(t,n))});else{if(t.issues.length===n)continue;so(t.issues,n,e),i||=ro(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(ro(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new Mo;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new Mo;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return _o(this,`~standard`,mc(this))},set"~standard"(e){go(this,`~standard`,e)}}),fc=(e,t)=>e.issues.length?{issues:e.issues.map(e=>co(e,t,Fo()))}:{value:e.value};async function pc(e,t){let n={async:!0};return fc(await e._zod.run({value:t,issues:[]},n),n)}function mc(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return fc(r,n)}catch{}return pc(e,t)},vendor:`zod`,version:1}}var hc=P(`$ZodString`,(e,t)=>{dc.init(e,t),e._zod.pattern=t.pattern??Ls,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),gc=P(`$ZodStringFormat`,(e,t)=>{tc.init(e,t),hc.init(e,t)}),_c=P(`$ZodGUID`,(e,t)=>{t.pattern??=vs,gc.init(e,t)}),vc=P(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=ys(e)}else t.pattern??=ys();gc.init(e,t)}),yc=P(`$ZodEmail`,(e,t)=>{t.pattern??=bs,gc.init(e,t)});function bc(e,t){if(!t.normalize&&t.protocol?.source===ks.source&&!/^https?:\/\//i.test(e))return 1;try{return new URL(e)}catch{return 2}}var xc=/[\t\n\r]/g;function Sc(e){return e.replace(xc,``)}function Cc(e,t){return t.lastIndex=0,t.test(e.hostname)}function wc(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var Tc=P(`$ZodURL`,(e,t)=>{gc.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=bc(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}t.hostname&&!Cc(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!wc(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:Sc(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Ec=P(`$ZodEmoji`,(e,t)=>{t.pattern??=Ss(),gc.init(e,t)}),Dc=P(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?hs:gs(t.length),gc.init(e,t)}),Oc=P(`$ZodCUID`,(e,t)=>{t.pattern??=us,gc.init(e,t)}),kc=P(`$ZodCUID2`,(e,t)=>{t.pattern??=ds,gc.init(e,t)}),Ac=P(`$ZodULID`,(e,t)=>{t.pattern??=fs,gc.init(e,t)}),jc=P(`$ZodXID`,(e,t)=>{t.pattern??=ps,gc.init(e,t)}),Mc=P(`$ZodKSUID`,(e,t)=>{t.pattern??=ms,gc.init(e,t)}),Nc=P(`$ZodISODateTime`,(e,t)=>{t.pattern??=Is(t),gc.init(e,t)}),Pc=P(`$ZodISODate`,(e,t)=>{t.pattern??=Ns,gc.init(e,t)}),Fc=P(`$ZodISOTime`,(e,t)=>{t.pattern??=Fs(t),gc.init(e,t)}),Ic=P(`$ZodISODuration`,(e,t)=>{t.pattern??=_s,gc.init(e,t)}),Lc=P(`$ZodIPv4`,(e,t)=>{t.pattern??=Cs,gc.init(e,t)}),Rc=/^[0-9a-fA-F:.]+$/;function zc(e){if(!Rc.test(e))return!1;try{return new URL(`http://[${e}]`),!0}catch{return!1}}var Bc=P(`$ZodIPv6`,(e,t)=>{t.pattern??=ws,gc.init(e,t),e._zod.check=n=>{zc(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Vc=P(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Ts,gc.init(e,t)});function Hc(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:zc(n)}var Uc=P(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Es,gc.init(e,t),e._zod.check=n=>{Hc(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Wc(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Gc=/^[0-9a-zA-Z+/]*={0,2}$/,Kc=P(`$ZodBase64`,(e,t)=>{t.pattern??=Gc,gc.init(e,t),e._zod.check=n=>{Wc(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),qc=/^[A-Za-z0-9_-]*$/;function Jc(e){if(!qc.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Wc(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Yc=P(`$ZodBase64URL`,(e,t)=>{t.pattern??=qc,gc.init(e,t),e._zod.check=n=>{Jc(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Xc=P(`$ZodE164`,(e,t)=>{t.pattern??=As,gc.init(e,t)});function Zc(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var Qc=P(`$ZodJWT`,(e,t)=>{gc.init(e,t),e._zod.check=n=>{Zc(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),$c=P(`$ZodNumber`,(e,t)=>{dc.init(e,t),e._zod.pattern=zs,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),el=P(`$ZodNumberFormat`,(e,t)=>{Zs.init(e,t),$c.init(e,t)}),tl=P(`$ZodBoolean`,(e,t)=>{dc.init(e,t),e._zod.pattern=Bs,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),nl=P(`$ZodUndefined`,(e,t)=>{dc.init(e,t),e._zod.pattern=Hs,e._zod.values=new Set([void 0]),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),rl=P(`$ZodNull`,(e,t)=>{dc.init(e,t),e._zod.pattern=Vs,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),il=P(`$ZodAny`,(e,t)=>{dc.init(e,t),e._zod.parse=e=>e}),al=P(`$ZodUnknown`,(e,t)=>{dc.init(e,t),e._zod.parse=e=>e}),ol=P(`$ZodNever`,(e,t)=>{dc.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function sl(e,t,n){e.issues.length&&t.issues.push(...ao(n,e.issues)),t.value[n]=e.value}var cl=P(`$ZodArray`,(e,t)=>{dc.init(e,t);let n=Po.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>sl(t,r,e)));else if(sl(c,r,e),s&&c.issues.length!==0&&ro(c))break}return o.length?Promise.all(o).then(()=>r):r}});function ll(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...ao(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}}var ul=[];function dl(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:ul,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=Ga(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function fl(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(ro(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>ll(e,n,i,t,d,f))):ll(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var pl=P(`$ZodObject`,(e,t)=>{dc.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=ba(()=>dl(t));N(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||Ea(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=La,o=t.catchall,s,c=Po.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(ro(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>ll(n,t,e,r,a,o))):ll(s,t,e,r,a,o)}return o?fl(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),ml=P(`$ZodObjectJIT`,(e,t)=>{pl.init(e,t);let n=e._zod.parse,r=ba(()=>dl(t)),i=Po.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new lc([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
|
|
22
|
+
let ${e}_ab = false;
|
|
23
23
|
for (let i = 0; i < ${e}.issues.length; i++) {
|
|
24
24
|
const iss = ${e}.issues[i];
|
|
25
25
|
iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
|
|
26
26
|
payload.issues.push(iss);
|
|
27
|
-
|
|
27
|
+
if (iss.continue !== true) ${e}_ab = true;
|
|
28
|
+
}
|
|
29
|
+
if (${e}_ab && ctx && ctx.abortEarly) {
|
|
30
|
+
payload.value = newResult;
|
|
31
|
+
return payload;
|
|
32
|
+
}`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:Pa(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
|
|
28
33
|
const ${n}_present = ${i};
|
|
29
34
|
if (!${n}.issues.length || ${n}_present) {
|
|
30
35
|
if (${n}.issues.length) {${c(n,r)}
|
|
@@ -58,22 +63,25 @@ Error generating stack: `+e.message+`
|
|
|
58
63
|
input: undefined,
|
|
59
64
|
path: [${r}]
|
|
60
65
|
});
|
|
66
|
+
if (ctx && ctx.abortEarly) {
|
|
67
|
+
payload.value = newResult;
|
|
68
|
+
return payload;
|
|
69
|
+
}
|
|
61
70
|
}
|
|
62
71
|
|
|
63
72
|
if (${n}_present) {
|
|
64
73
|
newResult[${r}] = ${n}.value;
|
|
65
74
|
}
|
|
66
75
|
|
|
67
|
-
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=La,c=!Go.jitless,l=c&&wo.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?ql([],p,i,f,d,e):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}}),sd=L(`$ZodUnion`,(e,t)=>{B.init(e,t),F(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),F(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),F(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),F(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>Ta(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Jl(t,r,e,i)):Jl(o,r,e,i)}}),cd=L(`$ZodXor`,(e,t)=>{sd.init(e,t),t.inclusive=!1;let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);t instanceof Promise?(o.push(t),a=!0):o.push(t)}return a?Promise.all(o).then(t=>R(t,r,e,i)):R(o,r,e,i)}}),ld=L(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,sd.init(e,t);let n=e._zod.parse;F(e,`propValues`,e=>{let t={};for(let n of e.def.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(n)}"`);for(let[e,n]of Object.entries(r)){Object.prototype.hasOwnProperty.call(t,e)||ka(t,e,new Set);for(let r of n)t[e].add(r)}}return t}),t.options.forEach((e,n)=>{let r=id.get(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=Ca(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!La(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),ud=L(`$ZodIntersection`,(e,t)=>{B.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Xl(e,t,n)):Xl(e,i,a)}}),dd=L(`$ZodTuple`,(e,t)=>{B.init(e,t);let n=t.items,r=Go.memoizer;r?.attach(e),e._zod.parse=(i,a)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:e,expected:`tuple`,code:`invalid_type`}),i;i.value=r?r.alloc(e,i,[],a):[];let s=[],c=Zl(n,`optin`),l=Zl(n,`optout`);if(!t.rest){if(o.length<c)return i.issues.push({code:`too_small`,minimum:c,inclusive:!0,input:o,inst:e,origin:`array`}),i;o.length>n.length&&i.issues.push({code:`too_big`,maximum:n.length,inclusive:!0,input:o,inst:e,origin:`array`})}let u=Array(n.length);for(let e=0;e<n.length;e++){let t=n[e]._zod.run({value:o[e],issues:[]},a);t instanceof Promise?s.push(t.then(t=>{u[e]=t})):u[e]=t}if(t.rest){let e=n.length-1,r=o.slice(n.length);for(let n of r){e++;let r=t.rest._zod.run({value:n,issues:[]},a);r instanceof Promise?s.push(r.then(t=>Ql(t,i,e))):Ql(r,i,e)}}return s.length?Promise.all(s).then(()=>$l(u,i,n,o,l)):$l(u,i,n,o,l)}}),fd=L(`$ZodRecord`,(e,t)=>{B.init(e,t);let n=Go.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Ra(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>ro(e,i,Lo())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...eo(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...eo(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&Mc.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>ro(e,i,Lo())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...eo(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...eo(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),pd=L(`$ZodMap`,(e,t)=>{B.init(e,t);let n=Go.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!(a instanceof Map))return r.issues.push({expected:`map`,code:`invalid_type`,input:a,inst:e}),r;let o=[];r.value=n?n.alloc(e,r,new Map,i):new Map;for(let[n,s]of a){let c=t.keyType._zod.run({value:n,issues:[]},i),l=t.valueType._zod.run({value:s,issues:[]},i);c instanceof Promise||l instanceof Promise?o.push(Promise.all([c,l]).then(([t,o])=>{eu(t,o,r,n,a,e,i)})):eu(c,l,r,n,a,e,i)}return o.length?Promise.all(o).then(()=>r):r}}),md=L(`$ZodSet`,(e,t)=>{B.init(e,t);let n=Go.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!(a instanceof Set))return r.issues.push({input:a,inst:e,expected:`set`,code:`invalid_type`}),r;let o=[];r.value=n?n.alloc(e,r,new Set,i):new Set;for(let e of a){let n=t.valueType._zod.run({value:e,issues:[]},i);n instanceof Promise?o.push(n.then(e=>tu(e,r))):tu(n,r)}return o.length?Promise.all(o).then(()=>r):r}}),hd=L(`$ZodEnum`,(e,t)=>{B.init(e,t);let n=xa(t.entries),r=new Set(n);e._zod.values=r;let i=n.filter(e=>Eo.has(typeof e));e._zod.pattern=RegExp(i.length?`^(${i.map(e=>Va(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),gd=L(`$ZodLiteral`,(e,t)=>{B.init(e,t);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(t.values.length?`^(${t.values.map(e=>typeof e==`string`?Va(e):e?Va(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),_d=L(`$ZodFile`,(e,t)=>{B.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r instanceof File||t.issues.push({expected:`file`,code:`invalid_type`,input:r,inst:e}),t}}),vd=L(`$ZodTransform`,(e,t)=>{B.init(e,t),e._zod.optin=`optional`,Go.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Wo(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new Uo;return n.value=i,n}}),yd=L(`$ZodOptional`,(e,t)=>{B.init(e,t),F(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,F(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),F(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Ta(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>nu(e,t)):nu(e,r)}return t.innerType._zod.run(e,n)}}),bd=L(`$ZodExactOptional`,(e,t)=>{yd.init(e,t),F(e,`values`,e=>e.def.innerType._zod.values),F(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),xd=L(`$ZodNullable`,(e,t)=>{B.init(e,t),F(e,`optin`,e=>e.def.innerType._zod.optin),F(e,`optout`,e=>e.def.innerType._zod.optout),F(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Ta(t.source)}|null)$`):void 0}),F(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Sd=L(`$ZodDefault`,(e,t)=>{B.init(e,t),e._zod.optin=`defaulted`,F(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>ru(e,t)):ru(r,t)}}),Cd=L(`$ZodPrefault`,(e,t)=>{B.init(e,t),e._zod.optin=`defaulted`,F(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),wd=L(`$ZodNonOptional`,(e,t)=>{B.init(e,t),F(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>iu(t,e)):iu(i,e)}}),Td=L(`$ZodSuccess`,(e,t)=>{B.init(e,t),e._zod.parse=(e,n)=>{if(n.direction===`backward`)throw new Wo(`ZodSuccess`);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>(e.value=t.issues.length===0,e)):(e.value=r.issues.length===0,e)}}),Ed=L(`$ZodCatch`,(e,t)=>{B.init(e,t),F(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),F(e,`optout`,e=>e.def.innerType._zod.optout),F(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>au(e,r,t,n)):au(e,r,t,n)}}),Dd=L(`$ZodNaN`,(e,t)=>{B.init(e,t),e._zod.parse=(t,n)=>((typeof t.value!=`number`||!Number.isNaN(t.value))&&t.issues.push({input:t.value,inst:e,expected:`nan`,code:`invalid_type`}),t)}),Od=L(`$ZodPipe`,(e,t)=>{B.init(e,t),F(e,`values`,e=>e.def.in._zod.values),F(e,`optin`,e=>e.def.in._zod.optin),F(e,`optout`,e=>e.def.out._zod.optout),F(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>ou(e,t.in,n)):ou(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>ou(e,t.out,n)):ou(r,t.out,n)}}),kd=L(`$ZodCodec`,(e,t)=>{B.init(e,t),F(e,`values`,e=>e.def.in._zod.values),F(e,`optin`,e=>e.def.in._zod.optin),F(e,`optout`,e=>e.def.out._zod.optout),F(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if((n.direction||`forward`)===`forward`){let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>su(e,t,n)):su(r,t,n)}{let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>su(e,t,n)):su(r,t,n)}}}),Ad=L(`$ZodPreprocess`,(e,t)=>{Od.init(e,t)}),V=L(`$ZodReadonly`,(e,t)=>{B.init(e,t),F(e,`propValues`,e=>e.def.innerType._zod.propValues),F(e,`values`,e=>e.def.innerType._zod.values),F(e,`optin`,e=>e.def.innerType?._zod?.optin),F(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(lu):lu(r)}}),jd=L(`$ZodTemplateLiteral`,(e,t)=>{B.init(e,t);let n=[];for(let e of t.parts)if(typeof e==`object`&&e){if(!e._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);let t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw Error(`Invalid template literal part: ${e._zod.traits}`);let r=+!!t.startsWith(`^`),i=t.endsWith(`$`)?t.length-1:t.length;n.push(t.slice(r,i))}else if(e===null||Do.has(typeof e))n.push(Va(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${n.join(``)}$`),e._zod.parse=(n,r)=>typeof n.value==`string`?(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:`invalid_format`,format:t.format??`template_literal`,pattern:e._zod.pattern.source}),n):(n.issues.push({input:n.value,inst:e,expected:`string`,code:`invalid_type`}),n)}),Md=L(`$ZodFunction`,(e,t)=>(B.init(e,t),Object.defineProperty(e,"_def",{value:t}),e._zod.def=t,e.implement=t=>{if(typeof t!=`function`)throw Error(`implement() must be called with a function`);return Object.defineProperty(function(...n){let r=e._def.input?fs(e._def.input,n):n,i=Reflect.apply(t,this,r);return e._def.output?fs(e._def.output,i):i},"_zod",{value:e._zod,enumerable:!1})},e.implementAsync=t=>{if(typeof t!=`function`)throw Error(`implementAsync() must be called with a function`);return Object.defineProperty(async function(...n){let r=e._def.input?await ms(e._def.input,n):n,i=await Reflect.apply(t,this,r);return e._def.output?await ms(e._def.output,i):i},"_zod",{value:e._zod,enumerable:!1})},e._zod.parse=(t,n)=>typeof t.value==`function`?(t.value=e._def.output&&e._def.output._zod.def.type===`promise`?e.implementAsync(t.value):e.implement(t.value),t):(t.issues.push({code:`invalid_type`,expected:`function`,input:t.value,inst:e}),t),e.input=(...t)=>{let n=e.constructor;return Array.isArray(t[0])?new n({type:`function`,input:new dd({type:`tuple`,items:t[0],rest:t[1]}),output:e._def.output}):new n({type:`function`,input:t[0],output:e._def.output})},e.output=t=>{let n=e.constructor;return new n({type:`function`,input:e._def.input,output:t})},e)),Nd=L(`$ZodPromise`,(e,t)=>{B.init(e,t),e._zod.parse=(e,n)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},n))}),Pd=L(`$ZodLazy`,(e,t)=>{B.init(e,t),Da(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),F(e,`pattern`,e=>e.innerType?._zod?.pattern),F(e,`propValues`,e=>e.innerType?._zod?.propValues),F(e,`optin`,e=>e.innerType?._zod?.optin??void 0),F(e,`optout`,e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Fd=L(`$ZodCustom`,(e,t)=>{nl.init(e,t),B.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>uu(t,n,r,e));uu(i,n,r,e)}})}));function Ld(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}function Rd(e,t){let n=Kd.get(e);if(n!==void 0)return n;if(t.has(e))return!0;t.add(e);let r=!1,i=e=>{!r&&e?._zod&&Rd(e,t)&&(r=!0)},a=e._zod.def;switch(a.type){case`object`:for(let e of Reflect.ownKeys(a.shape))i(a.shape[e]);i(a.catchall);break;case`array`:i(a.element);break;case`tuple`:for(let e of a.items)i(e);i(a.rest);break;case`record`:case`map`:i(a.keyType),i(a.valueType);break;case`set`:i(a.valueType);break;case`union`:for(let e of a.options)i(e);break;case`intersection`:i(a.left),i(a.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:i(a.innerType);break;case`pipe`:i(a.in),i(a.out);break;case`function`:i(a.input),i(a.output);break;case`lazy`:i(e._zod.innerType);break;case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in a){let t=Object.getOwnPropertyDescriptor(a,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)i(n);else if(Array.isArray(n))for(let e of n)i(e)}}}return t.delete(e),Kd.set(e,r),r}function zd(e){return Rd(e,new Set)}function Bd(e,t){let n=e.buckets.get(t);return n||(n=new Map,e.buckets.set(t,n)),n}function Vd(){return Yd}function Hd(e,t){let n=e[Wd]?.backEdges;return n!==void 0&&typeof t==`object`&&!!t&&n.has(t)}var Ud,Wd,Gd,Kd,qd,Jd,Yd,Xd=t((()=>{Ud=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},Wd=`~memo`,Gd=[],Kd=new WeakMap,Jd=[],Yd={alloc(e,t,n){let r=qd;if(!r)return n;qd=void 0;let i={value:n,issues:null};return r.set(t.value,i),Jd.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&Hd(n,e.value))throw new Ud;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,a=(o,s)=>{if(n===void 0&&(n=Rd(e,new Set),!n))return e._zod.parse=t,e._zod.run===a&&(e._zod.run=t),t(o,s);let c=o.value;if(typeof c!=`object`||!c)return t(o,s);let l=s[Wd];l||(l={buckets:new Map,backEdges:void 0},s[Wd]=l);let u;r===s?u=i:(u=Bd(l,e),r=s,i=u);let d=u.get(c);if(d)return o.value=d.value,d.issues?d.issues.length&&o.issues.push(...Ld(d.issues)):(o.memo=!0,l.backEdges??(l.backEdges=new Set),l.backEdges.add(d.value)),o;qd=u;let f=Jd.length,p=t(o,s);qd=void 0;let m=Jd.length>f?Jd.pop():void 0;return p instanceof Promise?p.then(e=>(m&&(m.issues=e.issues.length?Ld(e.issues):Gd),e)):(m&&(m.issues=p.issues.length?Ld(p.issues):Gd),p)};e._zod.parse=a,e._zod.run===t&&(e._zod.run=a)})}}}));function Zd(){return{localeError:Qd()}}var Qd,$d=t((()=>{I(),Qd=()=>{let e={string:{unit:`حرف`,verb:`أن يحوي`},file:{unit:`بايت`,verb:`أن يحوي`},array:{unit:`عنصر`,verb:`أن يحوي`},set:{unit:`عنصر`,verb:`أن يحوي`},map:{unit:`عنصر`,verb:`أن يحوي`}};function t(t){return e[t]??null}let n={regex:`مدخل`,email:`بريد إلكتروني`,url:`رابط`,emoji:`إيموجي`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`تاريخ ووقت بمعيار ISO`,date:`تاريخ بمعيار ISO`,time:`وقت بمعيار ISO`,duration:`مدة بمعيار ISO`,ipv4:`عنوان IPv4`,ipv6:`عنوان IPv6`,mac:`عنوان MAC`,cidrv4:`مدى عناوين بصيغة IPv4`,cidrv6:`مدى عناوين بصيغة IPv6`,base64:`نَص بترميز base64-encoded`,base64url:`نَص بترميز base64url-encoded`,json_string:`نَص على هيئة JSON`,e164:`رقم هاتف بمعيار E.164`,credit_card:`رقم بطاقة الائتمان`,jwt:`JWT`,template_literal:`مدخل`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`مدخلات غير مقبولة: يفترض إدخال instanceof ${e.expected}، ولكن تم إدخال ${i}`:`مدخلات غير مقبولة: يفترض إدخال ${t}، ولكن تم إدخال ${i}`}case`invalid_value`:return e.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${M(e.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?` أكبر من اللازم: يفترض أن تكون ${e.origin??`القيمة`} ${n} ${e.maximum.toString()} ${r.unit??`عنصر`}`:`أكبر من اللازم: يفترض أن تكون ${e.origin??`القيمة`} ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()} ${r.unit}`:`أصغر من اللازم: يفترض لـ ${e.origin} أن يكون ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`نَص غير مقبول: يجب أن يبدأ بـ "${e.prefix}"`:t.format===`ends_with`?`نَص غير مقبول: يجب أن ينتهي بـ "${t.suffix}"`:t.format===`includes`?`نَص غير مقبول: يجب أن يتضمَّن "${t.includes}"`:t.format===`regex`?`نَص غير مقبول: يجب أن يطابق النمط ${t.pattern}`:`${n[t.format]??e.format} غير مقبول`}case`not_multiple_of`:return`رقم غير مقبول: يجب أن يكون من مضاعفات ${e.divisor}`;case`unrecognized_keys`:return`معرف${e.keys.length>1?`ات`:``} غريب${e.keys.length>1?`ة`:``}: ${A(e.keys,`، `)}`;case`invalid_key`:return`معرف غير مقبول في ${e.origin}`;case`invalid_union`:return`مدخل غير مقبول`;case`invalid_element`:return`مدخل غير مقبول في ${e.origin}`;default:return`مدخل غير مقبول`}}}}));function ef(){return{localeError:tf()}}var tf,nf=t((()=>{I(),tf=()=>{let e={string:{unit:`simvol`,verb:`olmalıdır`},file:{unit:`bayt`,verb:`olmalıdır`},array:{unit:`element`,verb:`olmalıdır`},set:{unit:`element`,verb:`olmalıdır`},map:{unit:`element`,verb:`olmalıdır`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,credit_card:`kredit kartı nömrəsi`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Yanlış dəyər: gözlənilən instanceof ${e.expected}, daxil olan ${i}`:`Yanlış dəyər: gözlənilən ${t}, daxil olan ${i}`}case`invalid_value`:return e.values.length===1?`Yanlış dəyər: gözlənilən ${M(e.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Çox böyük: gözlənilən ${e.origin??`dəyər`} ${n}${e.maximum.toString()} ${r.unit??`element`}`:`Çox böyük: gözlənilən ${e.origin??`dəyər`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`Çox kiçik: gözlənilən ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Yanlış mətn: "${t.prefix}" ilə başlamalıdır`:t.format===`ends_with`?`Yanlış mətn: "${t.suffix}" ilə bitməlidir`:t.format===`includes`?`Yanlış mətn: "${t.includes}" daxil olmalıdır`:t.format===`regex`?`Yanlış mətn: ${t.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${n[t.format]??e.format}`}case`not_multiple_of`:return`Yanlış ədəd: ${e.divisor} ilə bölünə bilən olmalıdır`;case`unrecognized_keys`:return`Tanınmayan açar${e.keys.length>1?`lar`:``}: ${A(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} daxilində yanlış açar`;case`invalid_union`:return`Yanlış dəyər`;case`invalid_element`:return`${e.origin} daxilində yanlış dəyər`;default:return`Yanlış dəyər`}}}}));function rf(e,t,n,r){let i=Math.abs(e),a=i%10,o=i%100;return o>=11&&o<=19?r:a===1?t:a>=2&&a<=4?n:r}function af(){return{localeError:of()}}var of,sf=t((()=>{I(),of=()=>{let e={string:{unit:{one:`сімвал`,few:`сімвалы`,many:`сімвалаў`},verb:`мець`},array:{unit:{one:`элемент`,few:`элементы`,many:`элементаў`},verb:`мець`},set:{unit:{one:`элемент`,few:`элементы`,many:`элементаў`},verb:`мець`},map:{unit:{one:`элемент`,few:`элементы`,many:`элементаў`},verb:`мець`},file:{unit:{one:`байт`,few:`байты`,many:`байтаў`},verb:`мець`}};function t(t){return e[t]??null}let n={regex:`увод`,email:`email адрас`,url:`URL`,emoji:`эмодзі`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO дата і час`,date:`ISO дата`,time:`ISO час`,duration:`ISO працягласць`,ipv4:`IPv4 адрас`,ipv6:`IPv6 адрас`,mac:`MAC адрас`,cidrv4:`IPv4 дыяпазон`,cidrv6:`IPv6 дыяпазон`,base64:`радок у фармаце base64`,base64url:`радок у фармаце base64url`,json_string:`JSON радок`,e164:`нумар E.164`,credit_card:`нумар крэдытнай карты`,jwt:`JWT`,template_literal:`увод`},r={nan:`NaN`,number:`лік`,array:`масіў`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Няправільны ўвод: чакаўся instanceof ${e.expected}, атрымана ${i}`:`Няправільны ўвод: чакаўся ${t}, атрымана ${i}`}case`invalid_value`:return e.values.length===1?`Няправільны ўвод: чакалася ${M(e.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=rf(Number(e.maximum),r.unit.one,r.unit.few,r.unit.many);return`Занадта вялікі: чакалася, што ${e.origin??`значэнне`} павінна ${r.verb} ${n}${e.maximum.toString()} ${t}`}return`Занадта вялікі: чакалася, што ${e.origin??`значэнне`} павінна быць ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=rf(Number(e.minimum),r.unit.one,r.unit.few,r.unit.many);return`Занадта малы: чакалася, што ${e.origin} павінна ${r.verb} ${n}${e.minimum.toString()} ${t}`}return`Занадта малы: чакалася, што ${e.origin} павінна быць ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Няправільны радок: павінен пачынацца з "${t.prefix}"`:t.format===`ends_with`?`Няправільны радок: павінен заканчвацца на "${t.suffix}"`:t.format===`includes`?`Няправільны радок: павінен змяшчаць "${t.includes}"`:t.format===`regex`?`Няправільны радок: павінен адпавядаць шаблону ${t.pattern}`:`Няправільны ${n[t.format]??e.format}`}case`not_multiple_of`:return`Няправільны лік: павінен быць кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспазнаны ${e.keys.length>1?`ключы`:`ключ`}: ${A(e.keys,`, `)}`;case`invalid_key`:return`Няправільны ключ у ${e.origin}`;case`invalid_union`:return`Няправільны ўвод`;case`invalid_element`:return`Няправільнае значэнне ў ${e.origin}`;default:return`Няправільны ўвод`}}}}));function cf(){return{localeError:lf()}}var lf,uf=t((()=>{I(),lf=()=>{let e={string:{unit:`символа`,verb:`да съдържа`},file:{unit:`байта`,verb:`да съдържа`},array:{unit:`елемента`,verb:`да съдържа`},set:{unit:`елемента`,verb:`да съдържа`},map:{unit:`елемента`,verb:`да съдържа`}};function t(t){return e[t]??null}let n={regex:`вход`,email:`имейл адрес`,url:`URL`,emoji:`емоджи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO време`,date:`ISO дата`,time:`ISO време`,duration:`ISO продължителност`,ipv4:`IPv4 адрес`,ipv6:`IPv6 адрес`,mac:`MAC адрес`,cidrv4:`IPv4 диапазон`,cidrv6:`IPv6 диапазон`,base64:`base64-кодиран низ`,base64url:`base64url-кодиран низ`,json_string:`JSON низ`,e164:`E.164 номер`,credit_card:`номер на кредитна карта`,jwt:`JWT`,template_literal:`вход`},r={nan:`NaN`,number:`число`,array:`масив`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Невалиден вход: очакван instanceof ${e.expected}, получен ${i}`:`Невалиден вход: очакван ${t}, получен ${i}`}case`invalid_value`:return e.values.length===1?`Невалиден вход: очакван ${M(e.values[0])}`:`Невалидна опция: очаквано едно от ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Твърде голямо: очаква се ${e.origin??`стойност`} да съдържа ${n}${e.maximum.toString()} ${r.unit??`елемента`}`:`Твърде голямо: очаква се ${e.origin??`стойност`} да бъде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Твърде малко: очаква се ${e.origin} да съдържа ${n}${e.minimum.toString()} ${r.unit}`:`Твърде малко: очаква се ${e.origin} да бъде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;if(t.format===`starts_with`)return`Невалиден низ: трябва да започва с "${t.prefix}"`;if(t.format===`ends_with`)return`Невалиден низ: трябва да завършва с "${t.suffix}"`;if(t.format===`includes`)return`Невалиден низ: трябва да включва "${t.includes}"`;if(t.format===`regex`)return`Невалиден низ: трябва да съвпада с ${t.pattern}`;let r=`Невалиден`;return t.format===`emoji`&&(r=`Невалидно`),t.format===`datetime`&&(r=`Невалидно`),t.format===`date`&&(r=`Невалидна`),t.format===`time`&&(r=`Невалидно`),t.format===`duration`&&(r=`Невалидна`),`${r} ${n[t.format]??e.format}`}case`not_multiple_of`:return`Невалидно число: трябва да бъде кратно на ${e.divisor}`;case`unrecognized_keys`:return`Неразпознат${e.keys.length>1?`и`:``} ключ${e.keys.length>1?`ове`:``}: ${A(e.keys,`, `)}`;case`invalid_key`:return`Невалиден ключ в ${e.origin}`;case`invalid_union`:return`Невалиден вход`;case`invalid_element`:return`Невалидна стойност в ${e.origin}`;default:return`Невалиден вход`}}}}));function df(){return{localeError:ff()}}var ff,pf=t((()=>{I(),ff=()=>{let e={string:{unit:`অক্ষর`,verb:`থাকতে হবে`},file:{unit:`বাইট`,verb:`থাকতে হবে`},array:{unit:`আইটেম`,verb:`থাকতে হবে`},set:{unit:`আইটেম`,verb:`থাকতে হবে`},map:{unit:`এন্ট্রি`,verb:`থাকতে হবে`}};function t(t){return e[t]??null}let n={regex:`ইনপুট`,email:`ইমেইল ঠিকানা`,url:`URL`,emoji:`ইমোজি`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO তারিখ ও সময়`,date:`ISO তারিখ`,time:`ISO সময়`,duration:`ISO সময়কাল`,ipv4:`IPv4 ঠিকানা`,ipv6:`IPv6 ঠিকানা`,mac:`MAC ঠিকানা`,cidrv4:`IPv4 রেঞ্জ`,cidrv6:`IPv6 রেঞ্জ`,base64:`base64-এনকোডেড স্ট্রিং`,base64url:`base64url-এনকোডেড স্ট্রিং`,json_string:`JSON স্ট্রিং`,e164:`E.164 নম্বর`,credit_card:`ক্রেডিট কার্ড নম্বর`,jwt:`JWT`,template_literal:`ইনপুট`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input);return`অবৈধ ইনপুট: প্রত্যাশিত ${t}, প্রাপ্ত ${r[n]??n}`}case`invalid_value`:return e.values.length===1?`অবৈধ ইনপুট: প্রত্যাশিত ${M(e.values[0])}`:`অবৈধ অপশন: ${A(e.values,` | `)} এর মধ্যে একটি প্রত্যাশিত`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`অনেক বড়: ${e.origin??`মান`} ${n}${e.maximum.toString()} ${r.unit??`এলিমেন্ট`} হতে হবে`:`অনেক বড়: ${e.origin??`মান`} ${n}${e.maximum.toString()} হতে হবে`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`অনেক ছোট: ${e.origin} ${n}${e.minimum.toString()} ${r.unit} হতে হবে`:`অনেক ছোট: ${e.origin} ${n}${e.minimum.toString()} হতে হবে`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`অবৈধ স্ট্রিং: "${t.prefix}" দিয়ে শুরু হতে হবে`:t.format===`ends_with`?`অবৈধ স্ট্রিং: "${t.suffix}" দিয়ে শেষ হতে হবে`:t.format===`includes`?`অবৈধ স্ট্রিং: "${t.includes}" অন্তর্ভুক্ত থাকতে হবে`:t.format===`regex`?`অবৈধ স্ট্রিং: ${t.pattern} প্যাটার্ন মিলতে হবে`:`অবৈধ ${n[t.format]??e.format}`}case`not_multiple_of`:return`অবৈধ নম্বর: ${e.divisor} এর গুণিতক হতে হবে`;case`unrecognized_keys`:return`অচেনা কী${e.keys.length>1?`গুলো`:``}: ${A(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} এ অবৈধ কী`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`অবৈধ ডিসক্রিমিনেটর মান। প্রত্যাশিত ${e.options.map(e=>`'${e}'`).join(` | `)}`:`অবৈধ ইনপুট`;case`invalid_element`:return`${e.origin} এ অবৈধ মান`;default:return`অবৈধ ইনপুট`}}}}));function mf(){return{localeError:hf()}}var hf,gf=t((()=>{I(),hf=()=>{let e={string:{unit:`caràcters`,verb:`contenir`},file:{unit:`bytes`,verb:`contenir`},array:{unit:`elements`,verb:`contenir`},set:{unit:`elements`,verb:`contenir`},map:{unit:`elements`,verb:`contenir`}};function t(t){return e[t]??null}let n={regex:`entrada`,email:`adreça electrònica`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data i hora ISO`,date:`data ISO`,time:`hora ISO`,duration:`durada ISO`,ipv4:`adreça IPv4`,ipv6:`adreça IPv6`,mac:`adreça MAC`,cidrv4:`rang IPv4`,cidrv6:`rang IPv6`,base64:`cadena codificada en base64`,base64url:`cadena codificada en base64url`,json_string:`cadena JSON`,e164:`número E.164`,credit_card:`número de targeta de crèdit`,jwt:`JWT`,template_literal:`entrada`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Tipus invàlid: s'esperava instanceof ${e.expected}, s'ha rebut ${i}`:`Tipus invàlid: s'esperava ${t}, s'ha rebut ${i}`}case`invalid_value`:return e.values.length===1?`Valor invàlid: s'esperava ${M(e.values[0])}`:`Opció invàlida: s'esperava una de ${A(e.values,` o `)}`;case`too_big`:{let n=e.inclusive?`com a màxim`:`menys de`,r=t(e.origin);return r?`Massa gran: s'esperava que ${e.origin??`el valor`} contingués ${n} ${e.maximum.toString()} ${r.unit??`elements`}`:`Massa gran: s'esperava que ${e.origin??`el valor`} fos ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`com a mínim`:`més de`,r=t(e.origin);return r?`Massa petit: s'esperava que ${e.origin} contingués ${n} ${e.minimum.toString()} ${r.unit}`:`Massa petit: s'esperava que ${e.origin} fos ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Format invàlid: ha de començar amb "${t.prefix}"`:t.format===`ends_with`?`Format invàlid: ha d'acabar amb "${t.suffix}"`:t.format===`includes`?`Format invàlid: ha d'incloure "${t.includes}"`:t.format===`regex`?`Format invàlid: ha de coincidir amb el patró ${t.pattern}`:`Format invàlid per a ${n[t.format]??e.format}`}case`not_multiple_of`:return`Número invàlid: ha de ser múltiple de ${e.divisor}`;case`unrecognized_keys`:return`Clau${e.keys.length>1?`s`:``} no reconeguda${e.keys.length>1?`s`:``}: ${A(e.keys,`, `)}`;case`invalid_key`:return`Clau invàlida a ${e.origin}`;case`invalid_union`:return`Entrada invàlida`;case`invalid_element`:return`Element invàlid a ${e.origin}`;default:return`Entrada invàlida`}}}}));function _f(){return{localeError:vf()}}var vf,yf=t((()=>{I(),vf=()=>{let e={string:{unit:`پیت`,verb:`بێت`},file:{unit:`بایت`,verb:`بێت`},array:{unit:`دانە`,verb:`بێت`},set:{unit:`دانە`,verb:`بێت`},map:{unit:`دانە`,verb:`بێت`}};function t(t){return e[t]??null}let n={regex:`regex`,email:`ئیمەیڵ`,url:`بەستەر (URL)`,emoji:`ئیمۆجی`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ڕێکەوت و کات`,date:`ڕێکەوت`,time:`کات`,duration:`ماوە`,ipv4:`ناونیشانی IPv4`,ipv6:`ناونیشانی IPv6`,mac:`ناونیشانی MAC`,cidrv4:`مەودای IPv4`,cidrv6:`مەودای IPv6`,base64:`دەقی base64`,base64url:`دەقی base64url`,json_string:`دەقی JSON`,e164:`ژمارەی E.164`,credit_card:`ژمارەی کارتی کرێدیت`,jwt:`JWT`,template_literal:`تێکردە`},r={nan:`NaN`,string:`نووسین`,number:`ژمارە`,boolean:`boolean`,array:`array`,object:`object`,date:`ڕێکەوت`,integer:`ژمارە`,float:`ژمارە`,null:`null`,undefined:`undefined`,function:`function`,symbol:`symbol`,unknown:`unknown`,promise:`promise`,void:`void`,never:`never`,map:`map`,set:`set`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n,a=[`ا`,`و`,`ۆ`,`وو`,`ە`,`ی`,`ێ`].some(e=>i.endsWith(e))?`یە`:`ە`,o=/^[a-zA-Z]+$/.test(i);return n===`null`||n===`undefined`?`داواکراوە`:`چاوەڕوانکراوە ${t} بێت، بەڵام ${i}${o?``:a}`}case`invalid_value`:return e.values.length===1?`بەهاکە نادرووستە: چاوەڕوانکراوە ${M(e.values[0])} بێت`:`هەڵبژاردەی نادروست: چاوەڕوانکراوە یەکێک بێت لە ${A(e.values,`|`)}`;case`too_big`:{let n=t(e.origin);return n?`پێویستە بە لایەنی زۆرەوە ${e.maximum.toString()} ${n.unit} ${n.verb}`:`پێویستە بە لایەنی زۆرەوە ${e.maximum.toString()} بێت`}case`too_small`:{let n=t(e.origin);return n?`پێویستە بە لایەنی کەمەوە ${e.minimum.toString()} ${n.unit} ${n.verb}`:`پێویستە بە لایەنی کەمەوە ${e.minimum.toString()} بێت`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`دەقی نادروست: پێویستە دەستپێبکات بە "${t.prefix}"`:t.format===`ends_with`?`دەقی نادروست: پێویستە کۆتاییبێت بە "${t.suffix}"`:t.format===`includes`?`دەقی نادروست: پێویستە "${t.includes}" لەخۆبگرێت`:t.format===`regex`?`دەقی نادروست: پێویستە لەگەڵ پاتێرنی ${t.pattern} بگونجێت`:`بەهای ${n[t.format]??e.format} نادروستە`}case`not_multiple_of`:return`ژمارەی نادروست: دەبێت چەند هێندە بێت بۆ ${e.divisor}`;case`unrecognized_keys`:return`کلیلی نەناسراو: ${A(e.keys,`, `)}`;case`invalid_key`:return`کلیلی نادروست لە ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`بەهای نەناسراو هەیە. بەهای چاوەڕوانکراو: ${e.options.map(e=>`'${e}'`).join(` | `)}`:`یەکگرتنی نادروست`;case`invalid_element`:return`${e.origin} بەهاکە نادروستە`;default:return`تێکردەی نادروست`}}}}));function bf(){return{localeError:xf()}}var xf,Sf=t((()=>{I(),xf=()=>{let e={string:{unit:`znaků`,verb:`mít`},file:{unit:`bajtů`,verb:`mít`},array:{unit:`prvků`,verb:`mít`},set:{unit:`prvků`,verb:`mít`},map:{unit:`prvků`,verb:`mít`}};function t(t){return e[t]??null}let n={regex:`regulární výraz`,email:`e-mailová adresa`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`datum a čas ve formátu ISO`,date:`datum ve formátu ISO`,time:`čas ve formátu ISO`,duration:`doba trvání ISO`,ipv4:`IPv4 adresa`,ipv6:`IPv6 adresa`,mac:`MAC adresa`,cidrv4:`rozsah IPv4`,cidrv6:`rozsah IPv6`,base64:`řetězec zakódovaný ve formátu base64`,base64url:`řetězec zakódovaný ve formátu base64url`,json_string:`řetězec ve formátu JSON`,e164:`číslo E.164`,credit_card:`číslo kreditní karty`,jwt:`JWT`,template_literal:`vstup`},r={nan:`NaN`,number:`číslo`,string:`řetězec`,function:`funkce`,array:`pole`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Neplatný vstup: očekáváno instanceof ${e.expected}, obdrženo ${i}`:`Neplatný vstup: očekáváno ${t}, obdrženo ${i}`}case`invalid_value`:return e.values.length===1?`Neplatný vstup: očekáváno ${M(e.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Hodnota je příliš velká: ${e.origin??`hodnota`} musí mít ${n}${e.maximum.toString()} ${r.unit??`prvků`}`:`Hodnota je příliš velká: ${e.origin??`hodnota`} musí být ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Hodnota je příliš malá: ${e.origin??`hodnota`} musí mít ${n}${e.minimum.toString()} ${r.unit??`prvků`}`:`Hodnota je příliš malá: ${e.origin??`hodnota`} musí být ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neplatný řetězec: musí začínat na "${t.prefix}"`:t.format===`ends_with`?`Neplatný řetězec: musí končit na "${t.suffix}"`:t.format===`includes`?`Neplatný řetězec: musí obsahovat "${t.includes}"`:t.format===`regex`?`Neplatný řetězec: musí odpovídat vzoru ${t.pattern}`:`Neplatný formát ${n[t.format]??e.format}`}case`not_multiple_of`:return`Neplatné číslo: musí být násobkem ${e.divisor}`;case`unrecognized_keys`:return`Neznámé klíče: ${A(e.keys,`, `)}`;case`invalid_key`:return`Neplatný klíč v ${e.origin}`;case`invalid_union`:return`Neplatný vstup`;case`invalid_element`:return`Neplatná hodnota v ${e.origin}`;default:return`Neplatný vstup`}}}}));function Cf(){return{localeError:wf()}}var wf,Tf=t((()=>{I(),wf=()=>{let e={string:{unit:`tegn`,verb:`havde`},file:{unit:`bytes`,verb:`havde`},array:{unit:`elementer`,verb:`indeholdt`},set:{unit:`elementer`,verb:`indeholdt`},map:{unit:`elementer`,verb:`indeholdt`}};function t(t){return e[t]??null}let n={regex:`input`,email:`e-mailadresse`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO dato- og klokkeslæt`,date:`ISO-dato`,time:`ISO-klokkeslæt`,duration:`ISO-varighed`,ipv4:`IPv4-adresse`,ipv6:`IPv6-adresse`,mac:`MAC-adresse`,cidrv4:`IPv4-spektrum`,cidrv6:`IPv6-spektrum`,base64:`base64-kodet streng`,base64url:`base64url-kodet streng`,json_string:`JSON-streng`,e164:`E.164-nummer`,credit_card:`kreditkortnummer`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`,string:`streng`,number:`tal`,boolean:`boolean`,array:`liste`,object:`objekt`,set:`sæt`,file:`fil`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ugyldigt input: forventede instanceof ${e.expected}, fik ${i}`:`Ugyldigt input: forventede ${t}, fik ${i}`}case`invalid_value`:return e.values.length===1?`Ugyldig værdi: forventede ${M(e.values[0])}`:`Ugyldigt valg: forventede en af følgende ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`For stor: forventede ${a??`value`} ${i.verb} ${n} ${e.maximum.toString()} ${i.unit??`elementer`}`:`For stor: forventede ${a??`value`} havde ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`For lille: forventede ${a} ${i.verb} ${n} ${e.minimum.toString()} ${i.unit}`:`For lille: forventede ${a} havde ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ugyldig streng: skal starte med "${t.prefix}"`:t.format===`ends_with`?`Ugyldig streng: skal ende med "${t.suffix}"`:t.format===`includes`?`Ugyldig streng: skal indeholde "${t.includes}"`:t.format===`regex`?`Ugyldig streng: skal matche mønsteret ${t.pattern}`:`Ugyldig ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ugyldigt tal: skal være deleligt med ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Ukendte nøgler`:`Ukendt nøgle`}: ${A(e.keys,`, `)}`;case`invalid_key`:return`Ugyldig nøgle i ${e.origin}`;case`invalid_union`:return`Ugyldigt input: matcher ingen af de tilladte typer`;case`invalid_element`:return`Ugyldig værdi i ${e.origin}`;default:return`Ugyldigt input`}}}}));function Ef(){return{localeError:Df()}}var Df,Of=t((()=>{I(),Df=()=>{let e={string:{unit:`Zeichen`,verb:`zu haben`},file:{unit:`Bytes`,verb:`zu haben`},array:{unit:`Elemente`,verb:`zu haben`},set:{unit:`Elemente`,verb:`zu haben`},map:{unit:`Elemente`,verb:`zu haben`}};function t(t){return e[t]??null}let n={regex:`Eingabe`,email:`E-Mail-Adresse`,url:`URL`,emoji:`Emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-Datum und -Uhrzeit`,date:`ISO-Datum`,time:`ISO-Uhrzeit`,duration:`ISO-Dauer`,ipv4:`IPv4-Adresse`,ipv6:`IPv6-Adresse`,mac:`MAC-Adresse`,cidrv4:`IPv4-Bereich`,cidrv6:`IPv6-Bereich`,base64:`Base64-codierter String`,base64url:`Base64-URL-codierter String`,json_string:`JSON-String`,e164:`E.164-Nummer`,credit_card:`Kreditkartennummer`,jwt:`JWT`,template_literal:`Eingabe`},r={nan:`NaN`,number:`Zahl`,array:`Array`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ungültige Eingabe: erwartet instanceof ${e.expected}, erhalten ${i}`:`Ungültige Eingabe: erwartet ${t}, erhalten ${i}`}case`invalid_value`:return e.values.length===1?`Ungültige Eingabe: erwartet ${M(e.values[0])}`:`Ungültige Option: erwartet eine von ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Zu groß: erwartet, dass ${e.origin??`Wert`} ${n}${e.maximum.toString()} ${r.unit??`Elemente`} hat`:`Zu groß: erwartet, dass ${e.origin??`Wert`} ${n}${e.maximum.toString()} ist`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ${r.unit} hat`:`Zu klein: erwartet, dass ${e.origin} ${n}${e.minimum.toString()} ist`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ungültiger String: muss mit "${t.prefix}" beginnen`:t.format===`ends_with`?`Ungültiger String: muss mit "${t.suffix}" enden`:t.format===`includes`?`Ungültiger String: muss "${t.includes}" enthalten`:t.format===`regex`?`Ungültiger String: muss dem Muster ${t.pattern} entsprechen`:`Ungültig: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ungültige Zahl: muss ein Vielfaches von ${e.divisor} sein`;case`unrecognized_keys`:return`${e.keys.length>1?`Unbekannte Schlüssel`:`Unbekannter Schlüssel`}: ${A(e.keys,`, `)}`;case`invalid_key`:return`Ungültiger Schlüssel in ${e.origin}`;case`invalid_union`:return`Ungültige Eingabe`;case`invalid_element`:return`Ungültiger Wert in ${e.origin}`;default:return`Ungültige Eingabe`}}}}));function kf(){return{localeError:Af()}}var Af,jf=t((()=>{I(),Af=()=>{let e={string:{unit:`χαρακτήρες`,verb:`να έχει`},file:{unit:`bytes`,verb:`να έχει`},array:{unit:`στοιχεία`,verb:`να έχει`},set:{unit:`στοιχεία`,verb:`να έχει`},map:{unit:`καταχωρήσεις`,verb:`να έχει`}};function t(t){return e[t]??null}let n={regex:`είσοδος`,email:`διεύθυνση email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO ημερομηνία και ώρα`,date:`ISO ημερομηνία`,time:`ISO ώρα`,duration:`ISO διάρκεια`,ipv4:`διεύθυνση IPv4`,ipv6:`διεύθυνση IPv6`,mac:`διεύθυνση MAC`,cidrv4:`εύρος IPv4`,cidrv6:`εύρος IPv6`,base64:`συμβολοσειρά κωδικοποιημένη σε base64`,base64url:`συμβολοσειρά κωδικοποιημένη σε base64url`,json_string:`συμβολοσειρά JSON`,e164:`αριθμός E.164`,credit_card:`αριθμός πιστωτικής κάρτας`,jwt:`JWT`,template_literal:`είσοδος`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return typeof e.expected==`string`&&/^[A-Z]/.test(e.expected)?`Μη έγκυρη είσοδος: αναμενόταν instanceof ${e.expected}, λήφθηκε ${i}`:`Μη έγκυρη είσοδος: αναμενόταν ${t}, λήφθηκε ${i}`}case`invalid_value`:return e.values.length===1?`Μη έγκυρη είσοδος: αναμενόταν ${M(e.values[0])}`:`Μη έγκυρη επιλογή: αναμενόταν ένα από ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Πολύ μεγάλο: αναμενόταν ${e.origin??`τιμή`} να έχει ${n}${e.maximum.toString()} ${r.unit??`στοιχεία`}`:`Πολύ μεγάλο: αναμενόταν ${e.origin??`τιμή`} να είναι ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Πολύ μικρό: αναμενόταν ${e.origin} να έχει ${n}${e.minimum.toString()} ${r.unit}`:`Πολύ μικρό: αναμενόταν ${e.origin} να είναι ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Μη έγκυρη συμβολοσειρά: πρέπει να ξεκινά με "${t.prefix}"`:t.format===`ends_with`?`Μη έγκυρη συμβολοσειρά: πρέπει να τελειώνει με "${t.suffix}"`:t.format===`includes`?`Μη έγκυρη συμβολοσειρά: πρέπει να περιέχει "${t.includes}"`:t.format===`regex`?`Μη έγκυρη συμβολοσειρά: πρέπει να ταιριάζει με το μοτίβο ${t.pattern}`:`Μη έγκυρο: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Μη έγκυρος αριθμός: πρέπει να είναι πολλαπλάσιο του ${e.divisor}`;case`unrecognized_keys`:return`Άγνωστ${e.keys.length>1?`α`:`ο`} κλειδ${e.keys.length>1?`ιά`:`ί`}: ${A(e.keys,`, `)}`;case`invalid_key`:return`Μη έγκυρο κλειδί στο ${e.origin}`;case`invalid_union`:return`Μη έγκυρη είσοδος`;case`invalid_element`:return`Μη έγκυρη τιμή στο ${e.origin}`;default:return`Μη έγκυρη είσοδος`}}}}));function Mf(){return{localeError:Nf()}}var Nf,Pf=t((()=>{I(),Nf=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,credit_card:`credit card number`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(N(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${M(e.values[0])}`:`Invalid option: expected one of ${A(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${A(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}}}));function Ff(){return{localeError:If()}}var If,Lf=t((()=>{I(),If=()=>{let e={string:{unit:`karaktrojn`,verb:`havi`},file:{unit:`bajtojn`,verb:`havi`},array:{unit:`elementojn`,verb:`havi`},set:{unit:`elementojn`,verb:`havi`},map:{unit:`elementojn`,verb:`havi`}};function t(t){return e[t]??null}let n={regex:`enigo`,email:`retadreso`,url:`URL`,emoji:`emoĝio`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-datotempo`,date:`ISO-dato`,time:`ISO-tempo`,duration:`ISO-daŭro`,ipv4:`IPv4-adreso`,ipv6:`IPv6-adreso`,mac:`MAC-adreso`,cidrv4:`IPv4-rango`,cidrv6:`IPv6-rango`,base64:`64-ume kodita karaktraro`,base64url:`URL-64-ume kodita karaktraro`,json_string:`JSON-karaktraro`,e164:`E.164-nombro`,credit_card:`kreditkarta numero`,jwt:`JWT`,template_literal:`enigo`},r={nan:`NaN`,number:`nombro`,array:`tabelo`,null:`senvalora`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Nevalida enigo: atendiĝis instanceof ${e.expected}, riceviĝis ${i}`:`Nevalida enigo: atendiĝis ${t}, riceviĝis ${i}`}case`invalid_value`:return e.values.length===1?`Nevalida enigo: atendiĝis ${M(e.values[0])}`:`Nevalida opcio: atendiĝis unu el ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Tro granda: atendiĝis ke ${e.origin??`valoro`} havu ${n}${e.maximum.toString()} ${r.unit??`elementojn`}`:`Tro granda: atendiĝis ke ${e.origin??`valoro`} havu ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Tro malgranda: atendiĝis ke ${e.origin} havu ${n}${e.minimum.toString()} ${r.unit}`:`Tro malgranda: atendiĝis ke ${e.origin} estu ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Nevalida karaktraro: devas komenciĝi per "${t.prefix}"`:t.format===`ends_with`?`Nevalida karaktraro: devas finiĝi per "${t.suffix}"`:t.format===`includes`?`Nevalida karaktraro: devas inkluzivi "${t.includes}"`:t.format===`regex`?`Nevalida karaktraro: devas kongrui kun la modelo ${t.pattern}`:`Nevalida ${n[t.format]??e.format}`}case`not_multiple_of`:return`Nevalida nombro: devas esti oblo de ${e.divisor}`;case`unrecognized_keys`:return`Nekonata${e.keys.length>1?`j`:``} ŝlosilo${e.keys.length>1?`j`:``}: ${A(e.keys,`, `)}`;case`invalid_key`:return`Nevalida ŝlosilo en ${e.origin}`;case`invalid_union`:return`Nevalida enigo`;case`invalid_element`:return`Nevalida valoro en ${e.origin}`;default:return`Nevalida enigo`}}}}));function Rf(){return{localeError:zf()}}var zf,Bf=t((()=>{I(),zf=()=>{let e={string:{unit:`caracteres`,verb:`tener`},file:{unit:`bytes`,verb:`tener`},array:{unit:`elementos`,verb:`tener`},set:{unit:`elementos`,verb:`tener`}};function t(t){return e[t]??null}let n={regex:`entrada`,email:`dirección de correo electrónico`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`fecha y hora ISO`,date:`fecha ISO`,time:`hora ISO`,duration:`duración ISO`,ipv4:`dirección IPv4`,ipv6:`dirección IPv6`,mac:`dirección MAC`,cidrv4:`rango IPv4`,cidrv6:`rango IPv6`,base64:`cadena codificada en base64`,base64url:`URL codificada en base64`,json_string:`cadena JSON`,e164:`número E.164`,credit_card:`número de tarjeta de crédito`,jwt:`JWT`,template_literal:`entrada`},r={nan:`NaN`,string:`texto`,number:`número`,boolean:`booleano`,array:`arreglo`,object:`objeto`,set:`conjunto`,file:`archivo`,date:`fecha`,bigint:`número grande`,symbol:`símbolo`,undefined:`indefinido`,null:`nulo`,function:`función`,map:`mapa`,record:`registro`,tuple:`tupla`,enum:`enumeración`,union:`unión`,literal:`literal`,promise:`promesa`,void:`vacío`,never:`nunca`,unknown:`desconocido`,any:`cualquiera`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Entrada inválida: se esperaba instanceof ${e.expected}, recibido ${i}`:`Entrada inválida: se esperaba ${t}, recibido ${i}`}case`invalid_value`:return e.values.length===1?`Entrada inválida: se esperaba ${M(e.values[0])}`:`Opción inválida: se esperaba una de ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`Demasiado grande: se esperaba que ${a??`valor`} tuviera ${n}${e.maximum.toString()} ${i.unit??`elementos`}`:`Demasiado grande: se esperaba que ${a??`valor`} fuera ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`Demasiado pequeño: se esperaba que ${a} tuviera ${n}${e.minimum.toString()} ${i.unit}`:`Demasiado pequeño: se esperaba que ${a} fuera ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Cadena inválida: debe comenzar con "${t.prefix}"`:t.format===`ends_with`?`Cadena inválida: debe terminar en "${t.suffix}"`:t.format===`includes`?`Cadena inválida: debe incluir "${t.includes}"`:t.format===`regex`?`Cadena inválida: debe coincidir con el patrón ${t.pattern}`:`Inválido ${n[t.format]??e.format}`}case`not_multiple_of`:return`Número inválido: debe ser múltiplo de ${e.divisor}`;case`unrecognized_keys`:return`Llave${e.keys.length>1?`s`:``} desconocida${e.keys.length>1?`s`:``}: ${A(e.keys,`, `)}`;case`invalid_key`:return`Llave inválida en ${r[e.origin]??e.origin}`;case`invalid_union`:return`Entrada inválida`;case`invalid_element`:return`Valor inválido en ${r[e.origin]??e.origin}`;default:return`Entrada inválida`}}}}));function Vf(){return{localeError:Hf()}}var Hf,Uf=t((()=>{I(),Hf=()=>{let e={string:{unit:`کاراکتر`,verb:`داشته باشد`},file:{unit:`بایت`,verb:`داشته باشد`},array:{unit:`آیتم`,verb:`داشته باشد`},set:{unit:`آیتم`,verb:`داشته باشد`},map:{unit:`آیتم`,verb:`داشته باشد`}};function t(t){return e[t]??null}let n={regex:`ورودی`,email:`آدرس ایمیل`,url:`URL`,emoji:`ایموجی`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`تاریخ و زمان ایزو`,date:`تاریخ ایزو`,time:`زمان ایزو`,duration:`مدت زمان ایزو`,ipv4:`IPv4 آدرس`,ipv6:`IPv6 آدرس`,mac:`MAC آدرس`,cidrv4:`IPv4 دامنه`,cidrv6:`IPv6 دامنه`,base64:`base64-encoded رشته`,base64url:`base64url-encoded رشته`,json_string:`JSON رشته`,e164:`E.164 عدد`,credit_card:`شماره کارت اعتباری`,jwt:`JWT`,template_literal:`ورودی`},r={nan:`NaN`,number:`عدد`,array:`آرایه`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ورودی نامعتبر: میبایست instanceof ${e.expected} میبود، ${i} دریافت شد`:`ورودی نامعتبر: میبایست ${t} میبود، ${i} دریافت شد`}case`invalid_value`:return e.values.length===1?`ورودی نامعتبر: میبایست ${M(e.values[0])} میبود`:`گزینه نامعتبر: میبایست یکی از ${A(e.values,`|`)} میبود`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`خیلی بزرگ: ${e.origin??`مقدار`} باید ${n}${e.maximum.toString()} ${r.unit??`عنصر`} باشد`:`خیلی بزرگ: ${e.origin??`مقدار`} باید ${n}${e.maximum.toString()} باشد`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} باشد`:`خیلی کوچک: ${e.origin} باید ${n}${e.minimum.toString()} باشد`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`رشته نامعتبر: باید با "${t.prefix}" شروع شود`:t.format===`ends_with`?`رشته نامعتبر: باید با "${t.suffix}" تمام شود`:t.format===`includes`?`رشته نامعتبر: باید شامل "${t.includes}" باشد`:t.format===`regex`?`رشته نامعتبر: باید با الگوی ${t.pattern} مطابقت داشته باشد`:`${n[t.format]??e.format} نامعتبر`}case`not_multiple_of`:return`عدد نامعتبر: باید مضرب ${e.divisor} باشد`;case`unrecognized_keys`:return`کلید${e.keys.length>1?`های`:``} ناشناس: ${A(e.keys,`, `)}`;case`invalid_key`:return`کلید ناشناس در ${e.origin}`;case`invalid_union`:return`ورودی نامعتبر`;case`invalid_element`:return`مقدار نامعتبر در ${e.origin}`;default:return`ورودی نامعتبر`}}}}));function Wf(){return{localeError:Gf()}}var Gf,Kf=t((()=>{I(),Gf=()=>{let e={string:{unit:`merkkiä`,subject:`merkkijonon`},file:{unit:`tavua`,subject:`tiedoston`},array:{unit:`alkiota`,subject:`listan`},set:{unit:`alkiota`,subject:`joukon`},map:{unit:`alkiota`,subject:`kuvauksen`},number:{unit:``,subject:`luvun`},bigint:{unit:``,subject:`suuren kokonaisluvun`},int:{unit:``,subject:`kokonaisluvun`},date:{unit:``,subject:`päivämäärän`}};function t(t){return e[t]??null}let n={regex:`säännöllinen lauseke`,email:`sähköpostiosoite`,url:`URL-osoite`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-aikaleima`,date:`ISO-päivämäärä`,time:`ISO-aika`,duration:`ISO-kesto`,ipv4:`IPv4-osoite`,ipv6:`IPv6-osoite`,mac:`MAC-osoite`,cidrv4:`IPv4-alue`,cidrv6:`IPv6-alue`,base64:`base64-koodattu merkkijono`,base64url:`base64url-koodattu merkkijono`,json_string:`JSON-merkkijono`,e164:`E.164-luku`,credit_card:`luottokortin numero`,jwt:`JWT`,template_literal:`templaattimerkkijono`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Virheellinen tyyppi: odotettiin instanceof ${e.expected}, oli ${i}`:`Virheellinen tyyppi: odotettiin ${t}, oli ${i}`}case`invalid_value`:return e.values.length===1?`Virheellinen syöte: täytyy olla ${M(e.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Liian suuri: ${r.subject} täytyy olla ${n}${e.maximum.toString()} ${r.unit}`.trim():`Liian suuri: arvon täytyy olla ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Liian pieni: ${r.subject} täytyy olla ${n}${e.minimum.toString()} ${r.unit}`.trim():`Liian pieni: arvon täytyy olla ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Virheellinen syöte: täytyy alkaa "${t.prefix}"`:t.format===`ends_with`?`Virheellinen syöte: täytyy loppua "${t.suffix}"`:t.format===`includes`?`Virheellinen syöte: täytyy sisältää "${t.includes}"`:t.format===`regex`?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${t.pattern}`:`Virheellinen ${n[t.format]??e.format}`}case`not_multiple_of`:return`Virheellinen luku: täytyy olla luvun ${e.divisor} monikerta`;case`unrecognized_keys`:return`${e.keys.length>1?`Tuntemattomat avaimet`:`Tuntematon avain`}: ${A(e.keys,`, `)}`;case`invalid_key`:return`Virheellinen avain tietueessa`;case`invalid_union`:return`Virheellinen unioni`;case`invalid_element`:return`Virheellinen arvo joukossa`;default:return`Virheellinen syöte`}}}}));function qf(){return{localeError:Jf()}}var Jf,Yf=t((()=>{I(),Jf=()=>{let e={string:{unit:`caractères`,verb:`avoir`},file:{unit:`octets`,verb:`avoir`},array:{unit:`éléments`,verb:`avoir`},set:{unit:`éléments`,verb:`avoir`}};function t(t){return e[t]??null}let n={regex:`expression régulière`,email:`adresse e-mail`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`date et heure ISO`,date:`date ISO`,time:`heure ISO`,duration:`durée ISO`,ipv4:`adresse IPv4`,ipv6:`adresse IPv6`,mac:`adresse MAC`,cidrv4:`plage IPv4`,cidrv6:`plage IPv6`,base64:`chaîne de caractères encodée en base64`,base64url:`chaîne de caractères encodée en base64url`,json_string:`chaîne de caractères JSON`,e164:`numéro au format E.164`,credit_card:`numéro de carte de crédit`,jwt:`JWT`,template_literal:`entrée`},r={string:`chaîne de caractères`,number:`nombre`,int:`entier`,boolean:`booléen`,bigint:`grand entier`,symbol:`symbole`,undefined:`indéfini`,null:`null`,never:`jamais`,void:`vide`,date:`date`,array:`tableau`,object:`objet`,tuple:`tuple`,record:`record`,map:`map`,set:`ensemble`,file:`fichier`,nonoptional:`non optionnel`,nan:`NaN`,function:`fonction`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Entrée invalide : instance de ${e.expected} attendu, ${i} reçu`:`Entrée invalide : ${t} attendu, ${i} reçu`}case`invalid_value`:return e.values.length===1?`Entrée invalide : ${M(e.values[0])} attendu`:`Option invalide : une valeur parmi ${A(e.values,`|`)} attendue`;case`too_big`:{let n=e.inclusive?`<=`:`<`,i=t(e.origin);return i?`Trop grand : ${r[e.origin]??`valeur`} doit ${i.verb} ${n}${e.maximum.toString()} ${i.unit??`élément(s)`}`:`Trop grand : ${r[e.origin]??`valeur`} doit être ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,i=t(e.origin);return i?`Trop petit : ${r[e.origin]??`valeur`} doit ${i.verb} ${n}${e.minimum.toString()} ${i.unit}`:`Trop petit : ${r[e.origin]??`valeur`} doit être ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chaîne de caractères invalide : doit commencer par "${t.prefix}"`:t.format===`ends_with`?`Chaîne de caractères invalide : doit se terminer par "${t.suffix}"`:t.format===`includes`?`Chaîne de caractères invalide : doit inclure "${t.includes}"`:t.format===`regex`?`Chaîne de caractères invalide : doit correspondre au motif ${t.pattern}`:`${n[t.format]??e.format} invalide`}case`not_multiple_of`:return`Nombre invalide : doit être un multiple de ${e.divisor}`;case`unrecognized_keys`:return`Clé${e.keys.length>1?`s`:``} non reconnue${e.keys.length>1?`s`:``} : ${A(e.keys,`, `)}`;case`invalid_key`:return`Clé invalide dans ${e.origin}`;case`invalid_union`:return`Entrée invalide`;case`invalid_element`:return`Valeur invalide dans ${e.origin}`;default:return`Entrée invalide`}}}}));function Xf(){return{localeError:Zf()}}var Zf,Qf=t((()=>{I(),Zf=()=>{let e={string:{unit:`caractères`,verb:`avoir`},file:{unit:`octets`,verb:`avoir`},array:{unit:`éléments`,verb:`avoir`},set:{unit:`éléments`,verb:`avoir`},map:{unit:`éléments`,verb:`avoir`}};function t(t){return e[t]??null}let n={regex:`entrée`,email:`adresse courriel`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`date-heure ISO`,date:`date ISO`,time:`heure ISO`,duration:`durée ISO`,ipv4:`adresse IPv4`,ipv6:`adresse IPv6`,mac:`adresse MAC`,cidrv4:`plage IPv4`,cidrv6:`plage IPv6`,base64:`chaîne encodée en base64`,base64url:`chaîne encodée en base64url`,json_string:`chaîne JSON`,e164:`numéro E.164`,credit_card:`numéro de carte de crédit`,jwt:`JWT`,template_literal:`entrée`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Entrée invalide : attendu instanceof ${e.expected}, reçu ${i}`:`Entrée invalide : attendu ${t}, reçu ${i}`}case`invalid_value`:return e.values.length===1?`Entrée invalide : attendu ${M(e.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`≤`:`<`,r=t(e.origin);return r?`Trop grand : attendu que ${e.origin??`la valeur`} ait ${n}${e.maximum.toString()} ${r.unit}`:`Trop grand : attendu que ${e.origin??`la valeur`} soit ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`≥`:`>`,r=t(e.origin);return r?`Trop petit : attendu que ${e.origin} ait ${n}${e.minimum.toString()} ${r.unit}`:`Trop petit : attendu que ${e.origin} soit ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chaîne invalide : doit commencer par "${t.prefix}"`:t.format===`ends_with`?`Chaîne invalide : doit se terminer par "${t.suffix}"`:t.format===`includes`?`Chaîne invalide : doit inclure "${t.includes}"`:t.format===`regex`?`Chaîne invalide : doit correspondre au motif ${t.pattern}`:`${n[t.format]??e.format} invalide`}case`not_multiple_of`:return`Nombre invalide : doit être un multiple de ${e.divisor}`;case`unrecognized_keys`:return`Clé${e.keys.length>1?`s`:``} non reconnue${e.keys.length>1?`s`:``} : ${A(e.keys,`, `)}`;case`invalid_key`:return`Clé invalide dans ${e.origin}`;case`invalid_union`:return`Entrée invalide`;case`invalid_element`:return`Valeur invalide dans ${e.origin}`;default:return`Entrée invalide`}}}}));function $f(){return{localeError:ep()}}var ep,tp=t((()=>{I(),ep=()=>{let e={string:{unit:`અક્ષર`,verb:`હોવા જોઈએ`},file:{unit:`બાયટ`,verb:`હોવા જોઈએ`},array:{unit:`આઇટમ`,verb:`હોવા જોઈએ`},set:{unit:`આઇટમ`,verb:`હોવા જોઈએ`},map:{unit:`એન્ટ્રી`,verb:`હોવા જોઈએ`}};function t(t){return e[t]??null}let n={regex:`ઇનપુટ`,email:`ઈમેઇલ એડ્રેસ`,url:`URL`,emoji:`ઇમોજી`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO તારીખ અને સમય`,date:`ISO તારીખ`,time:`ISO સમય`,duration:`ISO અવધિ`,ipv4:`IPv4 એડ્રેસ`,ipv6:`IPv6 એડ્રેસ`,mac:`MAC એડ્રેસ`,cidrv4:`IPv4 શ્રેણી`,cidrv6:`IPv6 શ્રેણી`,base64:`base64-એન્કોડેડ સ્ટ્રિંગ`,base64url:`base64url-એન્કોડેડ સ્ટ્રિંગ`,json_string:`JSON સ્ટ્રિંગ`,e164:`E.164 નંબર`,credit_card:`ક્રેડિટ કાર્ડ નંબર`,jwt:`JWT`,template_literal:`ઇનપુટ`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input);return`અમાન્ય ઇનપુટ: અપેક્ષિત ${t}, પ્રાપ્ત ${r[n]??n}`}case`invalid_value`:return e.values.length===1?`અમાન્ય ઇનપુટ: અપેક્ષિત ${M(e.values[0])}`:`અમાન્ય વિકલ્પ: ${A(e.values,` | `)} માધ્યમથી એક અપેક્ષિત`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ખૂબ મોટું: ${e.origin??`મૂલ્ય`} ${n}${e.maximum.toString()} ${r.unit??`એલિમેન્ટ`} હોવા જોઈએ`:`ખૂબ મોટું: ${e.origin??`મૂલ્ય`} ${n}${e.maximum.toString()} હોવું જોઈએ`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`ખૂબ નાનું: ${e.origin} ${n}${e.minimum.toString()} ${r.unit} હોવા જોઈએ`:`ખૂબ નાનું: ${e.origin} ${n}${e.minimum.toString()} હોવું જોઈએ`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`અમાન્ય સ્ટ્રિંગ: "${t.prefix}" થી શરૂ થવું જોઈએ`:t.format===`ends_with`?`અમાન્ય સ્ટ્રિંગ: "${t.suffix}" પર સમાપ્ત થવું જોઈએ`:t.format===`includes`?`અમાન્ય સ્ટ્રિંગ: "${t.includes}" શામેલ હોવું જોઈએ`:t.format===`regex`?`અમાન્ય સ્ટ્રિંગ: પેટર્ન ${t.pattern} સાથે મેળ ખાવું જોઈએ`:`અમાન્ય ${n[t.format]??e.format}`}case`not_multiple_of`:return`અમાન્ય નંબર: ${e.divisor} નો ગુણાંક હોવો જોઈએ`;case`unrecognized_keys`:return`ઓળખી શકાતા નહીં તે કી${e.keys.length>1?`ઓ`:``}: ${A(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} માં અમાન્ય કી`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`અમાન્ય ડિસ્ક્રિમિનેટર મૂલ્ય. અપેક્ષિત ${e.options.map(e=>`'${e}'`).join(` | `)}`:`અમાન્ય ઇનપુટ`;case`invalid_element`:return`${e.origin} માં અમાન્ય મૂલ્ય`;default:return`અમાન્ય ઇનપુટ`}}}}));function np(){return{localeError:rp()}}var rp,ip=t((()=>{I(),rp=()=>{let e={string:{label:`מחרוזת`,gender:`f`},number:{label:`מספר`,gender:`m`},boolean:{label:`ערך בוליאני`,gender:`m`},bigint:{label:`BigInt`,gender:`m`},date:{label:`תאריך`,gender:`m`},array:{label:`מערך`,gender:`m`},object:{label:`אובייקט`,gender:`m`},null:{label:`ערך ריק (null)`,gender:`m`},undefined:{label:`ערך לא מוגדר (undefined)`,gender:`m`},symbol:{label:`סימבול (Symbol)`,gender:`m`},function:{label:`פונקציה`,gender:`f`},map:{label:`מפה (Map)`,gender:`f`},set:{label:`קבוצה (Set)`,gender:`f`},file:{label:`קובץ`,gender:`m`},promise:{label:`Promise`,gender:`m`},NaN:{label:`NaN`,gender:`m`},unknown:{label:`ערך לא ידוע`,gender:`m`},value:{label:`ערך`,gender:`m`}},t={string:{unit:`תווים`,shortLabel:`קצר`,longLabel:`ארוך`},file:{unit:`בייטים`,shortLabel:`קטן`,longLabel:`גדול`},array:{unit:`פריטים`,shortLabel:`קטן`,longLabel:`גדול`},set:{unit:`פריטים`,shortLabel:`קטן`,longLabel:`גדול`},number:{unit:``,shortLabel:`קטן`,longLabel:`גדול`}},n=t=>t?e[t]:void 0,r=t=>{let r=n(t);return r?r.label:t??e.unknown.label},i=e=>`ה${r(e)}`,a=e=>(n(e)?.gender??`m`)===`f`?`צריכה להיות`:`צריך להיות`,o=e=>e?t[e]??null:null,s={regex:{label:`קלט`,gender:`m`},email:{label:`כתובת אימייל`,gender:`f`},url:{label:`כתובת רשת`,gender:`f`},emoji:{label:`אימוג'י`,gender:`m`},uuid:{label:`UUID`,gender:`m`},uuidv4:{label:`UUIDv4`,gender:`m`},uuidv6:{label:`UUIDv6`,gender:`m`},nanoid:{label:`nanoid`,gender:`m`},guid:{label:`GUID`,gender:`m`},cuid:{label:`cuid`,gender:`m`},cuid2:{label:`cuid2`,gender:`m`},ulid:{label:`ULID`,gender:`m`},xid:{label:`XID`,gender:`m`},ksuid:{label:`KSUID`,gender:`m`},datetime:{label:`תאריך וזמן ISO`,gender:`m`},date:{label:`תאריך ISO`,gender:`m`},time:{label:`זמן ISO`,gender:`m`},duration:{label:`משך זמן ISO`,gender:`m`},ipv4:{label:`כתובת IPv4`,gender:`f`},ipv6:{label:`כתובת IPv6`,gender:`f`},mac:{label:`כתובת MAC`,gender:`f`},cidrv4:{label:`טווח IPv4`,gender:`m`},cidrv6:{label:`טווח IPv6`,gender:`m`},base64:{label:`מחרוזת בבסיס 64`,gender:`f`},base64url:{label:`מחרוזת בבסיס 64 לכתובות רשת`,gender:`f`},json_string:{label:`מחרוזת JSON`,gender:`f`},e164:{label:`מספר E.164`,gender:`m`},credit_card:{label:`מספר כרטיס אשראי`,gender:`m`},jwt:{label:`JWT`,gender:`m`},template_literal:{label:`קלט`,gender:`m`},ends_with:{label:`קלט`,gender:`m`},includes:{label:`קלט`,gender:`m`},lowercase:{label:`קלט`,gender:`m`},starts_with:{label:`קלט`,gender:`m`},uppercase:{label:`קלט`,gender:`m`}},c={nan:`NaN`};return t=>{switch(t.code){case`invalid_type`:{let n=t.expected,i=c[n??``]??r(n),a=N(t.input),o=c[a]??e[a]?.label??a;return/^[A-Z]/.test(t.expected)?`קלט לא תקין: צריך להיות instanceof ${t.expected}, התקבל ${o}`:`קלט לא תקין: צריך להיות ${i}, התקבל ${o}`}case`invalid_value`:{if(t.values.length===1)return`ערך לא תקין: הערך חייב להיות ${M(t.values[0])}`;let e=t.values.map(e=>M(e));if(t.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${e[0]} או ${e[1]}`;let n=e[e.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${e.slice(0,-1).join(`, `)} או ${n}`}case`too_big`:{let e=o(t.origin),n=i(t.origin??`value`);if(t.origin===`string`)return`${e?.longLabel??`ארוך`} מדי: ${n} צריכה להכיל ${t.maximum.toString()} ${e?.unit??``} ${t.inclusive?`או פחות`:`לכל היותר`}`.trim();if(t.origin===`number`)return`גדול מדי: ${n} צריך להיות ${t.inclusive?`קטן או שווה ל-${t.maximum}`:`קטן מ-${t.maximum}`}`;if(t.origin===`array`||t.origin===`set`)return`גדול מדי: ${n} ${t.origin===`set`?`צריכה`:`צריך`} להכיל ${t.inclusive?`${t.maximum} ${e?.unit??``} או פחות`:`פחות מ-${t.maximum} ${e?.unit??``}`}`.trim();let r=t.inclusive?`<=`:`<`,s=a(t.origin??`value`);return e?.unit?`${e.longLabel} מדי: ${n} ${s} ${r}${t.maximum.toString()} ${e.unit}`:`${e?.longLabel??`גדול`} מדי: ${n} ${s} ${r}${t.maximum.toString()}`}case`too_small`:{let e=o(t.origin),n=i(t.origin??`value`);if(t.origin===`string`)return`${e?.shortLabel??`קצר`} מדי: ${n} צריכה להכיל ${t.minimum.toString()} ${e?.unit??``} ${t.inclusive?`או יותר`:`לפחות`}`.trim();if(t.origin===`number`)return`קטן מדי: ${n} צריך להיות ${t.inclusive?`גדול או שווה ל-${t.minimum}`:`גדול מ-${t.minimum}`}`;if(t.origin===`array`||t.origin===`set`){let r=t.origin===`set`?`צריכה`:`צריך`;return t.minimum===1&&t.inclusive?`קטן מדי: ${n} ${r} להכיל ${t.origin,`לפחות פריט אחד`}`:`קטן מדי: ${n} ${r} להכיל ${t.inclusive?`${t.minimum} ${e?.unit??``} או יותר`:`יותר מ-${t.minimum} ${e?.unit??``}`}`.trim()}let r=t.inclusive?`>=`:`>`,s=a(t.origin??`value`);return e?.unit?`${e.shortLabel} מדי: ${n} ${s} ${r}${t.minimum.toString()} ${e.unit}`:`${e?.shortLabel??`קטן`} מדי: ${n} ${s} ${r}${t.minimum.toString()}`}case`invalid_format`:{let e=t;if(e.format===`starts_with`)return`המחרוזת חייבת להתחיל ב "${e.prefix}"`;if(e.format===`ends_with`)return`המחרוזת חייבת להסתיים ב "${e.suffix}"`;if(e.format===`includes`)return`המחרוזת חייבת לכלול "${e.includes}"`;if(e.format===`regex`)return`המחרוזת חייבת להתאים לתבנית ${e.pattern}`;let n=s[e.format];return`${n?.label??e.format} לא ${(n?.gender??`m`)===`f`?`תקינה`:`תקין`}`}case`not_multiple_of`:return`מספר לא תקין: חייב להיות מכפלה של ${t.divisor}`;case`unrecognized_keys`:return`מפתח${t.keys.length>1?`ות`:``} לא מזוה${t.keys.length>1?`ים`:`ה`}: ${A(t.keys,`, `)}`;case`invalid_key`:return`שדה לא תקין באובייקט`;case`invalid_union`:return`קלט לא תקין`;case`invalid_element`:return`ערך לא תקין ב${i(t.origin??`array`)}`;default:return`קלט לא תקין`}}}}));function ap(){return{localeError:op()}}var op,sp=t((()=>{I(),op=()=>{let e={string:{unit:`अक्षर`,verb:`रखने के लिए`},file:{unit:`बाइट्स`,verb:`रखने के लिए`},array:{unit:`तत्व`,verb:`रखने के लिए`},set:{unit:`तत्व`,verb:`रखने के लिए`},map:{unit:`प्रविष्टियाँ`,verb:`रखने के लिए`}};function t(t){return e[t]??null}let n={regex:`इनपुट`,email:`ईमेल पता`,url:`URL`,emoji:`इमोजी`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO तिथि और समय`,date:`ISO तिथि`,time:`ISO समय`,duration:`ISO अवधि`,ipv4:`IPv4 पता`,ipv6:`IPv6 पता`,mac:`MAC पता`,cidrv4:`IPv4 श्रेणी`,cidrv6:`IPv6 श्रेणी`,base64:`Base64-एन्कोडेड स्ट्रिंग`,base64url:`Base64URL-एन्कोडेड स्ट्रिंग`,json_string:`JSON स्ट्रिंग`,e164:`E.164 संख्या`,credit_card:`क्रेडिट कार्ड संख्या`,jwt:`JWT`,template_literal:`इनपुट`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input);return`अमान्य इनपुट: अपेक्षित ${t}, प्राप्त ${r[n]??n}`}case`invalid_value`:return e.values.length===1?`अमान्य इनपुट: अपेक्षित ${M(e.values[0])}`:`अमान्य विकल्प: अपेक्षित मानों में से एक ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`बहुत बड़ा: अपेक्षित था कि ${e.origin??`मान`} में ${n}${e.maximum} ${r.unit} हों`:`बहुत बड़ा: अपेक्षित था कि ${e.origin??`मान`} ${n}${e.maximum} हो`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`बहुत छोटा: अपेक्षित था कि ${e.origin} में ${n}${e.minimum} ${r.unit} हों`:`बहुत छोटा: अपेक्षित था कि ${e.origin} ${n}${e.minimum} हो`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`अमान्य स्ट्रिंग: "${t.prefix}" से शुरू होना चाहिए`:t.format===`ends_with`?`अमान्य स्ट्रिंग: "${t.suffix}" पर समाप्त होना चाहिए`:t.format===`includes`?`अमान्य स्ट्रिंग: इसमें "${t.includes}" शामिल होना चाहिए`:t.format===`regex`?`अमान्य स्ट्रिंग: पैटर्न ${t.pattern} से मेल खाना चाहिए`:`अमान्य ${n[t.format]??e.format}`}case`not_multiple_of`:return`अमान्य संख्या: यह ${e.divisor} का गुणज होना चाहिए`;case`unrecognized_keys`:return`अपरिचित कुंजी${e.keys.length>1?`याँ`:``}: ${A(e.keys,`, `)}`;case`invalid_key`:return`अमान्य कुंजी: ${e.origin} में`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`अमान्य डिस्क्रिमिनेटर मान: अपेक्षित ${e.options.map(e=>`'${e}'`).join(` | `)}`:`अमान्य इनपुट`;case`invalid_element`:return`अमान्य मान: ${e.origin} में`;default:return`अमान्य इनपुट`}}}}));function cp(){return{localeError:lp()}}var lp,up=t((()=>{I(),lp=()=>{let e={string:{unit:`znakova`,verb:`imati`},file:{unit:`bajtova`,verb:`imati`},array:{unit:`stavki`,verb:`imati`},set:{unit:`stavki`,verb:`imati`}};function t(t){return e[t]??null}let n={regex:`unos`,email:`email adresa`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datum i vrijeme`,date:`ISO datum`,time:`ISO vrijeme`,duration:`ISO trajanje`,ipv4:`IPv4 adresa`,ipv6:`IPv6 adresa`,mac:`MAC adresa`,cidrv4:`IPv4 raspon`,cidrv6:`IPv6 raspon`,base64:`base64 kodirani tekst`,base64url:`base64url kodirani tekst`,json_string:`JSON tekst`,e164:`E.164 broj`,credit_card:`broj kreditne kartice`,jwt:`JWT`,template_literal:`unos`},r={nan:`NaN`,string:`tekst`,number:`broj`,boolean:`boolean`,array:`niz`,object:`objekt`,set:`skup`,file:`datoteka`,date:`datum`,bigint:`bigint`,symbol:`simbol`,undefined:`undefined`,null:`null`,function:`funkcija`,map:`mapa`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Neispravan unos: očekuje se instanceof ${e.expected}, a primljeno je ${i}`:`Neispravan unos: očekuje se ${t}, a primljeno je ${i}`}case`invalid_value`:return e.values.length===1?`Neispravna vrijednost: očekivano ${M(e.values[0])}`:`Neispravna opcija: očekivano jedno od ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`Preveliko: očekivano da ${a??`vrijednost`} ima ${n}${e.maximum.toString()} ${i.unit??`elemenata`}`:`Preveliko: očekivano da ${a??`vrijednost`} bude ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,i=t(e.origin),a=r[e.origin]??e.origin;return i?`Premalo: očekivano da ${a} ima ${n}${e.minimum.toString()} ${i.unit}`:`Premalo: očekivano da ${a} bude ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neispravan tekst: mora započinjati s "${t.prefix}"`:t.format===`ends_with`?`Neispravan tekst: mora završavati s "${t.suffix}"`:t.format===`includes`?`Neispravan tekst: mora sadržavati "${t.includes}"`:t.format===`regex`?`Neispravan tekst: mora odgovarati uzorku ${t.pattern}`:`Neispravna ${n[t.format]??e.format}`}case`not_multiple_of`:return`Neispravan broj: mora biti višekratnik od ${e.divisor}`;case`unrecognized_keys`:return`Neprepoznat${e.keys.length>1?`i ključevi`:` ključ`}: ${A(e.keys,`, `)}`;case`invalid_key`:return`Neispravan ključ u ${r[e.origin]??e.origin}`;case`invalid_union`:return`Neispravan unos`;case`invalid_element`:return`Neispravna vrijednost u ${r[e.origin]??e.origin}`;default:return`Neispravan unos`}}}}));function dp(){return{localeError:fp()}}var fp,pp=t((()=>{I(),fp=()=>{let e={string:{unit:`karakter`,verb:`legyen`},file:{unit:`byte`,verb:`legyen`},array:{unit:`elem`,verb:`legyen`},set:{unit:`elem`,verb:`legyen`},map:{unit:`elem`,verb:`legyen`}};function t(t){return e[t]??null}let n={regex:`bemenet`,email:`email cím`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO időbélyeg`,date:`ISO dátum`,time:`ISO idő`,duration:`ISO időintervallum`,ipv4:`IPv4 cím`,ipv6:`IPv6 cím`,mac:`MAC cím`,cidrv4:`IPv4 tartomány`,cidrv6:`IPv6 tartomány`,base64:`base64-kódolt string`,base64url:`base64url-kódolt string`,json_string:`JSON string`,e164:`E.164 szám`,credit_card:`hitelkártyaszám`,jwt:`JWT`,template_literal:`bemenet`},r={nan:`NaN`,number:`szám`,array:`tömb`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Érvénytelen bemenet: a várt érték instanceof ${e.expected}, a kapott érték ${i}`:`Érvénytelen bemenet: a várt érték ${t}, a kapott érték ${i}`}case`invalid_value`:return e.values.length===1?`Érvénytelen bemenet: a várt érték ${M(e.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Túl nagy: ${e.origin??`érték`} mérete túl nagy ${n}${e.maximum.toString()} ${r.unit??`elem`}`:`Túl nagy: a bemeneti érték ${e.origin??`érték`} túl nagy: ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Túl kicsi: a bemeneti érték ${e.origin} mérete túl kicsi ${n}${e.minimum.toString()} ${r.unit}`:`Túl kicsi: a bemeneti érték ${e.origin} túl kicsi ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Érvénytelen string: "${t.prefix}" értékkel kell kezdődnie`:t.format===`ends_with`?`Érvénytelen string: "${t.suffix}" értékkel kell végződnie`:t.format===`includes`?`Érvénytelen string: "${t.includes}" értéket kell tartalmaznia`:t.format===`regex`?`Érvénytelen string: ${t.pattern} mintának kell megfelelnie`:`Érvénytelen ${n[t.format]??e.format}`}case`not_multiple_of`:return`Érvénytelen szám: ${e.divisor} többszörösének kell lennie`;case`unrecognized_keys`:return`Ismeretlen kulcs${e.keys.length>1?`s`:``}: ${A(e.keys,`, `)}`;case`invalid_key`:return`Érvénytelen kulcs ${e.origin}`;case`invalid_union`:return`Érvénytelen bemenet`;case`invalid_element`:return`Érvénytelen érték: ${e.origin}`;default:return`Érvénytelen bemenet`}}}}));function mp(e,t,n){return Math.abs(e)===1?t:n}function hp(e){if(!e)return``;let t=[`ա`,`ե`,`ը`,`ի`,`ո`,`ու`,`օ`],n=e[e.length-1];return e+(t.includes(n)?`ն`:`ը`)}function gp(){return{localeError:_p()}}var _p,vp=t((()=>{I(),_p=()=>{let e={string:{unit:{one:`նշան`,many:`նշաններ`},verb:`ունենալ`},file:{unit:{one:`բայթ`,many:`բայթեր`},verb:`ունենալ`},array:{unit:{one:`տարր`,many:`տարրեր`},verb:`ունենալ`},set:{unit:{one:`տարր`,many:`տարրեր`},verb:`ունենալ`},map:{unit:{one:`տարր`,many:`տարրեր`},verb:`ունենալ`}};function t(t){return e[t]??null}let n={regex:`մուտք`,email:`էլ. հասցե`,url:`URL`,emoji:`էմոջի`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO ամսաթիվ և ժամ`,date:`ISO ամսաթիվ`,time:`ISO ժամ`,duration:`ISO տևողություն`,ipv4:`IPv4 հասցե`,ipv6:`IPv6 հասցե`,mac:`MAC հասցե`,cidrv4:`IPv4 միջակայք`,cidrv6:`IPv6 միջակայք`,base64:`base64 ձևաչափով տող`,base64url:`base64url ձևաչափով տող`,json_string:`JSON տող`,e164:`E.164 համար`,credit_card:`կրեդիտ քարտի համար`,jwt:`JWT`,template_literal:`մուտք`},r={nan:`NaN`,number:`թիվ`,array:`զանգված`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Սխալ մուտքագրում․ սպասվում էր instanceof ${e.expected}, ստացվել է ${i}`:`Սխալ մուտքագրում․ սպասվում էր ${t}, ստացվել է ${i}`}case`invalid_value`:return e.values.length===1?`Սխալ մուտքագրում․ սպասվում էր ${M(e.values[1])}`:`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=mp(Number(e.maximum),r.unit.one,r.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${hp(e.origin??`արժեք`)} կունենա ${n}${e.maximum.toString()} ${t}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${hp(e.origin??`արժեք`)} լինի ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=mp(Number(e.minimum),r.unit.one,r.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${hp(e.origin)} կունենա ${n}${e.minimum.toString()} ${t}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${hp(e.origin)} լինի ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Սխալ տող․ պետք է սկսվի "${t.prefix}"-ով`:t.format===`ends_with`?`Սխալ տող․ պետք է ավարտվի "${t.suffix}"-ով`:t.format===`includes`?`Սխալ տող․ պետք է պարունակի "${t.includes}"`:t.format===`regex`?`Սխալ տող․ պետք է համապատասխանի ${t.pattern} ձևաչափին`:`Սխալ ${n[t.format]??e.format}`}case`not_multiple_of`:return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${e.divisor}-ի`;case`unrecognized_keys`:return`Չճանաչված բանալի${e.keys.length>1?`ներ`:``}. ${A(e.keys,`, `)}`;case`invalid_key`:return`Սխալ բանալի ${hp(e.origin)}-ում`;case`invalid_union`:return`Սխալ մուտքագրում`;case`invalid_element`:return`Սխալ արժեք ${hp(e.origin)}-ում`;default:return`Սխալ մուտքագրում`}}}}));function yp(){return{localeError:bp()}}var bp,xp=t((()=>{I(),bp=()=>{let e={string:{unit:`karakter`,verb:`memiliki`},file:{unit:`byte`,verb:`memiliki`},array:{unit:`item`,verb:`memiliki`},set:{unit:`item`,verb:`memiliki`},map:{unit:`item`,verb:`memiliki`}};function t(t){return e[t]??null}let n={regex:`input`,email:`alamat email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`tanggal dan waktu format ISO`,date:`tanggal format ISO`,time:`jam format ISO`,duration:`durasi format ISO`,ipv4:`alamat IPv4`,ipv6:`alamat IPv6`,mac:`alamat MAC`,cidrv4:`rentang alamat IPv4`,cidrv6:`rentang alamat IPv6`,base64:`string dengan enkode base64`,base64url:`string dengan enkode base64url`,json_string:`string JSON`,e164:`angka E.164`,credit_card:`nomor kartu kredit`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Input tidak valid: diharapkan instanceof ${e.expected}, diterima ${i}`:`Input tidak valid: diharapkan ${t}, diterima ${i}`}case`invalid_value`:return e.values.length===1?`Input tidak valid: diharapkan ${M(e.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Terlalu besar: diharapkan ${e.origin??`value`} memiliki ${n}${e.maximum.toString()} ${r.unit??`elemen`}`:`Terlalu besar: diharapkan ${e.origin??`value`} menjadi ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Terlalu kecil: diharapkan ${e.origin} memiliki ${n}${e.minimum.toString()} ${r.unit}`:`Terlalu kecil: diharapkan ${e.origin} menjadi ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`String tidak valid: harus dimulai dengan "${t.prefix}"`:t.format===`ends_with`?`String tidak valid: harus berakhir dengan "${t.suffix}"`:t.format===`includes`?`String tidak valid: harus menyertakan "${t.includes}"`:t.format===`regex`?`String tidak valid: harus sesuai pola ${t.pattern}`:`${n[t.format]??e.format} tidak valid`}case`not_multiple_of`:return`Angka tidak valid: harus kelipatan dari ${e.divisor}`;case`unrecognized_keys`:return`Kunci tidak dikenali ${e.keys.length>1?`s`:``}: ${A(e.keys,`, `)}`;case`invalid_key`:return`Kunci tidak valid di ${e.origin}`;case`invalid_union`:return`Input tidak valid`;case`invalid_element`:return`Nilai tidak valid di ${e.origin}`;default:return`Input tidak valid`}}}}));function Sp(){return{localeError:Cp()}}var Cp,wp=t((()=>{I(),Cp=()=>{let e={string:{unit:`stafi`,verb:`að hafa`},file:{unit:`bæti`,verb:`að hafa`},array:{unit:`hluti`,verb:`að hafa`},set:{unit:`hluti`,verb:`að hafa`},map:{unit:`hluti`,verb:`að hafa`}};function t(t){return e[t]??null}let n={regex:`gildi`,email:`netfang`,url:`vefslóð`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO dagsetning og tími`,date:`ISO dagsetning`,time:`ISO tími`,duration:`ISO tímalengd`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded strengur`,base64url:`base64url-encoded strengur`,json_string:`JSON strengur`,e164:`E.164 tölugildi`,credit_card:`kreditkortanúmer`,jwt:`JWT`,template_literal:`gildi`},r={nan:`NaN`,number:`númer`,array:`fylki`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Rangt gildi: Þú slóst inn ${i} þar sem á að vera instanceof ${e.expected}`:`Rangt gildi: Þú slóst inn ${i} þar sem á að vera ${t}`}case`invalid_value`:return e.values.length===1?`Rangt gildi: gert ráð fyrir ${M(e.values[0])}`:`Ógilt val: má vera eitt af eftirfarandi ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Of stórt: gert er ráð fyrir að ${e.origin??`gildi`} hafi ${n}${e.maximum.toString()} ${r.unit??`hluti`}`:`Of stórt: gert er ráð fyrir að ${e.origin??`gildi`} sé ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Of lítið: gert er ráð fyrir að ${e.origin} hafi ${n}${e.minimum.toString()} ${r.unit}`:`Of lítið: gert er ráð fyrir að ${e.origin} sé ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ógildur strengur: verður að byrja á "${t.prefix}"`:t.format===`ends_with`?`Ógildur strengur: verður að enda á "${t.suffix}"`:t.format===`includes`?`Ógildur strengur: verður að innihalda "${t.includes}"`:t.format===`regex`?`Ógildur strengur: verður að fylgja mynstri ${t.pattern}`:`Rangt ${n[t.format]??e.format}`}case`not_multiple_of`:return`Röng tala: verður að vera margfeldi af ${e.divisor}`;case`unrecognized_keys`:return`Óþekkt ${e.keys.length>1?`ir lyklar`:`ur lykill`}: ${A(e.keys,`, `)}`;case`invalid_key`:return`Rangur lykill í ${e.origin}`;case`invalid_union`:return`Rangt gildi`;case`invalid_element`:return`Rangt gildi í ${e.origin}`;default:return`Rangt gildi`}}}}));function Tp(){return{localeError:Ep()}}var Ep,Dp=t((()=>{I(),Ep=()=>{let e={string:{unit:`caratteri`,verb:`avere`},file:{unit:`byte`,verb:`avere`},array:{unit:`elementi`,verb:`avere`},set:{unit:`elementi`,verb:`avere`},map:{unit:`elementi`,verb:`avere`}};function t(t){return e[t]??null}let n={regex:`input`,email:`indirizzo email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data e ora ISO`,date:`data ISO`,time:`ora ISO`,duration:`durata ISO`,ipv4:`indirizzo IPv4`,ipv6:`indirizzo IPv6`,mac:`indirizzo MAC`,cidrv4:`intervallo IPv4`,cidrv6:`intervallo IPv6`,base64:`stringa codificata in base64`,base64url:`URL codificata in base64`,json_string:`stringa JSON`,e164:`numero E.164`,credit_card:`numero di carta di credito`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`,number:`numero`,array:`vettore`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Input non valido: atteso instanceof ${e.expected}, ricevuto ${i}`:`Input non valido: atteso ${t}, ricevuto ${i}`}case`invalid_value`:return e.values.length===1?`Input non valido: atteso ${M(e.values[0])}`:`Opzione non valida: atteso uno tra ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Troppo grande: ${e.origin??`valore`} deve avere ${n}${e.maximum.toString()} ${r.unit??`elementi`}`:`Troppo grande: ${e.origin??`valore`} deve essere ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Troppo piccolo: ${e.origin} deve avere ${n}${e.minimum.toString()} ${r.unit}`:`Troppo piccolo: ${e.origin} deve essere ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Stringa non valida: deve iniziare con "${t.prefix}"`:t.format===`ends_with`?`Stringa non valida: deve terminare con "${t.suffix}"`:t.format===`includes`?`Stringa non valida: deve includere "${t.includes}"`:t.format===`regex`?`Stringa non valida: deve corrispondere al pattern ${t.pattern}`:`Input non valido: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Numero non valido: deve essere un multiplo di ${e.divisor}`;case`unrecognized_keys`:return`Chiav${e.keys.length>1?`i`:`e`} non riconosciut${e.keys.length>1?`e`:`a`}: ${A(e.keys,`, `)}`;case`invalid_key`:return`Chiave non valida in ${e.origin}`;case`invalid_union`:return`Input non valido`;case`invalid_element`:return`Valore non valido in ${e.origin}`;default:return`Input non valido`}}}}));function Op(){return{localeError:kp()}}var kp,Ap=t((()=>{I(),kp=()=>{let e={string:{unit:`文字`,verb:`である`},file:{unit:`バイト`,verb:`である`},array:{unit:`要素`,verb:`である`},set:{unit:`要素`,verb:`である`},map:{unit:`要素`,verb:`である`}};function t(t){return e[t]??null}let n={regex:`入力値`,email:`メールアドレス`,url:`URL`,emoji:`絵文字`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO日時`,date:`ISO日付`,time:`ISO時刻`,duration:`ISO期間`,ipv4:`IPv4アドレス`,ipv6:`IPv6アドレス`,mac:`MACアドレス`,cidrv4:`IPv4範囲`,cidrv6:`IPv6範囲`,base64:`base64エンコード文字列`,base64url:`base64urlエンコード文字列`,json_string:`JSON文字列`,e164:`E.164番号`,credit_card:`クレジットカード番号`,jwt:`JWT`,template_literal:`入力値`},r={nan:`NaN`,number:`数値`,array:`配列`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`無効な入力: instanceof ${e.expected}が期待されましたが、${i}が入力されました`:`無効な入力: ${t}が期待されましたが、${i}が入力されました`}case`invalid_value`:return e.values.length===1?`無効な入力: ${M(e.values[0])}が期待されました`:`無効な選択: ${A(e.values,`、`)}のいずれかである必要があります`;case`too_big`:{let n=e.inclusive?`以下である`:`より小さい`,r=t(e.origin);return r?`大きすぎる値: ${e.origin??`値`}は${e.maximum.toString()}${r.unit??`要素`}${n}必要があります`:`大きすぎる値: ${e.origin??`値`}は${e.maximum.toString()}${n}必要があります`}case`too_small`:{let n=e.inclusive?`以上である`:`より大きい`,r=t(e.origin);return r?`小さすぎる値: ${e.origin}は${e.minimum.toString()}${r.unit}${n}必要があります`:`小さすぎる値: ${e.origin}は${e.minimum.toString()}${n}必要があります`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`無効な文字列: "${t.prefix}"で始まる必要があります`:t.format===`ends_with`?`無効な文字列: "${t.suffix}"で終わる必要があります`:t.format===`includes`?`無効な文字列: "${t.includes}"を含む必要があります`:t.format===`regex`?`無効な文字列: パターン${t.pattern}に一致する必要があります`:`無効な${n[t.format]??e.format}`}case`not_multiple_of`:return`無効な数値: ${e.divisor}の倍数である必要があります`;case`unrecognized_keys`:return`認識されていないキー${e.keys.length>1?`群`:``}: ${A(e.keys,`、`)}`;case`invalid_key`:return`${e.origin}内の無効なキー`;case`invalid_union`:return`無効な入力`;case`invalid_element`:return`${e.origin}内の無効な値`;default:return`無効な入力`}}}}));function jp(){return{localeError:Mp()}}var Mp,Np=t((()=>{I(),Mp=()=>{let e={string:{unit:`სიმბოლო`,verb:`უნდა შეიცავდეს`},file:{unit:`ბაიტი`,verb:`უნდა შეიცავდეს`},array:{unit:`ელემენტი`,verb:`უნდა შეიცავდეს`},set:{unit:`ელემენტი`,verb:`უნდა შეიცავდეს`},map:{unit:`ელემენტი`,verb:`უნდა შეიცავდეს`}};function t(t){return e[t]??null}let n={regex:`შეყვანა`,email:`ელ-ფოსტის მისამართი`,url:`URL`,emoji:`ემოჯი`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`თარიღი-დრო`,date:`თარიღი`,time:`დრო`,duration:`ხანგრძლივობა`,ipv4:`IPv4 მისამართი`,ipv6:`IPv6 მისამართი`,mac:`MAC მისამართი`,cidrv4:`IPv4 დიაპაზონი`,cidrv6:`IPv6 დიაპაზონი`,base64:`base64-კოდირებული ველი`,base64url:`base64url-კოდირებული ველი`,json_string:`JSON ველი`,e164:`E.164 ნომერი`,credit_card:`საკრედიტო ბარათის ნომერი`,jwt:`JWT`,template_literal:`შეყვანა`},r={nan:`NaN`,number:`რიცხვი`,string:`ველი`,boolean:`ბულეანი`,function:`ფუნქცია`,array:`მასივი`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`არასწორი შეყვანა: მოსალოდნელი instanceof ${e.expected}, მიღებული ${i}`:`არასწორი შეყვანა: მოსალოდნელი ${t}, მიღებული ${i}`}case`invalid_value`:return e.values.length===1?`არასწორი შეყვანა: მოსალოდნელი ${M(e.values[0])}`:`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${A(e.values,`|`)}-დან`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ზედმეტად დიდი: მოსალოდნელი ${e.origin??`მნიშვნელობა`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit}`:`ზედმეტად დიდი: მოსალოდნელი ${e.origin??`მნიშვნელობა`} იყოს ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`ზედმეტად პატარა: მოსალოდნელი ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`ზედმეტად პატარა: მოსალოდნელი ${e.origin} იყოს ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`არასწორი ველი: უნდა იწყებოდეს "${t.prefix}"-ით`:t.format===`ends_with`?`არასწორი ველი: უნდა მთავრდებოდეს "${t.suffix}"-ით`:t.format===`includes`?`არასწორი ველი: უნდა შეიცავდეს "${t.includes}"-ს`:t.format===`regex`?`არასწორი ველი: უნდა შეესაბამებოდეს შაბლონს ${t.pattern}`:`არასწორი ${n[t.format]??e.format}`}case`not_multiple_of`:return`არასწორი რიცხვი: უნდა იყოს ${e.divisor}-ის ჯერადი`;case`unrecognized_keys`:return`უცნობი გასაღებ${e.keys.length>1?`ები`:`ი`}: ${A(e.keys,`, `)}`;case`invalid_key`:return`არასწორი გასაღები ${e.origin}-ში`;case`invalid_union`:return`არასწორი შეყვანა`;case`invalid_element`:return`არასწორი მნიშვნელობა ${e.origin}-ში`;default:return`არასწორი შეყვანა`}}}}));function Pp(){return{localeError:Fp()}}var Fp,Ip=t((()=>{I(),Fp=()=>{let e={string:{unit:`តួអក្សរ`,verb:`គួរមាន`},file:{unit:`បៃ`,verb:`គួរមាន`},array:{unit:`ធាតុ`,verb:`គួរមាន`},set:{unit:`ធាតុ`,verb:`គួរមាន`},map:{unit:`ធាតុ`,verb:`គួរមាន`}};function t(t){return e[t]??null}let n={regex:`ទិន្នន័យបញ្ចូល`,email:`អាសយដ្ឋានអ៊ីមែល`,url:`URL`,emoji:`សញ្ញាអារម្មណ៍`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`កាលបរិច្ឆេទ និងម៉ោង ISO`,date:`កាលបរិច្ឆេទ ISO`,time:`ម៉ោង ISO`,duration:`រយៈពេល ISO`,ipv4:`អាសយដ្ឋាន IPv4`,ipv6:`អាសយដ្ឋាន IPv6`,mac:`អាសយដ្ឋាន MAC`,cidrv4:`ដែនអាសយដ្ឋាន IPv4`,cidrv6:`ដែនអាសយដ្ឋាន IPv6`,base64:`ខ្សែអក្សរអ៊ិកូដ base64`,base64url:`ខ្សែអក្សរអ៊ិកូដ base64url`,json_string:`ខ្សែអក្សរ JSON`,e164:`លេខ E.164`,credit_card:`លេខប័ណ្ណឥណទាន`,jwt:`JWT`,template_literal:`ទិន្នន័យបញ្ចូល`},r={nan:`NaN`,number:`លេខ`,array:`អារេ (Array)`,null:`គ្មានតម្លៃ (null)`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${e.expected} ប៉ុន្តែទទួលបាន ${i}`:`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${t} ប៉ុន្តែទទួលបាន ${i}`}case`invalid_value`:return e.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${M(e.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ធំពេក៖ ត្រូវការ ${e.origin??`តម្លៃ`} ${n} ${e.maximum.toString()} ${r.unit??`ធាតុ`}`:`ធំពេក៖ ត្រូវការ ${e.origin??`តម្លៃ`} ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()} ${r.unit}`:`តូចពេក៖ ត្រូវការ ${e.origin} ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${t.prefix}"`:t.format===`ends_with`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${t.suffix}"`:t.format===`includes`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${t.includes}"`:t.format===`regex`?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${t.pattern}`:`មិនត្រឹមត្រូវ៖ ${n[t.format]??e.format}`}case`not_multiple_of`:return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${e.divisor}`;case`unrecognized_keys`:return`រកឃើញសោមិនស្គាល់៖ ${A(e.keys,`, `)}`;case`invalid_key`:return`សោមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`;case`invalid_union`:return`ទិន្នន័យមិនត្រឹមត្រូវ`;case`invalid_element`:return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${e.origin}`;default:return`ទិន្នន័យមិនត្រឹមត្រូវ`}}}}));function Lp(){return Pp()}var Rp=t((()=>{Ip()}));function zp(){return{localeError:Bp()}}var Bp,Vp=t((()=>{I(),Bp=()=>{let e={string:{unit:`ಅಕ್ಷರಗಳು`,verb:`ಹೊಂದಲು`},file:{unit:`ಬೈಟ್ಗಳು`,verb:`ಹೊಂದಲು`},array:{unit:`ವಸ್ತುಗಳು`,verb:`ಹೊಂದಲು`},set:{unit:`ವಸ್ತುಗಳು`,verb:`ಹೊಂದಲು`},map:{unit:`entries`,verb:`ಹೊಂದಲು`}};function t(t){return e[t]??null}let n={regex:`ಇನ್ಪುಟ್`,email:`email ವಿಳಾಸ`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO ದಿನಾಂಕದ ಸಮಯ`,date:`ISO ದಿನಾಂಕ`,time:`ISO ಸಮಯ`,duration:`ISO ಅವಧಿ`,ipv4:`IPv4 ವಿಳಾಸ`,ipv6:`IPv6 ವಿಳಾಸ`,mac:`MAC ವಿಳಾಸ`,cidrv4:`IPv4 ವ್ಯಾಪ್ತಿಯ`,cidrv6:`IPv6 ವ್ಯಾಪ್ತಿಯ`,base64:`base64-encodedಸ್ಟ್ರಿಂಗ್`,base64url:`base64url-encodedಸ್ಟ್ರಿಂಗ್`,json_string:`JSONಸ್ಟ್ರಿಂಗ್`,e164:`E.164 ಸಂಖ್ಯೆ`,credit_card:`ಕ್ರೆಡಿಟ್ ಕಾರ್ಡ್ ಸಂಖ್ಯೆ`,jwt:`JWT`,template_literal:`ಇನ್ಪುಟ್`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input);return`ಅಮಾನ್ಯ ಇನ್ಪುಟ್: ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${t}, ಸ್ವೀಕರಿಸಿದನು ${r[n]??n}`}case`invalid_value`:return e.values.length===1?`ಅಮಾನ್ಯ ಇನ್ಪುಟ್: ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${M(e.values[0])}`:`ಅಮಾನ್ಯ ಆಯ್ಕೆ: ಇವುಗಳಲ್ಲಿ ಒಂದನ್ನು ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ತುಂಬಾ ದೊಡ್ಡದು: ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${e.origin??`value`} ಹೊಂದಲು ${n}${e.maximum.toString()} ${r.unit??`ಅಂಶಗಳು`}`:`ತುಂಬಾ ದೊಡ್ಡದು: ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${e.origin??`value`} ಎಂದು ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`ತುಂಬಾ ಚಿಕ್ಕದು: ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${e.origin} ಹೊಂದಲು ${n}${e.minimum.toString()} ${r.unit}`:`ತುಂಬಾ ಚಿಕ್ಕದು: ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${e.origin} ಎಂದು ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`ಅಮಾನ್ಯವಾದ ಸ್ಟ್ರಿಂಗ್: ಇದರೊಂದಿಗೆ ಪ್ರಾರಂಭಿಸಬೇಕು "${t.prefix}"`:t.format===`ends_with`?`ಅಮಾನ್ಯವಾದ ಸ್ಟ್ರಿಂಗ್: ಇದರೊಂದಿಗೆ ಕೊನೆಗೊಳ್ಳಬೇಕು "${t.suffix}"`:t.format===`includes`?`ಅಮಾನ್ಯ ಸ್ಟ್ರಿಂಗ್: ಒಳಗೊಂಡಿರಬೇಕು "${t.includes}"`:t.format===`regex`?`ಅಮಾನ್ಯವಾದ ಸ್ಟ್ರಿಂಗ್: ಮಾದರಿಗೆ ಹೊಂದಿಕೆಯಾಗಬೇಕು ${t.pattern}`:`ಅಮಾನ್ಯ ${n[t.format]??e.format}`}case`not_multiple_of`:return`ಅಮಾನ್ಯ ಸಂಖ್ಯೆ: ಬಹುಸಂಖ್ಯೆಯಾಗಿರಬೇಕು ${e.divisor}`;case`unrecognized_keys`:return`ಗುರುತಿಸಲಾಗದ ಕೀ ${e.keys.length>1?`s`:``}: ${A(e.keys,`, `)}`;case`invalid_key`:return`ಅಮಾನ್ಯವಾದ ಕೀ ಇನ್ ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`ಅಮಾನ್ಯ ತಾರತಮ್ಯ ಮೌಲ್ಯ. ನಿರೀಕ್ಷಿಸಲಾಗಿದೆ ${e.options.map(e=>`'${e}'`).join(` | `)}`:`ಅಮಾನ್ಯ ಇನ್ಪುಟ್`;case`invalid_element`:return`ರಲ್ಲಿ ಅಮಾನ್ಯ ಮೌಲ್ಯ ${e.origin}`;default:return`ಅಮಾನ್ಯ ಇನ್ಪುಟ್`}}}}));function Hp(){return{localeError:Up()}}var Up,Wp=t((()=>{I(),Up=()=>{let e={string:{unit:`문자`,verb:`to have`},file:{unit:`바이트`,verb:`to have`},array:{unit:`개`,verb:`to have`},set:{unit:`개`,verb:`to have`},map:{unit:`개`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`입력`,email:`이메일 주소`,url:`URL`,emoji:`이모지`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO 날짜시간`,date:`ISO 날짜`,time:`ISO 시간`,duration:`ISO 기간`,ipv4:`IPv4 주소`,ipv6:`IPv6 주소`,mac:`MAC 주소`,cidrv4:`IPv4 범위`,cidrv6:`IPv6 범위`,base64:`base64 인코딩 문자열`,base64url:`base64url 인코딩 문자열`,json_string:`JSON 문자열`,e164:`E.164 번호`,credit_card:`신용카드 번호`,jwt:`JWT`,template_literal:`입력`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`잘못된 입력: 예상 타입은 instanceof ${e.expected}, 받은 타입은 ${i}입니다`:`잘못된 입력: 예상 타입은 ${t}, 받은 타입은 ${i}입니다`}case`invalid_value`:return e.values.length===1?`잘못된 입력: 값은 ${M(e.values[0])} 이어야 합니다`:`잘못된 옵션: ${A(e.values,`또는 `)} 중 하나여야 합니다`;case`too_big`:{let n=e.inclusive?`이하`:`미만`,r=n===`미만`?`이어야 합니다`:`여야 합니다`,i=t(e.origin),a=i?.unit??`요소`;return i?`${e.origin??`값`}이 너무 큽니다: ${e.maximum.toString()}${a} ${n}${r}`:`${e.origin??`값`}이 너무 큽니다: ${e.maximum.toString()} ${n}${r}`}case`too_small`:{let n=e.inclusive?`이상`:`초과`,r=n===`이상`?`이어야 합니다`:`여야 합니다`,i=t(e.origin),a=i?.unit??`요소`;return i?`${e.origin??`값`}이 너무 작습니다: ${e.minimum.toString()}${a} ${n}${r}`:`${e.origin??`값`}이 너무 작습니다: ${e.minimum.toString()} ${n}${r}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`잘못된 문자열: "${t.prefix}"(으)로 시작해야 합니다`:t.format===`ends_with`?`잘못된 문자열: "${t.suffix}"(으)로 끝나야 합니다`:t.format===`includes`?`잘못된 문자열: "${t.includes}"을(를) 포함해야 합니다`:t.format===`regex`?`잘못된 문자열: 정규식 ${t.pattern} 패턴과 일치해야 합니다`:`잘못된 ${n[t.format]??e.format}`}case`not_multiple_of`:return`잘못된 숫자: ${e.divisor}의 배수여야 합니다`;case`unrecognized_keys`:return`인식할 수 없는 키: ${A(e.keys,`, `)}`;case`invalid_key`:return`잘못된 키: ${e.origin}`;case`invalid_union`:return`잘못된 입력`;case`invalid_element`:return`잘못된 값: ${e.origin}`;default:return`잘못된 입력`}}}}));function Gp(e){let t=Math.abs(e),n=t%10,r=t%100;return r>=11&&r<=19||n===0?`many`:n===1?`one`:`few`}function Kp(){return{localeError:Jp()}}var qp,Jp,Yp=t((()=>{I(),qp=e=>e.charAt(0).toUpperCase()+e.slice(1),Jp=()=>{let e={string:{unit:{one:`simbolis`,few:`simboliai`,many:`simbolių`},verb:{smaller:{inclusive:`turi būti ne ilgesnė kaip`,notInclusive:`turi būti trumpesnė kaip`},bigger:{inclusive:`turi būti ne trumpesnė kaip`,notInclusive:`turi būti ilgesnė kaip`}}},file:{unit:{one:`baitas`,few:`baitai`,many:`baitų`},verb:{smaller:{inclusive:`turi būti ne didesnis kaip`,notInclusive:`turi būti mažesnis kaip`},bigger:{inclusive:`turi būti ne mažesnis kaip`,notInclusive:`turi būti didesnis kaip`}}},array:{unit:{one:`elementą`,few:`elementus`,many:`elementų`},verb:{smaller:{inclusive:`turi turėti ne daugiau kaip`,notInclusive:`turi turėti mažiau kaip`},bigger:{inclusive:`turi turėti ne mažiau kaip`,notInclusive:`turi turėti daugiau kaip`}}},set:{unit:{one:`elementą`,few:`elementus`,many:`elementų`},verb:{smaller:{inclusive:`turi turėti ne daugiau kaip`,notInclusive:`turi turėti mažiau kaip`},bigger:{inclusive:`turi turėti ne mažiau kaip`,notInclusive:`turi turėti daugiau kaip`}}}};function t(t,n,r,i){let a=e[t]??null;return a===null?a:{unit:a.unit[n],verb:a.verb[i][r?`inclusive`:`notInclusive`]}}let n={regex:`įvestis`,email:`el. pašto adresas`,url:`URL`,emoji:`jaustukas`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO data ir laikas`,date:`ISO data`,time:`ISO laikas`,duration:`ISO trukmė`,ipv4:`IPv4 adresas`,ipv6:`IPv6 adresas`,mac:`MAC adresas`,cidrv4:`IPv4 tinklo prefiksas (CIDR)`,cidrv6:`IPv6 tinklo prefiksas (CIDR)`,base64:`base64 užkoduota eilutė`,base64url:`base64url užkoduota eilutė`,json_string:`JSON eilutė`,e164:`E.164 numeris`,credit_card:`kredito kortelės numeris`,jwt:`JWT`,template_literal:`įvestis`},r={nan:`NaN`,number:`skaičius`,bigint:`sveikasis skaičius`,string:`eilutė`,boolean:`loginė reikšmė`,undefined:`neapibrėžta reikšmė`,function:`funkcija`,symbol:`simbolis`,array:`masyvas`,object:`objektas`,null:`nulinė reikšmė`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Gautas tipas ${i}, o tikėtasi - instanceof ${e.expected}`:`Gautas tipas ${i}, o tikėtasi - ${t}`}case`invalid_value`:return e.values.length===1?`Privalo būti ${M(e.values[0])}`:`Privalo būti vienas iš ${A(e.values,`|`)} pasirinkimų`;case`too_big`:{let n=r[e.origin]??e.origin,i=t(e.origin,Gp(Number(e.maximum)),e.inclusive??!1,`smaller`);if(i?.verb)return`${qp(n??e.origin??`reikšmė`)} ${i.verb} ${e.maximum.toString()} ${i.unit??`elementų`}`;let a=e.inclusive?`ne didesnis kaip`:`mažesnis kaip`;return`${qp(n??e.origin??`reikšmė`)} turi būti ${a} ${e.maximum.toString()} ${i?.unit}`}case`too_small`:{let n=r[e.origin]??e.origin,i=t(e.origin,Gp(Number(e.minimum)),e.inclusive??!1,`bigger`);if(i?.verb)return`${qp(n??e.origin??`reikšmė`)} ${i.verb} ${e.minimum.toString()} ${i.unit??`elementų`}`;let a=e.inclusive?`ne mažesnis kaip`:`didesnis kaip`;return`${qp(n??e.origin??`reikšmė`)} turi būti ${a} ${e.minimum.toString()} ${i?.unit}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Eilutė privalo prasidėti "${t.prefix}"`:t.format===`ends_with`?`Eilutė privalo pasibaigti "${t.suffix}"`:t.format===`includes`?`Eilutė privalo įtraukti "${t.includes}"`:t.format===`regex`?`Eilutė privalo atitikti ${t.pattern}`:`Neteisingas ${n[t.format]??e.format}`}case`not_multiple_of`:return`Skaičius privalo būti ${e.divisor} kartotinis.`;case`unrecognized_keys`:return`Neatpažint${e.keys.length>1?`i`:`as`} rakt${e.keys.length>1?`ai`:`as`}: ${A(e.keys,`, `)}`;case`invalid_key`:return`Rastas klaidingas raktas`;case`invalid_union`:return`Klaidinga įvestis`;case`invalid_element`:{let t=r[e.origin]??e.origin;return`${qp(t??e.origin??`reikšmė`)} turi klaidingą įvestį`}default:return`Klaidinga įvestis`}}}}));function Xp(){return{localeError:Zp()}}var Zp,Qp=t((()=>{I(),Zp=()=>{let e={string:{unit:`знаци`,verb:`да имаат`},file:{unit:`бајти`,verb:`да имаат`},array:{unit:`ставки`,verb:`да имаат`},set:{unit:`ставки`,verb:`да имаат`},map:{unit:`ставки`,verb:`да имаат`}};function t(t){return e[t]??null}let n={regex:`внес`,email:`адреса на е-пошта`,url:`URL`,emoji:`емоџи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO датум и време`,date:`ISO датум`,time:`ISO време`,duration:`ISO времетраење`,ipv4:`IPv4 адреса`,ipv6:`IPv6 адреса`,mac:`MAC адреса`,cidrv4:`IPv4 опсег`,cidrv6:`IPv6 опсег`,base64:`base64-енкодирана низа`,base64url:`base64url-енкодирана низа`,json_string:`JSON низа`,e164:`E.164 број`,credit_card:`број на кредитна картичка`,jwt:`JWT`,template_literal:`внес`},r={nan:`NaN`,number:`број`,array:`низа`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Грешен внес: се очекува instanceof ${e.expected}, примено ${i}`:`Грешен внес: се очекува ${t}, примено ${i}`}case`invalid_value`:return e.values.length===1?`Invalid input: expected ${M(e.values[0])}`:`Грешана опција: се очекува една ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Премногу голем: се очекува ${e.origin??`вредноста`} да има ${n}${e.maximum.toString()} ${r.unit??`елементи`}`:`Премногу голем: се очекува ${e.origin??`вредноста`} да биде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Премногу мал: се очекува ${e.origin} да има ${n}${e.minimum.toString()} ${r.unit}`:`Премногу мал: се очекува ${e.origin} да биде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неважечка низа: мора да започнува со "${t.prefix}"`:t.format===`ends_with`?`Неважечка низа: мора да завршува со "${t.suffix}"`:t.format===`includes`?`Неважечка низа: мора да вклучува "${t.includes}"`:t.format===`regex`?`Неважечка низа: мора да одгоара на патернот ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Грешен број: мора да биде делив со ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Непрепознаени клучеви`:`Непрепознаен клуч`}: ${A(e.keys,`, `)}`;case`invalid_key`:return`Грешен клуч во ${e.origin}`;case`invalid_union`:return`Грешен внес`;case`invalid_element`:return`Грешна вредност во ${e.origin}`;default:return`Грешен внес`}}}}));function $p(){return{localeError:em()}}var em,tm=t((()=>{I(),em=()=>{let e={string:{unit:`aksara`,verb:`mempunyai`},file:{unit:`bait`,verb:`mempunyai`},array:{unit:`elemen`,verb:`mempunyai`},set:{unit:`elemen`,verb:`mempunyai`},map:{unit:`elemen`,verb:`mempunyai`}};function t(t){return e[t]??null}let n={regex:`input`,email:`alamat e-mel`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`tarikh masa ISO`,date:`tarikh ISO`,time:`masa ISO`,duration:`tempoh ISO`,ipv4:`alamat IPv4`,ipv6:`alamat IPv6`,mac:`alamat MAC`,cidrv4:`julat IPv4`,cidrv6:`julat IPv6`,base64:`string dikodkan base64`,base64url:`string dikodkan base64url`,json_string:`string JSON`,e164:`nombor E.164`,credit_card:`nombor kad kredit`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`,number:`nombor`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Input tidak sah: dijangka instanceof ${e.expected}, diterima ${i}`:`Input tidak sah: dijangka ${t}, diterima ${i}`}case`invalid_value`:return e.values.length===1?`Input tidak sah: dijangka ${M(e.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Terlalu besar: dijangka ${e.origin??`nilai`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`elemen`}`:`Terlalu besar: dijangka ${e.origin??`nilai`} adalah ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Terlalu kecil: dijangka ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Terlalu kecil: dijangka ${e.origin} adalah ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`String tidak sah: mesti bermula dengan "${t.prefix}"`:t.format===`ends_with`?`String tidak sah: mesti berakhir dengan "${t.suffix}"`:t.format===`includes`?`String tidak sah: mesti mengandungi "${t.includes}"`:t.format===`regex`?`String tidak sah: mesti sepadan dengan corak ${t.pattern}`:`${n[t.format]??e.format} tidak sah`}case`not_multiple_of`:return`Nombor tidak sah: perlu gandaan ${e.divisor}`;case`unrecognized_keys`:return`Kunci tidak dikenali: ${A(e.keys,`, `)}`;case`invalid_key`:return`Kunci tidak sah dalam ${e.origin}`;case`invalid_union`:return`Input tidak sah`;case`invalid_element`:return`Nilai tidak sah dalam ${e.origin}`;default:return`Input tidak sah`}}}}));function nm(){return{localeError:rm()}}var rm,im=t((()=>{I(),rm=()=>{let e={string:{unit:`अक्षर`,verb:`हुनुपर्छ`},file:{unit:`बाइट`,verb:`हुनुपर्छ`},array:{unit:`तत्व`,verb:`हुनुपर्छ`},set:{unit:`तत्व`,verb:`हुनुपर्छ`},map:{unit:`प्रविष्टि`,verb:`हुनुपर्छ`}};function t(t){return e[t]??null}let n={regex:`इनपुट`,email:`इमेल ठेगाना`,url:`URL`,emoji:`इमोजी`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO मिति र समय`,date:`ISO मिति`,time:`ISO समय`,duration:`ISO अवधि`,ipv4:`IPv4 ठेगाना`,ipv6:`IPv6 ठेगाना`,mac:`MAC ठेगाना`,cidrv4:`IPv4 दायरा`,cidrv6:`IPv6 दायरा`,base64:`base64-इन्कोड गरिएको स्ट्रिङ`,base64url:`base64url-इन्कोड गरिएको स्ट्रिङ`,json_string:`JSON स्ट्रिङ`,e164:`E.164 नम्बर`,credit_card:`क्रेडिट कार्ड नम्बर`,jwt:`JWT`,template_literal:`इनपुट`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input);return`अमान्य इनपुट: अपेक्षित ${t}, प्राप्त ${r[n]??n}`}case`invalid_value`:return e.values.length===1?`अमान्य इनपुट: अपेक्षित ${M(e.values[0])}`:`अमान्य विकल्प: अपेक्षित मानहरू मध्ये एक ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`धेरै ठूलो: ${e.origin??`मान`} मा ${n}${e.maximum.toString()} ${r.unit} ${r.verb}`:`धेरै ठूलो: ${e.origin??`मान`} ${n}${e.maximum.toString()} हुनुपर्छ`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`धेरै सानो: ${e.origin} मा ${n}${e.minimum.toString()} ${r.unit} ${r.verb}`:`धेरै सानो: ${e.origin} ${n}${e.minimum.toString()} हुनुपर्छ`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`अमान्य स्ट्रिङ: "${t.prefix}" बाट सुरु हुनुपर्छ`:t.format===`ends_with`?`अमान्य स्ट्रिङ: "${t.suffix}" मा समाप्त हुनुपर्छ`:t.format===`includes`?`अमान्य स्ट्रिङ: "${t.includes}" समावेश हुनुपर्छ`:t.format===`regex`?`अमान्य स्ट्रिङ: ढाँचा ${t.pattern} सँग मेल खानुपर्छ`:`अमान्य ${n[t.format]??e.format}`}case`not_multiple_of`:return`अमान्य संख्या: ${e.divisor} को गुणज हुनुपर्छ`;case`unrecognized_keys`:return`अपरिचित कुञ्जी${e.keys.length>1?`हरू`:``}: ${A(e.keys,`, `)}`;case`invalid_key`:return`अमान्य कुञ्जी: ${e.origin} मा`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`अमान्य डिस्क्रिमिनेटर मान: अपेक्षित ${e.options.map(e=>`'${e}'`).join(` | `)}`:`अमान्य इनपुट`;case`invalid_element`:return`अमान्य मान: ${e.origin} मा`;default:return`अमान्य इनपुट`}}}}));function am(){return{localeError:om()}}var om,sm=t((()=>{I(),om=()=>{let e={string:{unit:`tekens`,verb:`heeft`},file:{unit:`bytes`,verb:`heeft`},array:{unit:`elementen`,verb:`heeft`},set:{unit:`elementen`,verb:`heeft`},map:{unit:`elementen`,verb:`heeft`}};function t(t){return e[t]??null}let n={regex:`invoer`,email:`emailadres`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datum en tijd`,date:`ISO datum`,time:`ISO tijd`,duration:`ISO duur`,ipv4:`IPv4-adres`,ipv6:`IPv6-adres`,mac:`MAC-adres`,cidrv4:`IPv4-bereik`,cidrv6:`IPv6-bereik`,base64:`base64-gecodeerde tekst`,base64url:`base64 URL-gecodeerde tekst`,json_string:`JSON string`,e164:`E.164-nummer`,credit_card:`creditcardnummer`,jwt:`JWT`,template_literal:`invoer`},r={nan:`NaN`,number:`getal`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ongeldige invoer: verwacht instanceof ${e.expected}, ontving ${i}`:`Ongeldige invoer: verwacht ${t}, ontving ${i}`}case`invalid_value`:return e.values.length===1?`Ongeldige invoer: verwacht ${M(e.values[0])}`:`Ongeldige optie: verwacht één van ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin),i=e.origin===`date`?`laat`:e.origin===`string`?`lang`:`groot`;return r?`Te ${i}: verwacht dat ${e.origin??`waarde`} ${n}${e.maximum.toString()} ${r.unit??`elementen`} ${r.verb}`:`Te ${i}: verwacht dat ${e.origin??`waarde`} ${n}${e.maximum.toString()} is`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin),i=e.origin===`date`?`vroeg`:e.origin===`string`?`kort`:`klein`;return r?`Te ${i}: verwacht dat ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ${r.verb}`:`Te ${i}: verwacht dat ${e.origin} ${n}${e.minimum.toString()} is`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ongeldige tekst: moet met "${t.prefix}" beginnen`:t.format===`ends_with`?`Ongeldige tekst: moet op "${t.suffix}" eindigen`:t.format===`includes`?`Ongeldige tekst: moet "${t.includes}" bevatten`:t.format===`regex`?`Ongeldige tekst: moet overeenkomen met patroon ${t.pattern}`:`Ongeldig: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ongeldig getal: moet een veelvoud van ${e.divisor} zijn`;case`unrecognized_keys`:return`Onbekende key${e.keys.length>1?`s`:``}: ${A(e.keys,`, `)}`;case`invalid_key`:return`Ongeldige key in ${e.origin}`;case`invalid_union`:return`Ongeldige invoer`;case`invalid_element`:return`Ongeldige waarde in ${e.origin}`;default:return`Ongeldige invoer`}}}}));function cm(){return{localeError:lm()}}var lm,um=t((()=>{I(),lm=()=>{let e={string:{unit:`teikn`,verb:`å ha`},file:{unit:`bytes`,verb:`å ha`},array:{unit:`element`,verb:`å innehalde`},set:{unit:`element`,verb:`å innehalde`},map:{unit:`element`,verb:`å innehalde`}};function t(t){return e[t]??null}let n={regex:`input`,email:`e-postadresse`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO dato- og klokkeslett`,date:`ISO-dato`,time:`ISO-klokkeslett`,duration:`ISO-varigheit`,ipv4:`IPv4-adresse`,ipv6:`IPv6-adresse`,mac:`MAC-adresse`,cidrv4:`IPv4-spekter`,cidrv6:`IPv6-spekter`,base64:`base64-enkoda streng`,base64url:`base64url-enkoda streng`,json_string:`JSON-streng`,e164:`E.164-nummer`,credit_card:`kredittkortnummer`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`,number:`tal`,array:`liste`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ugyldig input: forventa instanceof ${e.expected}, fekk ${i}`:`Ugyldig input: forventa ${t}, fekk ${i}`}case`invalid_value`:return e.values.length===1?`Ugyldig verdi: forventa ${M(e.values[0])}`:`Ugyldig val: forventa eitt av ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`For stor(t): forventa ${e.origin??`value`} til å ha ${n}${e.maximum.toString()} ${r.unit??`element`}`:`For stor(t): forventa ${e.origin??`value`} til å ha ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`For lite(n): forventa ${e.origin} til å ha ${n}${e.minimum.toString()} ${r.unit}`:`For lite(n): forventa ${e.origin} til å ha ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ugyldig streng: må starte med "${t.prefix}"`:t.format===`ends_with`?`Ugyldig streng: må slutte med "${t.suffix}"`:t.format===`includes`?`Ugyldig streng: må innehalde "${t.includes}"`:t.format===`regex`?`Ugyldig streng: må matche mønsteret ${t.pattern}`:`Ugyldig ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ugyldig tal: må vere eit multiplum av ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Ukjende nøklar`:`Ukjend nøkkel`}: ${A(e.keys,`, `)}`;case`invalid_key`:return`Ugyldig nøkkel i ${e.origin}`;case`invalid_union`:return`Ugyldig input`;case`invalid_element`:return`Ugyldig verdi i ${e.origin}`;default:return`Ugyldig input`}}}}));function dm(){return{localeError:fm()}}var fm,pm=t((()=>{I(),fm=()=>{let e={string:{unit:`tegn`,verb:`å ha`},file:{unit:`bytes`,verb:`å ha`},array:{unit:`elementer`,verb:`å inneholde`},set:{unit:`elementer`,verb:`å inneholde`},map:{unit:`elementer`,verb:`å inneholde`}};function t(t){return e[t]??null}let n={regex:`input`,email:`e-postadresse`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO dato- og klokkeslett`,date:`ISO-dato`,time:`ISO-klokkeslett`,duration:`ISO-varighet`,ipv4:`IPv4-adresse`,ipv6:`IPv6-adresse`,mac:`MAC-adresse`,cidrv4:`IPv4-spekter`,cidrv6:`IPv6-spekter`,base64:`base64-enkodet streng`,base64url:`base64url-enkodet streng`,json_string:`JSON-streng`,e164:`E.164-nummer`,credit_card:`kredittkortnummer`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`,number:`tall`,array:`liste`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ugyldig input: forventet instanceof ${e.expected}, fikk ${i}`:`Ugyldig input: forventet ${t}, fikk ${i}`}case`invalid_value`:return e.values.length===1?`Ugyldig verdi: forventet ${M(e.values[0])}`:`Ugyldig valg: forventet en av ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`For stor(t): forventet ${e.origin??`value`} til å ha ${n}${e.maximum.toString()} ${r.unit??`elementer`}`:`For stor(t): forventet ${e.origin??`value`} til å ha ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()} ${r.unit}`:`For lite(n): forventet ${e.origin} til å ha ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ugyldig streng: må starte med "${t.prefix}"`:t.format===`ends_with`?`Ugyldig streng: må ende med "${t.suffix}"`:t.format===`includes`?`Ugyldig streng: må inneholde "${t.includes}"`:t.format===`regex`?`Ugyldig streng: må matche mønsteret ${t.pattern}`:`Ugyldig ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ugyldig tall: må være et multiplum av ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Ukjente nøkler`:`Ukjent nøkkel`}: ${A(e.keys,`, `)}`;case`invalid_key`:return`Ugyldig nøkkel i ${e.origin}`;case`invalid_union`:return`Ugyldig input`;case`invalid_element`:return`Ugyldig verdi i ${e.origin}`;default:return`Ugyldig input`}}}}));function mm(){return{localeError:hm()}}var hm,gm=t((()=>{I(),hm=()=>{let e={string:{unit:`harf`,verb:`olmalıdır`},file:{unit:`bayt`,verb:`olmalıdır`},array:{unit:`unsur`,verb:`olmalıdır`},set:{unit:`unsur`,verb:`olmalıdır`},map:{unit:`unsur`,verb:`olmalıdır`}};function t(t){return e[t]??null}let n={regex:`giren`,email:`epostagâh`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO hengâmı`,date:`ISO tarihi`,time:`ISO zamanı`,duration:`ISO müddeti`,ipv4:`IPv4 nişânı`,ipv6:`IPv6 nişânı`,mac:`MAC nişânı`,cidrv4:`IPv4 menzili`,cidrv6:`IPv6 menzili`,base64:`base64-şifreli metin`,base64url:`base64url-şifreli metin`,json_string:`JSON metin`,e164:`E.164 sayısı`,credit_card:`i'tibâr kartı numarası`,jwt:`JWT`,template_literal:`giren`},r={nan:`NaN`,number:`numara`,array:`saf`,null:`gayb`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Fâsit giren: umulan instanceof ${e.expected}, alınan ${i}`:`Fâsit giren: umulan ${t}, alınan ${i}`}case`invalid_value`:return e.values.length===1?`Fâsit giren: umulan ${M(e.values[0])}`:`Fâsit tercih: mûteberler ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Fazla büyük: ${e.origin??`value`}, ${n}${e.maximum.toString()} ${r.unit??`elements`} sahip olmalıydı.`:`Fazla büyük: ${e.origin??`value`}, ${n}${e.maximum.toString()} olmalıydı.`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} ${r.unit} sahip olmalıydı.`:`Fazla küçük: ${e.origin}, ${n}${e.minimum.toString()} olmalıydı.`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Fâsit metin: "${t.prefix}" ile başlamalı.`:t.format===`ends_with`?`Fâsit metin: "${t.suffix}" ile bitmeli.`:t.format===`includes`?`Fâsit metin: "${t.includes}" ihtivâ etmeli.`:t.format===`regex`?`Fâsit metin: ${t.pattern} nakşına uymalı.`:`Fâsit ${n[t.format]??e.format}`}case`not_multiple_of`:return`Fâsit sayı: ${e.divisor} katı olmalıydı.`;case`unrecognized_keys`:return`Tanınmayan anahtar ${e.keys.length>1?`s`:``}: ${A(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} için tanınmayan anahtar var.`;case`invalid_union`:return`Giren tanınamadı.`;case`invalid_element`:return`${e.origin} için tanınmayan kıymet var.`;default:return`Kıymet tanınamadı.`}}}}));function _m(){return{localeError:vm()}}var vm,ym=t((()=>{I(),vm=()=>{let e={string:{unit:`توکي`,verb:`ولري`},file:{unit:`بایټس`,verb:`ولري`},array:{unit:`توکي`,verb:`ولري`},set:{unit:`توکي`,verb:`ولري`},map:{unit:`توکي`,verb:`ولري`}};function t(t){return e[t]??null}let n={regex:`ورودي`,email:`بریښنالیک`,url:`یو آر ال`,emoji:`ایموجي`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`نیټه او وخت`,date:`نېټه`,time:`وخت`,duration:`موده`,ipv4:`د IPv4 پته`,ipv6:`د IPv6 پته`,mac:`د MAC پته`,cidrv4:`د IPv4 ساحه`,cidrv6:`د IPv6 ساحه`,base64:`base64-encoded متن`,base64url:`base64url-encoded متن`,json_string:`JSON متن`,e164:`د E.164 شمېره`,credit_card:`د کریډیټ کارت شمیره`,jwt:`JWT`,template_literal:`ورودي`},r={nan:`NaN`,number:`عدد`,array:`ارې`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ناسم ورودي: باید instanceof ${e.expected} وای, مګر ${i} ترلاسه شو`:`ناسم ورودي: باید ${t} وای, مګر ${i} ترلاسه شو`}case`invalid_value`:return e.values.length===1?`ناسم ورودي: باید ${M(e.values[0])} وای`:`ناسم انتخاب: باید یو له ${A(e.values,`|`)} څخه وای`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`ډیر لوی: ${e.origin??`ارزښت`} باید ${n}${e.maximum.toString()} ${r.unit??`عنصرونه`} ولري`:`ډیر لوی: ${e.origin??`ارزښت`} باید ${n}${e.maximum.toString()} وي`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} ${r.unit} ولري`:`ډیر کوچنی: ${e.origin} باید ${n}${e.minimum.toString()} وي`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`ناسم متن: باید د "${t.prefix}" سره پیل شي`:t.format===`ends_with`?`ناسم متن: باید د "${t.suffix}" سره پای ته ورسيږي`:t.format===`includes`?`ناسم متن: باید "${t.includes}" ولري`:t.format===`regex`?`ناسم متن: باید د ${t.pattern} سره مطابقت ولري`:`${n[t.format]??e.format} ناسم دی`}case`not_multiple_of`:return`ناسم عدد: باید د ${e.divisor} مضرب وي`;case`unrecognized_keys`:return`ناسم ${e.keys.length>1?`کلیډونه`:`کلیډ`}: ${A(e.keys,`, `)}`;case`invalid_key`:return`ناسم کلیډ په ${e.origin} کې`;case`invalid_union`:return`ناسمه ورودي`;case`invalid_element`:return`ناسم عنصر په ${e.origin} کې`;default:return`ناسمه ورودي`}}}}));function bm(){return{localeError:xm()}}var xm,Sm=t((()=>{I(),xm=()=>{let e={string:{unit:`znaków`,verb:`mieć`},file:{unit:`bajtów`,verb:`mieć`},array:{unit:`elementów`,verb:`mieć`},set:{unit:`elementów`,verb:`mieć`},map:{unit:`elementów`,verb:`mieć`}};function t(t){return e[t]??null}let n={regex:`wyrażenie`,email:`adres email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`data i godzina w formacie ISO`,date:`data w formacie ISO`,time:`godzina w formacie ISO`,duration:`czas trwania ISO`,ipv4:`adres IPv4`,ipv6:`adres IPv6`,mac:`adres MAC`,cidrv4:`zakres IPv4`,cidrv6:`zakres IPv6`,base64:`ciąg znaków zakodowany w formacie base64`,base64url:`ciąg znaków zakodowany w formacie base64url`,json_string:`ciąg znaków w formacie JSON`,e164:`liczba E.164`,credit_card:`numer karty kredytowej`,jwt:`JWT`,template_literal:`wejście`},r={nan:`NaN`,number:`liczba`,array:`tablica`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${e.expected}, otrzymano ${i}`:`Nieprawidłowe dane wejściowe: oczekiwano ${t}, otrzymano ${i}`}case`invalid_value`:return e.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${M(e.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Za duża wartość: oczekiwano, że ${e.origin??`wartość`} będzie mieć ${n}${e.maximum.toString()} ${r.unit??`elementów`}`:`Zbyt duż(y/a/e): oczekiwano, że ${e.origin??`wartość`} będzie wynosić ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Za mała wartość: oczekiwano, że ${e.origin??`wartość`} będzie mieć ${n}${e.minimum.toString()} ${r.unit??`elementów`}`:`Zbyt mał(y/a/e): oczekiwano, że ${e.origin??`wartość`} będzie wynosić ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Nieprawidłowy ciąg znaków: musi zaczynać się od "${t.prefix}"`:t.format===`ends_with`?`Nieprawidłowy ciąg znaków: musi kończyć się na "${t.suffix}"`:t.format===`includes`?`Nieprawidłowy ciąg znaków: musi zawierać "${t.includes}"`:t.format===`regex`?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${t.pattern}`:`Nieprawidłow(y/a/e) ${n[t.format]??e.format}`}case`not_multiple_of`:return`Nieprawidłowa liczba: musi być wielokrotnością ${e.divisor}`;case`unrecognized_keys`:return`Nierozpoznane klucze${e.keys.length>1?`s`:``}: ${A(e.keys,`, `)}`;case`invalid_key`:return`Nieprawidłowy klucz w ${e.origin}`;case`invalid_union`:return`Nieprawidłowe dane wejściowe`;case`invalid_element`:return`Nieprawidłowa wartość w ${e.origin}`;default:return`Nieprawidłowe dane wejściowe`}}}}));function Cm(){return{localeError:wm()}}var wm,Tm=t((()=>{I(),wm=()=>{let e={string:{unit:`caracteres`},file:{unit:`bytes`},array:{unit:`elementos`},set:{unit:`elementos`},map:{unit:`entradas`}};function t(t){return e[t]??null}let n={regex:`a entrada`,email:`o endereço de e-mail`,url:`o URL`,emoji:`o emoji`,uuid:`o UUID`,uuidv4:`o UUIDv4`,uuidv6:`o UUIDv6`,nanoid:`o nanoid`,guid:`o GUID`,cuid:`o cuid`,cuid2:`o cuid2`,ulid:`o ULID`,xid:`o XID`,ksuid:`o KSUID`,datetime:`a data e hora ISO`,date:`a data ISO`,time:`a hora ISO`,duration:`a duração ISO`,ipv4:`o endereço IPv4`,ipv6:`o endereço IPv6`,mac:`o endereço MAC`,cidrv4:`o intervalo de endereços IPv4`,cidrv6:`o intervalo de endereços IPv6`,base64:`o texto codificado em base64`,base64url:`o texto codificado em base64url`,json_string:`o texto JSON`,e164:`o número E.164`,credit_card:`o número de cartão de crédito`,jwt:`o JWT`,template_literal:`a entrada`},r={masculine:{definite:`o`,indefinite:`um`},feminine:{definite:`a`,indefinite:`uma`}},i={string:{name:`texto`,articles:r.masculine},number:{name:`número`,articles:r.masculine},int:{name:`número inteiro`,articles:r.masculine},boolean:{name:`valor booleano`,articles:r.masculine},bigint:{name:`número bigint`,articles:r.masculine},symbol:{name:`símbolo`,articles:r.masculine},undefined:{name:`valor "undefined"`,articles:r.masculine},null:{name:`valor "nulo"`,articles:r.masculine},never:{name:`valor "never"`,articles:r.masculine},void:{name:`valor "void"`,articles:r.masculine},date:{name:`data`,articles:r.feminine},array:{name:`vetor`,articles:r.masculine},object:{name:`objeto`,articles:r.masculine},tuple:{name:`tuplo`,articles:r.masculine},record:{name:`registo`,articles:r.masculine},map:{name:`mapa`,articles:r.masculine},set:{name:`conjunto`,articles:r.masculine},file:{name:`ficheiro`,articles:r.masculine},nonoptional:{name:`valor não opcional`,articles:r.masculine},nan:{name:`valor "NaN"`,articles:r.masculine},function:{name:`função`,articles:r.feminine}};function a(e,t){let n=i[e]??{name:`valor "${e}"`,articles:r.masculine};return`${n.articles[t]} ${n.name}`}return e=>{switch(e.code){case`invalid_type`:return`Entrada inválida: esperava ${a(e.expected,`indefinite`)}, recebeu ${a(N(e.input),`indefinite`)}`;case`invalid_value`:return e.values.length===1?`Entrada inválida: esperava ${M(e.values[0])}`:`Opção inválida: esperava uma das seguintes opções: ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Demasiado grande: esperava que ${a(e.origin,`definite`)} tivesse ${n} ${e.maximum.toString()} ${r.unit??`elementos`}`:`Demasiado grande: esperava que ${a(e.origin,`definite`)} fosse ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Demasiado pequeno: esperava que ${a(e.origin,`definite`)} tivesse ${n} ${e.minimum.toString()} ${r.unit??`elementos`}`:`Demasiado pequeno: esperava que ${a(e.origin,`definite`)} fosse ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Texto inválido: deve começar por "${t.prefix}"`:t.format===`ends_with`?`Texto inválido: deve terminar em "${t.suffix}"`:t.format===`includes`?`Texto inválido: deve incluir "${t.includes}"`:t.format===`regex`?`Texto inválido: deve corresponder ao padrão ${t.pattern}`:`Formato d${n[t.format]??e.format} inválido`}case`not_multiple_of`:return`Número inválido: deve ser múltiplo de ${e.divisor}`;case`unrecognized_keys`:{let t=e.keys.length>1?`s`:``;return`Chave${t} inválida${t}: ${A(e.keys,`, `)}`}case`invalid_key`:return`Entrada inválida n${a(e.origin,`definite`)}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Valor de discriminação inválido. Esperava ${e.options.map(e=>`'${e}'`).join(` | `)}`:`Entrada inválida`;case`invalid_element`:return`Entrada inválida n${a(e.origin,`definite`)}`;default:return`Entrada inválida`}}}}));function Em(){return{localeError:Dm()}}var Dm,Om=t((()=>{I(),Dm=()=>{let e={string:{unit:`caracteres`},file:{unit:`bytes`},array:{unit:`elementos`},set:{unit:`elementos`},map:{unit:`entradas`}};function t(t){return e[t]??null}let n={regex:`a entrada`,email:`o endereço de e-mail`,url:`o URL`,emoji:`o emoji`,uuid:`o UUID`,uuidv4:`o UUIDv4`,uuidv6:`o UUIDv6`,nanoid:`o nanoid`,guid:`o GUID`,cuid:`o cuid`,cuid2:`o cuid2`,ulid:`o ULID`,xid:`o XID`,ksuid:`o KSUID`,datetime:`a data e hora ISO`,date:`a data ISO`,time:`a hora ISO`,duration:`a duração ISO`,ipv4:`o endereço IPv4`,ipv6:`o endereço IPv6`,mac:`o endereço MAC`,cidrv4:`a faixa de endereços IPv4`,cidrv6:`a faixa de endereços IPv6`,base64:`o texto codificado em base64`,base64url:`o texto codificado em base64url`,json_string:`o texto JSON`,e164:`o número E.164`,credit_card:`o número de cartão de crédito`,jwt:`o JWT`,template_literal:`a entrada`},r={masculine:{definite:`o`,indefinite:`um`},feminine:{definite:`a`,indefinite:`uma`}},i={string:{name:`texto`,articles:r.masculine},number:{name:`número`,articles:r.masculine},int:{name:`número inteiro`,articles:r.masculine},boolean:{name:`valor booleano`,articles:r.masculine},bigint:{name:`número bigint`,articles:r.masculine},symbol:{name:`símbolo`,articles:r.masculine},undefined:{name:`valor "undefined"`,articles:r.masculine},null:{name:`valor "nulo"`,articles:r.masculine},never:{name:`valor "never"`,articles:r.masculine},void:{name:`valor "void"`,articles:r.masculine},date:{name:`data`,articles:r.feminine},array:{name:`vetor`,articles:r.masculine},object:{name:`objeto`,articles:r.masculine},tuple:{name:`tupla`,articles:r.feminine},record:{name:`registro`,articles:r.masculine},map:{name:`mapa`,articles:r.masculine},set:{name:`conjunto`,articles:r.masculine},file:{name:`arquivo`,articles:r.masculine},nonoptional:{name:`valor não opcional`,articles:r.masculine},nan:{name:`valor "NaN"`,articles:r.masculine},function:{name:`função`,articles:r.feminine}};function a(e,t){let n=i[e]??{name:`valor "${e}"`,articles:r.masculine};return`${n.articles[t]} ${n.name}`}return e=>{switch(e.code){case`invalid_type`:return`Entrada inválida: esperava ${a(e.expected,`indefinite`)}, recebeu ${a(N(e.input),`indefinite`)}`;case`invalid_value`:return e.values.length===1?`Entrada inválida: esperava ${M(e.values[0])}`:`Opção inválida: esperava uma das seguintes opções: ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Grande demais: esperava que ${a(e.origin,`definite`)} tivesse ${n} ${e.maximum.toString()} ${r.unit??`elementos`}`:`Grande demais: esperava que ${a(e.origin,`definite`)} fosse ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Pequeno demais: esperava que ${a(e.origin,`definite`)} tivesse ${n} ${e.minimum.toString()} ${r.unit??`elementos`}`:`Pequeno demais: esperava que ${a(e.origin,`definite`)} fosse ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Texto inválido: deve começar com "${t.prefix}"`:t.format===`ends_with`?`Texto inválido: deve terminar com "${t.suffix}"`:t.format===`includes`?`Texto inválido: deve incluir "${t.includes}"`:t.format===`regex`?`Texto inválido: deve corresponder ao padrão ${t.pattern}`:`Formato d${n[t.format]??e.format} inválido`}case`not_multiple_of`:return`Número inválido: deve ser múltiplo de ${e.divisor}`;case`unrecognized_keys`:{let t=e.keys.length>1?`s`:``;return`Chave${t} inválida${t}: ${A(e.keys,`, `)}`}case`invalid_key`:return`Entrada inválida n${a(e.origin,`definite`)}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Valor de discriminação inválido. Esperava ${e.options.map(e=>`'${e}'`).join(` | `)}`:`Entrada inválida`;case`invalid_element`:return`Entrada inválida n${a(e.origin,`definite`)}`;default:return`Entrada inválida`}}}}));function km(){return{localeError:Am()}}var Am,jm=t((()=>{I(),Am=()=>{let e={string:{unit:`caractere`,verb:`să aibă`},file:{unit:`octeți`,verb:`să aibă`},array:{unit:`elemente`,verb:`să aibă`},set:{unit:`elemente`,verb:`să aibă`},map:{unit:`intrări`,verb:`să aibă`}};function t(t){return e[t]??null}let n={regex:`intrare`,email:`adresă de email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`dată și oră ISO`,date:`dată ISO`,time:`oră ISO`,duration:`durată ISO`,ipv4:`adresă IPv4`,ipv6:`adresă IPv6`,mac:`adresă MAC`,cidrv4:`interval IPv4`,cidrv6:`interval IPv6`,base64:`șir codat base64`,base64url:`șir codat base64url`,json_string:`șir JSON`,e164:`număr E.164`,credit_card:`număr de card de credit`,jwt:`JWT`,template_literal:`intrare`},r={nan:`NaN`,string:`șir`,number:`număr`,boolean:`boolean`,function:`funcție`,array:`matrice`,object:`obiect`,undefined:`nedefinit`,symbol:`simbol`,bigint:`număr mare`,void:`void`,never:`never`,map:`hartă`,set:`set`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input);return`Intrare invalidă: așteptat ${t}, primit ${r[n]??n}`}case`invalid_value`:return e.values.length===1?`Intrare invalidă: așteptat ${M(e.values[0])}`:`Opțiune invalidă: așteptat una dintre ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Prea mare: așteptat ca ${e.origin??`valoarea`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`elemente`}`:`Prea mare: așteptat ca ${e.origin??`valoarea`} să fie ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Prea mic: așteptat ca ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Prea mic: așteptat ca ${e.origin} să fie ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Șir invalid: trebuie să înceapă cu "${t.prefix}"`:t.format===`ends_with`?`Șir invalid: trebuie să se termine cu "${t.suffix}"`:t.format===`includes`?`Șir invalid: trebuie să includă "${t.includes}"`:t.format===`regex`?`Șir invalid: trebuie să se potrivească cu modelul ${t.pattern}`:`Format invalid: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Număr invalid: trebuie să fie multiplu de ${e.divisor}`;case`unrecognized_keys`:return`Chei nerecunoscute: ${A(e.keys,`, `)}`;case`invalid_key`:return`Cheie invalidă în ${e.origin}`;case`invalid_union`:return`Intrare invalidă`;case`invalid_element`:return`Valoare invalidă în ${e.origin}`;default:return`Intrare invalidă`}}}}));function Mm(e,t,n,r){let i=Math.abs(e),a=i%10,o=i%100;return o>=11&&o<=19?r:a===1?t:a>=2&&a<=4?n:r}function Nm(){return{localeError:Pm()}}var Pm,Fm=t((()=>{I(),Pm=()=>{let e={string:{unit:{one:`символ`,few:`символа`,many:`символов`},verb:`иметь`},file:{unit:{one:`байт`,few:`байта`,many:`байт`},verb:`иметь`},array:{unit:{one:`элемент`,few:`элемента`,many:`элементов`},verb:`иметь`},set:{unit:{one:`элемент`,few:`элемента`,many:`элементов`},verb:`иметь`},map:{unit:{one:`элемент`,few:`элемента`,many:`элементов`},verb:`иметь`}};function t(t){return e[t]??null}let n={regex:`ввод`,email:`email адрес`,url:`URL`,emoji:`эмодзи`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO дата и время`,date:`ISO дата`,time:`ISO время`,duration:`ISO длительность`,ipv4:`IPv4 адрес`,ipv6:`IPv6 адрес`,mac:`MAC адрес`,cidrv4:`IPv4 диапазон`,cidrv6:`IPv6 диапазон`,base64:`строка в формате base64`,base64url:`строка в формате base64url`,json_string:`JSON строка`,e164:`номер E.164`,credit_card:`номер кредитной карты`,jwt:`JWT`,template_literal:`ввод`},r={nan:`NaN`,number:`число`,array:`массив`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Неверный ввод: ожидалось instanceof ${e.expected}, получено ${i}`:`Неверный ввод: ожидалось ${t}, получено ${i}`}case`invalid_value`:return e.values.length===1?`Неверный ввод: ожидалось ${M(e.values[0])}`:`Неверный вариант: ожидалось одно из ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);if(r){let t=Mm(Number(e.maximum),r.unit.one,r.unit.few,r.unit.many);return`Слишком большое значение: ожидалось, что ${e.origin??`значение`} будет иметь ${n}${e.maximum.toString()} ${t}`}return`Слишком большое значение: ожидалось, что ${e.origin??`значение`} будет ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);if(r){let t=Mm(Number(e.minimum),r.unit.one,r.unit.few,r.unit.many);return`Слишком маленькое значение: ожидалось, что ${e.origin} будет иметь ${n}${e.minimum.toString()} ${t}`}return`Слишком маленькое значение: ожидалось, что ${e.origin} будет ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неверная строка: должна начинаться с "${t.prefix}"`:t.format===`ends_with`?`Неверная строка: должна заканчиваться на "${t.suffix}"`:t.format===`includes`?`Неверная строка: должна содержать "${t.includes}"`:t.format===`regex`?`Неверная строка: должна соответствовать шаблону ${t.pattern}`:`Неверный ${n[t.format]??e.format}`}case`not_multiple_of`:return`Неверное число: должно быть кратным ${e.divisor}`;case`unrecognized_keys`:return`Нераспознанн${e.keys.length>1?`ые`:`ый`} ключ${e.keys.length>1?`и`:``}: ${A(e.keys,`, `)}`;case`invalid_key`:return`Неверный ключ в ${e.origin}`;case`invalid_union`:return`Неверные входные данные`;case`invalid_element`:return`Неверное значение в ${e.origin}`;default:return`Неверные входные данные`}}}}));function Im(){return{localeError:Lm()}}var Lm,Rm=t((()=>{I(),Lm=()=>{let e={string:{unit:`znakov`,verb:`mať`},file:{unit:`bajtov`,verb:`mať`},array:{unit:`prvkov`,verb:`mať`},set:{unit:`prvkov`,verb:`mať`},map:{unit:`položiek`,verb:`mať`}};function t(t){return e[t]??null}let n={regex:`regulárny výraz`,email:`e-mailová adresa`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`dátum a čas vo formáte ISO`,date:`dátum vo formáte ISO`,time:`čas vo formáte ISO`,duration:`doba trvania ISO`,ipv4:`IPv4 adresa`,ipv6:`IPv6 adresa`,mac:`MAC adresa`,cidrv4:`rozsah IPv4`,cidrv6:`rozsah IPv6`,base64:`reťazec zakódovaný vo formáte base64`,base64url:`reťazec zakódovaný vo formáte base64url`,json_string:`reťazec vo formáte JSON`,e164:`číslo E.164`,credit_card:`číslo kreditnej karty`,jwt:`JWT`,template_literal:`vstup`},r={nan:`NaN`,number:`číslo`,string:`reťazec`,function:`funkcia`,array:`pole`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Neplatný vstup: očakávané instanceof ${e.expected}, obdržané ${i}`:`Neplatný vstup: očakávané ${t}, obdržané ${i}`}case`invalid_value`:return e.values.length===1?`Neplatný vstup: očakávané ${M(e.values[0])}`:`Neplatný vstup: očakávaná jedna z hodnôt ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Hodnota je príliš veľká: ${e.origin??`hodnota`} musí mať ${n}${e.maximum.toString()} ${r.unit??`prvkov`}`:`Hodnota je príliš veľká: ${e.origin??`hodnota`} musí byť ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Hodnota je príliš malá: ${e.origin??`hodnota`} musí mať ${n}${e.minimum.toString()} ${r.unit??`prvkov`}`:`Hodnota je príliš malá: ${e.origin??`hodnota`} musí byť ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neplatný reťazec: musí začínať na "${t.prefix}"`:t.format===`ends_with`?`Neplatný reťazec: musí končiť na "${t.suffix}"`:t.format===`includes`?`Neplatný reťazec: musí obsahovať "${t.includes}"`:t.format===`regex`?`Neplatný reťazec: musí zodpovedať vzoru ${t.pattern}`:`Neplatný formát ${n[t.format]??e.format}`}case`not_multiple_of`:return`Neplatné číslo: musí byť násobkom ${e.divisor}`;case`unrecognized_keys`:return`Neznáme klúče: ${A(e.keys,`, `)}`;case`invalid_key`:return`Neplatný klúč v ${e.origin}`;case`invalid_union`:return`Neplatný vstup`;case`invalid_element`:return`Neplatná hodnota v ${e.origin}`;default:return`Neplatný vstup`}}}}));function zm(){return{localeError:Bm()}}var Bm,Vm=t((()=>{I(),Bm=()=>{let e={string:{unit:`znakov`,verb:`imeti`},file:{unit:`bajtov`,verb:`imeti`},array:{unit:`elementov`,verb:`imeti`},set:{unit:`elementov`,verb:`imeti`},map:{unit:`elementov`,verb:`imeti`}};function t(t){return e[t]??null}let n={regex:`vnos`,email:`e-poštni naslov`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datum in čas`,date:`ISO datum`,time:`ISO čas`,duration:`ISO trajanje`,ipv4:`IPv4 naslov`,ipv6:`IPv6 naslov`,mac:`MAC naslov`,cidrv4:`obseg IPv4`,cidrv6:`obseg IPv6`,base64:`base64 kodiran niz`,base64url:`base64url kodiran niz`,json_string:`JSON niz`,e164:`E.164 številka`,credit_card:`številka kreditne kartice`,jwt:`JWT`,template_literal:`vnos`},r={nan:`NaN`,number:`število`,array:`tabela`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Neveljaven vnos: pričakovano instanceof ${e.expected}, prejeto ${i}`:`Neveljaven vnos: pričakovano ${t}, prejeto ${i}`}case`invalid_value`:return e.values.length===1?`Neveljaven vnos: pričakovano ${M(e.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Preveliko: pričakovano, da bo ${e.origin??`vrednost`} imelo ${n}${e.maximum.toString()} ${r.unit??`elementov`}`:`Preveliko: pričakovano, da bo ${e.origin??`vrednost`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Premajhno: pričakovano, da bo ${e.origin} imelo ${n}${e.minimum.toString()} ${r.unit}`:`Premajhno: pričakovano, da bo ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Neveljaven niz: mora se začeti z "${t.prefix}"`:t.format===`ends_with`?`Neveljaven niz: mora se končati z "${t.suffix}"`:t.format===`includes`?`Neveljaven niz: mora vsebovati "${t.includes}"`:t.format===`regex`?`Neveljaven niz: mora ustrezati vzorcu ${t.pattern}`:`Neveljaven ${n[t.format]??e.format}`}case`not_multiple_of`:return`Neveljavno število: mora biti večkratnik ${e.divisor}`;case`unrecognized_keys`:return`Neprepoznan${e.keys.length>1?`i ključi`:` ključ`}: ${A(e.keys,`, `)}`;case`invalid_key`:return`Neveljaven ključ v ${e.origin}`;case`invalid_union`:return`Neveljaven vnos`;case`invalid_element`:return`Neveljavna vrednost v ${e.origin}`;default:return`Neveljaven vnos`}}}}));function Hm(){return{localeError:Um()}}var Um,Wm=t((()=>{I(),Um=()=>{let e={string:{unit:`tecken`,verb:`att ha`},file:{unit:`bytes`,verb:`att ha`},array:{unit:`objekt`,verb:`att innehålla`},set:{unit:`objekt`,verb:`att innehålla`},map:{unit:`objekt`,verb:`att innehålla`}};function t(t){return e[t]??null}let n={regex:`reguljärt uttryck`,email:`e-postadress`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO-datum och tid`,date:`ISO-datum`,time:`ISO-tid`,duration:`ISO-varaktighet`,ipv4:`IPv4-adress`,ipv6:`IPv6-adress`,mac:`MAC-adress`,cidrv4:`IPv4-spektrum`,cidrv6:`IPv6-spektrum`,base64:`base64-kodad sträng`,base64url:`base64url-kodad sträng`,json_string:`JSON-sträng`,e164:`E.164-nummer`,credit_card:`kreditkortsnummer`,jwt:`JWT`,template_literal:`mall-literal`},r={nan:`NaN`,number:`antal`,array:`lista`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ogiltig inmatning: förväntat instanceof ${e.expected}, fick ${i}`:`Ogiltig inmatning: förväntat ${t}, fick ${i}`}case`invalid_value`:return e.values.length===1?`Ogiltig inmatning: förväntat ${M(e.values[0])}`:`Ogiltigt val: förväntade en av ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`För stor(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.maximum.toString()} ${r.unit??`element`}`:`För stor(t): förväntat ${e.origin??`värdet`} att ha ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`För lite(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.minimum.toString()} ${r.unit}`:`För lite(t): förväntade ${e.origin??`värdet`} att ha ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ogiltig sträng: måste börja med "${t.prefix}"`:t.format===`ends_with`?`Ogiltig sträng: måste sluta med "${t.suffix}"`:t.format===`includes`?`Ogiltig sträng: måste innehålla "${t.includes}"`:t.format===`regex`?`Ogiltig sträng: måste matcha mönstret "${t.pattern}"`:`Ogiltig(t) ${n[t.format]??e.format}`}case`not_multiple_of`:return`Ogiltigt tal: måste vara en multipel av ${e.divisor}`;case`unrecognized_keys`:return`${e.keys.length>1?`Okända nycklar`:`Okänd nyckel`}: ${A(e.keys,`, `)}`;case`invalid_key`:return`Ogiltig nyckel i ${e.origin??`värdet`}`;case`invalid_union`:return`Ogiltig input`;case`invalid_element`:return`Ogiltigt värde i ${e.origin??`värdet`}`;default:return`Ogiltig input`}}}}));function Gm(){return{localeError:Km()}}var Km,qm=t((()=>{I(),Km=()=>{let e={string:{unit:`எழுத்துக்கள்`,verb:`கொண்டிருக்க வேண்டும்`},file:{unit:`பைட்டுகள்`,verb:`கொண்டிருக்க வேண்டும்`},array:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`},set:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`},map:{unit:`உறுப்புகள்`,verb:`கொண்டிருக்க வேண்டும்`}};function t(t){return e[t]??null}let n={regex:`உள்ளீடு`,email:`மின்னஞ்சல் முகவரி`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO தேதி நேரம்`,date:`ISO தேதி`,time:`ISO நேரம்`,duration:`ISO கால அளவு`,ipv4:`IPv4 முகவரி`,ipv6:`IPv6 முகவரி`,mac:`MAC முகவரி`,cidrv4:`IPv4 வரம்பு`,cidrv6:`IPv6 வரம்பு`,base64:`base64-encoded சரம்`,base64url:`base64url-encoded சரம்`,json_string:`JSON சரம்`,e164:`E.164 எண்`,credit_card:`கடன் அட்டை எண்`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`,number:`எண்`,array:`அணி`,null:`வெறுமை`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${e.expected}, பெறப்பட்டது ${i}`:`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${t}, பெறப்பட்டது ${i}`}case`invalid_value`:return e.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${M(e.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${A(e.values,`|`)} இல் ஒன்று`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin??`மதிப்பு`} ${n}${e.maximum.toString()} ${r.unit??`உறுப்புகள்`} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${e.origin??`மதிப்பு`} ${n}${e.maximum.toString()} ஆக இருக்க வேண்டும்`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${e.origin} ${n}${e.minimum.toString()} ஆக இருக்க வேண்டும்`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`தவறான சரம்: "${t.prefix}" இல் தொடங்க வேண்டும்`:t.format===`ends_with`?`தவறான சரம்: "${t.suffix}" இல் முடிவடைய வேண்டும்`:t.format===`includes`?`தவறான சரம்: "${t.includes}" ஐ உள்ளடக்க வேண்டும்`:t.format===`regex`?`தவறான சரம்: ${t.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${n[t.format]??e.format}`}case`not_multiple_of`:return`தவறான எண்: ${e.divisor} இன் பலமாக இருக்க வேண்டும்`;case`unrecognized_keys`:return`அடையாளம் தெரியாத விசை${e.keys.length>1?`கள்`:``}: ${A(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} இல் தவறான விசை`;case`invalid_union`:return`தவறான உள்ளீடு`;case`invalid_element`:return`${e.origin} இல் தவறான மதிப்பு`;default:return`தவறான உள்ளீடு`}}}}));function Jm(){return{localeError:Ym()}}var Ym,Xm=t((()=>{I(),Ym=()=>{let e={string:{unit:`ตัวอักษร`,verb:`ควรมี`},file:{unit:`ไบต์`,verb:`ควรมี`},array:{unit:`รายการ`,verb:`ควรมี`},set:{unit:`รายการ`,verb:`ควรมี`},map:{unit:`รายการ`,verb:`ควรมี`}};function t(t){return e[t]??null}let n={regex:`ข้อมูลที่ป้อน`,email:`ที่อยู่อีเมล`,url:`URL`,emoji:`อิโมจิ`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`วันที่เวลาแบบ ISO`,date:`วันที่แบบ ISO`,time:`เวลาแบบ ISO`,duration:`ช่วงเวลาแบบ ISO`,ipv4:`ที่อยู่ IPv4`,ipv6:`ที่อยู่ IPv6`,mac:`ที่อยู่ MAC`,cidrv4:`ช่วง IP แบบ IPv4`,cidrv6:`ช่วง IP แบบ IPv6`,base64:`ข้อความแบบ Base64`,base64url:`ข้อความแบบ Base64 สำหรับ URL`,json_string:`ข้อความแบบ JSON`,e164:`เบอร์โทรศัพท์ระหว่างประเทศ (E.164)`,credit_card:`หมายเลขบัตรเครดิต`,jwt:`โทเคน JWT`,template_literal:`ข้อมูลที่ป้อน`},r={nan:`NaN`,number:`ตัวเลข`,array:`อาร์เรย์ (Array)`,null:`ไม่มีค่า (null)`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${e.expected} แต่ได้รับ ${i}`:`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${t} แต่ได้รับ ${i}`}case`invalid_value`:return e.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${M(e.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`ไม่เกิน`:`น้อยกว่า`,r=t(e.origin);return r?`เกินกำหนด: ${e.origin??`ค่า`} ควรมี${n} ${e.maximum.toString()} ${r.unit??`รายการ`}`:`เกินกำหนด: ${e.origin??`ค่า`} ควรมี${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`อย่างน้อย`:`มากกว่า`,r=t(e.origin);return r?`น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()} ${r.unit}`:`น้อยกว่ากำหนด: ${e.origin} ควรมี${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${t.prefix}"`:t.format===`ends_with`?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${t.suffix}"`:t.format===`includes`?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${t.includes}" อยู่ในข้อความ`:t.format===`regex`?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${t.pattern}`:`รูปแบบไม่ถูกต้อง: ${n[t.format]??e.format}`}case`not_multiple_of`:return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${e.divisor} ได้ลงตัว`;case`unrecognized_keys`:return`พบคีย์ที่ไม่รู้จัก: ${A(e.keys,`, `)}`;case`invalid_key`:return`คีย์ไม่ถูกต้องใน ${e.origin}`;case`invalid_union`:return`ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้`;case`invalid_element`:return`ข้อมูลไม่ถูกต้องใน ${e.origin}`;default:return`ข้อมูลไม่ถูกต้อง`}}}}));function Zm(){return{localeError:Qm()}}var Qm,$m=t((()=>{I(),Qm=()=>{let e={string:{unit:`simwol`,verb:`bolmaly`},file:{unit:`baýt`,verb:`bolmaly`},array:{unit:`elementler`,verb:`bolmaly`},set:{unit:`elementler`,verb:`bolmaly`},map:{unit:`elementler`,verb:`bolmaly`}};function t(t){return e[t]??null}let n={regex:`giriş`,email:`e-poçta salgysy`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO sene we wagt`,date:`ISO sene`,time:`ISO wagt`,duration:`ISO wagt aralygy`,ipv4:`IPv4 salgysy`,ipv6:`IPv6 salgysy`,mac:`MAC salgysy`,cidrv4:`IPv4 aralygy`,cidrv6:`IPv6 aralygy`,base64:`base64 bilen şifrlenen setir`,base64url:`base64url bilen şifrlenen setir`,json_string:`JSON setiri`,e164:`E.164 nomeri`,credit_card:`kredit kartynyň nomeri`,jwt:`JWT`,template_literal:`şablon`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input);return`Nädogry baha: garaşylan ${t} ýerine ${r[n]??n} alyndy`}case`invalid_value`:return e.values.length===1?`Nädogry baha: ${M(e.values[0])} bolmaly`:`Nädogry saýlaw: aşakdakylardan biri bolmaly: ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Has uly: garaşylýan ${e.origin??`baha`} ${n} ${e.maximum.toString()} ${r.unit??`element`}`:`Has uly: garaşylýan ${e.origin??`baha`} ${n} ${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Has kiçi: garaşylýan ${e.origin} ${n} ${e.minimum.toString()} ${r.unit}`:`Has kiçi: garaşylýan ${e.origin} ${n} ${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Nädogry setir: "${t.prefix}" bilen başlamaly`:t.format===`ends_with`?`Nädogry setir: "${t.suffix}" bilen gutarmaly`:t.format===`includes`?`Nädogry setir: "${t.includes}" saklamaly`:t.format===`regex`?`Nädogry setir: ${t.pattern} nusga laýyk bolmaly`:`Nädogry ${n[t.format]??e.format}`}case`not_multiple_of`:return`Nädogry san: ${e.divisor} bilen galyndysyz bölünmeli`;case`unrecognized_keys`:return`Tanalmaýan açar${e.keys.length>1?`lar`:``}: ${A(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} içinde nädogry açar`;case`invalid_union`:return`Nädogry baha`;case`invalid_element`:return`${e.origin} içinde nädogry baha`;default:return`Nädogry baha`}}}}));function eh(){return{localeError:th()}}var th,nh=t((()=>{I(),th=()=>{let e={string:{unit:`karakter`,verb:`olmalı`},file:{unit:`bayt`,verb:`olmalı`},array:{unit:`öğe`,verb:`olmalı`},set:{unit:`öğe`,verb:`olmalı`},map:{unit:`öğe`,verb:`olmalı`}};function t(t){return e[t]??null}let n={regex:`girdi`,email:`e-posta adresi`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO tarih ve saat`,date:`ISO tarih`,time:`ISO saat`,duration:`ISO süre`,ipv4:`IPv4 adresi`,ipv6:`IPv6 adresi`,mac:`MAC adresi`,cidrv4:`IPv4 aralığı`,cidrv6:`IPv6 aralığı`,base64:`base64 ile şifrelenmiş metin`,base64url:`base64url ile şifrelenmiş metin`,json_string:`JSON dizesi`,e164:`E.164 sayısı`,credit_card:`kredi kartı numarası`,jwt:`JWT`,template_literal:`Şablon dizesi`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Geçersiz değer: beklenen instanceof ${e.expected}, alınan ${i}`:`Geçersiz değer: beklenen ${t}, alınan ${i}`}case`invalid_value`:return e.values.length===1?`Geçersiz değer: beklenen ${M(e.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Çok büyük: beklenen ${e.origin??`değer`} ${n}${e.maximum.toString()} ${r.unit??`öğe`}`:`Çok büyük: beklenen ${e.origin??`değer`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`Çok küçük: beklenen ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Geçersiz metin: "${t.prefix}" ile başlamalı`:t.format===`ends_with`?`Geçersiz metin: "${t.suffix}" ile bitmeli`:t.format===`includes`?`Geçersiz metin: "${t.includes}" içermeli`:t.format===`regex`?`Geçersiz metin: ${t.pattern} desenine uymalı`:`Geçersiz ${n[t.format]??e.format}`}case`not_multiple_of`:return`Geçersiz sayı: ${e.divisor} ile tam bölünebilmeli`;case`unrecognized_keys`:return`Tanınmayan anahtar${e.keys.length>1?`lar`:``}: ${A(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} içinde geçersiz anahtar`;case`invalid_union`:return`Geçersiz değer`;case`invalid_element`:return`${e.origin} içinde geçersiz değer`;default:return`Geçersiz değer`}}}}));function rh(){return{localeError:ih()}}var ih,ah=t((()=>{I(),ih=()=>{let e={string:{unit:`символів`,verb:`матиме`},file:{unit:`байтів`,verb:`матиме`},array:{unit:`елементів`,verb:`матиме`},set:{unit:`елементів`,verb:`матиме`},map:{unit:`елементів`,verb:`матиме`}};function t(t){return e[t]??null}let n={regex:`вхідні дані`,email:`адреса електронної пошти`,url:`URL`,emoji:`емодзі`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`дата та час ISO`,date:`дата ISO`,time:`час ISO`,duration:`тривалість ISO`,ipv4:`адреса IPv4`,ipv6:`адреса IPv6`,mac:`адреса MAC`,cidrv4:`діапазон IPv4`,cidrv6:`діапазон IPv6`,base64:`рядок у кодуванні base64`,base64url:`рядок у кодуванні base64url`,json_string:`рядок JSON`,e164:`номер E.164`,credit_card:`номер кредитної картки`,jwt:`JWT`,template_literal:`вхідні дані`},r={nan:`NaN`,number:`число`,array:`масив`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Неправильні вхідні дані: очікується instanceof ${e.expected}, отримано ${i}`:`Неправильні вхідні дані: очікується ${t}, отримано ${i}`}case`invalid_value`:return e.values.length===1?`Неправильні вхідні дані: очікується ${M(e.values[0])}`:`Неправильна опція: очікується одне з ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Занадто велике: очікується, що ${e.origin??`значення`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`елементів`}`:`Занадто велике: очікується, що ${e.origin??`значення`} буде ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Занадто мале: очікується, що ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Занадто мале: очікується, що ${e.origin} буде ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Неправильний рядок: повинен починатися з "${t.prefix}"`:t.format===`ends_with`?`Неправильний рядок: повинен закінчуватися на "${t.suffix}"`:t.format===`includes`?`Неправильний рядок: повинен містити "${t.includes}"`:t.format===`regex`?`Неправильний рядок: повинен відповідати шаблону ${t.pattern}`:`Неправильний ${n[t.format]??e.format}`}case`not_multiple_of`:return`Неправильне число: повинно бути кратним ${e.divisor}`;case`unrecognized_keys`:return`Нерозпізнаний ключ${e.keys.length>1?`і`:``}: ${A(e.keys,`, `)}`;case`invalid_key`:return`Неправильний ключ у ${e.origin}`;case`invalid_union`:return`Неправильні вхідні дані`;case`invalid_element`:return`Неправильне значення у ${e.origin}`;default:return`Неправильні вхідні дані`}}}}));function oh(){return rh()}var sh=t((()=>{ah()}));function ch(){return{localeError:lh()}}var lh,uh=t((()=>{I(),lh=()=>{let e={string:{unit:`حروف`,verb:`ہونا`},file:{unit:`بائٹس`,verb:`ہونا`},array:{unit:`آئٹمز`,verb:`ہونا`},set:{unit:`آئٹمز`,verb:`ہونا`},map:{unit:`آئٹمز`,verb:`ہونا`}};function t(t){return e[t]??null}let n={regex:`ان پٹ`,email:`ای میل ایڈریس`,url:`یو آر ایل`,emoji:`ایموجی`,uuid:`یو یو آئی ڈی`,uuidv4:`یو یو آئی ڈی وی 4`,uuidv6:`یو یو آئی ڈی وی 6`,nanoid:`نینو آئی ڈی`,guid:`جی یو آئی ڈی`,cuid:`سی یو آئی ڈی`,cuid2:`سی یو آئی ڈی 2`,ulid:`یو ایل آئی ڈی`,xid:`ایکس آئی ڈی`,ksuid:`کے ایس یو آئی ڈی`,datetime:`آئی ایس او ڈیٹ ٹائم`,date:`آئی ایس او تاریخ`,time:`آئی ایس او وقت`,duration:`آئی ایس او مدت`,ipv4:`آئی پی وی 4 ایڈریس`,ipv6:`آئی پی وی 6 ایڈریس`,mac:`ایم اے سی ایڈریس`,cidrv4:`آئی پی وی 4 رینج`,cidrv6:`آئی پی وی 6 رینج`,base64:`بیس 64 ان کوڈڈ سٹرنگ`,base64url:`بیس 64 یو آر ایل ان کوڈڈ سٹرنگ`,json_string:`جے ایس او این سٹرنگ`,e164:`ای 164 نمبر`,credit_card:`کریڈٹ کارڈ نمبر`,jwt:`جے ڈبلیو ٹی`,template_literal:`ان پٹ`},r={nan:`NaN`,number:`نمبر`,array:`آرے`,null:`نل`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`غلط ان پٹ: instanceof ${e.expected} متوقع تھا، ${i} موصول ہوا`:`غلط ان پٹ: ${t} متوقع تھا، ${i} موصول ہوا`}case`invalid_value`:return e.values.length===1?`غلط ان پٹ: ${M(e.values[0])} متوقع تھا`:`غلط آپشن: ${A(e.values,`|`)} میں سے ایک متوقع تھا`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`بہت بڑا: ${e.origin??`ویلیو`} کے ${n}${e.maximum.toString()} ${r.unit??`عناصر`} ہونے متوقع تھے`:`بہت بڑا: ${e.origin??`ویلیو`} کا ${n}${e.maximum.toString()} ہونا متوقع تھا`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`بہت چھوٹا: ${e.origin} کے ${n}${e.minimum.toString()} ${r.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${e.origin} کا ${n}${e.minimum.toString()} ہونا متوقع تھا`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`غلط سٹرنگ: "${t.prefix}" سے شروع ہونا چاہیے`:t.format===`ends_with`?`غلط سٹرنگ: "${t.suffix}" پر ختم ہونا چاہیے`:t.format===`includes`?`غلط سٹرنگ: "${t.includes}" شامل ہونا چاہیے`:t.format===`regex`?`غلط سٹرنگ: پیٹرن ${t.pattern} سے میچ ہونا چاہیے`:`غلط ${n[t.format]??e.format}`}case`not_multiple_of`:return`غلط نمبر: ${e.divisor} کا مضاعف ہونا چاہیے`;case`unrecognized_keys`:return`غیر تسلیم شدہ کی${e.keys.length>1?`ز`:``}: ${A(e.keys,`، `)}`;case`invalid_key`:return`${e.origin} میں غلط کی`;case`invalid_union`:return`غلط ان پٹ`;case`invalid_element`:return`${e.origin} میں غلط ویلیو`;default:return`غلط ان پٹ`}}}}));function dh(){return{localeError:fh()}}var fh,ph=t((()=>{I(),fh=()=>{let e={string:{unit:`belgi`,verb:`bo‘lishi kerak`},file:{unit:`bayt`,verb:`bo‘lishi kerak`},array:{unit:`element`,verb:`bo‘lishi kerak`},set:{unit:`element`,verb:`bo‘lishi kerak`},map:{unit:`yozuv`,verb:`bo‘lishi kerak`}};function t(t){return e[t]??null}let n={regex:`kirish`,email:`elektron pochta manzili`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO sana va vaqti`,date:`ISO sana`,time:`ISO vaqt`,duration:`ISO davomiylik`,ipv4:`IPv4 manzil`,ipv6:`IPv6 manzil`,mac:`MAC manzil`,cidrv4:`IPv4 diapazon`,cidrv6:`IPv6 diapazon`,base64:`base64 kodlangan satr`,base64url:`base64url kodlangan satr`,json_string:`JSON satr`,e164:`E.164 raqam`,credit_card:`kredit karta raqami`,jwt:`JWT`,template_literal:`kirish`},r={nan:`NaN`,number:`raqam`,array:`massiv`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Noto‘g‘ri kirish: kutilgan instanceof ${e.expected}, qabul qilingan ${i}`:`Noto‘g‘ri kirish: kutilgan ${t}, qabul qilingan ${i}`}case`invalid_value`:return e.values.length===1?`Noto‘g‘ri kirish: kutilgan ${M(e.values[0])}`:`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Juda katta: kutilgan ${e.origin??`qiymat`} ${n}${e.maximum.toString()} ${r.unit} ${r.verb}`:`Juda katta: kutilgan ${e.origin??`qiymat`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Juda kichik: kutilgan ${e.origin} ${n}${e.minimum.toString()} ${r.unit} ${r.verb}`:`Juda kichik: kutilgan ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Noto‘g‘ri satr: "${t.prefix}" bilan boshlanishi kerak`:t.format===`ends_with`?`Noto‘g‘ri satr: "${t.suffix}" bilan tugashi kerak`:t.format===`includes`?`Noto‘g‘ri satr: "${t.includes}" ni o‘z ichiga olishi kerak`:t.format===`regex`?`Noto‘g‘ri satr: ${t.pattern} shabloniga mos kelishi kerak`:`Noto‘g‘ri ${n[t.format]??e.format}`}case`not_multiple_of`:return`Noto‘g‘ri raqam: ${e.divisor} ning karralisi bo‘lishi kerak`;case`unrecognized_keys`:return`Noma’lum kalit${e.keys.length>1?`lar`:``}: ${A(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} dagi kalit noto‘g‘ri`;case`invalid_union`:return`Noto‘g‘ri kirish`;case`invalid_element`:return`${e.origin} da noto‘g‘ri qiymat`;default:return`Noto‘g‘ri kirish`}}}}));function mh(){return{localeError:hh()}}var hh,gh=t((()=>{I(),hh=()=>{let e={string:{unit:`ký tự`,verb:`có`},file:{unit:`byte`,verb:`có`},array:{unit:`phần tử`,verb:`có`},set:{unit:`phần tử`,verb:`có`},map:{unit:`phần tử`,verb:`có`}};function t(t){return e[t]??null}let n={regex:`đầu vào`,email:`địa chỉ email`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ngày giờ ISO`,date:`ngày ISO`,time:`giờ ISO`,duration:`khoảng thời gian ISO`,ipv4:`địa chỉ IPv4`,ipv6:`địa chỉ IPv6`,mac:`địa chỉ MAC`,cidrv4:`dải IPv4`,cidrv6:`dải IPv6`,base64:`chuỗi mã hóa base64`,base64url:`chuỗi mã hóa base64url`,json_string:`chuỗi JSON`,e164:`số E.164`,credit_card:`số thẻ tín dụng`,jwt:`JWT`,template_literal:`đầu vào`},r={nan:`NaN`,number:`số`,array:`mảng`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Đầu vào không hợp lệ: mong đợi instanceof ${e.expected}, nhận được ${i}`:`Đầu vào không hợp lệ: mong đợi ${t}, nhận được ${i}`}case`invalid_value`:return e.values.length===1?`Đầu vào không hợp lệ: mong đợi ${M(e.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Quá lớn: mong đợi ${e.origin??`giá trị`} ${r.verb} ${n}${e.maximum.toString()} ${r.unit??`phần tử`}`:`Quá lớn: mong đợi ${e.origin??`giá trị`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Quá nhỏ: mong đợi ${e.origin} ${r.verb} ${n}${e.minimum.toString()} ${r.unit}`:`Quá nhỏ: mong đợi ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Chuỗi không hợp lệ: phải bắt đầu bằng "${t.prefix}"`:t.format===`ends_with`?`Chuỗi không hợp lệ: phải kết thúc bằng "${t.suffix}"`:t.format===`includes`?`Chuỗi không hợp lệ: phải bao gồm "${t.includes}"`:t.format===`regex`?`Chuỗi không hợp lệ: phải khớp với mẫu ${t.pattern}`:`${n[t.format]??e.format} không hợp lệ`}case`not_multiple_of`:return`Số không hợp lệ: phải là bội số của ${e.divisor}`;case`unrecognized_keys`:return`Khóa không được nhận dạng: ${A(e.keys,`, `)}`;case`invalid_key`:return`Khóa không hợp lệ trong ${e.origin}`;case`invalid_union`:return`Đầu vào không hợp lệ`;case`invalid_element`:return`Giá trị không hợp lệ trong ${e.origin}`;default:return`Đầu vào không hợp lệ`}}}}));function _h(){return{localeError:vh()}}var vh,yh=t((()=>{I(),vh=()=>{let e={string:{unit:`字符`,verb:`包含`},file:{unit:`字节`,verb:`包含`},array:{unit:`项`,verb:`包含`},set:{unit:`项`,verb:`包含`},map:{unit:`项`,verb:`包含`}};function t(t){return e[t]??null}let n={regex:`输入`,email:`电子邮件`,url:`URL`,emoji:`表情符号`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO日期时间`,date:`ISO日期`,time:`ISO时间`,duration:`ISO时长`,ipv4:`IPv4地址`,ipv6:`IPv6地址`,mac:`MAC地址`,cidrv4:`IPv4网段`,cidrv6:`IPv6网段`,base64:`base64编码字符串`,base64url:`base64url编码字符串`,json_string:`JSON字符串`,e164:`E.164号码`,credit_card:`信用卡号`,jwt:`JWT`,template_literal:`输入`},r={nan:`NaN`,number:`数字`,array:`数组`,null:`空值(null)`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`无效输入:期望 instanceof ${e.expected},实际接收 ${i}`:`无效输入:期望 ${t},实际接收 ${i}`}case`invalid_value`:return e.values.length===1?`无效输入:期望 ${M(e.values[0])}`:`无效选项:期望以下之一 ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`数值过大:期望 ${e.origin??`值`} ${n}${e.maximum.toString()} ${r.unit??`个元素`}`:`数值过大:期望 ${e.origin??`值`} ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`数值过小:期望 ${e.origin} ${n}${e.minimum.toString()} ${r.unit}`:`数值过小:期望 ${e.origin} ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`无效字符串:必须以 "${t.prefix}" 开头`:t.format===`ends_with`?`无效字符串:必须以 "${t.suffix}" 结尾`:t.format===`includes`?`无效字符串:必须包含 "${t.includes}"`:t.format===`regex`?`无效字符串:必须满足正则表达式 ${t.pattern}`:`无效${n[t.format]??e.format}`}case`not_multiple_of`:return`无效数字:必须是 ${e.divisor} 的倍数`;case`unrecognized_keys`:return`出现未知的键(key): ${A(e.keys,`, `)}`;case`invalid_key`:return`${e.origin} 中的键(key)无效`;case`invalid_union`:return`无效输入`;case`invalid_element`:return`${e.origin} 中包含无效值(value)`;default:return`无效输入`}}}}));function bh(){return{localeError:xh()}}var xh,Sh=t((()=>{I(),xh=()=>{let e={string:{unit:`字元`,verb:`擁有`},file:{unit:`位元組`,verb:`擁有`},array:{unit:`項目`,verb:`擁有`},set:{unit:`項目`,verb:`擁有`},map:{unit:`項目`,verb:`擁有`}};function t(t){return e[t]??null}let n={regex:`輸入`,email:`郵件地址`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO 日期時間`,date:`ISO 日期`,time:`ISO 時間`,duration:`ISO 期間`,ipv4:`IPv4 位址`,ipv6:`IPv6 位址`,mac:`MAC 位址`,cidrv4:`IPv4 範圍`,cidrv6:`IPv6 範圍`,base64:`base64 編碼字串`,base64url:`base64url 編碼字串`,json_string:`JSON 字串`,e164:`E.164 數值`,credit_card:`信用卡號`,jwt:`JWT`,template_literal:`輸入`},r={nan:`NaN`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`無效的輸入值:預期為 instanceof ${e.expected},但收到 ${i}`:`無效的輸入值:預期為 ${t},但收到 ${i}`}case`invalid_value`:return e.values.length===1?`無效的輸入值:預期為 ${M(e.values[0])}`:`無效的選項:預期為以下其中之一 ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`數值過大:預期 ${e.origin??`值`} 應為 ${n}${e.maximum.toString()} ${r.unit??`個元素`}`:`數值過大:預期 ${e.origin??`值`} 應為 ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()} ${r.unit}`:`數值過小:預期 ${e.origin} 應為 ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`無效的字串:必須以 "${t.prefix}" 開頭`:t.format===`ends_with`?`無效的字串:必須以 "${t.suffix}" 結尾`:t.format===`includes`?`無效的字串:必須包含 "${t.includes}"`:t.format===`regex`?`無效的字串:必須符合格式 ${t.pattern}`:`無效的 ${n[t.format]??e.format}`}case`not_multiple_of`:return`無效的數字:必須為 ${e.divisor} 的倍數`;case`unrecognized_keys`:return`無法識別的鍵值${e.keys.length>1?`們`:``}:${A(e.keys,`、`)}`;case`invalid_key`:return`${e.origin} 中有無效的鍵值`;case`invalid_union`:return`無效的輸入值`;case`invalid_element`:return`${e.origin} 中有無效的值`;default:return`無效的輸入值`}}}}));function Ch(){return{localeError:wh()}}var wh,Th=t((()=>{I(),wh=()=>{let e={string:{unit:`àmi`,verb:`ní`},file:{unit:`bytes`,verb:`ní`},array:{unit:`nkan`,verb:`ní`},set:{unit:`nkan`,verb:`ní`},map:{unit:`nkan`,verb:`ní`}};function t(t){return e[t]??null}let n={regex:`ẹ̀rọ ìbáwọlé`,email:`àdírẹ́sì ìmẹ́lì`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`àkókò ISO`,date:`ọjọ́ ISO`,time:`àkókò ISO`,duration:`àkókò tó pé ISO`,ipv4:`àdírẹ́sì IPv4`,ipv6:`àdírẹ́sì IPv6`,mac:`àdírẹ́sì MAC`,cidrv4:`àgbègbè IPv4`,cidrv6:`àgbègbè IPv6`,base64:`ọ̀rọ̀ tí a kọ́ ní base64`,base64url:`ọ̀rọ̀ base64url`,json_string:`ọ̀rọ̀ JSON`,e164:`nọ́mbà E.164`,credit_card:`nọmba kaadi gbese`,jwt:`JWT`,template_literal:`ẹ̀rọ ìbáwọlé`},r={nan:`NaN`,number:`nọ́mbà`,array:`akopọ`};return e=>{switch(e.code){case`invalid_type`:{let t=r[e.expected]??e.expected,n=N(e.input),i=r[n]??n;return/^[A-Z]/.test(e.expected)?`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${e.expected}, àmọ̀ a rí ${i}`:`Ìbáwọlé aṣìṣe: a ní láti fi ${t}, àmọ̀ a rí ${i}`}case`invalid_value`:return e.values.length===1?`Ìbáwọlé aṣìṣe: a ní láti fi ${M(e.values[0])}`:`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${A(e.values,`|`)}`;case`too_big`:{let n=e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Tó pọ̀ jù: a ní láti jẹ́ pé ${e.origin??`iye`} ${r.verb} ${n}${e.maximum} ${r.unit}`:`Tó pọ̀ jù: a ní láti jẹ́ ${n}${e.maximum}`}case`too_small`:{let n=e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Kéré ju: a ní láti jẹ́ pé ${e.origin} ${r.verb} ${n}${e.minimum} ${r.unit}`:`Kéré ju: a ní láti jẹ́ ${n}${e.minimum}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${t.prefix}"`:t.format===`ends_with`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${t.suffix}"`:t.format===`includes`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${t.includes}"`:t.format===`regex`?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${t.pattern}`:`Aṣìṣe: ${n[t.format]??e.format}`}case`not_multiple_of`:return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${e.divisor}`;case`unrecognized_keys`:return`Bọtìnì àìmọ̀: ${A(e.keys,`, `)}`;case`invalid_key`:return`Bọtìnì aṣìṣe nínú ${e.origin}`;case`invalid_union`:return`Ìbáwọlé aṣìṣe`;case`invalid_element`:return`Iye aṣìṣe nínú ${e.origin}`;default:return`Ìbáwọlé aṣìṣe`}}}})),Eh=r({ar:()=>Zd,az:()=>ef,be:()=>af,bg:()=>cf,bn:()=>df,ca:()=>mf,ckb:()=>_f,cs:()=>bf,da:()=>Cf,de:()=>Ef,el:()=>kf,en:()=>Mf,eo:()=>Ff,es:()=>Rf,fa:()=>Vf,fi:()=>Wf,fr:()=>qf,frCA:()=>Xf,gu:()=>$f,he:()=>np,hi:()=>ap,hr:()=>cp,hu:()=>dp,hy:()=>gp,id:()=>yp,is:()=>Sp,it:()=>Tp,ja:()=>Op,ka:()=>jp,kh:()=>Lp,km:()=>Pp,kn:()=>zp,ko:()=>Hp,lt:()=>Kp,mk:()=>Xp,ms:()=>$p,ne:()=>nm,nl:()=>am,nn:()=>cm,no:()=>dm,ota:()=>mm,pl:()=>bm,ps:()=>_m,pt:()=>Cm,ptBR:()=>Em,ro:()=>km,ru:()=>Nm,sk:()=>Im,sl:()=>zm,sv:()=>Hm,ta:()=>Gm,th:()=>Jm,tk:()=>Zm,tr:()=>eh,ua:()=>oh,uk:()=>rh,ur:()=>ch,uz:()=>dh,vi:()=>mh,yo:()=>Ch,zhCN:()=>_h,zhTW:()=>bh}),Dh=t((()=>{$d(),nf(),sf(),uf(),pf(),gf(),yf(),Sf(),Tf(),Of(),jf(),Pf(),Lf(),Bf(),Uf(),Kf(),Yf(),Qf(),tp(),ip(),sp(),up(),pp(),vp(),xp(),wp(),Dp(),Ap(),Np(),Rp(),Ip(),Vp(),Wp(),Yp(),Qp(),tm(),im(),sm(),um(),pm(),gm(),ym(),Sm(),Tm(),Om(),jm(),Fm(),Rm(),Vm(),Wm(),qm(),Xm(),$m(),nh(),sh(),ah(),uh(),ph(),gh(),yh(),Sh(),Th()}));function Oh(){return new Mh}var kh,Ah,jh,Mh,Nh,Ph=t((()=>{Ah=Symbol(`ZodOutput`),jh=Symbol(`ZodInput`),Mh=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}},(kh=globalThis).__zod_globalRegistry??(kh.__zod_globalRegistry=Oh()),Nh=globalThis.__zod_globalRegistry}));function Fh(e,t){try{return Rh(e,{assertOnly:!0})}catch{return t}}function Ih(e,t){try{let t=Rh(e),n=Ha(e),r=e._zod.run,i=r.__originalRun??r,a=(e,n)=>{if(n?.async||n?.direction===`backward`||n?.skipChecks||n?.[Yg]||n&&Hd(n,e.value))return i(e,n);let r=t(e.value);return r===Jg?(n&&(n[Yg]=!0),i(e,n)):(e.value=r,e)};return a.__originalRun=i,n._zod.bag.fallbackRun=i,n._zod.bag.validator=Fh(e,t),n._zod.run=a,r.__originalRun||Lh(n,e,t),n}catch(n){if(t?.strict)throw n;return e}}function Lh(e,t,n){let r=e,i=t;if(typeof i.safeParse==`function`){let e=i.safeParse;r.safeParse=(t,r)=>{let i=n(t);return i===Jg?e(t,r):{success:!0,data:i}}}if(typeof i.parse==`function`){let e=i.parse;r.parse=(t,r)=>{let i=n(t);return i===Jg?e(t,r):i}}}function Rh(e,t){let n=!0;try{n=zd(e)}catch{}if(n)throw new Zg(`a schema whose subtree contains a reference cycle`);let r={constants:new Map,constantCounter:0,varCounter:0},i=new Ol([`input`]),a=ig(i,r,e,`input`,!t?.assertOnly);i.write(a===null?`return true;`:`return ${a};`);let o=[`INVALID`,...r.constants.keys()],s=[Jg,...r.constants.values()],c=i.content.join(`
|
|
68
|
-
`),l=t?.debug?o.length>0?`// Constants: ${o.join(`, `)}\n${c}`:c:``,u=Function,d=`return (input) => {\n${c}\n}`,f;try{f=new u(...o,d)(...s)}catch(e){throw new Zg(`this schema (generated code failed to evaluate: ${e.message})`)}return t?.debug&&(f.code=l),f}function H(e,t){for(let[n,r]of e.constants)if(r===t)return n;let n=`c${e.constantCounter++}`;return e.constants.set(n,t),n}function U(e){return`v${e.varCounter++}`}function zh(e,t){let n=e._zod.run({value:t,issues:[]},{});if(n&&typeof n.then==`function`)return Jg;let r=n;return r.issues.length===0?r.value:Jg}function Bh(e,t,n,r,i=!0){let a=e.content.length,o=t.constants.size,s=t.constantCounter,c=t.varCounter;try{return ig(e,t,n,r,i)}catch(i){if(!(i instanceof Zg)||!i.islandable)throw i;if(e.content.length=a,t.constants.size>o){let e=Array.from(t.constants.keys()).slice(o);for(let n of e)t.constants.delete(n)}return t.constantCounter=s,t.varCounter=c,Vh(e,t,n,r)}}function Vh(e,t,n,r){let i=H(t,n),a=H(t,zh),o=U(t);return e.write(`const ${o} = ${a}(${i}, ${r});`),e.write(`if (${o} === INVALID) return INVALID;`),o}function Hh(e,t,n,r){let i=n._zod.def.checks;if(!i||i.length===0)return r;let a=r;for(let n of i){let r=n._zod.def;if(r.when&&!Qg.has(r.check))throw new Zg(`check with a custom "when" condition`);switch(r.check){case`greater_than`:Kh(e,t,r,a);break;case`less_than`:qh(e,t,r,a);break;case`multiple_of`:Jh(e,t,r,a);break;case`number_format`:Yh(e,r,a);break;case`min_length`:{let n=Wh(r.minimum,`min_length`),i=Uh(e,t,a,`${a}.length >= ${n} && ${a}.length < ${r.minimum*2}`);e.write(`if (${i} < ${n}) return INVALID;`);break}case`max_length`:{let n=Wh(r.maximum,`max_length`),i=Uh(e,t,a,`${a}.length > ${n}`);e.write(`if (${i} > ${n}) return INVALID;`);break}case`length_equals`:{let n=Wh(r.length,`length_equals`),i=Uh(e,t,a,`${a}.length >= ${n} && ${a}.length <= ${r.length*2}`);e.write(`if (${i} !== ${n}) return INVALID;`);break}case`min_size`:e.write(`if (${a}.size < ${Wh(r.minimum,`min_size`)}) return INVALID;`);break;case`max_size`:e.write(`if (${a}.size > ${Wh(r.maximum,`max_size`)}) return INVALID;`);break;case`size_equals`:e.write(`if (${a}.size !== ${Wh(r.size,`size_equals`)}) return INVALID;`);break;case`string_format`:a=rg(e,t,r,a);break;case`custom`:a=ng(e,t,n,a);break;case`bigint_format`:Xh(e,r,a);break;case`mime_type`:Zh(e,t,r,a);break;case`property`:Qh(e,t,r,a);break;case`overwrite`:{let r=U(t);$h(e,t,n,a,r),a=r;break}default:throw new Zg(`check type ${r.check}`)}}return a}function Uh(e,t,n,r){let i=H(t,ao),a=U(t);return e.write(`const ${a} = typeof ${n} === "string" && ${r} ? ${i}(${n}) : ${n}.length;`),a}function Wh(e,t){if(typeof e!=`number`||!Number.isFinite(e))throw new Zg(`${t} bound of type ${typeof e}`);return`${e}`}function Gh(e,t){if(typeof t==`bigint`)return`${t}n`;if(typeof t==`number`){if(Number.isNaN(t))throw new Zg(`comparison check with NaN bound`);return`${t}`}if(t instanceof Date){if(Number.isNaN(t.getTime()))throw new Zg(`comparison check with Invalid Date bound`);return H(e,t)}throw new Zg(`comparison check bound of type ${typeof t}`)}function Kh(e,t,n,r){let i=n.inclusive?`<`:`<=`;e.write(`if (${r} ${i} ${Gh(t,n.value)}) return INVALID;`)}function qh(e,t,n,r){let i=n.inclusive?`>`:`>=`;e.write(`if (${r} ${i} ${Gh(t,n.value)}) return INVALID;`)}function Jh(e,t,n,r){if(typeof n.value==`bigint`){if(n.value===BigInt(0))throw new Zg(`multiple_of check with a zero divisor`);e.write(`if (${r} % ${n.value}n !== 0n) return INVALID;`)}else{let i=H(t,Ea);e.write(`if (${i}(${r}, ${Wh(n.value,`multiple_of`)}) !== 0) return INVALID;`)}}function Yh(e,t,n){let r=t.format;switch(r){case`safeint`:e.write(`if (!Number.isSafeInteger(${n})) return INVALID;`);break;case`int32`:e.write(`if (!Number.isInteger(${n}) || ${n} < -2147483648 || ${n} > 2147483647) return INVALID;`);break;case`uint32`:e.write(`if (!Number.isInteger(${n}) || ${n} < 0 || ${n} > 4294967295) return INVALID;`);break;case`float32`:e.write(`if (!Number.isFinite(${n}) || ${n} < -3.4028234663852886e38 || ${n} > 3.4028234663852886e38) return INVALID;`);break;case`float64`:e.write(`if (!Number.isFinite(${n})) return INVALID;`);break;default:throw new Zg(`number format ${r}`)}}function Xh(e,t,n){let r=t.format;if(r)switch(r){case`int64`:e.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case`uint64`:e.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`);break;default:throw new Zg(`bigint format ${r}`)}}function Zh(e,t,n,r){let i=n.mime;if(i&&i.length>0){let n=H(t,new Set(i));e.write(`if (!${n}.has(${r}.type)) return INVALID;`)}}function Qh(e,t,n,r){let i=`${r}[${JSON.stringify(n.property)}]`;ig(e,t,n.schema,i)}function $h(e,t,n,r,i){let a=n._zod.def.tx;if(!a)throw new Zg(`overwrite check without a transform function`);if(Ug(a))throw new Xg(`z.compile: async overwrite transforms are not supported`);let o=H(t,a);e.write(`const ${i} = ${o}(${r});`)}function eg(){throw new Uo}function tg(e){this.issues.push(e)}function ng(e,t,n,r){let i=n._zod.def;if(i.fn){if(Ug(i.fn))throw new Xg(`z.compile: async .refine() predicates are not supported`);let n=H(t,i.fn),a=H(t,eg),o=U(t);return e.write(`const ${o} = ${n}(${r});`),e.write(`if (${o} instanceof Promise) ${a}();`),e.write(`if (!${o}) return INVALID;`),r}if(n._zod.check){if(Ug(n._zod.check))throw new Xg(`z.compile: async .superRefine() / check functions are not supported`);let i=n._zod.check,a=H(t,e=>{let t={value:e,issues:[],addIssue:tg};return i(t)instanceof Promise&&eg(),t.issues.length===0?t.value:Jg}),o=U(t);return e.write(`const ${o} = ${a}(${r});`),e.write(`if (${o} === INVALID) return INVALID;`),o}throw new Zg(`custom check without a predicate or check function`)}function rg(e,t,n,r){let i=n.format;if(i===`base64`){let n=H(t,zl);return e.write(`if (!${n}(${r})) return INVALID;`),r}if(i===`base64url`){let n=H(t,Bl);return e.write(`if (!${n}(${r})) return INVALID;`),r}if(i===`jwt`){let i=H(t,Ul),a=H(t,n.alg??null);return e.write(`if (!${i}(${r}, ${a})) return INVALID;`),r}if(i===`ipv6`){let n=H(t,Ll);return e.write(`if (!${n}(${r})) return INVALID;`),r}if(i===`cidrv6`){let n=H(t,Rl);return e.write(`if (!${n}(${r})) return INVALID;`),r}if(i===`credit_card`){let n=H(t,Hl);return e.write(`if (!${n}(${r})) return INVALID;`),r}let a=n;if(i===`url`||i===`httpurl`||a.normalize||a.hostname!==void 0||a.protocol!==void 0){let i=H(t,Nl),o=H(t,n),s=U(t),c=U(t);if(e.write(`const ${s} = ${r}.trim();`),e.write(`const ${c} = ${i}(${s}, ${o});`),e.write(`if (typeof ${c} === "number") return INVALID;`),a.hostname!==void 0){let n=H(t,Fl);e.write(`if (!${n}(${c}, ${o}.hostname)) return INVALID;`)}if(a.protocol!==void 0){let n=H(t,Il);e.write(`if (!${n}(${c}, ${o}.protocol)) return INVALID;`)}let l=U(t),u=a.normalize?`${c}.href`:`${H(t,Pl)}(${s})`;return e.write(`const ${l} = ${u};`),l}let o=n.fn;if(o){if(Ug(o))throw new Zg(`async string format ${i}`);let n=H(t,o);return e.write(`if (!${n}(${r})) return INVALID;`),r}if($g.has(i)&&n.pattern){let i=H(t,n.pattern);return e.write(`${i}.lastIndex = 0;`),e.write(`if (!${i}.test(${r})) return INVALID;`),r}let s=n.format;switch(s){case`regex`:throw new Zg(`regex format without a pattern`);case`lowercase`:e.write(`if (${r} !== ${r}.toLowerCase()) return INVALID;`);break;case`uppercase`:e.write(`if (${r} !== ${r}.toUpperCase()) return INVALID;`);break;case`includes`:e.write(`if (!${r}.includes(${Fa(n.includes)})) return INVALID;`);break;case`starts_with`:{let t=n.prefix;e.write(`if (${r}.slice(0, ${t.length}) !== ${Fa(t)}) return INVALID;`);break}case`ends_with`:{let t=n.suffix;e.write(`if (${r}.slice(-${t.length}) !== ${Fa(t)}) return INVALID;`);break}default:throw new Zg(`string format ${s}`)}return r}function ig(e,t,n,r,i=!0){let a=n._zod.def,o=a.type;if(a.coerce)throw new Zg(`coercion (z.coerce.${o}())`);let s=i||!!a.checks?.length,c;switch(o){case`string`:c=ag(e,t,n,r);break;case`number`:c=og(e,n,r);break;case`boolean`:c=sg(e,r);break;case`bigint`:c=cg(e,n,r);break;case`symbol`:c=lg(e,r);break;case`undefined`:c=ug(e,r);break;case`null`:c=dg(e,r);break;case`any`:case`unknown`:c=r;break;case`never`:e.write(`return INVALID;`),c=r;break;case`void`:c=fg(e,r);break;case`nan`:c=pg(e,r);break;case`date`:c=mg(e,r);break;case`object`:c=hg(e,t,n,r,s);break;case`optional`:c=gg(e,t,n,r,s);break;case`nullable`:c=Sg(e,t,n,r,s);break;case`array`:c=Cg(e,t,n,r,s);break;case`literal`:c=wg(e,t,n,r);break;case`enum`:c=Tg(e,t,n,r);break;case`readonly`:{let i=Eg(e,t,n,r),a=U(t);e.write(`const ${a} = Object.freeze(${i});`),c=a;break}case`success`:Eg(e,t,n,r),c=`true`;break;case`default`:case`prefault`:c=Dg(e,t,n,r);break;case`nonoptional`:c=Og(e,t,n,r);break;case`tuple`:c=kg(e,t,n,r);break;case`union`:c=jg(e,t,n,r);break;case`intersection`:c=Pg(e,t,n,r);break;case`record`:c=Fg(e,t,n,r);break;case`map`:c=Lg(e,t,n,r);break;case`set`:c=Rg(e,t,n,r);break;case`file`:c=zg(e,r);break;case`template_literal`:c=Bg(e,t,n,r);break;case`lazy`:c=Vg(e,t,n,r);break;case`pipe`:c=Hg(e,t,n,r);break;case`custom`:c=Wg(e,t,n,r);break;case`transform`:c=qg(e,t,n,r);break;case`catch`:c=Kg(e,t,n,r);break;default:throw new Zg(`schema type ${o}`)}return c===null?null:Hh(e,t,n,c)}function ag(e,t,n,r){e.write(`if (typeof ${r} !== "string") return INVALID;`);let i=n._zod.def;return i.format===void 0?r:rg(e,t,i,r)}function og(e,t,n){e.write(`if (typeof ${n} !== "number" || !Number.isFinite(${n})) return INVALID;`);let r=t._zod.def;return r.check===`number_format`&&r.format&&Yh(e,{format:r.format},n),n}function sg(e,t){return e.write(`if (typeof ${t} !== "boolean") return INVALID;`),t}function cg(e,t,n){e.write(`if (typeof ${n} !== "bigint") return INVALID;`);let r=t._zod.def;if(r.format)switch(r.format){case`int64`:e.write(`if (${n} < -9223372036854775808n || ${n} > 9223372036854775807n) return INVALID;`);break;case`uint64`:e.write(`if (${n} < 0n || ${n} > 18446744073709551615n) return INVALID;`)}return n}function lg(e,t){return e.write(`if (typeof ${t} !== "symbol") return INVALID;`),t}function ug(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function dg(e,t){return e.write(`if (${t} !== null) return INVALID;`),t}function fg(e,t){return e.write(`if (${t} !== undefined) return INVALID;`),t}function pg(e,t){return e.write(`if (typeof ${t} !== "number" || !Number.isNaN(${t})) return INVALID;`),t}function mg(e,t){return e.write(`if (!(${t} instanceof Date) || Number.isNaN(${t}.getTime())) return INVALID;`),t}function hg(e,t,n,r,i=!0){let a=n._zod.def;e.write(`if (typeof ${r} !== "object" || ${r} === null || Array.isArray(${r})) return INVALID;`);let o=a.shape,s=Object.keys(o),c=Object.getOwnPropertySymbols(o),l=c.length?[...s,...c]:s,u=e=>typeof e==`symbol`?H(t,e):Fa(e),d=e=>typeof e==`symbol`?`[${u(e)}]`:Fa(e),f=o;if(s.includes(`__proto__`))throw new Zg(`object shape key "__proto__"`);let p=new Map;for(let n of l){let a=f[n],o=u(n),s=U(t);if(e.write(`const ${s} = ${r}[${o}];`),a._zod.optin!==void 0){let i=U(t);e.write(`let ${i} = (() => {`),e.indented(e=>{let n=Bh(e,t,a,s);e.write(`return ${n};`)}),e.write(`})();`),a._zod.optout===`optional`?(e.write(`if (${i} === INVALID) {`),e.indented(e=>{e.write(`if (${o} in ${r}) return INVALID;`),e.write(`${i} = undefined;`)}),e.write(`}`)):e.write(`if (${i} === INVALID) return INVALID;`),p.set(n,i)}else{vg(a)&&e.write(`if (!(${o} in ${r})) return INVALID;`);let c=Bh(e,t,a,s,i);c!==null&&p.set(n,c)}}let m=a.catchall,h=`none`;if(m){let t=m._zod.def.type;if(t===`never`){let t=s.map(e=>`k !== ${Fa(e)}`).join(` && `)||`true`;e.write(`for (const k in ${r}) {`),e.indented(e=>{e.write(`if (${t}) return INVALID;`)}),e.write(`}`)}else h=(t===`unknown`||t===`any`)&&!m._zod.def.checks?.length?`passthrough`:`schema`}let g=U(t),_=l.some(e=>xg(f[e])||bg(f[e]));if(!i){if(h===`schema`){let n=s.length>0?H(t,new Set(s)):null;e.write(`for (const k in ${r}) {`),e.indented(e=>{e.write(`if (k === "__proto__") continue;`),n&&e.write(`if (${n}.has(k)) continue;`);let i=U(t);e.write(`const ${i} = ${r}[k];`),Bh(e,t,m,i,!1)}),e.write(`}`)}return null}if(_){e.write(`const ${g} = {};`);for(let t of l){let n=u(t),i=p.get(t);bg(f[t])?e.write(`if (${n} in ${r}) ${g}[${n}] = ${i};`):xg(f[t])?e.write(`if (${i} !== undefined || ${n} in ${r}) ${g}[${n}] = ${i};`):e.write(`${g}[${n}] = ${i};`)}}else{let t=l.map(e=>`${d(e)}: ${p.get(e)}`).join(`, `);e.write(`const ${g} = { ${t} };`)}if(h!==`none`){let n=s.length>0?H(t,new Set(s)):null;e.write(`for (const k in ${r}) {`),e.indented(e=>{if(e.write(`if (k === "__proto__") continue;`),n&&e.write(`if (${n}.has(k)) continue;`),h===`passthrough`)e.write(`${g}[k] = ${r}[k];`);else{let n=U(t);e.write(`const ${n} = ${r}[k];`);let i=Bh(e,t,m,n);e.write(`${g}[k] = ${i};`)}}),e.write(`}`)}return g}function gg(e,t,n,r,i=!0){let a=n._zod.def;if(_g(n))return ig(e,t,a.innerType,r,i);if(a.innerType._zod.optin===`defaulted`){let n=U(t),i=U(t);return e.write(`let ${n};`),e.write(`if (${r} === undefined) {`),e.indented(e=>{e.write(`const ${i} = (() => {`),e.indented(e=>{let n=ig(e,t,a.innerType,r);e.write(`return ${n};`)}),e.write(`})();`),e.write(`if (${i} !== INVALID) ${n} = ${i};`)}),e.write(`} else {`),e.indented(e=>{let i=ig(e,t,a.innerType,r);e.write(`${n} = ${i};`)}),e.write(`}`),n}let o=i?U(t):null;return o&&e.write(`let ${o};`),e.write(`if (${r} !== undefined) {`),e.indented(e=>{let n=ig(e,t,a.innerType,r,i);o&&n!==null&&e.write(`${o} = ${n};`)}),e.write(`}`),o}function _g(e){return e._zod.traits?.has(`$ZodExactOptional`)===!0}function vg(e){return e._zod.optin===void 0&&yg(e)}function yg(e){if(e._zod.def.coerce)return!0;let t=e._zod.def;switch(t.type){case`any`:case`unknown`:case`undefined`:case`void`:case`default`:case`prefault`:case`transform`:case`custom`:case`lazy`:return!0;case`string`:case`number`:case`boolean`:case`bigint`:case`symbol`:case`null`:case`never`:case`nan`:case`date`:case`object`:case`array`:case`tuple`:case`record`:case`map`:case`set`:case`file`:case`template_literal`:return!1;case`nonoptional`:return t.innerType?yg(t.innerType):!1;case`literal`:return!!t.values?.includes(void 0);case`enum`:return!!e._zod.values?.has(void 0);case`optional`:case`nullable`:case`readonly`:case`success`:return!t.innerType||yg(t.innerType);case`catch`:return!0;case`union`:return!t.options||t.options.some(yg);case`intersection`:return!t.left||!t.right||yg(t.left)&&yg(t.right);case`pipe`:return!t.in||yg(t.in);default:return!0}}function bg(e){return e._zod.optin===`optional`&&e._zod.optout===`optional`}function xg(e){let t=e._zod.def;switch(t.type){case`string`:case`number`:case`boolean`:case`bigint`:case`symbol`:case`null`:case`nan`:case`date`:case`object`:case`array`:case`tuple`:case`record`:case`map`:case`set`:case`file`:case`template_literal`:case`never`:case`success`:return!1;case`literal`:return!!t.values?.includes(void 0);case`enum`:return!!e._zod.values?.has(void 0);case`optional`:return!0;case`nullable`:case`readonly`:case`nonoptional`:return!t.innerType||xg(t.innerType);case`union`:return!t.options||t.options.some(xg);case`intersection`:return!t.left||!t.right||xg(t.left)||xg(t.right);case`pipe`:return!t.out||xg(t.out);default:return!0}}function Sg(e,t,n,r,i=!0){let a=n._zod.def,o=i?U(t):null;return o&&e.write(`let ${o} = null;`),e.write(`if (${r} !== null) {`),e.indented(e=>{let n=ig(e,t,a.innerType,r,i);o&&n!==null&&e.write(`${o} = ${n};`)}),e.write(`}`),o}function Cg(e,t,n,r,i=!0){let a=n._zod.def;e.write(`if (!Array.isArray(${r})) return INVALID;`);let o=i?U(t):null,s=U(t),c=U(t);return o&&e.write(`const ${o} = new Array(${r}.length);`),e.write(`for (let ${s} = 0; ${s} < ${r}.length; ${s}++) {`),e.indented(e=>{e.write(`const ${c} = ${r}[${s}];`);let n=Bh(e,t,a.element,c,i);o&&n!==null&&e.write(`${o}[${s}] = ${n};`)}),e.write(`}`),o}function wg(e,t,n,r){let i=n._zod.def.values;if(i.length!==1){let n=H(t,new Set(i));return e.write(`if (!${n}.has(${r})) return INVALID;`),r}let a=i[0];if(typeof a==`number`&&Number.isNaN(a)){let n=H(t,new Set(i));return e.write(`if (!${n}.has(${r})) return INVALID;`),r}if(typeof a==`string`)e.write(`if (${r} !== ${Fa(a)}) return INVALID;`);else if(typeof a==`number`||typeof a==`boolean`)e.write(`if (${r} !== ${a}) return INVALID;`);else if(a===null)e.write(`if (${r} !== null) return INVALID;`);else if(a===void 0)e.write(`if (${r} !== undefined) return INVALID;`);else if(typeof a==`bigint`)e.write(`if (${r} !== ${a}n) return INVALID;`);else throw new Zg(`literal type ${typeof a}`);return r}function Tg(e,t,n,r){let i=n._zod.values;if(!i)throw new Zg(`enum schema without enumerated values`);let a=H(t,i);return e.write(`if (!${a}.has(${r})) return INVALID;`),r}function Eg(e,t,n,r){let i=n._zod.def;return ig(e,t,i.innerType,r)}function Dg(e,t,n,r){let i=n._zod.def,a=Object.getOwnPropertyDescriptor(n._zod.def,`defaultValue`)?()=>n._zod.def.defaultValue:void 0;if(n._zod.def.type===`prefault`){if(!a)return ig(e,t,i.innerType,r);let n=H(t,a),o=U(t);return e.write(`let ${o} = ${r};`),e.write(`if (${r} === undefined) ${o} = ${n}();`),ig(e,t,i.innerType,o)}let o=U(t);if(a){let n=H(t,a),s=H(t,za);e.write(`let ${o};`),e.write(`if (${r} === undefined) {`),e.indented(e=>{e.write(`${o} = ${s}(${n}());`)}),e.write(`} else {`),e.indented(e=>{let a=ig(e,t,i.innerType,r);e.write(`${o} = ${a} === undefined ? ${s}(${n}()) : ${a};`)}),e.write(`}`)}else e.write(`let ${o};`),e.write(`if (${r} !== undefined) {`),e.indented(e=>{let n=ig(e,t,i.innerType,r);e.write(`${o} = ${n};`)}),e.write(`}`);return o}function Og(e,t,n,r){let i=n._zod.def,a=ig(e,t,i.innerType,r),o=U(t);return e.write(`const ${o} = ${a};`),e.write(`if (${o} === undefined) return INVALID;`),o}function kg(e,t,n,r){let i=n._zod.def,a=i.items,o=i.rest;e.write(`if (!Array.isArray(${r})) return INVALID;`);let s=Ag(a,`optin`),c=Ag(a,`optout`);o?e.write(`if (${r}.length < ${s}) return INVALID;`):e.write(`if (${r}.length < ${s} || ${r}.length > ${a.length}) return INVALID;`);let l=U(t);e.write(`const ${l} = [];`);for(let n=0;n<a.length;n++){let i=a[n];if(n>=c)e.write(`if (${l}.length === ${n}) {`),e.indented(e=>{e.write(`if (${n} < ${r}.length) {`),e.indented(e=>{let a=U(t);e.write(`const ${a} = ${r}[${n}];`);let o=Bh(e,t,i,a);e.write(`${l}[${n}] = ${o};`)}),e.write(`} else {`),e.indented(e=>{if(bg(i)){e.write(`${l}.length = ${n};`);return}let r=U(t),a=U(t);e.write(`const ${r} = undefined;`),e.write(`const ${a} = (() => {`),e.indented(e=>{let n=Bh(e,t,i,r);e.write(`return ${n};`)}),e.write(`})();`),e.write(`if (${a} === INVALID || ${a} === undefined) ${l}.length = ${n};`),e.write(`else ${l}[${n}] = ${a};`)}),e.write(`}`)}),e.write(`}`);else{let a=U(t);e.write(`const ${a} = ${r}[${n}];`);let o=Bh(e,t,i,a);e.write(`${l}[${n}] = ${o};`)}}if(o){let n=U(t),i=U(t);e.write(`for (let ${n} = ${a.length}; ${n} < ${r}.length; ${n}++) {`),e.indented(e=>{e.write(`const ${i} = ${r}[${n}];`);let a=Bh(e,t,o,i);e.write(`${l}[${n}] = ${a};`)}),e.write(`}`)}return l}function Ag(e,t){for(let n=e.length-1;n>=0;n--)if(!(t===`optin`?e[n]._zod.optin!==void 0:e[n]._zod.optout===`optional`))return n+1;return 0}function jg(e,t,n,r){let i=n._zod.def,a=i.options;if(i.discriminator)return Mg(e,t,i,r);if(i.inclusive===!1)throw new Zg(`exclusive unions (z.xor)`);if(a.length===0)return e.write(`return INVALID;`),r;if(a.length===1)return ig(e,t,a[0],r);if(a.every(e=>e._zod.def.type===`literal`&&!e._zod.def.checks?.length)){let n=H(t,new Set(a.flatMap(e=>e._zod.def.values)));return e.write(`if (!${n}.has(${r})) return INVALID;`),r}let o=U(t);e.write(`let ${o};`);for(let n=0;n<a.length;n++){let i=a[n];n===0?e.write(`${o} = (() => {`):e.write(`if (${o} === INVALID) ${o} = (() => {`),e.indented(e=>{let n=ig(e,t,i,r);e.write(`return ${n};`)}),e.write(`})();`)}return e.write(`if (${o} === INVALID) return INVALID;`),o}function Mg(e,t,n,r){if(n.unionFallback)throw new Zg(`discriminated union with unionFallback`);if(n.options.length===0)return e.write(`return INVALID;`),r;let i=U(t),a=U(t);e.write(`const ${i} = ${r}?.[${Fa(n.discriminator)}];`),e.write(`let ${a};`);let o=!0,s=new Set;for(let c of n.options){let l=c._zod.propValues?.[n.discriminator];if(!l||l.size===0)throw new Zg(`discriminated union option without static discriminator values`);for(let e of l){if(s.has(e))throw new Zg(`duplicate discriminator value ${String(e)}`);s.add(e)}let u=Array.from(l,e=>Ng(t,i,e)),d=o?`if`:`else if`;e.write(`${d} (${u.join(` || `)}) {`),e.indented(e=>{let n=ig(e,t,c,r);e.write(`${a} = ${n};`)}),e.write(`}`),o=!1}return e.write(`else { return INVALID; }`),a}function Ng(e,t,n){if(typeof n==`string`)return`${t} === ${Fa(n)}`;if(typeof n==`number`)return Number.isNaN(n)?`Number.isNaN(${t})`:`${t} === ${n}`;if(typeof n==`boolean`)return`${t} === ${n}`;if(n===null)return`${t} === null`;if(n===void 0)return`${t} === undefined`;if(typeof n==`bigint`)return`${t} === ${n}n`;if(typeof n==`symbol`)return`${t} === ${H(e,n)}`;throw new Zg(`literal discriminator value ${String(n)}`)}function Pg(e,t,n,r){let i=n._zod.def,a=Bh(e,t,i.left,r),o=Bh(e,t,i.right,r),s=H(t,Yl),c=U(t);return e.write(`const ${c} = ${s}(${a}, ${o});`),e.write(`if (!${c}.valid) return INVALID;`),`${c}.data`}function Fg(e,t,n,r){let i=n._zod.def,a=H(t,Ra);e.write(`if (!${a}(${r})) return INVALID;`);let o=U(t),s=U(t),c=U(t);e.write(`const ${o} = {};`);let l=i,u=l.partial?void 0:i.keyType._zod.values;if(u){let n=[];for(let a of u){if(typeof a!=`string`&&typeof a!=`number`&&typeof a!=`symbol`)throw new Zg(`record key value ${String(a)}`);let s=typeof a==`number`?a.toString():a;if(s===`__proto__`)throw new Zg(`record key "__proto__"`);n.push(s);let c=H(t,a),l=ig(e,t,i.keyType,c),u=U(t);e.write(`const ${u} = ${r}[${Ig(t,s)}];`);let d=Bh(e,t,i.valueType,u);e.write(`${o}[${l}] = ${d};`)}let a=H(t,new Set(n));return e.write(`for (const ${s} in ${r}) {`),e.indented(e=>{e.write(`if (${a}.has(${s})) continue;`),l.mode===`loose`?e.write(`if (${s} !== "__proto__") ${o}[${s}] = ${r}[${s}];`):e.write(`return INVALID;`)}),e.write(`}`),o}let d=i.keyType._zod.def;if(d.type!==`string`||d.format!==void 0||d.coerce||(d.checks?.length??0)!==0){let n=i.mode===`loose`,a=H(t,Rh(i.keyType)),c=H(t,Mc),l=H(t,Object.prototype.propertyIsEnumerable),u=U(t);return e.write(`for (const ${s} of Reflect.ownKeys(${r})) {`),e.indented(e=>{e.write(`if (${s} === "__proto__") continue;`),e.write(`if (!${l}.call(${r}, ${s})) continue;`),e.write(`let ${u} = ${a}(${s});`),e.write(`if (${u} === INVALID && typeof ${s} === "string" && ${c}.test(${s})) ${u} = ${a}(Number(${s}));`),n?e.write(`if (${u} === INVALID) { ${o}[${s}] = ${r}[${s}]; continue; }`):e.write(`if (${u} === INVALID) return INVALID;`),e.write(`if (${u} === "__proto__") continue;`);let d=U(t);e.write(`const ${d} = ${r}[${s}];`);let f=Bh(e,t,i.valueType,d);e.write(`${o}[${u}] = ${f};`)}),e.write(`}`),o}let f=H(t,Object.prototype.propertyIsEnumerable);return e.write(`for (const ${s} of Reflect.ownKeys(${r})) {`),e.indented(e=>{e.write(`if (${s} === "__proto__") continue;`),e.write(`if (!${f}.call(${r}, ${s})) continue;`),e.write(`if (typeof ${s} !== "string") return INVALID;`),e.write(`const ${c} = ${r}[${s}];`);let n=Bh(e,t,i.valueType,c);e.write(`${o}[${s}] = ${n};`)}),e.write(`}`),o}function Ig(e,t){return typeof t==`string`?Fa(t):H(e,t)}function Lg(e,t,n,r){let i=n._zod.def;e.write(`if (!(${r} instanceof Map)) return INVALID;`);let a=U(t),o=U(t),s=U(t);return e.write(`const ${a} = new Map();`),e.write(`for (const [${o}, ${s}] of ${r}) {`),e.indented(e=>{let n=ig(e,t,i.keyType,o),r=ig(e,t,i.valueType,s);e.write(`${a}.set(${n}, ${r});`)}),e.write(`}`),a}function Rg(e,t,n,r){let i=n._zod.def;e.write(`if (!(${r} instanceof Set)) return INVALID;`);let a=U(t),o=U(t);return e.write(`const ${a} = new Set();`),e.write(`for (const ${o} of ${r}) {`),e.indented(e=>{let n=ig(e,t,i.valueType,o);e.write(`${a}.add(${n});`)}),e.write(`}`),a}function zg(e,t){return e.write(`if (!(${t} instanceof File)) return INVALID;`),t}function Bg(e,t,n,r){e.write(`if (typeof ${r} !== "string") return INVALID;`);let i=n._zod.pattern;if(i){let n=H(t,i);e.write(`${n}.lastIndex = 0;`),e.write(`if (!${n}.test(${r})) return INVALID;`)}return r}function Vg(e,t,n,r){let i=n._zod.def,a=H(t,i.getter),o=H(t,{parser:null});e.write(`if (!${o}.parser) {`),e.indented(e=>{e.write(`const inner = ${a}();`),e.write(`${o}.parser = function(input) {`),e.indented(e=>{e.write(`const result = inner._zod.run({ value: input, issues: [] }, {});`),e.write(`return result.issues.length === 0 ? result.value : INVALID;`)}),e.write(`};`)}),e.write(`}`);let s=U(t);return e.write(`const ${s} = ${o}.parser(${r});`),e.write(`if (${s} === INVALID) return INVALID;`),s}function Hg(e,t,n,r){let i=n._zod.def,a=ig(e,t,i.in,r);if(i.transform){if(Ug(i.transform))throw new Xg(`z.compile: async transforms in pipes are not supported`);let n=i.transform,r=H(t,e=>{let t={value:e,issues:[],addIssue:tg},r=n(e,t);return r instanceof Promise?Jg:t.issues.length===0?r:Jg}),o=U(t);return e.write(`const ${o} = ${r}(${a});`),e.write(`if (${o} === INVALID) return INVALID;`),ig(e,t,i.out,o)}return ig(e,t,i.out,a)}function Ug(e){return typeof e==`function`&&(e.constructor.name===`AsyncFunction`||e[Symbol.toStringTag]===`AsyncFunction`)}function Wg(e,t,n,r){let i=n._zod.def;if(i.fn){if(Ug(i.fn))throw new Xg(`z.compile: async custom predicates are not supported`);let n=H(t,i.fn),a=H(t,eg),o=U(t);e.write(`const ${o} = ${n}(${r});`),e.write(`if (${o} instanceof Promise) ${a}();`),e.write(`if (!${o}) return INVALID;`)}else throw new Zg(`custom schema without a predicate function`);return r}function Gg(e,t,n){let r=e._zod.run({value:n,issues:[]},{});if(r&&typeof r.then==`function`)return Jg;let i=r;return i.issues.length===0?i.value:t()}function Kg(e,t,n,r){let i=n._zod.def;if(!i.catchValue[`~constantCatch`])throw new Zg(`catch with a callback (only a constant catch value compiles)`,!1);let a=U(t);e.write(`let ${a} = (() => {`),e.indented(e=>{let n=Bh(e,t,i.innerType,r);e.write(`return ${n};`)}),e.write(`})();`);let o=H(t,i.innerType),s=H(t,i.catchValue),c=H(t,Gg);return e.write(`if (${a} === INVALID) {`),e.indented(e=>{e.write(`${a} = ${c}(${o}, ${s}, ${r});`),e.write(`if (${a} === INVALID) return INVALID;`)}),e.write(`}`),a}function qg(e,t,n,r){let i=n._zod.def;if(i.transform){if(Ug(i.transform))throw new Xg(`z.compile: async transforms are not supported`);let n=i.transform,a=H(t,e=>{let t={value:e,issues:[],addIssue:tg},r=n(e,t);return r instanceof Promise?Jg:t.issues.length===0?r:Jg}),o=U(t);return e.write(`const ${o} = ${a}(${r});`),e.write(`if (${o} === INVALID) return INVALID;`),o}return r}var Jg,Yg,Xg,Zg,Qg,$g,e_=t((()=>{Ko(),kl(),Xd(),el(),Id(),I(),Jg=Symbol.for(`zod.compile.invalid`),Yg=Symbol.for(`zod.compile.fallback`),Xg=class extends Error{constructor(e=`z.compile does not support async refinements, transforms, or checks`){super(e),this.name=`ZodCompileAsyncError`}},Zg=class extends Error{constructor(e,t=!0){super(`z.compile does not support ${e}; this schema must use the runtime parser`),this.name=`ZodCompileUnsupportedError`,this.islandable=t}},Qg=new Set([`max_size`,`min_size`,`size_equals`,`max_length`,`min_length`,`length_equals`]),$g=new Set([`cidrv4`,`cuid`,`cuid2`,`date`,`datetime`,`duration`,`e164`,`email`,`emoji`,`ends_with`,`guid`,`includes`,`ipv4`,`ksuid`,`lowercase`,`mac`,`nanoid`,`regex`,`starts_with`,`time`,`ulid`,`uppercase`,`uuid`,`xid`])}));function t_(e,t){return new e({type:`string`,...j(t)})}function n_(e,t){return new e({type:`string`,coerce:!0,...j(t)})}function r_(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...j(t)})}function i_(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...j(t)})}function a_(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...j(t)})}function o_(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...j(t)})}function s_(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...j(t)})}function c_(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...j(t)})}function l_(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...j(t)})}function u_(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...j(t)})}function d_(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...j(t)})}function f_(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...j(t)})}function p_(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...j(t)})}function m_(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...j(t)})}function h_(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...j(t)})}function g_(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...j(t)})}function __(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...j(t)})}function v_(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...j(t)})}function y_(e,t){return new e({type:`string`,format:`mac`,check:`string_format`,abort:!1,...j(t)})}function b_(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...j(t)})}function x_(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...j(t)})}function S_(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...j(t)})}function C_(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...j(t)})}function w_(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...j(t)})}function T_(e,t){return new e({type:`string`,format:`credit_card`,check:`string_format`,abort:!1,...j(t)})}function E_(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...j(t)})}function D_(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...j(t)})}function O_(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...j(t)})}function k_(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...j(t)})}function A_(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...j(t)})}function j_(e,t){return new e({type:`number`,checks:[],...j(t)})}function M_(e,t){return new e({type:`number`,coerce:!0,checks:[],...j(t)})}function N_(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...j(t)})}function P_(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`float32`,...j(t)})}function F_(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`float64`,...j(t)})}function I_(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`int32`,...j(t)})}function L_(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`uint32`,...j(t)})}function R_(e,t){return new e({type:`boolean`,...j(t)})}function z_(e,t){return new e({type:`boolean`,coerce:!0,...j(t)})}function B_(e,t){return new e({type:`bigint`,...j(t)})}function V_(e,t){return new e({type:`bigint`,coerce:!0,...j(t)})}function H_(e,t){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`int64`,...j(t)})}function U_(e,t){return new e({type:`bigint`,check:`bigint_format`,abort:!1,format:`uint64`,...j(t)})}function W_(e,t){return new e({type:`symbol`,...j(t)})}function G_(e,t){return new e({type:`undefined`,...j(t)})}function K_(e,t){return new e({type:`null`,...j(t)})}function q_(e){return new e({type:`any`})}function J_(e){return new e({type:`unknown`})}function Y_(e,t){return new e({type:`never`,...j(t)})}function X_(e,t){return new e({type:`void`,...j(t)})}function Z_(e,t){return new e({type:`date`,...j(t)})}function Q_(e,t){return new e({type:`date`,coerce:!0,...j(t)})}function $_(e,t){return new e({type:`nan`,...j(t)})}function ev(e,t){return new ol({check:`less_than`,...j(t),value:e,inclusive:!1})}function tv(e,t){return new ol({check:`less_than`,...j(t),value:e,inclusive:!0})}function nv(e,t){return new sl({check:`greater_than`,...j(t),value:e,inclusive:!1})}function rv(e,t){return new sl({check:`greater_than`,...j(t),value:e,inclusive:!0})}function iv(e){return nv(0,e)}function av(e){return ev(0,e)}function ov(e){return tv(0,e)}function sv(e){return rv(0,e)}function cv(e,t){return new cl({check:`multiple_of`,...j(t),value:e})}function lv(e,t){return new dl({check:`max_size`,...j(t),maximum:e})}function uv(e,t){return new fl({check:`min_size`,...j(t),minimum:e})}function dv(e,t){return new pl({check:`size_equals`,...j(t),size:e})}function fv(e,t){return new ml({check:`max_length`,...j(t),maximum:e})}function pv(e,t){return new hl({check:`min_length`,...j(t),minimum:e})}function mv(e,t){return new gl({check:`length_equals`,...j(t),length:e})}function hv(e,t){return new vl({check:`string_format`,format:`regex`,...j(t),pattern:e})}function gv(e){return new yl({check:`string_format`,format:`lowercase`,...j(e)})}function _v(e){return new bl({check:`string_format`,format:`uppercase`,...j(e)})}function vv(e,t){return new xl({check:`string_format`,format:`includes`,...j(t),includes:e})}function yv(e,t){return new Sl({check:`string_format`,format:`starts_with`,...j(t),prefix:e})}function bv(e,t){return new Cl({check:`string_format`,format:`ends_with`,...j(t),suffix:e})}function xv(e,t,n){return new wl({check:`property`,property:e,schema:t,...j(n)})}function Sv(e){return Object.entries(e).map(([e,t])=>new wl({check:`property`,property:e,schema:t}))}function Cv(e,t){return new Tl({check:`mime_type`,mime:e,...j(t)})}function wv(e){return new El({check:`overwrite`,tx:e})}function Tv(e){return wv(t=>t.normalize(e))}function Ev(){return wv(e=>e.trim())}function Dv(){return wv(e=>e.toLowerCase())}function Ov(){return wv(e=>e.toUpperCase())}function kv(){return wv(e=>Ia(e))}function Av(e,t,n){return new e({type:`array`,element:t,...j(n)})}function jv(e,t,n){return new e({type:`union`,options:t,...j(n)})}function Mv(e,t,n){return new e({type:`union`,options:t,inclusive:!1,...j(n)})}function Nv(e,t,n,r){return new e({type:`union`,options:n,discriminator:t,...j(r)})}function Pv(e,t,n){return new e({type:`intersection`,left:t,right:n})}function Fv(e,t,n,r){let i=n instanceof B;return new e({type:`tuple`,items:t,rest:i?n:null,...j(i?r:n)})}function Iv(e,t,n,r){return new e({type:`record`,keyType:t,valueType:n,...j(r)})}function Lv(e,t,n,r){return new e({type:`map`,keyType:t,valueType:n,...j(r)})}function Rv(e,t,n){return new e({type:`set`,valueType:t,...j(n)})}function zv(e,t,n){return new e({type:`enum`,entries:Array.isArray(t)?Object.fromEntries(t.map(e=>[e,e])):t,...j(n)})}function Bv(e,t,n){return new e({type:`enum`,entries:t,...j(n)})}function Vv(e,t,n){return new e({type:`literal`,values:Array.isArray(t)?t:[t],...j(n)})}function Hv(e,t){return new e({type:`file`,...j(t)})}function Uv(e,t){return new e({type:`transform`,transform:t})}function Wv(e,t){return new e({type:`optional`,innerType:t})}function Gv(e,t){return new e({type:`nullable`,innerType:t})}function Kv(e,t,n){return new e({type:`default`,innerType:t,get defaultValue(){return typeof n==`function`?n():za(n)}})}function qv(e,t,n){return new e({type:`nonoptional`,innerType:t,...j(n)})}function Jv(e,t){return new e({type:`success`,innerType:t})}function Yv(e,t,n){return new e({type:`catch`,innerType:t,catchValue:typeof n==`function`?n:xo(n)})}function Xv(e,t,n){return new e({type:`pipe`,in:t,out:n})}function Zv(e,t){return new e({type:`readonly`,innerType:t})}function Qv(e,t,n){return new e({type:`template_literal`,parts:t,...j(n)})}function $v(e,t){return new e({type:`lazy`,getter:t})}function ey(e,t){return new e({type:`promise`,innerType:t})}function ty(e,t,n){let r=j(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function ny(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...j(n)})}function ry(e,t){let n=iy(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(so(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(so(r))}},e(t.value,t)),t);return n}function iy(e,t){let n=new nl({check:`custom`,...j(t)});return n._zod.check=e,n}function ay(e){let t=new nl({check:`describe`});return t._zod.onattach=[t=>{let n=Nh.get(t)??{};Nh.add(t,{...n,description:e})}],t._zod.check=()=>{},t}function oy(e){let t=new nl({check:`meta`});return t._zod.onattach=[t=>{let n=Nh.get(t)??{};Nh.add(t,{...n,...e})}],t._zod.check=()=>{},t}function sy(e,t){let n=j(t),r=n.truthy??[`true`,`1`,`yes`,`on`,`y`,`enabled`],i=n.falsy??[`false`,`0`,`no`,`off`,`n`,`disabled`];n.case!==`sensitive`&&(r=r.map(e=>typeof e==`string`?e.toLowerCase():e),i=i.map(e=>typeof e==`string`?e.toLowerCase():e));let a=new Set(r),o=new Set(i),s=e.Codec??kd,c=e.Boolean??Gu,l=new s({type:`pipe`,in:new(e.String??fu)({type:`string`,error:n.error}),out:new c({type:`boolean`,error:n.error}),transform:((e,t)=>{let r=e;return n.case!==`sensitive`&&(r=r.toLowerCase()),a.has(r)?!0:!o.has(r)&&(t.issues.push({code:`invalid_value`,expected:`stringbool`,values:[...a,...o],input:t.value,inst:l,continue:!1}),{})}),reverseTransform:((e,t)=>e===!0?r[0]||`true`:i[0]||`false`),error:n.error});return l._zod.bag.truthy=r,l._zod.bag.falsy=i,l._zod.bag.case=n.case??`insensitive`,l}function cy(e,t,n,r={}){let i=j(r),a={check:`string_format`,type:`string`,format:t,fn:typeof n==`function`?n:e=>n.test(e),...i};return n instanceof RegExp&&(a.pattern=n),new e(a)}var ly,uy=t((()=>{Dl(),Ph(),Id(),I(),ly={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}}));function dy(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&ka(e,t,n[t]);return e}function fy(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Nh,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function py(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function my(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,my(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&dy(o.schema,c),t.io===`input`&&Sy(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function hy(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function gy(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${hy(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+hy(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
76
|
+
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=La,c=!Po.jitless,l=c&&Ra.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?fl([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function hl(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!ro(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>co(e,r,Fo())))}),t)}var gl=P(`$ZodUnion`,(e,t)=>{dc.init(e,t),N(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),N(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),N(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),N(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>Sa(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>hl(t,r,e,i)):hl(o,r,e,i)}});function _l(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let e of r)if(t.has(e)){if(e!==void 0)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,n)}return t}var vl=P(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,gl.init(e,t);let n=e._zod.parse;N(e,`propValues`,e=>{let t={},n=0;for(let r of e.def.options){let i=r._zod.propValues;if(!i||Object.keys(i).length===0)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(r)}"`);i[e.def.discriminator]?.has(void 0)&&n++;for(let[e,n]of Object.entries(i)){Object.prototype.hasOwnProperty.call(t,e)||Ea(t,e,new Set);for(let r of n)t[e].add(r)}}return!e.def.unionFallback&&n>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,n)=>{let r=Da(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=ba(()=>_l(t));e._zod.parse=(i,a)=>{let o=i.value;if(!La(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=o?.[t.discriminator],c=r.value.get(s);return c&&(s!==void 0||a.direction!==`backward`)?c._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(e=>r.value.get(e)!==null),input:o,path:[t.discriminator],inst:e}),i)}}),yl=P(`$ZodIntersection`,(e,t)=>{dc.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>xl(e,t,n)):xl(e,i,a)}});function bl(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(za(e)&&za(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=bl(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=bl(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function xl(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=bl(t.value,n.value);if(!c.valid){if(ro(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Sl=P(`$ZodRecord`,(e,t)=>{dc.init(e,t);let n=Po.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!za(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>co(e,i,Fo())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...ao(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...ao(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&zs.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>co(e,i,Fo())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...ao(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...ao(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),Cl=P(`$ZodEnum`,(e,t)=>{dc.init(e,t);let n=ga(t.entries),r=new Set(n);e._zod.values=r,N(e,`pattern`,e=>{let t=ga(e.def.entries).filter(e=>Va.has(typeof e));return RegExp(t.length?`^(${t.map(e=>Ha(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),wl=P(`$ZodLiteral`,(e,t)=>{dc.init(e,t);let n=new Set(t.values);e._zod.values=n,N(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?Ha(e):e?Ha(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Tl=P(`$ZodTransform`,(e,t)=>{dc.init(e,t),e._zod.optin=`optional`,Po.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new No(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new Mo;return n.value=i,n}});function El(e,t){return e.value=t.issues.length?void 0:t.value,e}var Dl=P(`$ZodOptional`,(e,t)=>{dc.init(e,t),N(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,N(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),N(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Sa(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>El(e,t)):El(e,r)}return t.innerType._zod.run(e,n)}}),Ol=P(`$ZodExactOptional`,(e,t)=>{Dl.init(e,t),N(e,`values`,e=>e.def.innerType._zod.values),N(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),kl=P(`$ZodNullable`,(e,t)=>{dc.init(e,t),N(e,`optin`,e=>e.def.innerType._zod.optin),N(e,`optout`,e=>e.def.innerType._zod.optout),N(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${Sa(t.source)}|null)$`):void 0}),N(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Al=P(`$ZodDefault`,(e,t)=>{dc.init(e,t),e._zod.optin=`defaulted`,N(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>jl(e,t)):jl(r,t)}});function jl(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Ml=P(`$ZodPrefault`,(e,t)=>{dc.init(e,t),e._zod.optin=`defaulted`,N(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Nl=P(`$ZodNonOptional`,(e,t)=>{dc.init(e,t),N(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Pl(t,e)):Pl(i,e)}});function Pl(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function Fl(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>co(e,r,Fo()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var Il=P(`$ZodCatch`,(e,t)=>{dc.init(e,t),N(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),N(e,`optout`,e=>e.def.innerType._zod.optout),N(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>Fl(e,r,t,n)):Fl(e,r,t,n)}}),Ll=P(`$ZodPipe`,(e,t)=>{dc.init(e,t),N(e,`values`,e=>e.def.in._zod.values),N(e,`optin`,e=>e.def.in._zod.optin),N(e,`optout`,e=>e.def.out._zod.optout),N(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Rl(e,t.in,n)):Rl(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Rl(e,t.out,n)):Rl(r,t.out,n)}});function Rl(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var zl=P(`$ZodPreprocess`,(e,t)=>{Ll.init(e,t)}),Bl=P(`$ZodReadonly`,(e,t)=>{dc.init(e,t),N(e,`propValues`,e=>e.def.innerType._zod.propValues),N(e,`values`,e=>e.def.innerType._zod.values),N(e,`optin`,e=>e.def.innerType?._zod?.optin),N(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Vl):Vl(r)}});function Vl(e){return e.memo||(e.value=Object.freeze(e.value)),e}var Hl=P(`$ZodLazy`,(e,t)=>{dc.init(e,t),Ta(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),N(e,`pattern`,e=>e.innerType?._zod?.pattern),N(e,`propValues`,e=>e.innerType?._zod?.propValues),N(e,`optin`,e=>e.innerType?._zod?.optin??void 0),N(e,`optout`,e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Ul=P(`$ZodCustom`,(e,t)=>{Gs.init(e,t),dc.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Wl(t,n,r,e));Wl(i,n,r,e)}});function Wl(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(mo(e))}}var Gl=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},Kl=`~memo`,ql=[];function Jl(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function Yl(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var Xl=new WeakMap,Zl=0,Ql=1,$l=2;function eu(e,t,n){let r=Xl.get(e);if(r!==void 0)return r?$l:Zl;if(t.has(e))return $l;t.add(e);let i=Zl,a=e=>{if(i!==$l&&e?._zod){let r=eu(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=Zl;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?Ql:o.value?._zod?eu(o.value,t,n):Zl;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=Da(c);s(e?o(e,!0):Ql),a(c.catchall);break}case`properties`:s(o(c.shape,!1));break;case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?eu(r,t,!1):Ql);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),tu(e,i)}function tu(e,t){return t!==Ql&&Xl.set(e,t===$l),t}function nu(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var ru,iu=[],au={alloc(e,t,n){let r=ru;if(!r)return n;ru=void 0;let i={value:n,issues:null};return r.set(t.value,i),iu.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&su(n,e.value))throw new Gl;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=eu(e,new Set,!1);if(i===Zl)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===$l||r?n=!0:r=!0}let l=s.value;if(!Jl(l))return t(s,c);let u=c[Kl];u||(u={buckets:new WeakMap,backEdges:void 0},c[Kl]=u);let d;i===c?d=a:(d=nu(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...Yl(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;ru=d;let p=iu.length,m=t(s,c);ru=void 0;let h=iu.length>p?iu.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?Yl(e.issues):ql),e)):(h&&(h.issues=m.issues.length?Yl(m.issues):ql),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function ou(){return au}function su(e,t){let n=e[Kl]?.backEdges;return n!==void 0&&Jl(t)&&n.has(t)}var cu=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(po(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${Wa(e.values[0])}`:`Invalid option: expected one of ${_a(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${_a(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function lu(){return{localeError:cu()}}var uu,du=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function fu(){return new du}(uu=globalThis).__zod_globalRegistry??(uu.__zod_globalRegistry=fu());var pu=globalThis.__zod_globalRegistry;function mu(e,t){return new e({type:`string`,...M(t)})}function hu(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...M(t)})}function gu(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...M(t)})}function _u(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...M(t)})}function vu(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...M(t)})}function yu(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...M(t)})}function bu(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...M(t)})}function xu(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...M(t)})}function Su(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...M(t)})}function Cu(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...M(t)})}function wu(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...M(t)})}function Tu(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...M(t)})}function Eu(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...M(t)})}function Du(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...M(t)})}function Ou(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...M(t)})}function ku(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...M(t)})}function Au(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...M(t)})}function ju(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...M(t)})}function Mu(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...M(t)})}function Nu(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...M(t)})}function Pu(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...M(t)})}function Fu(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...M(t)})}function Iu(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...M(t)})}function Lu(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...M(t)})}function Ru(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...M(t)})}function zu(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...M(t)})}function Bu(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...M(t)})}function Vu(e,t){return new e({type:`number`,checks:[],...M(t)})}function Hu(e,t){return new e({type:`number`,coerce:!0,checks:[],...M(t)})}function Uu(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...M(t)})}function Wu(e,t){return new e({type:`boolean`,...M(t)})}function Gu(e,t){return new e({type:`undefined`,...M(t)})}function Ku(e,t){return new e({type:`null`,...M(t)})}function qu(e){return new e({type:`any`})}function Ju(e){return new e({type:`unknown`})}function Yu(e,t){return new e({type:`never`,...M(t)})}function Xu(e,t){return new Js({check:`less_than`,...M(t),value:e,inclusive:!1})}function Zu(e,t){return new Js({check:`less_than`,...M(t),value:e,inclusive:!0})}function Qu(e,t){return new Ys({check:`greater_than`,...M(t),value:e,inclusive:!1})}function $u(e,t){return new Ys({check:`greater_than`,...M(t),value:e,inclusive:!0})}function ed(e,t){return new Xs({check:`multiple_of`,...M(t),value:e})}function td(e,t){return new Qs({check:`max_length`,...M(t),maximum:e})}function nd(e,t){return new $s({check:`min_length`,...M(t),minimum:e})}function rd(e,t){return new ec({check:`length_equals`,...M(t),length:e})}function id(e,t){return new nc({check:`string_format`,format:`regex`,...M(t),pattern:e})}function ad(e){return new rc({check:`string_format`,format:`lowercase`,...M(e)})}function od(e){return new ic({check:`string_format`,format:`uppercase`,...M(e)})}function sd(e,t){return new ac({check:`string_format`,format:`includes`,...M(t),includes:e})}function cd(e,t){return new oc({check:`string_format`,format:`starts_with`,...M(t),prefix:e})}function ld(e,t){return new sc({check:`string_format`,format:`ends_with`,...M(t),suffix:e})}function I(e){return new cc({check:`overwrite`,tx:e})}function ud(e){return I(t=>t.normalize(e))}function L(){return I(e=>e.trim())}function R(){return I(e=>e.toLowerCase())}function dd(){return I(e=>e.toUpperCase())}function fd(){return I(e=>Fa(e))}function pd(e,t,n){return new e({type:`array`,element:t,...M(n)})}function md(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...M(n)})}function hd(e,t){let n=gd(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(mo(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(mo(r))}},e(t.value,t)),t);return n}function gd(e,t){let n=new Gs({check:`custom`,...M(t)});return n._zod.check=e,n}function _d(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&Ea(e,t,n[t]);return e}function vd(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??pu,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function yd(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function bd(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,bd(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&_d(o.schema,c),t.io===`input`&&Ad(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function xd(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Sd(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${xd(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+xd(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
69
77
|
|
|
70
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}e.external&&(e.sharedDefsExtractedFor=e.external)}function _y(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;_y(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}function vy(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function yy(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Cy.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??vy(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}ka(n,r,e.length===1?e[0]:yy(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=vy(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function by(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Cy)if(t in e)return;let n=t.filter(e=>wy.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=yy(t);else{let e=n[0],i=wy.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>yy([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,dy(e,r))}function xy(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):dy(i,s),dy(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())_y(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])by(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}dy(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,ka(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Ey(t,`input`,e.processors),output:Ey(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Sy(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Sy(r.element,n);if(r.type===`set`)return Sy(r.valueType,n);if(r.type===`lazy`)return Sy(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return Sy(r.innerType,n);if(r.type===`intersection`)return Sy(r.left,n)||Sy(r.right,n);if(r.type===`record`||r.type===`map`)return Sy(r.keyType,n)||Sy(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Sy(r.in,n)||Sy(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Sy(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Sy(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Sy(e,n))return!0;return!!(r.rest&&Sy(r.rest,n))}return!1}var Cy,wy,Ty,Ey,Dy=t((()=>{Ph(),I(),Cy=new Set([`type`,`properties`,`required`,`additionalProperties`]),wy=[`oneOf`,`anyOf`],Ty=(e,t={})=>n=>{let r=fy({...n,processors:t});return my(e,r),gy(r,e),xy(r,e)},Ey=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=fy({...i??{},target:a,io:t,processors:n});return my(e,o),gy(o,e),xy(o,e)}}));function Oy(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Oy(t.out):t.type===`catch`?Oy(t.innerType):e._zod.optin}function ky(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=ky(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>ky(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i?(p.type=`string`,a||(p.pattern=(r.includes(`number`)?Mc:jc).source),p):p}function Ay(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of cb.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=ky(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}function jy(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(py(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),fb):JSON.parse(o)}function My(e,t){if(`_idmap`in e){let n=e,r=fy({...t,processors:xb}),i={};for(let e of n._idmap.entries()){let[t,n]=e;my(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;gy(r,n),ka(a,t,xy(r,n))}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=fy({...t,processors:xb});return my(e,n),gy(n,e),xy(n,e)}var Ny,Py,Fy,Iy,Ly,Ry,zy,By,Vy,Hy,Uy,Wy,Gy,Ky,qy,Jy,Yy,Xy,Zy,Qy,$y,eb,tb,nb,rb,ib,ab,ob,sb,cb,lb,ub,db,fb,pb,mb,hb,gb,_b,vb,yb,bb,xb,Sb=t((()=>{el(),Dy(),I(),Ny={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Py=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Ny[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Fy=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;i.type=typeof s==`string`&&s.includes(`int`)?`integer`:`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(Number.isFinite(c)&&c!==0?i.multipleOf=Math.abs(c):py(e,t,i,r,`A multipleOf divisor of ${c} cannot be represented in JSON Schema`))},Iy=(e,t,n,r)=>{n.type=`boolean`},Ly=(e,t,n,r)=>{py(e,t,n,r,`BigInt cannot be represented in JSON Schema`)},Ry=(e,t,n,r)=>{py(e,t,n,r,`Symbols cannot be represented in JSON Schema`)},zy=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},By=(e,t,n,r)=>{py(e,t,n,r,`Undefined cannot be represented in JSON Schema`)},Vy=(e,t,n,r)=>{py(e,t,n,r,`Void cannot be represented in JSON Schema`)},Hy=(e,t,n,r)=>{n.not={}},Uy=(e,t,n,r)=>{},Wy=(e,t,n,r)=>{},Gy=(e,t,n,r)=>{py(e,t,n,r,`Date cannot be represented in JSON Schema`)},Ky=(e,t,n,r)=>{let i=e._zod.def,a=xa(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},qy=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(py(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(py(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},Jy=(e,t,n,r)=>{py(e,t,n,r,`NaN cannot be represented in JSON Schema`)},Yy=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},Xy=(e,t,n,r)=>{let i=n,a={type:`string`,format:`binary`,contentEncoding:`binary`},{minimum:o,maximum:s,mime:c}=e._zod.bag;o!==void 0&&(a.minLength=o),s!==void 0&&(a.maxLength=s),c?c.length===1?(a.contentMediaType=c[0],Object.assign(i,a)):(Object.assign(i,a),i.anyOf=c.map(e=>({contentMediaType:e}))):Object.assign(i,a)},Zy=(e,t,n,r)=>{n.type=`boolean`},Qy=(e,t,n,r)=>{py(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},$y=(e,t,n,r)=>{py(e,t,n,r,`Function types cannot be represented in JSON Schema`)},eb=(e,t,n,r)=>{py(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},tb=(e,t,n,r)=>{py(e,t,n,r,`Map cannot be represented in JSON Schema`)},nb=(e,t,n,r)=>{py(e,t,n,r,`Set cannot be represented in JSON Schema`)},rb=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=my(a.element,t,{...r,path:[...r.path,`items`]})},ib=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&py(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)ka(i.properties,e,my(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e];return t.io===`input`?Oy(n)===void 0:n._zod.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=my(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},ab=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>my(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},ob=(e,t,n,r)=>{let i=e._zod.def,a=my(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=my(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},sb=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>my(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?my(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null,u=a.items.length;for(;u>0;){let e=a.items[u-1];if(!(t.io===`input`?Oy(e)!==void 0:e._zod.optout===`optional`))break;u--}let d=a.items.length,f=!a.rest;t.target===`draft-2020-12`?(i.prefixItems=c,f?i.items=!1:l&&(i.items=l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):(i.items=c,f?i.additionalItems=!1:l&&(i.additionalItems=l),u>0&&(i.minItems=u),f&&(i.maxItems=d));let{minimum:p,maximum:m}=e._zod.bag;typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)},cb=new WeakMap,lb=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=my(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)ka(i.patternProperties,t.source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=my(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=cb.get(t);n||(n=[],cb.set(t,n),t.deferred.push(()=>Ay(t))),n.push(e)}i.additionalProperties=my(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Oy(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},ub=(e,t,n,r)=>{let i=e._zod.def,a=my(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},db=(e,t,n,r)=>{let i=e._zod.def;my(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},fb=Symbol(),pb=(e,t,n,r)=>{let i=e._zod.def;my(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=jy(i.defaultValue,e,t,n,r);o!==fb&&(n.default=o)},mb=(e,t,n,r)=>{let i=e._zod.def;my(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=jy(i.defaultValue,e,t,n,r);o!==fb&&(n._prefault=o)},hb=(e,t,n,r)=>{let i=e._zod.def;my(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{py(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},gb=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;my(o,t,r);let s=t.seen.get(e);s.ref=o},_b=(e,t,n,r)=>{let i=e._zod.def;my(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},vb=(e,t,n,r)=>{let i=e._zod.def;my(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},yb=(e,t,n,r)=>{let i=e._zod.def;my(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},bb=(e,t,n,r)=>{let i=e._zod.innerType;my(i,t,r);let a=t.seen.get(e);a.ref=i},xb={string:Py,number:Fy,boolean:Iy,bigint:Ly,symbol:Ry,null:zy,undefined:By,void:Vy,never:Hy,any:Uy,unknown:Wy,date:Gy,enum:Ky,literal:qy,nan:Jy,template_literal:Yy,file:Xy,success:Zy,custom:Qy,function:$y,transform:eb,map:tb,set:nb,array:rb,object:ib,union:ab,intersection:ob,tuple:sb,record:lb,nullable:ub,nonoptional:db,default:pb,prefault:mb,catch:hb,pipe:gb,readonly:_b,promise:vb,optional:yb,lazy:bb}})),Cb,wb=t((()=>{Sb(),Dy(),Cb=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let t=e?.target??`draft-2020-12`;t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),this.ctx=fy({processors:xb,target:t,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,t={path:[],schemaPath:[]}){return my(e,this.ctx,t)}emit(e,t){t&&(t.cycles&&(this.ctx.cycles=t.cycles),t.reused&&(this.ctx.reused=t.reused),t.external&&(this.ctx.external=t.external)),this.ctx.sharedDefsExtractedFor=void 0,this.ctx.sharedEmitDoneFor=void 0,gy(this.ctx,e);let{"~standard":n,...r}=xy(this.ctx,e);return r}}})),Tb=r({}),Eb=t((()=>{})),Db=r({$ZodAny:()=>Zu,$ZodArray:()=>nd,$ZodAsyncError:()=>Uo,$ZodBase64:()=>Iu,$ZodBase64URL:()=>Lu,$ZodBigInt:()=>Ku,$ZodBigIntFormat:()=>qu,$ZodBoolean:()=>Gu,$ZodCIDRv4:()=>Pu,$ZodCIDRv6:()=>Fu,$ZodCUID:()=>xu,$ZodCUID2:()=>Su,$ZodCatch:()=>Ed,$ZodCheck:()=>nl,$ZodCheckBigIntFormat:()=>ul,$ZodCheckEndsWith:()=>Cl,$ZodCheckGreaterThan:()=>sl,$ZodCheckIncludes:()=>xl,$ZodCheckLengthEquals:()=>gl,$ZodCheckLessThan:()=>ol,$ZodCheckLowerCase:()=>yl,$ZodCheckMaxLength:()=>ml,$ZodCheckMaxSize:()=>dl,$ZodCheckMimeType:()=>Tl,$ZodCheckMinLength:()=>hl,$ZodCheckMinSize:()=>fl,$ZodCheckMultipleOf:()=>cl,$ZodCheckNumberFormat:()=>ll,$ZodCheckOverwrite:()=>El,$ZodCheckProperty:()=>wl,$ZodCheckRegex:()=>vl,$ZodCheckSizeEquals:()=>pl,$ZodCheckStartsWith:()=>Sl,$ZodCheckStringFormat:()=>_l,$ZodCheckUpperCase:()=>bl,$ZodCodec:()=>kd,$ZodCreditCard:()=>Bu,$ZodCustom:()=>Fd,$ZodCustomStringFormat:()=>Hu,$ZodCyclicError:()=>Ud,$ZodDate:()=>td,$ZodDefault:()=>Sd,$ZodDiscriminatedUnion:()=>ld,$ZodE164:()=>Ru,$ZodEmail:()=>gu,$ZodEmoji:()=>yu,$ZodEncodeError:()=>Wo,$ZodEnum:()=>hd,$ZodError:()=>os,$ZodExactOptional:()=>bd,$ZodFile:()=>_d,$ZodFunction:()=>Md,$ZodGUID:()=>mu,$ZodIPv4:()=>Au,$ZodIPv6:()=>Mu,$ZodISODate:()=>Du,$ZodISODateTime:()=>Eu,$ZodISODuration:()=>ku,$ZodISOTime:()=>Ou,$ZodIntersection:()=>ud,$ZodJWT:()=>Vu,$ZodKSUID:()=>Tu,$ZodLazy:()=>Pd,$ZodLiteral:()=>gd,$ZodMAC:()=>Nu,$ZodMap:()=>pd,$ZodNaN:()=>Dd,$ZodNanoID:()=>bu,$ZodNever:()=>$u,$ZodNonOptional:()=>wd,$ZodNull:()=>Xu,$ZodNullable:()=>xd,$ZodNumber:()=>Uu,$ZodNumberFormat:()=>Wu,$ZodObject:()=>ad,$ZodObjectJIT:()=>od,$ZodOptional:()=>yd,$ZodPipe:()=>Od,$ZodPrefault:()=>Cd,$ZodPreprocess:()=>Ad,$ZodPromise:()=>Nd,$ZodReadonly:()=>V,$ZodRealError:()=>ss,$ZodRecord:()=>fd,$ZodRegistry:()=>Mh,$ZodSet:()=>md,$ZodString:()=>fu,$ZodStringFormat:()=>pu,$ZodSuccess:()=>Td,$ZodSymbol:()=>Ju,$ZodTemplateLiteral:()=>jd,$ZodTransform:()=>vd,$ZodTuple:()=>dd,$ZodType:()=>B,$ZodULID:()=>Cu,$ZodURL:()=>vu,$ZodUUID:()=>hu,$ZodUndefined:()=>Yu,$ZodUnion:()=>sd,$ZodUnknown:()=>Qu,$ZodVoid:()=>ed,$ZodXID:()=>wu,$ZodXor:()=>cd,$brand:()=>Ho,$constructor:()=>L,$input:()=>jh,$output:()=>Ah,Doc:()=>Ol,INVALID:()=>Jg,JSONSchema:()=>Tb,JSONSchemaGenerator:()=>Cb,NEVER:()=>zo,TimePrecision:()=>ly,URL_BAD_FORMAT:()=>1,URL_UNPARSEABLE:()=>2,ZodCompileAsyncError:()=>Xg,ZodCompileUnsupportedError:()=>Zg,_any:()=>q_,_array:()=>Av,_base64:()=>S_,_base64url:()=>C_,_bigint:()=>B_,_boolean:()=>R_,_catch:()=>Yv,_check:()=>iy,_cidrv4:()=>b_,_cidrv6:()=>x_,_coercedBigint:()=>V_,_coercedBoolean:()=>z_,_coercedDate:()=>Q_,_coercedNumber:()=>M_,_coercedString:()=>n_,_creditCard:()=>T_,_cuid:()=>f_,_cuid2:()=>p_,_custom:()=>ty,_date:()=>Z_,_decode:()=>Ts,_decodeAsync:()=>ks,_default:()=>Kv,_discriminatedUnion:()=>Nv,_e164:()=>w_,_email:()=>r_,_emoji:()=>u_,_encode:()=>Cs,_encodeAsync:()=>Ds,_endsWith:()=>bv,_enum:()=>zv,_file:()=>Hv,_float32:()=>P_,_float64:()=>F_,_gt:()=>nv,_gte:()=>rv,_guid:()=>i_,_includes:()=>vv,_int:()=>N_,_int32:()=>I_,_int64:()=>H_,_intersection:()=>Pv,_ipv4:()=>__,_ipv6:()=>v_,_isoDate:()=>O_,_isoDateTime:()=>D_,_isoDuration:()=>A_,_isoTime:()=>k_,_jwt:()=>E_,_ksuid:()=>g_,_lazy:()=>$v,_length:()=>mv,_literal:()=>Vv,_lowercase:()=>gv,_lt:()=>ev,_lte:()=>tv,_mac:()=>y_,_map:()=>Lv,_max:()=>tv,_maxLength:()=>fv,_maxSize:()=>lv,_mime:()=>Cv,_min:()=>rv,_minLength:()=>pv,_minSize:()=>uv,_multipleOf:()=>cv,_nan:()=>$_,_nanoid:()=>d_,_nativeEnum:()=>Bv,_negative:()=>av,_never:()=>Y_,_nonnegative:()=>sv,_nonoptional:()=>qv,_nonpositive:()=>ov,_normalize:()=>Tv,_null:()=>K_,_nullable:()=>Gv,_number:()=>j_,_optional:()=>Wv,_overwrite:()=>wv,_parse:()=>ds,_parseAsync:()=>ps,_pipe:()=>Xv,_positive:()=>iv,_promise:()=>ey,_properties:()=>Sv,_property:()=>xv,_readonly:()=>Zv,_record:()=>Iv,_refine:()=>ny,_regex:()=>hv,_safeDecode:()=>Ns,_safeDecodeAsync:()=>Ls,_safeEncode:()=>js,_safeEncodeAsync:()=>Fs,_safeParse:()=>hs,_safeParseAsync:()=>_s,_set:()=>Rv,_size:()=>dv,_slugify:()=>kv,_startsWith:()=>yv,_string:()=>t_,_stringFormat:()=>cy,_stringbool:()=>sy,_success:()=>Jv,_superRefine:()=>ry,_symbol:()=>W_,_templateLiteral:()=>Qv,_toLowerCase:()=>Dv,_toUpperCase:()=>Ov,_transform:()=>Uv,_trim:()=>Ev,_tuple:()=>Fv,_uint32:()=>L_,_uint64:()=>U_,_ulid:()=>m_,_undefined:()=>G_,_union:()=>jv,_unknown:()=>J_,_uppercase:()=>_v,_url:()=>l_,_uuid:()=>a_,_uuidv4:()=>o_,_uuidv6:()=>s_,_uuidv7:()=>c_,_void:()=>X_,_xid:()=>h_,_xor:()=>Mv,clone:()=>Ha,compile:()=>Ih,compileFn:()=>Rh,config:()=>Lo,createStandardJSONSchemaMethod:()=>Ey,createToJSONSchemaMethod:()=>Ty,decode:()=>Es,decodeAsync:()=>As,describe:()=>ay,encode:()=>ws,encodeAsync:()=>Os,extractDefs:()=>gy,finalize:()=>xy,flattenError:()=>Xo,formatError:()=>Zo,getDiscriminatedOption:()=>z,globalConfig:()=>Go,globalRegistry:()=>Nh,handleUnrepresentable:()=>py,initializeContext:()=>fy,isBackEdge:()=>Hd,isRecursiveSchema:()=>zd,isValidBase64:()=>zl,isValidBase64URL:()=>Bl,isValidCIDRv6:()=>Rl,isValidCreditCard:()=>Hl,isValidIPv6:()=>Ll,isValidJWT:()=>Ul,locales:()=>Eh,memoizer:()=>Vd,mergeValues:()=>Yl,meta:()=>oy,parse:()=>fs,parseAsync:()=>ms,parseURLObject:()=>Nl,prettifyError:()=>es,process:()=>my,regexes:()=>Bs,registry:()=>Oh,safeDecode:()=>Ps,safeDecodeAsync:()=>Rs,safeEncode:()=>Ms,safeEncodeAsync:()=>Is,safeParse:()=>gs,safeParseAsync:()=>vs,standardProps:()=>Ml,stripTabAndNewline:()=>Pl,toDotPath:()=>$o,toJSONSchema:()=>My,toZod:()=>_a,treeifyError:()=>Qo,urlHostnameOk:()=>Fl,urlProtocolOk:()=>Il,util:()=>ma,validate:()=>xs,validateAsync:()=>Ss,version:()=>Al}),Ob=t((()=>{Ko(),zs(),cs(),Id(),Xd(),Dl(),jl(),I(),el(),Dh(),Ph(),kl(),e_(),uy(),Dy(),Sb(),wb(),Eb()}));function kb(e,t){let n=typeof t==`function`?t:(e,n)=>{let r=t[e._zod.def.type];return r?r(e,n):e},r=new Map;function i(e){let t=r.get(e);if(t===Ab)return new Pd({type:`lazy`,getter:()=>r.get(e)});if(t!==void 0)return t;r.set(e,Ab);let i=a(e),o=n(i,i!==e);return r.set(e,o),o}function a(e){let t=e._zod.def;switch(t.type){case`object`:{let n=t.shape,r=Object.keys(n),a=!1,o={};for(let e of r){let t=i(n[e]);t!==n[e]&&(a=!0),o[e]=t}let s=t.catchall;return t.catchall&&(s=i(t.catchall),s!==t.catchall&&(a=!0)),a?Ha(e,{...t,shape:o,catchall:s}):e}case`array`:{let n=i(t.element);return n===t.element?e:Ha(e,{...t,element:n})}case`tuple`:{let n=t.items,r=!1,a=[];for(let e of n){let t=i(e);t!==e&&(r=!0),a.push(t)}let o=t.rest;return t.rest&&(o=i(t.rest),o!==t.rest&&(r=!0)),r?Ha(e,{...t,items:a,rest:o}):e}case`record`:case`map`:{let n=i(t.keyType),r=i(t.valueType);return n===t.keyType&&r===t.valueType?e:Ha(e,{...t,keyType:n,valueType:r})}case`set`:{let n=i(t.valueType);return n===t.valueType?e:Ha(e,{...t,valueType:n})}case`union`:{let n=t.options,r=!1,a=[];for(let e of n){let t=i(e);t!==e&&(r=!0),a.push(t)}return r?Ha(e,{...t,options:a}):e}case`intersection`:{let n=i(t.left),r=i(t.right);return n===t.left&&r===t.right?e:Ha(e,{...t,left:n,right:r})}case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:{let n=i(t.innerType);return n===t.innerType?e:Ha(e,{...t,innerType:n})}case`pipe`:{let n=i(t.in),r=i(t.out);return n===t.in&&r===t.out?e:Ha(e,{...t,in:n,out:r})}case`function`:{let n=i(t.input),r=i(t.output);return n===t.input&&r===t.output?e:Ha(e,{...t,input:n,output:r})}case`lazy`:{let n=t.getter,{_cachedInner:r,...a}=t;return Ha(e,{...a,getter:()=>i(n())})}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:return e;default:return e}}return i(e)}var Ab,jb=t((()=>{Id(),I(),Ab=Symbol(`z.visit/resolving`)})),W=c(),Mb=f();zs();function Nb(e){return!!e._zod}function Pb(e,t){return Nb(e)?gs(e,t):e.safeParse(t)}function Fb(e){if(!e)return;let t;if(t=Nb(e)?e._zod?.def?.shape:e.shape,t){if(typeof t==`function`)try{return t()}catch{return}return t}}function Ib(e){if(Nb(e)){let t=e._zod?.def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}}let t=e._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}let n=e.value;if(n!==void 0)return n}var Lb=r({endsWith:()=>bv,gt:()=>nv,gte:()=>rv,includes:()=>vv,length:()=>mv,lowercase:()=>gv,lt:()=>ev,lte:()=>tv,maxLength:()=>fv,maxSize:()=>lv,mime:()=>Cv,minLength:()=>pv,minSize:()=>uv,multipleOf:()=>cv,negative:()=>av,nonnegative:()=>sv,nonpositive:()=>ov,normalize:()=>Tv,overwrite:()=>wv,positive:()=>iv,properties:()=>Sv,property:()=>xv,regex:()=>hv,size:()=>dv,slugify:()=>kv,startsWith:()=>yv,toLowerCase:()=>Dv,toUpperCase:()=>Ov,trim:()=>Ev,uppercase:()=>_v}),Rb=t((()=>{Ob()}));function zb(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var Bb,Vb,Hb,Ub,Wb=t((()=>{Ob(),I(),Bb=new WeakSet([Object.prototype,Error.prototype]),Vb=(e,t)=>{os.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);Bb.has(n)||(Bb.add(n),zb(n,`format`,e=>t=>Zo(e,t)),zb(n,`flatten`,e=>t=>Xo(e,t)),zb(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Sa,2)}),zb(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Sa,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},Hb=L(`ZodError`,Vb),Ub=L(`ZodError`,Vb,void 0,{Parent:Error})})),Gb,Kb,qb,Jb,Yb,Xb,Zb,Qb,$b,ex,tx,nx,rx=t((()=>{Ob(),Wb(),Gb=ds(Ub),Kb=ps(Ub),qb=hs(Ub),Jb=_s(Ub),Yb=Cs(Ub),Xb=Ts(Ub),Zb=Ds(Ub),Qb=ks(Ub),$b=js(Ub),ex=Ns(Ub),tx=Fs(Ub),nx=Ls(Ub)})),ix=r({ZodAny:()=>CC,ZodArray:()=>OC,ZodBase64:()=>lC,ZodBase64URL:()=>uC,ZodBigInt:()=>vC,ZodBigIntFormat:()=>yC,ZodBoolean:()=>_C,ZodCIDRv4:()=>sC,ZodCIDRv6:()=>cC,ZodCUID:()=>$S,ZodCUID2:()=>eC,ZodCatch:()=>YC,ZodCodec:()=>QC,ZodCreditCard:()=>fC,ZodCustom:()=>aw,ZodCustomStringFormat:()=>mC,ZodDate:()=>DC,ZodDefault:()=>GC,ZodDiscriminatedUnion:()=>MC,ZodE164:()=>dC,ZodEmail:()=>qS,ZodEmoji:()=>ZS,ZodEnum:()=>RC,ZodExactOptional:()=>UC,ZodFile:()=>BC,ZodFunction:()=>iw,ZodGUID:()=>JS,ZodIPv4:()=>iC,ZodIPv6:()=>oC,ZodISODate:()=>WS,ZodISODateTime:()=>US,ZodISODuration:()=>KS,ZodISOTime:()=>GS,ZodIntersection:()=>NC,ZodJWT:()=>pC,ZodKSUID:()=>rC,ZodLazy:()=>nw,ZodLiteral:()=>zC,ZodMAC:()=>aC,ZodMap:()=>IC,ZodNaN:()=>XC,ZodNanoID:()=>QS,ZodNever:()=>TC,ZodNonOptional:()=>qC,ZodNull:()=>SC,ZodNullable:()=>WC,ZodNumber:()=>hC,ZodNumberFormat:()=>gC,ZodObject:()=>kC,ZodOptional:()=>HC,ZodPipe:()=>ZC,ZodPrefault:()=>KC,ZodPreprocess:()=>$C,ZodPromise:()=>rw,ZodReadonly:()=>ew,ZodRecord:()=>FC,ZodSet:()=>LC,ZodString:()=>VS,ZodStringFormat:()=>HS,ZodSuccess:()=>JC,ZodSymbol:()=>bC,ZodTemplateLiteral:()=>tw,ZodTransform:()=>VC,ZodTuple:()=>PC,ZodType:()=>Z,ZodULID:()=>tC,ZodURL:()=>XS,ZodUUID:()=>YS,ZodUndefined:()=>xC,ZodUnion:()=>AC,ZodUnknown:()=>wC,ZodVoid:()=>EC,ZodXID:()=>nC,ZodXor:()=>jC,_ZodString:()=>BS,_default:()=>yS,_function:()=>MS,any:()=>Jx,array:()=>q,base64:()=>Dx,base64url:()=>Ox,bigint:()=>Hx,boolean:()=>Vx,catch:()=>CS,check:()=>NS,cidrv4:()=>Tx,cidrv6:()=>Ex,codec:()=>ES,creditCard:()=>Ax,cuid:()=>_x,cuid2:()=>vx,custom:()=>PS,date:()=>Qx,describe:()=>ow,discriminatedUnion:()=>rS,e164:()=>kx,email:()=>sx,emoji:()=>hx,enum:()=>dS,exactOptional:()=>gS,file:()=>pS,float32:()=>Lx,float64:()=>Rx,function:()=>MS,guid:()=>cx,hash:()=>Fx,hex:()=>Px,hostname:()=>Nx,httpUrl:()=>mx,instanceof:()=>LS,int:()=>Ix,int32:()=>zx,int64:()=>Ux,intersection:()=>iS,invertCodec:()=>DS,ipv4:()=>Sx,ipv6:()=>wx,json:()=>RS,jwt:()=>jx,keyof:()=>$x,ksuid:()=>xx,lazy:()=>AS,literal:()=>X,looseObject:()=>tS,looseRecord:()=>cS,mac:()=>Cx,map:()=>lS,meta:()=>sw,nan:()=>wS,nanoid:()=>gx,nativeEnum:()=>fS,never:()=>Xx,nonoptional:()=>xS,null:()=>qx,nullable:()=>_S,nullish:()=>vS,number:()=>K,object:()=>J,optional:()=>hS,partialRecord:()=>sS,pipe:()=>TS,prefault:()=>bS,preprocess:()=>zS,promise:()=>jS,readonly:()=>OS,record:()=>oS,refine:()=>FS,set:()=>uS,strictObject:()=>eS,string:()=>G,stringFormat:()=>Mx,stringbool:()=>cw,success:()=>SS,superRefine:()=>IS,symbol:()=>Gx,templateLiteral:()=>kS,transform:()=>mS,tuple:()=>aS,uint32:()=>Bx,uint64:()=>Wx,ulid:()=>yx,undefined:()=>Kx,union:()=>Y,unknown:()=>Yx,url:()=>px,uuid:()=>lx,uuidv4:()=>ux,uuidv6:()=>dx,uuidv7:()=>fx,void:()=>Zx,xid:()=>bx,xor:()=>nS});function ax(){Go.localeError||Lo(Mf())}function ox(){Go.memoizer||Lo({memoizer:Vd()})}function G(e){return t_(VS,e)}function sx(e){return r_(qS,e)}function cx(e){return i_(JS,e)}function lx(e){return a_(YS,e)}function ux(e){return o_(YS,e)}function dx(e){return s_(YS,e)}function fx(e){return c_(YS,e)}function px(e){return l_(XS,e)}function mx(e){return l_(XS,{protocol:wc,hostname:Cc,...j(e)})}function hx(e){return u_(ZS,e)}function gx(e){return d_(QS,e)}function _x(e){return f_($S,e)}function vx(e){return p_(eC,e)}function yx(e){return m_(tC,e)}function bx(e){return h_(nC,e)}function xx(e){return g_(rC,e)}function Sx(e){return __(iC,e)}function Cx(e){return y_(aC,e)}function wx(e){return v_(oC,e)}function Tx(e){return b_(sC,e)}function Ex(e){return x_(cC,e)}function Dx(e){return S_(lC,e)}function Ox(e){return C_(uC,e)}function kx(e){return w_(dC,e)}function Ax(e){return T_(fC,e)}function jx(e){return E_(pC,e)}function Mx(e,t,n={}){return cy(mC,e,t,n)}function Nx(e){return cy(mC,`hostname`,Sc,e)}function Px(e){return cy(mC,`hex`,Rc,e)}function Fx(e,t){let n=`${e}_${t?.enc??`hex`}`,r=Bs[n];if(!r)throw Error(`Unrecognized hash format: ${n}`);return cy(mC,n,r,t)}function K(e){return j_(hC,e)}function Ix(e){return N_(gC,e)}function Lx(e){return P_(gC,e)}function Rx(e){return F_(gC,e)}function zx(e){return I_(gC,e)}function Bx(e){return L_(gC,e)}function Vx(e){return R_(_C,e)}function Hx(e){return B_(vC,e)}function Ux(e){return H_(yC,e)}function Wx(e){return U_(yC,e)}function Gx(e){return W_(bC,e)}function Kx(e){return G_(xC,e)}function qx(e){return K_(SC,e)}function Jx(){return q_(CC)}function Yx(){return J_(wC)}function Xx(e){return Y_(TC,e)}function Zx(e){return X_(EC,e)}function Qx(e){return Z_(DC,e)}function q(e,t){return Av(OC,e,t)}function $x(e){let t=e._zod.def.shape;return dS(Object.keys(t))}function J(e,t){let n={type:`object`,shape:e??{},...j(t)};return new kC(n)}function eS(e,t){return new kC({type:`object`,shape:e,catchall:Xx(),...j(t)})}function tS(e,t){return new kC({type:`object`,shape:e,catchall:Yx(),...j(t)})}function Y(e,t){return new AC({type:`union`,options:e,...j(t)})}function nS(e,t){return new jC({type:`union`,options:e,inclusive:!1,...j(t)})}function rS(e,t,n){return new MC({type:`union`,options:t,discriminator:e,...j(n)})}function iS(e,t){return new NC({type:`intersection`,left:e,right:t})}function aS(e,t,n){let r=t instanceof B;return new PC({type:`tuple`,items:e,rest:r?t:null,...j(r?n:t)})}function oS(e,t,n){return!t||!t._zod?new FC({type:`record`,keyType:G(),valueType:e,...j(t)}):new FC({type:`record`,keyType:e,valueType:t,...j(n)})}function sS(e,t,n){return new FC({type:`record`,keyType:e,valueType:t,...j(n),partial:!0})}function cS(e,t,n){return new FC({type:`record`,keyType:e,valueType:t,mode:`loose`,...j(n)})}function lS(e,t,n){return new IC({type:`map`,keyType:e,valueType:t,...j(n)})}function uS(e,t){return new LC({type:`set`,valueType:e,...j(t)})}function dS(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new RC({type:`enum`,entries:n,...j(t)})}function fS(e,t){return new RC({type:`enum`,entries:e,...j(t)})}function X(e,t){return new zC({type:`literal`,values:Array.isArray(e)?e:[e],...j(t)})}function pS(e){return Hv(BC,e)}function mS(e){return new VC({type:`transform`,transform:e})}function hS(e){return new HC({type:`optional`,innerType:e})}function gS(e){return new UC({type:`optional`,innerType:e})}function _S(e){return new WC({type:`nullable`,innerType:e})}function vS(e){return hS(_S(e))}function yS(e,t){return new GC({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():za(t)}})}function bS(e,t){return new KC({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():za(t)}})}function xS(e,t){return new qC({type:`nonoptional`,innerType:e,...j(t)})}function SS(e){return new JC({type:`success`,innerType:e})}function CS(e,t){return new YC({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:xo(t)})}function wS(e){return $_(XC,e)}function TS(e,t){return new ZC({type:`pipe`,in:e,out:t})}function ES(e,t,n){return new QC({type:`pipe`,in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function DS(e){let t=e._zod.def;return new QC({type:`pipe`,in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}function OS(e){return new ew({type:`readonly`,innerType:e})}function kS(e,t){return new tw({type:`template_literal`,parts:e,...j(t)})}function AS(e){return new nw({type:`lazy`,getter:e})}function jS(e){return new rw({type:`promise`,innerType:e})}function MS(e){return new iw({type:`function`,input:Array.isArray(e?.input)?aS(e?.input):e?.input??q(Yx()),output:e?.output??Yx()})}function NS(e){let t=new nl({check:`custom`});return t._zod.check=e,t}function PS(e,t){return ty(aw,e??(()=>!0),t)}function FS(e,t={}){return ny(aw,e,t)}function IS(e,t){return ry(e,t)}function LS(e,t={}){let n=new aw({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...j(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:`invalid_type`,expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}function RS(e){let t=AS(()=>Y([G(e),K(),Vx(),qx(),q(t),oS(G(),t)]));return t}function zS(e,t){return new $C({type:`pipe`,in:mS(e),out:t})}var Z,BS,VS,HS,US,WS,GS,KS,qS,JS,YS,XS,ZS,QS,$S,eC,tC,nC,rC,iC,aC,oC,sC,cC,lC,uC,dC,fC,pC,mC,hC,gC,_C,vC,yC,bC,xC,SC,CC,wC,TC,EC,DC,OC,kC,AC,jC,MC,NC,PC,FC,IC,LC,RC,zC,BC,VC,HC,UC,WC,GC,KC,qC,JC,YC,XC,ZC,QC,$C,ew,tw,nw,rw,iw,aw,ow,sw,cw,lw=t((()=>{Ob(),Sb(),Dy(),Pf(),Rb(),rx(),Z=L(`ZodType`,(e,t)=>(ax(),B.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(Aa(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Ha(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(FS(e,t))},superRefine(e,t){return this.check(IS(e,t))},overwrite(e){return this.check(wv(e))},optional(){return hS(this)},exactOptional(){return gS(this)},nullable(){return _S(this)},nullish(){return hS(_S(this))},nonoptional(e){return xS(this,e)},array(){return q(this)},or(e){return Y([this,e])},and(e){return iS(this,e)},transform(e){return TS(this,mS(e))},default(e){return yS(this,e)},prefault(e){return bS(this,e)},catch(e){return CS(this,e)},pipe(e){return TS(this,e)},readonly(){return OS(this)},describe(e){let t=this.clone();return Nh.add(t,{description:e}),t},meta(...e){if(e.length===0)return Nh.get(this);let t=this.clone();return Nh.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return vo(this,`~standard`,{...Ml(this),jsonSchema:{input:Ey(this,`input`),output:Ey(this,`output`)}})},set"~standard"(e){_o(this,`~standard`,e)},parse:function e(t,n){return Gb(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Kb(this,t,n,{callee:e})},safeParse(e,t){return qb(this,e,t)},async safeParseAsync(e,t){return Jb(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){_o(this,`spa`,e)},encode:function e(t,n){return Yb(this,t,n,{callee:e})},decode:function e(t,n){return Xb(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Zb(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Qb(this,t,n,{callee:e})},safeEncode(e,t){return $b(this,e,t)},safeDecode(e,t){return ex(this,e,t)},async safeEncodeAsync(e,t){return tx(this,e,t)},async safeDecodeAsync(e,t){return nx(this,e,t)},toJSONSchema(e){return Ty(this,{})(e)},get description(){return Nh.get(this)?.description},get _def(){return this._zod.def}}),BS=L(`_ZodString`,(e,t)=>{fu.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Py(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null},{regex(...e){return this.check(hv(...e))},includes(...e){return this.check(vv(...e))},startsWith(...e){return this.check(yv(...e))},endsWith(...e){return this.check(bv(...e))},min(...e){return this.check(pv(...e))},max(...e){return this.check(fv(...e))},length(...e){return this.check(mv(...e))},nonempty(...e){return this.check(pv(1,...e))},lowercase(e){return this.check(gv(e))},uppercase(e){return this.check(_v(e))},trim(){return this.check(Ev())},normalize(...e){return this.check(Tv(...e))},toLowerCase(){return this.check(Dv())},toUpperCase(){return this.check(Ov())},slugify(){return this.check(kv())}}),VS=L(`ZodString`,(e,t)=>{fu.init(e,t),BS.init(e,t)},{email(e){return this.check(r_(qS,e))},url(e){return this.check(l_(XS,e))},jwt(e){return this.check(E_(pC,e))},emoji(e){return this.check(u_(ZS,e))},guid(e){return this.check(i_(JS,e))},uuid(e){return this.check(a_(YS,e))},uuidv4(e){return this.check(o_(YS,e))},uuidv6(e){return this.check(s_(YS,e))},uuidv7(e){return this.check(c_(YS,e))},nanoid(e){return this.check(d_(QS,e))},cuid(e){return this.check(f_($S,e))},cuid2(e){return this.check(p_(eC,e))},ulid(e){return this.check(m_(tC,e))},base64(e){return this.check(S_(lC,e))},base64url(e){return this.check(C_(uC,e))},xid(e){return this.check(h_(nC,e))},ksuid(e){return this.check(g_(rC,e))},ipv4(e){return this.check(__(iC,e))},ipv6(e){return this.check(v_(oC,e))},cidrv4(e){return this.check(b_(sC,e))},cidrv6(e){return this.check(x_(cC,e))},e164(e){return this.check(w_(dC,e))},datetime(e){return this.check(D_(US,e))},date(e){return this.check(O_(WS,e))},time(e){return this.check(k_(GS,e))},duration(e){return this.check(A_(KS,e))}}),HS=L(`ZodStringFormat`,(e,t)=>{pu.init(e,t),BS.init(e,t)}),US=L(`ZodISODateTime`,(e,t)=>{Eu.init(e,t),HS.init(e,t)}),WS=L(`ZodISODate`,(e,t)=>{Du.init(e,t),HS.init(e,t)}),GS=L(`ZodISOTime`,(e,t)=>{Ou.init(e,t),HS.init(e,t)}),KS=L(`ZodISODuration`,(e,t)=>{ku.init(e,t),HS.init(e,t)}),qS=L(`ZodEmail`,(e,t)=>{gu.init(e,t),HS.init(e,t)}),JS=L(`ZodGUID`,(e,t)=>{mu.init(e,t),HS.init(e,t)}),YS=L(`ZodUUID`,(e,t)=>{hu.init(e,t),HS.init(e,t)}),XS=L(`ZodURL`,(e,t)=>{vu.init(e,t),HS.init(e,t)}),ZS=L(`ZodEmoji`,(e,t)=>{yu.init(e,t),HS.init(e,t)}),QS=L(`ZodNanoID`,(e,t)=>{bu.init(e,t),HS.init(e,t)}),$S=L(`ZodCUID`,(e,t)=>{xu.init(e,t),HS.init(e,t)}),eC=L(`ZodCUID2`,(e,t)=>{Su.init(e,t),HS.init(e,t)}),tC=L(`ZodULID`,(e,t)=>{Cu.init(e,t),HS.init(e,t)}),nC=L(`ZodXID`,(e,t)=>{wu.init(e,t),HS.init(e,t)}),rC=L(`ZodKSUID`,(e,t)=>{Tu.init(e,t),HS.init(e,t)}),iC=L(`ZodIPv4`,(e,t)=>{Au.init(e,t),HS.init(e,t)}),aC=L(`ZodMAC`,(e,t)=>{Nu.init(e,t),HS.init(e,t)}),oC=L(`ZodIPv6`,(e,t)=>{Mu.init(e,t),HS.init(e,t)}),sC=L(`ZodCIDRv4`,(e,t)=>{Pu.init(e,t),HS.init(e,t)}),cC=L(`ZodCIDRv6`,(e,t)=>{Fu.init(e,t),HS.init(e,t)}),lC=L(`ZodBase64`,(e,t)=>{Iu.init(e,t),HS.init(e,t)}),uC=L(`ZodBase64URL`,(e,t)=>{Lu.init(e,t),HS.init(e,t)}),dC=L(`ZodE164`,(e,t)=>{Ru.init(e,t),HS.init(e,t)}),fC=L(`ZodCreditCard`,(e,t)=>{Bu.init(e,t),HS.init(e,t)}),pC=L(`ZodJWT`,(e,t)=>{Vu.init(e,t),HS.init(e,t)}),mC=L(`ZodCustomStringFormat`,(e,t)=>{Hu.init(e,t),HS.init(e,t)}),hC=L(`ZodNumber`,(e,t)=>{Uu.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fy(e,t,n,r);let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null},{gt(e,t){return this.check(nv(e,t))},gte(e,t){return this.check(rv(e,t))},min(e,t){return this.check(rv(e,t))},lt(e,t){return this.check(ev(e,t))},lte(e,t){return this.check(tv(e,t))},max(e,t){return this.check(tv(e,t))},int(e){return this.check(Ix(e))},safe(e){return this.check(Ix(e))},positive(e){return this.check(nv(0,e))},nonnegative(e){return this.check(rv(0,e))},negative(e){return this.check(ev(0,e))},nonpositive(e){return this.check(tv(0,e))},multipleOf(e,t){return this.check(cv(e,t))},step(e,t){return this.check(cv(e,t))},finite(){return this}}),gC=L(`ZodNumberFormat`,(e,t)=>{Wu.init(e,t),hC.init(e,t)}),_C=L(`ZodBoolean`,(e,t)=>{Gu.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Iy(e,t,n,r)}),vC=L(`ZodBigInt`,(e,t)=>{Ku.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ly(e,t,n,r);let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null},{gte(e,t){return this.check(rv(e,t))},min(e,t){return this.check(rv(e,t))},gt(e,t){return this.check(nv(e,t))},lt(e,t){return this.check(ev(e,t))},lte(e,t){return this.check(tv(e,t))},max(e,t){return this.check(tv(e,t))},positive(e){return this.check(nv(BigInt(0),e))},negative(e){return this.check(ev(BigInt(0),e))},nonpositive(e){return this.check(tv(BigInt(0),e))},nonnegative(e){return this.check(rv(BigInt(0),e))},multipleOf(e,t){return this.check(cv(e,t))}}),yC=L(`ZodBigIntFormat`,(e,t)=>{qu.init(e,t),vC.init(e,t)}),bC=L(`ZodSymbol`,(e,t)=>{Ju.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ry(e,t,n,r)}),xC=L(`ZodUndefined`,(e,t)=>{Yu.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>By(e,t,n,r)}),SC=L(`ZodNull`,(e,t)=>{Xu.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zy(e,t,n,r)}),CC=L(`ZodAny`,(e,t)=>{Zu.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Uy(e,t,n,r)}),wC=L(`ZodUnknown`,(e,t)=>{Qu.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wy(e,t,n,r)}),TC=L(`ZodNever`,(e,t)=>{$u.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hy(e,t,n,r)}),EC=L(`ZodVoid`,(e,t)=>{ed.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vy(e,t,n,r)}),DC=L(`ZodDate`,(e,t)=>{td.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gy(e,t,n,r),e.min=(t,n)=>e.check(rv(t,n)),e.max=(t,n)=>e.check(tv(t,n));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null}),OC=L(`ZodArray`,(e,t)=>{ox(),nd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rb(e,t,n,r),e.element=t.element},{min(e,t){return this.check(pv(e,t))},nonempty(e){return this.check(pv(1,e))},max(e,t){return this.check(fv(e,t))},length(e,t){return this.check(mv(e,t))},unwrap(){return this.element}}),kC=L(`ZodObject`,(e,t)=>{ox(),od.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ib(e,t,n,r),bo(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return dS(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Yx()})},loose(){return this.clone({...this._zod.def,catchall:Yx()})},strict(){return this.clone({...this._zod.def,catchall:Xx()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return qa(this,e)},safeExtend(e){return Ja(this,e)},merge(e){return Ya(this,e)},pick(e){return Ga(this,e)},omit(e){return Ka(this,e)},partial(...e){return Xa(HC,this,e[0])},exactPartial(...e){return Xa(UC,this,e[0],`exactPartial`)},required(...e){return Za(qC,this,e[0])}}),AC=L(`ZodUnion`,(e,t)=>{sd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ab(e,t,n,r),e.options=t.options}),jC=L(`ZodXor`,(e,t)=>{AC.init(e,t),cd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ab(e,t,n,r),e.options=t.options}),MC=L(`ZodDiscriminatedUnion`,(e,t)=>{AC.init(e,t),ld.init(e,t)}),NC=L(`ZodIntersection`,(e,t)=>{ud.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ob(e,t,n,r)}),PC=L(`ZodTuple`,(e,t)=>{ox(),dd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sb(e,t,n,r)},{rest(e){return this.clone({...this._zod.def,rest:e})},partial(){let e=this._zod.def;if(e.checks?.length)throw Error(`.partial() cannot be used on tuple schemas containing refinements`);return this.clone({...e,items:e.items.map(e=>new HC({type:`optional`,innerType:e}))})}}),FC=L(`ZodRecord`,(e,t)=>{ox(),fd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lb(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType}),IC=L(`ZodMap`,(e,t)=>{ox(),pd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tb(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...t)=>e.check(uv(...t)),e.nonempty=t=>e.check(uv(1,t)),e.max=(...t)=>e.check(lv(...t)),e.size=(...t)=>e.check(dv(...t))}),LC=L(`ZodSet`,(e,t)=>{ox(),md.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nb(e,t,n,r),e.min=(...t)=>e.check(uv(...t)),e.nonempty=t=>e.check(uv(1,t)),e.max=(...t)=>e.check(lv(...t)),e.size=(...t)=>e.check(dv(...t))}),RC=L(`ZodEnum`,(e,t)=>{hd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ky(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new RC({...t,checks:[],...j(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new RC({...t,checks:[],...j(r),entries:i})}}),zC=L(`ZodLiteral`,(e,t)=>{gd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qy(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})}),BC=L(`ZodFile`,(e,t)=>{_d.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xy(e,t,n,r),e.min=(t,n)=>e.check(uv(t,n)),e.max=(t,n)=>e.check(lv(t,n)),e.mime=(t,n)=>e.check(Cv(Array.isArray(t)?t:[t],n))}),VC=L(`ZodTransform`,(e,t)=>{ox(),vd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>eb(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Wo(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(so(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(so(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}}),HC=L(`ZodOptional`,(e,t)=>{yd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yb(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),UC=L(`ZodExactOptional`,(e,t)=>{bd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yb(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),WC=L(`ZodNullable`,(e,t)=>{xd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ub(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),GC=L(`ZodDefault`,(e,t)=>{Sd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pb(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),KC=L(`ZodPrefault`,(e,t)=>{Cd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mb(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),qC=L(`ZodNonOptional`,(e,t)=>{wd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>db(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),JC=L(`ZodSuccess`,(e,t)=>{Td.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zy(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),YC=L(`ZodCatch`,(e,t)=>{Ed.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hb(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),XC=L(`ZodNaN`,(e,t)=>{Dd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jy(e,t,n,r)}),ZC=L(`ZodPipe`,(e,t)=>{Od.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gb(e,t,n,r),e.in=t.in,e.out=t.out}),QC=L(`ZodCodec`,(e,t)=>{ZC.init(e,t),kd.init(e,t)}),$C=L(`ZodPreprocess`,(e,t)=>{ZC.init(e,t),Ad.init(e,t)}),ew=L(`ZodReadonly`,(e,t)=>{V.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_b(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),tw=L(`ZodTemplateLiteral`,(e,t)=>{jd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yy(e,t,n,r)}),nw=L(`ZodLazy`,(e,t)=>{Pd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bb(e,t,n,r),e.unwrap=()=>e._zod.def.getter()}),rw=L(`ZodPromise`,(e,t)=>{Nd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vb(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),iw=L(`ZodFunction`,(e,t)=>{Md.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$y(e,t,n,r)}),aw=L(`ZodCustom`,(e,t)=>{Fd.init(e,t),Z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qy(e,t,n,r)}),ow=ay,sw=oy,cw=(...e)=>sy({Codec:QC,Boolean:_C,String:VS},...e)}));function uw(e){Lo({customError:e})}function dw(){return Lo().customError}var fw,pw,mw=t((()=>{Ob(),fw={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`},pw||={}})),hw=r({ZodISODate:()=>WS,ZodISODateTime:()=>US,ZodISODuration:()=>KS,ZodISOTime:()=>GS,date:()=>_w,datetime:()=>gw,duration:()=>yw,time:()=>vw});function gw(e){return D_(US,e)}function _w(e){return O_(WS,e)}function vw(e){return k_(GS,e)}function yw(e){return A_(KS,e)}var bw=t((()=>{Ob(),lw()}));function xw(e,t){let n=e.$schema;return n===`https://json-schema.org/draft/2020-12/schema`?`draft-2020-12`:n===`http://json-schema.org/draft-07/schema#`?`draft-7`:n===`http://json-schema.org/draft-04/schema#`?`draft-4`:t??`draft-2020-12`}function Sw(e,t){return e.map((e,n)=>n<t?e:e.optional())}function Cw(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function ww(e,t){if(!e.startsWith(`#`))throw Error(`External $ref is not supported, only local refs (#/...) are allowed`);let n=e.slice(1).split(`/`).filter(Boolean);if(n.length===0)return t.rootSchema;let r=t.version===`draft-2020-12`?`$defs`:`definitions`;if(n[0]===r){let r=n[1]===void 0?void 0:Cw(n[1]);if(!r||!t.defs[r])throw Error(`Reference not found: ${e}`);return t.defs[r]}throw Error(`Reference not found: ${e}`)}function Tw(e,t){return Q.transform(e=>e).check(e=>{let n=e.value;if(typeof n==`object`&&n&&!Array.isArray(n))for(let r of Object.getOwnPropertyNames(n)){let n=t.safeParse(r);n.success||e.issues.push({code:`invalid_key`,origin:`record`,issues:n.error.issues,input:r,path:[r],continue:!0})}}).pipe(e)}function Ew(e,t){if(e!==!1)return e===void 0||e===!0?Q.any():Ow(e,t)}function Dw(e,t){if(e.not!==void 0){if(typeof e.not==`object`&&Object.keys(e.not).length===0)return Q.never();throw Error(`not is not supported in Zod (except { not: {} } for never)`)}if(e.unevaluatedItems!==void 0)throw Error(`unevaluatedItems is not supported`);if(e.unevaluatedProperties!==void 0)throw Error(`unevaluatedProperties is not supported`);if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw Error(`Conditional schemas (if/then/else) are not supported`);if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw Error(`dependentSchemas and dependentRequired are not supported`);if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return Q.lazy(()=>{if(!t.refs.has(n))throw Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let r=Ow(ww(n,t),t);return t.refs.set(n,r),t.processing.delete(n),r}if(e.enum!==void 0){let n=e.enum;if(t.version===`openapi-3.0`&&e.nullable===!0&&n.length===1&&n[0]===null)return Q.null();if(n.length===0)return Q.never();if(n.length===1)return Q.literal(n[0]);if(n.every(e=>typeof e==`string`))return Q.enum(n);let r=n.map(e=>Q.literal(e));return r.length<2?r[0]:Q.union([r[0],r[1],...r.slice(2)])}if(e.const!==void 0)return Q.literal(e.const);let n=e.type;if(Array.isArray(n)){let r=n.map(n=>Dw({...e,type:n},t));return r.length===0?Q.never():r.length===1?r[0]:Q.union(r)}if(!n)return Q.any();let r;switch(n){case`string`:{let t=Q.string();if(e.format){let n=e.format;n===`email`?t=t.check(Q.email()):n===`uri`||n===`uri-reference`?t=t.check(Q.url()):n===`uuid`||n===`guid`?t=t.check(Q.uuid()):n===`date-time`?t=t.check(Q.iso.datetime({offset:!0})):n===`date`?t=t.check(Q.iso.date()):n===`time`?t=t.check(Q.regex(jw)):n===`duration`?t=t.check(Q.iso.duration()):n===`hostname`?t=t.check(Q.hostname()):n===`ipv4`?t=t.check(Q.ipv4()):n===`ipv6`?t=t.check(Q.ipv6()):n===`mac`?t=t.check(Q.mac()):n===`cidr`?t=t.check(Q.cidrv4()):n===`cidr-v6`?t=t.check(Q.cidrv6()):n===`base64`?t=t.check(Q.base64()):n===`base64url`?t=t.check(Q.base64url()):n===`e164`?t=t.check(Q.e164()):n===`credit_card`?t=t.check(Q.creditCard()):n===`jwt`?t=t.check(Q.jwt()):n===`emoji`?t=t.check(Q.emoji()):n===`nanoid`?t=t.check(Q.nanoid()):n===`cuid`?t=t.check(Q.cuid()):n===`cuid2`?t=t.check(Q.cuid2()):n===`ulid`?t=t.check(Q.ulid()):n===`xid`?t=t.check(Q.xid()):n===`ksuid`&&(t=t.check(Q.ksuid()))}typeof e.minLength==`number`&&(t=t.min(e.minLength)),typeof e.maxLength==`number`&&(t=t.max(e.maxLength)),e.pattern&&(t=t.regex(new RegExp(e.pattern))),r=t;break}case`number`:case`integer`:{let t=n===`integer`?Q.number().int():Q.number();typeof e.minimum==`number`&&e.exclusiveMinimum!==!0&&(t=t.min(e.minimum)),typeof e.maximum==`number`&&e.exclusiveMaximum!==!0&&(t=t.max(e.maximum)),typeof e.exclusiveMinimum==`number`?t=t.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum==`number`&&(t=t.gt(e.minimum)),typeof e.exclusiveMaximum==`number`?t=t.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum==`number`&&(t=t.lt(e.maximum)),typeof e.multipleOf==`number`&&(t=t.multipleOf(e.multipleOf)),r=t;break}case`boolean`:r=Q.boolean();break;case`null`:r=Q.null();break;case`object`:{let n={},i=e.properties||{},a=new Set(e.required||[]),o=typeof e.additionalProperties==`object`?Ow(e.additionalProperties,t):void 0;for(let[e,r]of Object.entries(i)){let i=Ow(r,t);ka(n,e,a.has(e)?i:i.optional())}if(e.patternProperties){let i=e.patternProperties,a=Object.keys(i),o=[];for(let e of a){let n=Ow(i[e],t),r=Q.string().regex(new RegExp(e));o.push(Q.looseRecord(r,n))}let s=[];if(Object.keys(n).length>0&&s.push(Q.object(n).passthrough()),s.push(...o),s.length===0)r=Q.object({}).passthrough();else if(s.length===1)r=s[0];else{let e=Q.intersection(s[0],s[1]);for(let t=2;t<s.length;t++)e=Q.intersection(e,s[t]);r=e}if(e.additionalProperties===!1){let e=Object.keys(n),t=a.map(e=>new RegExp(e)),i=r;r=r.check(n=>{if(!Ra(n.value))return;let r=[];for(let i of Object.keys(n.value))e.includes(i)||t.some(e=>e.test(i))||r.push(i);r.length&&n.issues.push({code:`unrecognized_keys`,keys:r,input:n.value,inst:i})})}}else{let t=Q.object(n);r=e.additionalProperties===!1?t.strict():o?t.catchall(o):t.passthrough()}if(e.propertyNames!==void 0&&e.propertyNames!==!0){let n=typeof e.propertyNames==`object`&&e.propertyNames.type===void 0?{type:`string`,...e.propertyNames}:e.propertyNames;r=Tw(r,Ow(n,t))}break}case`array`:{let n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){let a=typeof e.minItems==`number`?e.minItems:0,o=Sw(n.map(e=>Ow(e,t)),a),s=Array.isArray(i)?void 0:Ew(i,t),c=Q.tuple(o);r=s?c.rest(s):c,typeof e.minItems==`number`&&(r=r.check(Q.minLength(e.minItems))),typeof e.maxItems==`number`&&(r=r.check(Q.maxLength(e.maxItems)))}else if(Array.isArray(i)){let n=typeof e.minItems==`number`?e.minItems:0,a=Sw(i.map(e=>Ow(e,t)),n),o=Ew(e.additionalItems,t),s=Q.tuple(a);r=o?s.rest(o):s,typeof e.minItems==`number`&&(r=r.check(Q.minLength(e.minItems))),typeof e.maxItems==`number`&&(r=r.check(Q.maxLength(e.maxItems)))}else if(i!==void 0){let n=Ow(i,t),a=Q.array(n);typeof e.minItems==`number`&&(a=a.min(e.minItems)),typeof e.maxItems==`number`&&(a=a.max(e.maxItems)),r=a}else r=Q.array(Q.any());break}default:throw Error(`Unsupported type: ${n}`)}return r}function Ow(e,t){if(typeof e==`boolean`)return e?Q.any():Q.never();let n=Dw(e,t),r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let i=e.anyOf.map(e=>Ow(e,t)),a=Q.union(i);n=r?Q.intersection(n,a):a}if(e.oneOf&&Array.isArray(e.oneOf)){let i=e.oneOf.map(e=>Ow(e,t)),a=Q.xor(i);n=r?Q.intersection(n,a):a}if(e.allOf&&Array.isArray(e.allOf)){if(e.allOf.length===0)n=r?n:Q.any();else{let i=r?n:Ow(e.allOf[0],t),a=+!r;for(let n=a;n<e.allOf.length;n++)i=Q.intersection(i,Ow(e.allOf[n],t));n=i}}e.nullable===!0&&t.version===`openapi-3.0`&&(n=Q.nullable(n)),e.readOnly===!0&&(n=Q.readonly(n)),e.default!==void 0&&(n=n.default(e.default));let i={};for(let t of[`$id`,`id`,`$comment`,`$anchor`,`$vocabulary`,`$dynamicRef`,`$dynamicAnchor`])t in e&&(i[t]=e[t]);for(let t of[`contentEncoding`,`contentMediaType`,`contentSchema`])t in e&&(i[t]=e[t]);e.propertyNames!==void 0&&e.type===`object`&&e.$ref===void 0&&(i.propertyNames=e.propertyNames);for(let t of Object.keys(e))Aw.has(t)||ka(i,t,e[t]);return Object.keys(i).length>0&&t.registry.add(n,i),e.description&&(n=n.describe(e.description)),n}function kw(e,t){if(typeof e==`boolean`)return e?Q.any():Q.never();let n;try{n=JSON.parse(JSON.stringify(e))}catch{throw Error(`fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas`)}let r={version:xw(n,t?.defaultTarget),defs:n.$defs||n.definitions||{},refs:new Map,processing:new Set,rootSchema:n,registry:t?.registry??Nh};return Ow(n,r)}var Q,Aw,jw,Mw=t((()=>{Ph(),I(),Rb(),bw(),lw(),Q={...ix,...Lb,iso:hw},Aw=new Set(`$schema.$ref.$defs.definitions.$id.id.$comment.$anchor.$vocabulary.$dynamicRef.$dynamicAnchor.type.enum.const.anyOf.oneOf.allOf.not.properties.required.additionalProperties.patternProperties.propertyNames.minProperties.maxProperties.items.prefixItems.additionalItems.minItems.maxItems.uniqueItems.contains.minContains.maxContains.minLength.maxLength.pattern.format.minimum.maximum.exclusiveMinimum.exclusiveMaximum.multipleOf.description.default.contentEncoding.contentMediaType.contentSchema.unevaluatedItems.unevaluatedProperties.if.then.else.dependentSchemas.dependentRequired.nullable.readOnly`.split(`.`)),jw=/^(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/}));function Nw(e){return kb(e,{object:e=>e.partial(),union:e=>{let t=e._zod.def;return t.discriminator===void 0?e:Y(t.options)}})}var Pw=t((()=>{jb(),lw()}));function Fw(e,t){if(!t?.length)return e;let n=e._zod.def;return Ha(e,Aa(n,{checks:[...n.checks??[],...t]}),{parent:!0})}function Iw(e){return Fw(e.out,e.checks)}function Lw(e){return e.in._zod.traits.has(`$ZodTransform`)?Iw(e):e.in}function Rw(e){return kb(e,{pipe:e=>Lw(e._zod.def),default:(e,t)=>t?hS(e._zod.def.innerType):e,catch:(e,t)=>t?e._zod.def.innerType:e})}function zw(e){return kb(e,{pipe:e=>Iw(e._zod.def),prefault:(e,t)=>t?e._zod.def.innerType:e})}var Bw=t((()=>{I(),jb(),lw()})),Vw=r({bigint:()=>Gw,boolean:()=>Ww,date:()=>Kw,number:()=>Uw,string:()=>Hw});function Hw(e){return n_(VS,e)}function Uw(e){return M_(hC,e)}function Ww(e){return z_(_C,e)}function Gw(e){return V_(vC,e)}function Kw(e){return Q_(DC,e)}var qw=t((()=>{Ob(),lw()})),Jw=r({$brand:()=>Ho,$input:()=>jh,$output:()=>Ah,NEVER:()=>zo,TimePrecision:()=>ly,ZodAny:()=>CC,ZodArray:()=>OC,ZodBase64:()=>lC,ZodBase64URL:()=>uC,ZodBigInt:()=>vC,ZodBigIntFormat:()=>yC,ZodBoolean:()=>_C,ZodCIDRv4:()=>sC,ZodCIDRv6:()=>cC,ZodCUID:()=>$S,ZodCUID2:()=>eC,ZodCatch:()=>YC,ZodCodec:()=>QC,ZodCompileAsyncError:()=>Xg,ZodCompileUnsupportedError:()=>Zg,ZodCreditCard:()=>fC,ZodCustom:()=>aw,ZodCustomStringFormat:()=>mC,ZodDate:()=>DC,ZodDefault:()=>GC,ZodDiscriminatedUnion:()=>MC,ZodE164:()=>dC,ZodEmail:()=>qS,ZodEmoji:()=>ZS,ZodEnum:()=>RC,ZodError:()=>Hb,ZodExactOptional:()=>UC,ZodFile:()=>BC,ZodFirstPartyTypeKind:()=>pw,ZodFunction:()=>iw,ZodGUID:()=>JS,ZodIPv4:()=>iC,ZodIPv6:()=>oC,ZodISODate:()=>WS,ZodISODateTime:()=>US,ZodISODuration:()=>KS,ZodISOTime:()=>GS,ZodIntersection:()=>NC,ZodIssueCode:()=>fw,ZodJWT:()=>pC,ZodKSUID:()=>rC,ZodLazy:()=>nw,ZodLiteral:()=>zC,ZodMAC:()=>aC,ZodMap:()=>IC,ZodNaN:()=>XC,ZodNanoID:()=>QS,ZodNever:()=>TC,ZodNonOptional:()=>qC,ZodNull:()=>SC,ZodNullable:()=>WC,ZodNumber:()=>hC,ZodNumberFormat:()=>gC,ZodObject:()=>kC,ZodOptional:()=>HC,ZodPipe:()=>ZC,ZodPrefault:()=>KC,ZodPreprocess:()=>$C,ZodPromise:()=>rw,ZodReadonly:()=>ew,ZodRealError:()=>Ub,ZodRecord:()=>FC,ZodSet:()=>LC,ZodString:()=>VS,ZodStringFormat:()=>HS,ZodSuccess:()=>JC,ZodSymbol:()=>bC,ZodTemplateLiteral:()=>tw,ZodTransform:()=>VC,ZodTuple:()=>PC,ZodType:()=>Z,ZodULID:()=>tC,ZodURL:()=>XS,ZodUUID:()=>YS,ZodUndefined:()=>xC,ZodUnion:()=>AC,ZodUnknown:()=>wC,ZodVoid:()=>EC,ZodXID:()=>nC,ZodXor:()=>jC,_ZodString:()=>BS,_default:()=>yS,_function:()=>MS,any:()=>Jx,array:()=>q,base64:()=>Dx,base64url:()=>Ox,bigint:()=>Hx,boolean:()=>Vx,catch:()=>CS,check:()=>NS,cidrv4:()=>Tx,cidrv6:()=>Ex,clone:()=>Ha,codec:()=>ES,coerce:()=>Vw,compile:()=>Ih,config:()=>Lo,core:()=>Db,creditCard:()=>Ax,cuid:()=>_x,cuid2:()=>vx,custom:()=>PS,date:()=>Qx,decode:()=>Xb,decodeAsync:()=>Qb,deepPartial:()=>Nw,describe:()=>ow,discriminatedUnion:()=>rS,e164:()=>kx,email:()=>sx,emoji:()=>hx,encode:()=>Yb,encodeAsync:()=>Zb,endsWith:()=>bv,enum:()=>dS,exactOptional:()=>gS,file:()=>pS,flattenError:()=>Xo,float32:()=>Lx,float64:()=>Rx,formatError:()=>Zo,fromJSONSchema:()=>kw,function:()=>MS,getDiscriminatedOption:()=>z,getErrorMap:()=>dw,globalRegistry:()=>Nh,gt:()=>nv,gte:()=>rv,guid:()=>cx,hash:()=>Fx,hex:()=>Px,hostname:()=>Nx,httpUrl:()=>mx,includes:()=>vv,input:()=>Rw,instanceof:()=>LS,int:()=>Ix,int32:()=>zx,int64:()=>Ux,intersection:()=>iS,invertCodec:()=>DS,ipv4:()=>Sx,ipv6:()=>wx,iso:()=>hw,json:()=>RS,jwt:()=>jx,keyof:()=>$x,ksuid:()=>xx,lazy:()=>AS,length:()=>mv,literal:()=>X,locales:()=>Eh,looseObject:()=>tS,looseRecord:()=>cS,lowercase:()=>gv,lt:()=>ev,lte:()=>tv,mac:()=>Cx,map:()=>lS,maxLength:()=>fv,maxSize:()=>lv,memoizer:()=>Vd,meta:()=>sw,mime:()=>Cv,minLength:()=>pv,minSize:()=>uv,multipleOf:()=>cv,nan:()=>wS,nanoid:()=>gx,nativeEnum:()=>fS,negative:()=>av,never:()=>Xx,nonnegative:()=>sv,nonoptional:()=>xS,nonpositive:()=>ov,normalize:()=>Tv,null:()=>qx,nullable:()=>_S,nullish:()=>vS,number:()=>K,object:()=>J,optional:()=>hS,output:()=>zw,overwrite:()=>wv,parse:()=>Gb,parseAsync:()=>Kb,partialRecord:()=>sS,pipe:()=>TS,positive:()=>iv,prefault:()=>bS,preprocess:()=>zS,prettifyError:()=>es,promise:()=>jS,properties:()=>Sv,property:()=>xv,readonly:()=>OS,record:()=>oS,refine:()=>FS,regex:()=>hv,regexes:()=>Bs,registry:()=>Oh,safeDecode:()=>ex,safeDecodeAsync:()=>nx,safeEncode:()=>$b,safeEncodeAsync:()=>tx,safeParse:()=>qb,safeParseAsync:()=>Jb,set:()=>uS,setErrorMap:()=>uw,size:()=>dv,slugify:()=>kv,startsWith:()=>yv,strictObject:()=>eS,string:()=>G,stringFormat:()=>Mx,stringbool:()=>cw,success:()=>SS,superRefine:()=>IS,symbol:()=>Gx,templateLiteral:()=>kS,toJSONSchema:()=>My,toLowerCase:()=>Dv,toUpperCase:()=>Ov,toZod:()=>_a,transform:()=>mS,treeifyError:()=>Qo,trim:()=>Ev,tuple:()=>aS,uint32:()=>Bx,uint64:()=>Wx,ulid:()=>yx,undefined:()=>Kx,union:()=>Y,unknown:()=>Yx,uppercase:()=>_v,url:()=>px,util:()=>ma,uuid:()=>lx,uuidv4:()=>ux,uuidv6:()=>dx,uuidv7:()=>fx,validate:()=>xs,validateAsync:()=>Ss,void:()=>Zx,xid:()=>bx,xor:()=>nS}),Yw=t((()=>{Ob(),lw(),Rb(),Wb(),rx(),mw(),Sb(),Mw(),Pw(),Bw(),Dh(),bw(),qw()})),Xw=t((()=>{Yw(),Yw()})),Zw=r({$brand:()=>Ho,$input:()=>jh,$output:()=>Ah,NEVER:()=>zo,TimePrecision:()=>ly,ZodAny:()=>CC,ZodArray:()=>OC,ZodBase64:()=>lC,ZodBase64URL:()=>uC,ZodBigInt:()=>vC,ZodBigIntFormat:()=>yC,ZodBoolean:()=>_C,ZodCIDRv4:()=>sC,ZodCIDRv6:()=>cC,ZodCUID:()=>$S,ZodCUID2:()=>eC,ZodCatch:()=>YC,ZodCodec:()=>QC,ZodCompileAsyncError:()=>Xg,ZodCompileUnsupportedError:()=>Zg,ZodCreditCard:()=>fC,ZodCustom:()=>aw,ZodCustomStringFormat:()=>mC,ZodDate:()=>DC,ZodDefault:()=>GC,ZodDiscriminatedUnion:()=>MC,ZodE164:()=>dC,ZodEmail:()=>qS,ZodEmoji:()=>ZS,ZodEnum:()=>RC,ZodError:()=>Hb,ZodExactOptional:()=>UC,ZodFile:()=>BC,ZodFirstPartyTypeKind:()=>pw,ZodFunction:()=>iw,ZodGUID:()=>JS,ZodIPv4:()=>iC,ZodIPv6:()=>oC,ZodISODate:()=>WS,ZodISODateTime:()=>US,ZodISODuration:()=>KS,ZodISOTime:()=>GS,ZodIntersection:()=>NC,ZodIssueCode:()=>fw,ZodJWT:()=>pC,ZodKSUID:()=>rC,ZodLazy:()=>nw,ZodLiteral:()=>zC,ZodMAC:()=>aC,ZodMap:()=>IC,ZodNaN:()=>XC,ZodNanoID:()=>QS,ZodNever:()=>TC,ZodNonOptional:()=>qC,ZodNull:()=>SC,ZodNullable:()=>WC,ZodNumber:()=>hC,ZodNumberFormat:()=>gC,ZodObject:()=>kC,ZodOptional:()=>HC,ZodPipe:()=>ZC,ZodPrefault:()=>KC,ZodPreprocess:()=>$C,ZodPromise:()=>rw,ZodReadonly:()=>ew,ZodRealError:()=>Ub,ZodRecord:()=>FC,ZodSet:()=>LC,ZodString:()=>VS,ZodStringFormat:()=>HS,ZodSuccess:()=>JC,ZodSymbol:()=>bC,ZodTemplateLiteral:()=>tw,ZodTransform:()=>VC,ZodTuple:()=>PC,ZodType:()=>Z,ZodULID:()=>tC,ZodURL:()=>XS,ZodUUID:()=>YS,ZodUndefined:()=>xC,ZodUnion:()=>AC,ZodUnknown:()=>wC,ZodVoid:()=>EC,ZodXID:()=>nC,ZodXor:()=>jC,_ZodString:()=>BS,_default:()=>yS,_function:()=>MS,any:()=>Jx,array:()=>q,base64:()=>Dx,base64url:()=>Ox,bigint:()=>Hx,boolean:()=>Vx,catch:()=>CS,check:()=>NS,cidrv4:()=>Tx,cidrv6:()=>Ex,clone:()=>Ha,codec:()=>ES,coerce:()=>Vw,compile:()=>Ih,config:()=>Lo,core:()=>Db,creditCard:()=>Ax,cuid:()=>_x,cuid2:()=>vx,custom:()=>PS,date:()=>Qx,decode:()=>Xb,decodeAsync:()=>Qb,deepPartial:()=>Nw,default:()=>Jw,describe:()=>ow,discriminatedUnion:()=>rS,e164:()=>kx,email:()=>sx,emoji:()=>hx,encode:()=>Yb,encodeAsync:()=>Zb,endsWith:()=>bv,enum:()=>dS,exactOptional:()=>gS,file:()=>pS,flattenError:()=>Xo,float32:()=>Lx,float64:()=>Rx,formatError:()=>Zo,fromJSONSchema:()=>kw,function:()=>MS,getDiscriminatedOption:()=>z,getErrorMap:()=>dw,globalRegistry:()=>Nh,gt:()=>nv,gte:()=>rv,guid:()=>cx,hash:()=>Fx,hex:()=>Px,hostname:()=>Nx,httpUrl:()=>mx,includes:()=>vv,input:()=>Rw,instanceof:()=>LS,int:()=>Ix,int32:()=>zx,int64:()=>Ux,intersection:()=>iS,invertCodec:()=>DS,ipv4:()=>Sx,ipv6:()=>wx,iso:()=>hw,json:()=>RS,jwt:()=>jx,keyof:()=>$x,ksuid:()=>xx,lazy:()=>AS,length:()=>mv,literal:()=>X,locales:()=>Eh,looseObject:()=>tS,looseRecord:()=>cS,lowercase:()=>gv,lt:()=>ev,lte:()=>tv,mac:()=>Cx,map:()=>lS,maxLength:()=>fv,maxSize:()=>lv,memoizer:()=>Vd,meta:()=>sw,mime:()=>Cv,minLength:()=>pv,minSize:()=>uv,multipleOf:()=>cv,nan:()=>wS,nanoid:()=>gx,nativeEnum:()=>fS,negative:()=>av,never:()=>Xx,nonnegative:()=>sv,nonoptional:()=>xS,nonpositive:()=>ov,normalize:()=>Tv,null:()=>qx,nullable:()=>_S,nullish:()=>vS,number:()=>K,object:()=>J,optional:()=>hS,output:()=>zw,overwrite:()=>wv,parse:()=>Gb,parseAsync:()=>Kb,partialRecord:()=>sS,pipe:()=>TS,positive:()=>iv,prefault:()=>bS,preprocess:()=>zS,prettifyError:()=>es,promise:()=>jS,properties:()=>Sv,property:()=>xv,readonly:()=>OS,record:()=>oS,refine:()=>FS,regex:()=>hv,regexes:()=>Bs,registry:()=>Oh,safeDecode:()=>ex,safeDecodeAsync:()=>nx,safeEncode:()=>$b,safeEncodeAsync:()=>tx,safeParse:()=>qb,safeParseAsync:()=>Jb,set:()=>uS,setErrorMap:()=>uw,size:()=>dv,slugify:()=>kv,startsWith:()=>yv,strictObject:()=>eS,string:()=>G,stringFormat:()=>Mx,stringbool:()=>cw,success:()=>SS,superRefine:()=>IS,symbol:()=>Gx,templateLiteral:()=>kS,toJSONSchema:()=>My,toLowerCase:()=>Dv,toUpperCase:()=>Ov,toZod:()=>_a,transform:()=>mS,treeifyError:()=>Qo,trim:()=>Ev,tuple:()=>aS,uint32:()=>Bx,uint64:()=>Wx,ulid:()=>yx,undefined:()=>Kx,union:()=>Y,unknown:()=>Yx,uppercase:()=>_v,url:()=>px,util:()=>ma,uuid:()=>lx,uuidv4:()=>ux,uuidv6:()=>dx,uuidv7:()=>fx,validate:()=>xs,validateAsync:()=>Ss,void:()=>Zx,xid:()=>bx,xor:()=>nS,z:()=>Jw}),Qw=t((()=>{Yw(),Xw()}));Qw();var $w=`io.modelcontextprotocol/related-task`,eT=PS(e=>e!==null&&(typeof e==`object`||typeof e==`function`)),tT=Y([G(),K().int()]),nT=G();tS({ttl:K().optional(),pollInterval:K().optional()});var rT=J({ttl:K().optional()}),iT=J({taskId:G()}),aT=tS({progressToken:tT.optional(),[$w]:iT.optional()}),oT=J({_meta:aT.optional()}),sT=oT.extend({task:rT.optional()}),cT=e=>sT.safeParse(e).success,lT=J({method:G(),params:oT.loose().optional()}),uT=J({_meta:aT.optional()}),dT=J({method:G(),params:uT.loose().optional()}),fT=tS({_meta:aT.optional()}),pT=Y([G(),K().int()]),mT=J({jsonrpc:X(`2.0`),id:pT,...lT.shape}).strict(),hT=e=>mT.safeParse(e).success,gT=J({jsonrpc:X(`2.0`),...dT.shape}).strict(),_T=e=>gT.safeParse(e).success,vT=J({jsonrpc:X(`2.0`),id:pT,result:fT}).strict(),yT=e=>vT.safeParse(e).success,bT;(function(e){e[e.ConnectionClosed=-32e3]=`ConnectionClosed`,e[e.RequestTimeout=-32001]=`RequestTimeout`,e[e.ParseError=-32700]=`ParseError`,e[e.InvalidRequest=-32600]=`InvalidRequest`,e[e.MethodNotFound=-32601]=`MethodNotFound`,e[e.InvalidParams=-32602]=`InvalidParams`,e[e.InternalError=-32603]=`InternalError`,e[e.UrlElicitationRequired=-32042]=`UrlElicitationRequired`})(bT||={});var xT=J({jsonrpc:X(`2.0`),id:pT.optional(),error:J({code:K().int(),message:G(),data:Yx().optional()})}).strict(),ST=e=>xT.safeParse(e).success,CT=Y([mT,gT,vT,xT]);Y([vT,xT]);var wT=fT.strict(),TT=uT.extend({requestId:pT.optional(),reason:G().optional()}),ET=dT.extend({method:X(`notifications/cancelled`),params:TT}),DT=J({icons:q(J({src:G(),mimeType:G().optional(),sizes:q(G()).optional(),theme:dS([`light`,`dark`]).optional()})).optional()}),OT=J({name:G(),title:G().optional()}),kT=OT.extend({...OT.shape,...DT.shape,version:G(),websiteUrl:G().optional(),description:G().optional()}),AT=zS(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,iS(J({form:iS(J({applyDefaults:Vx().optional()}),oS(G(),Yx())).optional(),url:eT.optional()}),oS(G(),Yx()).optional())),jT=tS({list:eT.optional(),cancel:eT.optional(),requests:tS({sampling:tS({createMessage:eT.optional()}).optional(),elicitation:tS({create:eT.optional()}).optional()}).optional()}),MT=tS({list:eT.optional(),cancel:eT.optional(),requests:tS({tools:tS({call:eT.optional()}).optional()}).optional()}),NT=J({experimental:oS(G(),eT).optional(),sampling:J({context:eT.optional(),tools:eT.optional()}).optional(),elicitation:AT.optional(),roots:J({listChanged:Vx().optional()}).optional(),tasks:jT.optional(),extensions:oS(G(),eT).optional()}),PT=oT.extend({protocolVersion:G(),capabilities:NT,clientInfo:kT}),FT=lT.extend({method:X(`initialize`),params:PT}),IT=J({experimental:oS(G(),eT).optional(),logging:eT.optional(),completions:eT.optional(),prompts:J({listChanged:Vx().optional()}).optional(),resources:J({subscribe:Vx().optional(),listChanged:Vx().optional()}).optional(),tools:J({listChanged:Vx().optional()}).optional(),tasks:MT.optional(),extensions:oS(G(),eT).optional()}),LT=fT.extend({protocolVersion:G(),capabilities:IT,serverInfo:kT,instructions:G().optional()}),RT=dT.extend({method:X(`notifications/initialized`),params:uT.optional()}),zT=lT.extend({method:X(`ping`),params:oT.optional()}),BT=J({progress:K(),total:hS(K()),message:hS(G())}),VT=J({...uT.shape,...BT.shape,progressToken:tT}),HT=dT.extend({method:X(`notifications/progress`),params:VT}),UT=oT.extend({cursor:nT.optional()}),WT=lT.extend({params:UT.optional()}),GT=fT.extend({nextCursor:nT.optional()}),KT=dS([`working`,`input_required`,`completed`,`failed`,`cancelled`]),qT=J({taskId:G(),status:KT,ttl:Y([K(),qx()]),createdAt:G(),lastUpdatedAt:G(),pollInterval:hS(K()),statusMessage:hS(G())}),JT=fT.extend({task:qT}),YT=uT.merge(qT),XT=dT.extend({method:X(`notifications/tasks/status`),params:YT}),ZT=lT.extend({method:X(`tasks/get`),params:oT.extend({taskId:G()})}),QT=fT.merge(qT),$T=lT.extend({method:X(`tasks/result`),params:oT.extend({taskId:G()})});fT.loose();var eE=WT.extend({method:X(`tasks/list`)}),tE=GT.extend({tasks:q(qT)}),nE=lT.extend({method:X(`tasks/cancel`),params:oT.extend({taskId:G()})}),rE=fT.merge(qT),iE=J({uri:G(),mimeType:hS(G()),_meta:oS(G(),Yx()).optional()}),aE=iE.extend({text:G()}),oE=G().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),sE=iE.extend({blob:oE}),cE=dS([`user`,`assistant`]),lE=J({audience:q(cE).optional(),priority:K().min(0).max(1).optional(),lastModified:gw({offset:!0}).optional()}),uE=J({...OT.shape,...DT.shape,uri:G(),description:hS(G()),mimeType:hS(G()),size:hS(K()),annotations:lE.optional(),_meta:hS(tS({}))}),dE=J({...OT.shape,...DT.shape,uriTemplate:G(),description:hS(G()),mimeType:hS(G()),annotations:lE.optional(),_meta:hS(tS({}))}),fE=WT.extend({method:X(`resources/list`)}),pE=GT.extend({resources:q(uE)}),mE=WT.extend({method:X(`resources/templates/list`)}),hE=GT.extend({resourceTemplates:q(dE)}),gE=oT.extend({uri:G()}),_E=gE,vE=lT.extend({method:X(`resources/read`),params:_E}),yE=fT.extend({contents:q(Y([aE,sE]))}),bE=dT.extend({method:X(`notifications/resources/list_changed`),params:uT.optional()}),xE=gE,SE=lT.extend({method:X(`resources/subscribe`),params:xE}),CE=gE,wE=lT.extend({method:X(`resources/unsubscribe`),params:CE}),TE=uT.extend({uri:G()}),EE=dT.extend({method:X(`notifications/resources/updated`),params:TE}),DE=J({name:G(),description:hS(G()),required:hS(Vx())}),OE=J({...OT.shape,...DT.shape,description:hS(G()),arguments:hS(q(DE)),_meta:hS(tS({}))}),kE=WT.extend({method:X(`prompts/list`)}),AE=GT.extend({prompts:q(OE)}),jE=oT.extend({name:G(),arguments:oS(G(),G()).optional()}),ME=lT.extend({method:X(`prompts/get`),params:jE}),NE=J({type:X(`text`),text:G(),annotations:lE.optional(),_meta:oS(G(),Yx()).optional()}),PE=J({type:X(`image`),data:oE,mimeType:G(),annotations:lE.optional(),_meta:oS(G(),Yx()).optional()}),FE=J({type:X(`audio`),data:oE,mimeType:G(),annotations:lE.optional(),_meta:oS(G(),Yx()).optional()}),IE=J({type:X(`tool_use`),name:G(),id:G(),input:oS(G(),Yx()),_meta:oS(G(),Yx()).optional()}),LE=J({type:X(`resource`),resource:Y([aE,sE]),annotations:lE.optional(),_meta:oS(G(),Yx()).optional()}),RE=uE.extend({type:X(`resource_link`)}),zE=Y([NE,PE,FE,RE,LE]),BE=J({role:cE,content:zE}),VE=fT.extend({description:G().optional(),messages:q(BE)}),HE=dT.extend({method:X(`notifications/prompts/list_changed`),params:uT.optional()}),UE=J({title:G().optional(),readOnlyHint:Vx().optional(),destructiveHint:Vx().optional(),idempotentHint:Vx().optional(),openWorldHint:Vx().optional()}),WE=J({taskSupport:dS([`required`,`optional`,`forbidden`]).optional()}),GE=J({...OT.shape,...DT.shape,description:G().optional(),inputSchema:J({type:X(`object`),properties:oS(G(),eT).optional(),required:q(G()).optional()}).catchall(Yx()),outputSchema:J({type:X(`object`),properties:oS(G(),eT).optional(),required:q(G()).optional()}).catchall(Yx()).optional(),annotations:UE.optional(),execution:WE.optional(),_meta:oS(G(),Yx()).optional()}),KE=WT.extend({method:X(`tools/list`)}),qE=GT.extend({tools:q(GE)}),JE=fT.extend({content:q(zE).default([]),structuredContent:oS(G(),Yx()).optional(),isError:Vx().optional()});JE.or(fT.extend({toolResult:Yx()}));var YE=sT.extend({name:G(),arguments:oS(G(),Yx()).optional()}),XE=lT.extend({method:X(`tools/call`),params:YE}),ZE=dT.extend({method:X(`notifications/tools/list_changed`),params:uT.optional()});J({autoRefresh:Vx().default(!0),debounceMs:K().int().nonnegative().default(300)});var QE=dS([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),$E=oT.extend({level:QE}),eD=lT.extend({method:X(`logging/setLevel`),params:$E}),tD=uT.extend({level:QE,logger:G().optional(),data:Yx()}),nD=dT.extend({method:X(`notifications/message`),params:tD}),rD=J({hints:q(J({name:G().optional()})).optional(),costPriority:K().min(0).max(1).optional(),speedPriority:K().min(0).max(1).optional(),intelligencePriority:K().min(0).max(1).optional()}),iD=J({mode:dS([`auto`,`required`,`none`]).optional()}),aD=J({type:X(`tool_result`),toolUseId:G().describe(`The unique identifier for the corresponding tool call.`),content:q(zE).default([]),structuredContent:J({}).loose().optional(),isError:Vx().optional(),_meta:oS(G(),Yx()).optional()}),oD=rS(`type`,[NE,PE,FE]),sD=rS(`type`,[NE,PE,FE,IE,aD]),cD=J({role:cE,content:Y([sD,q(sD)]),_meta:oS(G(),Yx()).optional()}),lD=sT.extend({messages:q(cD),modelPreferences:rD.optional(),systemPrompt:G().optional(),includeContext:dS([`none`,`thisServer`,`allServers`]).optional(),temperature:K().optional(),maxTokens:K().int(),stopSequences:q(G()).optional(),metadata:eT.optional(),tools:q(GE).optional(),toolChoice:iD.optional()}),uD=lT.extend({method:X(`sampling/createMessage`),params:lD}),dD=fT.extend({model:G(),stopReason:hS(dS([`endTurn`,`stopSequence`,`maxTokens`]).or(G())),role:cE,content:oD}),fD=fT.extend({model:G(),stopReason:hS(dS([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(G())),role:cE,content:Y([sD,q(sD)])}),pD=J({type:X(`boolean`),title:G().optional(),description:G().optional(),default:Vx().optional()}),mD=J({type:X(`string`),title:G().optional(),description:G().optional(),minLength:K().optional(),maxLength:K().optional(),format:dS([`email`,`uri`,`date`,`date-time`]).optional(),default:G().optional()}),hD=J({type:dS([`number`,`integer`]),title:G().optional(),description:G().optional(),minimum:K().optional(),maximum:K().optional(),default:K().optional()}),gD=J({type:X(`string`),title:G().optional(),description:G().optional(),enum:q(G()),default:G().optional()}),_D=J({type:X(`string`),title:G().optional(),description:G().optional(),oneOf:q(J({const:G(),title:G()})),default:G().optional()}),vD=Y([Y([J({type:X(`string`),title:G().optional(),description:G().optional(),enum:q(G()),enumNames:q(G()).optional(),default:G().optional()}),Y([gD,_D]),Y([J({type:X(`array`),title:G().optional(),description:G().optional(),minItems:K().optional(),maxItems:K().optional(),items:J({type:X(`string`),enum:q(G())}),default:q(G()).optional()}),J({type:X(`array`),title:G().optional(),description:G().optional(),minItems:K().optional(),maxItems:K().optional(),items:J({anyOf:q(J({const:G(),title:G()}))}),default:q(G()).optional()})])]),pD,mD,hD]),yD=Y([sT.extend({mode:X(`form`).optional(),message:G(),requestedSchema:J({type:X(`object`),properties:oS(G(),vD),required:q(G()).optional()})}),sT.extend({mode:X(`url`),message:G(),elicitationId:G(),url:G().url()})]),bD=lT.extend({method:X(`elicitation/create`),params:yD}),xD=uT.extend({elicitationId:G()}),SD=dT.extend({method:X(`notifications/elicitation/complete`),params:xD}),CD=fT.extend({action:dS([`accept`,`decline`,`cancel`]),content:zS(e=>e===null?void 0:e,oS(G(),Y([G(),K(),Vx(),q(G())])).optional())}),wD=J({type:X(`ref/resource`),uri:G()}),TD=J({type:X(`ref/prompt`),name:G()}),ED=oT.extend({ref:Y([TD,wD]),argument:J({name:G(),value:G()}),context:J({arguments:oS(G(),G()).optional()}).optional()}),DD=lT.extend({method:X(`completion/complete`),params:ED}),OD=fT.extend({completion:tS({values:q(G()).max(100),total:hS(K().int()),hasMore:hS(Vx())})}),kD=J({uri:G().startsWith(`file://`),name:G().optional(),_meta:oS(G(),Yx()).optional()}),AD=lT.extend({method:X(`roots/list`),params:oT.optional()}),jD=fT.extend({roots:q(kD)}),MD=dT.extend({method:X(`notifications/roots/list_changed`),params:uT.optional()});Y([zT,FT,DD,eD,ME,kE,fE,mE,vE,SE,wE,XE,KE,ZT,$T,eE,nE]),Y([ET,HT,RT,MD,XT]),Y([wT,dD,fD,CD,jD,QT,tE,JT]),Y([zT,uD,bD,AD,ZT,$T,eE,nE]),Y([ET,HT,nD,EE,bE,ZE,HE,XT,SD]),Y([wT,LT,OD,VE,AE,pE,hE,yE,JE,qE,QT,tE,JT]);var ND=class e extends Error{constructor(e,t,n){super(`MCP error ${e}: ${t}`),this.code=e,this.data=n,this.name=`McpError`}static fromError(t,n,r){if(t===bT.UrlElicitationRequired&&r){let e=r;if(e.elicitations)return new PD(e.elicitations,n)}return new e(t,n,r)}},PD=class extends ND{constructor(e,t=`URL elicitation${e.length>1?`s`:``} required`){super(bT.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};function FD(e){return e===`completed`||e===`failed`||e===`cancelled`}function ID(e){let t=Fb(e)?.method;if(!t)throw Error(`Schema is missing a method literal`);let n=Ib(t);if(typeof n!=`string`)throw Error(`Schema method literal must be a string`);return n}function LD(e,t){let n=Pb(e,t);if(!n.success)throw n.error;return n.data}var RD=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(ET,e=>{this._oncancel(e)}),this.setNotificationHandler(HT,e=>{this._onprogress(e)}),this.setRequestHandler(zT,e=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(ZT,async(e,t)=>{let n=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!n)throw new ND(bT.InvalidParams,`Failed to retrieve task: Task not found`);return{...n}}),this.setRequestHandler($T,async(e,t)=>{let n=async()=>{let r=e.params.taskId;if(this._taskMessageQueue){let e;for(;e=await this._taskMessageQueue.dequeue(r,t.sessionId);){if(e.type===`response`||e.type===`error`){let t=e.message,n=t.id,r=this._requestResolvers.get(n);if(r){if(this._requestResolvers.delete(n),e.type===`response`)r(t);else{let e=t;r(new ND(e.error.code,e.error.message,e.error.data))}}else{let t=e.type===`response`?`Response`:`Error`;this._onerror(Error(`${t} handler missing for request ${n}`))}continue}await this._transport?.send(e.message,{relatedRequestId:t.requestId})}}let i=await this._taskStore.getTask(r,t.sessionId);if(!i)throw new ND(bT.InvalidParams,`Task not found: ${r}`);if(!FD(i.status))return await this._waitForTaskUpdate(r,t.signal),await n();if(FD(i.status)){let e=await this._taskStore.getTaskResult(r,t.sessionId);return this._clearTaskQueue(r),{...e,_meta:{...e._meta,[$w]:{taskId:r}}}}return await n()};return await n()}),this.setRequestHandler(eE,async(e,t)=>{try{let{tasks:n,nextCursor:r}=await this._taskStore.listTasks(e.params?.cursor,t.sessionId);return{tasks:n,nextCursor:r,_meta:{}}}catch(e){throw new ND(bT.InvalidParams,`Failed to list tasks: ${e instanceof Error?e.message:String(e)}`)}}),this.setRequestHandler(nE,async(e,t)=>{try{let n=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!n)throw new ND(bT.InvalidParams,`Task not found: ${e.params.taskId}`);if(FD(n.status))throw new ND(bT.InvalidParams,`Cannot cancel task in terminal status: ${n.status}`);await this._taskStore.updateTaskStatus(e.params.taskId,`cancelled`,`Client cancelled task execution.`,t.sessionId),this._clearTaskQueue(e.params.taskId);let r=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!r)throw new ND(bT.InvalidParams,`Task not found after cancellation: ${e.params.taskId}`);return{_meta:{},...r}}catch(e){throw e instanceof ND?e:new ND(bT.InvalidRequest,`Failed to cancel task: ${e instanceof Error?e.message:String(e)}`)}}))}async _oncancel(e){e.params.requestId&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,r,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),ND.fromError(bT.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw Error(`Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.`);this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=e=>{n?.(e),this._onerror(e)};let r=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{r?.(e,t),yT(e)||ST(e)?this._onresponse(e):hT(e)?this._onrequest(e,t):_T(e)?this._onnotification(e):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let e of this._timeoutInfo.values())clearTimeout(e.timeoutId);this._timeoutInfo.clear();for(let e of this._requestHandlerAbortControllers.values())e.abort();this._requestHandlerAbortControllers.clear();let t=ND.fromError(bT.ConnectionClosed,`Connection closed`);this._transport=void 0,this.onclose?.();for(let n of e.values())n(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){let t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,i=e.params?._meta?.[$w]?.taskId;if(n===void 0){let t={jsonrpc:`2.0`,id:e.id,error:{code:bT.MethodNotFound,message:`Method not found`}};i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:`error`,message:t,timestamp:Date.now()},r?.sessionId).catch(e=>this._onerror(Error(`Failed to enqueue error response: ${e}`))):r?.send(t).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)));return}let a=new AbortController;this._requestHandlerAbortControllers.set(e.id,a);let o=cT(e.params)?e.params.task:void 0,s=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,c={signal:a.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async t=>{if(a.signal.aborted)return;let n={relatedRequestId:e.id};i&&(n.relatedTask={taskId:i}),await this.notification(t,n)},sendRequest:async(t,n,r)=>{if(a.signal.aborted)throw new ND(bT.ConnectionClosed,`Request was cancelled`);let o={...r,relatedRequestId:e.id};i&&!o.relatedTask&&(o.relatedTask={taskId:i});let c=o.relatedTask?.taskId??i;return c&&s&&await s.updateTaskStatus(c,`input_required`),await this.request(t,n,o)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:i,taskStore:s,taskRequestedTtl:o?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{o&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,c)).then(async t=>{if(a.signal.aborted)return;let n={result:t,jsonrpc:`2.0`,id:e.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:`response`,message:n,timestamp:Date.now()},r?.sessionId):await r?.send(n)},async t=>{if(a.signal.aborted)return;let n={jsonrpc:`2.0`,id:e.id,error:{code:Number.isSafeInteger(t.code)?t.code:bT.InternalError,message:t.message??`Internal error`,...t.data!==void 0&&{data:t.data}}};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:`error`,message:n,timestamp:Date.now()},r?.sessionId):await r?.send(n)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===a&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,r=Number(t),i=this._progressHandlers.get(r);if(!i){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(r),o=this._timeoutInfo.get(r);if(o&&a&&o.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(e){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),a(e);return}i(n)}_onresponse(e){let t=Number(e.id),n=this._requestResolvers.get(t);if(n){this._requestResolvers.delete(t),yT(e)?n(e):n(new ND(e.error.code,e.error.message,e.error.data));return}let r=this._responseHandlers.get(t);if(r===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let i=!1;if(yT(e)&&e.result&&typeof e.result==`object`){let n=e.result;if(n.task&&typeof n.task==`object`){let e=n.task;typeof e.taskId==`string`&&(i=!0,this._taskProgressTokens.set(e.taskId,t))}}i||this._progressHandlers.delete(t),yT(e)?r(e):r(ND.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,n){let{task:r}=n??{};if(!r){try{yield{type:`result`,result:await this.request(e,t,n)}}catch(e){yield{type:`error`,error:e instanceof ND?e:new ND(bT.InternalError,String(e))}}return}let i;try{let r=await this.request(e,JT,n);if(r.task)i=r.task.taskId,yield{type:`taskCreated`,task:r.task};else throw new ND(bT.InternalError,`Task creation did not return a task`);for(;;){let e=await this.getTask({taskId:i},n);if(yield{type:`taskStatus`,task:e},FD(e.status)){e.status===`completed`?yield{type:`result`,result:await this.getTaskResult({taskId:i},t,n)}:e.status===`failed`?yield{type:`error`,error:new ND(bT.InternalError,`Task ${i} failed`)}:e.status===`cancelled`&&(yield{type:`error`,error:new ND(bT.InternalError,`Task ${i} was cancelled`)});return}if(e.status===`input_required`){yield{type:`result`,result:await this.getTaskResult({taskId:i},t,n)};return}let r=e.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(e=>setTimeout(e,r)),n?.signal?.throwIfAborted()}}catch(e){yield{type:`error`,error:e instanceof ND?e:new ND(bT.InternalError,String(e))}}}request(e,t,n){let{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a,task:o,relatedTask:s}=n??{};return new Promise((c,l)=>{let u=e=>{l(e)};if(!this._transport){u(Error(`Not connected`));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),o&&this.assertTaskCapability(e.method)}catch(e){u(e);return}n?.signal?.throwIfAborted();let d=this._requestMessageId++,f={...e,jsonrpc:`2.0`,id:d};n?.onprogress&&(this._progressHandlers.set(d,n.onprogress),f.params={...e.params,_meta:{...e.params?._meta||{},progressToken:d}}),o&&(f.params={...f.params,task:o}),s&&(f.params={...f.params,_meta:{...f.params?._meta||{},[$w]:s}});let p=e=>{this._responseHandlers.delete(d),this._progressHandlers.delete(d),this._cleanupTimeout(d),this._transport?.send({jsonrpc:`2.0`,method:`notifications/cancelled`,params:{requestId:d,reason:String(e)}},{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))),l(e instanceof ND?e:new ND(bT.RequestTimeout,String(e)))};this._responseHandlers.set(d,e=>{if(!n?.signal?.aborted){if(e instanceof Error)return l(e);try{let n=Pb(t,e.result);n.success?c(n.data):l(n.error)}catch(e){l(e)}}}),n?.signal?.addEventListener(`abort`,()=>{p(n?.signal?.reason)});let m=n?.timeout??6e4;this._setupTimeout(d,m,n?.maxTotalTimeout,()=>p(ND.fromError(bT.RequestTimeout,`Request timed out`,{timeout:m})),n?.resetTimeoutOnProgress??!1);let h=s?.taskId;h?(this._requestResolvers.set(d,e=>{let t=this._responseHandlers.get(d);t?t(e):this._onerror(Error(`Response handler missing for side-channeled request ${d}`))}),this._enqueueTaskMessage(h,{type:`request`,message:f,timestamp:Date.now()}).catch(e=>{this._cleanupTimeout(d),l(e)})):this._transport.send(f,{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a}).catch(e=>{this._cleanupTimeout(d),l(e)})})}async getTask(e,t){return this.request({method:`tasks/get`,params:e},QT,t)}async getTaskResult(e,t,n){return this.request({method:`tasks/result`,params:e},t,n)}async listTasks(e,t){return this.request({method:`tasks/list`,params:e},tE,t)}async cancelTask(e,t){return this.request({method:`tasks/cancel`,params:e},rE,t)}async notification(e,t){if(!this._transport)throw Error(`Not connected`);this.assertNotificationCapability(e.method);let n=t?.relatedTask?.taskId;if(n){let r={...e,jsonrpc:`2.0`,params:{...e.params,_meta:{...e.params?._meta||{},[$w]:t.relatedTask}}};await this._enqueueTaskMessage(n,{type:`notification`,message:r,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let n={...e,jsonrpc:`2.0`};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[$w]:t.relatedTask}}}),this._transport?.send(n,t).catch(e=>this._onerror(e))});return}let r={...e,jsonrpc:`2.0`};t?.relatedTask&&(r={...r,params:{...r.params,_meta:{...r.params?._meta||{},[$w]:t.relatedTask}}}),await this._transport.send(r,t)}setRequestHandler(e,t){let n=ID(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(n,r)=>{let i=LD(e,n);return Promise.resolve(t(i,r))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){let n=ID(e);this._notificationHandlers.set(n,n=>{let r=LD(e,n);return Promise.resolve(t(r))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,n){if(!this._taskStore||!this._taskMessageQueue)throw Error(`Cannot enqueue task message: taskStore and taskMessageQueue are not configured`);let r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,n,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,t);for(let t of n)if(t.type===`request`&&hT(t.message)){let n=t.message.id,r=this._requestResolvers.get(n);r?(r(new ND(bT.InternalError,`Task cancelled or completed`)),this._requestResolvers.delete(n)):this._onerror(Error(`Resolver missing for request ${n} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let n=this._options?.defaultTaskPollInterval??1e3;try{let t=await this._taskStore?.getTask(e);t?.pollInterval&&(n=t.pollInterval)}catch{}return new Promise((e,r)=>{if(t.aborted){r(new ND(bT.InvalidRequest,`Request cancelled`));return}let i=setTimeout(e,n);t.addEventListener(`abort`,()=>{clearTimeout(i),r(new ND(bT.InvalidRequest,`Request cancelled`))},{once:!0})})}requestTaskStore(e,t){let n=this._taskStore;if(!n)throw Error(`No task store configured`);return{createTask:async r=>{if(!e)throw Error(`No request provided`);return await n.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async e=>{let r=await n.getTask(e,t);if(!r)throw new ND(bT.InvalidParams,`Failed to retrieve task: Task not found`);return r},storeTaskResult:async(e,r,i)=>{await n.storeTaskResult(e,r,i,t);let a=await n.getTask(e,t);if(a){let t=XT.parse({method:`notifications/tasks/status`,params:a});await this.notification(t),FD(a.status)&&this._cleanupTaskProgressHandler(e)}},getTaskResult:e=>n.getTaskResult(e,t),updateTaskStatus:async(e,r,i)=>{let a=await n.getTask(e,t);if(!a)throw new ND(bT.InvalidParams,`Task "${e}" not found - it may have been cleaned up`);if(FD(a.status))throw new ND(bT.InvalidParams,`Cannot update task "${e}" from terminal status "${a.status}" to "${r}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(e,r,i,t);let o=await n.getTask(e,t);if(o){let t=XT.parse({method:`notifications/tasks/status`,params:o});await this.notification(t),FD(o.status)&&this._cleanupTaskProgressHandler(e)}},listTasks:e=>n.listTasks(e,t)}}};function zD(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function BD(e,t){let n={...e};for(let e in t){let r=e,i=t[r];if(i===void 0)continue;let a=n[r];n[r]=zD(a)&&zD(i)?{...a,...i}:i}return n}var VD=`modulepreload`,HD=function(e,t){return new URL(e,t).href},UD={},WD=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=HD(t,n),t=s(t),t in UD)return;UD[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`:VD,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}`)))})}))}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)})};Qw(),(e=>typeof i<`u`?i:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof i<`u`?i:e)[t]}):e)(function(e){if(typeof i<`u`)return i.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)});var GD=class extends RD{_registeredMethods=new Set;_eventSlots=new Map;onEventDispatch(e,t){}_ensureEventSlot(e){let t=this._eventSlots.get(e);if(!t){let n=this.eventSchemas[e];if(!n)throw Error(`Unknown event: ${String(e)}`);t={listeners:[]},this._eventSlots.set(e,t);let r=n.shape.method.value;this._registeredMethods.add(r);let i=t;super.setNotificationHandler(n,t=>{let n=t.params;this.onEventDispatch(e,n),i.onHandler?.(n);for(let e of[...i.listeners])e(n)})}return t}setEventHandler(e,t){let n=this._ensureEventSlot(e);n.onHandler&&t&&console.warn(`[MCP Apps] on${String(e)} handler replaced. Use addEventListener("${String(e)}", …) to add multiple listeners without replacing.`),n.onHandler=t}getEventHandler(e){return this._eventSlots.get(e)?.onHandler}addEventListener(e,t){this._ensureEventSlot(e).listeners.push(t)}removeEventListener(e,t){let n=this._eventSlots.get(e);if(!n)return;let r=n.listeners.indexOf(t);r!==-1&&n.listeners.splice(r,1)}setRequestHandler=(e,t)=>{this._assertMethodNotRegistered(e,`setRequestHandler`),super.setRequestHandler(e,t)};setNotificationHandler=(e,t)=>{this._assertMethodNotRegistered(e,`setNotificationHandler`),super.setNotificationHandler(e,t)};warnIfRequestHandlerReplaced(e,t,n){t&&n&&console.warn(`[MCP Apps] ${e} handler replaced. Previous handler will no longer be called.`)}replaceRequestHandler=(e,t)=>{let n=e.shape.method.value;this._registeredMethods.add(n),super.setRequestHandler(e,t)};_assertMethodNotRegistered(e,t){let n=e.shape.method.value;if(this._registeredMethods.has(n))throw Error(`Handler for "${n}" already registered (via ${t}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._registeredMethods.add(n)}},KD=`2026-01-26`,qD=class{eventTarget;eventSource;messageListener;constructor(e=window.parent,t){this.eventTarget=e,this.eventSource=t,this.messageListener=e=>{if(t&&e.source!==this.eventSource){console.debug(`Ignoring message from unknown source`,e);return}let n=CT.safeParse(e.data);n.success?(console.debug(`Parsed message`,n.data),this.onmessage?.(n.data)):e.data?.jsonrpc===`2.0`?(console.error(`Failed to parse message`,n.error.message,e),this.onerror?.(Error(`Invalid JSON-RPC message received: `+n.error.message))):console.debug(`Ignoring non-JSON-RPC message`,n.error.message,e)}}async start(){window.addEventListener(`message`,this.messageListener)}async send(e,t){e.method!==`ui/notifications/tool-input-partial`&&console.debug(`Sending message`,e),this.eventTarget.postMessage(e,`*`)}async close(){window.removeEventListener(`message`,this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion},JD=Y([X(`light`),X(`dark`)]).describe(`Color theme preference for the host environment.`),YD=Y([X(`inline`),X(`fullscreen`),X(`pip`)]).describe(`Display mode for UI presentation.`),XD=oS(Y([X(`--color-background-primary`),X(`--color-background-secondary`),X(`--color-background-tertiary`),X(`--color-background-inverse`),X(`--color-background-ghost`),X(`--color-background-info`),X(`--color-background-danger`),X(`--color-background-success`),X(`--color-background-warning`),X(`--color-background-disabled`),X(`--color-text-primary`),X(`--color-text-secondary`),X(`--color-text-tertiary`),X(`--color-text-inverse`),X(`--color-text-ghost`),X(`--color-text-info`),X(`--color-text-danger`),X(`--color-text-success`),X(`--color-text-warning`),X(`--color-text-disabled`),X(`--color-border-primary`),X(`--color-border-secondary`),X(`--color-border-tertiary`),X(`--color-border-inverse`),X(`--color-border-ghost`),X(`--color-border-info`),X(`--color-border-danger`),X(`--color-border-success`),X(`--color-border-warning`),X(`--color-border-disabled`),X(`--color-ring-primary`),X(`--color-ring-secondary`),X(`--color-ring-inverse`),X(`--color-ring-info`),X(`--color-ring-danger`),X(`--color-ring-success`),X(`--color-ring-warning`),X(`--font-sans`),X(`--font-mono`),X(`--font-weight-normal`),X(`--font-weight-medium`),X(`--font-weight-semibold`),X(`--font-weight-bold`),X(`--font-text-xs-size`),X(`--font-text-sm-size`),X(`--font-text-md-size`),X(`--font-text-lg-size`),X(`--font-heading-xs-size`),X(`--font-heading-sm-size`),X(`--font-heading-md-size`),X(`--font-heading-lg-size`),X(`--font-heading-xl-size`),X(`--font-heading-2xl-size`),X(`--font-heading-3xl-size`),X(`--font-text-xs-line-height`),X(`--font-text-sm-line-height`),X(`--font-text-md-line-height`),X(`--font-text-lg-line-height`),X(`--font-heading-xs-line-height`),X(`--font-heading-sm-line-height`),X(`--font-heading-md-line-height`),X(`--font-heading-lg-line-height`),X(`--font-heading-xl-line-height`),X(`--font-heading-2xl-line-height`),X(`--font-heading-3xl-line-height`),X(`--border-radius-xs`),X(`--border-radius-sm`),X(`--border-radius-md`),X(`--border-radius-lg`),X(`--border-radius-xl`),X(`--border-radius-full`),X(`--border-width-regular`),X(`--shadow-hairline`),X(`--shadow-sm`),X(`--shadow-md`),X(`--shadow-lg`)]).describe(`CSS variable keys available to MCP apps for theming.`).describe(`Style variables for theming MCP apps.
|
|
78
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function Cd(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;Cd(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var wd=new Set([`type`,`properties`,`required`,`additionalProperties`]),Td=[`oneOf`,`anyOf`];function Ed(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Dd(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!wd.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??Ed(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}Ea(n,r,e.length===1?e[0]:Dd(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=Ed(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Od(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of wd)if(t in e)return;let n=t.filter(e=>Td.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Dd(t);else{let e=n[0],i=Td.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Dd([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,_d(e,r))}function kd(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):_d(i,s),_d(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())Cd(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Od(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}_d(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,Ea(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Md(t,`input`,e.processors),output:Md(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Ad(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Ad(r.element,n);if(r.type===`set`)return Ad(r.valueType,n);if(r.type===`lazy`)return Ad(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return Ad(r.innerType,n);if(r.type===`intersection`)return Ad(r.left,n)||Ad(r.right,n);if(r.type===`record`||r.type===`map`)return Ad(r.keyType,n)||Ad(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Ad(r.in,n)||Ad(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Ad(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Ad(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Ad(e,n))return!0;return!!(r.rest&&Ad(r.rest,n))}return!1}var jd=(e,t={})=>n=>{let r=vd({...n,processors:t});return bd(e,r),Sd(r,e),kd(r,e)},Md=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=vd({...i??{},target:a,io:t,processors:n});return bd(e,o),Sd(o,e),kd(o,e)},Nd=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Pd=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Fd=(e,t)=>{Nd(e,`minimum`,t),Pd(e,`maximum`,t)},Id=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Ld=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},Rd=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},zd=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},Bd=(e,t)=>Nd(e,`minimum`,t.minimum),Vd=(e,t)=>Pd(e,`maximum`,t.maximum),Hd=e=>(t,n)=>{zd(t,n.format);let[r,i]=e[n.format];Nd(t,`minimum`,r),Pd(t,`maximum`,i)},Ud={greater_than:(e,t)=>Nd(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>Pd(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Id(e,t.value),number_format:Hd(Ka),bigint_format:Hd(qa),min_length:Bd,max_length:Vd,length_equals:(e,t)=>Fd(e,t.length),min_size:Bd,max_size:Vd,size_equals:(e,t)=>Fd(e,t.size),string_format:(e,t)=>{zd(e,t.format),t.pattern&&Ld(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Rd(e,t.mime)};function Wd(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Ud[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Nd(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Nd(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&Pd(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&Pd(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Id(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Rd(t,i.mime);for(let e of i.patterns??[])Ld(t,e);return t}var Gd={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Kd=new Map([[Gc,Ds],[qc,Os]]),qd=e=>Kd.get(e)??e,Jd=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=Wd(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Gd[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(qd);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Yd=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=Wd(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):yd(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},Xd=(e,t,n,r)=>{n.type=`boolean`},Zd=(e,t,n,r)=>{yd(e,t,n,r,`BigInt cannot be represented in JSON Schema`)},Qd=(e,t,n,r)=>{yd(e,t,n,r,`Symbols cannot be represented in JSON Schema`)},$d=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},ef=(e,t,n,r)=>{yd(e,t,n,r,`Undefined cannot be represented in JSON Schema`)},tf=(e,t,n,r)=>{yd(e,t,n,r,`Void cannot be represented in JSON Schema`)},nf=(e,t,n,r)=>{n.not={}},rf=(e,t,n,r)=>{},af=(e,t,n,r)=>{},of=(e,t,n,r)=>{yd(e,t,n,r,`Date cannot be represented in JSON Schema`)},sf=(e,t,n,r)=>{let i=e._zod.def,a=ga(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},cf=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(yd(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(yd(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},lf=(e,t,n,r)=>{yd(e,t,n,r,`NaN cannot be represented in JSON Schema`)},uf=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},df=(e,t,n,r)=>{let i=n;i.type=`string`,i.format=`binary`,i.contentEncoding=`binary`;let{minimum:a,maximum:o,mime:s}=Wd(e);a!==void 0&&(i.minLength=a),o!==void 0&&(i.maxLength=o),s&&(s.length===0?i.not={}:s.length===1?i.contentMediaType=s[0]:i.anyOf=s.map(e=>({contentMediaType:e})))},ff=(e,t,n,r)=>{n.type=`boolean`},pf=(e,t,n,r)=>{yd(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},mf=(e,t,n,r)=>{yd(e,t,n,r,`Function types cannot be represented in JSON Schema`)},hf=(e,t,n,r)=>{yd(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},gf=(e,t,n,r)=>{yd(e,t,n,r,`Map cannot be represented in JSON Schema`)},_f=(e,t,n,r)=>{yd(e,t,n,r,`Set cannot be represented in JSON Schema`)},vf=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=Wd(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=bd(a.element,t,{...r,path:[...r.path,`items`]})};function yf(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?yf(t.out):t.type===`catch`?yf(t.innerType):e._zod.optin}var bf=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&yd(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)Ea(i.properties,e,bd(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e];return t.io===`input`?yf(n)===void 0:n._zod.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=bd(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},xf=(e,t,n,r)=>{let i=n,a=e._zod.def;if(Object.getOwnPropertySymbols(a.shape).length&&yd(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;if(t.io===`output`){for(let n in a.shape)if(Ad(a.shape[n])&&yd(e,t,i,r,`z.properties() returns its input, so the output of a transforming schema at key "${n}" cannot be represented in JSON Schema`))return}i.type=`object`,i.properties={};for(let e in a.shape)Ea(i.properties,e,bd(a.shape[e],t,{...r,path:[...r.path,`properties`,e]}));let o=Object.keys(a.shape).filter(e=>yf(a.shape[e])===void 0);o.length>0&&(i.required=o)},Sf=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>bd(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Cf=(e,t,n,r)=>{let i=e._zod.def,a=bd(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=bd(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},wf=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>bd(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?bd(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null,u=a.items.length;for(;u>0;){let e=a.items[u-1];if(!(t.io===`input`?yf(e)!==void 0:e._zod.optout===`optional`))break;u--}let d=a.items.length,f=!a.rest;t.target===`draft-2020-12`?(i.prefixItems=c,f?i.items=!1:l&&(i.items=l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):(i.items=c,f?i.additionalItems=!1:l&&(i.additionalItems=l),u>0&&(i.minItems=u),f&&(i.maxItems=d));let{minimum:p,maximum:m}=Wd(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function Tf(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=Tf(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>Tf(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i?(p.type=`string`,a||(p.pattern=(r.includes(`number`)?zs:Rs).source),p):p}var Ef=new WeakMap;function Df(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of Ef.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Tf(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var Of=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=Wd(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=bd(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)Ea(i.patternProperties,qd(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=bd(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=Ef.get(t);n||(n=[],Ef.set(t,n),t.deferred.push(()=>Df(t))),n.push(e)}i.additionalProperties=bd(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&yf(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},kf=(e,t,n,r)=>{let i=e._zod.def,a=bd(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Af=(e,t,n,r)=>{let i=e._zod.def;bd(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},jf=Symbol();function Mf(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(yd(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),jf):JSON.parse(o)}var Nf=(e,t,n,r)=>{let i=e._zod.def;bd(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Mf(i.defaultValue,e,t,n,r);o!==jf&&(n.default=o)},Pf=(e,t,n,r)=>{let i=e._zod.def;bd(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Mf(i.defaultValue,e,t,n,r);o!==jf&&(n._prefault=o)},Ff=(e,t,n,r)=>{let i=e._zod.def;bd(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{yd(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},If=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;bd(o,t,r);let s=t.seen.get(e);s.ref=o},Lf=(e,t,n,r)=>{let i=e._zod.def;bd(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Rf=(e,t,n,r)=>{let i=e._zod.def;bd(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},zf=(e,t,n,r)=>{let i=e._zod.def;bd(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Bf=(e,t,n,r)=>{let i=e._zod.innerType;bd(i,t,r);let a=t.seen.get(e);a.ref=i},Vf={string:Jd,number:Yd,boolean:Xd,bigint:Zd,symbol:Qd,null:$d,undefined:ef,void:tf,never:nf,any:rf,unknown:af,date:of,enum:sf,literal:cf,nan:lf,template_literal:uf,file:df,success:ff,custom:pf,properties:xf,function:mf,transform:hf,map:gf,set:_f,array:vf,object:bf,union:Sf,intersection:Cf,tuple:wf,record:Of,nullable:kf,nonoptional:Af,default:Nf,prefault:Pf,catch:Ff,pipe:If,readonly:Lf,promise:Rf,optional:zf,lazy:Bf};function Hf(e,t){if(`_idmap`in e){let n=e,r=vd({...t,processors:Vf}),i={};for(let e of n._idmap.entries()){let[t,n]=e;bd(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;Sd(r,n),Ea(a,t,kd(r,n))}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=vd({...t,processors:Vf});return bd(e,n),Sd(n,e),kd(n,e)}var Uf=new WeakSet([Object.prototype,Error.prototype]);function Wf(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var Gf=P(`ZodError`,(e,t)=>{Ho.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);Uf.has(n)||(Uf.add(n),Wf(n,`format`,e=>t=>Go(e,t)),Wf(n,`flatten`,e=>t=>Wo(e,t)),Wf(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,va,2)}),Wf(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,va,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),Kf=qo(Gf),qf=Jo(Gf),Jf=F(Gf),Yf=Xo(Gf),Xf=ns(Gf),Zf=rs(Gf),Qf=is(Gf),$f=as(Gf),ep=os(Gf),z=ss(Gf),tp=cs(Gf),np=ls(Gf);function rp(){Po.localeError||Fo(lu())}function ip(){Po.memoizer||Fo({memoizer:ou()})}var ap=P(`ZodType`,(e,t)=>(rp(),dc.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(Na(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Ua(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Em(e,t))},superRefine(e,t){return this.check(Dm(e,t))},overwrite(e){return this.check(I(e))},optional(){return Z(this)},exactOptional(){return sm(this)},nullable(){return lm(this)},nullish(){return Z(lm(this))},nonoptional(e){return hm(this,e)},array(){return W(this)},or(e){return q([this,e])},and(e){return $p(this,e)},transform(e){return ym(this,im(e))},default(e){return dm(this,e)},prefault(e){return pm(this,e)},catch(e){return _m(this,e)},pipe(e){return ym(this,e)},readonly(){return Sm(this)},describe(e){let t=this.clone();return pu.add(t,{description:e}),t},meta(...e){if(e.length===0)return pu.get(this);let t=this.clone();return pu.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return _o(this,`~standard`,{...mc(this),jsonSchema:{input:Md(this,`input`),output:Md(this,`output`)}})},set"~standard"(e){go(this,`~standard`,e)},parse:function e(t,n){return Kf(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await qf(this,t,n,{callee:e})},safeParse(e,t){return Jf(this,e,t)},async safeParseAsync(e,t){return Yf(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){go(this,`spa`,e)},validate(e,t){return $o(this,e,t)},validateAsync(e,t){return ts(this,e,t)},encode:function e(t,n){return Xf(this,t,n,{callee:e})},decode:function e(t,n){return Zf(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Qf(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await $f(this,t,n,{callee:e})},safeEncode(e,t){return ep(this,e,t)},safeDecode(e,t){return z(this,e,t)},async safeEncodeAsync(e,t){return tp(this,e,t)},async safeDecodeAsync(e,t){return np(this,e,t)},toJSONSchema(e){return jd(this,{})(e)},get description(){return pu.get(this)?.description},get _def(){return this._zod.def}}),op=P(`_ZodString`,(e,t)=>{hc.init(e,t),ap.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jd(e,t,n,r)},vo({format:e=>Wd(e).format??null,minLength:e=>Wd(e).minimum??null,maxLength:e=>Wd(e).maximum??null},{regex(...e){return this.check(id(...e))},includes(...e){return this.check(sd(...e))},startsWith(...e){return this.check(cd(...e))},endsWith(...e){return this.check(ld(...e))},min(...e){return this.check(nd(...e))},max(...e){return this.check(td(...e))},length(...e){return this.check(rd(...e))},nonempty(...e){return this.check(nd(1,...e))},lowercase(e){return this.check(ad(e))},uppercase(e){return this.check(od(e))},trim(){return this.check(L())},normalize(...e){return this.check(ud(...e))},toLowerCase(){return this.check(R())},toUpperCase(){return this.check(dd())},slugify(){return this.check(fd())}})),sp=P(`ZodString`,(e,t)=>{hc.init(e,t),op.init(e,t)},{email(e){return this.check(hu(pp,e))},url(e){return this.check(xu(_p,e))},jwt(e){return this.check(Iu(Np,e))},emoji(e){return this.check(Su(yp,e))},guid(e){return this.check(gu(hp,e))},uuid(e){return this.check(_u(gp,e))},uuidv4(e){return this.check(vu(gp,e))},uuidv6(e){return this.check(yu(gp,e))},uuidv7(e){return this.check(bu(gp,e))},nanoid(e){return this.check(Cu(bp,e))},cuid(e){return this.check(wu(xp,e))},cuid2(e){return this.check(Tu(Sp,e))},ulid(e){return this.check(Eu(Cp,e))},base64(e){return this.check(Nu(Ap,e))},base64url(e){return this.check(Pu(jp,e))},xid(e){return this.check(Du(wp,e))},ksuid(e){return this.check(Ou(Tp,e))},ipv4(e){return this.check(ku(Ep,e))},ipv6(e){return this.check(Au(Dp,e))},cidrv4(e){return this.check(ju(Op,e))},cidrv6(e){return this.check(Mu(kp,e))},e164(e){return this.check(Fu(Mp,e))},datetime(e){return this.check(Lu(lp,e))},date(e){return this.check(Ru(up,e))},time(e){return this.check(zu(dp,e))},duration(e){return this.check(Bu(fp,e))}});function B(e){return mu(sp,e)}var cp=P(`ZodStringFormat`,(e,t)=>{gc.init(e,t),op.init(e,t)}),lp=P(`ZodISODateTime`,(e,t)=>{Nc.init(e,t),cp.init(e,t)}),up=P(`ZodISODate`,(e,t)=>{Pc.init(e,t),cp.init(e,t)}),dp=P(`ZodISOTime`,(e,t)=>{Fc.init(e,t),cp.init(e,t)}),fp=P(`ZodISODuration`,(e,t)=>{Ic.init(e,t),cp.init(e,t)}),pp=P(`ZodEmail`,(e,t)=>{yc.init(e,t),cp.init(e,t)});function mp(e){return hu(pp,e)}var hp=P(`ZodGUID`,(e,t)=>{_c.init(e,t),cp.init(e,t)}),gp=P(`ZodUUID`,(e,t)=>{vc.init(e,t),cp.init(e,t)}),_p=P(`ZodURL`,(e,t)=>{Tc.init(e,t),cp.init(e,t)});function vp(e){return xu(_p,e)}var yp=P(`ZodEmoji`,(e,t)=>{Ec.init(e,t),cp.init(e,t)}),bp=P(`ZodNanoID`,(e,t)=>{Dc.init(e,t),cp.init(e,t)}),xp=P(`ZodCUID`,(e,t)=>{Oc.init(e,t),cp.init(e,t)}),Sp=P(`ZodCUID2`,(e,t)=>{kc.init(e,t),cp.init(e,t)}),Cp=P(`ZodULID`,(e,t)=>{Ac.init(e,t),cp.init(e,t)}),wp=P(`ZodXID`,(e,t)=>{jc.init(e,t),cp.init(e,t)}),Tp=P(`ZodKSUID`,(e,t)=>{Mc.init(e,t),cp.init(e,t)}),Ep=P(`ZodIPv4`,(e,t)=>{Lc.init(e,t),cp.init(e,t)}),Dp=P(`ZodIPv6`,(e,t)=>{Bc.init(e,t),cp.init(e,t)}),Op=P(`ZodCIDRv4`,(e,t)=>{Vc.init(e,t),cp.init(e,t)}),kp=P(`ZodCIDRv6`,(e,t)=>{Uc.init(e,t),cp.init(e,t)}),Ap=P(`ZodBase64`,(e,t)=>{Kc.init(e,t),cp.init(e,t)}),jp=P(`ZodBase64URL`,(e,t)=>{Yc.init(e,t),cp.init(e,t)}),Mp=P(`ZodE164`,(e,t)=>{Xc.init(e,t),cp.init(e,t)}),Np=P(`ZodJWT`,(e,t)=>{Qc.init(e,t),cp.init(e,t)}),Pp=P(`ZodNumber`,(e,t)=>{$c.init(e,t),ap.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yd(e,t,n,r),e.isFinite=!0},vo({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=Wd(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=Wd(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=Wd(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>Wd(e).format??null},{gt(e,t){return this.check(Qu(e,t))},gte(e,t){return this.check($u(e,t))},min(e,t){return this.check($u(e,t))},lt(e,t){return this.check(Xu(e,t))},lte(e,t){return this.check(Zu(e,t))},max(e,t){return this.check(Zu(e,t))},int(e){return this.check(Ip(e))},safe(e){return this.check(Ip(e))},positive(e){return this.check(Qu(0,e))},nonnegative(e){return this.check($u(0,e))},negative(e){return this.check(Xu(0,e))},nonpositive(e){return this.check(Zu(0,e))},multipleOf(e,t){return this.check(ed(e,t))},step(e,t){return this.check(ed(e,t))},finite(){return this}}));function V(e){return Vu(Pp,e)}var Fp=P(`ZodNumberFormat`,(e,t)=>{el.init(e,t),Pp.init(e,t)});function Ip(e){return Uu(Fp,e)}var Lp=P(`ZodBoolean`,(e,t)=>{tl.init(e,t),ap.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xd(e,t,n,r)});function H(e){return Wu(Lp,e)}var Rp=P(`ZodUndefined`,(e,t)=>{nl.init(e,t),ap.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ef(e,t,n,r)});function zp(e){return Gu(Rp,e)}var Bp=P(`ZodNull`,(e,t)=>{rl.init(e,t),ap.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$d(e,t,n,r)});function Vp(e){return Ku(Bp,e)}var Hp=P(`ZodAny`,(e,t)=>{il.init(e,t),ap.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Up(){return qu(Hp)}var Wp=P(`ZodUnknown`,(e,t)=>{al.init(e,t),ap.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function U(){return Ju(Wp)}var Gp=P(`ZodNever`,(e,t)=>{ol.init(e,t),ap.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nf(e,t,n,r)});function Kp(e){return Yu(Gp,e)}var qp=P(`ZodArray`,(e,t)=>{ip(),cl.init(e,t),ap.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vf(e,t,n,r),e.element=t.element},{min(e,t){return this.check(nd(e,t))},nonempty(e){return this.check(nd(1,e))},max(e,t){return this.check(td(e,t))},length(e,t){return this.check(rd(e,t))},unwrap(){return this.element}});function W(e,t){return pd(qp,e,t)}var Jp=P(`ZodObject`,(e,t)=>{ip(),ml.init(e,t),ap.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bf(e,t,n,r),wo(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return Y(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Na(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Na(this._zod.def,{catchall:U()}))},loose(){return this.clone(Na(this._zod.def,{catchall:U()}))},strict(){return this.clone(Na(this._zod.def,{catchall:Kp()}))},strip(){return this.clone(Na(this._zod.def,{catchall:void 0}))},extend(e){return Za(this,e)},safeExtend(e){return $a(this,e)},merge(e){return eo(this,e)},pick(e){return Ja(this,e)},omit(e){return Xa(this,e)},partial(...e){return to(am,this,e[0])},exactPartial(...e){return to(om,this,e[0],`exactPartial`)},required(...e){return no(mm,this,e[0])}});function G(e,t){return new Jp({type:`object`,shape:e??{},...M(t)})}function K(e,t){return new Jp({type:`object`,shape:e,catchall:U(),...M(t)})}var Yp=P(`ZodUnion`,(e,t)=>{gl.init(e,t),ap.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sf(e,t,n,r),e.options=t.options});function q(e,t){return new Yp({type:`union`,options:e,...M(t)})}var Xp=P(`ZodDiscriminatedUnion`,(e,t)=>{Yp.init(e,t),vl.init(e,t)});function Zp(e,t,n){return new Xp({type:`union`,options:t,discriminator:e,...M(n)})}var Qp=P(`ZodIntersection`,(e,t)=>{yl.init(e,t),ap.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cf(e,t,n,r)});function $p(e,t){return new Qp({type:`intersection`,left:e,right:t})}var em=P(`ZodRecord`,(e,t)=>{ip(),Sl.init(e,t),ap.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Of(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function J(e,t,n){return!t||!t._zod?new em({type:`record`,keyType:B(),valueType:e,...M(t)}):new em({type:`record`,keyType:e,valueType:t,...M(n)})}var tm=P(`ZodEnum`,(e,t)=>{Cl.init(e,t),ap.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sf(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new tm({...t,checks:[],...M(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new tm({...t,checks:[],...M(r),entries:i})}});function Y(e,t){return new tm({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...M(t)})}var nm=P(`ZodLiteral`,(e,t)=>{wl.init(e,t),ap.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cf(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function X(e,t){return new nm({type:`literal`,values:Array.isArray(e)?e:[e],...M(t)})}var rm=P(`ZodTransform`,(e,t)=>{ip(),Tl.init(e,t),ap.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hf(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new No(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(mo(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(mo(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function im(e){return new rm({type:`transform`,transform:e})}var am=P(`ZodOptional`,(e,t)=>{Dl.init(e,t),ap.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zf(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Z(e){return new am({type:`optional`,innerType:e})}var om=P(`ZodExactOptional`,(e,t)=>{Ol.init(e,t),ap.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zf(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function sm(e){return new om({type:`optional`,innerType:e})}var cm=P(`ZodNullable`,(e,t)=>{kl.init(e,t),ap.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kf(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function lm(e){return new cm({type:`nullable`,innerType:e})}var um=P(`ZodDefault`,(e,t)=>{Al.init(e,t),ap.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Nf(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function dm(e,t){return new um({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Ba(t)}})}var fm=P(`ZodPrefault`,(e,t)=>{Ml.init(e,t),ap.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pf(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function pm(e,t){return new fm({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Ba(t)}})}var mm=P(`ZodNonOptional`,(e,t)=>{Nl.init(e,t),ap.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Af(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function hm(e,t){return new mm({type:`nonoptional`,innerType:e,...M(t)})}var gm=P(`ZodCatch`,(e,t)=>{Il.init(e,t),ap.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ff(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function _m(e,t){return new gm({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Eo(t)})}var vm=P(`ZodPipe`,(e,t)=>{Ll.init(e,t),ap.init(e,t),e._zod.processJSONSchema=(t,n,r)=>If(e,t,n,r),e.in=t.in,e.out=t.out});function ym(e,t){return new vm({type:`pipe`,in:e,out:t})}var bm=P(`ZodPreprocess`,(e,t)=>{vm.init(e,t),zl.init(e,t)}),xm=P(`ZodReadonly`,(e,t)=>{Bl.init(e,t),ap.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lf(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Sm(e){return new xm({type:`readonly`,innerType:e})}var Cm=P(`ZodLazy`,(e,t)=>{Hl.init(e,t),ap.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bf(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function wm(e){return new Cm({type:`lazy`,getter:e})}var Tm=P(`ZodCustom`,(e,t)=>{Ul.init(e,t),ap.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pf(e,t,n,r)});function Em(e,t={}){return md(Tm,e,t)}function Dm(e,t){return hd(e,t)}function Om(e,t){return new bm({type:`pipe`,in:im(e),out:t})}var km={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`},Am;Am||={};function jm(e){return Lu(lp,e)}function Mm(e){return Ru(up,e)}function Nm(e){return Hu(Pp,e)}var Pm=[`2025-11-25`,`2025-06-18`,`2025-03-26`,`2024-11-05`,`2024-10-07`],Fm=`io.modelcontextprotocol/related-task`,Im=`io.modelcontextprotocol/protocolVersion`,Lm=`io.modelcontextprotocol/clientInfo`,Rm=`io.modelcontextprotocol/serverInfo`,zm=`io.modelcontextprotocol/clientCapabilities`,Bm=`io.modelcontextprotocol/subscriptionId`,Vm=`io.modelcontextprotocol/logLevel`,Hm=wm(()=>q([B(),V(),H(),Vp(),J(B(),Hm),W(Hm)])),Um=J(B(),Hm),Wm=W(Hm),Gm=q([B(),V().int()]),Km=B(),qm=G({ttl:V().optional()}),Jm=G({taskId:B()}),Ym=K({progressToken:Gm.optional(),[Fm]:Jm.optional()}),Xm=G({_meta:Ym.optional()}),Zm=Xm.extend({task:qm.optional()}),Qm=G({method:B(),params:Xm.loose().optional()}),$m=G({_meta:Ym.optional()}),eh=G({method:B(),params:$m.loose().optional()}),th=K({get[Rm](){return gh.optional().catch(void 0)}}),nh=K({_meta:th.optional()}),rh=q([B(),V().int()]),ih=G({jsonrpc:X(`2.0`),id:rh,...Qm.shape}).strict(),ah=G({jsonrpc:X(`2.0`),...eh.shape}).strict(),oh=G({jsonrpc:X(`2.0`),id:rh,result:nh}).strict(),sh=G({jsonrpc:X(`2.0`),id:rh.optional(),error:G({code:V().int(),message:B(),data:U().optional()})}).strict(),ch=q([ih,ah,oh,sh]),lh=q([oh,sh]),uh=nh.strict(),dh=$m.extend({requestId:rh.optional(),reason:B().optional()}),fh=eh.extend({method:X(`notifications/cancelled`),params:dh}),ph=G({src:B(),mimeType:B().optional(),sizes:W(B()).optional(),theme:Y([`light`,`dark`]).optional()}),mh=G({icons:W(ph).optional()}),hh=G({name:B(),title:B().optional()}),gh=hh.extend({...hh.shape,...mh.shape,version:B(),websiteUrl:B().optional(),description:B().optional()}),_h=Om(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,$p(G({form:$p(G({applyDefaults:H().optional()}),Um).optional(),url:Um.optional()}),Um.optional())),vh=K({list:Um.optional(),cancel:Um.optional(),requests:K({sampling:K({createMessage:Um.optional()}).optional(),elicitation:K({create:Um.optional()}).optional()}).optional()}),yh=K({list:Um.optional(),cancel:Um.optional(),requests:K({tools:K({call:Um.optional()}).optional()}).optional()}),bh=G({experimental:J(B(),Um).optional(),sampling:G({context:Um.optional(),tools:Um.optional()}).optional(),elicitation:_h.optional(),roots:G({listChanged:H().optional()}).optional(),tasks:vh.optional(),extensions:J(B(),Um).optional()}),xh=Xm.extend({protocolVersion:B(),capabilities:bh,clientInfo:gh}),Sh=Qm.extend({method:X(`initialize`),params:xh}),Ch=G({experimental:J(B(),Um).optional(),logging:Um.optional(),completions:Um.optional(),prompts:G({listChanged:H().optional()}).optional(),resources:G({subscribe:H().optional(),listChanged:H().optional()}).optional(),tools:G({listChanged:H().optional()}).optional(),tasks:yh.optional(),extensions:J(B(),Um).optional()}),wh=nh.extend({protocolVersion:B(),capabilities:Ch,serverInfo:gh,instructions:B().optional()}),Th=eh.extend({method:X(`notifications/initialized`),params:$m.optional()}),Eh=Qm.extend({method:X(`server/discover`),params:Xm.optional()}),Dh=nh.extend({supportedVersions:W(B()),capabilities:Ch,instructions:B().optional()}),Oh=Qm.extend({method:X(`ping`),params:Xm.optional()}),kh=G({progress:V(),total:Z(V()),message:Z(B())}),Ah=G({...$m.shape,...kh.shape,progressToken:Gm}),jh=eh.extend({method:X(`notifications/progress`),params:Ah}),Mh=Xm.extend({cursor:Km.optional()}),Nh=Qm.extend({params:Mh.optional()}),Ph=nh.extend({nextCursor:Km.optional()}),Fh=G({uri:B(),mimeType:Z(B()),_meta:J(B(),U()).optional()}),Ih=Fh.extend({text:B()}),Lh=B().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),Rh=Fh.extend({blob:Lh}),zh=Y([`user`,`assistant`]),Bh=G({audience:W(zh).optional(),priority:V().min(0).max(1).optional(),lastModified:jm({offset:!0}).optional()}),Vh=G({...hh.shape,...mh.shape,uri:B(),description:Z(B()),mimeType:Z(B()),size:Z(V()),annotations:Bh.optional(),_meta:Z(K({}))}),Hh=G({...hh.shape,...mh.shape,uriTemplate:B(),description:Z(B()),mimeType:Z(B()),annotations:Bh.optional(),_meta:Z(K({}))}),Uh=Nh.extend({method:X(`resources/list`)}),Wh=Ph.extend({resources:W(Vh)}),Gh=Nh.extend({method:X(`resources/templates/list`)}),Kh=Ph.extend({resourceTemplates:W(Hh)}),qh=Xm.extend({uri:B()}),Jh=qh,Yh=Qm.extend({method:X(`resources/read`),params:Jh}),Xh=nh.extend({contents:W(q([Ih,Rh]))}),Zh=eh.extend({method:X(`notifications/resources/list_changed`),params:$m.optional()}),Qh=qh,$h=Qm.extend({method:X(`resources/subscribe`),params:Qh}),eg=qh,tg=Qm.extend({method:X(`resources/unsubscribe`),params:eg}),ng=G({toolsListChanged:H().optional(),promptsListChanged:H().optional(),resourcesListChanged:H().optional(),resourceSubscriptions:W(B()).optional()}),rg=Xm.extend({notifications:ng}),ig=Qm.extend({method:X(`subscriptions/listen`),params:rg}),ag=$m.extend({notifications:ng}),og=eh.extend({method:X(`notifications/subscriptions/acknowledged`),params:ag}),sg=th.extend({[Bm]:rh}),cg=nh.extend({_meta:sg}),lg=$m.extend({uri:B()}),ug=eh.extend({method:X(`notifications/resources/updated`),params:lg}),dg=G({name:B(),description:Z(B()),required:Z(H())}),fg=G({...hh.shape,...mh.shape,description:Z(B()),arguments:Z(W(dg)),_meta:Z(K({}))}),pg=Nh.extend({method:X(`prompts/list`)}),mg=Ph.extend({prompts:W(fg)}),hg=Xm.extend({name:B(),arguments:J(B(),B()).optional()}),gg=Qm.extend({method:X(`prompts/get`),params:hg}),_g=G({type:X(`text`),text:B(),annotations:Bh.optional(),_meta:J(B(),U()).optional()}),vg=G({type:X(`image`),data:Lh,mimeType:B(),annotations:Bh.optional(),_meta:J(B(),U()).optional()}),yg=G({type:X(`audio`),data:Lh,mimeType:B(),annotations:Bh.optional(),_meta:J(B(),U()).optional()}),bg=G({type:X(`tool_use`),name:B(),id:B(),input:J(B(),U()),_meta:J(B(),U()).optional()}),xg=G({type:X(`resource`),resource:q([Ih,Rh]),annotations:Bh.optional(),_meta:J(B(),U()).optional()}),Sg=Vh.extend({type:X(`resource_link`)}),Cg=q([_g,vg,yg,Sg,xg]),wg=G({role:zh,content:Cg}),Tg=nh.extend({description:B().optional(),messages:W(wg)}),Eg=eh.extend({method:X(`notifications/prompts/list_changed`),params:$m.optional()}),Dg=G({title:B().optional(),readOnlyHint:H().optional(),destructiveHint:H().optional(),idempotentHint:H().optional(),openWorldHint:H().optional()}),Og=G({taskSupport:Y([`required`,`optional`,`forbidden`]).optional()}),kg=G({...hh.shape,...mh.shape,description:B().optional(),inputSchema:G({type:X(`object`),properties:J(B(),Hm).optional(),required:W(B()).optional()}).catchall(U()),outputSchema:K({$schema:B().optional()}).optional(),annotations:Dg.optional(),execution:Og.optional(),_meta:J(B(),U()).optional()}),Ag=Nh.extend({method:X(`tools/list`)}),jg=Ph.extend({tools:W(kg)}),Mg=nh.extend({content:W(Cg).default([]),structuredContent:U().optional(),isError:H().optional()}),Ng=Mg.or(nh.extend({toolResult:U()})),Pg=Zm.extend({name:B(),arguments:J(B(),U()).optional()}),Fg=Qm.extend({method:X(`tools/call`),params:Pg}),Ig=eh.extend({method:X(`notifications/tools/list_changed`),params:$m.optional()}),Lg=G({autoRefresh:H().default(!0),debounceMs:V().int().nonnegative().default(300)}),Rg=Y([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),zg=Xm.extend({level:Rg}),Bg=Qm.extend({method:X(`logging/setLevel`),params:zg}),Vg=$m.extend({level:Rg,logger:B().optional(),data:U()}),Hg=eh.extend({method:X(`notifications/message`),params:Vg}),Ug=G({name:B().optional()}),Wg=G({hints:W(Ug).optional(),costPriority:V().min(0).max(1).optional(),speedPriority:V().min(0).max(1).optional(),intelligencePriority:V().min(0).max(1).optional()}),Gg=G({mode:Y([`auto`,`required`,`none`]).optional()}),Kg=G({type:X(`tool_result`),toolUseId:B().describe(`The unique identifier for the corresponding tool call.`),content:W(Cg),structuredContent:U().optional(),isError:H().optional(),_meta:J(B(),U()).optional()}),qg=Zp(`type`,[_g,vg,yg]),Jg=Zp(`type`,[_g,vg,yg,bg,Kg]),Yg=G({role:zh,content:q([Jg,W(Jg)]),_meta:J(B(),U()).optional()}),Xg=Zm.extend({messages:W(Yg),modelPreferences:Wg.optional(),systemPrompt:B().optional(),includeContext:Y([`none`,`thisServer`,`allServers`]).optional(),temperature:V().optional(),maxTokens:V().int(),stopSequences:W(B()).optional(),metadata:Um.optional(),tools:W(kg).optional(),toolChoice:Gg.optional()}),Zg=Qm.extend({method:X(`sampling/createMessage`),params:Xg}),Qg=nh.extend({model:B(),stopReason:Z(Y([`endTurn`,`stopSequence`,`maxTokens`]).or(B())),role:zh,content:qg}),$g=nh.extend({model:B(),stopReason:Z(Y([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(B())),role:zh,content:q([Jg,W(Jg)])}),e_=G({type:X(`boolean`),title:B().optional(),description:B().optional(),default:H().optional()}),t_=G({type:X(`string`),title:B().optional(),description:B().optional(),minLength:V().optional(),maxLength:V().optional(),format:Y([`email`,`uri`,`date`,`date-time`]).optional(),default:B().optional()}),n_=G({type:Y([`number`,`integer`]),title:B().optional(),description:B().optional(),minimum:V().optional(),maximum:V().optional(),default:V().optional()}),r_=G({type:X(`string`),title:B().optional(),description:B().optional(),enum:W(B()),default:B().optional()}),i_=G({type:X(`string`),title:B().optional(),description:B().optional(),oneOf:W(G({const:B(),title:B()})),default:B().optional()}),a_=G({type:X(`string`),title:B().optional(),description:B().optional(),enum:W(B()),enumNames:W(B()).optional(),default:B().optional()}),o_=q([r_,i_]),s_=G({type:X(`array`),title:B().optional(),description:B().optional(),minItems:V().optional(),maxItems:V().optional(),items:G({type:X(`string`),enum:W(B())}),default:W(B()).optional()}),c_=G({type:X(`array`),title:B().optional(),description:B().optional(),minItems:V().optional(),maxItems:V().optional(),items:G({anyOf:W(G({const:B(),title:B()}))}),default:W(B()).optional()}),l_=q([s_,c_]),u_=q([a_,o_,l_]),d_=q([u_,e_,t_,n_]),f_=Zm.extend({mode:X(`form`).optional(),message:B(),requestedSchema:G({type:X(`object`),properties:J(B(),d_),required:W(B()).optional()}).catchall(U())}),p_=Zm.extend({mode:X(`url`),message:B(),elicitationId:B(),url:B().url()}),m_=q([f_,p_]),h_=Qm.extend({method:X(`elicitation/create`),params:m_}),g_=$m.extend({elicitationId:B()}),__=eh.extend({method:X(`notifications/elicitation/complete`),params:g_}),v_=nh.extend({action:Y([`accept`,`decline`,`cancel`]),content:Om(e=>e===null?void 0:e,J(B(),q([B(),V(),H(),W(B())])).optional())}),y_=G({type:X(`ref/resource`),uri:B()}),b_=G({type:X(`ref/prompt`),name:B()}),x_=Xm.extend({ref:q([b_,y_]),argument:G({name:B(),value:B()}),context:G({arguments:J(B(),B()).optional()}).optional()}),S_=Qm.extend({method:X(`completion/complete`),params:x_}),C_=nh.extend({completion:K({values:W(B()).max(100),total:Z(V().int()),hasMore:Z(H())})}),w_=G({uri:B().startsWith(`file://`),name:B().optional(),_meta:J(B(),U()).optional()}),T_=Qm.extend({method:X(`roots/list`),params:Xm.optional()}),E_=nh.extend({roots:W(w_)}),D_=eh.extend({method:X(`notifications/roots/list_changed`),params:$m.optional()}),O_=K({ttl:V().optional(),pollInterval:V().optional()}),k_=Y([`working`,`input_required`,`completed`,`failed`,`cancelled`]),A_=G({taskId:B(),status:k_,ttl:q([V(),Vp()]),createdAt:B(),lastUpdatedAt:B(),pollInterval:Z(V()),statusMessage:Z(B())}),j_=nh.extend({task:A_}),M_=$m.merge(A_),N_=eh.extend({method:X(`notifications/tasks/status`),params:M_}),P_=Qm.extend({method:X(`tasks/get`),params:Xm.extend({taskId:B()})}),F_=nh.merge(A_),I_=Qm.extend({method:X(`tasks/result`),params:Xm.extend({taskId:B()})}),L_=nh.loose(),R_=Nh.extend({method:X(`tasks/list`)}),z_=Ph.extend({tasks:W(A_)}),B_=Qm.extend({method:X(`tasks/cancel`),params:Xm.extend({taskId:B()})}),V_=nh.merge(A_),H_=q([Oh,Sh,Eh,S_,Bg,gg,pg,Uh,Gh,Yh,$h,tg,ig,Fg,Ag]),U_=q([fh,jh,Th,D_]),W_=q([uh,Qg,$g,v_,E_]),G_=q([Oh,Zg,h_,T_]),K_=q([fh,jh,Hg,ug,Zh,Ig,Eg,og,__]),q_=q([uh,wh,Dh,C_,Tg,mg,Wh,Kh,Xh,Mg,jg,cg]),J_=vp().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:km.custom,message:`URL must be parseable`,fatal:!0}),Oo}).refine(e=>{let t=new URL(e);return t.protocol!==`javascript:`&&t.protocol!==`data:`&&t.protocol!==`vbscript:`},{message:`URL cannot use javascript:, data:, or vbscript: scheme`}),Y_=K({resource:B().url(),authorization_servers:W(J_).optional(),jwks_uri:B().url().optional(),scopes_supported:W(B()).optional(),bearer_methods_supported:W(B()).optional(),resource_signing_alg_values_supported:W(B()).optional(),resource_name:B().optional(),resource_documentation:B().optional(),resource_policy_uri:B().url().optional(),resource_tos_uri:B().url().optional(),tls_client_certificate_bound_access_tokens:H().optional(),authorization_details_types_supported:W(B()).optional(),dpop_signing_alg_values_supported:W(B()).optional(),dpop_bound_access_tokens_required:H().optional()}),X_=K({issuer:B(),authorization_endpoint:J_,token_endpoint:J_,registration_endpoint:J_.optional(),scopes_supported:W(B()).optional(),response_types_supported:W(B()),response_modes_supported:W(B()).optional(),grant_types_supported:W(B()).optional(),token_endpoint_auth_methods_supported:W(B()).optional(),token_endpoint_auth_signing_alg_values_supported:W(B()).optional(),service_documentation:J_.optional(),revocation_endpoint:J_.optional(),revocation_endpoint_auth_methods_supported:W(B()).optional(),revocation_endpoint_auth_signing_alg_values_supported:W(B()).optional(),introspection_endpoint:B().optional(),introspection_endpoint_auth_methods_supported:W(B()).optional(),introspection_endpoint_auth_signing_alg_values_supported:W(B()).optional(),code_challenge_methods_supported:W(B()).optional(),client_id_metadata_document_supported:H().optional(),authorization_response_iss_parameter_supported:H().optional().catch(void 0)}),Z_=K({issuer:B(),authorization_endpoint:J_,token_endpoint:J_,userinfo_endpoint:J_.optional(),jwks_uri:J_,registration_endpoint:J_.optional(),scopes_supported:W(B()).optional(),response_types_supported:W(B()),response_modes_supported:W(B()).optional(),grant_types_supported:W(B()).optional(),acr_values_supported:W(B()).optional(),subject_types_supported:W(B()),id_token_signing_alg_values_supported:W(B()),id_token_encryption_alg_values_supported:W(B()).optional(),id_token_encryption_enc_values_supported:W(B()).optional(),userinfo_signing_alg_values_supported:W(B()).optional(),userinfo_encryption_alg_values_supported:W(B()).optional(),userinfo_encryption_enc_values_supported:W(B()).optional(),request_object_signing_alg_values_supported:W(B()).optional(),request_object_encryption_alg_values_supported:W(B()).optional(),request_object_encryption_enc_values_supported:W(B()).optional(),token_endpoint_auth_methods_supported:W(B()).optional(),token_endpoint_auth_signing_alg_values_supported:W(B()).optional(),display_values_supported:W(B()).optional(),claim_types_supported:W(B()).optional(),claims_supported:W(B()).optional(),service_documentation:B().optional(),claims_locales_supported:W(B()).optional(),ui_locales_supported:W(B()).optional(),claims_parameter_supported:H().optional(),request_parameter_supported:H().optional(),request_uri_parameter_supported:H().optional(),require_request_uri_registration:H().optional(),op_policy_uri:J_.optional(),op_tos_uri:J_.optional(),client_id_metadata_document_supported:H().optional(),authorization_response_iss_parameter_supported:H().optional().catch(void 0)}),Q_=G({...Z_.shape,...X_.pick({code_challenge_methods_supported:!0}).shape}),$_=G({access_token:B(),id_token:B().optional(),token_type:B(),expires_in:Nm().optional(),scope:B().optional(),refresh_token:B().optional()}).strip(),ev=G({issued_token_type:X(`urn:ietf:params:oauth:token-type:id-jag`),access_token:B(),token_type:B().optional(),expires_in:V().optional(),scope:B().optional()}).strip(),tv=G({error:B(),error_description:B().optional(),error_uri:B().optional()}),nv=J_.optional().or(X(``).transform(()=>void 0)),rv=G({redirect_uris:W(J_),token_endpoint_auth_method:B().optional(),grant_types:W(B()).optional(),response_types:W(B()).optional(),application_type:B().optional(),client_name:B().optional(),client_uri:J_.optional(),logo_uri:nv,scope:B().optional(),contacts:W(B()).optional(),tos_uri:nv,policy_uri:B().optional(),jwks_uri:J_.optional(),jwks:Up().optional(),software_id:B().optional(),software_version:B().optional(),software_statement:B().optional()}).strip(),iv=G({client_id:B(),client_secret:B().optional(),client_id_issued_at:V().optional(),client_secret_expires_at:V().optional()}).strip(),av=rv.merge(iv),ov=G({error:B(),error_description:B().optional()}).strip(),sv=G({token:B(),token_type_hint:B().optional()}).strip(),cv=Symbol.for(`mcp.sdk.errorBrands`);function lv(e,t){let n=new Set,r=t;for(;typeof r==`function`;){let e=r.mcpBrand;Object.prototype.hasOwnProperty.call(r,`mcpBrand`)&&typeof e==`string`&&n.add(e),r=Object.getPrototypeOf(r)}n.size!==0&&Object.defineProperty(e,cv,{value:n,enumerable:!1,configurable:!0})}function uv(e,t){try{if(typeof t==`object`&&t&&Object.prototype.hasOwnProperty.call(e,`mcpBrand`)&&typeof e.mcpBrand==`string`&&Object.prototype.hasOwnProperty.call(t,cv)){let n=t[cv];if(n&&typeof n.has==`function`&&n.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}(class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.OAuthError`})}static[Symbol.hasInstance](e){return uv(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return uv(this,e)}constructor(e,t,n){super(t),this.code=e,this.errorUri=n,this.name=`OAuthError`,lv(this,new.target)}toResponseObject(){let e={error:this.code,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}});var dv=function(e){return e.NotConnected=`NOT_CONNECTED`,e.AlreadyConnected=`ALREADY_CONNECTED`,e.NotInitialized=`NOT_INITIALIZED`,e.CapabilityNotSupported=`CAPABILITY_NOT_SUPPORTED`,e.RequestTimeout=`REQUEST_TIMEOUT`,e.ConnectionClosed=`CONNECTION_CLOSED`,e.SendFailed=`SEND_FAILED`,e.InvalidResult=`INVALID_RESULT`,e.UnsupportedResultType=`UNSUPPORTED_RESULT_TYPE`,e.InputRequiredRoundsExceeded=`INPUT_REQUIRED_ROUNDS_EXCEEDED`,e.ListPaginationExceeded=`LIST_PAGINATION_EXCEEDED`,e.MethodNotSupportedByProtocolVersion=`METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION`,e.EraNegotiationFailed=`ERA_NEGOTIATION_FAILED`,e.ClientHttpNotImplemented=`CLIENT_HTTP_NOT_IMPLEMENTED`,e.ClientHttpAuthentication=`CLIENT_HTTP_AUTHENTICATION`,e.ClientHttpForbidden=`CLIENT_HTTP_FORBIDDEN`,e.ClientHttpUnexpectedContent=`CLIENT_HTTP_UNEXPECTED_CONTENT`,e.ClientHttpFailedToOpenStream=`CLIENT_HTTP_FAILED_TO_OPEN_STREAM`,e.ClientHttpFailedToTerminateSession=`CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION`,e}({}),fv=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkError`})}static[Symbol.hasInstance](e){return uv(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return uv(this,e)}constructor(e,t,n){super(t),this.code=e,this.data=n,this.name=`SdkError`,lv(this,new.target)}};(class extends fv{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkHttpError`})}constructor(e,t,n){super(e,t,n),this.name=`SdkHttpError`}get status(){return this.data.status}get statusText(){return this.data.statusText}});var pv=`2026-07-28`;function mv(e){return e>=pv}function hv(e){let t=e.structuredContent;return t===void 0||typeof t==`object`&&t&&!Array.isArray(t)||(e.content?.some(e=>e.type===`text`)??!1)?e:{...e,content:[...e.content??[],{type:`text`,text:JSON.stringify(t)}]}}var gv=[`task`,`inputRequests`,`requestState`];function _v(e){return typeof e!=`object`||!e||Array.isArray(e)||e.content!==void 0||gv.some(t=>t in e)?e:{...e,content:[]}}function vv(){let e=wm(()=>q([B(),V(),H(),Vp(),J(B(),e),W(e)])),t=J(B(),e),n=q([B(),V().int()]),r=B(),i=G({ttl:V().optional()}),a=G({taskId:B()}),o=K({progressToken:n.optional(),"io.modelcontextprotocol/related-task":a.optional()}),s=G({_meta:o.optional()}),c=s.extend({task:i.optional()}),l=G({method:B(),params:s.loose().optional()}),u=G({_meta:o.optional()}),d=G({method:B(),params:u.loose().optional()}),f=K({_meta:o.optional()}),p=q([B(),V().int()]),m=f.strict(),h=u.extend({requestId:p.optional(),reason:B().optional()}),g=d.extend({method:X(`notifications/cancelled`),params:h}),_=G({src:B(),mimeType:B().optional(),sizes:W(B()).optional(),theme:Y([`light`,`dark`]).optional()}),v=G({icons:W(_).optional()}),y=G({name:B(),title:B().optional()}),b=y.extend({...y.shape,...v.shape,version:B(),websiteUrl:B().optional(),description:B().optional()}),ee=Om(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,$p(G({form:$p(G({applyDefaults:H().optional()}),t).optional(),url:t.optional()}),t.optional())),te=K({list:t.optional(),cancel:t.optional(),requests:K({sampling:K({createMessage:t.optional()}).optional(),elicitation:K({create:t.optional()}).optional()}).optional()}),x=K({list:t.optional(),cancel:t.optional(),requests:K({tools:K({call:t.optional()}).optional()}).optional()}),ne=G({experimental:J(B(),t).optional(),sampling:G({context:t.optional(),tools:t.optional()}).optional(),elicitation:ee.optional(),roots:G({listChanged:H().optional()}).optional(),tasks:te.optional(),extensions:J(B(),t).optional()}),S=s.extend({protocolVersion:B(),capabilities:ne,clientInfo:b}),re=l.extend({method:X(`initialize`),params:S}),C=G({experimental:J(B(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:G({listChanged:H().optional()}).optional(),resources:G({subscribe:H().optional(),listChanged:H().optional()}).optional(),tools:G({listChanged:H().optional()}).optional(),tasks:x.optional(),extensions:J(B(),t).optional()}),ie=f.extend({protocolVersion:B(),capabilities:C,serverInfo:b,instructions:B().optional()}),ae=d.extend({method:X(`notifications/initialized`),params:u.optional()}),oe=l.extend({method:X(`ping`),params:s.optional()}),se=G({progress:V(),total:Z(V()),message:Z(B())}),ce=G({...u.shape,...se.shape,progressToken:n}),le=d.extend({method:X(`notifications/progress`),params:ce}),ue=s.extend({cursor:r.optional()}),de=l.extend({params:ue.optional()}),fe=f.extend({nextCursor:r.optional()}),pe=G({uri:B(),mimeType:Z(B()),_meta:J(B(),U()).optional()}),me=pe.extend({text:B()}),he=B().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),ge=pe.extend({blob:he}),_e=Y([`user`,`assistant`]),ve=G({audience:W(_e).optional(),priority:V().min(0).max(1).optional(),lastModified:jm({offset:!0}).optional()}),ye=G({...y.shape,...v.shape,uri:B(),description:Z(B()),mimeType:Z(B()),size:Z(V()),annotations:ve.optional(),_meta:Z(K({}))}),be=G({...y.shape,...v.shape,uriTemplate:B(),description:Z(B()),mimeType:Z(B()),annotations:ve.optional(),_meta:Z(K({}))}),xe=de.extend({method:X(`resources/list`)}),Se=fe.extend({resources:W(ye)}),Ce=de.extend({method:X(`resources/templates/list`)}),we=fe.extend({resourceTemplates:W(be)}),Te=s.extend({uri:B()}),Ee=Te,w=l.extend({method:X(`resources/read`),params:Ee}),T=f.extend({contents:W(q([me,ge]))}),De=d.extend({method:X(`notifications/resources/list_changed`),params:u.optional()}),Oe=Te,ke=l.extend({method:X(`resources/subscribe`),params:Oe}),Ae=Te,je=l.extend({method:X(`resources/unsubscribe`),params:Ae}),Me=u.extend({uri:B()}),Ne=d.extend({method:X(`notifications/resources/updated`),params:Me}),Pe=G({name:B(),description:Z(B()),required:Z(H())}),Fe=G({...y.shape,...v.shape,description:Z(B()),arguments:Z(W(Pe)),_meta:Z(K({}))}),Ie=de.extend({method:X(`prompts/list`)}),Le=fe.extend({prompts:W(Fe)}),Re=s.extend({name:B(),arguments:J(B(),B()).optional()}),ze=l.extend({method:X(`prompts/get`),params:Re}),Be=G({type:X(`text`),text:B(),annotations:ve.optional(),_meta:J(B(),U()).optional()}),Ve=G({type:X(`image`),data:he,mimeType:B(),annotations:ve.optional(),_meta:J(B(),U()).optional()}),He=G({type:X(`audio`),data:he,mimeType:B(),annotations:ve.optional(),_meta:J(B(),U()).optional()}),Ue=G({type:X(`tool_use`),name:B(),id:B(),input:J(B(),U()),_meta:J(B(),U()).optional()}),We=G({type:X(`resource`),resource:q([me,ge]),annotations:ve.optional(),_meta:J(B(),U()).optional()}),Ge=ye.extend({type:X(`resource_link`)}),Ke=q([Be,Ve,He,Ge,We]),qe=G({role:_e,content:Ke}),Je=f.extend({description:B().optional(),messages:W(qe)}),Ye=d.extend({method:X(`notifications/prompts/list_changed`),params:u.optional()}),Xe=G({title:B().optional(),readOnlyHint:H().optional(),destructiveHint:H().optional(),idempotentHint:H().optional(),openWorldHint:H().optional()}),Ze=G({taskSupport:Y([`required`,`optional`,`forbidden`]).optional()}),Qe=G({...y.shape,...v.shape,description:B().optional(),inputSchema:G({type:X(`object`),properties:J(B(),e).optional(),required:W(B()).optional()}).catchall(U()),outputSchema:G({type:X(`object`),properties:J(B(),e).optional(),required:W(B()).optional()}).catchall(U()).optional(),annotations:Xe.optional(),execution:Ze.optional(),_meta:J(B(),U()).optional()}),$e=de.extend({method:X(`tools/list`)}),et=fe.extend({tools:W(Qe)}),tt=f.extend({content:W(Ke),structuredContent:J(B(),U()).optional(),isError:H().optional()}),nt=c.extend({name:B(),arguments:J(B(),U()).optional()}),rt=l.extend({method:X(`tools/call`),params:nt}),it=d.extend({method:X(`notifications/tools/list_changed`),params:u.optional()}),at=Y([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),ot=s.extend({level:at}),st=l.extend({method:X(`logging/setLevel`),params:ot}),ct=u.extend({level:at,logger:B().optional(),data:U()}),lt=d.extend({method:X(`notifications/message`),params:ct}),ut=G({name:B().optional()}),dt=G({hints:W(ut).optional(),costPriority:V().min(0).max(1).optional(),speedPriority:V().min(0).max(1).optional(),intelligencePriority:V().min(0).max(1).optional()}),ft=G({mode:Y([`auto`,`required`,`none`]).optional()}),pt=G({type:X(`tool_result`),toolUseId:B().describe(`The unique identifier for the corresponding tool call.`),content:W(Ke),structuredContent:G({}).loose().optional(),isError:H().optional(),_meta:J(B(),U()).optional()}),mt=Zp(`type`,[Be,Ve,He]),ht=Zp(`type`,[Be,Ve,He,Ue,pt]),gt=G({role:_e,content:q([ht,W(ht)]),_meta:J(B(),U()).optional()}),_t=c.extend({messages:W(gt),modelPreferences:dt.optional(),systemPrompt:B().optional(),includeContext:Y([`none`,`thisServer`,`allServers`]).optional(),temperature:V().optional(),maxTokens:V().int(),stopSequences:W(B()).optional(),metadata:t.optional(),tools:W(Qe).optional(),toolChoice:ft.optional()}),vt=l.extend({method:X(`sampling/createMessage`),params:_t}),yt=f.extend({model:B(),stopReason:Z(Y([`endTurn`,`stopSequence`,`maxTokens`]).or(B())),role:_e,content:mt}),bt=f.extend({model:B(),stopReason:Z(Y([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(B())),role:_e,content:q([ht,W(ht)])}),xt=G({type:X(`boolean`),title:B().optional(),description:B().optional(),default:H().optional()}),St=G({type:X(`string`),title:B().optional(),description:B().optional(),minLength:V().optional(),maxLength:V().optional(),format:Y([`email`,`uri`,`date`,`date-time`]).optional(),default:B().optional()}),Ct=G({type:Y([`number`,`integer`]),title:B().optional(),description:B().optional(),minimum:V().optional(),maximum:V().optional(),default:V().optional()}),wt=G({type:X(`string`),title:B().optional(),description:B().optional(),enum:W(B()),default:B().optional()}),Tt=G({type:X(`string`),title:B().optional(),description:B().optional(),oneOf:W(G({const:B(),title:B()})),default:B().optional()}),Et=G({type:X(`string`),title:B().optional(),description:B().optional(),enum:W(B()),enumNames:W(B()).optional(),default:B().optional()}),Dt=q([wt,Tt]),Ot=G({type:X(`array`),title:B().optional(),description:B().optional(),minItems:V().optional(),maxItems:V().optional(),items:G({type:X(`string`),enum:W(B())}),default:W(B()).optional()}),kt=G({type:X(`array`),title:B().optional(),description:B().optional(),minItems:V().optional(),maxItems:V().optional(),items:G({anyOf:W(G({const:B(),title:B()}))}),default:W(B()).optional()}),At=q([Ot,kt]),jt=q([Et,Dt,At]),Mt=q([jt,xt,St,Ct]),Nt=c.extend({mode:X(`form`).optional(),message:B(),requestedSchema:G({type:X(`object`),properties:J(B(),Mt),required:W(B()).optional()}).catchall(U())}),Pt=c.extend({mode:X(`url`),message:B(),elicitationId:B(),url:B().url()}),Ft=q([Nt,Pt]),It=l.extend({method:X(`elicitation/create`),params:Ft}),Lt=u.extend({elicitationId:B()}),Rt=d.extend({method:X(`notifications/elicitation/complete`),params:Lt}),zt=f.extend({action:Y([`accept`,`decline`,`cancel`]),content:Om(e=>e===null?void 0:e,J(B(),q([B(),V(),H(),W(B())])).optional())}),Bt=G({type:X(`ref/resource`),uri:B()}),Vt=G({type:X(`ref/prompt`),name:B()}),Ht=s.extend({ref:q([Vt,Bt]),argument:G({name:B(),value:B()}),context:G({arguments:J(B(),B()).optional()}).optional()}),Ut=l.extend({method:X(`completion/complete`),params:Ht}),Wt=f.extend({completion:K({values:W(B()).max(100),total:Z(V().int()),hasMore:Z(H())})}),Gt=G({uri:B().startsWith(`file://`),name:B().optional(),_meta:J(B(),U()).optional()}),Kt=l.extend({method:X(`roots/list`),params:s.optional()}),qt=f.extend({roots:W(Gt)}),Jt=d.extend({method:X(`notifications/roots/list_changed`),params:u.optional()}),Yt=K({ttl:V().optional(),pollInterval:V().optional()}),Xt=Y([`working`,`input_required`,`completed`,`failed`,`cancelled`]),Zt=G({taskId:B(),status:Xt,ttl:q([V(),Vp()]),createdAt:B(),lastUpdatedAt:B(),pollInterval:Z(V()),statusMessage:Z(B())}),Qt=f.extend({task:Zt}),$t=u.merge(Zt),E=d.extend({method:X(`notifications/tasks/status`),params:$t}),en=l.extend({method:X(`tasks/get`),params:s.extend({taskId:B()})}),tn=f.merge(Zt),nn=l.extend({method:X(`tasks/result`),params:s.extend({taskId:B()})}),rn=f.loose(),D=de.extend({method:X(`tasks/list`)}),an=fe.extend({tasks:W(Zt)}),on=l.extend({method:X(`tasks/cancel`),params:s.extend({taskId:B()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:r,TaskMetadataSchema:i,RelatedTaskMetadataSchema:a,RequestMetaSchema:o,BaseRequestParamsSchema:s,TaskAugmentedRequestParamsSchema:c,RequestSchema:l,NotificationsParamsSchema:u,NotificationSchema:d,ResultSchema:f,RequestIdSchema:p,EmptyResultSchema:m,CancelledNotificationParamsSchema:h,CancelledNotificationSchema:g,IconSchema:_,IconsSchema:v,BaseMetadataSchema:y,ImplementationSchema:b,ClientTasksCapabilitySchema:te,ServerTasksCapabilitySchema:x,ClientCapabilitiesSchema:ne,InitializeRequestParamsSchema:S,InitializeRequestSchema:re,ServerCapabilitiesSchema:C,InitializeResultSchema:ie,InitializedNotificationSchema:ae,PingRequestSchema:oe,ProgressSchema:se,ProgressNotificationParamsSchema:ce,ProgressNotificationSchema:le,PaginatedRequestParamsSchema:ue,PaginatedRequestSchema:de,PaginatedResultSchema:fe,ResourceContentsSchema:pe,TextResourceContentsSchema:me,BlobResourceContentsSchema:ge,RoleSchema:_e,AnnotationsSchema:ve,ResourceSchema:ye,ResourceTemplateSchema:be,ListResourcesRequestSchema:xe,ListResourcesResultSchema:Se,ListResourceTemplatesRequestSchema:Ce,ListResourceTemplatesResultSchema:we,ResourceRequestParamsSchema:Te,ReadResourceRequestParamsSchema:Ee,ReadResourceRequestSchema:w,ReadResourceResultSchema:T,ResourceListChangedNotificationSchema:De,SubscribeRequestParamsSchema:Oe,SubscribeRequestSchema:ke,UnsubscribeRequestParamsSchema:Ae,UnsubscribeRequestSchema:je,ResourceUpdatedNotificationParamsSchema:Me,ResourceUpdatedNotificationSchema:Ne,PromptArgumentSchema:Pe,PromptSchema:Fe,ListPromptsRequestSchema:Ie,ListPromptsResultSchema:Le,GetPromptRequestParamsSchema:Re,GetPromptRequestSchema:ze,TextContentSchema:Be,ImageContentSchema:Ve,AudioContentSchema:He,ToolUseContentSchema:Ue,EmbeddedResourceSchema:We,ResourceLinkSchema:Ge,ContentBlockSchema:Ke,PromptMessageSchema:qe,GetPromptResultSchema:Je,PromptListChangedNotificationSchema:Ye,ToolAnnotationsSchema:Xe,ToolExecutionSchema:Ze,ToolSchema:Qe,ListToolsRequestSchema:$e,ListToolsResultSchema:et,CallToolResultSchema:tt,CallToolRequestParamsSchema:nt,CallToolRequestSchema:rt,ToolListChangedNotificationSchema:it,LoggingLevelSchema:at,SetLevelRequestParamsSchema:ot,SetLevelRequestSchema:st,LoggingMessageNotificationParamsSchema:ct,LoggingMessageNotificationSchema:lt,ModelHintSchema:ut,ModelPreferencesSchema:dt,ToolChoiceSchema:ft,ToolResultContentSchema:pt,SamplingContentSchema:mt,SamplingMessageContentBlockSchema:ht,SamplingMessageSchema:gt,CreateMessageRequestParamsSchema:_t,CreateMessageRequestSchema:vt,CreateMessageResultSchema:yt,CreateMessageResultWithToolsSchema:bt,BooleanSchemaSchema:xt,StringSchemaSchema:St,NumberSchemaSchema:Ct,UntitledSingleSelectEnumSchemaSchema:wt,TitledSingleSelectEnumSchemaSchema:Tt,LegacyTitledEnumSchemaSchema:Et,SingleSelectEnumSchemaSchema:Dt,UntitledMultiSelectEnumSchemaSchema:Ot,TitledMultiSelectEnumSchemaSchema:kt,MultiSelectEnumSchemaSchema:At,EnumSchemaSchema:jt,PrimitiveSchemaDefinitionSchema:Mt,ElicitRequestFormParamsSchema:Nt,ElicitRequestURLParamsSchema:Pt,ElicitRequestParamsSchema:Ft,ElicitRequestSchema:It,ElicitationCompleteNotificationParamsSchema:Lt,ElicitationCompleteNotificationSchema:Rt,ElicitResultSchema:zt,ResourceTemplateReferenceSchema:Bt,PromptReferenceSchema:Vt,CompleteRequestParamsSchema:Ht,CompleteRequestSchema:Ut,CompleteResultSchema:Wt,RootSchema:Gt,ListRootsRequestSchema:Kt,ListRootsResultSchema:qt,RootsListChangedNotificationSchema:Jt,TaskCreationParamsSchema:Yt,TaskStatusSchema:Xt,TaskSchema:Zt,CreateTaskResultSchema:Qt,TaskStatusNotificationParamsSchema:$t,TaskStatusNotificationSchema:E,GetTaskRequestSchema:en,GetTaskResultSchema:tn,GetTaskPayloadRequestSchema:nn,GetTaskPayloadResultSchema:rn,ListTasksRequestSchema:D,ListTasksResultSchema:an,CancelTaskRequestSchema:on,CancelTaskResultSchema:f.merge(Zt),ClientRequestSchema:q([oe,re,Ut,st,ze,Ie,xe,Ce,w,ke,je,rt,$e,en,nn,D,on]),ClientNotificationSchema:q([g,le,ae,Jt,E]),ClientResultSchema:q([m,yt,bt,zt,qt,tn,an,Qt]),ServerRequestSchema:q([oe,vt,It,Kt,en,nn,D,on]),ServerNotificationSchema:q([g,le,lt,Ne,De,it,Ye,E,Rt]),ServerResultSchema:q([m,ie,Wt,Je,Le,Se,we,T,tt,et,tn,an,Qt]),CallToolResultWireSchema:U().superRefine((e,t)=>{if(typeof e==`object`&&e&&!Array.isArray(e)&&e.content===void 0){for(let n of gv)if(n in e){t.addIssue({code:`custom`,message:`content is required when the body carries '${n}' — another result family cannot default into an empty tools/call success`});return}}}).transform(_v).pipe(tt)}}var yv;function bv(){return yv??=vv()}function xv(e){return e.type!==`object`}var Sv=new Set([`const`,`enum`,`default`,`examples`]),Cv=new Set([`properties`,`patternProperties`,`$defs`,`definitions`,`dependentSchemas`,`dependencies`]);function wv(e){return e!==void 0&&!(typeof e==`string`&&e.startsWith(`#`))}function Tv(e){let t=typeof e.$schema==`string`?e.$schema:void 0;if(wv(e.$id))return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:e},required:[`result`]};let n=ha(e.$schema)&&e.$recursiveAnchor!==!0,r=(e,t)=>{if(Array.isArray(e))return e.map(e=>r(e,!1));if(typeof e!=`object`||!e||!t&&wv(e.$id))return e;let i={},a=!1;for(let[o,s]of Object.entries(e))t?i[o]=r(s,!1):(o===`$ref`||o===`$dynamicRef`)&&typeof s==`string`?i[o]=s===`#`?`#/properties/result`:s.startsWith(`#/`)?`#/properties/result${s.slice(1)}`:s:o===`$recursiveRef`&&s===`#`&&n?a=!0:i[o]=Sv.has(o)?s:Cv.has(o)?r(s,!0):r(s,!1);return a&&(`$ref`in i?i.allOf=[...Array.isArray(i.allOf)?i.allOf:[],{$ref:`#/properties/result`}]:i.$ref=`#/properties/result`),i};return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:r(e,!1)},required:[`result`]}}var Ev={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Dv={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},Ov={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},kv;function Av(){if(kv)return kv;let e=bv();return kv={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}},kv}function jv(e){return Object.prototype.hasOwnProperty.call(Ev,e)}function Mv(e){return Object.prototype.hasOwnProperty.call(Dv,e)}function Nv(e){return Object.prototype.hasOwnProperty.call(Ov,e)}function Pv(e){return Nv(e)?Av().resultSchemas[e]:void 0}function Fv(e){return jv(e)?Av().requestSchemas[e]:void 0}function Iv(e){return Mv(e)?Av().notificationSchemas[e]:void 0}Object.keys(Ev),Object.keys(Dv);function Lv(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Rv(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var zv={ok:!1,reason:`not-in-era`};function Bv(e){return Lv(e)&&Lv(e.outputSchema)&&xv(e.outputSchema)}function Vv(e){return e}var Hv={era:`2025-11-25`,hasRequestMethod:jv,hasNotificationMethod:Mv,validateRequest:(e,t)=>Rv(Fv(e),t),validateResult:(e,t)=>Rv(Pv(e),t),validateNotification:(e,t)=>Rv(Iv(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>zv,validateInputResponse:()=>zv,samplingResultVariant:((e,t)=>{let n=bv();return Rv(e?n.CreateMessageResultWithToolsSchema:n.CreateMessageResultSchema,t)}),outboundEnvelope:e=>void 0,validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let n=hv(e),r=n.structuredContent;if(r===void 0)return n;let i=typeof r!=`object`||!r||Array.isArray(r),a=t!==void 0&&xv(t);return!i&&!a?n:{...n,structuredContent:{result:r}}},decodeResult(e,t){if(Lv(t)&&`resultType`in t){let e={...t};return delete e.resultType,{kind:`complete`,result:Vv(e)}}return{kind:`complete`,result:Vv(t)}},encodeResult(e,t){if(e!==`tools/list`)return t;let n=t.tools;return!Array.isArray(n)||!n.some(e=>Bv(e))?t:{...t,tools:n.map(e=>Bv(e)?{...e,outputSchema:Tv(e.outputSchema)}:e)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>void 0};function Uv(){let e=wm(()=>q([B(),V(),H(),Vp(),J(B(),e),W(e)])),t=J(B(),e),n=q([B(),V().int()]),r=B(),i=q([B(),V().int()]),a=Y([`user`,`assistant`]),o=Y([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),s=B().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),c=G({ttl:V().optional()}),l=G({taskId:B()}),u=K({progressToken:n.optional(),"io.modelcontextprotocol/related-task":l.optional()}),d=G({_meta:u.optional()}),f=d.extend({task:c.optional()}),p=G({_meta:u.optional()}),m=G({method:B(),params:p.loose().optional()}),h=G({src:B(),mimeType:B().optional(),sizes:W(B()).optional(),theme:Y([`light`,`dark`]).optional()}),g=G({icons:W(h).optional()}),_=G({name:B(),title:B().optional()}),v=_.extend({..._.shape,...g.shape,version:B(),websiteUrl:B().optional(),description:B().optional()}),y=Om(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,$p(G({form:$p(G({applyDefaults:H().optional()}),t).optional(),url:t.optional()}),t.optional())),b=K({list:t.optional(),cancel:t.optional(),requests:K({sampling:K({createMessage:t.optional()}).optional(),elicitation:K({create:t.optional()}).optional()}).optional()}),ee=K({list:t.optional(),cancel:t.optional(),requests:K({tools:K({call:t.optional()}).optional()}).optional()}),te=G({experimental:J(B(),t).optional(),sampling:G({context:t.optional(),tools:t.optional()}).optional(),elicitation:y.optional(),roots:G({listChanged:H().optional()}).optional(),tasks:b.optional(),extensions:J(B(),t).optional()}),x=G({experimental:J(B(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:G({listChanged:H().optional()}).optional(),resources:G({subscribe:H().optional(),listChanged:H().optional()}).optional(),tools:G({listChanged:H().optional()}).optional(),tasks:ee.optional(),extensions:J(B(),t).optional()}),ne=G({progress:V(),total:Z(V()),message:Z(B())}),S=G({...p.shape,...ne.shape,progressToken:n}),re=m.extend({method:X(`notifications/progress`),params:S}),C=p.extend({level:o,logger:B().optional(),data:U()}),ie=m.extend({method:X(`notifications/message`),params:C}),ae=G({uri:B(),mimeType:Z(B()),_meta:J(B(),U()).optional()}),oe=ae.extend({text:B()}),se=ae.extend({blob:s}),ce=G({audience:W(a).optional(),priority:V().min(0).max(1).optional(),lastModified:jm({offset:!0}).optional()}),le=G({..._.shape,...g.shape,uri:B(),description:Z(B()),mimeType:Z(B()),size:Z(V()),annotations:ce.optional(),_meta:Z(K({}))}),ue=G({..._.shape,...g.shape,uriTemplate:B(),description:Z(B()),mimeType:Z(B()),annotations:ce.optional(),_meta:Z(K({}))}),de=m.extend({method:X(`notifications/resources/list_changed`),params:p.optional()}),fe=p.extend({uri:B()}),pe=m.extend({method:X(`notifications/resources/updated`),params:fe}),me=G({name:B(),description:Z(B()),required:Z(H())}),he=G({..._.shape,...g.shape,description:Z(B()),arguments:Z(W(me)),_meta:Z(K({}))}),ge=m.extend({method:X(`notifications/prompts/list_changed`),params:p.optional()}),_e=G({type:X(`text`),text:B(),annotations:ce.optional(),_meta:J(B(),U()).optional()}),ve=G({type:X(`image`),data:s,mimeType:B(),annotations:ce.optional(),_meta:J(B(),U()).optional()}),ye=G({type:X(`audio`),data:s,mimeType:B(),annotations:ce.optional(),_meta:J(B(),U()).optional()}),be=G({type:X(`tool_use`),name:B(),id:B(),input:J(B(),U()),_meta:J(B(),U()).optional()}),xe=G({type:X(`resource`),resource:q([oe,se]),annotations:ce.optional(),_meta:J(B(),U()).optional()}),Se=le.extend({type:X(`resource_link`)}),Ce=q([_e,ve,ye,Se,xe]),we=G({role:a,content:Ce}),Te=G({title:B().optional(),readOnlyHint:H().optional(),destructiveHint:H().optional(),idempotentHint:H().optional(),openWorldHint:H().optional()}),Ee=m.extend({method:X(`notifications/tools/list_changed`),params:p.optional()}),w=G({name:B().optional()}),T=G({hints:W(w).optional(),costPriority:V().min(0).max(1).optional(),speedPriority:V().min(0).max(1).optional(),intelligencePriority:V().min(0).max(1).optional()}),De=G({mode:Y([`auto`,`required`,`none`]).optional()}),Oe=G({type:X(`boolean`),title:B().optional(),description:B().optional(),default:H().optional()}),ke=G({type:X(`string`),title:B().optional(),description:B().optional(),minLength:V().optional(),maxLength:V().optional(),format:Y([`email`,`uri`,`date`,`date-time`]).optional(),default:B().optional()}),Ae=G({type:Y([`number`,`integer`]),title:B().optional(),description:B().optional(),minimum:V().optional(),maximum:V().optional(),default:V().optional()}),je=G({type:X(`string`),title:B().optional(),description:B().optional(),enum:W(B()),default:B().optional()}),Me=G({type:X(`string`),title:B().optional(),description:B().optional(),oneOf:W(G({const:B(),title:B()})),default:B().optional()}),Ne=G({type:X(`string`),title:B().optional(),description:B().optional(),enum:W(B()),enumNames:W(B()).optional(),default:B().optional()}),Pe=q([je,Me]),Fe=G({type:X(`array`),title:B().optional(),description:B().optional(),minItems:V().optional(),maxItems:V().optional(),items:G({type:X(`string`),enum:W(B())}),default:W(B()).optional()}),Ie=G({type:X(`array`),title:B().optional(),description:B().optional(),minItems:V().optional(),maxItems:V().optional(),items:G({anyOf:W(G({const:B(),title:B()}))}),default:W(B()).optional()}),Le=q([Fe,Ie]),Re=q([Ne,Pe,Le]),ze=q([Re,Oe,ke,Ae]),Be=f.extend({mode:X(`form`).optional(),message:B(),requestedSchema:G({type:X(`object`),properties:J(B(),ze),required:W(B()).optional()}).catchall(U())}),Ve=G({type:X(`ref/resource`),uri:B()}),He=G({type:X(`ref/prompt`),name:B()}),Ue=G({uri:B().startsWith(`file://`),name:B().optional(),_meta:J(B(),U()).optional()}),We=te.shape,Ge=G({experimental:We.experimental,sampling:We.sampling,elicitation:We.elicitation,roots:We.roots,extensions:We.extensions}),Ke=x.shape,qe=G({experimental:Ke.experimental,logging:Ke.logging,completions:Ke.completions,prompts:Ke.prompts,resources:Ke.resources,tools:Ke.tools,extensions:Ke.extensions}),Je=K({progressToken:n.optional(),[Im]:B(),[Lm]:v.optional(),[zm]:Ge,[Vm]:o.optional()}),Ye=G({..._.shape,...g.shape,description:B().optional(),inputSchema:K({$schema:B().optional(),type:X(`object`)}),outputSchema:K({$schema:B().optional()}).optional(),annotations:Te.optional(),_meta:J(B(),U()).optional()}),Xe=G({type:X(`tool_result`),toolUseId:B(),content:W(Ce),structuredContent:U().optional(),isError:H().optional(),_meta:J(B(),U()).optional()}),Ze=q([_e,ve,ye,be,Xe]),Qe=G({role:a,content:q([Ze,W(Ze)]),_meta:J(B(),U()).optional()}),$e=B(),et=K({[Rm]:v.optional().catch(void 0)}),tt=et.optional();function nt(e){return K({_meta:tt,resultType:$e.default(`complete`),...e})}let rt=nt({}),it=nt({nextCursor:r.optional()}),at=nt({content:W(Ce),structuredContent:U().optional(),isError:H().optional()}),ot=nt({ttlMs:V().int().min(0),cacheScope:Y([`public`,`private`]),tools:W(Ye),nextCursor:r.optional()}),st=nt({ttlMs:V().int().min(0),cacheScope:Y([`public`,`private`]),prompts:W(he),nextCursor:r.optional()}),ct=nt({description:B().optional(),messages:W(we)}),lt=nt({ttlMs:V().int().min(0),cacheScope:Y([`public`,`private`]),resources:W(le),nextCursor:r.optional()}),ut=nt({ttlMs:V().int().min(0),cacheScope:Y([`public`,`private`]),resourceTemplates:W(ue),nextCursor:r.optional()}),dt=nt({ttlMs:V().int().min(0),cacheScope:Y([`public`,`private`]),contents:W(q([oe,se]))}),ft=nt({completion:G({values:W(B()).max(100),total:V().int().optional(),hasMore:H().optional()}).loose()}),pt=nt({ttlMs:V().int().min(0),cacheScope:Y([`public`,`private`])}),mt=nt({ttlMs:V().int().min(0).catch(0),cacheScope:Y([`public`,`private`]).catch(`private`),supportedVersions:W(B()),capabilities:qe,instructions:B().optional()}),ht=G({messages:W(Qe),modelPreferences:T.optional(),systemPrompt:B().optional(),includeContext:Y([`none`,`thisServer`,`allServers`]).optional(),temperature:V().optional(),maxTokens:V().int(),stopSequences:W(B()).optional(),metadata:t.optional(),tools:W(Ye).optional(),toolChoice:De.optional()}),gt=G({method:X(`sampling/createMessage`),params:ht}),_t=G({method:X(`roots/list`),params:G({_meta:J(B(),U()).optional()}).optional()}),vt=G({...Qe.shape,model:B(),stopReason:B().optional()}),yt=G({roots:W(Ue)}),bt=G({action:Y([`accept`,`decline`,`cancel`]),content:J(B(),q([B(),V(),H(),W(B())])).optional()}),xt=G({mode:X(`url`),message:B(),url:B().url()}),St=q([Be,xt]),Ct=G({method:X(`elicitation/create`),params:St}),wt=q([gt,_t,Ct]),Tt=q([vt,yt,bt]),Et=J(B(),wt),Dt=J(B(),Tt),Ot=nt({inputRequests:Et.optional(),requestState:B().optional()}),kt={inputResponses:Dt.optional(),requestState:B().optional()},At=G({_meta:Je,...kt}),jt=K({progressToken:n.optional()});function Mt(e,t){return G({method:X(e),params:G({_meta:Je,...t})})}function Nt(e,t){return G({method:X(e),params:G({_meta:jt.optional(),...t}).optional()})}let Pt={name:B(),arguments:J(B(),U()).optional(),...kt},Ft={cursor:r.optional()},It=Mt(`tools/call`,Pt),Lt=Mt(`tools/list`,Ft),Rt=Mt(`prompts/list`,Ft),zt=Mt(`prompts/get`,{name:B(),arguments:J(B(),B()).optional(),...kt}),Bt=Mt(`resources/list`,Ft),Vt=Mt(`resources/templates/list`,Ft),Ht=Mt(`resources/read`,{uri:B(),...kt}),Ut={ref:q([He,Ve]),argument:G({name:B(),value:B()}),context:G({arguments:J(B(),B()).optional()}).optional()},Wt=Mt(`completion/complete`,Ut),Gt=Mt(`server/discover`,{}),Kt=G({toolsListChanged:H().optional(),promptsListChanged:H().optional(),resourcesListChanged:H().optional(),resourceSubscriptions:W(B()).optional()}),qt={notifications:Kt},Jt=Mt(`subscriptions/listen`,qt),Yt=et.extend({"io.modelcontextprotocol/subscriptionId":i}),Xt=K({_meta:Yt,resultType:$e.default(`complete`)}),Zt={"tools/call":Nt(`tools/call`,Pt),"tools/list":Nt(`tools/list`,Ft),"prompts/get":Nt(`prompts/get`,{name:B(),arguments:J(B(),B()).optional()}),"prompts/list":Nt(`prompts/list`,Ft),"resources/list":Nt(`resources/list`,Ft),"resources/templates/list":Nt(`resources/templates/list`,Ft),"resources/read":Nt(`resources/read`,{uri:B()}),"completion/complete":Nt(`completion/complete`,Ut),"server/discover":Nt(`server/discover`,{}),"subscriptions/listen":Nt(`subscriptions/listen`,qt)};function Qt(e){return K({_meta:tt,...e})}let $t={"tools/call":Qt({content:W(Ce),structuredContent:U().optional(),isError:H().optional()}),"tools/list":Qt({ttlMs:V().int().min(0),cacheScope:Y([`public`,`private`]),tools:W(Ye),nextCursor:r.optional()}),"prompts/get":Qt({description:B().optional(),messages:W(we)}),"prompts/list":Qt({ttlMs:V().int().min(0),cacheScope:Y([`public`,`private`]),prompts:W(he),nextCursor:r.optional()}),"resources/list":Qt({ttlMs:V().int().min(0),cacheScope:Y([`public`,`private`]),resources:W(le),nextCursor:r.optional()}),"resources/templates/list":Qt({ttlMs:V().int().min(0),cacheScope:Y([`public`,`private`]),resourceTemplates:W(ue),nextCursor:r.optional()}),"resources/read":Qt({ttlMs:V().int().min(0),cacheScope:Y([`public`,`private`]),contents:W(q([oe,se]))}),"completion/complete":Qt({completion:G({values:W(B()).max(100),total:V().int().optional(),hasMore:H().optional()}).loose()}),"server/discover":Qt({ttlMs:V().int().min(0).catch(0),cacheScope:Y([`public`,`private`]).catch(`private`),supportedVersions:W(B()),capabilities:qe,instructions:B().optional()}),"subscriptions/listen":Qt({})},E=K({"io.modelcontextprotocol/subscriptionId":i.optional()}),en=G({method:X(`notifications/subscriptions/acknowledged`),params:G({_meta:E.optional(),notifications:Kt})}),tn=G({_meta:E.optional(),requestId:i,reason:B().optional()}),nn=G({method:X(`notifications/cancelled`),params:tn}),rn={"notifications/cancelled":nn,"notifications/progress":re,"notifications/message":ie,"notifications/resources/updated":pe,"notifications/resources/list_changed":de,"notifications/tools/list_changed":Ee,"notifications/prompts/list_changed":ge,"notifications/subscriptions/acknowledged":en},D=e=>G({jsonrpc:X(`2.0`),id:q([B(),V().int()]),result:e}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:r,RequestIdSchema:i,RoleSchema:a,LoggingLevelSchema:o,TaskMetadataSchema:c,RelatedTaskMetadataSchema:l,RequestMetaSchema:u,BaseRequestParamsSchema:d,TaskAugmentedRequestParamsSchema:f,NotificationsParamsSchema:p,NotificationSchema:m,IconSchema:h,IconsSchema:g,BaseMetadataSchema:_,ImplementationSchema:v,ClientTasksCapabilitySchema:b,ServerTasksCapabilitySchema:ee,ClientCapabilitiesSchema:te,ServerCapabilitiesSchema:x,ProgressSchema:ne,ProgressNotificationParamsSchema:S,ProgressNotificationSchema:re,LoggingMessageNotificationParamsSchema:C,LoggingMessageNotificationSchema:ie,ResourceContentsSchema:ae,TextResourceContentsSchema:oe,BlobResourceContentsSchema:se,AnnotationsSchema:ce,ResourceSchema:le,ResourceTemplateSchema:ue,ResourceListChangedNotificationSchema:de,ResourceUpdatedNotificationParamsSchema:fe,ResourceUpdatedNotificationSchema:pe,PromptArgumentSchema:me,PromptSchema:he,PromptListChangedNotificationSchema:ge,TextContentSchema:_e,ImageContentSchema:ve,AudioContentSchema:ye,ToolUseContentSchema:be,EmbeddedResourceSchema:xe,ResourceLinkSchema:Se,ContentBlockSchema:Ce,PromptMessageSchema:we,ToolAnnotationsSchema:Te,ToolListChangedNotificationSchema:Ee,ModelHintSchema:w,ModelPreferencesSchema:T,ToolChoiceSchema:De,BooleanSchemaSchema:Oe,StringSchemaSchema:ke,NumberSchemaSchema:Ae,UntitledSingleSelectEnumSchemaSchema:je,TitledSingleSelectEnumSchemaSchema:Me,LegacyTitledEnumSchemaSchema:Ne,SingleSelectEnumSchemaSchema:Pe,UntitledMultiSelectEnumSchemaSchema:Fe,TitledMultiSelectEnumSchemaSchema:Ie,MultiSelectEnumSchemaSchema:Le,EnumSchemaSchema:Re,PrimitiveSchemaDefinitionSchema:ze,ElicitRequestFormParamsSchema:Be,ResourceTemplateReferenceSchema:Ve,PromptReferenceSchema:He,RootSchema:Ue,ClientCapabilities2026Schema:Ge,ServerCapabilities2026Schema:qe,RequestMetaEnvelopeSchema:Je,ToolSchema:Ye,ToolResultContentSchema:Xe,SamplingMessageContentBlockSchema:Ze,SamplingMessageSchema:Qe,ResultTypeSchema:$e,ResultMetaSchema:et,ResultSchema:rt,PaginatedResultSchema:it,CallToolResultSchema:at,ListToolsResultSchema:ot,ListPromptsResultSchema:st,GetPromptResultSchema:ct,ListResourcesResultSchema:lt,ListResourceTemplatesResultSchema:ut,ReadResourceResultSchema:dt,CompleteResultSchema:ft,CacheableResultSchema:pt,DiscoverResultSchema:mt,CreateMessageRequestParamsSchema:ht,CreateMessageRequestSchema:gt,ListRootsRequestSchema:_t,CreateMessageResultSchema:vt,ListRootsResultSchema:yt,ElicitResultSchema:bt,ElicitRequestURLParamsSchema:xt,ElicitRequestParamsSchema:St,ElicitRequestSchema:Ct,InputRequestSchema:wt,InputResponseSchema:Tt,InputRequestsSchema:Et,InputResponsesSchema:Dt,InputRequiredResultSchema:Ot,InputResponseRequestParamsSchema:At,CallToolRequestSchema:It,ListToolsRequestSchema:Lt,ListPromptsRequestSchema:Rt,GetPromptRequestSchema:zt,ListResourcesRequestSchema:Bt,ListResourceTemplatesRequestSchema:Vt,ReadResourceRequestSchema:Ht,CompleteRequestSchema:Wt,DiscoverRequestSchema:Gt,SubscriptionFilterSchema:Kt,SubscriptionsListenRequestSchema:Jt,SubscriptionsListenResultMetaSchema:Yt,SubscriptionsListenResultSchema:Xt,dispatchRequestSchemas:Zt,dispatchResultSchemas:$t,NotificationMetaSchema:E,SubscriptionsAcknowledgedNotificationSchema:en,CancelledNotificationParamsSchema:tn,CancelledNotificationSchema:nn,notificationSchemas2026:rn,JSONRPCResultResponseSchema:D(rt),CallToolResultResponseSchema:D(q([at,Ot])),ListToolsResultResponseSchema:D(ot),ListPromptsResultResponseSchema:D(st),GetPromptResultResponseSchema:D(q([ct,Ot])),ListResourcesResultResponseSchema:D(lt),ListResourceTemplatesResultResponseSchema:D(ut),ReadResourceResultResponseSchema:D(q([dt,Ot])),CompleteResultResponseSchema:D(ft),DiscoverResultResponseSchema:D(mt)}}var Wv;function Gv(){return Wv??=Uv()}var Kv=[`tools/list`,`prompts/list`,`resources/list`,`resources/templates/list`,`resources/read`,`server/discover`];function qv(e){return Kv.includes(e)}var Jv=Symbol(`modelcontextprotocol.resultCacheHintFallback`);function Yv(e){return e[Jv]}function Xv(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function Zv(e){return e===`public`||e===`private`}var Q=function(e){return e[e.ParseError=-32700]=`ParseError`,e[e.InvalidRequest=-32600]=`InvalidRequest`,e[e.MethodNotFound=-32601]=`MethodNotFound`,e[e.InvalidParams=-32602]=`InvalidParams`,e[e.InternalError=-32603]=`InternalError`,e[e.ResourceNotFound=-32002]=`ResourceNotFound`,e[e.MissingRequiredClientCapability=-32021]=`MissingRequiredClientCapability`,e[e.UnsupportedProtocolVersion=-32022]=`UnsupportedProtocolVersion`,e[e.UrlElicitationRequired=-32042]=`UrlElicitationRequired`,e}({}),Qv=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ProtocolError`})}static[Symbol.hasInstance](e){return uv(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return uv(this,e)}constructor(e,t,n){super(t),this.code=e,this.data=n,this.name=`ProtocolError`,lv(this,new.target)}static fromError(t,n,r){if(t===Q.UrlElicitationRequired&&r){let e=r;if(e.elicitations)return new ey(e.elicitations,n)}if(t===Q.UnsupportedProtocolVersion&&r){let e=r;if(Array.isArray(e.supported)&&typeof e.requested==`string`)return new ty({supported:e.supported,requested:e.requested},n)}if(t===Q.InvalidParams||t===Q.ResourceNotFound){let e=r;if(typeof e?.uri==`string`&&(t===Q.ResourceNotFound||Object.keys(e).length===1))return new $v(e.uri,n)}if(t===Q.MissingRequiredClientCapability&&r){let e=r;if(e.requiredCapabilities!==null&&typeof e.requiredCapabilities==`object`&&!Array.isArray(e.requiredCapabilities))return new ny({requiredCapabilities:e.requiredCapabilities},n)}return new e(t,n,r)}},$v=class extends Qv{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ResourceNotFoundError`})}constructor(e,t=`Resource not found: ${e}`){super(Q.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},ey=class extends Qv{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UrlElicitationRequiredError`})}constructor(e,t=`URL elicitation${e.length>1?`s`:``} required`){super(Q.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},ty=class extends Qv{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UnsupportedProtocolVersionError`})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(Q.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},ny=class extends Qv{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.MissingRequiredClientCapabilityError`})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(`, `)}`){super(Q.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},ry=0,iy=`private`,ay=[`tools/call`,`prompts/get`,`resources/read`];function oy(e,t){let n=t.resultType;if(n===void 0)return{...t,resultType:`complete`};if(n===`complete`||ay.includes(e))return t;throw new Qv(Q.InternalError,`Handler for ${e} returned resultType '${String(n)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function sy(e,t){let n=Yv(t);if(t.resultType!==`complete`||!qv(e))return n===void 0?t:fy(t);let r=t,i=Xv(r.ttlMs)?r.ttlMs:uy(n),a=Zv(r.cacheScope)?r.cacheScope:dy(n),o={...r,ttlMs:i,cacheScope:a};return delete o[Jv],o}function cy(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ly(e,t){if(t===void 0)return e;let n=e._meta;return n===void 0?{...e,_meta:{[Rm]:t}}:!cy(n)||n[`io.modelcontextprotocol/serverInfo`]!==void 0?e:{...e,_meta:{...n,[Rm]:t}}}function uy(e){return e!==void 0&&Xv(e.ttlMs)?e.ttlMs:ry}function dy(e){return e!==void 0&&Zv(e.cacheScope)?e.cacheScope:iy}function fy(e){let t={...e};return delete t[Jv],t}var py=[`elicitation/create`,`sampling/createMessage`,`roots/list`],my;function hy(){if(my)return my;let e=Gv();return my={request:{"elicitation/create":G({method:X(`elicitation/create`),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":G({method:X(`sampling/createMessage`),params:e.CreateMessageRequestParamsSchema}),"roots/list":G({method:X(`roots/list`),params:K({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},my}function gy(e){return py.includes(e)}function _y(e){return gy(e)?hy().request[e]:void 0}function vy(e){return gy(e)?hy().response[e]:void 0}var yy={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},by={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function xy(e){return Object.prototype.hasOwnProperty.call(yy,e)}function Sy(e){return Object.prototype.hasOwnProperty.call(by,e)}function Cy(e){return Object.prototype.hasOwnProperty.call(yy,e)}function wy(e){return xy(e)?Gv().dispatchRequestSchemas[e]:void 0}function Ty(e){return Cy(e)?Gv().dispatchResultSchemas[e]:void 0}function Ey(e){return Sy(e)?Gv().notificationSchemas2026[e]:void 0}Object.keys(yy),Object.keys(by);function Dy(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Oy(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var ky={ok:!1,reason:`not-in-era`},Ay=[Im,zm];function jy(e,t){let n=t,r=!1,i=()=>(r||=(n={...n},!0),n),a=t.tools;e===`tools/list`&&Array.isArray(a)&&a.some(e=>Dy(e)&&`execution`in e)&&(i().tools=a.map(e=>{if(!Dy(e)||!(`execution`in e))return e;let t={...e};return delete t.execution,t}));let o=t.capabilities;if(Dy(o)&&`tasks`in o){let e={...o};delete e.tasks,i().capabilities=e}return n}var My={era:`2026-07-28`,hasRequestMethod:xy,hasNotificationMethod:Sy,hasInputRequestMethod:e=>_y(e)!==void 0,validateRequest:(e,t)=>Oy(wy(e),t),validateResult:(e,t)=>Oy(Ty(e),t),validateNotification:(e,t)=>Oy(Ey(e),t),validateInputRequest:(e,t)=>Oy(_y(e),t),validateInputResponse:(e,t)=>Oy(vy(e),t),samplingResultVariant:()=>ky,outboundEnvelope(e){return{[Im]:e.protocolVersion,[Lm]:e.clientInfo,[zm]:e.clientCapabilities,...e.logLevel!==void 0&&{"io.modelcontextprotocol/logLevel":e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let n of Ay)n in e||t.push({key:n,problem:`missing`});let n=Gv().RequestMetaEnvelopeSchema.safeParse(e);if(!n.success)for(let e of n.error.issues){let n=e.path.map(String),r=n.length>0?n.join(`.`):`_meta`;n.length===1&&t.some(e=>e.key===r&&e.problem===`missing`)||t.push({key:r,problem:e.message})}return t},projectCallToolResult:e=>hv(e),inputRequestSchema:_y,decodeResult(e,t){if(!Dy(t))return{kind:`invalid`,error:new fv(dv.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let n=t.resultType;if(n===void 0)return{kind:`invalid`,error:new fv(dv.InvalidResult,`Invalid result for ${e}: missing required resultType — servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:`missing-resultType`})};if(typeof n!=`string`)return{kind:`invalid`,error:new fv(dv.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:n})};if(n===`input_required`){let n=t.inputRequests,r=Dy(n)?n:{},i=t.requestState;return Object.keys(r).length===0&&typeof i!=`string`?{kind:`invalid`,error:new fv(dv.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:`input-required-missing-both`})}:{kind:`input_required`,inputRequests:r,...typeof i==`string`&&{requestState:i}}}if(n!==`complete`)return{kind:`invalid`,error:new fv(dv.UnsupportedResultType,`Unsupported result type '${n}' for ${e}`,{resultType:n,method:e})};let r=Py(),i=Object.hasOwn(r,e)?r[e]:void 0;if(i!==void 0){let n=i.safeParse(t);if(!n.success)return{kind:`invalid`,error:new fv(dv.InvalidResult,`Invalid result for ${e}: ${n.error}`,{method:e})}}let a={...t};return delete a.resultType,{kind:`complete`,result:a}},encodeResult(e,t,n){return ly(sy(e,oy(e,jy(e,t))),n)},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope(e){if(e.envelope===void 0)return`Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)`;let t=Gv().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map(e=>e.message).join(`; `)}`}},Ny;function Py(){if(Ny)return Ny;let e=Gv();return Ny={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema},Ny}var Fy=`2026-07-28`;function Iy(e){return e!==void 0&&mv(e)?My:Hv}function Ly(e){return e.revision===void 0?e.era===`modern`?My.era:Hv.era:Iy(e.revision).era}function Ry(e){return By.some(t=>t.hasRequestMethod(e))}function zy(e){return By.some(t=>t.hasNotificationMethod(e))}var By=[Hv,My],Vy=j({AnnotationsSchema:()=>Bh,AudioContentSchema:()=>yg,BaseMetadataSchema:()=>hh,BaseRequestParamsSchema:()=>Xm,BlobResourceContentsSchema:()=>Rh,BooleanSchemaSchema:()=>e_,CallToolRequestParamsSchema:()=>Pg,CallToolRequestSchema:()=>Fg,CallToolResultSchema:()=>Mg,CancelTaskRequestSchema:()=>B_,CancelTaskResultSchema:()=>V_,CancelledNotificationParamsSchema:()=>dh,CancelledNotificationSchema:()=>fh,ClientCapabilitiesSchema:()=>bh,ClientNotificationSchema:()=>U_,ClientRequestSchema:()=>H_,ClientResultSchema:()=>W_,ClientTasksCapabilitySchema:()=>vh,CompatibilityCallToolResultSchema:()=>Ng,CompleteRequestParamsSchema:()=>x_,CompleteRequestSchema:()=>S_,CompleteResultSchema:()=>C_,ContentBlockSchema:()=>Cg,CreateMessageRequestParamsSchema:()=>Xg,CreateMessageRequestSchema:()=>Zg,CreateMessageResultSchema:()=>Qg,CreateMessageResultWithToolsSchema:()=>$g,CreateTaskResultSchema:()=>j_,CursorSchema:()=>Km,DiscoverRequestSchema:()=>Eh,DiscoverResultSchema:()=>Dh,ElicitRequestFormParamsSchema:()=>f_,ElicitRequestParamsSchema:()=>m_,ElicitRequestSchema:()=>h_,ElicitRequestURLParamsSchema:()=>p_,ElicitResultSchema:()=>v_,ElicitationCompleteNotificationParamsSchema:()=>g_,ElicitationCompleteNotificationSchema:()=>__,EmbeddedResourceSchema:()=>xg,EmptyResultSchema:()=>uh,EnumSchemaSchema:()=>u_,GetPromptRequestParamsSchema:()=>hg,GetPromptRequestSchema:()=>gg,GetPromptResultSchema:()=>Tg,GetTaskPayloadRequestSchema:()=>I_,GetTaskPayloadResultSchema:()=>L_,GetTaskRequestSchema:()=>P_,GetTaskResultSchema:()=>F_,IconSchema:()=>ph,IconsSchema:()=>mh,ImageContentSchema:()=>vg,ImplementationSchema:()=>gh,InitializeRequestParamsSchema:()=>xh,InitializeRequestSchema:()=>Sh,InitializeResultSchema:()=>wh,InitializedNotificationSchema:()=>Th,JSONArraySchema:()=>Wm,JSONObjectSchema:()=>Um,JSONRPCErrorResponseSchema:()=>sh,JSONRPCMessageSchema:()=>ch,JSONRPCNotificationSchema:()=>ah,JSONRPCRequestSchema:()=>ih,JSONRPCResponseSchema:()=>lh,JSONRPCResultResponseSchema:()=>oh,JSONValueSchema:()=>Hm,LegacyTitledEnumSchemaSchema:()=>a_,ListChangedOptionsBaseSchema:()=>Lg,ListPromptsRequestSchema:()=>pg,ListPromptsResultSchema:()=>mg,ListResourceTemplatesRequestSchema:()=>Gh,ListResourceTemplatesResultSchema:()=>Kh,ListResourcesRequestSchema:()=>Uh,ListResourcesResultSchema:()=>Wh,ListRootsRequestSchema:()=>T_,ListRootsResultSchema:()=>E_,ListTasksRequestSchema:()=>R_,ListTasksResultSchema:()=>z_,ListToolsRequestSchema:()=>Ag,ListToolsResultSchema:()=>jg,LoggingLevelSchema:()=>Rg,LoggingMessageNotificationParamsSchema:()=>Vg,LoggingMessageNotificationSchema:()=>Hg,ModelHintSchema:()=>Ug,ModelPreferencesSchema:()=>Wg,MultiSelectEnumSchemaSchema:()=>l_,NotificationSchema:()=>eh,NotificationsParamsSchema:()=>$m,NumberSchemaSchema:()=>n_,PaginatedRequestParamsSchema:()=>Mh,PaginatedRequestSchema:()=>Nh,PaginatedResultSchema:()=>Ph,PingRequestSchema:()=>Oh,PrimitiveSchemaDefinitionSchema:()=>d_,ProgressNotificationParamsSchema:()=>Ah,ProgressNotificationSchema:()=>jh,ProgressSchema:()=>kh,ProgressTokenSchema:()=>Gm,PromptArgumentSchema:()=>dg,PromptListChangedNotificationSchema:()=>Eg,PromptMessageSchema:()=>wg,PromptReferenceSchema:()=>b_,PromptSchema:()=>fg,ReadResourceRequestParamsSchema:()=>Jh,ReadResourceRequestSchema:()=>Yh,ReadResourceResultSchema:()=>Xh,RelatedTaskMetadataSchema:()=>Jm,RequestIdSchema:()=>rh,RequestMetaSchema:()=>Ym,RequestSchema:()=>Qm,ResourceContentsSchema:()=>Fh,ResourceLinkSchema:()=>Sg,ResourceListChangedNotificationSchema:()=>Zh,ResourceRequestParamsSchema:()=>qh,ResourceSchema:()=>Vh,ResourceTemplateReferenceSchema:()=>y_,ResourceTemplateSchema:()=>Hh,ResourceUpdatedNotificationParamsSchema:()=>lg,ResourceUpdatedNotificationSchema:()=>ug,ResultMetaObjectSchema:()=>th,ResultSchema:()=>nh,RoleSchema:()=>zh,RootSchema:()=>w_,RootsListChangedNotificationSchema:()=>D_,SamplingContentSchema:()=>qg,SamplingMessageContentBlockSchema:()=>Jg,SamplingMessageSchema:()=>Yg,ServerCapabilitiesSchema:()=>Ch,ServerNotificationSchema:()=>K_,ServerRequestSchema:()=>G_,ServerResultSchema:()=>q_,ServerTasksCapabilitySchema:()=>yh,SetLevelRequestParamsSchema:()=>zg,SetLevelRequestSchema:()=>Bg,SingleSelectEnumSchemaSchema:()=>o_,StringSchemaSchema:()=>t_,SubscribeRequestParamsSchema:()=>Qh,SubscribeRequestSchema:()=>$h,SubscriptionFilterSchema:()=>ng,SubscriptionsAcknowledgedNotificationParamsSchema:()=>ag,SubscriptionsAcknowledgedNotificationSchema:()=>og,SubscriptionsListenRequestParamsSchema:()=>rg,SubscriptionsListenRequestSchema:()=>ig,SubscriptionsListenResultMetaSchema:()=>sg,SubscriptionsListenResultSchema:()=>cg,TaskAugmentedRequestParamsSchema:()=>Zm,TaskCreationParamsSchema:()=>O_,TaskMetadataSchema:()=>qm,TaskSchema:()=>A_,TaskStatusNotificationParamsSchema:()=>M_,TaskStatusNotificationSchema:()=>N_,TaskStatusSchema:()=>k_,TextContentSchema:()=>_g,TextResourceContentsSchema:()=>Ih,TitledMultiSelectEnumSchemaSchema:()=>c_,TitledSingleSelectEnumSchemaSchema:()=>i_,ToolAnnotationsSchema:()=>Dg,ToolChoiceSchema:()=>Gg,ToolExecutionSchema:()=>Og,ToolListChangedNotificationSchema:()=>Ig,ToolResultContentSchema:()=>Kg,ToolSchema:()=>kg,ToolUseContentSchema:()=>bg,UnsubscribeRequestParamsSchema:()=>eg,UnsubscribeRequestSchema:()=>tg,UntitledMultiSelectEnumSchemaSchema:()=>s_,UntitledSingleSelectEnumSchemaSchema:()=>r_}),Hy=e=>ih.safeParse(e).success,Uy=e=>ah.safeParse(e).success,Wy=e=>oh.safeParse(e).success,Gy=e=>sh.safeParse(e).success;Q.InvalidRequest,Q.UnsupportedProtocolVersion,Q.InvalidParams,Q.MethodNotFound,Q.InvalidParams,Q.MissingRequiredClientCapability,Q.ParseError,Q.InvalidRequest,Q.MethodNotFound,Q.UnsupportedProtocolVersion,Q.MissingRequiredClientCapability;function Ky(e,t){return Jf(e,t)}function qy(e){return new Set(e.flatMap(e=>Object.keys(e.shape)))}function Jy(e){if(e==null)return!1;let t=typeof e;return t!==`object`&&t!==`function`||!(`~standard`in e)?!1:typeof e[`~standard`]?.validate==`function`}var Yy=!1,Xy=`draft-2020-12`;function Zy(e,t=`input`){let n=e[`~standard`],r;if(n.jsonSchema)r=n.jsonSchema[t]({target:Xy});else if(n.vendor===`zod`){if(!(`_zod`in e))throw Error(`Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().`);Yy||(Yy=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),r=Hf(e,{target:Xy,io:t})}else throw Error(`Schema library "${n.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t===`output`)return r.type===void 0&&Qy(r)?{type:`object`,...r}:r;if(r.type!==void 0&&r.type!==`object`)throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(r.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:`object`,...r}}function Qy(e){if(`properties`in e||`patternProperties`in e||`additionalProperties`in e||`required`in e)return!0;for(let t of[`oneOf`,`anyOf`,`allOf`]){let n=e[t];if(Array.isArray(n)&&n.length>0)return n.every(e=>typeof e==`object`&&!!e&&(e.type===`object`||Qy(e)))}return!1}function $y(e){return e.path?.length?`${e.path.map(e=>String(typeof e==`object`?e.key:e)).join(`.`)}: ${e.message}`:e.message}async function eb(e,t){let n=await e[`~standard`].validate(t);return n.issues&&n.issues.length>0?{success:!1,error:n.issues.map(e=>$y(e)).join(`, `)}:{success:!0,data:n.value}}function tb(e){let t=Hf(e,{target:Xy,io:`input`});return typeof t.pattern==`string`?t.pattern:void 0}var nb=/\\\.\\d\{(\d+)\}/;function rb(e){let t=nb.exec(e),n=[void 0,-1,0];return t&&n.push(Number(t[1])),[!1,!0].flatMap(e=>[!1,!0].flatMap(t=>n.map(n=>jm({local:e,offset:t,precision:n}))))}function ib(e,t){let n;switch(e){case`email`:n=[mp()];break;case`uri`:n=[vp()];break;case`date`:n=[Mm()];break;case`date-time`:n=rb(t)}return new Set(n.map(e=>tb(e)).filter(e=>e!==void 0))}function ab(e,t,n){return n!==`zod`||ib(e,t).has(t)}function ob(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function sb(e){try{return Zy(e,`input`)}catch(e){let t=e instanceof Error?e.message:String(e);throw new Qv(Q.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${t}`)}}var cb=new Set([`$comment`,`deprecated`,`description`,`examples`,`readOnly`,`title`,`writeOnly`]);function lb(e){return cb.has(e)||e.startsWith(`x-`)}var ub=new Set([`$schema`,...Object.keys(f_.shape.requestedSchema.shape)]),db={string:qy([t_,r_,i_,a_]),number:qy([n_]),integer:qy([n_]),boolean:qy([e_]),array:qy([s_,c_])},fb=new Set(t_.shape.format.unwrap().options);function pb(e,t,n,r){if(!ob(e))return e;let i=typeof e.type==`string`&&Object.hasOwn(db,e.type)?db[e.type]:void 0;if(i===void 0)return e;let a={};for(let[o,s]of Object.entries(e))i.has(o)||lb(o)?a[o]=s:o===`pattern`&&e.type===`string`&&typeof e.format==`string`?fb.has(e.format)?(typeof s!=`string`||!ab(e.format,s,n))&&r.push(`${t}.${o}`):a[o]=s:r.push(`${t}.${o}`);return a}function mb(e,t){let n={},r=[];for(let[i,a]of Object.entries(e))i===`properties`&&ob(a)?n[i]=Object.fromEntries(Object.entries(a).map(([e,n])=>[e,pb(n,`properties.${e}`,t,r)])):ub.has(i)?n[i]=a:lb(i)||r.push(i);if(r.length>0)throw new Qv(Q.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${r.join(`, `)}`);return n}function hb(e,t){if(!ob(e.properties))return t;let n=Object.entries(e.properties).filter(([,e])=>!Ky(d_,e).success).map(([e])=>`properties.${e}`);return n.length>0?n.join(`, `):t}function gb(e,t,n=``){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((e,r)=>gb(e,t[r],`${n}[${r}]`)):!ob(e)||!ob(t)?[]:Object.entries(e).flatMap(([e,r])=>{let i=n?`${n}.${e}`:e;return Object.prototype.hasOwnProperty.call(t,e)?gb(r,t[e],i):lb(e)?[]:[i]})}function _b(e){if(!Jy(e.requestedSchema))return{...e,mode:`form`,requestedSchema:e.requestedSchema};let t=e.requestedSchema[`~standard`].vendor,n=mb(sb(e.requestedSchema),t),r=Ky(f_.shape.requestedSchema,n);if(!r.success)throw new Qv(Q.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${hb(n,r.error.message)}`);let i=gb(n,r.data);if(i.length>0)throw new Qv(Q.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${i.join(`, `)}`);let a=(r.data.required??[]).filter(e=>!Object.prototype.hasOwnProperty.call(r.data.properties,e));if(a.length>0)throw new Qv(Q.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${a.join(`, `)}`);return{...e,mode:`form`,requestedSchema:r.data}}function vb(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,n=typeof e.requestState==`string`;if(!t&&!n)throw TypeError(`inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)`);return{resultType:`input_required`,...e.inputRequests!==void 0&&{inputRequests:e.inputRequests},...e.requestState!==void 0&&{requestState:e.requestState}}}Object.assign(vb,{elicit(e){try{return{method:`elicitation/create`,params:_b(e)}}catch(e){throw e instanceof Qv?TypeError(e.message,{cause:e}):e}},elicitUrl(e){return{method:`elicitation/create`,params:{...e,mode:`url`}}},createMessage(e){return{method:`sampling/createMessage`,params:e}},listRoots(){return{method:`roots/list`}}});var yb=`AnnotationsSchema.AudioContentSchema.BaseMetadataSchema.BlobResourceContentsSchema.BooleanSchemaSchema.CallToolRequestSchema.CallToolRequestParamsSchema.CallToolResultSchema.CancelledNotificationSchema.CancelledNotificationParamsSchema.CancelTaskRequestSchema.CancelTaskResultSchema.ClientCapabilitiesSchema.ClientNotificationSchema.ClientRequestSchema.ClientResultSchema.CompatibilityCallToolResultSchema.CompleteRequestSchema.CompleteRequestParamsSchema.CompleteResultSchema.ContentBlockSchema.CreateMessageRequestSchema.CreateMessageRequestParamsSchema.CreateMessageResultSchema.CreateMessageResultWithToolsSchema.CreateTaskResultSchema.CursorSchema.DiscoverRequestSchema.DiscoverResultSchema.ElicitationCompleteNotificationSchema.ElicitationCompleteNotificationParamsSchema.ElicitRequestSchema.ElicitRequestFormParamsSchema.ElicitRequestParamsSchema.ElicitRequestURLParamsSchema.ElicitResultSchema.EmbeddedResourceSchema.EmptyResultSchema.EnumSchemaSchema.GetPromptRequestSchema.GetPromptRequestParamsSchema.GetPromptResultSchema.GetTaskPayloadRequestSchema.GetTaskPayloadResultSchema.GetTaskRequestSchema.GetTaskResultSchema.IconSchema.IconsSchema.ImageContentSchema.ImplementationSchema.InitializedNotificationSchema.InitializeRequestSchema.InitializeRequestParamsSchema.InitializeResultSchema.JSONArraySchema.JSONObjectSchema.JSONRPCErrorResponseSchema.JSONRPCMessageSchema.JSONRPCNotificationSchema.JSONRPCRequestSchema.JSONRPCResponseSchema.JSONRPCResultResponseSchema.JSONValueSchema.LegacyTitledEnumSchemaSchema.ListPromptsRequestSchema.ListPromptsResultSchema.ListResourcesRequestSchema.ListResourcesResultSchema.ListResourceTemplatesRequestSchema.ListResourceTemplatesResultSchema.ListRootsRequestSchema.ListRootsResultSchema.ListTasksRequestSchema.ListTasksResultSchema.ListToolsRequestSchema.ListToolsResultSchema.LoggingLevelSchema.LoggingMessageNotificationSchema.LoggingMessageNotificationParamsSchema.ModelHintSchema.ModelPreferencesSchema.MultiSelectEnumSchemaSchema.NotificationSchema.NumberSchemaSchema.PaginatedRequestSchema.PaginatedRequestParamsSchema.PaginatedResultSchema.PingRequestSchema.PrimitiveSchemaDefinitionSchema.ProgressSchema.ProgressNotificationSchema.ProgressNotificationParamsSchema.ProgressTokenSchema.PromptSchema.PromptArgumentSchema.PromptListChangedNotificationSchema.PromptMessageSchema.PromptReferenceSchema.ReadResourceRequestSchema.ReadResourceRequestParamsSchema.ReadResourceResultSchema.RelatedTaskMetadataSchema.RequestSchema.RequestIdSchema.RequestMetaSchema.ResourceSchema.ResourceContentsSchema.ResourceLinkSchema.ResourceListChangedNotificationSchema.ResourceRequestParamsSchema.ResourceTemplateSchema.ResourceTemplateReferenceSchema.ResourceUpdatedNotificationSchema.ResourceUpdatedNotificationParamsSchema.ResultMetaObjectSchema.ResultSchema.RoleSchema.RootSchema.RootsListChangedNotificationSchema.SamplingContentSchema.SamplingMessageSchema.SamplingMessageContentBlockSchema.ServerCapabilitiesSchema.ServerNotificationSchema.ServerRequestSchema.ServerResultSchema.SetLevelRequestSchema.SetLevelRequestParamsSchema.SingleSelectEnumSchemaSchema.StringSchemaSchema.SubscribeRequestSchema.SubscribeRequestParamsSchema.SubscriptionFilterSchema.SubscriptionsAcknowledgedNotificationSchema.SubscriptionsAcknowledgedNotificationParamsSchema.SubscriptionsListenRequestSchema.SubscriptionsListenRequestParamsSchema.SubscriptionsListenResultSchema.SubscriptionsListenResultMetaSchema.TaskAugmentedRequestParamsSchema.TaskCreationParamsSchema.TaskMetadataSchema.TaskSchema.TaskStatusSchema.TaskStatusNotificationSchema.TaskStatusNotificationParamsSchema.TextContentSchema.TextResourceContentsSchema.TitledMultiSelectEnumSchemaSchema.TitledSingleSelectEnumSchemaSchema.ToolSchema.ToolAnnotationsSchema.ToolChoiceSchema.ToolExecutionSchema.ToolListChangedNotificationSchema.ToolResultContentSchema.ToolUseContentSchema.UnsubscribeRequestSchema.UnsubscribeRequestParamsSchema.UntitledMultiSelectEnumSchemaSchema.UntitledSingleSelectEnumSchemaSchema`.split(`.`),bb={IdJagTokenExchangeResponseSchema:ev,OAuthClientInformationFullSchema:av,OAuthClientInformationSchema:iv,OAuthClientMetadataSchema:rv,OAuthClientRegistrationErrorSchema:ov,OAuthErrorResponseSchema:tv,OAuthMetadataSchema:X_,OAuthProtectedResourceMetadataSchema:Y_,OAuthTokenRevocationRequestSchema:sv,OAuthTokensSchema:$_,OpenIdProviderDiscoveryMetadataSchema:Q_,OpenIdProviderMetadataSchema:Z_},xb={},Sb={};function Cb(e,t){let n=e.slice(0,-6);xb[n]=t,Sb[n]=e=>t.safeParse(e).success}for(let e of yb)Cb(e,Vy[e]);for(let[e,t]of Object.entries(bb))Cb(e,t);Object.freeze(xb),Object.freeze(Sb);function wb(e){switch(e){case`initialize`:case`notifications/initialized`:return Iy(void 0);case`server/discover`:return Iy(Fy);default:return}}var Tb=[Im,Lm,zm,Vm],Eb=[`inputResponses`,`requestState`];function Db(e,t){let n=e.params;if(!Mb(n))return{message:e,lifted:{}};let r=n._meta,i=Mb(r)?Tb.filter(e=>e in r):[],a=t===`request`?Eb.filter(e=>e in n):[];if(i.length===0&&a.length===0)return{message:e,lifted:{}};let o={},s={...n};if(i.length>0&&Mb(r)){let e={},t={...r};for(let n of i)e[n]=r[n],delete t[n];o.envelope=e,Object.keys(t).length>0?s._meta=t:delete s._meta}for(let e of a)e===`inputResponses`&&(o.inputResponses=s[e]),e===`requestState`&&(o.requestState=s[e]),delete s[e];return{message:{...e,params:s},lifted:o}}function Ob(e,t){let n=e.validateResult(t,void 0);if(n.ok||n.reason!==`not-in-era`)return{"~standard":{version:1,vendor:`mcp-wire-codec`,validate(n){let r=e.validateResult(t,n);return r.ok?{value:r.value}:{issues:[{message:r.reason===`invalid`?r.message:`not-in-era: ${t}`}]}}}}}function kb(e){return()=>e}var Ab=kb(void 0),jb=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??Pm,this.setNotificationHandler(`notifications/cancelled`,e=>{this._oncancel(e)}),this.setNotificationHandler(`notifications/progress`,e=>{this._onprogress(e)}),this.setRequestHandler(`ping`,e=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(t===void 0)return e;let n=e.params??{};return{...e,params:{...n,_meta:{...t,...n._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new fv(dv.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){e.params.requestId&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,r,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new fv(dv.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let n=this.transport?.onerror;this._transport.onerror=e=>{n?.(e),this._onerror(e)};let r=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{r?.(e,t),Wy(e)||Gy(e)?this._onresponse(e):Hy(e)?this._onrequest(e,t):Uy(e)?this._onnotification(e,t):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let e of this._timeoutInfo.values())clearTimeout(e.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let n=new fv(dv.ConnectionClosed,`Connection closed`);this._transport=void 0;try{this.onclose?.()}finally{for(let t of e.values())t(n);for(let e of t.values())e.abort(n)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:n}=Db(e,`notification`),r=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`)return;if(t?.classification!==void 0){let e=Ly(t.classification);if(e!==r.era){this._onerror(Error(`Era mismatch on inbound notification '${n.method}': classified as ${e} but this instance serves ${r.era}`));return}}if(zy(n.method)&&!r.hasNotificationMethod(n.method))return;let i=this._notificationHandlers.get(n.method),a=this.fallbackNotificationHandler;(i!==void 0||a!==void 0)&&Promise.resolve().then(()=>i===void 0?a(n):i(n,r)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let{message:n,lifted:r}=Db(e,`request`),i=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`){this._onerror(Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let a=this._transport,o=(e,t,r)=>{let i={jsonrpc:`2.0`,id:n.id,error:{code:e,message:t,...r!==void 0&&{data:r}}};a?.send(i).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)))};if(t?.classification!==void 0){let e=Ly(t.classification);if(e!==i.era){this._onerror(Error(`Era mismatch on inbound request '${n.method}': classified as ${e} but this instance serves ${i.era}`));let r=t.classification.revision??e;o(Q.UnsupportedProtocolVersion,`Unsupported protocol version: ${r}`,{supported:this._supportedProtocolVersions,requested:r});return}}if(Ry(n.method)&&!i.hasRequestMethod(n.method)){o(Q.MethodNotFound,`Method not found`);return}let s=this._requestHandlers.get(n.method)??this.fallbackRequestHandler;if(s===void 0){o(Q.MethodNotFound,`Method not found`);return}let c=i.checkInboundEnvelope(r);if(c!==void 0){o(Q.InvalidParams,c);return}let l=(e,t)=>this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,{...t,relatedRequestId:n.id}),u=(e,t,r)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(e.method),e,t,{...r,relatedRequestId:n.id}),d=new AbortController;this._requestHandlerAbortControllers.set(n.id,d);let f=r.inputResponses===void 0?void 0:Pb(r.inputResponses),p={sessionId:a?.sessionId,mcpReq:{id:n.id,method:n.method,_meta:n.params?._meta,...r.envelope!==void 0&&{envelope:r.envelope},...f!==void 0&&{inputResponses:f.accepted},...f!==void 0&&f.droppedKeys.length>0&&{droppedInputResponseKeys:f.droppedKeys},requestState:r.requestState===void 0?Ab:kb(r.requestState),signal:d.signal,send:((e,t,n)=>{let r=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(r,e.method),Jy(t))return u(e,t,n);let i=Ob(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return u(e,i,t)}),notify:l},http:t?.authInfo?{authInfo:t.authInfo}:void 0},m=this.buildContext(p,t);Promise.resolve().then(()=>s(n,m)).then(async e=>{if(d.signal.aborted)return;let t;try{t=i.encodeResult(n.method,e,this._outboundServerInfo())}catch(e){this._onerror(Error(`Failed to encode result for ${n.method}: ${e}`)),o(Q.InternalError,`Internal error`);return}let r={result:t,jsonrpc:`2.0`,id:n.id};await a?.send(r)},async e=>{if(d.signal.aborted)return;let t=Number.isSafeInteger(e.code)?e.code:Q.InternalError,r={jsonrpc:`2.0`,id:n.id,error:{code:i.encodeErrorCode(t),message:e.message??`Internal error`,...e.data!==void 0&&{data:e.data}}};await a?.send(r)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(n.id)===d&&this._requestHandlerAbortControllers.delete(n.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,r=Number(t),i=this._progressHandlers.get(r);if(!i){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(r),o=this._timeoutInfo.get(r);if(o&&a&&o.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(e){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),a(e);return}i(n)}_onresponse(e){let t=Number(e.id),n=this._responseHandlers.get(t);if(n===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),Wy(e)?n(e):n(Qv.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,n){let r=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(r,e.method),Jy(t))return this._requestWithSchemaViaCodec(r,e,t,n);let i=Ob(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(r,e,i,t)}_negotiatedWireCodec(){return Iy(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=wb(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(Ry(t)&&!e.hasRequestMethod(t))throw new fv(dv.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,n){let r=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,n)}_requestWithSchemaViaCodec(e,t,n,r){let{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s}=r??{},c=Date.now(),l,u;return new Promise((d,f)=>{let p=e=>{f(e)};if(!this._transport){p(Error(`Not connected`));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(e){p(e);return}if(r?.signal?.aborted){let e=r.signal.reason;throw e instanceof fv?e:new fv(dv.RequestTimeout,String(e))}let m=e.era===`2026-07-28`&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,h=this._requestMessageId++;u=h;let g={...t,jsonrpc:`2.0`,id:h};r?.onprogress&&(this._progressHandlers.set(h,r.onprogress),g.params={...t.params,_meta:{...t.params?._meta,progressToken:h}});let _=this._envelopeOutbound(g),v=!1,y=e=>{v||(this._progressHandlers.delete(h),m===void 0?this._transport?.send(this._envelopeOutbound({jsonrpc:`2.0`,method:`notifications/cancelled`,params:{requestId:h,reason:String(e)}}),{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))):m.abort(),f(e instanceof fv?e:new fv(dv.RequestTimeout,String(e))))};this._responseHandlers.set(h,i=>{if(r?.signal?.aborted)return;if(v=!0,i instanceof Error)return f(i);let a;try{a=e.decodeResult(t.method,i.result)}catch(e){return f(e instanceof Error?e:Error(String(e)))}if(a.kind===`invalid`)return f(a.error);if(a.kind===`input_required`){if(r?.allowInputRequired===!0)return d(Fb(a));let i={codec:e,request:t,resultSchema:n,options:r,flowStartedAt:c,retry:(r,i)=>this._requestWithSchemaViaCodec(e,r===void 0?{method:t.method}:{method:t.method,params:r},n,i)};return d(this._resolveNonCompleteResult(a,i))}let o=a.result;eb(n,o).then(e=>{e.success?d(e.data):f(new fv(dv.InvalidResult,`Invalid result for ${t.method}: ${e.error}`))},f)}),l=()=>y(r?.signal?.reason),r?.signal?.addEventListener(`abort`,l,{once:!0});let b=r?.timeout??6e4;this._setupTimeout(h,b,r?.maxTotalTimeout,()=>y(new fv(dv.RequestTimeout,`Request timed out`,{timeout:b})),r?.resetTimeoutOnProgress??!1),this._transport.send(_,{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s,requestSignal:m?.signal}).catch(e=>{this._progressHandlers.delete(h),f(e)})}).finally(()=>{l&&r?.signal?.removeEventListener(`abort`,l),u!==void 0&&(this._responseHandlers.delete(u),this._cleanupTimeout(u))})}async notification(e,t){return this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,n){if(!this._transport)throw new fv(dv.NotConnected,`Not connected`);if(zy(t.method)&&!e.hasNotificationMethod(t.method))throw new fv(dv.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let r=this._envelopeOutbound({jsonrpc:`2.0`,...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!n?.relatedRequestId){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(t.method),this._transport&&this._transport?.send(r,n).catch(e=>this._onerror(e))});return}await this._transport.send(r,n)}setRequestHandler(e,t,n){this.assertRequestHandlerCapability(e);let r;if(typeof t==`function`){if(!Ry(e))throw TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);r=(n,r)=>{let i=this._negotiatedWireCodec(),a=i.validateRequest(e,n);if(!a.ok&&a.reason===`not-in-era`&&(a=i.validateInputRequest(e,n)),!a.ok)throw a.reason===`not-in-era`?new Qv(Q.InternalError,`No wire schema for ${e} in the resolved era`):Error(a.message);return Promise.resolve(t(a.value,r))}}else if(n)r=async(r,i)=>{let a=await eb(t.params,{...r.params});if(!a.success)throw new Qv(Q.InvalidParams,`Invalid params for ${e}: ${a.error}`);return n(a.data,i)};else throw TypeError(`setRequestHandler: handler is required`);this._requestHandlers.set(e,this._wrapHandler(e,r))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,n){if(typeof t==`function`){if(!zy(e))throw TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(n,r)=>{let i=r.validateNotification(e,n);if(!i.ok)throw i.reason===`not-in-era`?new Qv(Q.InternalError,`No wire schema for ${e} in the resolved era`):Error(i.message);return Promise.resolve(t(i.value))});return}if(!n)throw TypeError(`setNotificationHandler: handler is required`);this._notificationHandlers.set(e,async r=>{let i=await eb(t.params,{...r.params});if(!i.success)throw new Qv(Q.InvalidParams,`Invalid params for notification ${e}: ${i.error}`);await n(i.data,r)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function Mb(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Nb(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Pb(e){let t={},n=[];if(!Nb(e))return{accepted:t,droppedKeys:n};for(let[r,i]of Object.entries(e)){if(!Nb(i)||`method`in i||`result`in i){n.push(r);continue}t[r]=i}return{accepted:t,droppedKeys:n}}function Fb(e){return{resultType:`input_required`,inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState}}}pa((e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,n=/\\([\u000b\u0020-\u00ff])/g,r=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=i;function i(e){if(!e)throw TypeError(`argument string is required`);var i=typeof e==`object`?a(e):e;if(typeof i!=`string`)throw TypeError(`argument string is required to be a string`);var s=i.indexOf(`;`),c=s===-1?i.trim():i.slice(0,s).trim();if(!r.test(c))throw TypeError(`invalid media type`);var l=new o(c.toLowerCase());if(s!==-1){var u,d,f;for(t.lastIndex=s;d=t.exec(i);){if(d.index!==s)throw TypeError(`invalid parameter format`);s+=d[0].length,u=d[1].toLowerCase(),f=d[2],f.charCodeAt(0)===34&&(f=f.slice(1,-1),f.indexOf(`\\`)!==-1&&(f=f.replace(n,`$1`))),l.parameters[u]=f}if(s!==i.length)throw TypeError(`invalid parameter format`)}return l}function a(e){var t;if(typeof e.getHeader==`function`?t=e.getHeader(`content-type`):typeof e.headers==`object`&&(t=e.headers&&e.headers[`content-type`]),typeof t!=`string`)throw TypeError(`content-type header is missing from object`);return t}function o(e){this.parameters=Object.create(null),this.type=e}}))(),typeof self<`u`&&self.location&&self.location.origin!==`null`?new URL(self.location.origin+self.location.pathname+location.search):new URL(`https://github.com/cfworker`);var Ib=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,Lb=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,Rb=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,zb=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,Bb=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,Vb=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,Hb=/^(?:\/(?:[^~/]|~0|~1)*)*$/,Ub=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,Wb=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,Gb=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,Kb=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i;function qb(e){return e.test.bind(e)}Jb.bind(void 0,!1),qb(Rb),qb(zb),qb(Bb),qb(Lb),qb(Gb),qb(Kb),qb(Vb),qb(Hb),qb(Ub),qb(Wb);function Jb(e,t){let n=t.match(Ib);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],o=!!n[5];return(r<=23&&i<=59&&a<=59||r==23&&i==59&&a==60)&&(!e||o)}globalThis.crypto;var Yb=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.OAuthClientFlowError`})}static[Symbol.hasInstance](e){return uv(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return uv(this,e)}constructor(e){super(e),this.name=new.target.name,lv(this,new.target)}};(class extends Yb{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.IssuerMismatchError`})}kind;expected;received;constructor(e,t,n){super(`Issuer mismatch in ${e===`metadata`?`authorization server metadata (RFC 8414 §3.3)`:`authorization response (RFC 9207)`}: expected ${JSON.stringify(t)}, received ${JSON.stringify(n)}`),this.kind=e,this.expected=t,this.received=n}}),class extends Yb{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.RegistrationRejectedError`})}status;body;submittedMetadata;constructor(e){super(`Dynamic Client Registration rejected (HTTP ${e.status}): ${e.body}`),this.status=e.status,this.body=e.body,this.submittedMetadata=e.submittedMetadata}},class extends Yb{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.InsecureTokenEndpointError`})}tokenEndpoint;constructor(e){super(`Refusing to send credentials to non-https token endpoint '${e}'. OAuth token requests MUST use TLS (localhost / 127.0.0.1 / ::1 are exempt).`),this.tokenEndpoint=e}},class extends Yb{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.AuthorizationServerMismatchError`})}constructor(e,t){super(`Authorization server changed between redirect and callback (redirected to ${JSON.stringify(e)}, callback resolved ${JSON.stringify(t)}); refusing to send authorization_code/code_verifier to a different token endpoint`),this.recordedIssuer=e,this.currentIssuer=t}},class extends Yb{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.InsufficientScopeError`})}requiredScope;resourceMetadataUrl;errorDescription;constructor(e){super(`Insufficient scope${e.requiredScope?`: required "${e.requiredScope}"`:``}`),this.requiredScope=e.requiredScope,this.resourceMetadataUrl=e.resourceMetadataUrl,this.errorDescription=e.errorDescription}},class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UnauthorizedError`})}static[Symbol.hasInstance](e){return uv(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return uv(this,e)}constructor(e){super(e??`Unauthorized`),this.name=`UnauthorizedError`,lv(this,new.target)}},class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SseError`})}static[Symbol.hasInstance](e){return uv(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return uv(this,e)}constructor(e,t,n){super(`SSE error: ${t}`),this.code=e,this.event=n,lv(this,new.target)}};var Xb=class{_eventSlots=new Map;setHandler(e,t){let n=this._ensureEventSlot(e);n.onHandler&&t&&console.warn(`[MCP Apps] on${String(e)} handler replaced. Use addEventListener("${String(e)}", …) to add multiple listeners without replacing.`),n.onHandler=t}getHandler(e){return this._eventSlots.get(e)?.onHandler}addEventListener(e,t){this._ensureEventSlot(e).listeners.push(t)}removeEventListener(e,t){let n=this._eventSlots.get(e);if(!n)return;let r=n.listeners.indexOf(t);r!==-1&&n.listeners.splice(r,1)}dispatch(e,t){let n=this._eventSlots.get(e);if(n){n.onHandler?.(t);for(let e of[...n.listeners])e(t)}}_ensureEventSlot(e){let t=this._eventSlots.get(e);return t||(t={listeners:[]},this._eventSlots.set(e,t)),t}},Zb=class{_methods=new Set;claim(e,t){if(this._methods.has(e))throw Error(`Handler for "${e}" already registered (via ${t}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._methods.add(e)}replace(e){this._methods.add(e)}release(e){this._methods.delete(e)}has(e){return this._methods.has(e)}},Qb=new Set;function $b(e,t){let[n,r]=t,i=n?.shape;if(typeof i?.method?.value!=`string`)return;let a=i.method.value,o=e===`request`?`setRequestHandler`:`setNotificationHandler`;Qb.has(o)||(Qb.add(o),console.warn(`[ext-apps] ${o}(Schema, handler) is deprecated; use ${o}("${a}", { params: Schema.shape.params }, handler).`));let s=r;return[a,{params:i.params},e===`request`?(e,t)=>s({method:a,params:e},ex(t)):e=>s({method:a,params:e})]}function ex(e){return{signal:e.mcpReq.signal,requestId:e.mcpReq.id,sessionId:e.sessionId,_meta:e.mcpReq._meta,sendRequest:e.mcpReq.send,sendNotification:e.mcpReq.notify,authInfo:e.http?.authInfo}}var tx=`2026-01-26`,nx=class{eventTarget;eventSource;messageListener;constructor(e=window.parent,t){this.eventTarget=e,this.eventSource=t,this.messageListener=e=>{if(t&&e.source!==this.eventSource){console.debug(`Ignoring message from unknown source`,e);return}let n=ch.safeParse(e.data);n.success?(console.debug(`Parsed message`,n.data),this.onmessage?.(n.data)):e.data?.jsonrpc===`2.0`?(console.error(`Failed to parse message`,n.error.message,e),this.onerror?.(Error(`Invalid JSON-RPC message received: `+n.error.message))):console.debug(`Ignoring non-JSON-RPC message`,n.error.message,e)}}async start(){window.addEventListener(`message`,this.messageListener)}async send(e,t){e.method!==`ui/notifications/tool-input-partial`&&console.debug(`Sending message`,e),this.eventTarget.postMessage(e,`*`)}async close(){window.removeEventListener(`message`,this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion},rx=q([X(`light`),X(`dark`)]).describe(`Color theme preference for the host environment.`),ix=q([X(`inline`),X(`fullscreen`),X(`pip`)]).describe(`Display mode for UI presentation.`),ax=J(q([X(`--color-background-primary`),X(`--color-background-secondary`),X(`--color-background-tertiary`),X(`--color-background-inverse`),X(`--color-background-ghost`),X(`--color-background-info`),X(`--color-background-danger`),X(`--color-background-success`),X(`--color-background-warning`),X(`--color-background-disabled`),X(`--color-text-primary`),X(`--color-text-secondary`),X(`--color-text-tertiary`),X(`--color-text-inverse`),X(`--color-text-ghost`),X(`--color-text-info`),X(`--color-text-danger`),X(`--color-text-success`),X(`--color-text-warning`),X(`--color-text-disabled`),X(`--color-border-primary`),X(`--color-border-secondary`),X(`--color-border-tertiary`),X(`--color-border-inverse`),X(`--color-border-ghost`),X(`--color-border-info`),X(`--color-border-danger`),X(`--color-border-success`),X(`--color-border-warning`),X(`--color-border-disabled`),X(`--color-ring-primary`),X(`--color-ring-secondary`),X(`--color-ring-inverse`),X(`--color-ring-info`),X(`--color-ring-danger`),X(`--color-ring-success`),X(`--color-ring-warning`),X(`--font-sans`),X(`--font-mono`),X(`--font-weight-normal`),X(`--font-weight-medium`),X(`--font-weight-semibold`),X(`--font-weight-bold`),X(`--font-text-xs-size`),X(`--font-text-sm-size`),X(`--font-text-md-size`),X(`--font-text-lg-size`),X(`--font-heading-xs-size`),X(`--font-heading-sm-size`),X(`--font-heading-md-size`),X(`--font-heading-lg-size`),X(`--font-heading-xl-size`),X(`--font-heading-2xl-size`),X(`--font-heading-3xl-size`),X(`--font-text-xs-line-height`),X(`--font-text-sm-line-height`),X(`--font-text-md-line-height`),X(`--font-text-lg-line-height`),X(`--font-heading-xs-line-height`),X(`--font-heading-sm-line-height`),X(`--font-heading-md-line-height`),X(`--font-heading-lg-line-height`),X(`--font-heading-xl-line-height`),X(`--font-heading-2xl-line-height`),X(`--font-heading-3xl-line-height`),X(`--border-radius-xs`),X(`--border-radius-sm`),X(`--border-radius-md`),X(`--border-radius-lg`),X(`--border-radius-xl`),X(`--border-radius-full`),X(`--border-width-regular`),X(`--shadow-hairline`),X(`--shadow-sm`),X(`--shadow-md`),X(`--shadow-lg`)]).describe(`CSS variable keys available to MCP apps for theming.`).describe(`Style variables for theming MCP apps.
|
|
71
79
|
|
|
72
80
|
Individual style keys are optional - hosts may provide any subset of these values.
|
|
73
81
|
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
|
|
74
82
|
|
|
75
83
|
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
|
|
76
|
-
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),
|
|
84
|
+
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),q([B(),zp()]).describe(`Style variables for theming MCP apps.
|
|
77
85
|
|
|
78
86
|
Individual style keys are optional - hosts may provide any subset of these values.
|
|
79
87
|
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
|
|
@@ -85,18 +93,18 @@ Individual style keys are optional - hosts may provide any subset of these value
|
|
|
85
93
|
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
|
|
86
94
|
|
|
87
95
|
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
|
|
88
|
-
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`);
|
|
96
|
+
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`);G({method:X(`ui/open-link`),params:G({url:B().describe(`URL to open in the host's browser`)})});var ox=G({isError:H().optional().describe(`True if the host failed to open the URL (e.g., due to security policy).`)}).passthrough(),sx=G({isError:H().optional().describe(`True if the download failed (e.g., user cancelled or host denied).`)}).passthrough(),cx=G({isError:H().optional().describe(`True if the host rejected or failed to deliver the message.`)}).passthrough();G({method:X(`ui/notifications/sandbox-proxy-ready`),params:G({})});var lx=G({connectDomains:W(B()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
|
|
89
97
|
|
|
90
98
|
- Maps to CSP \`connect-src\` directive
|
|
91
|
-
- Empty or omitted → no network connections (secure default)`),resourceDomains:
|
|
99
|
+
- Empty or omitted → no network connections (secure default)`),resourceDomains:W(B()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)"),frameDomains:W(B()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:W(B()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)")}),ux=G({camera:G({}).optional().describe(`Request camera access.
|
|
92
100
|
|
|
93
|
-
Maps to Permission Policy \`camera\` feature.`),microphone:
|
|
101
|
+
Maps to Permission Policy \`camera\` feature.`),microphone:G({}).optional().describe(`Request microphone access.
|
|
94
102
|
|
|
95
|
-
Maps to Permission Policy \`microphone\` feature.`),geolocation:
|
|
103
|
+
Maps to Permission Policy \`microphone\` feature.`),geolocation:G({}).optional().describe(`Request geolocation access.
|
|
96
104
|
|
|
97
|
-
Maps to Permission Policy \`geolocation\` feature.`),clipboardWrite:
|
|
105
|
+
Maps to Permission Policy \`geolocation\` feature.`),clipboardWrite:G({}).optional().describe(`Request clipboard write access.
|
|
98
106
|
|
|
99
|
-
Maps to Permission Policy \`clipboard-write\` feature.`)});
|
|
107
|
+
Maps to Permission Policy \`clipboard-write\` feature.`)});G({method:X(`ui/notifications/size-changed`),params:G({width:V().optional().describe(`New width in pixels.`),height:V().optional().describe(`New height in pixels.`)})});var dx=G({method:X(`ui/notifications/tool-input`),params:G({arguments:J(B(),U().describe(`Complete tool call arguments as key-value pairs.`)).optional().describe(`Complete tool call arguments as key-value pairs.`)})}),fx=G({method:X(`ui/notifications/tool-input-partial`),params:G({arguments:J(B(),U().describe(`Partial tool call arguments (incomplete, may change).`)).optional().describe(`Partial tool call arguments (incomplete, may change).`)})}),px=G({method:X(`ui/notifications/tool-cancelled`),params:G({reason:B().optional().describe(`Optional reason for the cancellation (e.g., "user action", "timeout").`)})}),mx=G({fonts:B().optional()}),hx=G({variables:ax.optional().describe(`CSS variables for theming the app.`),css:mx.optional().describe(`CSS blocks that apps can inject.`)}),gx=G({method:X(`ui/resource-teardown`),params:G({})}),_x=J(B(),U()),vx=G({text:G({}).optional().describe(`Host supports text content blocks.`),image:G({}).optional().describe(`Host supports image content blocks.`),audio:G({}).optional().describe(`Host supports audio content blocks.`),resource:G({}).optional().describe(`Host supports resource content blocks.`),resourceLink:G({}).optional().describe(`Host supports resource link content blocks.`),structuredContent:G({}).optional().describe(`Host supports structured content.`)});G({method:X(`ui/notifications/request-teardown`),params:G({}).optional()});var yx=G({experimental:J(B(),J(B(),Up()).describe(`Experimental features keyed by identifier.`)).optional().describe(`Experimental features keyed by identifier.`),openLinks:G({}).optional().describe(`Host supports opening external URLs.`),downloadFile:G({}).optional().describe(`Host supports file downloads via ui/download-file.`),serverTools:G({listChanged:H().optional().describe(`Host supports tools/list_changed notifications.`)}).optional().describe(`Host can proxy tool calls to the MCP server.`),serverResources:G({listChanged:H().optional().describe(`Host supports resources/list_changed notifications.`)}).optional().describe(`Host can proxy resource reads to the MCP server.`),logging:G({}).optional().describe(`Host accepts log messages.`),sandbox:G({permissions:ux.optional().describe(`Permissions granted by the host (camera, microphone, geolocation).`),csp:lx.optional().describe(`CSP domains approved by the host.`)}).optional().describe(`Sandbox configuration applied by the host.`),updateModelContext:vx.optional().describe(`Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns.`),message:vx.optional().describe(`Host supports receiving content messages (ui/message) from the view.`),sampling:G({tools:G({}).optional().describe("Host supports tool use via `tools` and `toolChoice` parameters.")}).optional().describe("Host supports LLM sampling (sampling/createMessage) from the view.\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.")}),bx=G({experimental:J(B(),J(B(),Up()).describe(`Experimental features keyed by identifier.`)).optional().describe(`Experimental features keyed by identifier.`),tools:G({listChanged:H().optional().describe(`App supports tools/list_changed notifications.`)}).optional().describe(`App exposes MCP-style tools that the host can call.`),availableDisplayModes:W(ix).optional().describe(`Display modes the app supports.`)});G({method:X(`ui/notifications/initialized`),params:G({}).optional()}),G({csp:lx.optional().describe(`Content Security Policy configuration for UI resources.`),permissions:ux.optional().describe(`Sandbox permissions requested by the UI resource.`),domain:B().optional().describe(`Dedicated origin for view sandbox.
|
|
100
108
|
|
|
101
109
|
Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.
|
|
102
110
|
|
|
@@ -104,16 +112,16 @@ Useful when views need stable, dedicated origins for OAuth callbacks, CORS polic
|
|
|
104
112
|
- Hash-based subdomains (e.g., \`{hash}.claudemcpcontent.com\`)
|
|
105
113
|
- URL-derived subdomains (e.g., \`www-example-com.oaiusercontent.com\`)
|
|
106
114
|
|
|
107
|
-
If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:
|
|
115
|
+
If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:H().optional().describe(`Visual boundary preference - true if view prefers a visible border.
|
|
108
116
|
|
|
109
117
|
Boolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary.
|
|
110
118
|
|
|
111
119
|
- \`true\`: request visible border + background
|
|
112
120
|
- \`false\`: request no visible border + background
|
|
113
|
-
- omitted: host decides border`)}),
|
|
121
|
+
- omitted: host decides border`)}),G({method:X(`ui/request-display-mode`),params:G({mode:ix.describe(`The display mode being requested.`)})});var xx=G({mode:ix.describe(`The display mode that was actually set. May differ from requested if not supported.`)}).passthrough(),Sx=q([X(`model`),X(`app`)]).describe(`Tool visibility scope - who can access the tool.`);G({resourceUri:B().optional(),visibility:W(Sx).optional().describe(`Who can access this tool. Default: ["model", "app"]
|
|
114
122
|
- "model": Tool visible to and callable by the agent
|
|
115
|
-
- "app": Tool callable by the app from this server only`),csp:
|
|
116
|
-
container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:G().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:G().optional().describe(`User's timezone in IANA format.`),userAgent:G().optional().describe(`Host application identifier.`),platform:Y([X(`web`),X(`desktop`),X(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:J({touch:Vx().optional().describe(`Whether the device supports touch input.`),hover:Vx().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:J({top:K().describe(`Top safe area inset in pixels.`),right:K().describe(`Right safe area inset in pixels.`),bottom:K().describe(`Bottom safe area inset in pixels.`),left:K().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough(),hO=J({method:X(`ui/notifications/host-context-changed`),params:mO.describe(`Partial context update containing only changed fields.`)});J({method:X(`ui/update-model-context`),params:J({content:q(zE).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:oS(G(),Yx().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),J({method:X(`ui/initialize`),params:J({appInfo:kT.describe(`App identification (name and version).`),appCapabilities:uO.describe(`Features and capabilities this app provides.`),protocolVersion:G().describe(`Protocol version this app supports.`)})});var gO=J({protocolVersion:G().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:kT.describe(`Host application identification and version.`),hostCapabilities:lO.describe(`Features and capabilities provided by the host.`),hostContext:mO.describe(`Rich context about the host environment.`)}).passthrough(),_O={target:`draft-2020-12`};async function vO(e,t){let n=e[`~standard`];if(n.jsonSchema)return n.jsonSchema[t](_O);if(n.vendor===`zod`){let{z:n}=await WD(async()=>{let{z:e}=await Promise.resolve().then(()=>(Qw(),Zw));return{z:e}},void 0,import.meta.url);return n.toJSONSchema(e,{io:t})}throw Error(`Schema (vendor: ${n.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function yO(e,t,n=``){let r=await e[`~standard`].validate(t);if(r.issues){let e=r.issues.map(e=>{let t=e.path?.map(e=>typeof e==`object`?e.key:e).join(`.`);return t?`${t}: ${e.message}`:e.message}).join(`; `);throw Error(n+e)}return r.value}var bO=class e extends GD{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_assertInitialized(e){if(this._initializedSent)return;let t=`[ext-apps] App.${e}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(t);console.warn(`${t}. This will throw in a future release.`)}eventSchemas={toolinput:nO,toolinputpartial:rO,toolresult:pO,toolcancelled:iO,hostcontextchanged:hO};static ONE_SHOT_EVENTS=new Set([`toolinput`,`toolinputpartial`,`toolresult`,`toolcancelled`]);_everHadListener=new Set;_assertHandlerTiming(t){if(!e.ONE_SHOT_EVENTS.has(t)||this._everHadListener.has(t)||(this._everHadListener.add(t),!this._initializedSent))return;let n=`[ext-apps] "${String(t)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(n);console.warn(n)}setEventHandler(e,t){t&&this._assertHandlerTiming(e),super.setEventHandler(e,t)}addEventListener(e,t){this._assertHandlerTiming(e),super.addEventListener(e,t)}onEventDispatch(e,t){e===`hostcontextchanged`&&(this._hostContext={...this._hostContext,...t})}constructor(e,t={},n={autoResize:!0}){super(n),this._appInfo=e,this._capabilities=t,this.options=n,n.allowUnsafeEval||Lo({jitless:!0}),this.setRequestHandler(zT,e=>(console.log(`Received ping:`,e.params),{})),this.setEventHandler(`hostcontextchanged`,void 0)}registerCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after transport is established`);this._capabilities=BD(this._capabilities,e)}registerTool(e,t,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let r=this,i=()=>{r._initializedSent&&r._capabilities.tools?.listChanged&&r.sendToolListChanged()},a=t.inputSchema!==void 0,o={title:t.title,description:t.description,inputSchema:t.inputSchema,outputSchema:t.outputSchema,annotations:t.annotations,_meta:t._meta,enabled:!0,enable(){this.enabled=!0,i()},disable(){this.enabled=!1,i()},update(e){Object.assign(this,e),i()},remove(){r._registeredTools[e]===o&&(delete r._registeredTools[e],i())},handler:async(t,r)=>{if(!o.enabled)throw Error(`Tool ${e} is disabled`);let i;if(a){let a=o.inputSchema;i=await n(a?await yO(a,t??{},`Invalid input for tool ${e}: `):t??{},r)}else i=await n(r);return o.outputSchema&&!i.isError&&(i.structuredContent=await yO(o.outputSchema,i.structuredContent,`Invalid output for tool ${e}: `)),i}};return this._registeredTools[e]=o,!this._capabilities.tools&&!this.transport&&this.registerCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),i(),o}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(e,t)=>{let n=this._registeredTools[e.name];if(!n)throw Error(`Tool ${e.name} not found`);return n.handler(e.arguments,t)},this.onlisttools=async(e,t)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([e,t])=>t.enabled).map(async([e,t])=>{let n={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?await vO(t.inputSchema,`input`):{type:`object`,properties:{}}};return t.outputSchema&&(n.outputSchema=await vO(t.outputSchema,`output`)),t.annotations&&(n.annotations=t.annotations),t._meta&&(n._meta=t._meta),n}))}))}async sendToolListChanged(e={}){this._assertInitialized(`sendToolListChanged`),await this.notification({method:`notifications/tools/list_changed`,params:e})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler(`toolinput`)}set ontoolinput(e){this.setEventHandler(`toolinput`,e)}get ontoolinputpartial(){return this.getEventHandler(`toolinputpartial`)}set ontoolinputpartial(e){this.setEventHandler(`toolinputpartial`,e)}get ontoolresult(){return this.getEventHandler(`toolresult`)}set ontoolresult(e){this.setEventHandler(`toolresult`,e)}get ontoolcancelled(){return this.getEventHandler(`toolcancelled`)}set ontoolcancelled(e){this.setEventHandler(`toolcancelled`,e)}get onhostcontextchanged(){return this.getEventHandler(`hostcontextchanged`)}set onhostcontextchanged(e){this.setEventHandler(`hostcontextchanged`,e)}_onteardown;get onteardown(){return this._onteardown}set onteardown(e){this.warnIfRequestHandlerReplaced(`onteardown`,this._onteardown,e),this._onteardown=e,this.replaceRequestHandler(sO,(e,t)=>{if(!this._onteardown)throw Error(`No onteardown handler set`);return this._onteardown(e.params,t)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(`oncalltool`,this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(XE,(e,t)=>{if(!this._oncalltool)throw Error(`No oncalltool handler set`);return this._oncalltool(e.params,t)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(e){this.warnIfRequestHandlerReplaced(`onlisttools`,this._onlisttools,e),this._onlisttools=e,this.replaceRequestHandler(KE,(e,t)=>{if(!this._onlisttools)throw Error(`No onlisttools handler set`);return this._onlisttools(e.params,t)})}assertCapabilityForMethod(e){if(e===`sampling/createMessage`&&!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${e})`)}assertRequestHandlerCapability(e){switch(e){case`tools/call`:case`tools/list`:if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${e})`);return;case`ping`:case`ui/resource-teardown`:return;default:throw Error(`No handler for method ${e} registered`)}}assertNotificationCapability(e){}assertTaskCapability(e){throw Error(`Tasks are not supported in MCP Apps`)}assertTaskHandlerCapability(e){throw Error(`Task handlers are not supported in MCP Apps`)}async callServerTool(e,t){if(this._assertInitialized(`callServerTool`),typeof e==`string`)throw Error(`callServerTool() expects an object as its first argument, but received a string ("${e}"). Did you mean: callServerTool({ name: "${e}", arguments: { ... } })?`);return await this.request({method:`tools/call`,params:e},JE,{onprogress:()=>{},resetTimeoutOnProgress:!0,...t})}async readServerResource(e,t){return this._assertInitialized(`readServerResource`),await this.request({method:`resources/read`,params:e},yE,t)}async listServerResources(e,t){return this._assertInitialized(`listServerResources`),await this.request({method:`resources/list`,params:e},pE,t)}async createSamplingMessage(e,t){this._assertInitialized(`createSamplingMessage`);let n=e.tools?fD:dD;return await this.request({method:`sampling/createMessage`,params:e},n,t)}sendMessage(e,t){return this._assertInitialized(`sendMessage`),this.request({method:`ui/message`,params:e},$D,t)}sendLog(e){return this.notification({method:`notifications/message`,params:e})}updateModelContext(e,t){return this._assertInitialized(`updateModelContext`),this.request({method:`ui/update-model-context`,params:e},wT,t)}openLink(e,t){return this._assertInitialized(`openLink`),this.request({method:`ui/open-link`,params:e},ZD,t)}sendOpenLink=this.openLink;downloadFile(e,t){return this._assertInitialized(`downloadFile`),this.request({method:`ui/download-file`,params:e},QD,t)}requestTeardown(e={}){return this.notification({method:`ui/notifications/request-teardown`,params:e})}requestDisplayMode(e,t){return this._assertInitialized(`requestDisplayMode`),this.request({method:`ui/request-display-mode`,params:e},dO,t)}sendSizeChanged(e){return this.notification({method:`ui/notifications/size-changed`,params:e})}setupSizeChangedNotifications(){let e=!1,t=0,n=0,r=()=>{e||(e=!0,requestAnimationFrame(()=>{e=!1;let r=document.documentElement,i=r.style.height;r.style.height=`max-content`;let a=Math.ceil(r.getBoundingClientRect().height);r.style.height=i;let o=Math.ceil(window.innerWidth);(o!==t||a!==n)&&(t=o,n=a,this.sendSizeChanged({width:o,height:a}))}))};r();let i=new ResizeObserver(r);return i.observe(document.documentElement),i.observe(document.body),()=>i.disconnect()}async connect(e=new qD(window.parent,window.parent),t){if(this.transport)throw Error(`App is already connected. Call close() before connecting again.`);this._initializedSent=!1,await super.connect(e);try{let e=await this.request({method:`ui/initialize`,params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:KD}},gO,t);if(e===void 0)throw Error(`Server sent invalid initialize result: ${e}`);this._hostCapabilities=e.hostCapabilities,this._hostInfo=e.hostInfo,this._hostContext=e.hostContext,await this.notification({method:`ui/notifications/initialized`}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(e){throw this.close(),e}}},xO=n((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})),$=n(((e,t)=>{t.exports=xO()}))();function SO({className:e=``}){return(0,$.jsxs)(`svg`,{viewBox:`0 0 2500 2500`,className:e,"aria-hidden":`true`,fillRule:`evenodd`,clipRule:`evenodd`,children:[(0,$.jsx)(`path`,{d:`m2499.6 1250c0 690.2-559.6 1249.8-1250.1 1249.9-690 0-1249.6-559.7-1249.5-1250-.2-690.3 559.4-1249.9 1249.7-1249.9s1249.9 559.7 1249.9 1250z`,fill:`#eab300`}),(0,$.jsxs)(`g`,{fill:`#fff`,children:[(0,$.jsx)(`path`,{d:`m1741.5 943.8c-16.1-167.4-160.6-223.5-343.2-239.5v-232.3h-141.3v226.1c-37.1 0-75.1.7-112.8 1.5v-227.6h-141.3l-.1 232.1c-30.6.6-60.7 1.2-90 1.2v-.7l-194.9-.1v151s104.4-2 102.6-.1c57.3 0 75.9 33.2 81.3 61.9v264.6c4 0 9.1.2 14.9 1h-14.9l-.1 370.7c-2.5 18-13.1 46.7-53.1 46.8 1.8 1.6-102.7 0-102.7 0l-28.1 168.8h184c34.2 0 67.9.6 100.9.8l.1 234.9h141.2v-232.4c38.7.8 76.2 1.1 112.9 1.1l-.1 231.3h141.3v-234.4c237.6-13.6 404.1-73.5 424.7-296.7 16.7-179.7-67.8-260-202.7-292.4 82.1-41.6 133.4-115.1 121.4-237.6zm-197.8 502.2c0 175.5-300.5 155.6-396.4 155.6v-311.3c95.9.2 396.4-27.3 396.4 155.7zm-65.8-439.1c0 159.7-250.8 141-330.6 141.1v-282.2c79.9 0 330.7-25.4 330.6 141.1z`}),(0,$.jsx)(`path`,{d:`m902 1175.7h21v15.5h-21z`})]})]})}function CO({children:e,active:t,onNavigate:n,navigation:r=!0}){return(0,$.jsxs)(`div`,{className:r?`local-shell`:`local-shell setup-shell`,children:[(0,$.jsxs)(`header`,{className:`local-header`,children:[(0,$.jsxs)(`div`,{className:`brand-mark`,children:[(0,$.jsx)(SO,{className:`brand-symbol`}),(0,$.jsx)(`span`,{children:`BSV MCP`})]}),r&&n?(0,$.jsx)(`nav`,{className:`local-nav`,"aria-label":`Local app sections`,children:[`explorer`,`wallet`,`ordinals`,`sweep`].map(e=>(0,$.jsx)(`button`,{type:`button`,className:t===e?`nav-tab active`:`nav-tab`,"aria-current":t===e?`page`:void 0,onClick:()=>n(e),children:e},e))}):null]}),(0,$.jsx)(`main`,{className:`local-content`,children:e}),(0,$.jsxs)(`footer`,{className:`local-footer`,children:[(0,$.jsx)(`span`,{children:`LOCAL PROCESS`}),(0,$.jsx)(`span`,{className:`status-dot`,"aria-hidden":`true`}),(0,$.jsx)(`span`,{children:`PRIVATE BY DEFAULT`})]})]})}function wO({eyebrow:e,title:t,description:n}){return(0,$.jsxs)(`header`,{className:`page-header`,children:[(0,$.jsxs)(`p`,{className:`eyebrow`,children:[(0,$.jsx)(`span`,{children:`#`}),` `,e]}),(0,$.jsx)(`h1`,{children:t}),n?(0,$.jsx)(`p`,{className:`page-description`,children:n}):null]})}function TO({children:e,className:t=``}){return(0,$.jsx)(`section`,{className:`surface ${t}`,children:e})}function EO({children:e,tone:t=`info`}){return(0,$.jsx)(`div`,{className:`notice notice-${t}`,role:t===`error`||t===`warning`?`alert`:`status`,children:e})}function DO({children:e,type:t=`button`,variant:n=`primary`,disabled:r,onClick:i,"aria-busy":a}){return(0,$.jsx)(`button`,{type:t,className:`button button-${n}`,disabled:r,onClick:i,"aria-busy":a,children:e})}function OO({label:e=`Loading`}){return(0,$.jsxs)(`div`,{className:`spinner-row`,role:`status`,children:[(0,$.jsx)(`span`,{className:`spinner`,"aria-hidden":`true`}),e]})}function kO({label:e,value:t}){return(0,$.jsxs)(`div`,{className:`data-row`,children:[(0,$.jsx)(`span`,{className:`data-label`,children:e}),(0,$.jsx)(`span`,{className:`data-value`,children:t})]})}function AO(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function jO(e){return Array.isArray(e)?e.filter(e=>!!(e&&typeof e==`object`)):[]}function MO(e,t=8){return e.length<=t*2+3?e:`${e.slice(0,t)}…${e.slice(-t)}`}function NO(e){return Number(e??0).toLocaleString()}function PO(){let e=(0,W.useRef)(null),[t,n]=(0,W.useState)(!1),[r,i]=(0,W.useState)();return(0,W.useEffect)(()=>{let t=new bO({name:`BSV MCP`,version:`1.0.0`});return e.current=t,t.ontoolresult=()=>n(!0),t.connect().then(()=>n(!0)).catch(e=>i(String(e))),()=>{e.current=null}},[]),{call:(0,W.useCallback)(async(t,n={})=>{let r=e.current;if(!r)throw Error(`The local app is not connected to its MCP host.`);let i=(await r.callServerTool({name:t,arguments:n}))?.structuredContent;if(!i)throw Error(`The MCP host returned no structured data.`);return AO(i)},[]),ready:t,error:r}}function FO(){let{call:e,ready:t,error:n}=PO(),[r,i]=(0,W.useState)(`explorer`);return n?(0,$.jsx)(CO,{navigation:!1,children:(0,$.jsxs)(EO,{tone:`error`,children:[`Could not connect to the MCP host: `,n]})}):t?(0,$.jsxs)(CO,{active:r,onNavigate:i,children:[r===`explorer`?(0,$.jsx)(IO,{call:e}):null,r===`wallet`?(0,$.jsx)(BO,{call:e}):null,r===`ordinals`?(0,$.jsx)(VO,{call:e}):null,r===`sweep`?(0,$.jsx)(UO,{call:e}):null]}):(0,$.jsx)(CO,{navigation:!1,children:(0,$.jsx)(`div`,{className:`center-state`,children:(0,$.jsx)(OO,{label:`Connecting to MCP host`})})})}function IO({call:e}){let[t,n]=(0,W.useState)(),[r,i]=(0,W.useState)(),[a,o]=(0,W.useState)(``);(0,W.useEffect)(()=>{e(`app_explorer_data`).then(n).catch(e=>i(String(e)))},[e]);async function s(){let t=a.trim();if(t){i(void 0);try{let r=/^[0-9a-f]{64}$/i.test(t)?{txid:t}:t.startsWith(`1`)?{address:t}:{query:t};n(await e(`app_explorer_data`,r))}catch(e){i(String(e))}}}let c=AO(t?.chainInfo),l=jO(t?.recentBlocks);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(wO,{eyebrow:`explorer`,title:`Read the chain`,description:`Inspect live network data without leaving your local MCP session.`}),r?(0,$.jsx)(EO,{tone:`error`,children:r}):null,!t&&!r?(0,$.jsx)(TO,{children:(0,$.jsx)(`div`,{className:`surface-body`,children:(0,$.jsx)(OO,{label:`Loading explorer data`})})}):null,t?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`grid grid-stats`,children:[(0,$.jsx)(LO,{label:`Block height`,value:Number(c.blocks??0)?Number(c.blocks).toLocaleString():`—`}),(0,$.jsx)(LO,{label:`BSV price`,value:typeof t.price==`number`?`$${t.price.toFixed(2)}`:`—`}),(0,$.jsx)(LO,{label:`Difficulty`,value:RO(c.difficulty)}),(0,$.jsx)(LO,{label:`Best block`,value:c.bestblockhash?MO(String(c.bestblockhash),6):`—`})]}),(0,$.jsxs)(TO,{className:`stack-surface`,children:[(0,$.jsx)(`div`,{className:`surface-header`,children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`section-label`,children:`lookup`}),(0,$.jsx)(`h2`,{children:`Search BSV`})]})}),(0,$.jsxs)(`div`,{className:`surface-body`,children:[(0,$.jsxs)(`div`,{className:`search-row`,children:[(0,$.jsx)(`input`,{className:`field`,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{e.key===`Enter`&&s()},placeholder:`Transaction ID or address`,"aria-label":`Transaction ID or address`}),(0,$.jsx)(DO,{onClick:()=>void s(),children:`Search`})]}),(0,$.jsx)(zO,{data:t,query:a})]})]}),l.length?(0,$.jsxs)(TO,{className:`stack-surface`,children:[(0,$.jsx)(`div`,{className:`surface-header`,children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`section-label`,children:`network`}),(0,$.jsx)(`h2`,{children:`Recent blocks`})]})}),(0,$.jsxs)(`div`,{className:`table`,children:[(0,$.jsxs)(`div`,{className:`table-row table-head`,children:[(0,$.jsx)(`span`,{children:`Height`}),(0,$.jsx)(`span`,{children:`Hash`}),(0,$.jsx)(`span`,{children:`Txs`}),(0,$.jsx)(`span`,{children:`Size`}),(0,$.jsx)(`span`,{children:`Time`})]}),l.map((e,t)=>(0,$.jsxs)(`div`,{className:`table-row`,children:[(0,$.jsx)(`span`,{className:`mono`,children:Number(e.height??0).toLocaleString()}),(0,$.jsx)(`span`,{className:`mono dim`,children:MO(String(e.hash??`—`),10)}),(0,$.jsx)(`span`,{className:`dim`,children:jO(e.tx).length||`—`}),(0,$.jsx)(`span`,{className:`dim`,children:e.size?`${(Number(e.size)/1024).toFixed(1)} KB`:`—`}),(0,$.jsx)(`span`,{className:`dim`,children:e.time?new Date(Number(e.time)*1e3).toLocaleTimeString():`—`})]},String(e.hash??t)))]})]}):null]}):null]})}function LO({label:e,value:t}){return(0,$.jsxs)(`div`,{className:`stat-card`,children:[(0,$.jsx)(`div`,{className:`stat-label`,children:e}),(0,$.jsx)(`div`,{className:`stat-value`,children:t})]})}function RO(e){let t=Number(e??0);if(!t)return`—`;for(let[e,n]of[[`PH`,0x38d7ea4c68000],[`TH`,0xe8d4a51000],[`GH`,1e9],[`MH`,1e6]])if(t>=n)return`${(t/n).toFixed(1)} ${e}`;return t.toLocaleString()}function zO({data:e,query:t}){let n=AO(e.transaction),r=AO(e.addressInfo);if(!Object.keys(n).length&&!Object.keys(r).length&&t)return(0,$.jsx)(`div`,{className:`empty`,children:`No results found`});if(Object.keys(n).length)return(0,$.jsxs)(`div`,{className:`data-list`,children:[(0,$.jsx)(kO,{label:`TXID`,value:(0,$.jsx)(`span`,{className:`mono`,children:String(n.txid??t)})}),(0,$.jsx)(kO,{label:`Size`,value:`${n.size??`—`} bytes`}),(0,$.jsx)(kO,{label:`Fee`,value:n.fee==null?`—`:`${NO(n.fee)} sats`}),(0,$.jsx)(kO,{label:`Confirmations`,value:String(n.confirmations??`—`)}),(0,$.jsx)(kO,{label:`Outputs`,value:jO(n.outputs).length})]});if(Object.keys(r).length){let e=AO(r.balance);return(0,$.jsxs)(`div`,{className:`data-list`,children:[(0,$.jsx)(kO,{label:`Address`,value:(0,$.jsx)(`span`,{className:`mono`,children:t})}),(0,$.jsx)(kO,{label:`Confirmed`,value:`${NO(e.confirmed)} sats`}),(0,$.jsx)(kO,{label:`Unconfirmed`,value:`${NO(e.unconfirmed)} sats`}),(0,$.jsx)(kO,{label:`Transactions`,value:jO(r.history).length||`—`})]})}return(0,$.jsx)(`div`,{className:`empty`,children:`Enter a transaction ID or address to search.`})}function BO({call:e}){let[t,n]=(0,W.useState)(),[r,i]=(0,W.useState)();if((0,W.useEffect)(()=>{e(`app_wallet_data`).then(e=>{if(e.error)throw Error(String(e.error));n(e)}).catch(e=>i(String(e)))},[e]),r)return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(wO,{eyebrow:`wallet`,title:`Wallet`}),(0,$.jsx)(EO,{tone:`error`,children:r})]});if(!t)return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(wO,{eyebrow:`wallet`,title:`Wallet`}),(0,$.jsx)(TO,{children:(0,$.jsx)(`div`,{className:`surface-body`,children:(0,$.jsx)(OO,{label:`Loading wallet data`})})})]});let a=AO(t.balance),o=jO(t.utxos),s=Number(a.satoshis??0),c=String(a.bsv??(s/1e8).toFixed(8));return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(wO,{eyebrow:`wallet`,title:`Your local wallet`,description:`Balances and unspent outputs are read from the connected wallet service.`}),(0,$.jsxs)(`div`,{className:`grid grid-three`,children:[(0,$.jsx)(LO,{label:`Balance`,value:`${c} BSV`}),(0,$.jsx)(LO,{label:`Satoshis`,value:`${NO(s)} sats`}),(0,$.jsx)(LO,{label:`UTXOs`,value:String(a.utxoCount??o.length)})]}),t.address?(0,$.jsxs)(`div`,{className:`address-row`,children:[(0,$.jsx)(`code`,{children:String(t.address)}),(0,$.jsx)(`button`,{className:`copy-button`,type:`button`,onClick:()=>void navigator.clipboard?.writeText(String(t.address)),children:`copy`})]}):null,(0,$.jsxs)(TO,{className:`stack-surface`,children:[(0,$.jsx)(`div`,{className:`surface-header`,children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`section-label`,children:`outputs`}),(0,$.jsx)(`h2`,{children:`Unspent outputs`})]})}),o.length?(0,$.jsxs)(`div`,{className:`table`,children:[(0,$.jsxs)(`div`,{className:`table-row table-head`,children:[(0,$.jsx)(`span`,{children:`TXID`}),(0,$.jsx)(`span`,{children:`Index`}),(0,$.jsx)(`span`,{children:`Value`})]}),o.slice(0,25).map((e,t)=>(0,$.jsxs)(`div`,{className:`table-row`,children:[(0,$.jsx)(`span`,{className:`mono dim`,children:MO(String(e.txid??`—`),10)}),(0,$.jsx)(`span`,{className:`mono`,children:String(e.vout??e.outputIndex??`—`)}),(0,$.jsxs)(`span`,{className:`mono`,children:[NO(e.satoshis),` sats`]})]},`${String(e.txid??t)}-${String(e.vout??e.outputIndex??t)}`))]}):(0,$.jsx)(`div`,{className:`empty`,children:`No UTXOs found.`})]})]})}function VO({call:e}){let[t,n]=(0,W.useState)(),[r,i]=(0,W.useState)(),[a,o]=(0,W.useState)(``),s=(0,W.useCallback)(async t=>{i(void 0);try{let r=await e(`app_ordinals_data`,t?{query:t}:{});if(r.error)throw Error(String(r.error));n(r)}catch(e){i(String(e))}},[e]);(0,W.useEffect)(()=>{s()},[s]);let c=jO(t?.listings),l=String(t?.contentBaseUrl??``);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(wO,{eyebrow:`ordinals`,title:`Inscription collection`,description:`Browse the latest ordinal listings available to this wallet.`}),r?(0,$.jsx)(EO,{tone:`error`,children:r}):null,(0,$.jsx)(TO,{children:(0,$.jsxs)(`div`,{className:`surface-body`,children:[(0,$.jsxs)(`div`,{className:`search-row`,children:[(0,$.jsx)(`input`,{className:`field`,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{e.key===`Enter`&&s(a.trim()||void 0)},placeholder:`Search listings`,"aria-label":`Search listings`}),(0,$.jsx)(DO,{onClick:()=>void s(a.trim()||void 0),children:`Search`})]}),!t&&!r?(0,$.jsx)(OO,{label:`Loading listings`}):null]})}),t?(0,$.jsx)(`div`,{className:`grid grid-three stack-grid`,children:c.length?c.map((e,t)=>(0,$.jsx)(HO,{item:e,base:l},`${String(e.outpoint??t)}`)):(0,$.jsx)(`div`,{className:`empty`,children:`No listings found.`})}):null]})}function HO({item:e,base:t}){let n=AO(AO(e.data).ordlock),r=String(n.content_type??``),i=String(n.origin??e.outpoint??``),a=r.startsWith(`image/`)&&/^https?:\/\//.test(t);return(0,$.jsxs)(`article`,{className:`ordinal-card`,title:String(e.outpoint??``),children:[(0,$.jsx)(`div`,{className:`ordinal-image`,children:a?(0,$.jsx)(`img`,{src:`${t}/${encodeURIComponent(i)}`,alt:`Inscription preview`,loading:`lazy`}):(0,$.jsx)(`span`,{children:r?r.split(`/`)[1]:`?`})}),(0,$.jsxs)(`div`,{className:`ordinal-info`,children:[(0,$.jsx)(`div`,{className:`ordinal-name`,children:String(n.name??MO(String(e.outpoint??`inscription`),10))}),(0,$.jsxs)(`div`,{className:`ordinal-meta`,children:[(0,$.jsx)(`span`,{children:r?r.split(`/`)[0]:`unknown`}),n.price==null?null:(0,$.jsxs)(`span`,{children:[NO(n.price),` sats`]})]})]})]})}function UO({call:e}){let[t,n]=(0,W.useState)(``),r=(0,W.useRef)(``),[i,a]=(0,W.useState)(``),[o,s]=(0,W.useState)(),[c,l]=(0,W.useState)(new Set),[u,d]=(0,W.useState)([]),[f,p]=(0,W.useState)(`input`),[m,h]=(0,W.useState)(),g=(0,W.useMemo)(()=>{if(!o)return[];let e=[],t=jO(o.funding),n=jO(o.ordinals);t.length&&e.push({type:`bsv`,name:`BSV funding`,detail:`${t.length} UTXOs`,value:`${(Number(o.totalFundingSats??0)/1e8).toFixed(8)} BSV`,inputs:t}),n.length&&e.push({type:`ordinals`,name:`Ordinals`,detail:`${n.length} inscriptions`,value:`${n.length} NFTs`,inputs:n});for(let t of jO(o.bsv21Tokens)){let n=String(t.tokenId??``),r=jO(t.inputs);e.push({type:`bsv21:${n}`,name:`${String(t.symbol??MO(n,6))} token`,detail:`${r.length} UTXOs`,value:String(t.totalAmount??`0`),inputs:r})}return e},[o]);async function _(){h(void 0);let i=t.trim();try{let t=(/^[0-9a-f]{64}$/i.test(i)?new Mr(i,16):Mr.fromWif(i)).toPublicKey().toAddress();r.current=i,n(``),a(t),p(`scanning`);let o=await e(`app_sweep_scan`,{address:t});if(o.error)throw Error(String(o.error));s(o),l(new Set(WO(o))),p(`review`)}catch(e){r.current=``,n(``),h(e instanceof Error?e.message:String(e)),p(`error`)}}async function v(){if(!o||!c.size||!r.current)return;p(`working`),h(void 0);let t=[];try{for(let n of g.filter(e=>c.has(e.type))){let i=await e(`app_sweep_prepare`,{sweepType:n.type===`bsv`?`bsv`:n.type===`ordinals`?`ordinals`:`bsv21`,inputs:n.inputs.map(e=>({outpoint:e.outpoint,satoshis:e.satoshis,lockingScript:e.lockingScript}))});if(i.error)throw Error(String(i.error));let a=/^[0-9a-f]{64}$/i.test(r.current)?new Mr(r.current,16):Mr.fromWif(r.current),o=pa.fromBEEF(rn(String(i.txHex),`hex`)),s=new Set(jO(i.inputsToSign).map(e=>`${String(e.outpoint).replace(`_`,`.`)}`));for(let e of o.inputs)s.has(`${e.sourceTXID}.${e.sourceOutputIndex}`)&&(e.unlockingScriptTemplate=new ki().unlock(a,`all`,!0));await o.sign();let c={};o.inputs.forEach((e,t)=>{s.has(`${e.sourceTXID}.${e.sourceOutputIndex}`)&&(c[String(t)]={unlockingScript:e.unlockingScript?.toHex()??``})});let l=await e(`app_sweep_complete`,{reference:i.reference,spends:c});if(l.error)throw Error(String(l.error));t.push({type:n.name,txid:String(l.txid??``)})}r.current=``,d(t),p(`complete`)}catch(e){r.current=``,h(e instanceof Error?e.message:String(e)),p(`error`)}}function y(){r.current=``,n(``),a(``),s(void 0),l(new Set),d([]),h(void 0),p(`input`)}return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(wO,{eyebrow:`sweep`,title:`Import funds`,description:`Scan a key locally, choose the assets to move, and sign in this browser tab.`}),m?(0,$.jsx)(EO,{tone:`error`,children:m}):null,(0,$.jsxs)(TO,{children:[(0,$.jsx)(`div`,{className:`surface-header`,children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`section-label`,children:f===`review`?`review`:f===`complete`?`complete`:`private key`}),(0,$.jsx)(`h2`,{children:f===`review`?`Assets at ${MO(i,8)}`:f===`complete`?`Sweep complete`:`Sweep assets into your wallet`})]})}),(0,$.jsxs)(`div`,{className:`surface-body`,children:[f===`input`||f===`error`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`label`,{className:`field-label`,htmlFor:`sweep-key`,children:[`WIF or 64-character hex`,(0,$.jsx)(`input`,{id:`sweep-key`,className:`field`,type:`password`,value:t,onChange:e=>n(e.target.value),onKeyDown:e=>{e.key===`Enter`&&_()},autoComplete:`new-password`,spellCheck:!1})]}),(0,$.jsx)(`p`,{className:`dim`,children:`The key is used only in this tab and cleared after scanning or sweeping.`}),(0,$.jsx)(`div`,{className:`form-actions`,children:(0,$.jsx)(DO,{onClick:()=>void _(),disabled:!t.trim(),children:`Scan address`})})]}):null,f===`scanning`||f===`working`?(0,$.jsx)(OO,{label:f===`scanning`?`Scanning ${MO(i,8)}…`:`Signing and broadcasting selected assets…`}):null,f===`review`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`role-grid`,children:g.length?g.map(e=>(0,$.jsx)(`button`,{type:`button`,className:c.has(e.type)?`asset-card asset-selected`:`asset-card`,onClick:()=>l(t=>{let n=new Set(t);return n.has(e.type)?n.delete(e.type):n.add(e.type),n}),children:(0,$.jsxs)(`div`,{className:`asset-info`,children:[(0,$.jsxs)(`div`,{className:`asset-name`,children:[c.has(e.type)?`✓ `:``,e.name]}),(0,$.jsxs)(`div`,{className:`ordinal-meta`,children:[(0,$.jsx)(`span`,{children:e.detail}),(0,$.jsx)(`span`,{children:e.value})]})]})},e.type)):(0,$.jsx)(`div`,{className:`empty`,children:`No assets found at this address.`})}),(0,$.jsxs)(`div`,{className:`form-actions`,children:[(0,$.jsx)(DO,{variant:`secondary`,onClick:y,children:`Back`}),(0,$.jsx)(DO,{onClick:()=>void v(),disabled:!c.size,children:`Sweep selected`})]})]}):null,f===`complete`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`data-list`,children:u.map(e=>(0,$.jsx)(kO,{label:String(e.type),value:(0,$.jsx)(`span`,{className:`mono`,children:MO(String(e.txid),12)})},`${String(e.type)}:${String(e.txid)}`))}),(0,$.jsx)(`div`,{className:`form-actions`,children:(0,$.jsx)(DO,{onClick:y,children:`Sweep another key`})})]}):null]})]})]})}function WO(e){let t=[];jO(e.funding).length&&t.push(`bsv`),jO(e.ordinals).length&&t.push(`ordinals`);for(let n of jO(e.bsv21Tokens))t.push(`bsv21:${String(n.tokenId??``)}`);return t}var GO=u();function KO(e,t,n){let r=Math.abs(n)*Math.PI/180;return{width:e*Math.cos(r)+t*Math.sin(r)+12,height:t*Math.cos(r)+e*Math.sin(r)+12}}function qO(e,t){return Math.abs(e.x-t.x)*2<e.width+t.width&&Math.abs(e.y-t.y)*2<e.height+t.height}function JO(e,t,n,r,i){for(let a=0;a<2800;a++){let o=a*2.399963+i,s=Math.sqrt(a/2800)*.52,c={x:e*(.5+Math.cos(o)*s),y:t*(.5+Math.sin(o)*s),...n};if(!(c.x-n.width/2<8||c.x+n.width/2>e-8||c.y-n.height/2<8||c.y+n.height/2>t-8)&&!r.some(e=>qO(c,e)))return c}}function YO(e){if(e.title)return e.title;let t=e.name.replace(/^[^_]+_/,``).replace(/_/g,` `).replace(/([a-z])([A-Z])/g,`$1 $2`).toLowerCase();return(t.charAt(0).toUpperCase()+t.slice(1)).replace(/\b(bsv|bap|mnee|utxo|utxos)\b/gi,e=>e.toUpperCase())}function XO(e,t,n,r,i){let a=document.createElement(`canvas`).getContext(`2d`);if(!a)return;let o=YO(e).split(` `),s=o.length>1&&YO(e).length>10?[o.slice(0,Math.ceil(o.length/2)).join(` `),o.slice(Math.ceil(o.length/2)).join(` `)]:[YO(e)],c=Math.min(t/760,n/600,1.25),l=[0,-7,5,-3,8,0,-5,4][i%8];for(let o of[1,.85,.7]){let u=Math.max(15,[100,66,52,58,43,48,36,42,32,38,30,34][i%12]*c*o);a.font=`${u}px "Geist Pixel Line"`;let d=JO(t,n,KO(Math.max(...s.map(e=>a.measureText(e).width)),s.length*u*1.03,l),r,i*1.37);if(d)return{...d,tool:e,lines:s,size:u,angle:l}}}function ZO({tools:e}){let t=(0,W.useRef)(null),[n,r]=(0,W.useState)([]),[i,a]=(0,W.useState)(),[o,s]=(0,W.useState)(!1),c=(0,W.useRef)({width:0,height:0}),l=(0,W.useRef)(0);return(0,W.useLayoutEffect)(()=>{let n=t.current;if(!n)return;let i=()=>{let t=n.clientWidth,i=n.clientHeight;if(t===c.current.width&&i===c.current.height)return;c.current={width:t,height:i};let o=[],s=[...e??[]].sort((e,t)=>Number(/^send bsv$/i.test(YO(t)))-Number(/^send bsv$/i.test(YO(e))));for(let e of s){let n=XO(e,t,i,o,o.length);if(n&&o.push(n),o.length===12)break}r(o),a(void 0)};c.current={width:0,height:0};let o=!1,s=new ResizeObserver(i);return document.fonts.load(`30px "Geist Pixel Line"`).catch(()=>[]).then(()=>{o||(i(),s.observe(n))}),()=>{o=!0,s.disconnect()}},[e]),(0,W.useEffect)(()=>{if(o||!e?.length)return;let t,n=setInterval(()=>{document.hidden||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||(r(e=>{if(e.length<2)return e;let t=1+Math.floor(Math.random()*(e.length-1));return e.map((e,n)=>({...e,exiting:n===t||l.current%3==2&&n===t+1}))}),t=setTimeout(()=>{r(t=>{let n=t.filter(e=>e.exiting).map(e=>e.tool.name),r=t.filter(e=>!e.exiting),i=e.filter(e=>!r.some(t=>t.tool.name===e.name)&&!n.includes(e.name)).sort(()=>Math.random()-.5);for(let e of i){let t=XO(e,c.current.width,c.current.height,r,1+l.current++%11);if(t&&r.push(t),r.length>=12)break}return r})},650))},3200);return()=>{clearInterval(n),clearTimeout(t),r(e=>e.map(e=>({...e,exiting:!1})))}},[e,o]),(0,$.jsxs)(`section`,{className:`tool-cloud-section`,"aria-label":`Explore your wallet tools`,children:[(0,$.jsxs)(`svg`,{className:`cloud-orbits`,viewBox:`0 0 760 650`,fill:`none`,"aria-hidden":`true`,children:[(0,$.jsx)(`ellipse`,{cx:`380`,cy:`325`,rx:`365`,ry:`220`,transform:`rotate(-16 380 325)`}),(0,$.jsx)(`ellipse`,{cx:`380`,cy:`325`,rx:`365`,ry:`170`,transform:`rotate(22 380 325)`}),(0,$.jsx)(`circle`,{cx:`110`,cy:`160`,r:`4`}),(0,$.jsx)(`circle`,{cx:`660`,cy:`450`,r:`6`}),(0,$.jsx)(`circle`,{cx:`230`,cy:`570`,r:`3`})]}),(0,$.jsx)(`ul`,{ref:t,className:`tool-cloud`,"aria-label":`Available MCP tools`,onMouseEnter:()=>s(!0),onMouseLeave:e=>{e.currentTarget.contains(document.activeElement)||(s(!1),a(void 0))},onFocus:()=>s(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(s(!1),a(void 0))},onKeyDown:e=>{e.key===`Escape`&&a(void 0)},children:n.map(e=>(0,$.jsx)(`li`,{className:e.exiting?`is-fading`:``,style:{left:e.x,top:e.y},children:(0,$.jsx)(`button`,{type:`button`,className:`tool-cloud-word tool-cloud-weight-${Math.round(e.size)%5}`,style:{fontSize:e.size,transform:`rotate(${e.angle}deg)`},"aria-describedby":i?.tool.name===e.tool.name?`tool-cloud-popover`:void 0,onMouseEnter:t=>a({tool:e.tool,rect:t.currentTarget.getBoundingClientRect()}),onMouseLeave:()=>a(void 0),onFocus:t=>a({tool:e.tool,rect:t.currentTarget.getBoundingClientRect()}),onClick:t=>a({tool:e.tool,rect:t.currentTarget.getBoundingClientRect()}),children:e.lines.map(e=>(0,$.jsx)(`span`,{children:e},e))})},e.tool.name))}),i&&(0,GO.createPortal)((0,$.jsxs)(`div`,{id:`tool-cloud-popover`,role:`tooltip`,className:`tool-cloud-popover`,style:{left:Math.max(12,Math.min(window.innerWidth-292,i.rect.left+i.rect.width/2-140)),...i.rect.top>window.innerHeight/2?{bottom:window.innerHeight-i.rect.top+12}:{top:i.rect.bottom+12}},children:[(0,$.jsx)(`strong`,{children:YO(i.tool)}),(0,$.jsx)(`code`,{children:i.tool.name}),(0,$.jsx)(`p`,{children:i.tool.description||`Available in your MCP client.`})]}),document.body)]})}function QO({tools:e}){return(0,$.jsxs)(`div`,{className:`wallet-ready`,children:[(0,$.jsxs)(`div`,{className:`ready-copy`,children:[(0,$.jsx)(`span`,{className:`ready-check`,"aria-hidden":`true`,children:`✓`}),(0,$.jsx)(`p`,{className:`ready-eyebrow`,children:`Setup complete`}),(0,$.jsxs)(`h1`,{children:[`Your wallet.`,(0,$.jsx)(`br`,{}),`Ready for anything.`]}),(0,$.jsxs)(`p`,{className:`ready-description`,children:[`Your keys are encrypted in your local Vault.`,(0,$.jsx)(`br`,{}),`Return to your MCP client to get started.`]})]}),(0,$.jsx)(ZO,{tools:e})]})}function $O({token:e,onWelcome:t,onUnlock:n,standalone:r=!1}){let[i,a]=(0,W.useState)([]),[o,s]=(0,W.useState)(),[c,l]=(0,W.useState)(),[u,d]=(0,W.useState)(),[f,p]=(0,W.useState)(`imported-wallet`),[m,h]=(0,W.useState)(``),[g,_]=(0,W.useState)(``),[v,y]=(0,W.useState)(``),[b,x]=(0,W.useState)(!1),[S,C]=(0,W.useState)(!1),[w,ee]=(0,W.useState)(!1),[te,ne]=(0,W.useState)(``),[T,re]=(0,W.useState)(0),[ie,ae]=(0,W.useState)(``),[oe,se]=(0,W.useState)();(0,W.useEffect)(()=>{e&&fetch(`/api/inventory?revision=${T}`,{headers:{Authorization:`Bearer ${e}`}}).then(async e=>{if(!e.ok)throw Error(`Could not inspect your wallets. Reopen setup and try again.`);return e.json()}).then(e=>{let t=e.boundAccounts??[];a(t),s((e.sources??[]).filter(e=>e.location!==`account`||!t.some(t=>t.name===e.account)))}).catch(e=>ae(e.message))},[e,T]);function ce(){l(void 0),d(void 0),x(!1),h(``),_(``),y(``),ae(``)}async function le(t){if(t.preventDefault(),!S&&b&&(c||u)){if(g.length<8){ae(`Choose a Vault password with at least 8 characters.`);return}if(g!==v){ae(`The Vault passwords don’t match.`);return}if(u&&u.size>1048576){ae(`Choose a key backup smaller than 1 MB.`);return}C(!0),ae(``);try{let t=await fetch(`/api/embedded/import`,{method:`POST`,headers:{Authorization:`Bearer ${e}`,"Content-Type":`application/json`},body:JSON.stringify({source:c,accountName:f,activate:!1,sourcePassphrase:m,destinationPassphrase:g,passwordConfirmation:v,confirmation:`IMPORT_WALLET_CONFIRMED`,...u?{backupText:await u.text(),backupName:u.name}:{}})}),n=await t.json();if(!t.ok)throw Error(n.error||`The wallet could not be imported.`);if(n.saved===!0&&n.ready===!1){ce(),ne(n.accountName),re(e=>e+1);return}if(n.ready!==!0)throw Error(`The wallet was saved, but could not be activated. Reopen setup to unlock it.`);h(``),_(``),y(``),se(n.tools),ee(!0)}catch(e){ae(e instanceof Error?e.message:`The wallet could not be imported.`)}finally{C(!1)}}}return w&&!r?(0,$.jsx)(CO,{navigation:!1,children:(0,$.jsx)(QO,{tools:oe})}):(0,$.jsxs)(CO,{navigation:!1,children:[(0,$.jsx)(wO,{eyebrow:`Existing wallet`,title:w?r?`Your wallet is saved`:`Your wallet is ready`:`Bring your wallet with you`,description:w?r?`Your keys are protected in your local Vault.`:`Your keys are protected in your local Vault and your wallet is available in this session.`:`Choose a wallet found on this computer, or browse for a key backup.`}),ie&&(0,$.jsx)(EO,{tone:`error`,children:ie}),te&&(0,$.jsxs)(EO,{tone:`success`,children:[te,` is saved in your Vault. Import another wallet below, or choose your default keys to continue.`]}),w?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(EO,{tone:`success`,children:r?`Open wallet setup in your MCP client to unlock and use your saved wallet.`:`Return to your MCP client to use your wallet.`}),!r&&(0,$.jsx)(ZO,{tools:oe})]}):!c&&!u?(0,$.jsx)(TO,{children:(0,$.jsxs)(`div`,{className:`surface-body`,children:[(0,$.jsx)(`h2`,{children:`Choose your wallet`}),i.map(e=>(0,$.jsxs)(`button`,{className:`setup-choice wallet-source-choice`,type:`button`,onClick:()=>n(e.name),children:[(0,$.jsx)(`strong`,{children:e.name}),(0,$.jsx)(`span`,{children:`Saved in your Vault · choose default keys`})]},e.name)),o===void 0?(0,$.jsx)(`p`,{children:`Looking for local wallets…`}):o.length===0?(0,$.jsx)(`p`,{children:`No additional local wallets were found. You can choose a backup below.`}):o.map(e=>(0,$.jsxs)(`button`,{type:`button`,className:`setup-choice wallet-source-choice`,onClick:()=>{l(e),p(e.account),ae(``)},children:[(0,$.jsx)(`strong`,{children:e.account}),(0,$.jsx)(`span`,{children:e.directory||e.location}),(0,$.jsx)(`span`,{children:e.encryptedBackup?`Encrypted key backup`:e.plaintextKeys?`Local key file`:`Wallet database — matching key backup needed`}),e.walletDatabases.length>0&&(0,$.jsx)(`span`,{children:e.walletDatabases.join(`, `)})]},`${e.location}:${e.account}`)),(0,$.jsxs)(`label`,{className:`field-label`,children:[`Browse for a key backup`,(0,$.jsx)(`input`,{className:`field`,type:`file`,disabled:S,accept:`.bep,.json`,onChange:e=>{d(e.target.files?.[0]),l(void 0),ae(``)}})]}),(0,$.jsx)(DO,{variant:`secondary`,onClick:t,children:`Back`})]})}):(0,$.jsx)(TO,{children:(0,$.jsxs)(`div`,{className:`surface-body`,children:[(0,$.jsx)(`h2`,{children:`Protect and import`}),(0,$.jsx)(`p`,{children:u?.name||c?.account}),c&&!c.encryptedBackup&&!c.plaintextKeys&&(0,$.jsx)(EO,{children:`These databases contain wallet records. Select the matching key backup to recover signing access.`}),(0,$.jsxs)(`form`,{className:`stack-surface`,onSubmit:le,children:[c&&!c.encryptedBackup&&!c.plaintextKeys&&(0,$.jsxs)(`label`,{className:`field-label`,children:[`Matching key backup`,(0,$.jsx)(`input`,{className:`field`,required:!0,type:`file`,disabled:S,accept:`.bep,.json`,onChange:e=>d(e.target.files?.[0])})]}),(0,$.jsxs)(`label`,{className:`field-label`,children:[`Wallet name`,(0,$.jsx)(`input`,{className:`field`,required:!0,value:f,onChange:e=>p(e.target.value),disabled:S||!!c})]}),(0,$.jsxs)(`label`,{className:`field-label`,children:[`Backup password, if encrypted`,(0,$.jsx)(`input`,{className:`field`,type:`password`,autoComplete:`off`,value:m,onChange:e=>h(e.target.value),disabled:S})]}),(0,$.jsxs)(`label`,{className:`field-label`,children:[`Vault password`,(0,$.jsx)(`input`,{className:`field`,required:!0,type:`password`,autoComplete:`new-password`,minLength:8,value:g,onChange:e=>_(e.target.value),disabled:S})]}),(0,$.jsx)(`p`,{children:`Use your existing Vault password, or choose one if this is your first wallet.`}),(0,$.jsxs)(`label`,{className:`field-label`,children:[`Confirm Vault password`,(0,$.jsx)(`input`,{className:`field`,required:!0,type:`password`,autoComplete:`new-password`,value:v,onChange:e=>y(e.target.value),disabled:S})]}),(0,$.jsxs)(`label`,{className:`checkbox-field`,children:[(0,$.jsx)(`input`,{required:!0,type:`checkbox`,checked:b,onChange:e=>x(e.target.checked),disabled:S}),` `,`Import this wallet into my local encrypted Vault.`]}),(0,$.jsxs)(`div`,{className:`form-actions`,children:[(0,$.jsx)(DO,{variant:`secondary`,type:`button`,onClick:ce,disabled:S,children:`Back`}),(0,$.jsx)(DO,{type:`submit`,disabled:S||!b,children:S?`Importing…`:`Import wallet`})]})]})]})})]})}function ek({token:e,onLinked:t}){let[n,r]=(0,W.useState)(``),[i,a]=(0,W.useState)(),[o,s]=(0,W.useState)(``),[c,l]=(0,W.useState)(`vault-key`),[u,d]=(0,W.useState)(``),[f,p]=(0,W.useState)(!1);async function m(){if(!f){p(!0),d(``);try{let l=i?.keys.find(e=>e.entryId===o);if(i&&!l)throw Error(`Choose a private key.`);let u=await fetch(i?`/api/embedded/link-key`:`/api/embedded/vault-keys`,{method:`POST`,headers:{Authorization:`Bearer ${e}`,"Content-Type":`application/json`},body:JSON.stringify(i?{password:n,accountName:c,vaultId:i.vaultId,entryId:l?.entryId,publicKey:l?.publicKey}:{password:n})}),d=await u.json();if(!u.ok)throw Error(d.error||`Could not open the Vault.`);i?(r(``),a(void 0),t()):(a(d),s(d.keys[0]?.entryId??``))}catch(e){d(e instanceof Error?e.message:`Could not use this key.`)}finally{p(!1)}}}return(0,$.jsx)(TO,{children:(0,$.jsxs)(`div`,{className:`surface-body`,children:[(0,$.jsx)(`h2`,{children:`Use a key already in your Vault`}),(0,$.jsx)(`p`,{children:`Link an existing private key to a new wallet account, then assign it to a role. This does not import another wallet’s transaction history.`}),u&&(0,$.jsx)(EO,{tone:`error`,children:u}),i?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`label`,{className:`field-label`,children:[`Private key`,(0,$.jsx)(`select`,{className:`field`,value:o,onChange:e=>s(e.target.value),disabled:f,children:i.keys.map(e=>(0,$.jsxs)(`option`,{value:e.entryId,children:[e.label,` · `,e.publicKey.slice(-8)]},e.entryId))})]}),!i.keys.length&&(0,$.jsx)(EO,{children:`No compatible private keys found. HD roots and non-key entries cannot be used directly.`}),(0,$.jsxs)(`label`,{className:`field-label`,children:[`Account name`,(0,$.jsx)(`input`,{className:`field`,value:c,onChange:e=>l(e.target.value),disabled:f})]})]}):(0,$.jsxs)(`label`,{className:`field-label`,children:[`Vault password`,(0,$.jsx)(`input`,{className:`field`,type:`password`,autoComplete:`off`,value:n,onChange:e=>r(e.target.value),disabled:f})]}),(0,$.jsx)(`div`,{className:`form-actions`,children:(0,$.jsx)(DO,{onClick:m,disabled:f||!n||!!i&&!o,children:f?`Please wait…`:i?`Link selected key`:`Show Vault keys`})})]})})}var tk=[{id:`payments`,label:`Payment key`},{id:`identity`,label:`Identity key`},{id:`ordinals`,label:`Ordinals key`}];function nk({token:e,onBack:t,onUnlock:n}){let[r,i]=(0,W.useState)(),[a,o]=(0,W.useState)({}),[s,c]=(0,W.useState)(``),[l,u]=(0,W.useState)(!1),[d,f]=(0,W.useState)(!1),[p,m]=(0,W.useState)(0);(0,W.useEffect)(()=>{fetch(`/api/embedded/roles`,{headers:{Authorization:`Bearer ${e}`}}).then(async e=>{if(!e.ok)throw Error(`Could not load key settings.`);let t=await e.json();i(t),o({payments:t.defaults.payments??t.keys[0]?.selector??null,identity:t.defaults.identity===void 0?void 0:t.defaults.identity,ordinals:t.defaults.ordinals===void 0?void 0:t.defaults.ordinals})}).catch(e=>c(e.message))},[e,p]);async function h(){if(r&&!l){u(!0),c(``);try{let t=await fetch(`/api/embedded/roles`,{method:`POST`,headers:{Authorization:`Bearer ${e}`,"Content-Type":`application/json`},body:JSON.stringify({defaults:a,revision:r.revision})});if(!t.ok)throw Error(`Could not save key settings. Reload and try again.`);let o=await t.json();if(i(o),!o.effective.payments)throw Error(`Select a payment key to continue.`);n(o.effective.payments.split(`:`)[0])}catch(e){c(e instanceof Error?e.message:`Could not save settings.`)}finally{u(!1)}}}return(0,$.jsxs)(CO,{navigation:!1,children:[(0,$.jsx)(wO,{eyebrow:`Your Vault`,title:`Choose your default keys`,description:`Keep all your keys in one Vault. Choose which key each role uses; project MCP settings can override individual roles.`}),s&&(0,$.jsx)(EO,{tone:`error`,children:s}),d?(0,$.jsx)(ek,{token:e,onLinked:()=>{f(!1),m(e=>e+1)}}):(0,$.jsx)(DO,{variant:`secondary`,onClick:()=>f(!0),children:`Choose another key from Vault`}),(0,$.jsx)(TO,{children:(0,$.jsxs)(`div`,{className:`surface-body`,children:[(0,$.jsx)(`p`,{children:`Import several wallets before unlocking. Choosing a default does not move keys or funds.`}),tk.map(e=>(0,$.jsxs)(`label`,{className:`field-label`,children:[e.label,(0,$.jsxs)(`select`,{className:`field`,value:a[e.id]===void 0?`inherit`:a[e.id]??``,disabled:!r||l,onChange:t=>o({...a,[e.id]:t.target.value===`inherit`?void 0:t.target.value||null}),children:[e.id!==`payments`&&(0,$.jsx)(`option`,{value:`inherit`,children:`Use payment key`}),(0,$.jsx)(`option`,{value:``,children:e.id===`payments`?`Choose a key`:`Disabled`}),r?.keys.map(e=>(0,$.jsxs)(`option`,{value:e.selector,children:[e.selector,` · `,e.publicKey.slice(-8)]},e.selector))]}),r?.overrides.includes(e.id)&&(0,$.jsxs)(`span`,{className:`source-detail`,children:[`Project configuration overrides this role:`,` `,r.effective[e.id]??`disabled`,`.`]})]},e.id)),(0,$.jsxs)(`div`,{className:`form-actions`,children:[(0,$.jsx)(DO,{variant:`secondary`,onClick:t,disabled:l,children:`Import more wallets`}),(0,$.jsx)(DO,{onClick:h,disabled:!r||l,children:`Save defaults and unlock`})]})]})})]})}function rk({token:e,standalone:t=!1}){let[n,r]=(0,W.useState)(`welcome`),[i,a]=(0,W.useState)([]),[o,s]=(0,W.useState)(`default`),[c,l]=(0,W.useState)(``),[u,d]=(0,W.useState)(``),[f,p]=(0,W.useState)(!1),[m,h]=(0,W.useState)(``),[g,_]=(0,W.useState)(),[v,y]=(0,W.useState)(!1),[b,x]=(0,W.useState)(!1);(0,W.useEffect)(()=>{e&&fetch(`/api/inventory`,{headers:{Authorization:`Bearer ${e}`}}).then(e=>e.ok?e.json():void 0).then(e=>{e?.sources?.length&&s(`new-wallet`),a(e?.boundAccounts??[]),y(e?.vaultExists===!0)}).catch(()=>{})},[e]);function S(e){f||b||(r(e),window.history.pushState({view:e},``,`/setup/source?mode=migration&view=${e}`))}(0,W.useEffect)(()=>{let e=()=>{if(f||b){window.history.replaceState({view:n},``,`/setup/source?mode=migration&view=${n}`);return}let e=window.history.state?.view;r(e===`create`||e===`existing`||e===`unlock`||e===`roles`?e:`welcome`),l(``),d(``),h(``)};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[f,b,n]);function C(){l(``),d(``),h(``),S(`welcome`)}async function w(t){if(t.preventDefault(),!f){if(c.length<8){h(`Choose a password with at least 8 characters.`);return}if(n!==`unlock`&&c!==u){h(`The passwords don’t match. Try again.`);return}p(!0),h(``);try{let t=await fetch(n===`unlock`?`/api/embedded/unlock`:`/api/embedded/create`,{method:`POST`,headers:{Authorization:`Bearer ${e}`,"Content-Type":`application/json`},body:JSON.stringify({accountName:o,activate:!1,password:c,passwordConfirmation:u,confirmation:`CREATE_NEW_CONFIRMED`})}),i=await t.json();if(!t.ok)throw Error(i.error||`Your wallet could not be created. Please try again.`);if(l(``),d(``),i.saved===!0){r(`roles`),window.history.pushState({view:`roles`},``,`/setup/source?mode=migration&view=roles`);return}if(i.ready!==!0)throw Error(`Your wallet was saved, but could not be activated. Reopen setup to unlock it.`);_(i.tools),x(!0)}catch(e){h(e instanceof Error?e.message:`Your wallet could not be created.`)}finally{p(!1)}}}return e?n===`roles`?(0,$.jsx)(nk,{token:e,onBack:()=>S(`existing`),onUnlock:e=>{s(e),S(`unlock`)}}):n===`existing`?(0,$.jsx)($O,{token:e,standalone:t,onWelcome:C,onUnlock:()=>S(`roles`)}):b&&!t?(0,$.jsx)(CO,{navigation:!1,children:(0,$.jsx)(QO,{tools:g})}):(0,$.jsxs)(CO,{navigation:!1,children:[(0,$.jsx)(wO,{eyebrow:b?`Wallet saved`:n===`welcome`?`Welcome`:n===`unlock`?`Saved wallet`:`New wallet`,title:b?t?`Your wallet is saved`:`Your wallet is ready`:n===`welcome`?`Your wallet starts here`:n===`unlock`?`Unlock your wallet`:`Make it yours`,description:b?`Your keys are saved in your encrypted local Vault.`:n===`welcome`?`Start fresh, or bring a wallet you already use.`:n===`unlock`?`Enter your Vault password to use your wallet in this session.`:v?`Give your new wallet a name and enter your existing Vault password.`:`Give your wallet a name and choose a password to protect it.`}),b?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(EO,{tone:`success`,children:t?`Open wallet setup in your MCP client to unlock and use your saved wallet.`:`Your wallet is ready to use. Return to your MCP client to continue.`}),!t&&(0,$.jsx)(ZO,{tools:g})]}):n===`welcome`?(0,$.jsxs)(`div`,{className:`setup-choices`,children:[(i.length>0||v)&&(0,$.jsx)(DO,{onClick:()=>S(`roles`),children:`Choose default keys`}),(0,$.jsxs)(`button`,{type:`button`,className:`setup-choice`,onClick:()=>S(`create`),children:[(0,$.jsx)(`span`,{className:`choice-icon`,"aria-hidden":`true`,children:`+`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`strong`,{children:`Create a new wallet`}),(0,$.jsx)(`span`,{children:`Get a fresh wallet, protected by your password.`})]}),(0,$.jsx)(`span`,{className:`choice-arrow`,"aria-hidden":`true`,children:`→`})]}),(0,$.jsxs)(`button`,{type:`button`,className:`setup-choice`,onClick:()=>S(`existing`),children:[(0,$.jsx)(`span`,{className:`choice-icon`,"aria-hidden":`true`,children:`↗`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`strong`,{children:`Use an existing wallet`}),(0,$.jsx)(`span`,{children:`Bring your existing keys and account with you.`})]}),(0,$.jsx)(`span`,{className:`choice-arrow`,"aria-hidden":`true`,children:`→`})]}),(0,$.jsx)(`p`,{className:`setup-reassurance`,children:`Your keys stay on this computer, encrypted in your Vault.`})]}):(0,$.jsx)(TO,{children:(0,$.jsxs)(`form`,{className:`surface-body`,onSubmit:w,children:[(0,$.jsxs)(`label`,{className:`field-label`,htmlFor:`wallet-name`,children:[`Wallet name`,(0,$.jsx)(`input`,{id:`wallet-name`,className:`field`,value:o,onChange:e=>s(e.target.value),autoComplete:`off`,pattern:`[a-z0-9][a-z0-9_-]{0,63}`,required:!0,disabled:f||n===`unlock`})]}),(0,$.jsxs)(`label`,{className:`field-label`,htmlFor:`new-password`,children:[`Password`,(0,$.jsx)(`input`,{id:`new-password`,className:`field`,type:`password`,value:c,onChange:e=>l(e.target.value),autoComplete:`new-password`,minLength:8,required:!0,disabled:f}),(0,$.jsx)(`span`,{className:`source-detail`,children:v?`Use the password for your existing Vault.`:`Use at least 8 characters. Keep this password somewhere safe.`})]}),n!==`unlock`&&(0,$.jsxs)(`label`,{className:`field-label`,htmlFor:`confirm-password`,children:[`Confirm password`,(0,$.jsx)(`input`,{id:`confirm-password`,className:`field`,type:`password`,value:u,onChange:e=>d(e.target.value),autoComplete:`new-password`,required:!0,disabled:f})]}),m?(0,$.jsx)(`div`,{className:`stack-surface`,children:(0,$.jsx)(EO,{tone:`error`,children:m})}):null,(0,$.jsxs)(`div`,{className:`form-actions`,children:[(0,$.jsx)(DO,{variant:`secondary`,onClick:C,disabled:f,children:`Back`}),(0,$.jsx)(DO,{type:`submit`,disabled:f,"aria-busy":f,children:f?`Please wait…`:n===`unlock`?`Unlock wallet`:`Create wallet`})]})]})})]}):(0,$.jsx)(CO,{navigation:!1,children:(0,$.jsx)(wO,{eyebrow:`Setup connection`,title:`Reopen wallet setup`,description:`Open wallet setup from your MCP client to start a private local session.`})})}var ik=[`identity-signing`,`payments`,`one-sat`,`encryption`],ak=[`source`,`destination`,`unlock`,`review`],ok=`migration`,sk=new Set(`token.setuptoken.setup_token.passphrase.sourcepassphrase.source_passphrase.destinationpassphrase.destination_passphrase.password.passwd.session.sessionid.session_id.secret.privatekey.private_key.wif.mnemonic.auth.authorization.accesstoken.access_token.refreshtoken.refresh_token.idtoken.id_token.apikey.api_key`.split(`.`));function ck(e){return ak.indexOf(e)}function lk(e){if(typeof e!=`string`)return null;switch(e.length>1&&e.endsWith(`/`)?e.slice(0,-1):e){case`/setup/source`:return`source`;case`/setup/destination`:return`destination`;case`/setup/unlock`:return`unlock`;case`/setup/review`:return`review`;default:return null}}function uk(e){try{return new URLSearchParams(e).get(`mode`)===ok}catch{return!1}}function dk(e,t){let n=ck(e),r=ck(t);return n!==-1&&r!==-1&&n<=r}function fk(e,t,n){if(!uk(t))return`source`;let r=lk(e);return r===null?`source`:dk(r,n)?r:n}function pk(e,t){let n=new URLSearchParams(t);for(let e of[...n.keys()])sk.has(e.toLowerCase())&&n.delete(e);n.set(`mode`,ok);let r=n.toString();return`/setup/${e}${r?`?${r}`:``}`}function mk(){return{pathname:window.location.pathname,search:window.location.search}}function hk(e){let{maxStep:t,busy:n}=e,[r,i]=(0,W.useState)(`source`),a=(0,W.useRef)(`source`),o=(0,W.useRef)(t),s=(0,W.useRef)(n);return(0,W.useEffect)(()=>{a.current=r,o.current=t,s.current=n}),(0,W.useEffect)(()=>{if(typeof window>`u`)return;let e=mk(),t=fk(e.pathname,e.search,o.current);a.current=t,i(t),window.history.replaceState(null,``,pk(t,e.search))},[]),(0,W.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>{let e=a.current,t=mk();if(s.current){window.history.replaceState(null,``,pk(e,t.search));return}let n=fk(t.pathname,t.search,o.current);n!==e&&(a.current=n,i(n));let r=pk(n,t.search);`${t.pathname}${t.search}`!==r&&window.history.replaceState(null,``,r)};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]),(0,W.useEffect)(()=>{typeof window>`u`||dk(r,t)||(a.current=t,i(t),window.history.replaceState(null,``,pk(t,window.location.search)))},[t,r]),{step:r,goToStep:(0,W.useCallback)(e=>{typeof window>`u`||n||dk(e,t)&&e!==r&&(i(e),a.current=e,window.history.pushState(null,``,pk(e,window.location.search)))},[n,t,r])}}var gk={"identity-signing":`Identity signing`,payments:`Payments`,"one-sat":`OneSat assets`,encryption:`Encryption`};function _k(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function vk(e){return e instanceof Error?e.message:String(e)}function yk({token:e,onWelcome:t}){let[n,r]=(0,W.useState)(),[i,a]=(0,W.useState)(),[o,s]=(0,W.useState)(),[c,l]=(0,W.useState)(),[u,d]=(0,W.useState)(),[f,p]=(0,W.useState)(),[m,h]=(0,W.useState)({}),[g,_]=(0,W.useState)(``),[v,y]=(0,W.useState)(``),[b,x]=(0,W.useState)(``),[S,C]=(0,W.useState)(`Inspecting local setup…`),[w,ee]=(0,W.useState)(),[te,ne]=(0,W.useState)(!1),[T,re]=(0,W.useState)(),[ie,ae]=(0,W.useState)(),{step:oe,goToStep:se}=hk({maxStep:f?`review`:c?`unlock`:o?`destination`:`source`,busy:T!==void 0}),[ce,le]=(0,W.useState)();(0,W.useEffect)(()=>{ce&&T===void 0&&(se(ce),le(void 0))},[ce,T,se]);function E(){_(``),y(``),ae(void 0);let e=ak.indexOf(oe);e>0&&se(ak[e-1])}let D=(0,W.useCallback)(async(t,n={})=>{let r=await fetch(t,{...n,headers:{Authorization:`Bearer ${e}`,...n.body?{"Content-Type":`application/json`}:{},...n.headers}}),i=null;try{i=await r.json()}catch{}if(!r.ok){let e=_k(i),t=Error(typeof e.error==`string`?e.error:`Local setup request failed`);throw Object.assign(t,{noEffect:e.noEffect===!0}),t}return _k(i)},[e]);(0,W.useEffect)(()=>{if(!e){ee(`This setup link is missing its local authorization token. Reopen it from BSV MCP.`);return}Promise.all([D(`/api/inventory`),D(`/api/migration/capabilities`)]).then(([e,t])=>{r(e),a(t),C(`Select a source to begin the local migration.`)}).catch(e=>ee(vk(e)))},[D,e]);function ue(e){T===void 0&&(s(e),le(`destination`),l(void 0),d(void 0),p(void 0),h({}),x(``),ee(void 0),ae(void 0),C(`Source selected: ${e.account}. Choose a Vault destination.`))}function de(e){e.preventDefault(),o&&i?.destinationDefaults&&(l({accountName:o.account,vaultPath:i.destinationDefaults.vaultPath,vaultEntryId:`new`}),le(`unlock`),x(``),p(void 0),h({}),ee(void 0),ae(void 0),C(`Destination selected. Unlock the Vault locally to preview preservation.`))}async function fe(e){if(e.preventDefault(),!o||!c||!i?.available)return;let t=g,n=v;if(_(``),y(``),x(``),!t.trim()&&!n.trim()){ae(`Enter the source backup passphrase or the destination Vault passphrase to unlock locally.`),C(`Action needs attention. Enter at least one passphrase.`);return}ae(void 0),re(`unlock`),ee(void 0),ne(!1),C(`Unlocking locally…`);try{let e=await D(`/api/migration/unlock`,{method:`POST`,body:JSON.stringify({source:o,destination:c,sourcePassphrase:t,destinationPassphrase:n||void 0})});d(e.session),le(`review`),p(e.preview),h(Dk(e.preview)),C(`Preview ready. Review preservation before cutover.`)}catch(e){pe(e)}finally{_(``),y(``),re(void 0)}}function pe(e){let t=e;ee(vk(e)),ne(t?.noEffect===!0),C(`Action needs attention.`)}async function me(){if(_(``),y(``),x(``),ae(void 0),!u){C(`Unlock fields cleared.`);return}re(`lock`);try{await D(`/api/migration/lock`,{method:`POST`,body:JSON.stringify({sessionId:u.sessionId})}),d(void 0),p(void 0),h({}),C(`Vault session locked. Unlock again locally to continue.`)}catch(e){pe(e)}finally{re(void 0)}}async function he(){if(u){re(`refresh`);try{let e=await D(`/api/migration/preview`,{method:`POST`,body:JSON.stringify({sessionId:u.sessionId})});p(e.preview),h(Dk(e.preview)),x(``),ee(void 0),C(`Preview refreshed. Review it before trying the cutover again.`)}catch(e){pe(e)}finally{re(void 0)}}}async function ge(e,t){if(u&&[`keep-existing`,`import-source`,`skip`].includes(t)){re(`resolve:${e}`);try{let n=(await D(`/api/migration/resolve`,{method:`POST`,body:JSON.stringify({sessionId:u.sessionId,conflictId:e,resolution:t})})).preview;p(n),h(Dk(n)),x(``),ee(void 0),C(`Conflict resolution saved. Review the updated preservation preview.`)}catch(e){pe(e)}finally{re(void 0)}}}async function _e(){if(u){re(`reconcile`);try{let e=await D(`/api/migration/reconcile`,{method:`POST`,body:JSON.stringify({sessionId:u.sessionId})});e.phase===`destination`?(d(void 0),p(void 0),h({}),x(``),C(`Backend confirmed the source is safe to retry. Unlock again locally.`)):e.phase===`complete`?(x(``),C(`Vault cutover complete and verified.`)):C(`Cutover status is still unknown. Keep the source and backup until reconciliation succeeds.`)}catch(e){pe(e)}finally{re(void 0)}}}async function ve(){if(u&&f&&kk(f,m,b)){re(`cutover`),ee(void 0),C(`Preparing a recoverable backup…`);try{let e=await D(`/api/migration/cutover`,{method:`POST`,body:JSON.stringify({sessionId:u.sessionId,confirmation:`MIGRATE_AND_SWITCH`,roleSelection:f.projectRoles?Ok(f,m):void 0})});if(e.error)throw Error(String(e.error));C(`Migration verified. Account ${String(_k(e).accountName??c?.accountName??``)} is ready in Vault.`),p(void 0)}catch(e){pe(e)}finally{re(void 0)}}}return(0,$.jsxs)(CO,{navigation:!1,children:[(0,$.jsx)(wO,{eyebrow:`Step ${ak.indexOf(oe)+1} of ${ak.length}`,title:`Set up your wallet`,description:`Bring an existing wallet into your local encrypted Vault.`}),oe===`source`&&t?(0,$.jsx)(`div`,{className:`form-actions`,children:(0,$.jsx)(DO,{variant:`secondary`,onClick:t,disabled:T!==void 0,children:`Back`})}):null,oe===`source`?null:(0,$.jsxs)(`div`,{className:`form-actions`,children:[(0,$.jsx)(DO,{variant:`secondary`,onClick:E,disabled:T!==void 0,children:`Back`}),(0,$.jsxs)(`span`,{className:`dim`,children:[`Wallet: `,o?.account]})]}),w?(0,$.jsx)(TO,{children:(0,$.jsxs)(`div`,{className:`surface-body`,children:[(0,$.jsxs)(EO,{tone:`error`,children:[w,te?` No destination write or source change was reported; retry the preview when ready.`:``]}),(0,$.jsx)(`div`,{className:`form-actions`,children:(0,$.jsx)(DO,{variant:`secondary`,disabled:T!==void 0||!u,"aria-busy":T!==void 0||void 0,onClick:te?he:_e,children:T===void 0?te?`Retry preview`:`Reconcile cutover`:te?`Retrying preview…`:`Reconciling cutover…`})})]})}):null,oe===`source`?(0,$.jsx)(bk,{inventory:n,source:o,onSelect:ue,disabled:T!==void 0}):null,oe===`destination`?(0,$.jsx)(xk,{source:o,destination:c,defaults:i?.destinationDefaults,onSubmit:de,pending:T}):null,oe===`unlock`?(0,$.jsx)(Sk,{source:o,destination:c,backend:i,sourcePassphrase:g,destinationPassphrase:v,setSourcePassphrase:_,setDestinationPassphrase:y,validationError:ie,onSubmit:fe,onLock:me,pending:T}):null,oe===`review`?(0,$.jsx)(Ck,{preview:f,roles:m,setRoles:h,confirmation:b,setConfirmation:x,onRefresh:he,onResolve:ge,onCutover:ve,canCutover:!!(f&&kk(f,m,b)),pending:T,status:S}):null,(0,$.jsx)(`p`,{role:`status`,"aria-live":`polite`,className:`dim migration-footnote`,children:S}),(0,$.jsx)(Ek,{inventory:n})]})}function bk({inventory:e,source:t,onSelect:n,disabled:r}){let i={"legacy-root":`Earlier BSV MCP wallet`,account:`BSV MCP account`,custom:`Configured wallet`};return(0,$.jsxs)(TO,{children:[(0,$.jsx)(`div`,{className:`surface-header`,children:(0,$.jsx)(`h2`,{children:`Choose a wallet to bring into Vault`})}),(0,$.jsxs)(`div`,{className:`surface-body`,children:[(0,$.jsx)(`p`,{children:`These files were found on this computer. Choose the wallet you want to keep using.`}),e?e.sources.length?e.sources.map(e=>{let a=t?.account===e.account&&t.location===e.location,o=e.encryptedBackup||e.plaintextKeys,s=[...e.encryptedBackup?[`keys.bep — encrypted key backup`]:[],...e.plaintextKeys?[`${e.keyFile??`keys.json`} — unencrypted key file`]:[],...e.walletDatabases.map(e=>`${e} — wallet database`)];return(0,$.jsxs)(`div`,{className:`source-row`,children:[(0,$.jsxs)(`div`,{className:`source-meta`,children:[(0,$.jsx)(`span`,{className:`source-title`,children:e.account}),(0,$.jsx)(`span`,{className:`source-detail`,children:i[e.location]}),(0,$.jsx)(`p`,{className:`source-detail`,children:e.encryptedBackup?`An encrypted key backup was found. You’ll need its password.`:e.plaintextKeys?`An unencrypted key file was found. Importing will add an encrypted copy to Vault.`:`Wallet data was found, but no key backup. This source cannot be imported on its own.`}),(0,$.jsx)(`div`,{className:`source-location`,children:e.directory}),(0,$.jsxs)(`details`,{className:`source-files`,children:[(0,$.jsxs)(`summary`,{children:[`Files found (`,s.length,`)`]}),(0,$.jsx)(`ul`,{className:`file-list`,children:s.map(e=>(0,$.jsx)(`li`,{children:e},e))})]})]}),o?(0,$.jsx)(DO,{variant:a?`secondary`:`primary`,disabled:r,onClick:()=>n(e),children:a?`Selected`:`Use this wallet`}):(0,$.jsx)(`span`,{className:`source-detail`,children:`Key backup needed`})]},`${e.location}:${e.account}`)}):(0,$.jsx)(EO,{tone:`info`,children:`No existing wallet files were found.`}):(0,$.jsx)(OO,{label:`Finding local wallets`}),e?(0,$.jsx)(`p`,{className:`dim`,children:e.vaultExists?`A Vault file was found. Its contents can be checked after you unlock it.`:`No Vault file was found on this computer.`}):null]})]})}function xk({source:e,destination:t,defaults:n,onSubmit:r,pending:i}){return(0,$.jsxs)(TO,{className:`stack-surface`,children:[(0,$.jsx)(`div`,{className:`surface-header`,children:(0,$.jsx)(`h2`,{children:`Where your wallet will be saved`})}),(0,$.jsxs)(`div`,{className:`surface-body`,children:[(0,$.jsx)(`p`,{children:`Your wallet will be added to the local encrypted Vault. Its existing keys and address will be checked before anything is switched.`}),n&&e?(0,$.jsxs)(`form`,{onSubmit:r,children:[(0,$.jsxs)(`dl`,{className:`stack-surface`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`field-label`,children:`Wallet`}),(0,$.jsx)(`dd`,{children:e.account})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`field-label`,children:`Vault location`}),(0,$.jsx)(`dd`,{style:{overflowWrap:`anywhere`},children:t?.vaultPath??n.vaultPath})]})]}),(0,$.jsx)(`p`,{className:`dim`,children:`A new entry will be created for this wallet. Existing Vault entries are kept.`}),(0,$.jsx)(`div`,{className:`form-actions`,children:(0,$.jsx)(DO,{type:`submit`,disabled:i!==void 0,children:`Continue`})})]}):(0,$.jsx)(EO,{tone:`info`,children:`The local server has not provided a Vault destination. Reopen setup after its configuration is complete.`})]})]})}function Sk({source:e,destination:t,backend:n,sourcePassphrase:r,destinationPassphrase:i,setSourcePassphrase:a,setDestinationPassphrase:o,validationError:s,onSubmit:c,onLock:l,pending:u}){return n?.available?(0,$.jsxs)(TO,{className:`stack-surface`,children:[(0,$.jsx)(`div`,{className:`surface-header`,children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`section-label`,children:`03 / unlock`}),(0,$.jsx)(`h2`,{children:`Unlock locally and preview`})]})}),(0,$.jsxs)(`div`,{className:`surface-body`,children:[n?(0,$.jsx)(EO,{tone:n.available?`success`:`warning`,children:n.available?`Vault migration backend is ready. Unlock stays on this device.`:n.reason??`Vault migration is unavailable.`}):(0,$.jsx)(OO,{label:`Checking Vault migration support`}),(0,$.jsxs)(`form`,{onSubmit:c,children:[(0,$.jsxs)(`label`,{className:`field-label`,children:[`Source backup passphrase`,(0,$.jsx)(`input`,{className:`field`,type:`password`,value:r,onChange:e=>a(e.target.value),autoComplete:`current-password`,pattern:`.*\\S.*`,title:`Use at least one non-whitespace character.`,"aria-invalid":s?!0:void 0,"aria-describedby":s?`unlock-validation-error`:void 0,disabled:!n?.available||!e||!t||u!==void 0})]}),(0,$.jsxs)(`label`,{className:`field-label`,children:[`Destination Vault passphrase`,(0,$.jsx)(`input`,{className:`field`,type:`password`,value:i,onChange:e=>o(e.target.value),autoComplete:`new-password`,pattern:`.*\\S.*`,title:`Use at least one non-whitespace character.`,"aria-invalid":s?!0:void 0,"aria-describedby":s?`unlock-validation-error`:void 0,disabled:!n?.available||!e||!t||u!==void 0})]}),s?(0,$.jsx)(`div`,{id:`unlock-validation-error`,children:(0,$.jsx)(EO,{tone:`error`,children:s})}):null,(0,$.jsxs)(`div`,{className:`form-actions`,children:[(0,$.jsx)(DO,{type:`submit`,"aria-busy":u===`unlock`||void 0,disabled:!n?.available||!e||!t||u!==void 0,children:u===`unlock`?`Unlocking…`:`Unlock locally`}),(0,$.jsx)(DO,{type:`button`,variant:`secondary`,onClick:l,"aria-busy":u===`lock`||void 0,disabled:u!==void 0,children:u===`lock`?`Locking…`:`Lock session`})]})]}),(0,$.jsx)(`p`,{className:`dim`,children:`Passphrases are sent only to the loopback setup server and cleared after each request.`})]})]}):(0,$.jsxs)(TO,{children:[(0,$.jsx)(`div`,{className:`surface-header`,children:(0,$.jsx)(`h2`,{children:`Setup is not ready to continue`})}),(0,$.jsxs)(`div`,{className:`surface-body`,children:[(0,$.jsx)(`p`,{children:`The local server cannot import this wallet yet. Your existing files have not been changed.`}),n?.reason?(0,$.jsxs)(`details`,{children:[(0,$.jsx)(`summary`,{children:`Connection details`}),(0,$.jsx)(`p`,{children:n.reason})]}):null]})]})}function Ck({preview:e,roles:t,setRoles:n,confirmation:r,setConfirmation:i,onRefresh:a,onResolve:o,onCutover:s,canCutover:c,pending:l,status:u}){if(!e)return null;let d=_k(_k(e.projectRoles?.current).current);return(0,$.jsxs)(TO,{className:`stack-surface`,children:[(0,$.jsxs)(`div`,{className:`surface-header`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`section-label`,children:`04 / verify`}),(0,$.jsx)(`h2`,{children:`Review preservation`})]}),(0,$.jsx)(DO,{variant:`secondary`,onClick:a,"aria-busy":l===`refresh`||void 0,disabled:l!==void 0,children:l===`refresh`?`Refreshing preview…`:`Refresh preview`})]}),(0,$.jsxs)(`div`,{className:`surface-body`,children:[(0,$.jsx)(EO,{tone:`info`,children:u}),(0,$.jsxs)(`div`,{className:`grid grid-two`,children:[(0,$.jsxs)(`div`,{className:`data-list`,children:[(0,$.jsx)(wk,{label:`Source`,value:`${e.source.account} · ${e.source.location}`}),(0,$.jsx)(wk,{label:`Identity`,value:e.preservation.identity}),(0,$.jsx)(wk,{label:`Addresses`,value:e.preservation.addresses}),(0,$.jsx)(wk,{label:`Databases`,value:e.preservation.databases.length?e.preservation.databases.join(`, `):`none`}),(0,$.jsx)(wk,{label:`Vault entries`,value:e.preservation.vaultEntries})]}),(0,$.jsx)(`pre`,{className:`json-preview`,children:JSON.stringify({source:e.source,destination:e.destination,conflicts:e.conflicts},null,2)})]}),e.projectRoles?(0,$.jsx)(Tk,{projectRoles:e.projectRoles,assignments:d,roles:t,setRoles:n,onRefresh:a,pending:l}):null,e.conflicts.length?(0,$.jsx)(`div`,{className:`conflict-list`,children:e.conflicts.map(e=>(0,$.jsxs)(`div`,{className:`role-row`,children:[(0,$.jsx)(`label`,{className:`role-label`,htmlFor:`conflict-resolution-${e.id}`,children:e.message}),(0,$.jsxs)(`select`,{id:`conflict-resolution-${e.id}`,className:`select`,"aria-label":`Resolve conflict: ${e.message}`,value:e.resolution??``,onChange:t=>o(e.id,t.target.value),disabled:l!==void 0,children:[(0,$.jsx)(`option`,{value:``,children:`Choose a resolution`}),(0,$.jsx)(`option`,{value:`keep-existing`,children:`Keep existing Vault entry`}),(0,$.jsx)(`option`,{value:`import-source`,children:`Import source material`}),(0,$.jsx)(`option`,{value:`skip`,children:`Skip this item`})]})]},e.id))}):(0,$.jsx)(`p`,{className:`dim`,children:`No conflicts reported.`}),(0,$.jsxs)(`label`,{className:`field-label`,children:[`Type `,(0,$.jsx)(`strong`,{children:`MIGRATE_AND_SWITCH`}),` to authorize`,(0,$.jsx)(`input`,{className:`field`,value:r,onChange:e=>i(e.target.value),autoComplete:`off`,disabled:l!==void 0})]}),(0,$.jsx)(`div`,{className:`form-actions`,children:(0,$.jsx)(DO,{onClick:s,"aria-busy":l===`cutover`||void 0,disabled:!c||l!==void 0,children:l===`cutover`?`Migrating to Vault…`:`Import and switch to Vault`})})]})]})}function wk({label:e,value:t}){return(0,$.jsxs)(`div`,{className:`data-row`,children:[(0,$.jsx)(`span`,{className:`data-label`,children:e}),(0,$.jsx)(`span`,{className:`data-value`,children:t})]})}function Tk({projectRoles:e,assignments:t,roles:n,setRoles:r,onRefresh:i,pending:a}){let o=_k(e).presentation,s=e.candidates,c=Array.isArray(o&&o.roles)?o.roles.filter(e=>!!(e&&typeof e==`object`)):[],l=c.length?c.map(e=>({role:String(e.role),label:String(e.label??gk[e.role]??e.role),current:e.current,selectedValue:typeof e.selectedValue==`string`?e.selectedValue:void 0,choices:Array.isArray(e.choices)?e.choices.filter(e=>!!(e&&typeof e==`object`)):[]})):ik.map(e=>({role:e,label:gk[e],current:t[e],selectedValue:void 0,choices:[]}));return(0,$.jsxs)(`div`,{className:`stack-surface`,children:[(0,$.jsx)(`p`,{className:`section-label`,children:`project roles`}),(0,$.jsx)(`h3`,{children:`Choose a verified key for each role`}),(0,$.jsx)(`p`,{className:`dim`,children:`Only candidate IDs are sent when you continue. Key material and paths stay in the trusted backend.`}),s.length===0?(0,$.jsxs)(`div`,{className:`stack-surface`,children:[(0,$.jsx)(EO,{tone:`info`,children:`No verified keys are available for project roles. Refresh the preview to check again.`}),(0,$.jsx)(`div`,{className:`form-actions`,children:(0,$.jsx)(DO,{variant:`secondary`,onClick:i,"aria-busy":a===`refresh`||void 0,disabled:a!==void 0,children:a===`refresh`?`Refreshing preview…`:`Refresh preview`})})]}):null,(0,$.jsx)(`div`,{className:`role-grid`,children:l.map(e=>{let t=e.role,i=typeof e.current==`string`?`keep:${e.current}`:`unassigned`,o=n[t]??e.selectedValue??i;return(0,$.jsxs)(`label`,{className:`role-row`,children:[(0,$.jsx)(`span`,{className:`role-label`,children:e.label}),(0,$.jsx)(`span`,{className:`role-help`,children:typeof e.current==`string`?`Current: ${String(e.current)}`:`No current assignment`}),(0,$.jsxs)(`select`,{className:`select`,value:o,disabled:a!==void 0,onChange:e=>r(n=>({...n,[t]:e.target.value})),children:[(0,$.jsx)(`option`,{value:`unassigned`,children:`Leave unassigned`}),typeof e.current==`string`?(0,$.jsx)(`option`,{value:i,children:`Keep current selection`}):null,e.choices.length?e.choices.map(e=>(0,$.jsx)(`option`,{value:String(e.value),disabled:e.disabled===!0,children:String(e.label??e.value)},String(e.value))):s.map(e=>(0,$.jsxs)(`option`,{value:`select:${e.candidateId}`,disabled:!!e.unavailableReason||!e.supportedRoles.includes(t),children:[e.label,e.publicDerivationLabel?` · ${e.publicDerivationLabel}`:``,e.unavailableReason?` · ${e.unavailableReason}`:``]},e.candidateId))]})]},t)})})]})}function Ek({inventory:e}){return e?.migrationRequired?(0,$.jsx)(`p`,{className:`dim migration-footnote`,children:`No source is erased and the running wallet is not switched until explicit cutover completes and verifies.`}):null}function Dk(e){let t=_k(e.projectRoles).presentation;if(t&&Array.isArray(t.roles)){let e=Object.fromEntries(t.roles.filter(e=>!!(e&&typeof e==`object`)).map(e=>[e.role,e.selectedValue]));return Object.fromEntries(ik.map(t=>[t,typeof e[t]==`string`?e[t]:`unassigned`]))}let n=_k(_k(e.projectRoles?.current).current);return Object.fromEntries(ik.map(e=>[e,typeof n[e]==`string`?`keep:${n[e]}`:`unassigned`]))}function Ok(e,t){let n=_k(e.projectRoles).presentation,r=_k(e.projectRoles?.current),i=n&&typeof n.revision==`number`?n.revision:typeof r.revision==`number`?r.revision:null;return{expectedProjectId:e.projectRoles?.projectId??``,expectedRevision:i,roleAssignments:Object.fromEntries(ik.map(e=>[e,t[e]??`unassigned`]))}}function kk(e,t,n){return n===`MIGRATE_AND_SWITCH`&&e.conflicts.every(e=>!!e.resolution)&&(!e.projectRoles||ik.every(e=>typeof t[e]==`string`))}var Ak={mode:null,token:``,flow:null},jk=null;function Mk(){return Ak}function Nk(){if(!jk){let e=window.location.hash.slice(1);jk={mode:window.location.pathname.startsWith(`/setup/`)?`migration`:new URLSearchParams(window.location.search).get(`mode`),token:e,flow:new URLSearchParams(window.location.search).get(`flow`)}}return jk}function Pk(){return()=>{}}function Fk(){let{mode:e,token:t,flow:n}=(0,W.useSyncExternalStore)(Pk,Nk,Mk);return(0,W.useEffect)(()=>{typeof window>`u`||t&&window.history.replaceState(null,``,`${window.location.pathname}?mode=${e??`migration`}${n===`project`||n===`standalone`?`&flow=${n}`:``}`)},[e,t,n]),e===`migration`||t.length>0?n===`project`?(0,$.jsx)(yk,{token:t}):(0,$.jsx)(rk,{token:t,standalone:n===`standalone`}):(0,$.jsx)(FO,{})}var Ik=document.getElementById(`root`);if(!Ik)throw Error(`Local app is missing its root element`);(0,Mb.createRoot)(Ik).render((0,$.jsx)(Fk,{}));</script>
|
|
123
|
+
- "app": Tool callable by the app from this server only`),csp:Kp().optional(),permissions:Kp().optional()}),G({mimeTypes:W(B()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),G({method:X(`ui/download-file`),params:G({contents:W(q([xg,Sg])).describe(`Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.`)})}),G({method:X(`ui/message`),params:G({role:X(`user`).describe(`Message role, currently only "user" is supported.`),content:W(Cg).describe(`Message content blocks (text, image, etc.).`)})}),G({method:X(`ui/notifications/sandbox-resource-ready`),params:G({html:B().describe(`HTML content to load into the inner iframe.`),sandbox:B().optional().describe(`Optional override for the inner iframe's sandbox attribute.`),csp:lx.optional().describe(`CSP configuration from resource metadata.`),permissions:ux.optional().describe(`Sandbox permissions from resource metadata.`)})});var Cx=G({method:X(`ui/notifications/tool-result`),params:Mg.describe(`Standard MCP tool execution result.`)}),wx=G({toolInfo:G({id:rh.optional().describe(`JSON-RPC id of the tools/call request.`),tool:kg.describe(`Tool definition including name, inputSchema, etc.`)}).optional().describe(`Metadata of the tool call that instantiated this App.`),theme:rx.optional().describe(`Current color theme preference.`),styles:hx.optional().describe(`Style configuration for theming the app.`),displayMode:ix.optional().describe(`How the UI is currently displayed.`),availableDisplayModes:W(ix).optional().describe(`Display modes the host supports.`),containerDimensions:q([G({height:V().describe(`Fixed container height in pixels.`)}),G({maxHeight:q([V(),zp()]).optional().describe(`Maximum container height in pixels.`)})]).and(q([G({width:V().describe(`Fixed container width in pixels.`)}),G({maxWidth:q([V(),zp()]).optional().describe(`Maximum container width in pixels.`)})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
|
|
124
|
+
container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:B().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:B().optional().describe(`User's timezone in IANA format.`),userAgent:B().optional().describe(`Host application identifier.`),platform:q([X(`web`),X(`desktop`),X(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:G({touch:H().optional().describe(`Whether the device supports touch input.`),hover:H().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:G({top:V().describe(`Top safe area inset in pixels.`),right:V().describe(`Right safe area inset in pixels.`),bottom:V().describe(`Bottom safe area inset in pixels.`),left:V().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough(),Tx=G({method:X(`ui/notifications/host-context-changed`),params:wx.describe(`Partial context update containing only changed fields.`)});G({method:X(`ui/update-model-context`),params:G({content:W(Cg).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:J(B(),U().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),G({method:X(`ui/initialize`),params:G({appInfo:gh.describe(`App identification (name and version).`),appCapabilities:bx.describe(`Features and capabilities this app provides.`),protocolVersion:B().describe(`Protocol version this app supports.`)})});var Ex=G({protocolVersion:B().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:gh.describe(`Host application identification and version.`),hostCapabilities:yx.describe(`Features and capabilities provided by the host.`),hostContext:wx.describe(`Rich context about the host environment.`)}).passthrough(),Dx={target:`draft-2020-12`};async function Ox(e,t){let n=e[`~standard`];if(n.jsonSchema)return n.jsonSchema[t](Dx);throw Error(`Schema (vendor: ${n.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function kx(e,t,n=``){let r=await e[`~standard`].validate(t);if(r.issues){let e=r.issues.map(e=>{let t=e.path?.map(e=>typeof e==`object`?e.key:e).join(`.`);return t?`${t}: ${e.message}`:e.message}).join(`; `);throw Error(n+e)}return r.value}function Ax(e,t){let n={...e,...t};return t.experimental!==void 0&&(n.experimental={...e.experimental,...t.experimental}),t.tools!==void 0&&(n.tools={...e.tools,...t.tools}),n}var jx=class e extends jb{_appInfo;_appCapabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_registeredEvents=new Set;_events=new Xb;_methods=new Zb;setRequestHandler=(...e)=>{let[t,...n]=$b(`request`,e)??e;this._methods.claim(t,`setRequestHandler`),super.setRequestHandler.call(this,t,...n)};setNotificationHandler=(...e)=>{let[t,...n]=$b(`notification`,e)??e;this._methods.claim(t,`setNotificationHandler`),super.setNotificationHandler.call(this,t,...n)};removeRequestHandler=e=>{this._methods.release(e),super.removeRequestHandler(e)};removeNotificationHandler=e=>{this._methods.release(e),super.removeNotificationHandler(e)};replaceRequestHandler=(e,...t)=>{this._methods.replace(e),super.setRequestHandler.call(this,e,...t)};_assertInitialized(e){if(this._initializedSent)return;let t=`[ext-apps] App.${e}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(t);console.warn(`${t}. This will throw in a future release.`)}eventSchemas={toolinput:dx,toolinputpartial:fx,toolresult:Cx,toolcancelled:px,hostcontextchanged:Tx};static ONE_SHOT_EVENTS=new Set([`toolinput`,`toolinputpartial`,`toolresult`,`toolcancelled`]);_everHadListener=new Set;_assertHandlerTiming(t){if(!e.ONE_SHOT_EVENTS.has(t)||this._everHadListener.has(t)||(this._everHadListener.add(t),!this._initializedSent))return;let n=`[ext-apps] "${String(t)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(n);console.warn(n)}setEventHandler(e,t){t&&this._assertHandlerTiming(e),this._ensureEventSlot(e),this._events.setHandler(e,t)}addEventListener(e,t){this._assertHandlerTiming(e),this._ensureEventSlot(e),this._events.addEventListener(e,t)}removeEventListener(e,t){this._events.removeEventListener(e,t)}_ensureEventSlot(e){if(this._registeredEvents.has(e))return;let t=this.eventSchemas[e];if(!t)throw Error(`Unknown event: ${String(e)}`);this.setNotificationHandler(t.shape.method.value,{params:t.shape.params},t=>{let n=t;e===`hostcontextchanged`&&(this._hostContext={...this._hostContext,...n}),this._events.dispatch(e,n)}),this._registeredEvents.add(e)}getEventHandler(e){return this._events.getHandler(e)}warnIfRequestHandlerReplaced(e,t,n){t&&n&&console.warn(`[MCP Apps] ${e} handler replaced. Previous handler will no longer be called.`)}constructor(e,t={},n={autoResize:!0}){super(n),this._appInfo=e,this._appCapabilities=t,this.options=n,this._methods.replace(`notifications/cancelled`),this._methods.replace(`notifications/progress`),!n.allowUnsafeEval&&Fo({jitless:!0}),this.replaceRequestHandler(`ping`,e=>(console.log(`Received ping:`,e.params),{})),this.setEventHandler(`hostcontextchanged`,void 0)}buildContext(e){return e}registerAppCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after transport is established`);this._appCapabilities=Ax(this._appCapabilities,e)}registerTool(e,t,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let r=this,i=()=>{r._initializedSent&&r._appCapabilities.tools?.listChanged&&r.sendToolListChanged()},a=t.inputSchema!==void 0,o={title:t.title,description:t.description,inputSchema:t.inputSchema,outputSchema:t.outputSchema,annotations:t.annotations,_meta:t._meta,enabled:!0,enable(){this.enabled=!0,i()},disable(){this.enabled=!1,i()},update(e){Object.assign(this,e),i()},remove(){r._registeredTools[e]===o&&(delete r._registeredTools[e],i())},handler:async(t,r)=>{if(!o.enabled)throw Error(`Tool ${e} is disabled`);let i;if(a){let a=o.inputSchema;i=await n(a?await kx(a,t??{},`Invalid input for tool ${e}: `):t??{},r)}else i=await n(r);return o.outputSchema&&!i.isError&&(i.structuredContent=await kx(o.outputSchema,i.structuredContent,`Invalid output for tool ${e}: `)),i}};return this._registeredTools[e]=o,!this._appCapabilities.tools&&!this.transport&&this.registerAppCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),i(),o}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(e,t)=>{let n=this._registeredTools[e.name];if(!n)throw Error(`Tool ${e.name} not found`);return n.handler(e.arguments,t)},this.onlisttools=async(e,t)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([e,t])=>t.enabled).map(async([e,t])=>{let n={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?await Ox(t.inputSchema,`input`):{type:`object`,properties:{}}};return t.outputSchema&&(n.outputSchema=await Ox(t.outputSchema,`output`)),t.annotations&&(n.annotations=t.annotations),t._meta&&(n._meta=t._meta),n}))}))}async sendToolListChanged(e={}){this._assertInitialized(`sendToolListChanged`),await this.notification({method:`notifications/tools/list_changed`,params:e})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler(`toolinput`)}set ontoolinput(e){this.setEventHandler(`toolinput`,e)}get ontoolinputpartial(){return this.getEventHandler(`toolinputpartial`)}set ontoolinputpartial(e){this.setEventHandler(`toolinputpartial`,e)}get ontoolresult(){return this.getEventHandler(`toolresult`)}set ontoolresult(e){this.setEventHandler(`toolresult`,e)}get ontoolcancelled(){return this.getEventHandler(`toolcancelled`)}set ontoolcancelled(e){this.setEventHandler(`toolcancelled`,e)}get onhostcontextchanged(){return this.getEventHandler(`hostcontextchanged`)}set onhostcontextchanged(e){this.setEventHandler(`hostcontextchanged`,e)}_onteardown;get onteardown(){return this._onteardown}set onteardown(e){this.warnIfRequestHandlerReplaced(`onteardown`,this._onteardown,e),this._onteardown=e,this.replaceRequestHandler(`ui/resource-teardown`,{params:gx.shape.params,result:_x},(e,t)=>{if(!this._onteardown)throw Error(`No onteardown handler set`);return this._onteardown(e,t)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(`oncalltool`,this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(`tools/call`,(e,t)=>{if(!this._oncalltool)throw Error(`No oncalltool handler set`);return this._oncalltool(e.params,t)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(e){this.warnIfRequestHandlerReplaced(`onlisttools`,this._onlisttools,e),this._onlisttools=e,this.replaceRequestHandler(`tools/list`,(e,t)=>{if(!this._onlisttools)throw Error(`No onlisttools handler set`);return this._onlisttools(e.params,t)})}assertCapabilityForMethod(e){if(e===`sampling/createMessage`&&!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${e})`)}assertRequestHandlerCapability(e){switch(e){case`tools/call`:case`tools/list`:if(!this._appCapabilities.tools)throw Error(`Client does not support tool capability (required for ${e})`);return;default:return}}assertNotificationCapability(e){}async callServerTool(e,t){if(this._assertInitialized(`callServerTool`),typeof e==`string`)throw Error(`callServerTool() expects an object as its first argument, but received a string ("${e}"). Did you mean: callServerTool({ name: "${e}", arguments: { ... } })?`);return await this.request({method:`tools/call`,params:e},{onprogress:()=>{},resetTimeoutOnProgress:!0,...t})}async readServerResource(e,t){return this._assertInitialized(`readServerResource`),await this.request({method:`resources/read`,params:e},t)}async listServerResources(e,t){return this._assertInitialized(`listServerResources`),await this.request({method:`resources/list`,params:e},t)}async createSamplingMessage(e,t){return this._assertInitialized(`createSamplingMessage`),await this.request({method:`sampling/createMessage`,params:e},t)}sendMessage(e,t){return this._assertInitialized(`sendMessage`),this.request({method:`ui/message`,params:e},cx,t)}sendLog(e){return this.notification({method:`notifications/message`,params:e})}updateModelContext(e,t){return this._assertInitialized(`updateModelContext`),this.request({method:`ui/update-model-context`,params:e},uh,t)}openLink(e,t){return this._assertInitialized(`openLink`),this.request({method:`ui/open-link`,params:e},ox,t)}sendOpenLink=this.openLink;downloadFile(e,t){return this._assertInitialized(`downloadFile`),this.request({method:`ui/download-file`,params:e},sx,t)}requestTeardown(e={}){return this.notification({method:`ui/notifications/request-teardown`,params:e})}requestDisplayMode(e,t){return this._assertInitialized(`requestDisplayMode`),this.request({method:`ui/request-display-mode`,params:e},xx,t)}sendSizeChanged(e){return this.notification({method:`ui/notifications/size-changed`,params:e})}setupSizeChangedNotifications(){let e=!1,t=0,n=0,r=()=>{e||(e=!0,requestAnimationFrame(()=>{e=!1;let r=document.documentElement,i=r.style.height;r.style.height=`max-content`;let a=Math.ceil(r.getBoundingClientRect().height);r.style.height=i;let o=Math.ceil(window.innerWidth);(o!==t||a!==n)&&(t=o,n=a,this.sendSizeChanged({width:o,height:a}))}))};r();let i=new ResizeObserver(r);return i.observe(document.documentElement),i.observe(document.body),()=>i.disconnect()}async connect(e=new nx(window.parent,window.parent),t){if(this.transport)throw Error(`App is already connected. Call close() before connecting again.`);this._initializedSent=!1;try{await super.connect(e);let n=await this.request({method:`ui/initialize`,params:{appCapabilities:this._appCapabilities,appInfo:this._appInfo,protocolVersion:tx}},Ex,t);if(n===void 0)throw Error(`Server sent invalid initialize result: ${n}`);this._hostCapabilities=n.hostCapabilities,this._hostInfo=n.hostInfo,this._hostContext=n.hostContext,await this.notification({method:`ui/notifications/initialized`}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(e){throw this.close(),e}}},Mx=e((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})),$=e(((e,t)=>{t.exports=Mx()}))();function Nx({className:e=``}){return(0,$.jsxs)(`svg`,{viewBox:`0 0 2500 2500`,className:e,"aria-hidden":`true`,fillRule:`evenodd`,clipRule:`evenodd`,children:[(0,$.jsx)(`path`,{d:`m2499.6 1250c0 690.2-559.6 1249.8-1250.1 1249.9-690 0-1249.6-559.7-1249.5-1250-.2-690.3 559.4-1249.9 1249.7-1249.9s1249.9 559.7 1249.9 1250z`,fill:`#eab300`}),(0,$.jsxs)(`g`,{fill:`#fff`,children:[(0,$.jsx)(`path`,{d:`m1741.5 943.8c-16.1-167.4-160.6-223.5-343.2-239.5v-232.3h-141.3v226.1c-37.1 0-75.1.7-112.8 1.5v-227.6h-141.3l-.1 232.1c-30.6.6-60.7 1.2-90 1.2v-.7l-194.9-.1v151s104.4-2 102.6-.1c57.3 0 75.9 33.2 81.3 61.9v264.6c4 0 9.1.2 14.9 1h-14.9l-.1 370.7c-2.5 18-13.1 46.7-53.1 46.8 1.8 1.6-102.7 0-102.7 0l-28.1 168.8h184c34.2 0 67.9.6 100.9.8l.1 234.9h141.2v-232.4c38.7.8 76.2 1.1 112.9 1.1l-.1 231.3h141.3v-234.4c237.6-13.6 404.1-73.5 424.7-296.7 16.7-179.7-67.8-260-202.7-292.4 82.1-41.6 133.4-115.1 121.4-237.6zm-197.8 502.2c0 175.5-300.5 155.6-396.4 155.6v-311.3c95.9.2 396.4-27.3 396.4 155.7zm-65.8-439.1c0 159.7-250.8 141-330.6 141.1v-282.2c79.9 0 330.7-25.4 330.6 141.1z`}),(0,$.jsx)(`path`,{d:`m902 1175.7h21v15.5h-21z`})]})]})}function Px({children:e,active:t,onNavigate:n,navigation:r=!0}){return(0,$.jsxs)(`div`,{className:r?`local-shell`:`local-shell setup-shell`,children:[(0,$.jsxs)(`header`,{className:`local-header`,children:[(0,$.jsxs)(`div`,{className:`brand-mark`,children:[(0,$.jsx)(Nx,{className:`brand-symbol`}),(0,$.jsx)(`span`,{children:`BSV MCP`})]}),r&&n?(0,$.jsx)(`nav`,{className:`local-nav`,"aria-label":`Local app sections`,children:[`explorer`,`wallet`,`ordinals`,`sweep`].map(e=>(0,$.jsx)(`button`,{type:`button`,className:t===e?`nav-tab active`:`nav-tab`,"aria-current":t===e?`page`:void 0,onClick:()=>n(e),children:e},e))}):null]}),(0,$.jsx)(`main`,{className:`local-content`,children:e}),(0,$.jsxs)(`footer`,{className:`local-footer`,children:[(0,$.jsx)(`span`,{children:`LOCAL PROCESS`}),(0,$.jsx)(`span`,{className:`status-dot`,"aria-hidden":`true`}),(0,$.jsx)(`span`,{children:`PRIVATE BY DEFAULT`})]})]})}function Fx({eyebrow:e,title:t,description:n}){return(0,$.jsxs)(`header`,{className:`page-header`,children:[(0,$.jsxs)(`p`,{className:`eyebrow`,children:[(0,$.jsx)(`span`,{children:`#`}),` `,e]}),(0,$.jsx)(`h1`,{children:t}),n?(0,$.jsx)(`p`,{className:`page-description`,children:n}):null]})}function Ix({children:e,className:t=``}){return(0,$.jsx)(`section`,{className:`surface ${t}`,children:e})}function Lx({children:e,tone:t=`info`}){return(0,$.jsx)(`div`,{className:`notice notice-${t}`,role:t===`error`||t===`warning`?`alert`:`status`,children:e})}function Rx({children:e,type:t=`button`,variant:n=`primary`,disabled:r,onClick:i,"aria-busy":a}){return(0,$.jsx)(`button`,{type:t,className:`button button-${n}`,disabled:r,onClick:i,"aria-busy":a,children:e})}function zx({label:e=`Loading`}){return(0,$.jsxs)(`div`,{className:`spinner-row`,role:`status`,children:[(0,$.jsx)(`span`,{className:`spinner`,"aria-hidden":`true`}),e]})}function Bx({label:e,value:t}){return(0,$.jsxs)(`div`,{className:`data-row`,children:[(0,$.jsx)(`span`,{className:`data-label`,children:e}),(0,$.jsx)(`span`,{className:`data-value`,children:t})]})}function Vx(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function Hx(e){return Array.isArray(e)?e.filter(e=>!!(e&&typeof e==`object`)):[]}function Ux(e,t=8){return e.length<=t*2+3?e:`${e.slice(0,t)}…${e.slice(-t)}`}function Wx(e){return Number(e??0).toLocaleString()}function Gx(){let e=(0,A.useRef)(null),[t,n]=(0,A.useState)(!1),[r,i]=(0,A.useState)();return(0,A.useEffect)(()=>{let t=new jx({name:`BSV MCP`,version:`1.0.0`});return e.current=t,t.ontoolresult=()=>n(!0),t.connect().then(()=>n(!0)).catch(e=>i(String(e))),()=>{e.current=null}},[]),{call:(0,A.useCallback)(async(t,n={})=>{let r=e.current;if(!r)throw Error(`The local app is not connected to its MCP host.`);let i=(await r.callServerTool({name:t,arguments:n}))?.structuredContent;if(!i)throw Error(`The MCP host returned no structured data.`);return Vx(i)},[]),ready:t,error:r}}function Kx(){let{call:e,ready:t,error:n}=Gx(),[r,i]=(0,A.useState)(`explorer`);return n?(0,$.jsx)(Px,{navigation:!1,children:(0,$.jsxs)(Lx,{tone:`error`,children:[`Could not connect to the MCP host: `,n]})}):t?(0,$.jsxs)(Px,{active:r,onNavigate:i,children:[r===`explorer`?(0,$.jsx)(qx,{call:e}):null,r===`wallet`?(0,$.jsx)(Zx,{call:e}):null,r===`ordinals`?(0,$.jsx)(Qx,{call:e}):null,r===`sweep`?(0,$.jsx)(eS,{call:e}):null]}):(0,$.jsx)(Px,{navigation:!1,children:(0,$.jsx)(`div`,{className:`center-state`,children:(0,$.jsx)(zx,{label:`Connecting to MCP host`})})})}function qx({call:e}){let[t,n]=(0,A.useState)(),[r,i]=(0,A.useState)(),[a,o]=(0,A.useState)(``);(0,A.useEffect)(()=>{e(`app_explorer_data`).then(n).catch(e=>i(String(e)))},[e]);async function s(){let t=a.trim();if(t){i(void 0);try{let r=/^[0-9a-f]{64}$/i.test(t)?{txid:t}:t.startsWith(`1`)?{address:t}:{query:t};n(await e(`app_explorer_data`,r))}catch(e){i(String(e))}}}let c=Vx(t?.chainInfo),l=Hx(t?.recentBlocks);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Fx,{eyebrow:`explorer`,title:`Read the chain`,description:`Inspect live network data without leaving your local MCP session.`}),r?(0,$.jsx)(Lx,{tone:`error`,children:r}):null,!t&&!r?(0,$.jsx)(Ix,{children:(0,$.jsx)(`div`,{className:`surface-body`,children:(0,$.jsx)(zx,{label:`Loading explorer data`})})}):null,t?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`grid grid-stats`,children:[(0,$.jsx)(Jx,{label:`Block height`,value:Number(c.blocks??0)?Number(c.blocks).toLocaleString():`—`}),(0,$.jsx)(Jx,{label:`BSV price`,value:typeof t.price==`number`?`$${t.price.toFixed(2)}`:`—`}),(0,$.jsx)(Jx,{label:`Difficulty`,value:Yx(c.difficulty)}),(0,$.jsx)(Jx,{label:`Best block`,value:c.bestblockhash?Ux(String(c.bestblockhash),6):`—`})]}),(0,$.jsxs)(Ix,{className:`stack-surface`,children:[(0,$.jsx)(`div`,{className:`surface-header`,children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`section-label`,children:`lookup`}),(0,$.jsx)(`h2`,{children:`Search BSV`})]})}),(0,$.jsxs)(`div`,{className:`surface-body`,children:[(0,$.jsxs)(`div`,{className:`search-row`,children:[(0,$.jsx)(`input`,{className:`field`,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{e.key===`Enter`&&s()},placeholder:`Transaction ID or address`,"aria-label":`Transaction ID or address`}),(0,$.jsx)(Rx,{onClick:()=>void s(),children:`Search`})]}),(0,$.jsx)(Xx,{data:t,query:a})]})]}),l.length?(0,$.jsxs)(Ix,{className:`stack-surface`,children:[(0,$.jsx)(`div`,{className:`surface-header`,children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`section-label`,children:`network`}),(0,$.jsx)(`h2`,{children:`Recent blocks`})]})}),(0,$.jsxs)(`div`,{className:`table`,children:[(0,$.jsxs)(`div`,{className:`table-row table-head`,children:[(0,$.jsx)(`span`,{children:`Height`}),(0,$.jsx)(`span`,{children:`Hash`}),(0,$.jsx)(`span`,{children:`Txs`}),(0,$.jsx)(`span`,{children:`Size`}),(0,$.jsx)(`span`,{children:`Time`})]}),l.map((e,t)=>(0,$.jsxs)(`div`,{className:`table-row`,children:[(0,$.jsx)(`span`,{className:`mono`,children:Number(e.height??0).toLocaleString()}),(0,$.jsx)(`span`,{className:`mono dim`,children:Ux(String(e.hash??`—`),10)}),(0,$.jsx)(`span`,{className:`dim`,children:Hx(e.tx).length||`—`}),(0,$.jsx)(`span`,{className:`dim`,children:e.size?`${(Number(e.size)/1024).toFixed(1)} KB`:`—`}),(0,$.jsx)(`span`,{className:`dim`,children:e.time?new Date(Number(e.time)*1e3).toLocaleTimeString():`—`})]},String(e.hash??t)))]})]}):null]}):null]})}function Jx({label:e,value:t}){return(0,$.jsxs)(`div`,{className:`stat-card`,children:[(0,$.jsx)(`div`,{className:`stat-label`,children:e}),(0,$.jsx)(`div`,{className:`stat-value`,children:t})]})}function Yx(e){let t=Number(e??0);if(!t)return`—`;for(let[e,n]of[[`PH`,0x38d7ea4c68000],[`TH`,0xe8d4a51000],[`GH`,1e9],[`MH`,1e6]])if(t>=n)return`${(t/n).toFixed(1)} ${e}`;return t.toLocaleString()}function Xx({data:e,query:t}){let n=Vx(e.transaction),r=Vx(e.addressInfo);if(!Object.keys(n).length&&!Object.keys(r).length&&t)return(0,$.jsx)(`div`,{className:`empty`,children:`No results found`});if(Object.keys(n).length)return(0,$.jsxs)(`div`,{className:`data-list`,children:[(0,$.jsx)(Bx,{label:`TXID`,value:(0,$.jsx)(`span`,{className:`mono`,children:String(n.txid??t)})}),(0,$.jsx)(Bx,{label:`Size`,value:`${n.size??`—`} bytes`}),(0,$.jsx)(Bx,{label:`Fee`,value:n.fee==null?`—`:`${Wx(n.fee)} sats`}),(0,$.jsx)(Bx,{label:`Confirmations`,value:String(n.confirmations??`—`)}),(0,$.jsx)(Bx,{label:`Outputs`,value:Hx(n.outputs).length})]});if(Object.keys(r).length){let e=Vx(r.balance);return(0,$.jsxs)(`div`,{className:`data-list`,children:[(0,$.jsx)(Bx,{label:`Address`,value:(0,$.jsx)(`span`,{className:`mono`,children:t})}),(0,$.jsx)(Bx,{label:`Confirmed`,value:`${Wx(e.confirmed)} sats`}),(0,$.jsx)(Bx,{label:`Unconfirmed`,value:`${Wx(e.unconfirmed)} sats`}),(0,$.jsx)(Bx,{label:`Transactions`,value:Hx(r.history).length||`—`})]})}return(0,$.jsx)(`div`,{className:`empty`,children:`Enter a transaction ID or address to search.`})}function Zx({call:e}){let[t,n]=(0,A.useState)(),[r,i]=(0,A.useState)();if((0,A.useEffect)(()=>{e(`app_wallet_data`).then(e=>{if(e.error)throw Error(String(e.error));n(e)}).catch(e=>i(String(e)))},[e]),r)return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Fx,{eyebrow:`wallet`,title:`Wallet`,description:`This session has no unlocked Vault wallet yet.`}),(0,$.jsx)(Lx,{tone:`error`,children:r}),(0,$.jsx)(Ix,{children:(0,$.jsxs)(`div`,{className:`surface-body`,children:[(0,$.jsx)(`p`,{children:`Import an existing key or create a Vault wallet in the local browser.`}),(0,$.jsx)(Rx,{onClick:()=>{e(`wallet_onboarding`).catch(e=>i(String(e)))},children:`Open wallet setup`})]})})]});if(!t)return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Fx,{eyebrow:`wallet`,title:`Wallet`}),(0,$.jsx)(Ix,{children:(0,$.jsx)(`div`,{className:`surface-body`,children:(0,$.jsx)(zx,{label:`Loading wallet data`})})})]});let a=Vx(t.balance),o=Hx(t.utxos),s=Number(a.satoshis??0),c=String(a.bsv??(s/1e8).toFixed(8));return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Fx,{eyebrow:`wallet`,title:`Your local wallet`,description:`Balances and unspent outputs are read from the connected wallet service.`}),(0,$.jsxs)(`div`,{className:`grid grid-three`,children:[(0,$.jsx)(Jx,{label:`Balance`,value:`${c} BSV`}),(0,$.jsx)(Jx,{label:`Satoshis`,value:`${Wx(s)} sats`}),(0,$.jsx)(Jx,{label:`UTXOs`,value:String(a.utxoCount??o.length)})]}),t.address?(0,$.jsxs)(`div`,{className:`address-row`,children:[(0,$.jsx)(`code`,{children:String(t.address)}),(0,$.jsx)(`button`,{className:`copy-button`,type:`button`,onClick:()=>void navigator.clipboard?.writeText(String(t.address)),children:`copy`})]}):null,(0,$.jsxs)(Ix,{className:`stack-surface`,children:[(0,$.jsx)(`div`,{className:`surface-header`,children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`section-label`,children:`outputs`}),(0,$.jsx)(`h2`,{children:`Unspent outputs`})]})}),o.length?(0,$.jsxs)(`div`,{className:`table`,children:[(0,$.jsxs)(`div`,{className:`table-row table-head`,children:[(0,$.jsx)(`span`,{children:`TXID`}),(0,$.jsx)(`span`,{children:`Index`}),(0,$.jsx)(`span`,{children:`Value`})]}),o.slice(0,25).map((e,t)=>(0,$.jsxs)(`div`,{className:`table-row`,children:[(0,$.jsx)(`span`,{className:`mono dim`,children:Ux(String(e.txid??`—`),10)}),(0,$.jsx)(`span`,{className:`mono`,children:String(e.vout??e.outputIndex??`—`)}),(0,$.jsxs)(`span`,{className:`mono`,children:[Wx(e.satoshis),` sats`]})]},`${String(e.txid??t)}-${String(e.vout??e.outputIndex??t)}`))]}):(0,$.jsx)(`div`,{className:`empty`,children:`No UTXOs found.`})]})]})}function Qx({call:e}){let[t,n]=(0,A.useState)(),[r,i]=(0,A.useState)(),[a,o]=(0,A.useState)(``),s=(0,A.useCallback)(async t=>{i(void 0);try{let r=await e(`app_ordinals_data`,t?{query:t}:{});if(r.error)throw Error(String(r.error));n(r)}catch(e){i(String(e))}},[e]);(0,A.useEffect)(()=>{s()},[s]);let c=Hx(t?.listings),l=String(t?.contentBaseUrl??``);return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Fx,{eyebrow:`ordinals`,title:`Inscription collection`,description:`Browse the latest ordinal listings available to this wallet.`}),r?(0,$.jsx)(Lx,{tone:`error`,children:r}):null,(0,$.jsx)(Ix,{children:(0,$.jsxs)(`div`,{className:`surface-body`,children:[(0,$.jsxs)(`div`,{className:`search-row`,children:[(0,$.jsx)(`input`,{className:`field`,value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{e.key===`Enter`&&s(a.trim()||void 0)},placeholder:`Search listings`,"aria-label":`Search listings`}),(0,$.jsx)(Rx,{onClick:()=>void s(a.trim()||void 0),children:`Search`})]}),!t&&!r?(0,$.jsx)(zx,{label:`Loading listings`}):null]})}),t?(0,$.jsx)(`div`,{className:`grid grid-three stack-grid`,children:c.length?c.map((e,t)=>(0,$.jsx)($x,{item:e,base:l},`${String(e.outpoint??t)}`)):(0,$.jsx)(`div`,{className:`empty`,children:`No listings found.`})}):null]})}function $x({item:e,base:t}){let n=Vx(Vx(e.data).ordlock),r=String(n.content_type??``),i=String(n.origin??e.outpoint??``),a=r.startsWith(`image/`)&&/^https?:\/\//.test(t);return(0,$.jsxs)(`article`,{className:`ordinal-card`,title:String(e.outpoint??``),children:[(0,$.jsx)(`div`,{className:`ordinal-image`,children:a?(0,$.jsx)(`img`,{src:`${t}/${encodeURIComponent(i)}`,alt:`Inscription preview`,loading:`lazy`}):(0,$.jsx)(`span`,{children:r?r.split(`/`)[1]:`?`})}),(0,$.jsxs)(`div`,{className:`ordinal-info`,children:[(0,$.jsx)(`div`,{className:`ordinal-name`,children:String(n.name??Ux(String(e.outpoint??`inscription`),10))}),(0,$.jsxs)(`div`,{className:`ordinal-meta`,children:[(0,$.jsx)(`span`,{children:r?r.split(`/`)[0]:`unknown`}),n.price==null?null:(0,$.jsxs)(`span`,{children:[Wx(n.price),` sats`]})]})]})]})}function eS({call:e}){let[t,n]=(0,A.useState)(``),r=(0,A.useRef)(``),[i,a]=(0,A.useState)(``),[o,s]=(0,A.useState)(),[c,l]=(0,A.useState)(new Set),[u,d]=(0,A.useState)([]),[f,p]=(0,A.useState)(`input`),[m,h]=(0,A.useState)(),g=(0,A.useMemo)(()=>{if(!o)return[];let e=[],t=Hx(o.funding),n=Hx(o.ordinals);t.length&&e.push({type:`bsv`,name:`BSV funding`,detail:`${t.length} UTXOs`,value:`${(Number(o.totalFundingSats??0)/1e8).toFixed(8)} BSV`,inputs:t}),n.length&&e.push({type:`ordinals`,name:`Ordinals`,detail:`${n.length} inscriptions`,value:`${n.length} NFTs`,inputs:n});for(let t of Hx(o.bsv21Tokens)){let n=String(t.tokenId??``),r=Hx(t.inputs);e.push({type:`bsv21:${n}`,name:`${String(t.symbol??Ux(n,6))} token`,detail:`${r.length} UTXOs`,value:String(t.totalAmount??`0`),inputs:r})}return e},[o]);async function _(){h(void 0);let i=t.trim();try{let t=(/^[0-9a-f]{64}$/i.test(i)?new kr(i,16):kr.fromWif(i)).toPublicKey().toAddress();r.current=i,n(``),a(t),p(`scanning`);let o=await e(`app_sweep_scan`,{address:t});if(o.error)throw Error(String(o.error));s(o),l(new Set(tS(o))),p(`review`)}catch(e){r.current=``,n(``),h(e instanceof Error?e.message:String(e)),p(`error`)}}async function v(){if(!o||!c.size||!r.current)return;p(`working`),h(void 0);let t=[];try{for(let n of g.filter(e=>c.has(e.type))){let i=await e(`app_sweep_prepare`,{sweepType:n.type===`bsv`?`bsv`:n.type===`ordinals`?`ordinals`:`bsv21`,inputs:n.inputs.map(e=>({outpoint:e.outpoint,satoshis:e.satoshis,lockingScript:e.lockingScript}))});if(i.error)throw Error(String(i.error));let a=/^[0-9a-f]{64}$/i.test(r.current)?new kr(r.current,16):kr.fromWif(r.current),o=ua.fromBEEF(tn(String(i.txHex),`hex`)),s=new Set(Hx(i.inputsToSign).map(e=>`${String(e.outpoint).replace(`_`,`.`)}`));for(let e of o.inputs)s.has(`${e.sourceTXID}.${e.sourceOutputIndex}`)&&(e.unlockingScriptTemplate=new Ei().unlock(a,`all`,!0));await o.sign();let c={};o.inputs.forEach((e,t)=>{s.has(`${e.sourceTXID}.${e.sourceOutputIndex}`)&&(c[String(t)]={unlockingScript:e.unlockingScript?.toHex()??``})});let l=await e(`app_sweep_complete`,{reference:i.reference,spends:c});if(l.error)throw Error(String(l.error));t.push({type:n.name,txid:String(l.txid??``)})}r.current=``,d(t),p(`complete`)}catch(e){r.current=``,h(e instanceof Error?e.message:String(e)),p(`error`)}}function y(){r.current=``,n(``),a(``),s(void 0),l(new Set),d([]),h(void 0),p(`input`)}return(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Fx,{eyebrow:`sweep`,title:`Import funds`,description:`Scan a key locally, choose the assets to move, and sign in this browser tab.`}),m?(0,$.jsx)(Lx,{tone:`error`,children:m}):null,(0,$.jsxs)(Ix,{children:[(0,$.jsx)(`div`,{className:`surface-header`,children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`section-label`,children:f===`review`?`review`:f===`complete`?`complete`:`private key`}),(0,$.jsx)(`h2`,{children:f===`review`?`Assets at ${Ux(i,8)}`:f===`complete`?`Sweep complete`:`Sweep assets into your wallet`})]})}),(0,$.jsxs)(`div`,{className:`surface-body`,children:[f===`input`||f===`error`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`label`,{className:`field-label`,htmlFor:`sweep-key`,children:[`WIF or 64-character hex`,(0,$.jsx)(`input`,{id:`sweep-key`,className:`field`,type:`password`,value:t,onChange:e=>n(e.target.value),onKeyDown:e=>{e.key===`Enter`&&_()},autoComplete:`new-password`,spellCheck:!1})]}),(0,$.jsx)(`p`,{className:`dim`,children:`The key is used only in this tab and cleared after scanning or sweeping.`}),(0,$.jsx)(`div`,{className:`form-actions`,children:(0,$.jsx)(Rx,{onClick:()=>void _(),disabled:!t.trim(),children:`Scan address`})})]}):null,f===`scanning`||f===`working`?(0,$.jsx)(zx,{label:f===`scanning`?`Scanning ${Ux(i,8)}…`:`Signing and broadcasting selected assets…`}):null,f===`review`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`role-grid`,children:g.length?g.map(e=>(0,$.jsx)(`button`,{type:`button`,className:c.has(e.type)?`asset-card asset-selected`:`asset-card`,onClick:()=>l(t=>{let n=new Set(t);return n.has(e.type)?n.delete(e.type):n.add(e.type),n}),children:(0,$.jsxs)(`div`,{className:`asset-info`,children:[(0,$.jsxs)(`div`,{className:`asset-name`,children:[c.has(e.type)?`✓ `:``,e.name]}),(0,$.jsxs)(`div`,{className:`ordinal-meta`,children:[(0,$.jsx)(`span`,{children:e.detail}),(0,$.jsx)(`span`,{children:e.value})]})]})},e.type)):(0,$.jsx)(`div`,{className:`empty`,children:`No assets found at this address.`})}),(0,$.jsxs)(`div`,{className:`form-actions`,children:[(0,$.jsx)(Rx,{variant:`secondary`,onClick:y,children:`Back`}),(0,$.jsx)(Rx,{onClick:()=>void v(),disabled:!c.size,children:`Sweep selected`})]})]}):null,f===`complete`?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`div`,{className:`data-list`,children:u.map(e=>(0,$.jsx)(Bx,{label:String(e.type),value:(0,$.jsx)(`span`,{className:`mono`,children:Ux(String(e.txid),12)})},`${String(e.type)}:${String(e.txid)}`))}),(0,$.jsx)(`div`,{className:`form-actions`,children:(0,$.jsx)(Rx,{onClick:y,children:`Sweep another key`})})]}):null]})]})]})}function tS(e){let t=[];Hx(e.funding).length&&t.push(`bsv`),Hx(e.ordinals).length&&t.push(`ordinals`);for(let n of Hx(e.bsv21Tokens))t.push(`bsv21:${String(n.tokenId??``)}`);return t}var nS=s();function rS(e,t,n){let r=Math.abs(n)*Math.PI/180;return{width:e*Math.cos(r)+t*Math.sin(r)+12,height:t*Math.cos(r)+e*Math.sin(r)+12}}function iS(e,t){return Math.abs(e.x-t.x)*2<e.width+t.width&&Math.abs(e.y-t.y)*2<e.height+t.height}function aS(e,t,n,r,i){for(let a=0;a<2800;a++){let o=a*2.399963+i,s=Math.sqrt(a/2800)*.52,c={x:e*(.5+Math.cos(o)*s),y:t*(.5+Math.sin(o)*s),...n};if(!(c.x-n.width/2<8||c.x+n.width/2>e-8||c.y-n.height/2<8||c.y+n.height/2>t-8)&&!r.some(e=>iS(c,e)))return c}}function oS(e){if(e.title)return e.title;let t=e.name.replace(/^[^_]+_/,``).replace(/_/g,` `).replace(/([a-z])([A-Z])/g,`$1 $2`).toLowerCase();return(t.charAt(0).toUpperCase()+t.slice(1)).replace(/\b(bsv|bap|mnee|utxo|utxos)\b/gi,e=>e.toUpperCase())}function sS(e,t,n,r,i){let a=document.createElement(`canvas`).getContext(`2d`);if(!a)return;let o=oS(e).split(` `),s=o.length>1&&oS(e).length>10?[o.slice(0,Math.ceil(o.length/2)).join(` `),o.slice(Math.ceil(o.length/2)).join(` `)]:[oS(e)],c=Math.min(t/760,n/600,1.25),l=[0,-7,5,-3,8,0,-5,4][i%8];for(let o of[1,.85,.7]){let u=Math.max(15,[100,66,52,58,43,48,36,42,32,38,30,34][i%12]*c*o);a.font=`${u}px "Geist Pixel Line"`;let d=aS(t,n,rS(Math.max(...s.map(e=>a.measureText(e).width)),s.length*u*1.03,l),r,i*1.37);if(d)return{...d,tool:e,lines:s,size:u,angle:l}}}function cS({tools:e}){let t=(0,A.useRef)(null),[n,r]=(0,A.useState)([]),[i,a]=(0,A.useState)(),[o,s]=(0,A.useState)(!1),c=(0,A.useRef)({width:0,height:0}),l=(0,A.useRef)(0);return(0,A.useLayoutEffect)(()=>{let n=t.current;if(!n)return;let i=()=>{let t=n.clientWidth,i=n.clientHeight;if(t===c.current.width&&i===c.current.height)return;c.current={width:t,height:i};let o=[],s=[...e??[]].sort((e,t)=>Number(/^send bsv$/i.test(oS(t)))-Number(/^send bsv$/i.test(oS(e))));for(let e of s){let n=sS(e,t,i,o,o.length);if(n&&o.push(n),o.length===12)break}r(o),a(void 0)};c.current={width:0,height:0};let o=!1,s=new ResizeObserver(i);return document.fonts.load(`30px "Geist Pixel Line"`).catch(()=>[]).then(()=>{o||(i(),s.observe(n))}),()=>{o=!0,s.disconnect()}},[e]),(0,A.useEffect)(()=>{if(o||!e?.length)return;let t,n=setInterval(()=>{document.hidden||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||(r(e=>{if(e.length<2)return e;let t=1+Math.floor(Math.random()*(e.length-1));return e.map((e,n)=>({...e,exiting:n===t||l.current%3==2&&n===t+1}))}),t=setTimeout(()=>{r(t=>{let n=t.filter(e=>e.exiting).map(e=>e.tool.name),r=t.filter(e=>!e.exiting),i=e.filter(e=>!r.some(t=>t.tool.name===e.name)&&!n.includes(e.name)).sort(()=>Math.random()-.5);for(let e of i){let t=sS(e,c.current.width,c.current.height,r,1+l.current++%11);if(t&&r.push(t),r.length>=12)break}return r})},650))},3200);return()=>{clearInterval(n),clearTimeout(t),r(e=>e.map(e=>({...e,exiting:!1})))}},[e,o]),(0,$.jsxs)(`section`,{className:`tool-cloud-section`,"aria-label":`Explore your wallet tools`,children:[(0,$.jsxs)(`svg`,{className:`cloud-orbits`,viewBox:`0 0 760 650`,fill:`none`,"aria-hidden":`true`,children:[(0,$.jsx)(`ellipse`,{cx:`380`,cy:`325`,rx:`365`,ry:`220`,transform:`rotate(-16 380 325)`}),(0,$.jsx)(`ellipse`,{cx:`380`,cy:`325`,rx:`365`,ry:`170`,transform:`rotate(22 380 325)`}),(0,$.jsx)(`circle`,{cx:`110`,cy:`160`,r:`4`}),(0,$.jsx)(`circle`,{cx:`660`,cy:`450`,r:`6`}),(0,$.jsx)(`circle`,{cx:`230`,cy:`570`,r:`3`})]}),(0,$.jsx)(`ul`,{ref:t,className:`tool-cloud`,"aria-label":`Available MCP tools`,onMouseEnter:()=>s(!0),onMouseLeave:e=>{e.currentTarget.contains(document.activeElement)||(s(!1),a(void 0))},onFocus:()=>s(!0),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(s(!1),a(void 0))},onKeyDown:e=>{e.key===`Escape`&&a(void 0)},children:n.map(e=>(0,$.jsx)(`li`,{className:e.exiting?`is-fading`:``,style:{left:e.x,top:e.y},children:(0,$.jsx)(`button`,{type:`button`,className:`tool-cloud-word tool-cloud-weight-${Math.round(e.size)%5}`,style:{fontSize:e.size,transform:`rotate(${e.angle}deg)`},"aria-describedby":i?.tool.name===e.tool.name?`tool-cloud-popover`:void 0,onMouseEnter:t=>a({tool:e.tool,rect:t.currentTarget.getBoundingClientRect()}),onMouseLeave:()=>a(void 0),onFocus:t=>a({tool:e.tool,rect:t.currentTarget.getBoundingClientRect()}),onClick:t=>a({tool:e.tool,rect:t.currentTarget.getBoundingClientRect()}),children:e.lines.map(e=>(0,$.jsx)(`span`,{children:e},e))})},e.tool.name))}),i&&(0,nS.createPortal)((0,$.jsxs)(`div`,{id:`tool-cloud-popover`,role:`tooltip`,className:`tool-cloud-popover`,style:{left:Math.max(12,Math.min(window.innerWidth-292,i.rect.left+i.rect.width/2-140)),...i.rect.top>window.innerHeight/2?{bottom:window.innerHeight-i.rect.top+12}:{top:i.rect.bottom+12}},children:[(0,$.jsx)(`strong`,{children:oS(i.tool)}),(0,$.jsx)(`code`,{children:i.tool.name}),(0,$.jsx)(`p`,{children:i.tool.description||`Available in your MCP client.`})]}),document.body)]})}function lS({tools:e}){return(0,$.jsxs)(`div`,{className:`wallet-ready`,children:[(0,$.jsxs)(`div`,{className:`ready-copy`,children:[(0,$.jsx)(`span`,{className:`ready-check`,"aria-hidden":`true`,children:`✓`}),(0,$.jsx)(`p`,{className:`ready-eyebrow`,children:`Setup complete`}),(0,$.jsxs)(`h1`,{children:[`Your wallet.`,(0,$.jsx)(`br`,{}),`Ready for anything.`]}),(0,$.jsxs)(`p`,{className:`ready-description`,children:[`Your keys are encrypted in your local Vault.`,(0,$.jsx)(`br`,{}),`Return to your MCP client to get started.`]})]}),(0,$.jsx)(cS,{tools:e})]})}function uS(e){if(e.length===0)return`Enter a Vault password.`;if(e.length<12)return`Use at least 12 characters.`;if(/^\s+$/u.test(e))return`The password cannot be only spaces.`;let t=[/[a-z]/u.test(e),/[A-Z]/u.test(e),/[0-9]/u.test(e),/[^A-Za-z0-9]/u.test(e)].filter(Boolean).length;if(e.length<16&&t<3)return`Use at least 16 characters, or mix upper, lower, and digits.`}function dS(e){if(e.location===`mcp-client`)return{title:e.serverName||e.account,origin:`Saved in ${e.client??`an MCP client`}`,detail:`A payment key is still in that client’s MCP config. Import it into Vault, then remove the key from the client config.`};if(e.location===`environment`)return{title:`MCP environment payment key`,origin:`Current MCP server environment`,detail:`A payment key is in the server environment. Import it into Vault and remove PRIVATE_KEY_WIF from the client config.`};let t=e.location===`legacy-root`?`Earlier BSV MCP wallet`:e.location===`account`?`BSV MCP account`:`Configured wallet`;return{title:e.account,origin:t,detail:e.encryptedBackup?`An encrypted key backup was found. You’ll need its password.`:e.plaintextKeys?`An unencrypted ${e.keyFile??`key`} file was found. Importing will add an encrypted copy to Vault.`:`Wallet data was found, but no key backup. This source cannot be imported on its own.`}}function fS({token:e,onWelcome:t,onUnlock:n,standalone:r=!1}){let[i,a]=(0,A.useState)([]),[o,s]=(0,A.useState)(),[c,l]=(0,A.useState)(),[u,d]=(0,A.useState)(),[f,p]=(0,A.useState)(`imported-wallet`),[m,h]=(0,A.useState)(``),[g,_]=(0,A.useState)(``),[v,y]=(0,A.useState)(``),[b,ee]=(0,A.useState)(!1),[te,x]=(0,A.useState)(!0),[ne,S]=(0,A.useState)(!1),[re,C]=(0,A.useState)(!1),[ie,ae]=(0,A.useState)(``),[oe,se]=(0,A.useState)(0),[ce,le]=(0,A.useState)(``),[ue,de]=(0,A.useState)();(0,A.useEffect)(()=>{e&&fetch(`/api/inventory?revision=${oe}`,{headers:{Authorization:`Bearer ${e}`}}).then(async e=>{if(!e.ok)throw Error(`Could not inspect your wallets. Reopen setup and try again.`);return e.json()}).then(e=>{let t=e.boundAccounts??[];a(t),s((e.sources??[]).filter(e=>e.location!==`account`||!t.some(t=>t.name===e.account)))}).catch(e=>le(e.message))},[e,oe]);function fe(){l(void 0),d(void 0),ee(!1),h(``),_(``),y(``),le(``)}async function pe(t){if(t.preventDefault(),ne||!b||!c&&!u)return;let n=uS(g);if(n){le(n);return}if(g!==v){le(`The Vault passwords don’t match.`);return}if(u&&u.size>1048576){le(`Choose a key backup smaller than 1 MB.`);return}S(!0),le(``);try{let t=await fetch(`/api/embedded/import`,{method:`POST`,headers:{Authorization:`Bearer ${e}`,"Content-Type":`application/json`},body:JSON.stringify({source:c,accountName:f,activate:!1,sourcePassphrase:m,destinationPassphrase:g,passwordConfirmation:v,confirmation:`IMPORT_WALLET_CONFIRMED`,eraseSources:te,...u?{backupText:await u.text(),backupName:u.name}:{}})}),n=await t.json();if(!t.ok)throw Error(n.error||`The wallet could not be imported.`);if(n.saved===!0&&n.ready===!1){fe(),ae(n.accountName),se(e=>e+1);return}if(n.ready!==!0)throw Error(`The wallet was saved, but could not be activated. Reopen setup to unlock it.`);h(``),_(``),y(``),de(n.tools),C(!0)}catch(e){le(e instanceof Error?e.message:`The wallet could not be imported.`)}finally{S(!1)}}return re&&!r?(0,$.jsx)(Px,{navigation:!1,children:(0,$.jsx)(lS,{tools:ue})}):(0,$.jsxs)(Px,{navigation:!1,children:[(0,$.jsx)(Fx,{eyebrow:`Existing wallet`,title:re?r?`Your wallet is saved`:`Your wallet is ready`:`Bring your wallet with you`,description:re?r?`Your keys are protected in your local Vault.`:`Your keys are protected in your local Vault and your wallet is available in this session.`:`Choose a wallet found on this computer, or browse for a key backup.`}),ce&&(0,$.jsx)(Lx,{tone:`error`,children:ce}),ie&&(0,$.jsxs)(Lx,{tone:`success`,children:[ie,` is saved in your Vault. Import another wallet below, or choose your default keys to continue.`]}),re?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Lx,{tone:`success`,children:r?`Open wallet setup in your MCP client to unlock and use your saved wallet.`:`Return to your MCP client to use your wallet.`}),!r&&(0,$.jsx)(cS,{tools:ue})]}):!c&&!u?(0,$.jsx)(Ix,{children:(0,$.jsxs)(`div`,{className:`surface-body`,children:[(0,$.jsx)(`h2`,{children:`Choose your wallet`}),i.map(e=>(0,$.jsxs)(`button`,{className:`setup-choice wallet-source-choice`,type:`button`,onClick:()=>n(e.name),children:[(0,$.jsx)(`strong`,{children:e.name}),(0,$.jsx)(`span`,{children:`Saved in your Vault · choose default keys`})]},e.name)),o===void 0?(0,$.jsx)(`p`,{children:`Looking for local wallets…`}):o.length===0?(0,$.jsx)(`p`,{children:`No additional local wallets were found. You can choose a backup below.`}):o.map(e=>{let t=dS(e);return(0,$.jsxs)(`button`,{type:`button`,className:`setup-choice wallet-source-choice`,onClick:()=>{l(e),p(e.account),le(``)},children:[(0,$.jsx)(`strong`,{children:t.title}),(0,$.jsx)(`span`,{children:t.origin}),(0,$.jsx)(`span`,{children:t.detail}),(e.configPath||e.directory)&&(0,$.jsx)(`span`,{children:e.configPath||e.directory})]},`${e.location}:${e.account}`)}),(0,$.jsxs)(`label`,{className:`field-label`,children:[`Browse for a key backup`,(0,$.jsx)(`input`,{className:`field`,type:`file`,disabled:ne,accept:`.bep,.json`,onChange:e=>{d(e.target.files?.[0]),l(void 0),le(``)}})]}),(0,$.jsx)(Rx,{variant:`secondary`,onClick:t,children:`Back`})]})}):(0,$.jsx)(Ix,{children:(0,$.jsxs)(`div`,{className:`surface-body`,children:[(0,$.jsx)(`h2`,{children:`Protect and import`}),(0,$.jsx)(`p`,{children:u?.name||c?.account}),c&&!c.encryptedBackup&&!c.plaintextKeys&&(0,$.jsx)(Lx,{children:`These databases contain wallet records. Select the matching key backup to recover signing access.`}),(0,$.jsxs)(`form`,{className:`stack-surface`,onSubmit:pe,children:[c&&!c.encryptedBackup&&!c.plaintextKeys&&(0,$.jsxs)(`label`,{className:`field-label`,children:[`Matching key backup`,(0,$.jsx)(`input`,{className:`field`,required:!0,type:`file`,disabled:ne,accept:`.bep,.json`,onChange:e=>d(e.target.files?.[0])})]}),(0,$.jsxs)(`label`,{className:`field-label`,children:[`Wallet name`,(0,$.jsx)(`input`,{className:`field`,required:!0,value:f,onChange:e=>p(e.target.value),disabled:ne||!!c})]}),(0,$.jsxs)(`label`,{className:`field-label`,children:[`Backup password, if encrypted`,(0,$.jsx)(`input`,{className:`field`,type:`password`,autoComplete:`off`,value:m,onChange:e=>h(e.target.value),disabled:ne})]}),(0,$.jsxs)(`label`,{className:`field-label`,children:[`Vault password`,(0,$.jsx)(`input`,{className:`field`,required:!0,type:`password`,autoComplete:`new-password`,minLength:8,value:g,onChange:e=>_(e.target.value),disabled:ne})]}),(0,$.jsx)(`p`,{children:`Use your existing Vault password, or choose one if this is your first wallet.`}),(0,$.jsxs)(`label`,{className:`field-label`,children:[`Confirm Vault password`,(0,$.jsx)(`input`,{className:`field`,required:!0,type:`password`,autoComplete:`new-password`,value:v,onChange:e=>y(e.target.value),disabled:ne})]}),(0,$.jsxs)(`label`,{className:`checkbox-field`,children:[(0,$.jsx)(`input`,{required:!0,type:`checkbox`,checked:b,onChange:e=>ee(e.target.checked),disabled:ne}),` `,`Import this wallet into my local encrypted Vault.`]}),c?.plaintextKeys||c?.location===`mcp-client`?(0,$.jsxs)(`label`,{className:`checkbox-field`,children:[(0,$.jsx)(`input`,{type:`checkbox`,checked:te,onChange:e=>x(e.target.checked),disabled:ne}),` `,`After import, overwrite and remove the plaintext copy that was imported. This cannot erase SSD snapshots or other backups.`]}):null,(0,$.jsxs)(`div`,{className:`form-actions`,children:[(0,$.jsx)(Rx,{variant:`secondary`,type:`button`,onClick:fe,disabled:ne,children:`Back`}),(0,$.jsx)(Rx,{type:`submit`,disabled:ne||!b,children:ne?`Importing…`:`Import wallet`})]})]})]})})]})}function pS({token:e,onLinked:t}){let[n,r]=(0,A.useState)(``),[i,a]=(0,A.useState)(),[o,s]=(0,A.useState)(``),[c,l]=(0,A.useState)(`vault-key`),[u,d]=(0,A.useState)(``),[f,p]=(0,A.useState)(!1);async function m(){if(!f){p(!0),d(``);try{let l=i?.keys.find(e=>e.entryId===o);if(i&&!l)throw Error(`Choose a private key.`);let u=await fetch(i?`/api/embedded/link-key`:`/api/embedded/vault-keys`,{method:`POST`,headers:{Authorization:`Bearer ${e}`,"Content-Type":`application/json`},body:JSON.stringify(i?{password:n,accountName:c,vaultId:i.vaultId,entryId:l?.entryId,publicKey:l?.publicKey}:{password:n})}),d=await u.json();if(!u.ok)throw Error(d.error||`Could not open the Vault.`);i?(r(``),a(void 0),t()):(a(d),s(d.keys[0]?.entryId??``))}catch(e){d(e instanceof Error?e.message:`Could not use this key.`)}finally{p(!1)}}}return(0,$.jsx)(Ix,{children:(0,$.jsxs)(`div`,{className:`surface-body`,children:[(0,$.jsx)(`h2`,{children:`Use a key already in your Vault`}),(0,$.jsx)(`p`,{children:`Link an existing private key to a new wallet account, then assign it to a role. This does not import another wallet’s transaction history.`}),u&&(0,$.jsx)(Lx,{tone:`error`,children:u}),i?(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`label`,{className:`field-label`,children:[`Private key`,(0,$.jsx)(`select`,{className:`field`,value:o,onChange:e=>s(e.target.value),disabled:f,children:i.keys.map(e=>(0,$.jsxs)(`option`,{value:e.entryId,children:[e.label,` · `,e.publicKey.slice(-8)]},e.entryId))})]}),!i.keys.length&&(0,$.jsx)(Lx,{children:`No compatible private keys found. HD roots and non-key entries cannot be used directly.`}),(0,$.jsxs)(`label`,{className:`field-label`,children:[`Account name`,(0,$.jsx)(`input`,{className:`field`,value:c,onChange:e=>l(e.target.value),disabled:f})]})]}):(0,$.jsxs)(`label`,{className:`field-label`,children:[`Vault password`,(0,$.jsx)(`input`,{className:`field`,type:`password`,autoComplete:`off`,value:n,onChange:e=>r(e.target.value),disabled:f})]}),(0,$.jsx)(`div`,{className:`form-actions`,children:(0,$.jsx)(Rx,{onClick:m,disabled:f||!n||!!i&&!o,children:f?`Please wait…`:i?`Link selected key`:`Show Vault keys`})})]})})}var mS=[{id:`payments`,label:`Payment key`},{id:`identity`,label:`Identity key`},{id:`ordinals`,label:`Ordinals key`}];function hS({token:e,onBack:t,onUnlock:n}){let[r,i]=(0,A.useState)(),[a,o]=(0,A.useState)({}),[s,c]=(0,A.useState)(``),[l,u]=(0,A.useState)(!1),[d,f]=(0,A.useState)(!1),[p,m]=(0,A.useState)(0);(0,A.useEffect)(()=>{fetch(`/api/embedded/roles`,{headers:{Authorization:`Bearer ${e}`}}).then(async e=>{if(!e.ok)throw Error(`Could not load key settings.`);let t=await e.json();i(t),o({payments:t.defaults.payments??t.keys[0]?.selector??null,identity:t.defaults.identity===void 0?void 0:t.defaults.identity,ordinals:t.defaults.ordinals===void 0?void 0:t.defaults.ordinals})}).catch(e=>c(e.message))},[e,p]);async function h(){if(r&&!l){u(!0),c(``);try{let t=await fetch(`/api/embedded/roles`,{method:`POST`,headers:{Authorization:`Bearer ${e}`,"Content-Type":`application/json`},body:JSON.stringify({defaults:a,revision:r.revision})});if(!t.ok)throw Error(`Could not save key settings. Reload and try again.`);let o=await t.json();if(i(o),!o.effective.payments)throw Error(`Select a payment key to continue.`);n(o.effective.payments.split(`:`)[0])}catch(e){c(e instanceof Error?e.message:`Could not save settings.`)}finally{u(!1)}}}return(0,$.jsxs)(Px,{navigation:!1,children:[(0,$.jsx)(Fx,{eyebrow:`Your Vault`,title:`Choose your default keys`,description:`Keep all your keys in one Vault. Choose which key each role uses; project MCP settings can override individual roles.`}),s&&(0,$.jsx)(Lx,{tone:`error`,children:s}),d?(0,$.jsx)(pS,{token:e,onLinked:()=>{f(!1),m(e=>e+1)}}):(0,$.jsx)(Rx,{variant:`secondary`,onClick:()=>f(!0),children:`Choose another key from Vault`}),(0,$.jsx)(Ix,{children:(0,$.jsxs)(`div`,{className:`surface-body`,children:[(0,$.jsx)(`p`,{children:`Import several wallets before unlocking. Choosing a default does not move keys or funds.`}),mS.map(e=>(0,$.jsxs)(`label`,{className:`field-label`,children:[e.label,(0,$.jsxs)(`select`,{className:`field`,value:a[e.id]===void 0?`inherit`:a[e.id]??``,disabled:!r||l,onChange:t=>o({...a,[e.id]:t.target.value===`inherit`?void 0:t.target.value||null}),children:[e.id!==`payments`&&(0,$.jsx)(`option`,{value:`inherit`,children:`Use payment key`}),(0,$.jsx)(`option`,{value:``,children:e.id===`payments`?`Choose a key`:`Disabled`}),r?.keys.map(e=>(0,$.jsxs)(`option`,{value:e.selector,children:[e.selector,` · `,e.publicKey.slice(-8)]},e.selector))]}),r?.overrides.includes(e.id)&&(0,$.jsxs)(`span`,{className:`source-detail`,children:[`Project configuration overrides this role:`,` `,r.effective[e.id]??`disabled`,`.`]})]},e.id)),(0,$.jsxs)(`div`,{className:`form-actions`,children:[(0,$.jsx)(Rx,{variant:`secondary`,onClick:t,disabled:l,children:`Import more wallets`}),(0,$.jsx)(Rx,{onClick:h,disabled:!r||l,children:`Save defaults and unlock`})]})]})})]})}function gS({token:e,standalone:t=!1}){let[n,r]=(0,A.useState)(`welcome`),[i,a]=(0,A.useState)([]),[o,s]=(0,A.useState)(`default`),[c,l]=(0,A.useState)(``),[u,d]=(0,A.useState)(``),[f,p]=(0,A.useState)(!1),[m,h]=(0,A.useState)(``),[g,_]=(0,A.useState)(),[v,y]=(0,A.useState)(!1),[b,ee]=(0,A.useState)(!1),[te,x]=(0,A.useState)(!1);(0,A.useEffect)(()=>{e&&fetch(`/api/inventory`,{headers:{Authorization:`Bearer ${e}`}}).then(e=>e.ok?e.json():void 0).then(e=>{e?.sources?.length&&s(`new-wallet`),a(e?.boundAccounts??[]),y(e?.vaultExists===!0),x(Array.isArray(e?.sources)&&e.sources.some(e=>e.location===`mcp-client`||e.location===`environment`))}).catch(()=>{})},[e]);function ne(e){f||b||(r(e),window.history.pushState({view:e},``,`/setup/source?mode=migration&view=${e}`))}(0,A.useEffect)(()=>{let e=()=>{if(f||b){window.history.replaceState({view:n},``,`/setup/source?mode=migration&view=${n}`);return}let e=window.history.state?.view;r(e===`create`||e===`existing`||e===`unlock`||e===`roles`?e:`welcome`),l(``),d(``),h(``)};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[f,b,n]);function S(){l(``),d(``),h(``),ne(`welcome`)}async function re(t){if(t.preventDefault(),!f){if(n===`unlock`){if(!c){h(`Enter your Vault password.`);return}}else{let e=uS(c);if(e){h(e);return}}if(n!==`unlock`&&c!==u){h(`The passwords don’t match. Try again.`);return}p(!0),h(``);try{let t=await fetch(n===`unlock`?`/api/embedded/unlock`:`/api/embedded/create`,{method:`POST`,headers:{Authorization:`Bearer ${e}`,"Content-Type":`application/json`},body:JSON.stringify({accountName:o,activate:!1,password:c,passwordConfirmation:u,confirmation:`CREATE_NEW_CONFIRMED`})}),i=await t.json();if(!t.ok)throw Error(i.error||`Your wallet could not be created. Please try again.`);if(l(``),d(``),i.saved===!0){r(`roles`),window.history.pushState({view:`roles`},``,`/setup/source?mode=migration&view=roles`);return}if(i.ready!==!0)throw Error(`Your wallet was saved, but could not be activated. Reopen setup to unlock it.`);_(i.tools),ee(!0)}catch(e){h(e instanceof Error?e.message:`Your wallet could not be created.`)}finally{p(!1)}}}return e?n===`roles`?(0,$.jsx)(hS,{token:e,onBack:()=>ne(`existing`),onUnlock:e=>{s(e),ne(`unlock`)}}):n===`existing`?(0,$.jsx)(fS,{token:e,standalone:t,onWelcome:S,onUnlock:()=>ne(`roles`)}):b&&!t?(0,$.jsx)(Px,{navigation:!1,children:(0,$.jsx)(lS,{tools:g})}):(0,$.jsxs)(Px,{navigation:!1,children:[(0,$.jsx)(Fx,{eyebrow:b?`Wallet saved`:n===`welcome`?`Welcome`:n===`unlock`?`Saved wallet`:`New wallet`,title:b?t?`Your wallet is saved`:`Your wallet is ready`:n===`welcome`?`Your wallet starts here`:n===`unlock`?`Unlock your wallet`:`Make it yours`,description:b?`Your keys are saved in your encrypted local Vault.`:n===`welcome`?`Start fresh, or bring a wallet you already use.`:n===`unlock`?`Enter your Vault password to use your wallet in this session.`:v?`Give your new wallet a name and enter your existing Vault password.`:`Give your wallet a name and choose a password to protect it.`}),b?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Lx,{tone:`success`,children:t?`Open wallet setup in your MCP client to unlock and use your saved wallet.`:`Your wallet is ready to use. Return to your MCP client to continue.`}),!t&&(0,$.jsx)(cS,{tools:g})]}):n===`welcome`?(0,$.jsxs)(`div`,{className:`setup-choices`,children:[te?(0,$.jsx)(Lx,{children:`A payment key is still in an MCP client config. Choose “Use an existing wallet” to import it into Vault.`}):null,(i.length>0||v)&&(0,$.jsx)(Rx,{onClick:()=>ne(`roles`),children:`Choose default keys`}),(0,$.jsxs)(`button`,{type:`button`,className:`setup-choice`,onClick:()=>ne(`create`),children:[(0,$.jsx)(`span`,{className:`choice-icon`,"aria-hidden":`true`,children:`+`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`strong`,{children:`Create a new wallet`}),(0,$.jsx)(`span`,{children:`Get a fresh wallet, protected by your password.`})]}),(0,$.jsx)(`span`,{className:`choice-arrow`,"aria-hidden":`true`,children:`→`})]}),(0,$.jsxs)(`button`,{type:`button`,className:`setup-choice`,onClick:()=>ne(`existing`),children:[(0,$.jsx)(`span`,{className:`choice-icon`,"aria-hidden":`true`,children:`↗`}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(`strong`,{children:`Use an existing wallet`}),(0,$.jsx)(`span`,{children:`Bring your existing keys and account with you.`})]}),(0,$.jsx)(`span`,{className:`choice-arrow`,"aria-hidden":`true`,children:`→`})]}),(0,$.jsx)(`p`,{className:`setup-reassurance`,children:`Your keys stay on this computer, encrypted in your Vault.`})]}):(0,$.jsx)(Ix,{children:(0,$.jsxs)(`form`,{className:`surface-body`,onSubmit:re,children:[(0,$.jsxs)(`label`,{className:`field-label`,htmlFor:`wallet-name`,children:[`Wallet name`,(0,$.jsx)(`input`,{id:`wallet-name`,className:`field`,value:o,onChange:e=>s(e.target.value),autoComplete:`off`,pattern:`[a-z0-9][a-z0-9_-]{0,63}`,required:!0,disabled:f||n===`unlock`})]}),(0,$.jsxs)(`label`,{className:`field-label`,htmlFor:`new-password`,children:[`Password`,(0,$.jsx)(`input`,{id:`new-password`,className:`field`,type:`password`,value:c,onChange:e=>l(e.target.value),autoComplete:`new-password`,minLength:8,required:!0,disabled:f}),(0,$.jsx)(`span`,{className:`source-detail`,children:v?`Use the password for your existing Vault.`:`Use at least 12 characters, or 16+ as a passphrase. On this Mac, Touch ID can wrap the Vault as well. Keep the recovery password somewhere safe.`})]}),n!==`unlock`&&(0,$.jsxs)(`label`,{className:`field-label`,htmlFor:`confirm-password`,children:[`Confirm password`,(0,$.jsx)(`input`,{id:`confirm-password`,className:`field`,type:`password`,value:u,onChange:e=>d(e.target.value),autoComplete:`new-password`,required:!0,disabled:f})]}),m?(0,$.jsx)(`div`,{className:`stack-surface`,children:(0,$.jsx)(Lx,{tone:`error`,children:m})}):null,(0,$.jsxs)(`div`,{className:`form-actions`,children:[(0,$.jsx)(Rx,{variant:`secondary`,onClick:S,disabled:f,children:`Back`}),(0,$.jsx)(Rx,{type:`submit`,disabled:f,"aria-busy":f,children:f?`Please wait…`:n===`unlock`?`Unlock wallet`:`Create wallet`})]})]})})]}):(0,$.jsx)(Px,{navigation:!1,children:(0,$.jsx)(Fx,{eyebrow:`Setup connection`,title:`Reopen wallet setup`,description:`Open wallet setup from your MCP client to start a private local session.`})})}var _S=[`identity-signing`,`payments`,`one-sat`,`encryption`],vS=[`source`,`destination`,`unlock`,`review`],yS=`migration`,bS=new Set(`token.setuptoken.setup_token.passphrase.sourcepassphrase.source_passphrase.destinationpassphrase.destination_passphrase.password.passwd.session.sessionid.session_id.secret.privatekey.private_key.wif.mnemonic.auth.authorization.accesstoken.access_token.refreshtoken.refresh_token.idtoken.id_token.apikey.api_key`.split(`.`));function xS(e){return vS.indexOf(e)}function SS(e){if(typeof e!=`string`)return null;switch(e.length>1&&e.endsWith(`/`)?e.slice(0,-1):e){case`/setup/source`:return`source`;case`/setup/destination`:return`destination`;case`/setup/unlock`:return`unlock`;case`/setup/review`:return`review`;default:return null}}function CS(e){try{return new URLSearchParams(e).get(`mode`)===yS}catch{return!1}}function wS(e,t){let n=xS(e),r=xS(t);return n!==-1&&r!==-1&&n<=r}function TS(e,t,n){if(!CS(t))return`source`;let r=SS(e);return r===null?`source`:wS(r,n)?r:n}function ES(e,t){let n=new URLSearchParams(t);for(let e of[...n.keys()])bS.has(e.toLowerCase())&&n.delete(e);n.set(`mode`,yS);let r=n.toString();return`/setup/${e}${r?`?${r}`:``}`}function DS(){return{pathname:window.location.pathname,search:window.location.search}}function OS(e){let{maxStep:t,busy:n}=e,[r,i]=(0,A.useState)(`source`),a=(0,A.useRef)(`source`),o=(0,A.useRef)(t),s=(0,A.useRef)(n);return(0,A.useEffect)(()=>{a.current=r,o.current=t,s.current=n}),(0,A.useEffect)(()=>{if(typeof window>`u`)return;let e=DS(),t=TS(e.pathname,e.search,o.current);a.current=t,i(t),window.history.replaceState(null,``,ES(t,e.search))},[]),(0,A.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>{let e=a.current,t=DS();if(s.current){window.history.replaceState(null,``,ES(e,t.search));return}let n=TS(t.pathname,t.search,o.current);n!==e&&(a.current=n,i(n));let r=ES(n,t.search);`${t.pathname}${t.search}`!==r&&window.history.replaceState(null,``,r)};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]),(0,A.useEffect)(()=>{typeof window>`u`||wS(r,t)||(a.current=t,i(t),window.history.replaceState(null,``,ES(t,window.location.search)))},[t,r]),{step:r,goToStep:(0,A.useCallback)(e=>{typeof window>`u`||n||wS(e,t)&&e!==r&&(i(e),a.current=e,window.history.pushState(null,``,ES(e,window.location.search)))},[n,t,r])}}var kS={"identity-signing":`Identity signing`,payments:`Payments`,"one-sat":`OneSat assets`,encryption:`Encryption`};function AS(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function jS(e){return e instanceof Error?e.message:String(e)}function MS({token:e,onWelcome:t}){let[n,r]=(0,A.useState)(),[i,a]=(0,A.useState)(),[o,s]=(0,A.useState)(),[c,l]=(0,A.useState)(),[u,d]=(0,A.useState)(),[f,p]=(0,A.useState)(),[m,h]=(0,A.useState)({}),[g,_]=(0,A.useState)(``),[v,y]=(0,A.useState)(``),[b,ee]=(0,A.useState)(``),[te,x]=(0,A.useState)(`Inspecting local setup…`),[ne,S]=(0,A.useState)(),[re,C]=(0,A.useState)(!1),[ie,ae]=(0,A.useState)(),[oe,se]=(0,A.useState)(),{step:ce,goToStep:le}=OS({maxStep:f?`review`:c?`unlock`:o?`destination`:`source`,busy:ie!==void 0}),[ue,de]=(0,A.useState)();(0,A.useEffect)(()=>{ue&&ie===void 0&&(le(ue),de(void 0))},[ue,ie,le]);function fe(){_(``),y(``),se(void 0);let e=vS.indexOf(ce);e>0&&le(vS[e-1])}let pe=(0,A.useCallback)(async(t,n={})=>{let r=await fetch(t,{...n,headers:{Authorization:`Bearer ${e}`,...n.body?{"Content-Type":`application/json`}:{},...n.headers}}),i=null;try{i=await r.json()}catch{}if(!r.ok){let e=AS(i),t=Error(typeof e.error==`string`?e.error:`Local setup request failed`);throw Object.assign(t,{noEffect:e.noEffect===!0}),t}return AS(i)},[e]);(0,A.useEffect)(()=>{if(!e){S(`This setup link is missing its local authorization token. Reopen it from BSV MCP.`);return}Promise.all([pe(`/api/inventory`),pe(`/api/migration/capabilities`)]).then(([e,t])=>{r(e),a(t),x(`Select a source to begin the local migration.`)}).catch(e=>S(jS(e)))},[pe,e]);function me(e){ie===void 0&&(s(e),de(`destination`),l(void 0),d(void 0),p(void 0),h({}),ee(``),S(void 0),se(void 0),x(`Source selected: ${e.account}. Choose a Vault destination.`))}function he(e){e.preventDefault(),o&&i?.destinationDefaults&&(l({accountName:o.account,vaultPath:i.destinationDefaults.vaultPath,vaultEntryId:`new`}),de(`unlock`),ee(``),p(void 0),h({}),S(void 0),se(void 0),x(`Destination selected. Unlock the Vault locally to preview preservation.`))}async function ge(e){if(e.preventDefault(),!o||!c||!i?.available)return;let t=g,n=v;if(_(``),y(``),ee(``),!t.trim()&&!n.trim()){se(`Enter the source backup passphrase or the destination Vault passphrase to unlock locally.`),x(`Action needs attention. Enter at least one passphrase.`);return}se(void 0),ae(`unlock`),S(void 0),C(!1),x(`Unlocking locally…`);try{let e=await pe(`/api/migration/unlock`,{method:`POST`,body:JSON.stringify({source:o,destination:c,sourcePassphrase:t,destinationPassphrase:n||void 0})});d(e.session),de(`review`),p(e.preview),h(BS(e.preview)),x(`Preview ready. Review preservation before cutover.`)}catch(e){_e(e)}finally{_(``),y(``),ae(void 0)}}function _e(e){let t=e;S(jS(e)),C(t?.noEffect===!0),x(`Action needs attention.`)}async function ve(){if(_(``),y(``),ee(``),se(void 0),!u){x(`Unlock fields cleared.`);return}ae(`lock`);try{await pe(`/api/migration/lock`,{method:`POST`,body:JSON.stringify({sessionId:u.sessionId})}),d(void 0),p(void 0),h({}),x(`Vault session locked. Unlock again locally to continue.`)}catch(e){_e(e)}finally{ae(void 0)}}async function ye(){if(u){ae(`refresh`);try{let e=await pe(`/api/migration/preview`,{method:`POST`,body:JSON.stringify({sessionId:u.sessionId})});p(e.preview),h(BS(e.preview)),ee(``),S(void 0),x(`Preview refreshed. Review it before trying the cutover again.`)}catch(e){_e(e)}finally{ae(void 0)}}}async function be(e,t){if(u&&[`keep-existing`,`import-source`,`skip`].includes(t)){ae(`resolve:${e}`);try{let n=(await pe(`/api/migration/resolve`,{method:`POST`,body:JSON.stringify({sessionId:u.sessionId,conflictId:e,resolution:t})})).preview;p(n),h(BS(n)),ee(``),S(void 0),x(`Conflict resolution saved. Review the updated preservation preview.`)}catch(e){_e(e)}finally{ae(void 0)}}}async function xe(){if(u){ae(`reconcile`);try{let e=await pe(`/api/migration/reconcile`,{method:`POST`,body:JSON.stringify({sessionId:u.sessionId})});e.phase===`destination`?(d(void 0),p(void 0),h({}),ee(``),x(`Backend confirmed the source is safe to retry. Unlock again locally.`)):e.phase===`complete`?(ee(``),x(`Vault cutover complete and verified.`)):x(`Cutover status is still unknown. Keep the source and backup until reconciliation succeeds.`)}catch(e){_e(e)}finally{ae(void 0)}}}async function Se(){if(u&&f&&HS(f,m,b)){ae(`cutover`),S(void 0),x(`Preparing a recoverable backup…`);try{let e=await pe(`/api/migration/cutover`,{method:`POST`,body:JSON.stringify({sessionId:u.sessionId,confirmation:`MIGRATE_AND_SWITCH`,roleSelection:f.projectRoles?VS(f,m):void 0})});if(e.error)throw Error(String(e.error));x(`Migration verified. Account ${String(AS(e).accountName??c?.accountName??``)} is ready in Vault.`),p(void 0)}catch(e){_e(e)}finally{ae(void 0)}}}return(0,$.jsxs)(Px,{navigation:!1,children:[(0,$.jsx)(Fx,{eyebrow:`Step ${vS.indexOf(ce)+1} of ${vS.length}`,title:`Set up your wallet`,description:`Bring an existing wallet into your local encrypted Vault.`}),ce===`source`&&t?(0,$.jsx)(`div`,{className:`form-actions`,children:(0,$.jsx)(Rx,{variant:`secondary`,onClick:t,disabled:ie!==void 0,children:`Back`})}):null,ce===`source`?null:(0,$.jsxs)(`div`,{className:`form-actions`,children:[(0,$.jsx)(Rx,{variant:`secondary`,onClick:fe,disabled:ie!==void 0,children:`Back`}),(0,$.jsxs)(`span`,{className:`dim`,children:[`Wallet: `,o?.account]})]}),ne?(0,$.jsx)(Ix,{children:(0,$.jsxs)(`div`,{className:`surface-body`,children:[(0,$.jsxs)(Lx,{tone:`error`,children:[ne,re?` No destination write or source change was reported; retry the preview when ready.`:``]}),(0,$.jsx)(`div`,{className:`form-actions`,children:(0,$.jsx)(Rx,{variant:`secondary`,disabled:ie!==void 0||!u,"aria-busy":ie!==void 0||void 0,onClick:re?ye:xe,children:ie===void 0?re?`Retry preview`:`Reconcile cutover`:re?`Retrying preview…`:`Reconciling cutover…`})})]})}):null,ce===`source`?(0,$.jsx)(NS,{inventory:n,source:o,onSelect:me,disabled:ie!==void 0}):null,ce===`destination`?(0,$.jsx)(PS,{source:o,destination:c,defaults:i?.destinationDefaults,onSubmit:he,pending:ie}):null,ce===`unlock`?(0,$.jsx)(FS,{source:o,destination:c,backend:i,sourcePassphrase:g,destinationPassphrase:v,setSourcePassphrase:_,setDestinationPassphrase:y,validationError:oe,onSubmit:ge,onLock:ve,pending:ie}):null,ce===`review`?(0,$.jsx)(IS,{preview:f,roles:m,setRoles:h,confirmation:b,setConfirmation:ee,onRefresh:ye,onResolve:be,onCutover:Se,canCutover:!!(f&&HS(f,m,b)),pending:ie,status:te}):null,(0,$.jsx)(`p`,{role:`status`,"aria-live":`polite`,className:`dim migration-footnote`,children:te}),(0,$.jsx)(zS,{inventory:n})]})}function NS({inventory:e,source:t,onSelect:n,disabled:r}){let i={"legacy-root":`Earlier BSV MCP wallet`,account:`BSV MCP account`,custom:`Configured wallet`,environment:`Current MCP server environment`,"mcp-client":`MCP client config`};return(0,$.jsxs)(Ix,{children:[(0,$.jsx)(`div`,{className:`surface-header`,children:(0,$.jsx)(`h2`,{children:`Choose a wallet to bring into Vault`})}),(0,$.jsxs)(`div`,{className:`surface-body`,children:[(0,$.jsx)(`p`,{children:`These files were found on this computer. Choose the wallet you want to keep using.`}),e?e.sources.length?e.sources.map(e=>{let a=t?.account===e.account&&t.location===e.location,o=e.encryptedBackup||e.plaintextKeys,s=[...e.encryptedBackup?[`keys.bep — encrypted key backup`]:[],...e.location===`mcp-client`||e.location===`environment`?[`Payment key in MCP config — import into Vault`]:e.plaintextKeys?[`${e.keyFile??`keys.json`} — unencrypted key file`]:[],...e.walletDatabases.map(e=>`${e} — wallet database`)],c=e.location===`mcp-client`?`Saved in ${e.client??`an MCP client`}`:i[e.location],l=e.location===`mcp-client`?`A payment key is still in that client’s MCP config. Import it into Vault, then remove it from the client config.`:e.location===`environment`?`A payment key is in the server environment. Import it into Vault and remove PRIVATE_KEY_WIF from the client config.`:e.encryptedBackup?`An encrypted key backup was found. You’ll need its password.`:e.plaintextKeys?`An unencrypted key file was found. Importing will add an encrypted copy to Vault.`:`Wallet data was found, but no key backup. This source cannot be imported on its own.`;return(0,$.jsxs)(`div`,{className:`source-row`,children:[(0,$.jsxs)(`div`,{className:`source-meta`,children:[(0,$.jsx)(`span`,{className:`source-title`,children:e.serverName||e.account}),(0,$.jsx)(`span`,{className:`source-detail`,children:c}),(0,$.jsx)(`p`,{className:`source-detail`,children:l}),(0,$.jsx)(`div`,{className:`source-location`,children:e.configPath||e.directory||e.location}),(0,$.jsxs)(`details`,{className:`source-files`,children:[(0,$.jsxs)(`summary`,{children:[`Files found (`,s.length,`)`]}),(0,$.jsx)(`ul`,{className:`file-list`,children:s.map(e=>(0,$.jsx)(`li`,{children:e},e))})]})]}),o?(0,$.jsx)(Rx,{variant:a?`secondary`:`primary`,disabled:r,onClick:()=>n(e),children:a?`Selected`:`Use this wallet`}):(0,$.jsx)(`span`,{className:`source-detail`,children:`Key backup needed`})]},`${e.location}:${e.account}`)}):(0,$.jsx)(Lx,{tone:`info`,children:`No existing wallet files were found.`}):(0,$.jsx)(zx,{label:`Finding local wallets`}),e?(0,$.jsx)(`p`,{className:`dim`,children:e.vaultExists?`A Vault file was found. Its contents can be checked after you unlock it.`:`No Vault file was found on this computer.`}):null]})]})}function PS({source:e,destination:t,defaults:n,onSubmit:r,pending:i}){return(0,$.jsxs)(Ix,{className:`stack-surface`,children:[(0,$.jsx)(`div`,{className:`surface-header`,children:(0,$.jsx)(`h2`,{children:`Where your wallet will be saved`})}),(0,$.jsxs)(`div`,{className:`surface-body`,children:[(0,$.jsx)(`p`,{children:`Your wallet will be added to the local encrypted Vault. Its existing keys and address will be checked before anything is switched.`}),n&&e?(0,$.jsxs)(`form`,{onSubmit:r,children:[(0,$.jsxs)(`dl`,{className:`stack-surface`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`field-label`,children:`Wallet`}),(0,$.jsx)(`dd`,{children:e.account})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`dt`,{className:`field-label`,children:`Vault location`}),(0,$.jsx)(`dd`,{style:{overflowWrap:`anywhere`},children:t?.vaultPath??n.vaultPath})]})]}),(0,$.jsx)(`p`,{className:`dim`,children:`A new entry will be created for this wallet. Existing Vault entries are kept.`}),(0,$.jsx)(`div`,{className:`form-actions`,children:(0,$.jsx)(Rx,{type:`submit`,disabled:i!==void 0,children:`Continue`})})]}):(0,$.jsx)(Lx,{tone:`info`,children:`The local server has not provided a Vault destination. Reopen setup after its configuration is complete.`})]})]})}function FS({source:e,destination:t,backend:n,sourcePassphrase:r,destinationPassphrase:i,setSourcePassphrase:a,setDestinationPassphrase:o,validationError:s,onSubmit:c,onLock:l,pending:u}){return n?.available?(0,$.jsxs)(Ix,{className:`stack-surface`,children:[(0,$.jsx)(`div`,{className:`surface-header`,children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`section-label`,children:`03 / unlock`}),(0,$.jsx)(`h2`,{children:`Unlock locally and preview`})]})}),(0,$.jsxs)(`div`,{className:`surface-body`,children:[n?(0,$.jsx)(Lx,{tone:n.available?`success`:`warning`,children:n.available?`Vault migration backend is ready. Unlock stays on this device.`:n.reason??`Vault migration is unavailable.`}):(0,$.jsx)(zx,{label:`Checking Vault migration support`}),(0,$.jsxs)(`form`,{onSubmit:c,children:[(0,$.jsxs)(`label`,{className:`field-label`,children:[`Source backup passphrase`,(0,$.jsx)(`input`,{className:`field`,type:`password`,value:r,onChange:e=>a(e.target.value),autoComplete:`current-password`,pattern:`.*\\S.*`,title:`Use at least one non-whitespace character.`,"aria-invalid":s?!0:void 0,"aria-describedby":s?`unlock-validation-error`:void 0,disabled:!n?.available||!e||!t||u!==void 0})]}),(0,$.jsxs)(`label`,{className:`field-label`,children:[`Destination Vault passphrase`,(0,$.jsx)(`input`,{className:`field`,type:`password`,value:i,onChange:e=>o(e.target.value),autoComplete:`new-password`,pattern:`.*\\S.*`,title:`Use at least one non-whitespace character.`,"aria-invalid":s?!0:void 0,"aria-describedby":s?`unlock-validation-error`:void 0,disabled:!n?.available||!e||!t||u!==void 0})]}),s?(0,$.jsx)(`div`,{id:`unlock-validation-error`,children:(0,$.jsx)(Lx,{tone:`error`,children:s})}):null,(0,$.jsxs)(`div`,{className:`form-actions`,children:[(0,$.jsx)(Rx,{type:`submit`,"aria-busy":u===`unlock`||void 0,disabled:!n?.available||!e||!t||u!==void 0,children:u===`unlock`?`Unlocking…`:`Unlock locally`}),(0,$.jsx)(Rx,{type:`button`,variant:`secondary`,onClick:l,"aria-busy":u===`lock`||void 0,disabled:u!==void 0,children:u===`lock`?`Locking…`:`Lock session`})]})]}),(0,$.jsx)(`p`,{className:`dim`,children:`Passphrases are sent only to the loopback setup server and cleared after each request.`})]})]}):(0,$.jsxs)(Ix,{children:[(0,$.jsx)(`div`,{className:`surface-header`,children:(0,$.jsx)(`h2`,{children:`Setup is not ready to continue`})}),(0,$.jsxs)(`div`,{className:`surface-body`,children:[(0,$.jsx)(`p`,{children:`The local server cannot import this wallet yet. Your existing files have not been changed.`}),n?.reason?(0,$.jsxs)(`details`,{children:[(0,$.jsx)(`summary`,{children:`Connection details`}),(0,$.jsx)(`p`,{children:n.reason})]}):null]})]})}function IS({preview:e,roles:t,setRoles:n,confirmation:r,setConfirmation:i,onRefresh:a,onResolve:o,onCutover:s,canCutover:c,pending:l,status:u}){if(!e)return null;let d=AS(AS(e.projectRoles?.current).current);return(0,$.jsxs)(Ix,{className:`stack-surface`,children:[(0,$.jsxs)(`div`,{className:`surface-header`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`p`,{className:`section-label`,children:`04 / verify`}),(0,$.jsx)(`h2`,{children:`Review preservation`})]}),(0,$.jsx)(Rx,{variant:`secondary`,onClick:a,"aria-busy":l===`refresh`||void 0,disabled:l!==void 0,children:l===`refresh`?`Refreshing preview…`:`Refresh preview`})]}),(0,$.jsxs)(`div`,{className:`surface-body`,children:[(0,$.jsx)(Lx,{tone:`info`,children:u}),(0,$.jsxs)(`div`,{className:`grid grid-two`,children:[(0,$.jsxs)(`div`,{className:`data-list`,children:[(0,$.jsx)(LS,{label:`Source`,value:`${e.source.account} · ${e.source.location}`}),(0,$.jsx)(LS,{label:`Identity`,value:e.preservation.identity}),(0,$.jsx)(LS,{label:`Addresses`,value:e.preservation.addresses}),(0,$.jsx)(LS,{label:`Databases`,value:e.preservation.databases.length?e.preservation.databases.join(`, `):`none`}),(0,$.jsx)(LS,{label:`Vault entries`,value:e.preservation.vaultEntries})]}),(0,$.jsx)(`pre`,{className:`json-preview`,children:JSON.stringify({source:e.source,destination:e.destination,conflicts:e.conflicts},null,2)})]}),e.projectRoles?(0,$.jsx)(RS,{projectRoles:e.projectRoles,assignments:d,roles:t,setRoles:n,onRefresh:a,pending:l}):null,e.conflicts.length?(0,$.jsx)(`div`,{className:`conflict-list`,children:e.conflicts.map(e=>(0,$.jsxs)(`div`,{className:`role-row`,children:[(0,$.jsx)(`label`,{className:`role-label`,htmlFor:`conflict-resolution-${e.id}`,children:e.message}),(0,$.jsxs)(`select`,{id:`conflict-resolution-${e.id}`,className:`select`,"aria-label":`Resolve conflict: ${e.message}`,value:e.resolution??``,onChange:t=>o(e.id,t.target.value),disabled:l!==void 0,children:[(0,$.jsx)(`option`,{value:``,children:`Choose a resolution`}),(0,$.jsx)(`option`,{value:`keep-existing`,children:`Keep existing Vault entry`}),(0,$.jsx)(`option`,{value:`import-source`,children:`Import source material`}),(0,$.jsx)(`option`,{value:`skip`,children:`Skip this item`})]})]},e.id))}):(0,$.jsx)(`p`,{className:`dim`,children:`No conflicts reported.`}),(0,$.jsxs)(`label`,{className:`field-label`,children:[`Type `,(0,$.jsx)(`strong`,{children:`MIGRATE_AND_SWITCH`}),` to authorize`,(0,$.jsx)(`input`,{className:`field`,value:r,onChange:e=>i(e.target.value),autoComplete:`off`,disabled:l!==void 0})]}),(0,$.jsx)(`div`,{className:`form-actions`,children:(0,$.jsx)(Rx,{onClick:s,"aria-busy":l===`cutover`||void 0,disabled:!c||l!==void 0,children:l===`cutover`?`Migrating to Vault…`:`Import and switch to Vault`})})]})]})}function LS({label:e,value:t}){return(0,$.jsxs)(`div`,{className:`data-row`,children:[(0,$.jsx)(`span`,{className:`data-label`,children:e}),(0,$.jsx)(`span`,{className:`data-value`,children:t})]})}function RS({projectRoles:e,assignments:t,roles:n,setRoles:r,onRefresh:i,pending:a}){let o=AS(e).presentation,s=e.candidates,c=Array.isArray(o&&o.roles)?o.roles.filter(e=>!!(e&&typeof e==`object`)):[],l=c.length?c.map(e=>({role:String(e.role),label:String(e.label??kS[e.role]??e.role),current:e.current,selectedValue:typeof e.selectedValue==`string`?e.selectedValue:void 0,choices:Array.isArray(e.choices)?e.choices.filter(e=>!!(e&&typeof e==`object`)):[]})):_S.map(e=>({role:e,label:kS[e],current:t[e],selectedValue:void 0,choices:[]}));return(0,$.jsxs)(`div`,{className:`stack-surface`,children:[(0,$.jsx)(`p`,{className:`section-label`,children:`project roles`}),(0,$.jsx)(`h3`,{children:`Choose a verified key for each role`}),(0,$.jsx)(`p`,{className:`dim`,children:`Only candidate IDs are sent when you continue. Key material and paths stay in the trusted backend.`}),s.length===0?(0,$.jsxs)(`div`,{className:`stack-surface`,children:[(0,$.jsx)(Lx,{tone:`info`,children:`No verified keys are available for project roles. Refresh the preview to check again.`}),(0,$.jsx)(`div`,{className:`form-actions`,children:(0,$.jsx)(Rx,{variant:`secondary`,onClick:i,"aria-busy":a===`refresh`||void 0,disabled:a!==void 0,children:a===`refresh`?`Refreshing preview…`:`Refresh preview`})})]}):null,(0,$.jsx)(`div`,{className:`role-grid`,children:l.map(e=>{let t=e.role,i=typeof e.current==`string`?`keep:${e.current}`:`unassigned`,o=n[t]??e.selectedValue??i;return(0,$.jsxs)(`label`,{className:`role-row`,children:[(0,$.jsx)(`span`,{className:`role-label`,children:e.label}),(0,$.jsx)(`span`,{className:`role-help`,children:typeof e.current==`string`?`Current: ${String(e.current)}`:`No current assignment`}),(0,$.jsxs)(`select`,{className:`select`,value:o,disabled:a!==void 0,onChange:e=>r(n=>({...n,[t]:e.target.value})),children:[(0,$.jsx)(`option`,{value:`unassigned`,children:`Leave unassigned`}),typeof e.current==`string`?(0,$.jsx)(`option`,{value:i,children:`Keep current selection`}):null,e.choices.length?e.choices.map(e=>(0,$.jsx)(`option`,{value:String(e.value),disabled:e.disabled===!0,children:String(e.label??e.value)},String(e.value))):s.map(e=>(0,$.jsxs)(`option`,{value:`select:${e.candidateId}`,disabled:!!e.unavailableReason||!e.supportedRoles.includes(t),children:[e.label,e.publicDerivationLabel?` · ${e.publicDerivationLabel}`:``,e.unavailableReason?` · ${e.unavailableReason}`:``]},e.candidateId))]})]},t)})})]})}function zS({inventory:e}){return e?.migrationRequired?(0,$.jsx)(`p`,{className:`dim migration-footnote`,children:`No source is erased and the running wallet is not switched until explicit cutover completes and verifies.`}):null}function BS(e){let t=AS(e.projectRoles).presentation;if(t&&Array.isArray(t.roles)){let e=Object.fromEntries(t.roles.filter(e=>!!(e&&typeof e==`object`)).map(e=>[e.role,e.selectedValue]));return Object.fromEntries(_S.map(t=>[t,typeof e[t]==`string`?e[t]:`unassigned`]))}let n=AS(AS(e.projectRoles?.current).current);return Object.fromEntries(_S.map(e=>[e,typeof n[e]==`string`?`keep:${n[e]}`:`unassigned`]))}function VS(e,t){let n=AS(e.projectRoles).presentation,r=AS(e.projectRoles?.current),i=n&&typeof n.revision==`number`?n.revision:typeof r.revision==`number`?r.revision:null;return{expectedProjectId:e.projectRoles?.projectId??``,expectedRevision:i,roleAssignments:Object.fromEntries(_S.map(e=>[e,t[e]??`unassigned`]))}}function HS(e,t,n){return n===`MIGRATE_AND_SWITCH`&&e.conflicts.every(e=>!!e.resolution)&&(!e.projectRoles||_S.every(e=>typeof t[e]==`string`))}var US={mode:null,token:``,flow:null},WS=null;function GS(){return US}function KS(){if(!WS){let e=window.location.hash.slice(1);WS={mode:window.location.pathname.startsWith(`/setup/`)?`migration`:new URLSearchParams(window.location.search).get(`mode`),token:e,flow:new URLSearchParams(window.location.search).get(`flow`)}}return WS}function qS(){return()=>{}}function JS(){let{mode:e,token:t,flow:n}=(0,A.useSyncExternalStore)(qS,KS,GS);return(0,A.useEffect)(()=>{typeof window>`u`||t&&window.history.replaceState(null,``,`${window.location.pathname}?mode=${e??`migration`}${n===`project`||n===`standalone`?`&flow=${n}`:``}`)},[e,t,n]),e===`migration`||t.length>0?n===`project`?(0,$.jsx)(MS,{token:t}):(0,$.jsx)(gS,{token:t,standalone:n===`standalone`}):(0,$.jsx)(Kx,{})}var YS=document.getElementById(`root`);if(!YS)throw Error(`Local app is missing its root element`);(0,da.createRoot)(YS).render((0,$.jsx)(JS,{}));</script>
|
|
117
125
|
<style rel="stylesheet" crossorigin>@font-face{font-family:Geist Pixel Line;src:url(data:font/woff2;base64,d09GMgABAAAAAEbIABIAAAABdjwAAEZfAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGoEeG5xYHI5EBmAAii4IdAmcDBEICoTZFISEDwE2AiQDjwALh0IABCA/bWV0YSAFihIHmHEMgT1buEZxRNy1q0CB7gDQXz2LWQXj2ARsnMFskIdWwI49As4DCNXu930oqqqqJiSoIWP/oAdzs9QsgkKtIUTmEDo0vBy1SszSEAwVq5sOVmL5ub+PT18+hDoePoUqV5oR/tWp0lkzbHSJMrTEbQTT0KF7hP29Nbzt0bR6jKBtbTBJNRFs8vs9qd7lsCdTduVLZMuL1M87vvd5+5UhwcboJSiv9ZJ4t1/bXDH7/feHHXZ2JJ/NiF+BIQhubBVgtzSHyCGNjrIP//D82jr3/T/D0NqDYjVYgYUYhY2VYGEWZmJiVGEVYmMWoMuWbiXG/D/VLEnw1WFnTL1WJ9w5d9WU9iUQwodAD4EV3zBuUcSu9rTOyG69AHDiDKG7vZIS/p/9wJ37xjZ+KqYo3WgzmAQFxdCKxRBFAtnRTgAKQKL1fCbq8ktyiJaxIJ2MIyQpBcBfOvt6r7sFFlALyHJLsoz6yN7RzOedmUUf2wO/ZtPbIDriIOGMIv8jjoDyCzlICAee73WfnnufTDKQzNpvfnapAL0Ali9Ab1xlFcBSSakAqQqByozUZbbeakebKlFp6AKon7AmnVX5mzhNdyxd5AQCmbBTl4H06NsqRRtwlku1/2moTqpg1jWd1VqQ72jJK8hye1eTtQyVTcyl1NqUd8QgQZYh36OjYkai1LX/zQDPp64ELmoFvuenurUcoAOHtJTwHUtBaalOeUWZcVc9+WiTCRHs5HQHnHgejwNOIOAEHjiBEcQDlc3EetoJgN///1NvxgQp2A8tgnC4wLEOTYE/R1vgjL6cvp+xwD932WHsgVJA9271/8+mVVrV1dUeaey96ZFmxkvgd54jTFv2AUJ4QdKqrtZ3q7raM5Jl0qA86x0geclwoFbLdre8BJ45DBmiBfYiRBgeUMac3QXxpcfRImabxXtxcuGl8QU5VgYjQRnL2dsk36rUWNW7BaEYJH78tCyq+rbG672U8MElzOsLgCSEbfX//910q0oOeea0iV6IKJdK6lH9Vs+G6HQpEnYAozk2AC78/zv/U6y34imlyR/yad6c/uwAVMRz375HsiXZQyCdFNVfqu89UMwvTYeKMe76LcuQYY7fhn7t023lQghBhiAyiIiEj0hOROST7ble/zc332+BmXUjRSxYRUOpSSYqlwsTt+WiqgZhvioCgUAgIhAIRAQCEREx4sTW7+/iXx3ghyA4OAiCYBAEwWAwGAwGg2AQ/Kmf83tg3tWvmzjjJl1NsULXHrpSpQosKyiQ9I+/u59HGAIAgPEMWRFTiGmsQKxkFYYEtiC2sR9xkO8QP/AD4oNyIuVWRVKlqjBaqIVIi7UYKV7xSMu1HOmKHmLpkd4ipSkNIQzgBwRjMLqia6AbuosDYeme7usBAnxwE4Jp8BgZRdhgcEO5iDXo1Q6l/EtewYYhb93nhKp8iVVaRWFEaKatLvoYbYqLAAgAgzc+2IA4PdLz9HIiGQe9SVPogwv2BIMLwws+4yQL4hU6WfgNAK5lBus19tRwEYZ3veeGmLD6QVTWm5Pvc1uQcWwx1VtOG+htF7O5USSKBc3/xQoeDxYgDFKYWY408pqA+GDCEL/Z05AGLAXpvFcqIlXvERmWG8lHlUkRBSPO8hfiMi+QqheMtEhZEIe4iUjkLCIZG5CaEfd4geTkIpJLLqRuuTFWLTZYMZd9eOEFAACeRE+imvO86pmwp5FXltmeJfoAzwCZqMMl2I9PSA8ReA8n5HpvLKPNZ8YaOJtzqmnXVapCx9WP8R58FoS1yodW5dVyjBn7AId3j8NOENTn8I4VxxC8EQ5nRyWZVZU9wXtAX7/P3Vru593nWGco+jqcbtW0uGdi5IoP2z2v2Mv4ID6DU/EH9OtCcngS5UR+C+EH3rVw1VBLAHCtcAT9Sm3C4EMt4aCxVhxEGyKAaUwjiL3sJw+PeU4+UvmOwv6RTZlyKzdhCq2imhj8EL6Am0J8CVVVzkBSYO8lzWEJlR7+46/lICdpLIkU2njr3WQeX9+CFMJwBv/XDYKY4hTLNwbZSHaTd8r7XAGvFXGVjqtMXCErFdrbKMpupWuE95xHerO4NGqpod79jxfBT67g9Ifsf2h0ZXnZXl9dPtRu3yeZxZWLKVcyIhuilp6GGmaMBLaxnYM8JpUf+MivClKRQhl80Ro7tUi36Skczj7DGOiGBF081sXHOU4FNSMVaSaFWk+FHohqCumz2E662KuLg7o4o4tUXXzQxa9Cc4jVa6kB3mBOZjk/t5fa3qM2XzxdL/O0nR/aT20vo/0Pbf/W7j+QZDx4uSp3i32w61dnLudw6TOawGGBNnPDa3QJx29l+LVBB1YvcmSOSq3+8E7EMfXD3KyXuaBEBsGEZ3dphGIAxnCkd92xonKxqWMgG0lZUmUi2JLmcBZhEs411Vgkg52Fmb+tbcEjktvWEJyms5FDhHdOWZWVpziqId5y9QuTdcK9bRQ7yZF0vKiMjTtli/LGSIrCJD97hnAbjWmPG21emEVK2ewllM6oEzObnGbPz8HB9bxdUnR2sjrvxYmLLeFXloWn7WbPbVdmYWQSE8y4yM8fwO4u8WNqk91W7LK573dnJJM0rTjS0pjF5wHJ1/S4WNZSZ0BrnPZYNgPa2C4THXGc8S6zXPYxex5Zx0yFaMUlVod5S/zsX8ac1eFkmJ1sdXtOhzPPur9Ma0rmhMEEZ1hfagjt4BO3V6bba9bZWyzXtM9l/qnQldm77NP2RXUOfMx2S2JNTe8+i8IGc5nZJW4/4BGYnQVURItZ3dzbnTUFO0Qv/8F+Zr+336jZeT+EM2Ryr7BcVgcEFOALzRyvMJ/tTG02ny1XyZHNYR7Fpz3+u/9v/T9vuiEUv50dCB0WwZqg/Awo6GeoREMMdhUKT6rUZfICQtnaWjBvYM4DCi16hyUlHjF3uHMQZAndm4uJTi/hSdQT8TYhXXG5MwtORC3J22RZ6baVRp1S5jWRIqAvXgUCzXDC582psSV9jtgew+oNZ0Qg+k/ESp9XJ+XIYvQeRKiiL/M8R+Tu7EjydBBxXWIYlMslKUHGQFnqkoyNAemKMS8wJHODKQ9pFViOnCzJZgprdTsZzQeMzKZQsrzcbSkG60PBIPqJ2xNLkDgbI09hEhlEp8vgS2Y4cZb+UkI0cYfGLJccJpzlLeEqEe+SSAZlsizy8v4oE18Dniq+nEfiOaxBGXOa28eYVSwSaUtK1WxmMNu8gEY2ietFJqzvl/Pu46DSfcmGnVpHHhI5r2kaLJkUnvCGDH7iLz7Llp/GlkPBKlqIKlerBkUWVbdi5Oj9okbrn+joIcP1NWbwQKGlMe/DKiX0++yda8NobO/dbYM/8sHaM5BDJHH42aHf1UhdHvb5coRxjvoqL64jCqRQj1gvOKm8jJV8GDWmHqXftBIQICsdC5D5igGkdDSCrW5qMvZcN86CbnMyBTSOTkyMZ8uTkI+oM5KMLrklXLaFjAF9IKvqNA/dg4uiLAOqiGjrjI4o6et0yei2TtzT353jJsdNjpscNzLuhrij426ImzzL5O0RWYXfQPxJNuIgXsRJXLqvidOzm4l6DjNez2nG6rnMaD23Gam7zXA9CLCPVbg1Jgz20ACygMcjKn8LuHJ88MUPfwIIJAtZyUZ2ZDbgQCaRLMiM5Q3spR+grD6cjzNF8XAchwejdWn0nsT8ZrbZtsaY2A3FzPswVHcfmT0Ys8D08OyzzBwndnGPbNNdH3/x/9A92Kpatf5UGXMeB9OYrtxy677HZx85nqUsYzkrLngSToVWtnKVr0IVWcjsQmZ0DSLwCq80xj46SOeRSVWtmGlJUy5/Yx7hzRzmMo/5LGAhi1jMEoy5jY+ClEd5Fax8yq8CKqhCFd7AR85LkYpWrOKVqGSlKl2ZQqL9rv3MlIWYiqu+OmuwZmu9Duu2PhsAj4esezOl10kQ/6TwflK42nfa9wfi12dAFsgGOUBOjH6gVFWbCSpOVN/HsdXMYCazmN340hvcb29thdyqtgLnQRVrXMta1aT7CCl8IPVQ7YJePcBFkQQSgU5ntekvqEG6jLBUp7qFM4goHXOOTeIuhtMkCfR4Ru3REaQEpDUI89MKs+BqjGbrBOW13HReLES00wibrnr7g//IwqKxBFKxEQmjaEyF/I7PQV0NPeON7ql/GxdVTAkllWKQaqsREE4e84SnPOO5cmOUR0UZ5VUxRsEqziifSjDKr5KMCqgUo4IqzahQZRgVLgSj3CrPqHVNfxLqt1T1O3yMOb5QoaCcqkT1BNY88jq2YCH89NWsGbmeDWxkE5s3xLNGppeiHOclVDnlVVBRJZVVUVW1zGMbi9JeBx3rYuXzjL3PeUOsvgHlVu2mrqp63VMlhiQtxCJV7WrBUq/qWYkh1CoMoUVq+ZqPxbpVtharMD8z/LjlCBDgjUhWT982JVqKA8wC0wk0lx9ePVSsrhePvQU8rVUw1mXq8FQ/kssU/GSsn7++BDu8BQVhBcDHiQ1QEOt1FlsiR4Fs1G1Hnr+vS5iGkwDKqWFK2VWmatWpSS3q25TitVz3TF5TbZ13ztwwb8eeMqpSg3p0Qj9Nv0y/T39clMUHi88VPyj+UvxLNCIVhajESJwXV4iN2BaHMipFWZVry6+Uz8tvlH8qv6+0kiu78qq0Kqp54YdVXvhZ2za/OJ9/8RP/PP0POT0FAAHn4SZ8AUM86wa+4Cnu4xup5v2axI/8E/IbClSmGhnh7+mieM/xf7/4c/FPASIWuRAHicvFmoSPv7T8crkpv17+0ejSY/xxBbeOZsGGFwNfV3h+EPtf/bXHii6rfl7OwZeNX5Z+mfolDuDdZQBt87VfISdlu3e105meAemD03uTHpjuk+5Ke5T2PG132qa0BEhbnDYrbfxvh9/qeBPw+u+HzeGKu1UilgD7VHFuE7Go9djgDd0aAHPZJAGQt7xtHplnYF5o4gndPNWkm/egm8x35gMv2MQalPQA3Sby1ag++wZTmzo1vp7Fa58mN6EBDaxHKxRVn9rVq/Z1aJ1Wa626FEf4E0AO3BRRVGmhqgmjlnoiNNZGO1E66SnaUMOMNsakBte7IW1Vv5783ufslXWnOcOlJ9d5KMUXvPwJMPvh5BuOf8iUQ075yk/ZFNtcDWqz2ta5xVqmJVqueZqqR5qmqo1ui6KbrjeapY1qVeueao+m1K23alm1xhRZ81rUlRcGB7448cGPrOQniLwEU2nLXBm5aaS5JppqpVmraGmAGP30N1Zbf7OB1a9h//bSejazlV0c5xBHOMpNkrnGdQ7wlvekkc53vFMC3+LhE1/4Kn9+VCAuNmKxBm82EcgOsrGb7OwhCzvJyT5ysZ8CJJKPYxTkBHk4THHnKOYsJV2ghPOEcIUyLlPVHSq7RRW3qegqZaVQwwNq8ojaPKGuZ9TxlHDPqe8VDb2hgde0kEGkb2jte9r7iY5+oYOf6ew3uvmTrv6gi9/p7T96+Zch2cQm+vrM4CwGBoMyjMjFuAIYL67sTCknk8uBzVq6+4s+/tdLPdYrpeq1numqknVDd5SiW0rSFd3WNd3UPT3QQ0q5yKh8GJ4XI/OmkJNMKAsTy6qRjWpowxvRsOZrgbq3UDN0TAd0SEeUqBM6roM6rKPapZXaoPVMVS5euO6jmLn0bgLPAGUxkXjQkVxkkH3QXALGRyqCcorrm5fMQCv3G6/5fhD5MAfrpQ/Ir3z1XM42kxBn0rzmIU36q4IKR2MdmbIA3gp02msBoYvOgi0iziyk1UILC21lckH9ALa68E5idJn4ncvNcgfpjs8Fo4Z03TSB7Z+3hJAuOsrprXJa3loBbt0SIgdl6lqOvHF8Cuz7aWhDJLIRK6Nzgs4H8yMK7YaX1IiJ8ON92OhrO1k0u/64j7zjC2gTDr/5Z+XmY28R9vdnzuKc4zpv/fW3BsmwMk2YsM03W8r57PkO6MebyUyajx0MkObESVZgYto6e5WHrp67dQjBbEiD0Y2Blz3wBA1M32FIKYYWT9LcgaOmZzCX4DCESQrgPARLULgSCTt1wSK10hdYkyaC0u17lNqh1s6URQDXFtnrZkDztVk5dNKIDds1w2DLJi+87o+RZkVvJ0281Buc5/NSAxsd+LhvDg6D11AEYXHkwbnxj23SCVmUll7XaYFEG6mXqlc7FaB2CXI4A4/ANcrM0mvF6FFWN54zOBRBJRYxtMzHHnNyWtv2LOj6bqtIIKT7E8o1hJ0xzhXoYE2UflMnmTg9B1lgNiHMZuG4Xmiz6fZUHRBTzGKGrzEE5pDFBnaFXZgG0J19X5i6CFuFxW4zITscp57FacG1CHb3vq90b23tAg4fvyycuCE3j+Ocq1zmDI6aOuF2UZq14NZOLV774dhndtwL9zCf6bmFtx8O/IejysWmXBLe2m8zeN1Jh5eHggcOd77uDYE0LtscdoaDYS3QZn+feXEorHHNx4T6lc6s0PeZMtfgEEmrVbV5wO6GOEhPqwStlkjOmAF43QM74G6LiFNXWNAuPAeyc+zxaid9rNph1tC1k3gTxwgucNhyzhXIP3vgQfbVOR+fmypYwjZDMK8oUhDFCkGJQlGqMJQpEsoVGfUVBRWKigZKb9m81DgcJ/L6w7FXqcB3rjXmmrFtCNV3G880jNQ3P26iXNjYc3tXgQdXEwx8duISC1xhgWss8BAL3GCBR1jgMRZ4ggWeYoFnWAycLaVOXHSuPBKvpatD0Y1sCdecpe6w8y3nOpzb6na90IoMg8Na0rStm/jam2aNG7yLkS5lS95JvePbXJhlCYMd/yBY613yUq3YgcutPLVg6ZV2AabY0bxVcE4I6rsgfLFg1PZL3c6XMbD543K1lVqGdvwiAV3atlxrq+i25XqXlWA3fjf8RpsJhI1UXT9QrzXH+a752AMdahI/Mlvf4bVrryMG/ozKb5ZAuIlu61gDa1r3ZgOGx6h3nWlzVkXq5jrauNUlldRFyJNMp35hvWMZvjjwF0ysCpPXjlbTt7ot7jqtk6bu2KuDKHW79TYbt3p873QsrIsTRerS5LSSdcm4bJyt2rMvqbw6rpEO0rap0brBniuvdcoON0rO1R1rv9zFoLx3qUlIwvthI32UxqHZ3qJWaBwMlts+cWRakEbQq3XcabiTR8N1DMDks3B6dzHWoLjLRwKv+kpqLf67UJkVcpI1XCw3NvLuBIYHMzDt7bBl68wP3zPI66KWjYc6VYeeiXTvotQ2c6epv9Go8/vm5eClDlU+j/7c8kKz5z40+1NvSai54/vdldzsyB69XXKr0wipqXYEm+tdypC7ivOMdvIQ0tQdhWB9wqidB1ii7lullkq3tZTfL7PGGvd2wjP7FjFMZ2Yb25m9e63bpqRNoQhk0YNlcLPjHuehNc+FQvO2VeCJVfJoH6z/1xbW9DVf5ldnkzz+f1JmQJ9vrrnP05IbRS++IdxR7mXQLN123S0T+wKD2eDHLFvwelim7JLgmHIH8OGZ8ktCYP6G5QVg/xC5iitC4iodgWSu8opQuNtSM9eqKaO6JDRMNQfw0zLVLgkdc9clx7HejFW/IgxcDUcgI1fjijBxv9MyYwVyN+NfUA8xR9sunD9j0NfLlQOxWiX0dUJtXohwthF2kd0eZrMcIhwj69Mtoc4vdJZLlGuUW5T7AvRIqGfCzQvZ8I7hE8M3ht8C9E8oKT4mQXHg4+0x/Qj3wiNnX2WE7ngtTNk5uA7qM6xh6/Pd9u8hu4CApx5sAAD8LQAA/TGA/wR4KQTelQGYfwGorwL1PJgID/IXH4FK0Kf2dCrueM0COAh9SPU8Ocy6iDh2bIv3EsLti/NARWdWMiKN3sRwaLLdPK7UkqXzOplfklfGiGjzDwe+YMAS1dldBSU+zGR9FQ2YOT5wn4Orh481w/V2qUw9LYBZnsMkTvwdMETQCBwvKI267efTU5iRcIEDbpUR7O1LDmt0RdpgwZAhBZSkMIdDBAlkkIKAg0BQGaceOIxg/++zbwAACorvOgccCILXyWBD9XPIOgIApHuOHhFzWaEJGWRHp6IFyu6nfYsRQ3K4MGkag52BCDzgwGGL6fDuO38ZhJCDAQQ4qMDAARPT0/LG8tgCIqha+P6P7sM57uQQRIZxTQgF+JFyYdmGFiAnjqNdYaHjaHftdul1u//JUNxoR/T+eHE3AQPA9cGaoDlj3ZXQlht8EiJpnYMew3FQCeTdEgGtct8IIKmOqsRVAl0Q1GiI5VIUp8aerTv1ee1JFngW0c7lK9rVTneHhQbFfaR301lZq7zonD+ZZ8d+JbhjBjNcRbdd8ulTOK7oZkTx2V7qN6QByhNizf32krdAU9nZ8mBq6g086m/qv9cF07XjW2msXeq7CkKSjgjwUNHNrFn3dMHMX4su27CoKWdjxGaqUuye4zp7bE3ZAq1xYRQ0PRLfvAIv9kM/6te/vE5m3t/z50zV56Y/yCysHiY/ueM/ZdvJ/I2YB34sekUmR9x6aLQrnCIlj6L1u1FkhJusXXauXkiR+EOKWkZQQNVJO9+vomS8dM9+bZ+U4JLdg+TlKxLp4jYeUy8tOflij8Vq5RTkBm1tDxQZca1uX9Gtyv6EnN4cdWD/J7c/N2nDx/7ntt7f18i2kiN3iHVAWaaRV9tqWpDViaKu6fjjpVgL7dVtgQE3lGdEFOK8n/NvpWtoGlyiOeyRPzDYTnnWBs6kqmullKXhN43kxRj7j9q3hlq9dgrz/B/r2uPHWjyilnALtzI1hTdbJJQZW6ewrOueXsa1AHF5+dyWCkUMYo9QO82isyMCjCscwXiVHG29qjdrcRIco1TsaqFgNpRwFqXPDf1H9Hwz3ru+OGr5hjPk5s2STsoa0dNar5PTXF/zLy4U0bxKsDAnJvs1IDD8DGjq2bR+TnJppd+TVLVkf4WT6YY271LWl4+yrafWCwcmw1aelSdP1SVUj0eAndbPK6sFkKZhQvPngbEO+VqBC2C/QAIBSkJmvnlTHzD/lFBNxjlwMJ9un6H3zrhxet2gp1G+3Mt07diXVBswoxR36ubdecByEr5aRPDfDUQ1Y3h1Up2HgeSXXqzpg1hSqgn4ClM0ldp17U0P60peIbOMnHL5iqa2yeu8oabTKnNF7g63QB5znxV7JfQ6joEOs6UsnBjfq9wifZLSQlSfWeYpyKgdeaXrCYpDrGa52p+HytePLqofunFH4AVRtLvpzCOnM/xfQPYkYM0O+vNj5nequtmekctZ59tev3xBf4CQLImhlCqiz1hEhj2C6M6nLsOjucS5I3MyETb6F33nyVeuvlY+fQStFGXSFuZ0hZcz7J2ayHKfDyWx9GQe+0Y4u/h9hhLpgY0j8SKLLMDVtnOyxU+u4woq5fD8rr370IKULG6XTTybGXaWnqPptzL0VHb3vnW99o0+LjYVj0iAdAbdU+XHKh8M9cvM7tKv4fmrdRhPxlgLJKi6mjzMC9iLaPJnQuWTy/bi6KXuKe2DGLPkivkytrXE8dbo+X6G9WKdjjU/xXb/JsLmqUOe/eBHGei3OtLyO0hiGbEfae5v88gLGnPj8MtnLns1J9q8jKggtnf0chFY3hDiCM89mf7LOQl4nGNF34KTMWTTH2KWZ8tm31mE/OJg/mRV2BWYhZsipjH5omoTEPQsd83RkgcaCFWPxdweBVNGvmUc/TWlXFVSL4fSPk/ZOjllAoldQ05961NWlQZo9WvfYwXkbxIME0lxll55vvRzqGe1pl5XPlgU4cNfvtpWp7HVLv8zq2SgKnfBHofb76tb3hhMt16ia8VZQekXpJDHGd5vvf306w9cWdeZKwP0k7N1o8QNtcoZWfSV6u6Q0t97vL/XaOM39Fif8YvAftf46B3IrPfrhr2+6WA9ohRdHfpppYZQcONqfcZUdIQjbI/3yE70JWwzVSa7mfHj7GMsehANQfdGUZLsnIt60rbFYZb/5M1Bmb/4OFBOWs9S47yLSSHDcakq+KQPEHGMXGIsy+lp0ZSdVpEORgxXYXdesLdBNYmo+BEwJG+xoDfepTGkuoCyh/eIDyi0YQdVamYQUdT5fekPjPYZyL2BV+wJ6CLqgINVlczE1UMx+r9Z5O0jH196V/JjOo5AIcYEKfIdbNurJT7oBXHvfk39ZUQdauwzl+3gzaxn3PTG8YiWFYKOHEHayId20FRXT2A3eYCWQEikZGs9fMI+Qe3+mO+Ll8MWMU5NumywE75GAyH2SYTcuOZzGO4EnEeFXEzDUBGr2SP5fnmw66nqSzwWrBWqnjfWSFHZ2Z01g9+kxNFY+ebQzYXQsJ1QYaEtl/kJoOGUh9e7xpz6Yd/TuaqVMdwTtNH+/IrQ6mK197dbcnjmETNJy+clukPx7gG3LzK1kR5YvV53d1gyjwNGRPHbdVpxYITyNfJii4TitX2N3CToOcvv+rEqJjq26vujR0w4k8k/AcxzW+/oHd9CPP1aPK7PhIvk6K4Sdhz096snKXFpEakY75KiKa1MaoL9xL1pwtB1RqCc4xgnrQkqu9MSVXGTl7Qer+ZRxSMXi+7+lT7a46AUTlNuw7jmx+pKv55dyYskY5rnurjogGVpc8qNINf8o0bO3+FbFbula+syQnzTz5wij+pu/n5eJd4xzlKmaeYfMHrzsEPDh8xiDy409ozE2E6csdMJtY5iSfgT55gO+UeThTlRO2s3AqmI9jex8IOQvHpq82TY4arbYgpvsjJ8dYauQLHXZC3QAtopdKYIy9GxsW6jj9FK8hrMplDvbq3kG6x+AGpXaRT9a2U36vTBBn1MJ19F8EVB26EZWzYWdiJ/2nOCezhBbRuYKjzU0mswSEDq62phX+JB4nVDC29o6CoDQSGulpxBq+G5BKlYI1nnnvF0+Z5Nn/fgqrDRC5KRgFSCJX/17tBoO/Z4NBq49TRFKqAsiCiTZKyiRgbmJls91hdzL+0CC6RWDIkBnYiEIwFFtCBVuVd62EAGimSivh4NgiaZkSCaTrMzO271EPN1L2w2dwvd7gUpc9E0QYpQp70ohGKxwjtXeDj/tiFW5c8X6Kr0L0SgZPPWkLBpmHo3kms0ybofIMHOTvq3RKYybQkk/AQ7AVamsqEAglIGmizE1IFUIFBJuHLILHnrXVaWYMCgBkWGQUO1fWzkkfMB0GHmUxodIQs/sZ2wdSxnzOdHSEvZbqDVmgnJpoOttu2OE6TTPCVWgcIpVQNbpXFrUXWnVmxH1icOzGho1o/vRDBI8eJWVNwZ9soO0TYXjZQ5psAhsRCEsRf0tu4dYU+ZhZj8ywGRhrOz0e5zOvvObE0UULlHB9hzS508EDx50zTcXeE+7CxyDT0R46mIvZOtN1uWhi0nbQ6ltsEFx2RGN8S2Oq1Jrao3sQ9m6/ubmzxl7dOUKTKawXwP8La638EfqnNXt3cNQmXjBGQs+WCEWhwIklVeF64VBjStfdedYsCDmcRC3K2eQ5ZAanO73Coiq/6wcPtZD5zidRNyh8HKxFHfyzZmuCW9SzsegEgDSe5HkmFMt1yjQie3hIJuFxKywmsF0KkQzc2+GYn50kA7YF8deRhX3qjzk6Ne+q1QjJwzE7/Vvxs/rFQA68/jIADZDAhxoSK9zDvRYN85uFpJbeOIWLH0C/c/L6TLo6qQMvYGe7MdWxt+ZzEs1iQAm32B9WSgA/QOHs3N7GJac/TwsMCmXfHeQxMqJqDg6e1KaJCuIfbpdqYmtQkD92CYahWSEyEry7Vcg2xSAs+1lqU28nMNgS6U/8FW68AM51DqrvXa6xf+sQgNV8FoKw9svQWE5t0ny5u9FmvhdWidxxBDUjgdYthiQ+liFmYvwlgTXe0k4pSMjTTxzFY3meKMjY1NT9Ni75VxrSgZBR49/8u2ADQoJ7GIKjuyIK3VdCI4X6jIdRLpiDBz06K+UchBQUVxI3tcbpAHG4iGpgtnMkxOErbTDI0Jrot71oJrixTvYUadp31wmEUYuk1/K3PckgGguWy9B6zI3G5tF2P5mZ9GOc3zQrxRuQPfiaBiZbp71u592vPXeZ1WXLB9YHpwvRAHESN7ptGPv5O3N34YtRboW9FxUHyBbjR0JB6jUkZADGo1s4u5vpBz5+rsL2i1E51YnK9Tf1zaJHMw8xbaLf/Y1+qDZpLVPa7irlhi1teLGW/XlPUeANhtESaE/PEvfXtu2ELYU/bG5WJ5pUCYU6QE1VCPEWVyy2FVi9PKNxvOOBSwPClC2aQW97VrP7qJZKjDLUwIbom21MDTaOTem43jdNvYYvGH9mEfY7QO1HxJvfaCORuMlGDgp5PcsGmtVcuPiRL03b3Q9j5j2ai5WIrPnYBUCs7wuMwRDkuQLaA84KGelg3w5QXxS6FCBJ4hnlFSREJQeiIvaXO1YkCoghNJf5WJkDiLePwoAiPYbOBrLlQOhFmtoCwMFHdpZji/5gZMTATdOTOgA76VvGDqmoSQS9Pgx2egAuDn2CmxMcdM7SvCyF3cFpgBe7PDIthoguAgYntmORYI98zVmVr5396LdMYs+rcBWyyauA/G6RzLZlKKyD8ECzbsqdrLgUEEewYhjB7Z45D5eIrgMEihyFXB4kxkzuqwN8cq18RCZKDbStfRdM3Pi3wJg+xKN7yS02nM2bsGk4HDyzSkJZM312tXgtBnJjjFPEjv/ayIrLsKQYnlzA1CQjW4wQd8IFMcq9D6WKKQMXFGE/dsvXnEUjXujZpBhaY0RnwWJU2GCl9BktebDcEKzQdlCihPxOpgvTRg5+4gb1vDn8Zs1mEqc9Ppmn7Dxt9oK0RFOTn7+/ZzHOxkm9EMkBsr1DK3i8UAA8eBoqIZeDSGG39xZUwukqOXYeZae9buocHzZwKZfZEMEPzJKK9N7Fauluc01MrSvlJgkwxH3YI0RlRUBS4LKCra0FIbA3k1OtvPOhy9MX7MtlmYlX0Havr2t7UdPtjJynhA28pxphw7hWh0o02kW0+wjaLeRZcH9Ejw8EO0b8qCeKIfZvSVCNF6w5to9h9A3RrhtxiYI7sFaETKUcPmJdOMfW7gpNz1u7EcnNrsetvwXxa4ssmQJg0nLyAM3I8bd1LD26QqekeisUaV1pu0KnadBQbJPc86Qml0K6t4YuHvvkShHdpgEIPhTHonYuXJpsMWi8Mm0mTL/bBjFyRUIf615pHrQUhrDPXnPfBTs4a1c+HuMbPXZ5S+pgh6A8Ha78OPbL1QZTZSYoEwbiPKAFryqgV1pzh9ZlgkyqBBKVHr1XlRr8Nshc2YCEHJzIse42PA7PABo6OIEMEjtkImzcsooIjTno7txKC8LyALPaT/TrZqqx73GeVw0b4s6E54efEQWlGMo6XBChh2TTsrwI5OzYn06aYZFdY6nwOgYfWfk6pG0RX258v1Ij4p2ZWIA57EhjtHMJFw99lPqikFAkjBY4fIAVO8sQQ9VpiWEXpi4SQz5QDbAiiaukEswbuEttGcEMV7eoa1uud0EaarbBri7nlI2JDK+S6QyQ7NxWI7TFRcrrHutjMFtkubjJ2bg08PE8JenZrrgFPIQPIKGOCGcAqS2Cp9LX0cXCCDDr2ImlW9puN9yO0DH1G8P/M5ZtOcTClUOh8HY5pAxh8jlANMgx7/5/a87CqltMtQi6rclptP/IdH06EHFuZSWNi6YgBGB+ELbU5y4VDTNGNlADKFE6EGZeRkpxZmF2KHsKZRgFCxLmb0PKlhBFRMiPzs0IVsepQUS5ydHXrRhyuhQwQwoJydr99NtorEmZJrbcWOPXgL2CuyK0sHvXMK6Ko2FTXcNDkT0LptZIcFrqvEeQnzvbCH3juUWVjB9FTssziKaTGW3ARH5E6jd/SvWizXU6vrd1wsmZDZfpXiNmn7Go3HWN43cGrtzSs6mXO+f0evZtBb5kH2oAvlYJzJjy5oddbUCqsJ6PpMi5nqUn1s9FjQd44C9vEHALEKvzIsHILiA8hoDGuSc0TE3BH/eWIuxgGgWcU6Sc53Oi24Z/PhAg2DnAacq4RwJ+aJPPWvI2aNhM1HSXJlrY30NZZO7624FHVF6Q+jGmZSPUgp+TqOFFva91mUrKTmOFFaQJftumxsfTJYzkn6kQ1e8TSIEeAi5N/eaRQwZoePp2LKalA+kVe6lTw2qalmolT9whkplZj1MAyk7cJPq3vPaHpXb15CujZIo3QbVSVjQ2/nIJa9ZN/2XaftZ+dCwA3zu6TkPQEoB21XG9hxpi+QkBvLg6Bxes4wSD3p45/HhAaQlY8483M6stm/ZYP+FDGu0TgQle6dR3WQKLIU2Mk1b0UAf/R5i1sqN0vXXdXUtRL/Iz/NS1n1y91TGUKnk8FToY1z9Ic9+JgCGGYYLylihnm7mh1ivrZ43uzfTtVlFr1DnDnDO+3gIqmoZnT6T3y0RKqdSRusAoxyTipIHOA7lGEodMEN8x+8adPsWGEMBoHKPFqgckuGOAa4Pe6TWfe76bN/+R1YS8H5NhePWNtZ0lWTu0xHU5JfwbrXvYXn/ppjJL2ZbS+k6ON5i3UmQf/Ywxv8k8VJ5nV6c5EBxPMjx6vjn5vYHMm05q1n+ehFLgx82b1odidyD8h13SomN3kANR5omM7sPGTNuqMJQNez2Mwj3mMt6TNMlDSwX+FPF5CKDUvADtQhGREAfvSBzSP5qaF4/5kfqbFvz/DISUgk1qtEzYg989KmTnbP8Xm3TzdMB1Swsu/vZYi3nzL2ELJzyXbho+2FXA7tO46g3MtWlT57AjjeWCOXa4H0BWht2w22if+tRFs2WcRr/GUPvOqIjojtteEqaE9u5gdsCMTEaZOGzOgOTv2VX3idkgUo3onyDG2JiENoZtUbbdEOWS/aOXUkQt6drwsv12gU9yQVai7ajWxPM+n2yMAPIpygsMO+sOK3ZuMVRdbRzET5ULHU6NrIjNiuA1n5Wd5r52GKAkqc9fGrjiIOJWu0C0EVUcqRM/nnGxVH5Eg3FBEZqREAwutWKE+nYXAcNRkb4mSA98pCEugmbV5Y2tu1ZIHDGgA3ku+q7OAfK8/gCChlzBGRMMm7dG9HciPoYKhpat2YsZUz0G/yNKmdOyo+9WKkh5uxku6NLMhQKJPNcaDbHFV1KcqOH5kIN+Nrg5CqugvxcNR1rSZi3yIzb+6sh4a0bMaCPsBHkpaorhGRW+HsWzK1JU2ezZlwthozx7NMxIurwPCysEiRl5bPbTHqJm6ft6Z2gq4DgyNNQiYWxNAVpaV6/kh6oWMnvfm2eTAKTwRjJKjwckXsdWqoEDn+CPfnZJgavLQkU8bxQQ6Tx8DvlVnjFJxXegn7l8s/40j7c/eRHkr+vzRPkZH+JmWkjw1c8o58gpWfp8vJTO8IrEJHUHRCMjpxA+VvCfDldFpqu4Ys8NfvNglgMk70gsBHNnN/3dXXlfkMC7yeeWnJXr+RdqdDKdJMtKxomCsWJfNQPr2zJyopL94HqzWYI2aiLZ+LMAJ+4hc0ppkEGKPzhNHYFEVoPsm1skxtV/KkXdmIc/8vqyt5i0Kb6YWmivWfRIMiWblUQwakngtk4HRhm8W56ZPbHWbqZkc+EJs0R5SYHDgUXRWzW38Hycn3N7qhLHRkjeEOtL35cRkcLuYMa/okxv8Z0q+fbgQGtB4c27Oi3pjE6f44s2ScepS9XAE03kkvlzT2LMxauQtmEFBYeSOGCfJit9WkPz/DVHAP5+Wk046cQ7AhfqPMwoiMu3DwtTQn/frAqppGnaTYx5xcsd8x8876TTeH7yXXNsI/CBi5t3J/Qzs+Kepw5Q/LiAvxYxeDLVXbNrQVwCbouzRfPvs326nNvRQuPOWuab0a3cBhnVW7S/xKg0Wr2wW+iazIjozFFXyOMtWu08j8uCCDLyM8KmCXFAjLuqvrhtLzzs3crWXoHXgYQhdCwGCDDe6K9AFnkBV0POhvnF+SBpkO9LkCXpI+wckRIMnN+t+/3XIlM0k8+dH9fOUDnLY3ltyuc+j/hammLZX5xvtp50RahqVOcwcqpdjoZi/jYgJNqhPJUuQzHnJmYsGx0nvIGU9BL6Y397XvOzAnTRGLN64uZwefSQOYWJUjFbO+XgWYpGe4v7QsjatOW4wDluND2x/E7mDjjT36U1+6smBydm23PbbJQ/dsSEZqK7AXGfsocXz44y2PWmQIdfkqKljP0qtO+2CJUGOwVAwhiFEjoayrsTL5w/+CP6EOuMxgbeQUHZUXr7YPqwCjqr/fp5yymU77T85vP9JuwbT770qBfrjkWH/rcvWETN3K+vMgWTPRj/Mb1fUJkEQjRrM1LRg4Vw74vf+2gN0gTeM3giJ8Wj6bnuPQD+9a0jEzn8kFTtfzcg95MvPo57uDsLk/JxE/IOEmC+zczxh61q1Sawn7kKwxHyUjJov8zej7ekzEGlqrN5e2GPHL2t2Orj7SVZ8aixgCsIZsFGx+qGfDkPJxTff8V/WWEIaeP9WujWoSqFI2WIFQPgXOMNHIefRg6ja9nOkLqWN8EE5otqwRH6cYaPXKRSbm8rVefI0Ce8By/ZpcyVUJFunTMLnDgeYSrsGmg9s9R8U5hEPPj13NjOEDYxQGf5+RObkK9TM7j+9GuuIJ+fSZsMdYAjgNQ0TxUyrid1wEJ7suXaMweUWch+zeFzNbE2UU+oh+sfCmnGA/PpaoYb9MO4M4/LXugjzcwDy2mtp2+XlWbEV3hVFVBBjRkU6NUUd1P+bkGoWJJK8BFCAaKFM58AX5GLPrCx9wlYMfwOdoWk5zS4Ih1m2uc1iStg4q8LYhwh3DvQ5AAIBP2lMvtnGpHElsDVROSl3Miwk87S8/i5S1muVsNAAS5Izv4+ai13T8MdbWn29PbdoKt/l/Z57cV56FApbkGkuXJGAjs4N6Y+XDG+tkkrmZ+wIleG0PMPvJvNqlv9T9jCxsP/+9iH/r23oXsktmZdpPfezXg57EcvoWeZ52kVaUFIbNJ8Zhr12tAN5xs/dpjwnFKo644K/HpthN0lPuuG7VZ0U8MnbEB5sVijTr4ZanZisqs7a8B894O5Pzioa3ucSr6XUoDPHebJDVhx77Ms+ya/YxH1Xt363d1/F35oHcfXs5avSKFJlhiwfvhaMxeDbzsrCENNRZrS6SYhNgeMaApgtWfc4R+ZyK0sAlRCVZ0tPpX8nYKFmNi8kPPPXEc0686ewGJDukhOp8hUTY7aABbABjJSJhOMcSRRcXV9S9dNSdM9XdjhvYyDcEZKqbukkRdUtZtGzZqJCFA2H3DQ2wGEAulmhptwxdMCxkkj2JPFPj4pUdR4bCZ9WIozJkk2ucrzDQWVZrLFyrkisTYYJuoVopQe72k8L6LdGINUiNmCoCckaosRtUjxm7VdqECzaVEslIPDSsa4t/djRqrVKjolGRo50sqZ1Ip+c8kBFmwC/a053aM9pTRqMriUbfdanRU0cXlBrdfnRqtIy+68NZiuTE6S9PHXZIeapJVshjNUkWViwlOabScCOTTG4vRUuwWgjnoHNoUmGgzldI8AtYV5+IzthnbYYNn4XOwWUGSQb2Eqropplawlg+JwHDgrDbiQTsvATR+DshGr9tUuMN8RLbuxkv84ogo1X0QSZO4MsD2HsIoMNFqCAqw+trI1BhxJQRdIFtCip776jgyYy38zvDlixByJMFR9HJOq8aA+3N4nVJ/0P0oK92EEgDrxIlFXnCoUfq10jakjX2a7lGDGSOnqnSO1MfiAUrJ38/slUozr3kVHriq1k3KhDj0MSwZTpt+mD3AgIpi1esHsCCj9sQuSdZ60S599SnRGoDT6gUFw8NdAs9foAEpNWcDBlmj28++nI95cu7EQzwQHKQOZrafDi17TZTgTNSd7LfJp0GtAVajn5cmHzEyiKQI/prIvIrVhlhPCjzfKRy/3mPLaEpVO6U1gDzUjNJZmEcCZgxVWYJxsz2MrVMkN7pYT/FslKhoMac0yRDkmnszUF1+MlScv1CQMIiFvEDOI0gTiTbCm1TNjCQ71t3jdudByt26ILCIkFPdlNBNgl4TdymIABdOMAMYCrgARXhgIYZgXraK6IVAdDFFyFSpM2nrEjmsyjKBVQXd6PN8NJ8pIRwuoo9XFXWXWO6zjPiItVBNrf+AdKSNhNNGFTcFjRDbKObt1M8Hzmr+3BJaIziXkSsOOQswfI6XkwG0KgdvmyhRFYUX1SKC9QYkLGJsTLIODqOzBaz931kiTaDZ4Cc7EReI0kbsKfkjzQlGafgN7LXYmvgKwNKjrJFuDeuajG5RW6TOySFPCAP0d0/iNT9/2fqjVtfn+f/4hX39/nPX95+/eKJ3/61jvlyqHZmwP9p/3+fdunXTwcg8u7qvhiPggLco9uHBXXmZTmArfcxL9XcdZ9WtKIVrjLAXslnA/YisT6JtgjGoCdVF9E/XHHQgjVi5gWJb3u+lV9sARhwm9qCGv93YJHS6bqe+yhVQ1VRbuvc1kntxJ0ADGgNFF/hkfHxQLWeSy4JZg1gSWuveCXdxNrdN/dw3YIbvi8j1e0QIWsQek/p0MQoRPattnHt82ekNG5uzbpjVivuRUrjZNHcS1QUP/ZQcnkpi+Y5Up2xM/wEI37lUlP1ynNL5Cpz5f1+pg4gwxpA96yPn5vL3C3mgzK+LNdjHjcxCVVKUrfT833KX4G8a/iyJ42gHri+vNT7uf5+2atquxeZ/R6IMGysA3DO2N3XFSnMdex8v5HcnDS+tYe1/Z+M7kZncMKYWHpxQfyt3zjxIBFHmfWyrEv9wiIF1GsSbqe0qls7kVks0cnzyKnB3hlj2Rk8urt571EziksoZLy54433HVlWzeImyZszo2xzu4+wlHrxDRcoqGGAHQN/WaMO9kXHYGneWb2tP/P8J2UM7MW3UTcML58Luvnh5soclKXK4Hk1ZYgSqqpKU5+mymBpJTlRXo9Dhtwmp6S+Uh9c2TmMT2JORuiMIuApI3qRXpQX93Wq86C9xrZNyY8oqSWGM0vakClvGlLKqpE39upTkB9RIlWoCrrOpY6s5S1k4OWoI6PuwDvgyqSzE34ESICUEXoCLERJZtK5vdZyhIoqK63VGHua2mttpGhahtnaytB2LLu1k6PrOe5fXa+P3ONHPiLCCgBGLyao69oKNG2q7w6LFhR5Hse+7ziGoaqMAQzHwxKjYlKLuiqDB/mg6MdZnKWJH/lRGDjc4Z5r2IZtmaqu6lqPKUyRJaBA3UKNXtjky2ChYC1KVVLy1Q16Cv2t9bVCG1DRWitRNzS926iWTKu1IWp6fY/3WvsjDEI/aB2OMYrD6M3jCSZpnJzky3la0xchTbPVtCwbZ7uX/3ufw51MlnXR5Wux2TvWZsh711zWlpwfXaVLLbcyw9zeEAqucpXNm7J2PW95mB/Qe3UwWkZWKoJK6kSXWs3BSAO1oVlT3TqOdNAauQ21vduF99GbBGPKQ4+fxBjOkimN0jA6KXgtXX0xx/yKtj+ngq4d4evxz0XXb8V72uYG171nehGj5w395EApRmpSS13QnnG89BYatV1R0zHMEw+dhg+p6zvuSYj+OBrRII5r9ZdpuHoru/aLWXjylwBiRAJ4AiT5d3mmpBNd0Nfz5MAuloEjpFcrter7KIxWtaJoHO3ydU3gJTtMyF75eFv3C9uLLUC4Smq+FmihFmmxmoS91fleOI67StF1r7m7XEw8w9nM6XvtBxIsdTJSwmWgxlTSpEaHE/bp/QfL8/iqj5xf446GGY1ONkTzEyXWUi0jOdvIk4XbXwLeQDnCIeXfD74frAQGwbVgF5tcyciWAxisDrJiq8oJAmPSSkVJGku7BKsPEOupaIpmUbtbdsVJ8wjn/SvOd+dFMAxz5aNpzs3dqU3MFLJBWn9koN9GbXMFyG3+uMkdHA4YDFKzm1kir9mas0LXtWVupekrF/XIHmPjpQp7hcU7054xCXqtV1ZApA1xU6tVL+aYGvLjTrOjAS0oIqwIniTtMpLrOibunVPXxGN1MASALe5pUUqWQAhdSUgJ3dOj8qlbsPzLtmgT+yQCtFD1LgVD4kucUpnQE81F5EgPe4GkGLKyHZ+f2PGg6zpLc3efcNy9s6ycydvJ3/7fFwCg8pEIP+xiYBdNllxMT2isOP/E17krGgT+KkTfnwZO5kgvhqhdyAj+je6EbrxrHdnBawCh1HkRBVpMkxot/zKw+o7KK3wDbTAYBP5S/98n/WCvcb1hOgfpbU/zx0wxnmYTmsTJUZ/mamMFn4Bd6xKFjYvJiC0Q6gQ41U9j+Gga5pEl3gY+Wf9AgOhrHeF20fMdv37yBbyDURQucTPf8vf+uXfBtrGQD5aMadVSLfNy9dL6WkEHNccN1gL2HMUx7i0bdfxEOmgkb1wsAuLOheZpXPO1QAtRZIZDHjl8VuVvIvlQYtRSU70ee5q2QlHkZW4lKysdFW9vxFp6VozBd0Cy4bTc609TK7SBJrxyrbVKq7Wh12QzciPcWYXTWalRP11zzNLtofFUr/vd4e0FeTrob5pfw7OEu/SRUnIvJ+TXWtC/ffrGBUBJ1zdPi+wA/B1vIwgRDSkywPTCsRoaUXMz01OpZ918KYVyHz3OvWUxa6uVCAaUXzPXLuNmr10JN1+mzqdiM/moY3mKcZLEy2JWufIWb1V7YpFZ2Pr/TfEarxn7gTTL0qVamPnatQjXDyyaLatT1kbYBiWJLaG2t41Je2dcJq5bhuugjPFaH7ccqvU1QGAKFtiKtbLXU5fFrK1Wru7Q3oSbHVjG/caIYFLDNMOYk2zkgoniJokeVSfRd4WB95oG4KTBkp7kHpeKst/jVNFk5UFUMjSDYWDZtrUEK4iVj35w7/nlwNA+Y0WwqcXncaoyYV7PVRxJ0vZ1ApczZ2C+5Jucjk2e1BzVsI0awtOop6Z5uvRrBjUtqctCLmdhAf444EDprdAeE02iVlWNZomR8HpuZSp/o2GaxhLBN/PkrwxaRJ3aEke2Si8LdB9Wp+E1UEzB0H0OK7EAAjdObMfyf8vfNu80fwLMvziRAvx+zblYfLtIo7O0BTaiAAj8j1g67sN5K3blMfSn798PEflZK7zJsWtW77G2eKUGKB40zscHe3dgXNydZDEDuRexLcPiWw+V0QzBuahbzOjoNFUFKAgGZpq9s0chNl4K6M95YogN2doHeHB+KwkWAZkcdXso8vMroxIb2CZh+z10HifZ9U+okw44f5IlHDVcD25gtQg+GoSY1RYBvxpNAr7XS5qfkGkc9VkQ6wew5VH/en4jNvhUpnTcZIXQVA3c1jjKf7JAnQce/3qi7fYpATdKyY3vjt1pptnkucvbofB4f7zCHcXDS6UjEjx6lFn34JUpbeyqEh0W+cQfiudQ3K14uu3JrFKMR6B4AKC1upLrPcSHch8uyGL+yZkCuH8oWwVqK6svHnLjCtbsXficuAhI8M9q32PdOQpbvy88Ez6l5wBXBPi+ErwPnm3vcIOmQvpp8mKaqc78ltPt3TdUTgIawJaoAwHg1ThXJo5nLdTzGnoXEhPuaZCZMZYipivDIyA/y2buYuI2VN7RF3gXzNN9GxEChMHpBnlqsBZq18j3dvqR98sODBJtmbcGLcKxtRZlB9+3GK7l73DktmwgaNaykZm81LKZ+/SRs2VJf27ZyvW6Et5GLds7ode27OB6K7TsYr95Z4/dbDbNQwV7zJctQnxZw0q/xoaexxH9Fm+gw+Wzkf1mvLV2eqbeWilKhy/PL29x1MEmmPeNeEs0hbFL+Y8rdo01a4i8MDPxrjS2we8Fz+Tq5vHsTMim585np7mpzjbc5sIZFpR21oW+LwVv0O5U0gH7YJwzdVg7Ac8kvAJ7cXq+cLJPSdCbPkmqLDR8wQmzSEgCUcwKbGGxANsdI0KSZCA2HZx7xdcjL26/8Kx61+Rr1gw+EZ99u3fN7P+C7IZMAFuUn8OEvc6MGArBlsX2QABUZ0W7sLXTDF88bWPrvIh+FjE7mFJpbHdCg4tiC0ZI3LSopE2OtuWcYe8ww1Y6mh1XSKd4UffwK4hOBeHPgeFhS5y2QdrBqD7YsJCpUcxUE9mmJmvGtBfJqsxc4MeqrpLG0ExaVtEmTt11cIjOwbSGgpjHWTo7BI7xlsrxGlRD0EC1UZo2+CrzZz44Mcy/Ps8GKvq6VjpQ1C0ZWdygj4Oy5SDaIZZSTHFf8BCTU16UyCVvfqSkvvlwk9vy5Y785K8ABVJKaf8pi7Iqm7JTphzKSYhykcJd7pHJfeWWW0GElkd5KVsw5UbjaV+8p7wKb+Tpquynogc8pL/HKlJRyzjMESr5mcqqVKzilVC1kjL4NFpPQ1UrRKFtlG/8ROU8ZYBnIwt1tVSpymoIU5WqVq3qalLLR9VwTmGqSW3V8t2bTXLC5f+YRlS/BjWsUY1rUtOa1bzIWtSyVrWuTW1rV5QGBta+DgYZLLaOdTLUEFtoqJGvgmF1rovGdU18oInhdTPSqLobUY961qvemmrmf/Upupj6al6/+ov0nNHGGtcAYxpYbIMarEVDGtowLRuuVSMa2Sjf0FqbRjemscZra4JJ4kxsXONtZbKjtPMLUdo3oYlN0qE43/JZk5tiPh2bqmmaTidTmsE0pjNVMzVLszVHc+msS/M0Xwu0kK66+UmLOKvFWkL34vleS7VMy7VCK7VKCVqtNVqrdVqvDdqoTdqsLdqqbdquHdqpXdqtPdqrfdqvAzqoQ1zmChvZpMM6oqM6xnqyk4Oc5CI3boLIQ16CdVyJOsF5/uJv/tFJndJpLJ0hK4HkIz/7sdlOYdu4ylz8cZKNurLoLMc4TkTn8MWPHnqpI1wy10jkBCc5xV72cZFLOPBhl85ThDfzmMNCFugCi5ipi7pETz8wgyRd1hVmcQEvJTGbBAL4ld84TUHiKaQAq1jJCnbT2w7qWc4GXWUda9mpZNbg4rqu6bq+hCfIFJ1hc3xBLMkVtaZjAWyYLbvj9mTdaFptp+upZAUtLoiv2dCIE893W0Qyyze847U8l3oaUkFuje4QI4zmL0e9D7ST+RDOQw97zDjI38PfStTPYTtdzNABlgx6Dge4QmcgTh0wNasurlLVvUu8+5F4XrcX0I1Y3u3TgV/HGdijcY8Ne/TZUBUqHYWok4rxo9xnyzazsvTPSlaopymt846jqcl2dbLQ3Dhfbd24KM0JCbC+UuBdZyG7CwU9jMGA8xSyh3UUql4Cida8a7oomip4tCpmikNw6JNYroytVOMV72Irt/IotrULpRoN6XsepEzyr9tmrjULCxvDtzz6VsPJDNyRvos59OF3f28gIZbZK9nPtwC254z8zA7JlPdTcDr6X27vCrvMGpwFcvCJNZUjurLc9bTHNLdQYlZF90SNt9iemRpmS2DkOcgh6hy1Y283Z87hkKPRStH3I89aZXLILmsqNFMMGrFEs2BtQ/7Qz5ERK+zHyKEQrB7zLgMUjLkhV5nL1woDpzyVk/N1w6VePE/txFx5LQ1l/kAGakMU/BvJUEnkkj251tSlYSNRfdvrZCCVopKVdIp+bj8aalSbYpOBmrabLRK5jYNqspBP9dRTT7zq1dbYNrRqa9ymbJOJXtt8pbWt2uAVSEgPdhlk4lZkAfovkAl4D6B7UgawURsY5DoYst0WMt8VAkYY0SbagBEpSIEBRswFqYT2yi6DnQJW7j3eYPcvBU1Z7/CrVTljU0T/lCkp0BSqjAEd3l1zIlXaX2o70oqsbS61Xy+FvdY0cfjlUthbS7NaL+WSihSqNmVWzu2uWOp2w/v7Xn8pEugtMLroXSja1a6HfvDr6FtbqOmkV/HGzoC1pvV142IKXbn1NhPtidmxZW820WbcVLVM8QKrevbOFOVB35J1Kly2qLqmnNTcVJjKYdjpgzYuAcFHmNEW0x+Mq+QG73muHNl8aKng/1CL4iCkjGdjukpf3FA/Qbk6CaCV+lxuM8QnxLWMlI5L4WfIpIBdLwND4uljdZxbeDKHn73sM+Kn3gq+8aDj/J1B2bqEc4bCbO6Nby6z4YanUI3/YNdJu5ZIx65t/TcXm23lx0BBF2TmYbHA4DT/AgXYzsPFj7zkWfx5Szk6ViZL5irkh8B2MM/HY5v9U98DyNrdR8cN2PzZublKRmu+RK3ZHE8/uGGffE7OQy+k4zXY7gEA)format("woff2");font-weight:100 900;font-style:normal;font-display:swap}:root{--brand-background:#080909;--brand-foreground:#f4f2eb;--brand-muted:#9b9d98;--brand-gold:#f5c842;--brand-gold-bright:#ffe174;--brand-line:#ffffff12;--brand-display:"Geist Pixel Line", ui-monospace, monospace;color:#eee;font-synthesis:none;text-rendering:optimizelegibility;--bg:var(--brand-background);--surface:#141414;--card:#161616;--elevated:#1a1a1a;--hover:#1f1f1f;--active:#2a2a2a;--border:#2a2a2a;--border-subtle:#1f1f1f;--text:var(--brand-foreground);--muted:#888;--dim:#666;--primary:var(--brand-gold);--primary-soft:#312900;--cyan:#22d3ee;--green:#7ed4a3;--red:#e87a7a;--amber:#f59e0b;--mono:"JetBrains Mono", "SFMono-Regular", ui-monospace, monospace;background:#0a0a0a;font-family:Inter,ui-sans-serif,system-ui,sans-serif}*{box-sizing:border-box}body{background:var(--bg);min-width:320px;min-height:100vh;color:var(--text);margin:0}button,input,select{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.45}.local-shell{flex-direction:column;min-height:100vh;display:flex}.local-header{background:var(--surface);border-bottom:1px solid var(--border);justify-content:space-between;align-items:center;gap:20px;min-height:56px;padding:0 20px;display:flex}.brand-mark{font:600 13px var(--mono);letter-spacing:.02em;white-space:nowrap;align-items:center;gap:9px;display:inline-flex}.brand-symbol{border:1px solid var(--primary);width:24px;height:24px;color:var(--primary);font:600 14px var(--mono);border-radius:50%;place-items:center;display:grid}.local-nav{align-items:center;gap:4px;display:flex}.nav-tab{color:var(--muted);font:500 12px var(--mono);text-transform:capitalize;background:0 0;border:0;border-radius:999px;padding:7px 12px}.nav-tab:hover,.nav-tab.active{background:var(--active);color:var(--text)}.nav-tab.active{box-shadow:inset 0 -1px var(--primary)}.local-content{flex:1;width:min(100%,1120px);margin:0 auto;padding:28px 20px 42px}.center-state{place-items:center;min-height:50vh;display:grid}.local-footer{border-top:1px solid var(--border-subtle);color:var(--dim);font:10px var(--mono);letter-spacing:.15em;align-items:center;gap:8px;padding:12px 20px;display:flex}.status-dot{background:var(--green);border-radius:50%;width:6px;height:6px;box-shadow:0 0 8px #7ed4a399}.page-header{margin-bottom:24px}.eyebrow,.section-label{color:var(--muted);font:600 10px var(--mono);letter-spacing:.18em;text-transform:uppercase;margin:0 0 9px}.eyebrow span{color:var(--primary)}h1,h2,h3,p{margin-top:0}h1{letter-spacing:-.03em;margin-bottom:8px;font-size:clamp(24px,5vw,34px)}h2{margin-bottom:8px;font-size:18px}h3{margin-bottom:8px;font-size:14px}.page-description{max-width:720px;color:var(--muted);margin-bottom:0;font-size:14px;line-height:1.55}.surface{border:1px solid var(--border);background:var(--card);border-radius:10px}.surface+.surface{margin-top:16px}.surface-header{border-bottom:1px solid var(--border);justify-content:space-between;align-items:flex-start;gap:16px;padding:16px 18px;display:flex}.surface-body{padding:18px}.button{color:#080808;border:1px solid #0000;border-radius:6px;padding:9px 14px;font-size:13px;font-weight:600;transition:filter .15s,background .15s}.button:hover:not(:disabled){filter:brightness(1.1)}.button-primary{background:var(--primary)}.button-secondary{border-color:var(--border);background:var(--elevated);color:var(--text)}.button-danger{background:var(--red)}.notice{border:1px solid var(--border);border-radius:7px;padding:11px 13px;font-size:13px;line-height:1.45}.notice-info{color:#c4e5f1;background:#152028;border-color:#244050}.notice-warning{color:#fbd27d;background:#30250d;border-color:#5b4614}.notice-error{color:#ffc3c3;background:#321a1a;border-color:#633}.notice-success{color:#c3f5d7;background:#162b20;border-color:#2a5a42}.spinner-row{color:var(--muted);font:12px var(--mono);align-items:center;gap:9px;display:flex}.spinner{border:2px solid var(--border);border-top-color:var(--cyan);border-radius:50%;width:16px;height:16px;animation:.7s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.grid{gap:14px;display:grid}.grid-stats{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-two{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-three{grid-template-columns:repeat(3,minmax(0,1fr))}.stat-card{border:1px solid var(--border);background:var(--surface);border-radius:8px;min-width:0;padding:15px}.stat-label,.data-label{color:var(--dim);font:600 10px var(--mono);letter-spacing:.1em;text-transform:uppercase}.stat-value{color:var(--text);font:20px var(--mono);text-overflow:ellipsis;white-space:nowrap;margin-top:8px;overflow:hidden}.table{border:1px solid var(--border);background:var(--surface);border-radius:8px;overflow:hidden}.table-row{border-bottom:1px solid var(--border-subtle);grid-template-columns:1fr 1.5fr .55fr .75fr .65fr;align-items:center;gap:10px;min-height:42px;padding:0 14px;display:grid}.table-row:last-child{border-bottom:0}.table-row:hover{background:var(--hover)}.table-head{color:var(--dim);font:600 10px var(--mono);letter-spacing:.08em;text-transform:uppercase}.mono{font-family:var(--mono)}.dim{color:var(--muted)}.empty{color:var(--dim);font:12px var(--mono);text-align:center;padding:28px 16px}.error-box{color:#ffc3c3;background:#321a1a;border:1px solid #633;border-radius:7px;padding:11px 13px;font-size:13px;line-height:1.45}.search-row{gap:8px;margin:16px 0;display:flex}.field,.select{border:1px solid var(--border);background:var(--elevated);width:100%;color:var(--text);border-radius:6px;outline:none;padding:9px 10px}.field:focus,.select:focus{border-color:var(--cyan);box-shadow:0 0 0 2px #22d3ee1f}.field-label{color:var(--muted);font:11px var(--mono);gap:6px;display:grid}.field-label+.field-label{margin-top:13px}.data-list{border:1px solid var(--border);border-radius:7px;gap:0;display:grid;overflow:hidden}.data-row{border-bottom:1px solid var(--border-subtle);justify-content:space-between;gap:16px;padding:11px 13px;display:flex}.data-row:last-child{border-bottom:0}.data-value{max-width:72%;color:var(--text);font:12px var(--mono);text-align:right;overflow-wrap:anywhere}.address-row{color:#c4e5f1;background:#152028;border:1px solid #244050;border-radius:7px;align-items:center;gap:10px;margin-top:12px;padding:11px 13px;display:flex}.address-row code{min-width:0;font:12px var(--mono);text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}.copy-button{color:inherit;font:11px var(--mono);background:0 0;border:0}.ordinal-card,.asset-card{border:1px solid var(--border);background:var(--surface);border-radius:8px;overflow:hidden}.ordinal-image{aspect-ratio:1.25;background:var(--elevated);color:var(--dim);place-items:center;display:grid}.ordinal-image img{object-fit:cover;width:100%;height:100%}.ordinal-info,.asset-info{padding:11px 13px}.ordinal-name,.asset-name{color:var(--text);text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:600;overflow:hidden}.ordinal-meta{color:var(--muted);font:11px var(--mono);justify-content:space-between;gap:8px;margin-top:5px;display:flex}.form-actions{flex-wrap:wrap;gap:8px;margin-top:16px;display:flex}.stack-surface,.stack-grid{margin-top:16px}.asset-selected{border-color:var(--primary);box-shadow:inset 0 0 0 1px var(--primary)}.migration-footnote{margin:20px 0 0;font-size:11px;line-height:1.5}.source-row{border-bottom:1px solid var(--border-subtle);justify-content:space-between;align-items:center;gap:12px;padding:12px 0;display:flex}.source-row:last-child{border-bottom:0}.source-meta{gap:4px;min-width:0;display:grid}.source-title{font:600 13px var(--mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.source-detail{color:var(--muted);font-size:12px}.role-grid{gap:10px;display:grid}.role-row{border:1px solid var(--border);background:var(--surface);border-radius:7px;gap:7px;padding:11px;display:grid}.role-label{color:var(--text);font-size:13px;font-weight:600}.role-help{color:var(--muted);font-size:11px}.progress-track{background:var(--elevated);border-radius:999px;height:8px;margin:12px 0;overflow:hidden}.progress-bar{background:var(--primary);height:100%;transition:width .2s}.json-preview{border:1px solid var(--border);background:var(--elevated);color:#c8d3db;max-height:280px;font:11px/1.5 var(--mono);white-space:pre-wrap;border-radius:7px;margin:14px 0;padding:12px;overflow:auto}.mobile-stack{display:contents}@media (width<=760px){.local-header{flex-direction:column;align-items:flex-start;padding:13px 16px}.local-nav{width:100%;overflow-x:auto}.nav-tab{padding-inline:10px}.local-content{padding:22px 14px 36px}.grid-stats,.grid-three{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-two{grid-template-columns:1fr}.table-row{grid-template-columns:.7fr 1.4fr .5fr}.table-row>:nth-child(n+4){display:none}}@media (prefers-reduced-motion:reduce){*,:before,:after{transition-duration:.01ms!important;animation-duration:.01ms!important}}.setup-shell{--muted:#a4a4a4;--dim:#929292}.setup-shell .local-header{background:0 0;min-height:72px;padding-inline:32px}.setup-shell .brand-mark{gap:12px;font-family:inherit;font-size:15px}.setup-shell .brand-symbol{width:30px;height:30px}.setup-shell .local-content{width:min(100%,736px);padding:64px 28px 80px}.setup-shell .page-header{margin-bottom:32px}.setup-shell .eyebrow{letter-spacing:.04em;font-size:13px;font-weight:500;line-height:1.5}.setup-shell .eyebrow>span{display:none}.setup-shell h1{margin-bottom:14px;font-size:clamp(30px,5vw,40px);font-weight:600;line-height:1.15}.setup-shell h2{font-size:21px;line-height:1.35}.setup-shell h3{font-size:17px}.setup-shell .page-description{font-size:16px;line-height:1.65}.setup-shell .surface{border-radius:16px}.setup-shell .surface-body{padding:28px}.setup-shell .surface-header{padding:24px 28px}.setup-shell .source-row{align-items:flex-start;gap:24px;padding:24px 0}.setup-shell .source-row:first-child{padding-top:8px}.setup-shell .source-row:last-child{padding-bottom:8px}.setup-shell .source-meta{gap:10px}.setup-shell .source-title{white-space:normal;font-family:inherit;font-size:17px;font-weight:600;line-height:1.4}.setup-shell .source-detail{font-size:15px;line-height:1.6}.setup-shell details{margin-top:8px}.setup-shell summary{cursor:pointer;color:var(--muted);padding-block:6px;font-size:14px}.setup-shell .button{border-radius:9px;flex-shrink:0;min-height:46px;padding:12px 20px;font-size:15px}.setup-shell .field,.setup-shell .select{border-radius:9px;min-height:48px;padding:12px 14px;font-size:16px}.setup-shell .field-label{gap:10px;font-family:inherit;font-size:15px;font-weight:500;line-height:1.5}.setup-shell .field-label+.field-label{margin-top:24px}.setup-shell .form-actions{align-items:center;gap:16px;margin-top:28px;margin-bottom:24px}.setup-shell .notice{padding:16px 18px;font-size:15px;line-height:1.6}.setup-shell .migration-footnote{margin-top:28px;font-size:13px;line-height:1.7}.setup-shell .local-footer{letter-spacing:.06em;justify-content:center;padding:20px;font-family:inherit;font-size:11px;line-height:1.5}.setup-shell button:focus-visible,.setup-shell summary:focus-visible{outline:2px solid var(--primary);outline-offset:4px}@media (width<=600px){.setup-shell .local-header{min-height:64px;padding:16px 24px}.setup-shell .local-content{padding:36px 20px 48px}.setup-shell .surface-body{padding:22px}.setup-shell .source-row{flex-direction:column;gap:16px}.setup-shell .source-row .button{width:100%}}.setup-choices{gap:16px;display:grid}.setup-choice{border:1px solid var(--border);text-align:left;background:var(--card);width:100%;color:var(--text);border-radius:16px;align-items:center;gap:20px;padding:28px;transition:border-color .15s,background .15s;display:flex}.setup-choice:hover{background:var(--elevated);border-color:#69604a}.setup-choice>span:nth-child(2){flex:1;gap:8px;display:grid}.setup-choice strong{font-size:18px;font-weight:600}.setup-choice strong+span{color:var(--muted);font-size:15px;line-height:1.6}.choice-icon{color:var(--primary);text-align:center;width:28px;font-size:28px}.choice-arrow{color:var(--muted);font-size:22px}.setup-reassurance{color:var(--muted);text-align:center;margin:12px 0 0;font-size:13px;line-height:1.6}@media (width<=600px){.setup-choice{gap:16px;padding:22px}}.source-location{font:12px/1.6 var(--mono);color:var(--muted);overflow-wrap:anywhere;background:var(--bg);border-radius:6px;padding:10px 12px}.file-list{margin:8px 0 0;padding:0;list-style:none}.file-list li{color:var(--muted);border-top:1px solid var(--border-subtle);padding:10px 0;font-size:13px;line-height:1.6}.setup-shell .source-meta p{margin-bottom:0}.wallet-source-choice{flex-direction:column;align-items:flex-start;gap:5px;width:100%;margin-block:12px;padding:20px 22px}.wallet-source-choice>span{color:var(--muted);overflow-wrap:anywhere;font-size:14px;line-height:1.5;display:block}.wallet-source-choice>strong{font-size:17px}.wallet-source-choice+.field-label{margin-top:24px}.checkbox-field{align-items:flex-start;gap:10px;line-height:1.5;display:flex}.checkbox-field input{margin-top:5px}.tool-cloud-section{text-align:center;margin-top:24px;position:relative}.tool-cloud-section h2{letter-spacing:-.025em;font-size:22px}.tool-cloud{width:100%;height:clamp(230px,36dvh,320px);margin:6px auto 0;padding:0;list-style:none;position:relative}.tool-cloud li{width:max-content;transition:opacity .45s,left .75s,top .75s;position:absolute;transform:translate(-50%,-50%)}.tool-cloud li.is-fading{opacity:0}.tool-cloud-word{color:#a8a8a8;letter-spacing:-.045em;white-space:nowrap;background:0 0;border:0;padding:2px 0;line-height:1.15;transition:color .2s;display:block}.tool-cloud-weight-0{color:#eee9d9;font-weight:650}.tool-cloud-weight-1{color:#ceb957;font-weight:500}.tool-cloud-weight-2{color:#85837a;font-weight:400}.tool-cloud-weight-3{color:#dedbd1;font-weight:550}.tool-cloud-weight-4{color:#ad9f70;font-weight:400}.tool-cloud-word:hover,.tool-cloud-word:focus{color:var(--primary)}.tool-cloud-word:focus-visible{outline:2px solid var(--primary);outline-offset:5px;border-radius:2px}.tool-cloud-popover{z-index:100;text-align:left;pointer-events:none;background:linear-gradient(145deg,#27251e,#161612);border:1px solid #514a31;border-radius:12px;width:280px;max-width:calc(100vw - 24px);padding:18px 20px;animation:.16s ease-out cloud-popover-in;position:fixed;box-shadow:0 12px 40px #0009}.tool-cloud-popover strong{color:#f0e9d3;font-size:15px;display:block}.tool-cloud-popover code{font:10px var(--mono);color:#bca85d;overflow-wrap:anywhere;margin-top:5px;display:block}.tool-cloud-popover p{color:#bbb8ad;max-height:160px;margin:12px 0 0;font-size:12px;line-height:1.6;overflow:auto}@keyframes cloud-popover-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.setup-shell:has(.tool-cloud-section) .local-content{padding-top:20px;padding-bottom:16px}@media (prefers-reduced-motion:reduce){.tool-cloud li,.tool-cloud-word{transition:none}.tool-cloud-popover{animation:none}}@media (height<=750px){.setup-shell:has(.tool-cloud-section) .local-header{min-height:52px;padding-block:10px}.setup-shell:has(.tool-cloud-section) .page-header{margin-bottom:18px}.setup-shell:has(.tool-cloud-section) .notice{padding:10px 14px;font-size:13px}.setup-shell:has(.tool-cloud-section) .local-footer{padding:12px}.setup-shell:has(.tool-cloud-section) .tool-cloud-section{margin-top:16px}.setup-shell:has(.tool-cloud-section) .tool-cloud{height:230px}}.setup-shell:has(.wallet-ready) .local-header{border:0;min-height:84px;padding:20px 3.2vw}.setup-shell:has(.wallet-ready) .brand-mark{letter-spacing:.12em;font-size:19px}.setup-shell:has(.wallet-ready) .brand-symbol{color:#f2c969;border-color:#f2c969;width:38px;height:38px;font-style:normal;transform:none}.setup-shell:has(.wallet-ready) .local-content{width:100%;padding:0 3.2vw;display:flex}.wallet-ready{grid-template-columns:.85fr 1.4fr;align-items:center;gap:20px;width:100%;min-height:calc(100dvh - 144px);display:grid}.ready-copy{padding-bottom:35px}.ready-check{color:#efc565;border:2px solid #efc565;border-radius:50%;place-items:center;width:48px;height:48px;margin-bottom:22px;font-size:30px;display:grid}.ready-eyebrow{color:#c3bca9;text-transform:uppercase;font:11px var(--mono);letter-spacing:.28em;margin-bottom:30px}.setup-shell .wallet-ready h1{letter-spacing:-.055em;color:#f3eddd;margin-bottom:30px;font-family:Georgia,Times New Roman,serif;font-size:clamp(38px,4.5vw,76px);font-weight:400;line-height:1.04}.ready-description{color:#a7a397;font-size:clamp(13px,1.3vw,19px);line-height:1.8}.wallet-ready .tool-cloud-section{min-width:0;height:min(74dvh,740px);margin:0}.wallet-ready .tool-cloud{height:100%;margin:0}.cloud-orbits{stroke:#9b86462b;stroke-width:.5px;pointer-events:none;width:100%;height:100%;position:absolute;inset:0}.cloud-orbits circle{fill:#cfa955;stroke:none}.tool-cloud li{transition:opacity .65s;animation:.8s both cloud-word-in}.tool-cloud li.is-fading{opacity:0;animation:none}.tool-cloud-word{letter-spacing:0;padding:0;font-family:Georgia,Times New Roman,serif;font-weight:400;line-height:.94}.tool-cloud-word span{display:block}.tool-cloud-weight-0,.tool-cloud-weight-3{color:#eee6d4;font-weight:400}.tool-cloud-weight-1,.tool-cloud-weight-4{color:#edc266;font-weight:400}.tool-cloud-weight-2{color:#a5a296}.tool-cloud-popover strong{color:#edc266;font:21px Georgia,serif}.setup-shell:has(.wallet-ready) .local-footer{font:9px var(--mono);letter-spacing:.25em;border:0;justify-content:space-between;padding:20px 3.2vw}.setup-shell:has(.wallet-ready) .local-footer .status-dot{display:none}@keyframes cloud-word-in{0%{opacity:0}to{opacity:1}}@media (width<=760px){.wallet-ready{grid-template-columns:1fr;align-content:center;gap:0;min-height:calc(100dvh - 110px)}.ready-copy{padding:15px 12px 0}.ready-check{width:30px;height:30px;margin-bottom:12px;font-size:20px}.ready-eyebrow{margin-bottom:14px;font-size:9px}.setup-shell .wallet-ready h1{margin-bottom:14px;font-size:39px}.ready-description{margin-bottom:0;font-size:12px}.wallet-ready .tool-cloud-section{height:clamp(270px,44dvh,440px)}.setup-shell:has(.wallet-ready) .local-header{min-height:60px;padding:12px 24px}}@media (prefers-reduced-motion:reduce){.tool-cloud li{transition:none;animation:none}}.setup-shell:has(.wallet-ready) .tool-cloud{height:100%}.setup-shell:has(.wallet-ready) .brand-symbol{font-size:25px}@media (width<=760px){.setup-shell:has(.wallet-ready) .local-content{padding-bottom:0}}.setup-shell:has(.wallet-ready){background:radial-gradient(ellipse at 74% 46%, #8d65130a, transparent 65%), var(--brand-background)}.setup-shell .wallet-ready h1{font-family:var(--brand-display);letter-spacing:-.065em;font-size:clamp(34px,3.6vw,62px);font-weight:400;line-height:1.15}.wallet-ready .tool-cloud-word{font-family:var(--brand-display);letter-spacing:-.045em;font-weight:400;line-height:1.03}.wallet-ready .tool-cloud-weight-0,.wallet-ready .tool-cloud-weight-3{color:var(--brand-foreground)}.wallet-ready .tool-cloud-weight-1,.wallet-ready .tool-cloud-weight-4{color:var(--brand-gold)}.tool-cloud-popover strong{font-family:var(--brand-display);font-size:20px}@media (width<=760px){.setup-shell .wallet-ready h1{font-size:clamp(30px,7.5vw,44px)}}svg.brand-symbol{background:0 0;border:0;border-radius:0}
|
|
118
126
|
/*$vite$:1*/</style>
|
|
119
127
|
</head>
|