neko-harness 0.4.2 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,391 +0,0 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},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 re(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function E(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?E(``+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(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function D(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,D(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ae(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(ie,`$&/`)+`/`),D(o,r,i,``,function(e){return e})):o!=null&&(re(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(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ae(a,u),c+=D(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+ae(a,u++),c+=D(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return D(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 se(e,t,n){if(e==null)return e;var r=[],i=0;return D(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ce(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 le=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 ue(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,le)}catch(e){le(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function de(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else ue(de.bind(null,e))}var fe={map:se,forEach:function(e,t,n){se(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return se(e,function(){t++}),t},toArray:function(e){return se(e,function(e){return e})||[]},only:function(e){if(!re(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=fe,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=de,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)!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=re,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ce}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=ue,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.0`})),d=o(((e,t)=>{t.exports=u()})),f=l(d(),1),p=f.useLayoutEffect;function m(e){return e[e.length-1]}function h(e,t){return typeof e==`function`?e(t):e}var g=Object.prototype.hasOwnProperty;function _(e){for(let t in e)if(g.call(e,t))return!0;return!1}var v=()=>Object.create(null),y=(e,t)=>b(e,t,!0);function b(e,t,n,r=0){if(e===t)return e;if(r++>500)return t;let i=Array.isArray(e)&&Array.isArray(t);if(!i&&!(x(e)&&x(t)))return t;let a=Object.keys(e),o=a.length,s=Object.keys(t),c=s.length;if(i?o!==e.length||c!==t.length||o&&m(a)!==`${o-1}`||c&&m(s)!==`${c-1}`:o!==Object.getOwnPropertyNames(e).length||c!==Object.getOwnPropertyNames(t).length||Object.getOwnPropertySymbols(t).length)return t;let l=0,u,d,f;if(i){for(;l<c&&(f=l,d=e[f],u=t[f],u=d===u?d:typeof d==`object`?b(d,u,n,r):u,u===d);l++);if(l===c&&o===c)return e}else{let i=o===c,p=!0;for(;l<c;l++){f=s[l],d=e[f];let o=t[f];u=d===o?d:typeof d==`object`?b(d,o,n,r):o,i&&=u===d&&(a[l]===f||g.call(e,f)),p&&=Object.is(u,o),a[l]=u}if(i)return Object.getOwnPropertySymbols(e).length?t:e;if(p)return t}let p=i?s.fill(0):n?v():{};for(let o=0;o<c;o++)f=i?o:s[o],i?(d=e[f],o>l&&(u=t[f],u=d===u?d:typeof d==`object`?b(d,u,n,r):u),p[f]=o<l?d:u):p[f]=a[o];return p}function x(e){return!e||typeof e!=`object`?!1:(Object.getPrototypeOf(e)?.constructor??Object)===Object}function S(e,t,n,r){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let i=0,a=e.length;i<a;i++){let a=e[i],o=t[i];if(a!==o&&!S(a,o,n,r))return!1}return!0}if(x(e)&&x(t)){if(n){for(let i in t)if((r||t[i]!==void 0)&&!S(e[i],t[i],n,r))return!1;return!0}let i=0;if(r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;for(let a in t)if((r||t[a]!==void 0)&&(i--===0||!S(e[a],t[a],n,r)))return!1;return i===0}return!1}var C=/[\x00-\x1f\x7f"<>`{}]/g;function w(e){return e.replace(C,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function T(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return w(t)}var ee=[`http:`,`https:`,`mailto:`,`tel:`];function te(e){if(e[0]!==`/`&&e.includes(`:`))return/^[\x00-\x20]*([a-z][a-z\d+.\t\n\r-]*:)/i.exec(e)?.[1]?.replace(/[\t\n\r]/g,``).toLowerCase()}var ne=/^[\x00-\x20]*[\\/][\t\n\r]*[\\/]/;function re(e,t){if(!e)return!1;if(ne.test(e))return!0;let n=te(e);return n?!t.has(n):!1}function E(e){if(!e)return e;let t=e;if(/[%\\\x00-\x1f\x7f]/.test(e)){let n=/%25|%5C/gi,r=0,i;for(t=``;(i=n.exec(e))!==null;)t+=T(e.slice(r,i.index))+i[0],r=n.lastIndex;t+=T(r?e.slice(r):e)}return t}function ie(e){return/[\s\u0080-\uFFFF]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function ae(e,t){if(e===t)return!0;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 oe(){throw Error(`Invariant failed`)}function D(e){return e.replace(/\/{2,}/g,`/`)}function se(e){return e===`/`?e:e.replace(/^\/+/,``)}function ce(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/+$/,``):e}function le(e){return ce(se(e))}function ue(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function de(e,t,n=`never`,r){if(t.includes(`//`)&&(t=D(t)),t.startsWith(`/`))return t.length===1||n===`preserve`?t:n===`always`?t.endsWith(`/`)?t:`${t}/`:t.endsWith(`/`)?t.slice(0,-1):t;let i=t===`.`,a;if(r){a=i?e:e+`\0`+t;let n=r.get(a);if(n)return n}let o;if(i)o=e.split(`/`);else{for(e.includes(`//`)&&(e=D(e)),o=e.split(`/`);o.length>1&&m(o)===``;)o.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&o.push(r):o=[r]:r===`..`?o.length>1?o.pop():o=[``]:r===`.`||o.push(r)}}o.length>1&&(m(o)===``?n===`never`&&o.pop():n===`always`&&o.push(``));let s=o.join(`/`),c=(i?D(s):s)||`/`;return a&&r&&r.set(a,c),c}function fe(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=new RegExp([...t.keys()].join(`|`).replace(/[.*()]/g,`\\$&`),`g`);return e=>e.replace(n,e=>t.get(e)??e)}function pe(e){return e==null||e===``}function me(e,t,n){if(typeof t!=`string`)return``+(t??void 0);let r=e===`_splat`;if(r&&(!t||/^[a-zA-Z0-9\-._~!/]*$/.test(t)))return t;let i=encodeURIComponent(t);return r&&(i=i.replaceAll(`%2F`,`/`)),n?n(i):i}function he(e,t,n,r,i){let a=e.endsWith(`/`)?`/`:``,o=``;for(let e of t){if(typeof e==`string`){o+=e;continue}let[t,s,c,l]=e,u=t===2,d=u&&l!==void 0?l+a:l,f=n[s];if(t!==3||f!=null){if(i&&(i[s]=f,u&&(i[`*`]=f)),u&&pe(f)){if(c===`/`&&!d)continue;f=``}o+=c+me(s,f,r)+(d||``)}}return o+a||`/`}function ge(e){return e?.isNotFound===!0}function _e(){try{return sessionStorage}catch{return}}var ve=`tsr-scroll-restoration-v1_3`,ye=_e();function be(){try{return JSON.parse(ye?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}var O=be(),k=`data-scroll-restoration-id`,xe=e=>e.state.__TSR_key||e.href;function Se(e){let t=e.getAttribute(k);if(t)return`[${k}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var Ce=!1,we=`window`;function Te(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function Ee(e){let t=new Set;for(let n of e){if(n===we)continue;let e=Te(n);e&&t.add(e)}return t}function De(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.e=!0);let i=e.options.getScrollRestorationKey||xe,a=new Set,o=e=>{let t=O[e]||={};for(let e of a)e===document?t[we]={scrollX,scrollY}:e.isConnected&&(t[Se(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.s&&(r.s=!0,Ce=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{Ce||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{history.scrollRestoration=`auto`,o(i(e.stores.resolvedLocation.get()??e.stores.location.get()));try{ye?.setItem(ve,JSON.stringify(O))}catch{}}),addEventListener(`pageshow`,e=>{e.persisted&&(history.scrollRestoration=`manual`)})),!r.r&&(r.r=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.n,c=r.h,l;if(a.clear(),r.n=!0,r.h=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.e&&d&&d!==u){let e=O[d];if(e){let t=O[u];for(let n in e){if(n===we){if(s)continue}else{let e=Te(n);if(!e||s&&o&&(l??=Ee(o),l.has(e)))continue}t||=O[u]={},t[n]??=e[n]}}}Ce=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=Ee(o));let t=e&&i&&c,s=r.e?O[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===we){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=Te(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{Ce=!1}}))}function Oe(e,t=String){let n;for(let r in e){let i=e[r];i!==void 0&&(n||=new URLSearchParams).set(r,t(i))}return n?n.toString():``}function ke(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Ae(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=ke(r):Array.isArray(t)?t.push(ke(r)):n[e]=[t,ke(r)]}return n}var je=/^(?:\s|["[{\d-]|fa|nu|tr)/,Me=Pe(JSON.parse),Ne=Fe(JSON.stringify,JSON.parse);function Pe(e){let t=e===JSON.parse;return n=>{n[0]===`?`&&(n=n.slice(1));let r=Ae(n);for(let n in r){let i=r[n];if(typeof i==`string`){if(t&&!je.test(i))continue;try{r[n]=e(i)}catch{}}}return r}}function Fe(e,t){let n=t===JSON.parse;function r(r){if(r&&typeof r==`object`)try{return e(r)}catch{}else if(t&&typeof r==`string`){if(n&&!je.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=Oe(e,r);return t?`?${t}`:``}}var Ie=`__root__`;function Le(e){e.statusCode=e.statusCode||e.code||307;let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Re(e){return e instanceof Response&&!!e.options}function ze(e){let t=new Map,n,r;return{get(e){let n=t.get(e);if(n)return n.visited=!0,n.value},set(i,a){let o=t.get(i);if(o){o.value=a;return}if(t.size>=e){let e=n?.next().value;for(;!e||e.visited;)e?e.visited=!1:n=t.values(),e=n.next().value;e===r&&(n=void 0),t.delete(e.key)}let s={key:i,value:a,visited:!1};r=s,t.set(i,s)},clear(){t.clear(),n=void 0,r=void 0}}}var Be=4,Ve=5;function He(e){let t=e.names;if(t)return t;let n=[];for(let t of e)typeof t!=`string`&&n.push(t[1]);return e.names=n}function Ue(e,t,n){let r=e.slice(t,n);if(r.charCodeAt(0)===36)return r.length===1?[2,`_splat`,``,void 0]:[1,r.slice(1),``,``];let i=r.indexOf(`{`);if(i>=0){let a=r.indexOf(`}`,i),o=r.charCodeAt(i+1)===45,s=i+(o?3:2);if(a>=0&&r.charCodeAt(s-1)===36&&(!o||s<a)){let c=r.slice(s,a);return[o?3:c?1:2,c||`_splat`,r.slice(0,i),e.slice(t+a+1,c?n:e.length)]}}return r}function We(e,t,n,r,i,a){let o=n,s=t.fullPath??t.from,c=t.options,l=s.length,u=s.endsWith(`/`)?l-1:l,d=c?.caseSensitive??e,f=c?.params?.parse??c?.parseParams,p,h=a?n-1:0;if(!r||s.includes(`$`)){p=a?.slice()??[];let e=m(p);e&&typeof e!=`string`&&e[0]===2&&(p[p.length-1]=[e[0],e[1],e[2],e[3]===void 0?void 0:e[3]+s.substring(n-(s[n-2]===`/`?2:1),u)],h=l)}for(;o<l;){let e=o,t=s.indexOf(`/`,e),n=t===-1?l:t,a=Ue(s,e,n);o=n+1;let c;if(typeof a==`string`){if(!r)continue;let e=a,t;d?t=r.static??=new Map:(e=a.toLowerCase(),t=r.staticInsensitive??=new Map);let n=t.get(e);if(n)c=n;else{let n=Ke(r);c=n,t.set(e,n)}}else{let t=a[0],m=a[2],g=a[3]??``;if(t===2&&(n=l,o=n+1),p&&h<n&&(h<e-1&&p.push(s.slice(h,e-1)),a[2]=`/`+m,t===2&&a[3]!==void 0&&u<l&&(a[3]=g.slice(0,-1)),p.push(a),h=n),!r)continue;let _=d&&!!(m||g);d||(m=m.toLowerCase(),g=g.toLowerCase());let v=t===1?r.dynamic??=[]:t===3?r.optional??=[]:r.wildcard??=[],y=t!==2&&!f&&v.find(e=>!e.parse&&e.caseSensitive===_&&e.prefix===m&&e.suffix===g);if(y)c=y;else{let e=Ke(r,t,_,m,g);c=e,v.push(e),v.length===2&&i?.push(v)}}r=c}p&&h<u&&p.push(s.slice(h,u));let g=p?.slice();if(!r)return g;if(f&&t.children&&!t.isRoot&&t.id&&t.id.charCodeAt(t.id.lastIndexOf(`/`)+1)===95){let e=Ke(r,Ve);(r.pathless??=[]).push(e),r=e}let _=(t.path||!t.children)&&!t.isRoot;if(_&&u<l){let e=Ke(r,Be);r.index=e,r=e}return r.parse=f??null,r.priority=c?.params?.priority??0,r.route||(r.data=g,_&&(r.route=t)),[r,o,g]}function Ge(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Ke(e,t=0,n,r,i){return{kind:t,depth:e?e.depth+1:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,data:void 0,parent:e,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function qe(e,t){let n=Ke(),r=[];function i(e,t,n,a){let[o,s,c]=We(!1,e,t,n,r,a);if(e.children)for(let t of e.children)i(t,s,o,c)}for(let t of e)i(t,1,n);for(let e of r)e.sort(Ge);t.masksTree=n,t.flatCache=ze(1e3)}function Je(e,t){e||=`/`;let n=t.flatCache.get(e);if(n!==void 0)return n;let r=Qe(e,t.masksTree);return t.flatCache.set(e,r),r}function Ye(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=Ke(),We(t,{from:e},1,o),i.singleCache.set(a,o)),Qe(r,o,n)}function Xe(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=Qe(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=et(a.route)),t.matchCache.set(r,a),a}function Ze(e,t=!1){let n=Ke(),r=[],i={},a={},o=0;function s(e,n,c,l){if(e.init(o),e.id in i&&oe(),i[e.id]=e,o!==0&&e.path){let t=ce(e.fullPath);(!a[t]||e.fullPath.endsWith(`/`))&&(a[t]=e)}o++;let[u,d,f]=We(t,e,n,c,r,l);if(e._interpolation=f,e.children)for(let t of e.children)s(t,d,u,f)}s(e,1,n);for(let e of r)e.sort(Ge);return{processedTree:{segmentTree:n,singleCache:ze(1e3),matchCache:ze(1e3),flatCache:null,masksTree:null},routesById:i,routesByPath:a}}function Qe(e,t,n=!1){let r=e.split(`/`),i=nt(e,r,t,n);if(!i)return null;let[a]=$e(e,r,i);return{route:i.node.route,rawParams:a}}function $e(e,t,n){let r=tt(n.node),i=n.node.data&&He(n.node.data),a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.param??0;for(;s<r.length;o++,s++,c++){let u=r[s];if(u.kind===Be)break;if(u.kind===Ve){o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1||u.kind===3){let e=i[l++];if(u.kind===3&&n.skipped&1<<s){o--,c=f-1;continue}let t=u.suffix||u.prefix?d.substring(u.prefix.length,d.length-u.suffix.length):d;(t||u.kind===1)&&(a[e]=decodeURIComponent(t))}else if(u.kind===2){let t=u,n=e.substring(f+t.prefix.length,e.length-t.suffix.length),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,param:l}]}function et(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function tt(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function nt(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!m(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,statics:0,dynamics:0,optionals:0}],c=null,l=null;for(;s.length;){let n=s.pop(),{node:i,index:u,skipped:d,statics:f,dynamics:p,optionals:m}=n,{extract:h,rawParams:g}=n;if(i.kind===2&&i.route&&!ot(l,n))continue;if(i.parse){if(!at(e,t,n))continue;g=n.rawParams,h=n.extract}r&&i.route&&i.kind!==Be&&ot(c,n)&&(c=n);let _=u===o;if(_&&(i.route&&(!a||i.kind===Be||i.kind===2)&&ot(l,n)&&(l=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let v=_?void 0:t[u],y;if(_&&i.index){let n={node:i.index,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g},r=!0;if(i.index.parse&&(at(e,t,n)||(r=!1)),r){if(!p&&!m&&!d&&it(f,o))return n;ot(l,n)&&(l=n)}}if(i.wildcard)for(let e=i.wildcard.length-1;e>=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!r||!_&&(n.caseSensitive?v:y??=v.toLowerCase()).startsWith(r)){if(a){if(_)continue;let e=t.slice(u).join(`/`),i=e.slice(-a.length);if((n.caseSensitive?i:i.toLowerCase())!==a||e.length-a.length<r.length)continue}s.push({node:n,index:o,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(i.optional){let e=d|1<<i.depth+1;for(let t=i.optional.length-1;t>=0;t--){let n=i.optional[t];s.push({node:n,index:u,skipped:e,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_)for(let e=i.optional.length-1;e>=0;e--){let t=i.optional[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p,optionals:m+rt(o,u),extract:h,rawParams:g})}}if(!_&&i.dynamic&&v)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)<n.length)continue}s.push({node:t,index:u+1,skipped:d,statics:f,dynamics:p+rt(o,u),optionals:m,extract:h,rawParams:g})}if(!_&&i.staticInsensitive){let e=i.staticInsensitive.get(y??=v.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,statics:f+rt(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_&&i.static){let e=i.static.get(v);e&&s.push({node:e,index:u+1,skipped:d,statics:f+rt(o,u),dynamics:p,optionals:m,extract:h,rawParams:g})}if(i.pathless)for(let e=i.pathless.length-1;e>=0;e--){let t=i.pathless[e];s.push({node:t,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;e<c.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return c.rawParams??=Object.create(null),c.rawParams[`**`]=decodeURIComponent(r),c}return null}function rt(e,t){return 2**(e-t-1)}function it(e,t){return e===2**(t-1)-1}function at(e,t,n){let r,i;try{[r,i]=$e(e,t,n)}catch{return null}if(n.rawParams=r,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(r)===!1)return null}catch{}return!0}function ot(e,t){return!e||t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Be)>(e.node.kind===Be)||t.node.kind===Be==(e.node.kind===Be)&&t.node.depth>e.node.depth)))}function st(e,t,n){let r=le(e),i=`/${r}`,a=t?i:i.toLowerCase(),o=`${a}/`,s={input:({url:e})=>{let n=t?e.pathname:e.pathname.toLowerCase();return n===a?e.pathname=`/`:n.startsWith(o)&&(e.pathname=e.pathname.slice(i.length)),e},output:({url:e})=>(e.pathname=D(`/${r}${e.pathname}`),e)};return n?{input:({url:e})=>ct(n,s.input({url:e})),output:({url:e})=>s.output({url:lt(n,e)})}:s}function ct(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function lt(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function ut(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,o=n(`idle`),s=n(e),c=n(void 0),l=n([]),u=r(()=>l.get().map(e=>a.get(e).get())),d=r(()=>({status:o.get(),isLoading:o.get()===`pending`,matches:u.get(),location:s.get(),resolvedLocation:c.get()}));function f(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let p={status:o,location:s,resolvedLocation:c,ids:l,matches:u,byRoute:a,__store:d,getMatchStore:f,setMatches:m};function m(e){let t=l.get(),n=e.map(e=>e.routeId);i(()=>{ae(t,n)||l.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=f(t.routeId);e.get()!==t&&e.set(t)}})}return p}var dt=`__TSR_index`,ft=`popstate`,pt=`beforeunload`,mt=/^[\x00-\x20]*(?:[\\/][\t\n\r]*){2,}/;function ht(e){let t=mt.exec(e);return t?`/`+e.slice(t[0].length):e}function gt(e){return/[\x00-\x1f\x7f]/.test(e)&&(e=e.replace(/[\x00-\x1f\x7f]/g,e=>`
2
- \r`.includes(e)?``:encodeURIComponent(e))),ht(e)}function _t(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async n=>{let r=n.navigateOpts?.ignoreBlocker?void 0:e.getBlockers?.();if(typeof document<`u`&&r?.length&&(n.type===`PUSH`||n.type===`REPLACE`))for(let i of r){let r=bt(n.path,n.state);if(await i.blockerFn({currentLocation:t,nextLocation:r,action:n.type})){e.onBlocked?.();return}}n.task()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[dt];i=vt(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[dt];i=vt(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t,n?.ignoreBlocker??!1),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[dt]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r,_getBlockers:()=>e.getBlockers?.()??[]}}function vt(e,t){let n=xt();return{...t,key:n,__TSR_key:n,[dt]:e}}function yt(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=t=>gt(e?.createHref?e.createHref(t):t),c=e?.parseLocation??(()=>bt(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=xt();t.history.replaceState({[dt]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(S._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),S._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(t,n,r)=>{let i=e?.createHref?s(n):void 0,a=!!g;a||(u=l),l=bt(n,r),g=[i??l.href,r,g?.[2]||t],a||queueMicrotask(()=>_())},y=e=>{l=c(),S.notify({type:e})},b=async()=>{if(m=!1,f){f=!1;return}let e=c(),n=e.state[dt]-l.state[dt],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let r=a();if(typeof document<`u`&&r.length){for(let i of r)if(await i.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(-n),S.notify(u);return}}}l=c(),S.notify(u)},x=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0||typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},S=_t({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>v(!0,e,t),replaceState:(e,t)=>v(!1,e,t),back:e=>(e&&(p=!0,m=!0),t.history.back()),forward:e=>{e&&(p=!0,m=!0),t.history.forward()},go:(e,n)=>{d=!0,n&&(p=!0,m=!0),t.history.go(e)},createHref:s,flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(pt,x,{capture:!0}),t.removeEventListener(ft,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return S._ignoreNextBeforeUnload=e=>{m=!1;try{e=new URL(e,t.document.baseURI).href,m=/^https?:/.test(e)&&(!e.includes(`#`)||e.split(`#`)[0]!==t.location.href.split(`#`)[0])}catch{}},t.addEventListener(pt,x,{capture:!0}),t.addEventListener(ft,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return S._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return S._ignoreSubscribers||y(`REPLACE`),n},S}function bt(e,t){let n=gt(e),r=n.indexOf(`#`),i=n.indexOf(`?`);if(!t){let e=xt();t={[dt]:0,key:e,__TSR_key:e}}return{href:n,pathname:n.slice(0,r>-1?i>-1?Math.min(r,i):r:i>-1?i:n.length),hash:r>-1?n.slice(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t}}function xt(){return(Math.random()+1).toString(36).slice(7)}function St(e,t){return e.protocol!==`http:`&&e.protocol!==`https:`||e.origin!==t||!!e.username||!!e.password}function Ct(e){return e.pathname+e.search+e.hash}function wt(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function Tt(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function Et({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function Dt(e){return e.findIndex(e=>e.status===`error`||e.status===`notFound`||e._notFound)+1}function Ot(e,t,n,r,i,a){r&&(t=t.slice(0,r)),i&&(n=n.slice(0,i));for(let r of t){if(a&&e._tx!==a)return;n.some(e=>e.routeId===r.routeId)||e.routesById[r.routeId].options.onLeave?.(r)}for(let r of n){if(a&&e._tx!==a)return;e.routesById[r.routeId].options[t.some(e=>e.routeId===r.routeId)?`onStay`:`onEnter`]?.(r)}}var kt=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={n:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options;this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.staticLocations=new WeakMap,this.protocolAllowlist=new Set(this.options.protocolAllowlist),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:yt()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`;let n=this.options.basepath??`/`,r=this.options.rewrite,i=this.basepath!==n||t?.rewrite!==r||t?.caseSensitive!==this.options.caseSensitive;if(i&&(this.basepath=n,this.rewrite=n!==`/`&&le(n)?st(n,this.options.caseSensitive,r):r),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;e=this.buildRouteTree(),this.setRoutes(e)}if(this.stores)i&&this.stores.location.set(this.latestLocation);else if(this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=ut(this.latestLocation,e),De(this)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=Ze(this.routeTree,this.options.caseSensitive);return this.options.routeMasks&&qe(this.options.routeMasks,e.processedTree),{...e,resolvePathCache:ze(1e3)}},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{for(let t of this.subscribers)if(t.eventType===e.type)try{t.fn(e)}catch(e){console.error(e)}},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i},a)=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:E(e),external:!1,searchStr:o,search:y(t?.search,i),hash:E(r.slice(1)),state:b(t?.state,a)}}let o=ct(this.rewrite,new URL(i,this.origin)),s=this.options.parseSearch(o.search),c=this.options.stringifySearch(s);return o.search=c,{href:o.href.replace(o.origin,``),publicHref:i,pathname:E(ht(o.pathname)),external:!!this.rewrite&&St(o,this.origin),searchStr:c,search:y(t?.search,s),hash:E(o.hash.slice(1)),state:b(t?.state,a)}},r=n(e,e.state),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i,{...i.state,__tempLocation:void 0,key:r.state.key,__TSR_key:r.state.__TSR_key});return e.maskedLocation=r,e}return r},this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>{let t=Object.create(null),n=Xe(ce(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{{let t=this.staticLocations.get(e);if(t)return t}let t=!1,n=(n={})=>{if(n.href){let e=bt(n.href,{});n={...n,to:ct(this.rewrite,new URL(e.pathname,this.origin)).pathname,search:this.options.parseSearch(e.search),hash:e.hash.slice(1)}}let r=e._fromLocation||this._pendingLocation||this.latestLocation,i,a=()=>(t=!0,r),o=()=>i??=this.matchRoutesLightweight(a()),s=n.to?`${n.to}`:`.`,c=de(s[0]===`/`?``:n.unsafeRelative===`path`?a().pathname:n.from??o()[1],s,this.options.trailingSlash,this.resolvePathCache),l=this.routesByPath[ce(c)],u=c.includes(`$`),d;if(l)d=l._branch??=et(l);else if(u)d=[];else{let[e,t,n]=this.getMatchedRoutes(c);d=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(d=[...d,this.options.notFoundRoute])}let f=u?l?._interpolation??We(!1,{fullPath:c},0):void 0,p;for(let e of d){let t=e.options.params?.stringify??e.options.stringifyParams;if(t){let e=o()[3];if(p??=Pt(n.params,e),!_(p))break;p===e&&(p=Object.assign(v(),p));try{Object.assign(p,t(p))}catch{}}}p??=Pt(n.params,Ft(n.params,f)?o()[3]:It);let m=e.leaveParams?c:ht(E(f?he(c,f,p,this.pathParamsDecoder):c)),h=Lt(d,e._includeValidateSearch),g=()=>{let t=o()[2];if(e._includeValidateSearch&&this.options.search?.strict){let e={};d.forEach(n=>{if(n.options.validateSearch)try{Object.assign(e,Nt(n.options.validateSearch,{...e,...t}))}catch{}}),t=e}return t},y=h.length?Rt(h,g(),n):n.search===!0?g():typeof n.search==`function`?n.search(g()):n.search||It,b=this.options.stringifySearch(y),x=n.hash===!0?a().hash:typeof n.hash==`function`?n.hash(a().hash):n.hash||void 0,S=x?`#${x}`:``,C=n.state?n.state===!0?a().state:typeof n.state==`function`?n.state(a().state):n.state:It,w=`${m}${b}${S}`,T,ee,te=!1;if(this.rewrite){let e=new URL(w,this.origin),t=e.origin,n=lt(this.rewrite,e);T=Ct(e),St(n,t)?(ee=n.href,te=!0):ee=ht(Ct(n))}else T=ie(w),ee=T;return{publicHref:ee,href:T,pathname:m,search:y,searchStr:b,state:C,hash:x??``,external:te,unmaskOnReload:n.unmaskOnReload}},r=n(e);if(e.mask)r.maskedLocation=n({from:e.from,...e.mask});else if(this.options.routeMasks){let t=Je(r.pathname,this.processedTree);if(t){let i=Object.assign(v(),t.rawParams),{from:a,params:o,...s}=t.route,c=Pt(o,i);r.maskedLocation=n({from:e.from,...s,params:c})}}return!t&&e._fromLocation&&this.staticLocations.set(e,r),r},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=n.maskedLocation??n;if(r.external)return At(this,r.publicHref,{replace:n.replace,ignoreBlocker:t});let i,a=ce(this.latestLocation.href)===ce(n.href)&&S(Et(n.state),Et(this.latestLocation.state)),o=this._commitPromise,s,c=new Promise(e=>{s=e});if(c.resolve=()=>{s(),o?.resolve()},this._commitPromise=c,a)this.load();else{let{maskedLocation:r,hashScrollIntoView:a,...o}=n;r&&(o={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state={...o.state,__hashScrollIntoViewOptions:a??this.options.defaultHashScrollIntoView??!0},this.shouldViewTransition=e,i=n.replace?`REPLACE`:`PUSH`,this.history[i===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.n=n.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,...a}={})=>{let o=this.buildLocation({...a,_includeValidateSearch:!0});this._pendingLocation=o;let s=this.commitLocation({...o,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this._pendingLocation===o&&(this._pendingLocation=void 0)}),s},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=n?te(n):void 0;if(a||t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i}),a=t.maskedLocation??t;n??=a.publicHref,r??=a.publicHref}let t=!a&&r?r:n;return At(this,t,i)}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.h=e.action.type===`PUSH`||e.action.type===`REPLACE`),await Mn(this,e)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&window.CSS?.supports?.(`selector(:active-view-transition-type(a))`)){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(Tt(r,i)):t.types;if(a===!1)return e();n={update:e,types:a}}else n=e;return document.startViewTransition(n).updateCallbackDone}return e()},this.invalidate=e=>{let t=this._committed,n=e?.filter,r=this._preloads,i=new Set,a=e=>{(!n||n(e))&&i.add(e.id)};t.forEach(a),this._cache.forEach(a),r?.forEach(e=>e.forEach(a)),this._tx?.[3].forEach(a);let o=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),o.push(e));let s=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&wt(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(s);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i){let t=this._flights?.get(e);this._flights?.delete(e),t&&!t[2]&&o.push(t[1])}for(let e of o)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.options,n=e.headers.get(`Location`)||t.href;if(!n){let e=this.buildLocation(t);n=(e.maskedLocation??e).publicHref||`/`}let r;if(ne.test(n)||(r=te(n))&&!this.protocolAllowlist.has(r))throw Error(`Redirect blocked: unsafe protocol`);if(r===`http:`||r===`https:`){let e=new URL(n);e.pathname.startsWith(`//`)?n=e.href:St(e,this.origin)||(n=Ct(e),r=void 0)}return r&&(t.reloadDocument=!0),t.href=n,e.headers.set(`Location`,n),e},this.clearCache=e=>{let t=this._cache,n=this._preloads,r=e?.filter,i=[],a=[];for(let[e,n]of t)(!r||r(n))&&(a.push(e),i.push(n));let o=[];for(let[e,t]of n??[])(!r||t.some(r))&&(o.push(e),i.push(...t));for(let e of a)t.delete(e);for(let e of o)n.delete(e);for(let e of i){let t=e._flight;e._flight=void 0,t&&!--t[2]&&(this._flights?.get(e.id)===t&&this._flights.delete(e.id),o.push(t[1]))}for(let e of o)e.abort()},this.loadRouteChunk=Ut,this.preloadRoute=e=>Nn(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?de(e.from||``,e.to,this.options.trailingSlash,this.resolvePathCache):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n),i=this.stores.status.get()===`pending`;if(t?.pending&&!i)return!1;let a=t?.pending??!i?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=Ye(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!S(o.rawParams,e.params,!0)?!1:t?.includeSearch??!0?S(a.search,r.search,!0)?o.rawParams:!1:o.rawParams},this.getStoreConfig=t,e.pathParamsAllowedCharacters?.length&&(this.pathParamsDecoder=fe(e.pathParamsAllowedCharacters)),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??Ne,parseSearch:e.parseSearch??Me,protocolAllowlist:e.protocolAllowlist??ee}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes(e){Object.assign(this,e),this.lightweightCache=new WeakMap,this.staticLocations=new WeakMap;let t=this.options.notFoundRoute;t&&(t.init(99999999999),this.routesById[t.id]!==t&&(t._interpolation=We(!1,t,0)),this.routesById[t.id]=t)}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,o=!1;(i?i.path!==`/`&&r[`**`]:ce(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?zt(this.options.notFoundMode,a):void 0,c=Array(a.length),l=this._committed,u=(e,t)=>{let n=l[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?l.find(t=>t.routeId===e.id):void 0},d;for(let n=0;n<a.length;n++){let i=a[n],o=c[n-1],l,f,p;{let n=o?.search??e.search,r=o?._strictSearch??void 0;try{let e=Nt(i.options.validateSearch,{...n})??void 0;l={...n,...e},f={...r,...e}}catch(e){let r=e;if(e instanceof jt||(r=new jt(e.message,{cause:e})),t?.throwOnError)throw r;l=n,f={},p=r}}let m=``,h=``;try{m=i.options.loaderDeps?.({search:l})??``,h=m&&JSON.stringify(m)||``}catch(e){if(t?.throwOnError)throw e;p??=e}let g=v(),_=i._interpolation?he(i.fullPath,i._interpolation,r,this.pathParamsDecoder,g):i.fullPath,x=i.id+_+h,S=u(i,n),C=this._cache.get(x)??(S?.id===x?S:void 0);d=C?._strictParams??Object.assign(g,d);let w;if(!C)try{Bt(i,d)}catch(e){if(w=ge(e)||Re(e)?e:new Mt(e.message,{cause:e}),t?.throwOnError)throw w}let T=S?`stay`:`enter`,ee;if(C)ee={...C,cause:T,search:y(S?S.search:C.search,l),_strictSearch:f,searchError:p};else{let e=wt(i)?`pending`:`success`;ee={id:x,ssr:i.options.ssr,index:n,routeId:i.id,params:S?.params??d,_strictParams:d,pathname:_,updatedAt:Date.now(),search:S?y(S.search,l):l,_strictSearch:f,searchError:p,status:e,isFetching:!1,error:void 0,paramsError:w,context:{},abortController:t?._controller??new AbortController,cause:T,loaderDeps:S?b(S.loaderDeps,m):m,invalid:!1,preload:!1,staticData:i.options.staticData||{},fullPath:i.fullPath}}let te=s===i.id;ee._notFound&&!te&&(ee.error=void 0),ee._notFound=te,c[n]=ee}for(let e=0;e<c.length;e++){let n=c[e];n.params=n.cause===`stay`?y(n.params,d):d,t?._controller&&(n.context={})}return c}matchRoutesLightweight(e){let t=m(this.stores.ids.get()),n=t?this.stores.byRoute.get(t).get():void 0,r=n?.id,i=this.lightweightCache.get(e);if(i&&i[0]===r)return i[1];let[a,o]=this.getMatchedRoutes(e.pathname),s=m(a),c={...e.search};for(let e of a)try{Object.assign(c,Nt(e.options.validateSearch,c))}catch{}let l=n&&n.routeId===s.id&&n.pathname===e.pathname,u;if(l)u=n.params;else{let e=o;for(let t of a)try{Bt(t,e)}catch{}u=e}let d=[a,s.fullPath,c,u];return this.lightweightCache.set(e,[r,d]),d}};async function At(e,t,{replace:n,ignoreBlocker:r}){if(!re(t,e.protocolAllowlist)){if(!r){let t=e.history._getBlockers();for(let r of t)if(r?.blockerFn&&await r.blockerFn({currentLocation:e.history.location,nextLocation:e.history.location,action:n?`REPLACE`:`PUSH`}))return}e.history._ignoreNextBeforeUnload?.(t),n?window.location.replace(t):window.location.href=t}}var jt=class extends Error{},Mt=class extends Error{};function Nt(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new jt(`Async validation not supported`);if(n.issues)throw new jt(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function Pt(e,t){if(e===void 0||e===!0)return t;let n=Object.create(null);return e===!1||e===null?n:typeof e==`function`?(Object.assign(n,t),Object.assign(n,e(n))):Object.assign(n,t,e)}function Ft(e,t){return typeof e==`function`?!0:!t||e===!1||e===null?!1:e===void 0||e===!0||t.some(t=>typeof t!=`string`&&!g.call(e,t[1]))}var It=Object.freeze({});function Lt(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r].options;`search`in i?i.search?.middlewares&&n.push(...i.search.middlewares):(i.preSearchFilters||i.postSearchFilters)&&n.push(({search:e,next:t})=>{let n=t(i.preSearchFilters?i.preSearchFilters.reduce((e,t)=>t(e),e):e);return i.postSearchFilters?i.postSearchFilters.reduce((e,t)=>t(e),n):n});let a=i.validateSearch;t&&a&&n.push(({search:e,next:t,meta:n})=>{let r=t(e);try{let e=Nt(a,r);if(n&&e)for(let t in e)t in r||(n.defaulted||=new Map).set(t,e[t]);return{...r,...e}}catch{}return r})}return n}function Rt(e,t,n){let r=(t,i,a)=>{if(t>=e.length){if(!n.search)return{};if(n.search===!0)return i;let e=h(n.search,i);return a&&(a.explicit=e),e}return e[t]({search:i,next:(e,n)=>{if(n){let n=a||{};return{search:r(t+1,e,n),meta:n}}return r(t+1,e,a)},meta:a})};return r(0,t)}function zt(e,t){if(e!==`root`){let e;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.options.notFoundComponent)return r.id;e||=r.children&&r.id}if(e)return e}return Ie}function Bt(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Vt(e,t){return e.options[t]?.preload?.()}function Ht(e,t){let n=Vt(e,`component`),r=Vt(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function Ut(e,t,n){let r=()=>t===!1?void 0:t?Vt(e,t):Ht(e,n),i=e._lazy;if(i)return i===!0?r():i.then(r);if(!e.lazyFn)return r();let a=e.lazyFn().then(t=>{{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazy=!0}},t=>{throw e._lazy=void 0,t});return e._lazy=a,a.then(r)}function Wt(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}function Gt(e,t,n){let r=e._tx;return t&&r?.[2]===n&&!r[3].some(e=>e.routeId===t)}var Kt=0,qt=1,Jt=2,Yt=3,Xt=[4];function Zt(e){return typeof e[0]==`number`}function Qt(e,t){return t.aborted?Promise.race([Promise.reject(t),e]):new Promise((n,r)=>{let i=()=>r(t);t.addEventListener(`abort`,i,{once:!0}),Promise.resolve(e).then(n,r).then(()=>t.removeEventListener(`abort`,i))})}function $t(e,t){return e.routesById[t.routeId]}function en(e,t,n){return Re(e)?[Yt,e]:ge(e)?(e.routeId||=n,[Jt,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[qt,e]):[Kt,e]}function tn(e,t){let n=en(t,!0,e.id);if(n[0]!==qt)return n;try{e.options.onError?.(n[1])}catch(t){n=en(t,!0,e.id)}return n}function nn(e,t,n,r,i){return i[0].signal.aborted?Xt:yn(e,t,n,tn(n,r),i)}async function rn(e,t,n,r,i,a){let[o,s]=t,c=n[0].signal,l=!!n[3];for(let i=n[6]??0;i<r;i++){let r=s[i],u=$t(e,r);r.abortController=n[0];let d=s[i-1]?.context??e.options.context??{},f={params:r.params,location:o,navigate:t=>e.navigate({...t,_fromLocation:o}),buildLocation:e.buildLocation,cause:l?`preload`:r.cause,abortController:n[0],preload:l,matches:s,routeId:u.id};try{let e=r._ctx||=u.options.context?u.options.context({...f,deps:r.loaderDeps,context:d})||{}:void 0;r.context={...d,...e}}catch(a){return on(e,r),[i,nn(e,t,u,a,n)]}if(c.aborted)return[i,Xt];let p=r.paramsError??r.searchError;if(p!==void 0)return on(e,r),[i,nn(e,t,u,p,n)];let m=u.options.beforeLoad;if(!m)continue;let h=r.status;i>=a&&(r.status=`pending`,n[7]?.());try{ln(e,r,`beforeLoad`,n[0]);let a=m({...f,search:r.search,context:r.context,...e.options.additionalContext}),o=await(typeof a?.then==`function`?Qt(a,c):a);if(c.aborted)return[i,Xt];let s=yn(e,t,u,en(o,!1,u.id),n);if(s[0]!==Kt)return on(e,r),[i,s];r.context={...r.context,...o}}catch(a){return on(e,r),[i,nn(e,t,u,a,n)]}finally{r.status=h,ln(e,r,!1,n[0])}}i()}function an(e,t,n){if(!(!n||--n[2])){if(e._flights?.get(t.id)===n){let n=e._tx;if(n&&!n[0].signal.aborted&&!n[3].includes(t)&&n[3].some(e=>e.id===t.id)&&n[3].some(e=>e.isFetching===`beforeLoad`))return;e._flights.delete(t.id)}return n[1]}}function on(e,t){let n=t._flight;t._flight=void 0,an(e,t,n)?.abort()}function sn(e,t,n,r){let i=[];for(let a of t)if(!n?.includes(a)){let t=a._flight;if(a._flight=void 0,r&&t?.[2]===1&&e._flights?.get(a.id)===t&&n?.some(e=>e.id===a.id))t[2]=0;else{let n=an(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function cn(e){for(let t of e){let e=t._flight;e&&e[2]++}}function ln(e,t,n,r){if(t.isFetching=n,r&&e._tx?.[0]!==r)return;let i=e.stores.byRoute.get(t.routeId),a=i?.get();a?.id===t.id&&i.set({...a,isFetching:n})}function un(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:t=>e.navigate({...t,_fromLocation:s}),cause:o?`preload`:n.cause,abortController:i,preload:o,deps:n.loaderDeps,parentMatchPromise:a,context:n.context,route:r,...e.options.additionalContext}}async function dn(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return Xt;if(!i)return[Kt,void 0];let l=n._flight;ln(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(un(e,t,n,r,s,a,!!o[3]))).then(e=>en(e,!1,r.id),e=>en(e,!0,r.id)).then(t=>(t[0]!==Kt&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===qt&&l[2]?tn(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],yn(e,t,r,await Qt(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return on(e,n),Xt}finally{ln(e,n,!1,s)}}function fn(e,t,n){t[0]!==Yt&&(e.status=`success`,e.error=void 0,t[0]===Kt?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function pn(e,t,n){let r=e._cache.get(t.id);if(r!==n||e._committed.some(e=>e.id===t.id&&e._flight===t._flight))return;let i={...t,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,e._cache.set(t.id,i),r&&on(e,r)}function mn(e,t){return t[0]===qt||t[0]===Jt?{...e,status:t[0]===qt?`error`:`notFound`,error:t[1],_flight:void 0}:e}function hn(e,t,n,r,i,a,o){let s=t[1][n],c=$t(e,s),l=!!a[3],u=e._cache.get(s.id),d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(un(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=Xt)),!p){if(s.status!==`success`)f=!0;else{let t=l||s.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;f=!!(s.invalid||d||d===void 0&&Date.now()-s.updatedAt>=t&&(a[5]||s.cause===`enter`||a[2].some(e=>e.routeId===s.routeId&&e.id!==s.id)))}}}catch(n){s.invalid=!0,on(e,s),p=nn(e,t,c,n,a)}let m=c.options.loader,h=typeof m==`function`,g=h?m:m?.handler,_=!l||c.options.preload!==!1,v=_&&m?e._flights?.get(s.id):void 0;v===s._flight||p?v=void 0:v&&!f&&!l&&d===void 0?f=!0:f||(v=void 0);let y=!(!m||!f||s.status!==`success`||l||a[4]||((h?void 0:m.staleReloadMode)??e.options.defaultStaleReloadMode)===`blocking`),b=f&&_,x=b&&!y&&(s.status!==`success`||!!m),S=n>=o?a[7]:void 0,C=c.lazyFn&&c._lazy!==!0?S:void 0;if(b&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),v&&v[2]++,x){let t=s._flight;s._flight=v,an(e,s,t)?.abort(),n>=o&&(s.status=`pending`),S?.()}b||(s.isFetching=!1);let w=!p&&x?dn(e,t,s,c,g,i,a).then(t=>(fn(s,t,l),t[0]===Kt&&(m&&!a[0].signal.aborted&&pn(e,s,u),n>=o&&(s.status=`pending`)),t)):Promise.resolve(p??[Kt,s.loaderData]),T=(async()=>{try{let e=Ut(c,void 0,C);e&&await Qt(e,a[0].signal)}catch(r){if(!t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound)))return[n,nn(e,t,c,r,a)]}let r=await w;x&&r[0]===Kt&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,S?.())})();if(r.push([n,w,T]),!y)return w.then(e=>mn(s,e));let ee={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let te=dn(e,t,ee,c,g,i,a).then(e=>(s.isFetching=!1,fn(ee,e,!1),e));return(t[2]??=[]).push([n,te,T,ee]),te.then(e=>mn(ee,e))}async function gn(e,t,n,r,i=0){let a=n?.[1][1],o=a?.routeId?t.findIndex(e=>e.routeId===a.routeId):n?.[0]??t.length-1;o<0&&(o=0);for(let n=o;n>=0;n--){let i=$t(e,t[n]);try{let e=Ut(i,!1);e&&await Qt(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function _n(e,t){t[2]&&=(sn(e,t[2].map(e=>e[3])),void 0)}async function vn(e,t,n,r){let i;try{await Promise.all(e.map(e=>e[1].then(async t=>{let a=e[0];if(!(r&&a>=await r)){if(t[0]>=Yt)throw[a,t];!i&&t[0]!==Kt&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===Yt)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function yn(e,t,n,r,i,a){for(;r[0]===Yt;){let o=r[1],s=o.options;try{if((s.href||o.headers.has(`Location`))&&(e.resolveRedirect(o),s.reloadDocument)||(s.reloadDocument?i[3]:i[1]>=20))return r;let n=e.buildLocation({...s,_fromLocation:t[0],_includeValidateSearch:!0}),a=n.maskedLocation??n;if(a.external){let t=o.clone();return t.options={...s},t.headers.set(`Location`,a.publicHref),e.resolveRedirect(t),i[3]?[Yt,t]:[Yt,t,a]}return[Yt,o,n]}catch(e){r=a?[qt,e]:tn(n,e),a=!0}}return r}async function bn(e,t,n,r,i,a){let o=t[1],s=await i,c=!1,l=o.findIndex(e=>e._notFound),u=t=>t[1][0]===Jt?gn(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=Yt)d=0;else if(s){d=s[2]??=await u(s);for(let e of n){if(e[0]>=d)break;let t=await e[1];if(t[0]!==Kt&&t[0]<Yt&&!(`loaderData`in o[e[0]])){s=[e[0],t],d=s[2]=await u(s);break}}}for(let e of n){if(e[0]>=d)break;let t=await e[2];if(t){s=t;break}}if((s?.[1][0]??0)>=Yt){let n=s[1];if(n[0]!==Yt||n[1].options.reloadDocument||n[2])return _n(e,t),n;c=!0,s=[0,[qt,Error(`Too many redirects`)]]}let f=s?s[2]??await u(s):l;if(f>=0){let i=s?.[1],l=i?.[0],u=o[f],d=i?.[1],p=()=>{i&&(u._notFound=void 0,l===qt?u.status=`error`:(d.routeId=u.routeId,u.routeId===e.routeTree.id?(u.status=`success`,u._notFound=!0):u.status=`notFound`),u.error=d,u.isFetching=!1)};p(),i||a?.();let m=$t(e,u);try{await Qt(i?Promise.resolve().then(()=>Ut(m,l===qt?`errorComponent`:`notFoundComponent`)):Promise.all([Ut(m),Ut(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return _n(e,t),Xt}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),_n(e,t),sn(e,o),p()):u.status=`success`}return t}async function xn(e,t,n,r=0,i=t[1].length){let a=t[1];for(let t=r;t<i;t++){let r=a[t],i=$t(e,r).options;if(i.head||i.scripts)try{let t={ssr:e.options.ssr,matches:a,match:r,params:r.params,loaderData:r.loaderData},[o,s]=await Qt(Promise.all([i.head?.(t),i.scripts?.(t)]),n);r.meta=o?.meta,r.links=o?.links,r.headScripts=o?.scripts,r.styles=o?.styles,r.scripts=s}catch(e){if(e===n&&n.aborted)break;console.error(e)}if(r.status!==`success`||r._notFound)break}return t}async function Sn(e,t,n,r){let i=[t,n],a=r[0].signal,o;try{let t=e.stores.matches.get(),s=n.findIndex(e=>e._notFound);if(e.options.notFoundMode!==`root`&&s>=0){let t=await gn(e,n,void 0,a,s);n[s]._notFound=void 0,n[t]._notFound=!0,s=t}let c=s<0?n.length:s+1,l=0;for(;l<c&&l!==s;){let e=n[l],i=r[2][l],a=t[l];if(i?.id!==e.id||i.status!==`success`||e.preload||a?.id!==e.id||a.status!==`success`||(l++,i._notFound||a._notFound))break}let u=[],d=r[6]??0,f=d?Promise.resolve(n[d-1]):void 0,p=()=>{for(let t=d;t<c&&!a.aborted;t++)f=hn(e,i,t,u,f,r,l)},m=await rn(e,i,r,c,p,l);if(m){if(r[4]=!0,c=m[0],m[1][0]===Jt){let t=await gn(e,n,m,a);m[2]=t,c=Math.min(c,t+1)}else m[1][0]>=Yt&&(c=0);p()}if(!a.aborted&&!r[3]){let t=[];for(let[n,r]of e._flights??[])r[2]||(e._flights.delete(n),t.push(r[1]));for(let e of t)e.abort()}let h=bn(e,i,u,r[0],vn(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=vn(i[2],void 0,void 0,h.then(e=>Zt(e)?0:Wt(n).length,()=>0))),o=await h}catch(t){if(_n(e,i),t===a&&a.aborted)return Xt;throw t}return Zt(o)?o:xn(e,o,a,r[6]===n.length?r[6]:0)}function Cn(e,t){if(e._tx!==t)return;let n=t[3],r=e.stores.matches.get(),i=e._pending;for(let a=0;a<n.length;a++){let o=n[a],s=o.status===`success`&&!o._notFound,c=r[a]?.id===o.id&&r[a]?.status===`pending`;if(s&&!c)continue;let l=$t(e,o),u=s||o.invalid?0:l.options.pendingMs??e.options.defaultPendingMs,d=l.options.pendingComponent??e.options.defaultPendingComponent;if(!d||typeof u!=`number`||u===1/0){i&&(i[0]=t,i[2]=0,i[4]=!0);return}let f=l.options.pendingMinMs??e.options.defaultPendingMinMs??0,p=!1;if(i?.[1]===o.id?(p=i[0]!==t,i[0]=t):(clearTimeout(i?.[3]),e._pending=i=void 0),i||(e._pending=i=[t,o.id,c?Date.now()+f:t[4]+u,void 0,c||void 0,d]),i[4]&&!p&&i[5]===d)return;if(i[5]=d,!i[4]){clearTimeout(i[3]);let n=i[2]-Date.now();if(n>0){i[3]=setTimeout(()=>Cn(e,t),n);return}i[2]=0}let m=n.map(e=>({...e,_flight:void 0}));m[a].status=`pending`;let h=i[4]=e.startTransition(()=>e.stores.setMatches(m),m).then(t=>(t&&e._pending===i&&i[4]===h&&!i[2]&&(i[2]=Date.now()+f),t));return}}function wn(e,t){let n=e._pending;(e._tx===t||!e._tx?.[3].some(e=>e.id===n?.[1]))&&(clearTimeout(n?.[3]),e._pending=void 0)}async function Tn(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!Wt(t[3]).some(e=>e.id===n[1]))return;let i;try{await Qt(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function En(e,t){e._committed=t,e.stores.setMatches(t)}function Dn(e,t,n,r){let i=e._committed,a=e._lifecycleEnd,o=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let s=Wt(n).length,c=new Map;{let t=Date.now(),r=new Set;for(let e=0;e<n.length;e++){let t=n[e];(e<s||t.status===`success`)&&r.add(t.id)}for(let n of[...i,...o.values()]){if(n.status!==`success`||r.has(n.id))continue;let i=$t(e,n);!i.options.loader||t-n.updatedAt>=(n.preload?i.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:i.options.gcTime??e.options.defaultGcTime??3e5)||c.set(n.id,o.get(n.id)===n?n:{...n,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=c;let l=e._lifecycleEnd=Dt(n);En(e,n),sn(e,[...o.values(),...i].filter(e=>e._flight&&c.get(e.id)!==e),n),Ot(e,i,n,a,l,t)}async function On(e,t){let n=e._tx;for(;n&&n!==t;)t=n,await n[5],n=e._tx}function kn(e,t,n){let r=n[1].options,i=n[2];if(!i)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:(i.maskedLocation??i).publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});i._redirects=t[1]+1,e._pendingLocation=i;let a=e.commitLocation({...i,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===i&&(e._pendingLocation=void 0)}),a}async function An(e,t,n,r,i){let a=n.map(e=>({...e}));cn(a);for(let t of r)on(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await bn(e,o,r,t[0],i)}catch(t){throw sn(e,a),t}if(Zt(s))sn(e,a),s[0]===Yt&&e._tx===t&&e._committed===n&&await kn(e,t,s);else if(await xn(e,s,t[0].signal),e._tx!==t||e._committed!==n)sn(e,a);else{for(let t of a){let n=e._cache.get(t.id);n?._flight&&n._flight===t._flight&&(e._cache.delete(t.id),on(e,n))}En(e,a),sn(e,n,a)}}async function jn(e,t,n,r,i,a){let o=await Sn(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if(Zt(o)){let n=o[0]===Yt&&e._tx===t;if((!n||o[1].options.reloadDocument)&&wn(e,t),sn(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){wn(e,t);return}await kn(e,t,o);return}let s=o[1];if(e._tx===t&&await Tn(e,t),e._tx!==t){wn(e,t),sn(e,s),_n(e,o);return}let c=t[2],l=Tt(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>{if(e._tx===t&&await Tn(e,t),e._tx!==t){wn(e,t),sn(e,s),_n(e,o);return}let n=await e.startTransition(()=>{wn(e,t),Dn(e,t,s,a),e._tx===t&&(e.emit({type:`onLoad`,...l}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...l}))},s);e._tx===t?(u?.length&&An(e,t,s,u,o[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(c),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...l}),n&&e._tx===t&&e.emit({type:`onRendered`,...l})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)):_n(e,o)})}async function Mn(e,t){let n=e._tx,r=e.stores.resolvedLocation.get(),i=r??e.stores.location.get(),a=e.latestLocation,o=e._pendingLocation,s=o?.href===a.href?o._redirects??0:0,c=e._handoff,l=c?.[0](),u=new AbortController,d=e._preflight;if(e._preflight=u,l||c?.[1](),d?.abort(),!u.signal.aborted){let t=Tt(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await On(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});cn(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){sn(e,m),await On(e,n);return}e._preflight=void 0;let g,_=()=>jn(e,y,f,()=>Cn(e,y),t?.sync,h),v=t?.sync?new Promise(e=>g=e):Promise.resolve().then(_),y=[p,s,a,m,Date.now(),v.then(()=>On(e,y))];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&ln(e,t,!1)}n[0].abort(),sn(e,n[3],y[3],!0)}e._tx===y?(e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),(h||!e._committed.length&&m[0]?.status!==`success`&&!m.some(e=>e._notFound))&&Cn(e,y),g?.(_()),await y[5]):(sn(e,y[3]),y[3]=[],g?.(),await On(e,y))}async function Nn(e,t){let n=e.buildLocation(t);for(let t=0;;t++){let r=e._committed,i=new AbortController,a,o,s;try{try{a=e.matchRoutes(n,{_controller:i}),cn(a),o=(e._preloads??=new Map).set(i,a),s=await Sn(e,n,a,[i,t,r,!0])}finally{o&&(o=o.delete(i),sn(e,a)),i.abort()}if(!Zt(s))return s[1];if(!o||s.length<3)return;n=s[2]}catch(e){ge(e)||console.error(e);return}}}var Pn=`Error preloading route! ☝️`,Fn=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e,this._branch=void 0;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=Ie:this.parentRoute||oe();let r=n?Ie:t?.path;r&&r!==`/`&&(r=se(r));let i=t?.id||r,a=n?Ie:D((this.parentRoute.id===`__root__`?``:this.parentRoute.id)+`/`+(i??``));r===`__root__`&&(r=`/`);let o=a===`__root__`?`/`:r===void 0?this.parentRoute.fullPath:D(this.parentRoute.fullPath+`/`+r);this._path=r,this._id=a,this._fullPath=o,this._to=ce(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>Le({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},In=class extends Fn{constructor(e){super(e)}},Ln=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),A=o(((e,t)=>{t.exports=Ln()}))(),Rn=class extends f.Component{constructor(...e){super(...e),this.state={error:0},this.reset=()=>{this.setState({error:0})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:0}:{resetKey:n}}static getDerivedStateFromError(e){return{error:[e]}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?f.createElement(this.props.errorComponent??zn,{error:e[0],reset:this.reset}):this.props.children}};function zn({error:e}){let[t,n]=f.useState(!1);return(0,A.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,A.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,A.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,A.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,A.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,A.jsx)(`div`,{children:(0,A.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e?.message?(0,A.jsx)(`code`,{children:e.message}):null})}):null]})}var Bn=()=>!0,Vn=()=>!1;function Hn({children:e,fallback:t=null}){return(0,A.jsx)(f.Fragment,{children:Un()?e:t})}function Un(e=!0){return f.useSyncExternalStore(Wn,Bn,e?Vn:Bn)}function Wn(){return()=>{}}var Gn=f.createContext(null);function Kn(e){return f.useContext(Gn)}function qn(e,t){let n=e.stores.location,r=new Set,i,a,o=n=>{Gt(e,t,n)||(i=n,r.forEach(e=>e()))};return[()=>i??n.get(),e=>(r.size||(i=n.get(),a=n.subscribe(o).unsubscribe),r.add(e),()=>{r.delete(e),r.size||(a(),i=void 0)})]}var Jn=f.createContext(void 0),Yn=f.createContext(void 0);function Xn({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0)n=e.nextSub;else{for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}}while(1)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(1)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function Zn(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var Qn=[],$n=0,{link:er,unlink:tr,propagate:nr,checkDirty:rr,shallowPropagate:ir}=Xn({update(e){return e._update()},notify(e){Qn[or++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,ur(e))}}),ar=0,or=0,sr,cr=0;function lr(e){try{++cr,e()}finally{--cr||dr()}}function ur(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=tr(n,e)}function dr(){if(!(cr>0)){for(;ar<or;){let e=Qn[ar];Qn[ar++]=void 0,e.notify()}ar=0,or=0}}function fr(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:+!n,get(){return sr!==void 0&&er(i,sr,$n),i._snapshot},subscribe(e){let t=Zn(e),n={current:!1},r=pr(()=>{i.get(),n.current?(sr=void 0,t.next?.(i._snapshot)):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=sr,o=t?.compare??Object.is;if(n)sr=i,++$n,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=5);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{sr=a,n&&(i.flags&=-5),ur(i)}}};return n?(i.flags=17,i.get=function(){let e=i.flags;if(e&16||e&32&&rr(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&ir(e)}}else e&32&&(i.flags=e&-33);return sr!==void 0&&er(i,sr,$n),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(nr(e),ir(e),dr())}},i}function pr(e){let t=()=>{let t=sr;sr=n,++$n,n.depsTail=void 0,n.flags=6;try{return e()}finally{sr=t,n.flags&=-5,ur(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){let e=this.flags;e&16||e&32&&rr(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,ur(this)}};return t(),n}var mr=o((e=>{var t=d();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),hr=o(((e,t)=>{t.exports=mr()})),gr=o((e=>{var t=d(),n=hr();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),_r=o(((e,t)=>{t.exports=gr()}))();function vr(e,t){return e===t}function yr(e,t=e=>e,n){let r=n?.compare??vr,i=(0,f.useCallback)(t=>{let{unsubscribe:n}=e.subscribe(t);return n},[e]),a=(0,f.useCallback)(()=>e.get(),[e]);return(0,_r.useSyncExternalStoreWithSelector)(i,a,a,t,r)}var br={};function xr(e,t){let n=f.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=b(n.current,i):i}}function Sr(e){let t=Kn(),n=f.useContext(e.from?Yn:Jn),r=e.from??n,i=t.stores.getMatchStore(r),a=xr(e,t),o=yr(i,e=>e?a(e):br);if(o!==br)return o;(e.shouldThrow??!0)&&oe()}function Cr(e){return Sr({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function wr(e){let{select:t,...n}=e;return Sr({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function Tr(e){return Sr({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Er(e){return Sr({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Dr(e){let t=Kn();return f.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Or(e){return Sr({...e,select:t=>e.select?e.select(t.context):t.context})}function kr(...e){let t=f.useRef(e),n=t.current;return e.forEach((e,t)=>{S(n[t],e,!1,!0)||(n[t]=e)}),t.current}function Ar(e,t){e.preloadRoute(t).catch(e=>{console.warn(e),console.warn(Pn)})}function jr(e,t){let n=typeof e==`string`&&te(e);if(n)return t.has(n)?e:null}function Mr(e,t,n,r){let i=ue(e.pathname,r),a=ue(t.pathname,r);return(n?.exact?i!==a:!i.startsWith(a)||i.length!==a.length&&i[a.length]!==`/`)||(n?.includeSearch??!0)&&!S(e.search,t.search,!n?.exact,n?.explicitUndefined)?!1:!n?.includeHash||e.hash===t.hash}function Nr(e,t,n){let r=Kn(),i=f.useRef(null),a=f.useCallback(e=>{if(i.current=e,typeof t==`function`)return t(e);t&&(t.current=e)},[t]),{activeOptions:o,to:s,preload:c,preloadDelay:l,disabled:u,target:d,onClick:p,onBlur:m,onFocus:h,onMouseEnter:g,onMouseLeave:_,onTouchStart:v}=e,[y,b,x]=kr(e.search,e.params,o),S=f.useContext(Jn),C=(r.stores._linkScopes??={})[S]??=qn(r,S),[w,T,ee]=f.useMemo(()=>{let t=jr(s,r.protocolAllowlist);if(t!==void 0){let n=[t??void 0];return[e,()=>n]}let n={...e},i,a,o,c=()=>{let e=C[0]();if(e!==i){n._fromLocation=e;let t=r.buildLocation(n),o=Vr(t,r,u),s=u||o&&!te(o)?Mr(e,t,x,r.basepath):void 0;(!a||a[0]!==o||a[1]!==s)&&(a=[o,s]),i=e}return a};return[n,c,x?.includeHash&&(()=>{let e=c();return e[1]?o??=[e[0],!1]:e})]},[r,C,e.from,e.hash,e.href,s,y,b,e.state,e.mask,e.unsafeRelative,x,u]),[ne,re]=f.useSyncExternalStore(C[1],T,ee||T),E=re===void 0&&ne,ie=u||ne===void 0,ae=f.useRef(!1),oe=e.reloadDocument||E||ie?!1:c??r.options.defaultPreload,D=l??r.options.defaultPreloadDelay??0,se=f.useCallback(e=>{let t=e?.isIntersecting;t??oe===`intent`?D?i.t??=setTimeout(()=>{i.t=void 0,Ar(r,w)},D):Ar(r,w):t===!1&&zr(i)},[r,w,i,oe,D]);f.useEffect(()=>{if(!oe)return;oe===`render`&&!ae.current&&(ae.current=!0,Ar(r,w));let e=!0,t;return oe===`viewport`&&i.current&&typeof IntersectionObserver==`function`&&(t=new IntersectionObserver(t=>{e&&se(t.pop())},{rootMargin:`100px`}),t.observe(i.current)),()=>{e=!1,t?.disconnect(),zr(i)}},[r,w,oe,se,i]);let ce=Lr(e,n);if(ce.ref=t?a:i,E)return ce.href=E,ce;let le=t=>{let n=d??t.currentTarget.getAttribute(`target`);!ie&&!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&(!n||n===`_self`)&&t.button===0&&(t.preventDefault(),zr(i),r.navigate({...e,_fromLocation:w._fromLocation}))},ue=()=>{oe===`intent`&&Ar(r,w)},de=()=>{oe===`intent`&&zr(i)};return ce.onClick=Br(p,le),ce.onBlur=Br(m,de),ce.onFocus=Br(h,se),ce.onMouseEnter=Br(g,se),ce.onMouseLeave=Br(_,de),ce.onTouchStart=Br(v,ue),Rr(ce,e,re,ne,ie,n)}var Pr={},Fr={className:`active`},Ir=new Set([`to`,`params`,`search`,`hash`,`state`,`mask`,`from`,`unsafeRelative`,`reloadDocument`,`preload`,`preloadDelay`,`preloadIntentProximity`,`hashScrollIntoView`,`replace`,`startTransition`,`resetScroll`,`viewTransition`,`ignoreBlocker`,`activeProps`,`inactiveProps`,`activeOptions`,`_asChild`]);function Lr(e,t){let n={};for(let r in e)Ir.has(r)||r===`type`&&t!==void 0||r===`disabled`&&t===`a`||(n[r]=e[r]);return n}function Rr(e,t,n,r,i,a){let{activeProps:o,inactiveProps:s,className:c,style:l,target:u}=t,d=h(n?o:s,{})??(n?Fr:Pr);Object.assign(e,d),e.href=r,a!==`a`&&(e.disabled=i),e.target=u;let f=d.style;(l||f)&&(e.style=l&&f?{...l,...f}:l||f);let p=d.className;return(c||p)&&(e.className=c?p?`${c} ${p}`:c:p),i&&(e.role=`link`,e[`aria-disabled`]=!0),n&&(e[`data-status`]=`active`,e[`aria-current`]=`page`),e}var zr=e=>{clearTimeout(e.t),e.t=void 0},Br=(e,t)=>e?n=>n.defaultPrevented||(e(n),n.defaultPrevented||t(n)):t;function Vr(e,t,n){if(n)return;let r=e.maskedLocation??e,i=r.external?r.publicHref:t.history.createHref(r.publicHref)||`/`;if(!r.external&&i===r.publicHref||!re(i,t.protocolAllowlist))return i}var Hr=f.memo(f.forwardRef((e,t)=>{let n=e._asChild||`a`,r=Nr(e,t,n),i=typeof e.children==`function`?e.children({isActive:r[`data-status`]===`active`}):e.children;return f.createElement(n,r,i)}),Ur);function Ur(e,t){let n=0;for(let r in t)if(n++,e[r]!==t[r]&&(!Ir.has(r)||!S(e[r],t[r],!1,!0)))return!1;for(let t in e)n--;return n===0}var Wr=class extends Fn{constructor(e){super(e),this.useMatch=e=>Sr({...e,from:this.id}),this.useRouteContext=e=>Or({...e,from:this.id}),this.useSearch=e=>Er({...e,from:this.id}),this.useParams=e=>Tr({...e,from:this.id}),this.useLoaderDeps=e=>wr({...e,from:this.id}),this.useLoaderData=e=>Cr({...e,from:this.id}),this.useNavigate=()=>Dr({from:this.fullPath}),this.Link=f.forwardRef((e,t)=>(0,A.jsx)(Hr,{ref:t,from:this.fullPath,...e}))}};function Gr(e){return new Wr(e)}var Kr=class extends In{constructor(e){super(e),this.useMatch=e=>Sr({...e,from:this.id}),this.useRouteContext=e=>Or({...e,from:this.id}),this.useSearch=e=>Er({...e,from:this.id}),this.useParams=e=>Tr({...e,from:this.id}),this.useLoaderDeps=e=>wr({...e,from:this.id}),this.useLoaderData=e=>Cr({...e,from:this.id}),this.useNavigate=()=>Dr({from:this.fullPath}),this.Link=f.forwardRef((e,t)=>(0,A.jsx)(Hr,{ref:t,from:this.fullPath,...e}))}};function qr(e){return new Kr(e)}function Jr(e){let t=Kn(),n=`not-found-${yr(t.stores.location,e=>e.pathname)}-${yr(t.stores.status)}`;return(0,A.jsx)(Rn,{getResetKey:()=>n,onCatch:(t,n)=>{if(ge(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(ge(t))return e.fallback?.(t);throw t},children:e.children})}function Yr(){return(0,A.jsx)(`p`,{children:`Not Found`})}function Xr(e,t,n){return t.options.notFoundComponent?(0,A.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,A.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,A.jsx)(Yr,{})}function Zr(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,A.jsx)(n,{}):null}var Qr=(e,t)=>e[0]===t[0]&&e[1]===t[1],$r=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,ei=f.memo(function({routeId:e}){let t=Kn();return ti(t,yr(t.stores.getMatchStore(e)))});function ti(e,t){let n=e.routesById[t.routeId],r=Zr(e,n),i=n.options.errorComponent??e.options.defaultErrorComponent,a=n.options.onCatch??e.options.defaultOnCatch,o=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,s=t.ssr===!1||t.ssr===`data-only`,c=$r(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||s)),l=(0,A.jsx)(ni,{match:t});s&&(l=(0,A.jsx)(Hn,{fallback:r,children:l})),o&&(l=(0,A.jsx)(Jr,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return f.createElement(o,e)},children:l})),i&&(l=(0,A.jsx)(Rn,{getResetKey:()=>t,errorComponent:i,onCatch:(e,n)=>{if(ge(e))throw e.routeId??=t.routeId,e;a?.(e,n)},children:l})),c&&(l=(0,A.jsx)(f.Suspense,{fallback:r,children:l}));let u=n.isRoot&&n.options.shellComponent;return u?(0,A.jsx)(Jn.Provider,{value:t.routeId,children:(0,A.jsxs)(u,{children:[l,null]})}):(0,A.jsxs)(Jn.Provider,{value:t.routeId,children:[l,null]})}var ni=f.memo(function({match:e}){let t=Kn(),n=e.routeId,r=t.routesById[n],i=f.useMemo(()=>{let i=(r.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return i?JSON.stringify(i):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,r.options.remountDeps,t.options.defaultRemountDeps]),a=f.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?(0,A.jsx)(e,{},i):(0,A.jsx)(ri,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!$r(t,r,e.ssr))return a;if(t._tx)throw t._tx[5];return Zr(t,r)}if(e.status===`notFound`)return Xr(t,r,e.error);if(e.status===`error`)throw e.error;return a}),ri=f.memo(function(){let e=Kn(),t=f.useContext(Jn),n,r,i;{let a=e.stores.getMatchStore(t);[n,r]=yr(a,e=>[!!e._notFound,e.error],{compare:Qr}),i=yr(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return Xr(e,e.routesById[t],r);if(!i)return null;let a=(0,A.jsx)(ei,{routeId:i});return t===`__root__`?(0,A.jsx)(f.Suspense,{fallback:Zr(e),children:a}):a});function ii(e,t){let n=e[1];e.length=0,n?.(t)}function ai({t:e}){let t=Kn(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise(a=>{ii(n,!1),n.push(i,a),e(t),f.startTransition(r)}),p(()=>{let e=t.history.subscribe(t.load);t.updateLatestLocation();let r=t.latestLocation,i=t.buildLocation({to:r.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(ce(r.publicHref)!==ce(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=t.stores.resolvedLocation.get();return a?.href===r.href&&a.state.__TSR_key===r.state.__TSR_key?n.push(t.stores.matches.get(),e=>{e&&t.emit({type:`onRendered`,...Tt(a,a)})}):t._tx||t.load({sync:!0}).catch(console.error),e},[t,t.history]),null}function oi(){let e=Kn(),t=e.routesById[Ie],n=Zr(e,t),r=(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(ai,{t:f.useState()[1]}),e.ssr?(0,A.jsx)(si,{}):(0,A.jsx)(f.Suspense,{fallback:n,children:(0,A.jsx)(si,{})})]});return e.options.InnerWrap?(0,A.jsx)(e.options.InnerWrap,{children:r}):r}function si(){let e=Kn(),t=e._rendered,n=yr(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;p(()=>{t[0]===n&&ii(t,!0)},[t,n]);let a=i?(0,A.jsx)(ei,{routeId:i}):null;return e.options.disableGlobalCatchBoundary?a:(0,A.jsx)(Rn,{getResetKey:()=>r,onCatch:void 0,children:a})}var ci=e=>({createMutableStore:fr,createReadonlyStore:fr,batch:lr}),li=e=>new ui(e),ui=class extends kt{constructor(e){super(e,ci)}};function di({router:e,children:t,...n}){_(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,A.jsx)(Gn.Provider,{value:e,children:t});return e.options.Wrap?(0,A.jsx)(e.options.Wrap,{children:r}):r}function fi({router:e,...t}){return(0,A.jsx)(di,{router:e,...t,children:(0,A.jsx)(oi,{})})}var pi=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,ne());else{var t=n(l);t!==null&&ie(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function ee(){return g?!0:!(e.unstable_now()-T<w)}function te(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&ee());){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&&ie(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?ne():S=!1}}}var ne;if(typeof y==`function`)ne=function(){y(te)};else if(typeof MessageChannel<`u`){var re=new MessageChannel,E=re.port2;re.port1.onmessage=te,ne=function(){E.postMessage(null)}}else ne=function(){_(te,0)};function ie(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,ie(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,ne()))),r},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),mi=o(((e,t)=>{t.exports=pi()})),hi=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=u(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=u(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.0`})),gi=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=hi()})),_i=o((e=>{var t=mi(),n=d(),r=gi();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}function p(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)&&p(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function m(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 h(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 g(e){var t=[null,null],n=m(e);return n===null||_(t,e,n.child,{foundSelf:!1}),t}function _(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)&&_(e,t,n.child,r))return!0;n=n.sibling}return!1}function v(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var y=null,b=null;function x(e,t,n){return e===n||e===t&&(y=e,!0)}function S(e,t,n){return e===n?(b=e,!1):e===t&&(b!==null&&(y=e),!0)}function C(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 w(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 T=Object.assign,ee=Symbol.for(`react.element`),te=Symbol.for(`react.transitional.element`),ne=Symbol.for(`react.portal`),re=Symbol.for(`react.fragment`),E=Symbol.for(`react.strict_mode`),ie=Symbol.for(`react.profiler`),ae=Symbol.for(`react.consumer`),oe=Symbol.for(`react.context`),D=Symbol.for(`react.forward_ref`),se=Symbol.for(`react.suspense`),ce=Symbol.for(`react.suspense_list`),le=Symbol.for(`react.memo`),ue=Symbol.for(`react.lazy`),de=Symbol.for(`react.activity`),fe=Symbol.for(`react.legacy_hidden`),pe=Symbol.for(`react.memo_cache_sentinel`),me=Symbol.for(`react.view_transition`),he=Symbol.for(`react.recoverable`),ge=Symbol.iterator;function _e(e){return typeof e!=`object`||!e?null:(e=ge&&e[ge]||e[`@@iterator`],typeof e==`function`?e:null)}var ve=Symbol.for(`react.client.reference`);function ye(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ve?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case re:return`Fragment`;case ie:return`Profiler`;case E:return`StrictMode`;case se:return`Suspense`;case ce:return`SuspenseList`;case de:return`Activity`;case me:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case ne:return`Portal`;case oe:return e.displayName||`Context`;case ae:return(e._context.displayName||`Context`)+`.Consumer`;case D:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case le:return t=e.displayName||null,t===null?ye(e.type)||`Memo`:t;case ue:t=e._payload,e=e._init;try{return ye(e(t))}catch{}}return null}var be=Array.isArray,O=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,k=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,xe={pending:!1,data:null,method:null,action:null},Se=[],Ce=-1;function we(e){return{current:e}}function Te(e){0>Ce||(e.current=Se[Ce],Se[Ce]=null,Ce--)}function Ee(e,t){Ce++,Se[Ce]=e.current,e.current=t}var De=we(null),Oe=we(null),ke=we(null),Ae=we(null);function je(e,t){switch(Ee(ke,t),Ee(Oe,e),Ee(De,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Dp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Dp(t),e=Op(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}Te(De),Ee(De,e)}function Me(){Te(De),Te(Oe),Te(ke)}function Ne(e){var t=e.memoizedState;t!==null&&(wh._currentValue=t.memoizedState,Ee(Ae,e)),t=De.current;var n=Op(t,e.type);t!==n&&(Ee(Oe,e),Ee(De,n))}function Pe(e){Oe.current===e&&(Te(De),Te(Oe)),Ae.current===e&&(Te(Ae),wh._currentValue=xe)}var Fe,Ie;function Le(e){if(Fe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Fe=t&&t[1]||``,Ie=-1<e.stack.indexOf(`
3
- at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
- `+Fe+e+Ie}var Re=!1;function ze(e,t){if(!e||Re)return``;Re=!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(`
5
- `),l=s.split(`
6
- `);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=`
7
- `+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{Re=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Le(n):``}function Be(e,t){switch(e.tag){case 26:case 27:case 5:return Le(e.type);case 16:return Le(`Lazy`);case 13:return e.child!==t&&t!==null?Le(`Suspense Fallback`):Le(`Suspense`);case 19:return Le(`SuspenseList`);case 0:case 15:return ze(e.type,!1);case 11:return ze(e.type.render,!1);case 1:return ze(e.type,!0);case 31:return Le(`Activity`);case 30:return Le(`ViewTransition`);default:return``}}function Ve(e){try{var t=``,n=null;do t+=Be(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
8
- Error generating stack: `+e.message+`
9
- `+e.stack}}var He=Object.prototype.hasOwnProperty,Ue=t.unstable_scheduleCallback,We=t.unstable_cancelCallback,Ge=t.unstable_shouldYield,Ke=t.unstable_requestPaint,qe=t.unstable_now,Je=t.unstable_getCurrentPriorityLevel,Ye=t.unstable_ImmediatePriority,Xe=t.unstable_UserBlockingPriority,Ze=t.unstable_NormalPriority,Qe=t.unstable_LowPriority,$e=t.unstable_IdlePriority,et=t.log,tt=t.unstable_setDisableYieldValue,nt=null,rt=null;function it(e){if(typeof et==`function`&&tt(e),rt&&typeof rt.setStrictMode==`function`)try{rt.setStrictMode(nt,e)}catch{}}var at=Math.clz32?Math.clz32:ct,ot=Math.log,st=Math.LN2;function ct(e){return e>>>=0,e===0?32:31-(ot(e)/st|0)|0}var lt=256,ut=262144,dt=4194304;function ft(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 pt(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=ft(n))):i=ft(o):i=ft(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ft(n))):i=ft(o)):i=ft(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 mt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ht(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-at(n),i=1<<r;t|=e[r],n&=~i}return t}function gt(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 _t(){var e=dt;return dt<<=1,!(dt&62914560)&&(dt=4194304),e}function vt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function yt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function bt(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-at(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&&xt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function xt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-at(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function St(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-at(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Ct(e,t){var n=t&-t;return n=n&42?1:wt(n),(n&(e.suspendedLanes|t))===0?n:0}function wt(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 Tt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Et(){var e=k.p;return e===0?(e=window.event,e===void 0?32:Bh(e.type)):e}function Dt(e,t){var n=k.p;try{return k.p=e,t()}finally{k.p=n}}var Ot=Math.random().toString(36).slice(2),kt=`__reactFiber$`+Ot,At=`__reactProps$`+Ot,jt=`__reactContainer$`+Ot,Mt=`__reactEvents$`+Ot,Nt=`__reactListeners$`+Ot,Pt=`__reactHandles$`+Ot,Ft=`__reactResources$`+Ot,It=`__reactMarker$`+Ot,Lt=`__reactLoad$`+Ot;function Rt(e){delete e[kt],delete e[At],delete e[Nt],delete e[Pt]}function zt(e){var t;if(t=e[kt])return t;for(var n=e.parentNode;n;){if(t=n[jt]||n[kt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=km(e);e!==null;){if(n=e[kt])return n;e=km(e)}return t}e=n,n=e.parentNode}return null}function Bt(e){if(e=e[kt]||e[jt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Vt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Ht(e){var t=e[Ft];return t||=e[Ft]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Ut(e){e[It]=!0}function Wt(e){e[Lt]=void 0}var Gt=new Set,Kt={};function qt(e,t){Jt(e,t),Jt(e+`Capture`,t)}function Jt(e,t){for(Kt[e]=t,e=0;e<t.length;e++)Gt.add(t[e])}var Yt=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]*$`),Xt={},Zt={};function Qt(e){return He.call(Zt,e)?!0:He.call(Xt,e)?!1:Yt.test(e)?Zt[e]=!0:(Xt[e]=!0,!1)}var $t=!1;function en(){var e=$t;return $t=!1,e}function tn(e,t,n){if(Qt(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 nn(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 rn(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 an(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function on(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function sn(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 cn(e){if(!e._valueTracker){var t=on(e)?`checked`:`value`;e._valueTracker=sn(e,t,``+e[t])}}function ln(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=on(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var un=/[\n"\\]/g;function dn(e){return e.replace(un,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function fn(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=``+an(t)):e.value!==``+an(t)&&(e.value=``+an(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):mn(e,an(n)):o===`number`&&e.value==t?mn(e,an(e.value)):mn(e,an(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=``+an(s):e.removeAttribute(`name`)}function pn(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)){cn(e);return}n=n==null?``:``+an(n),t=t==null?n:``+an(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),cn(e)}function mn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function hn(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=``+an(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 gn(e,t,n){t!=null&&(t=``+an(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+an(n)}function _n(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(be(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=an(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),cn(e)}function vn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var yn=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 bn(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||yn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function xn(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]=``,$t=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(bn(e,a,r),$t=!0)}else for(var o in t)t.hasOwnProperty(o)&&bn(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`],[`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`]]),wn=/^[\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 Tn(e){return wn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function En(){}var Dn=null;function On(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var kn=null,An=null;function jn(e){var t=Bt(e);if(t&&(e=t.stateNode)){var n=e[At]||null;a:switch(e=t.stateNode,t.type){case`input`:if(fn(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="`+dn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[At]||null;if(!a)throw Error(i(90));fn(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&&ln(r)}break a;case`textarea`:gn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&hn(e,!!n.multiple,t,!1)}}}var Mn=!1;function Nn(e,t,n){if(Mn)return e(t,n);Mn=!0;try{return e(t)}finally{if(Mn=!1,(kn!==null||An!==null)&&(tf(),kn&&(t=kn,e=An,An=kn=null,jn(t),e)))for(t=0;t<e.length;t++)jn(e[t])}}function Pn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[At]||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 Fn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,In=!1;if(Fn)try{var Ln={};Object.defineProperty(Ln,"passive",{get:function(){In=!0}}),window.addEventListener(`test`,Ln,Ln),window.removeEventListener(`test`,Ln,Ln)}catch{In=!1}var A=null,Rn=null,zn=null;function Bn(){if(zn)return zn;var e,t=Rn,n=t.length,r,i=`value`in A?A.value:A.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 zn=i.slice(e,1<r?1-r:void 0)}function Vn(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 Hn(){return!0}function Un(){return!1}function Wn(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)?Hn:Un,this.isPropagationStopped=Un,this}return T(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=Hn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Hn)},persist:function(){},isPersistent:Hn}),t}var Gn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Kn=Wn(Gn),qn=T({},Gn,{view:0,detail:0}),Jn=Wn(qn),Yn,Xn,Zn,Qn=T({},qn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:lr,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Zn&&(Zn&&e.type===`mousemove`?(Yn=e.screenX-Zn.screenX,Xn=e.screenY-Zn.screenY):Xn=Yn=0,Zn=e),Yn)},movementY:function(e){return`movementY`in e?e.movementY:Xn}}),$n=Wn(Qn),er=Wn(T({},Qn,{dataTransfer:0})),tr=Wn(T({},qn,{relatedTarget:0})),nr=Wn(T({},Gn,{animationName:0,elapsedTime:0,pseudoElement:0})),rr=Wn(T({},Gn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),ir=Wn(T({},Gn,{data:0})),ar={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},or={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`},sr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function cr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=sr[e])?!!t[e]:!1}function lr(){return cr}var ur=Wn(T({},qn,{key:function(e){if(e.key){var t=ar[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Vn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?or[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:lr,charCode:function(e){return e.type===`keypress`?Vn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Vn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),dr=Wn(T({},Qn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),fr=Wn(T({},Gn,{submitter:0})),pr=Wn(T({},qn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:lr})),mr=Wn(T({},Gn,{propertyName:0,elapsedTime:0,pseudoElement:0})),hr=Wn(T({},Qn,{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})),gr=Wn(T({},Gn,{newState:0,oldState:0,source:0})),_r=[9,13,27,32],vr=Fn&&`CompositionEvent`in window,yr=null;Fn&&`documentMode`in document&&(yr=document.documentMode);var br=Fn&&`TextEvent`in window&&!yr,xr=Fn&&(!vr||yr&&8<yr&&11>=yr),Sr=` `,Cr=!1;function wr(e,t){switch(e){case`keyup`:return _r.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Tr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Er=!1;function Dr(e,t){switch(e){case`compositionend`:return Tr(t);case`keypress`:return t.which===32?(Cr=!0,Sr):null;case`textInput`:return e=t.data,e===Sr&&Cr?null:e;default:return null}}function Or(e,t){if(Er)return e===`compositionend`||!vr&&wr(e,t)?(e=Bn(),zn=Rn=A=null,Er=!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 xr&&t.locale!==`ko`?null:t.data;default:return null}}var kr={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 Ar(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!kr[e.type]:t===`textarea`}function jr(e,t,n,r){kn?An?An.push(r):An=[r]:kn=r,t=fp(t,`onChange`),0<t.length&&(n=new Kn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Mr=null,Nr=null;function Pr(e){ip(e,0)}function Fr(e){if(ln(Vt(e)))return e}function Ir(e,t){if(e===`change`)return t}var Lr=!1;if(Fn){var Rr;if(Fn){var zr=`oninput`in document;if(!zr){var Br=document.createElement(`div`);Br.setAttribute(`oninput`,`return;`),zr=typeof Br.oninput==`function`}Rr=zr}else Rr=!1;Lr=Rr&&(!document.documentMode||9<document.documentMode)}function Vr(){Mr&&(Mr.detachEvent(`onpropertychange`,Hr),Nr=Mr=null)}function Hr(e){if(e.propertyName===`value`&&Fr(Nr)){var t=[];jr(t,Nr,e,On(e)),Nn(Pr,t)}}function Ur(e,t,n){e===`focusin`?(Vr(),Mr=t,Nr=n,Mr.attachEvent(`onpropertychange`,Hr)):e===`focusout`&&Vr()}function Wr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Fr(Nr)}function Gr(e,t){if(e===`click`)return Fr(t)}function Kr(e,t){if(e===`input`||e===`change`)return Fr(t)}function qr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Jr=typeof Object.is==`function`?Object.is:qr;function Yr(e,t){if(Jr(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(!He.call(t,i)||!Jr(e[i],t[i]))return!1}return!0}function Xr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Zr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Qr(e,t){var n=Zr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Zr(n)}}function $r(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?$r(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ei(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Xr(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=Xr(e.document)}return t}function ti(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 ni=Fn&&`documentMode`in document&&11>=document.documentMode,ri=null,ii=null,ai=null,oi=!1;function si(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;oi||ri==null||ri!==Xr(r)||(r=ri,`selectionStart`in r&&ti(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}),ai&&Yr(ai,r)||(ai=r,r=fp(ii,`onSelect`),0<r.length&&(t=new Kn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=ri)))}function ci(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var li={animationend:ci(`Animation`,`AnimationEnd`),animationiteration:ci(`Animation`,`AnimationIteration`),animationstart:ci(`Animation`,`AnimationStart`),transitionrun:ci(`Transition`,`TransitionRun`),transitionstart:ci(`Transition`,`TransitionStart`),transitioncancel:ci(`Transition`,`TransitionCancel`),transitionend:ci(`Transition`,`TransitionEnd`)},ui={},di={};Fn&&(di=document.createElement(`div`).style,`AnimationEvent`in window||(delete li.animationend.animation,delete li.animationiteration.animation,delete li.animationstart.animation),`TransitionEvent`in window||delete li.transitionend.transition);function fi(e){if(ui[e])return ui[e];if(!li[e])return e;var t=li[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in di)return ui[e]=t[n];return e}var pi=fi(`animationend`),hi=fi(`animationiteration`),_i=fi(`animationstart`),vi=fi(`transitionrun`),yi=fi(`transitionstart`),bi=fi(`transitioncancel`),xi=fi(`transitionend`),Si=new Map,Ci=`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(` `);Ci.push(`scrollEnd`);function wi(e,t){Si.set(e,t),qt(t,[e])}var Ti=0;function Ei(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Id.identifierPrefix;var n=Ti++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function Di(e){if(e==null||typeof e==`string`)return e;var t=null,n=Wd;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 Oi(e,t){return e=Di(e),t=Di(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var ki=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)},Ai=[],ji=0,Mi=0;function Ni(){for(var e=ji,t=Mi=ji=0;t<e;){var n=Ai[t];Ai[t++]=null;var r=Ai[t];Ai[t++]=null;var i=Ai[t];Ai[t++]=null;var a=Ai[t];if(Ai[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&&Ii(n,i,a)}}function Pi(e,t,n,r){Ai[ji++]=e,Ai[ji++]=t,Ai[ji++]=n,Ai[ji++]=r,Mi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Fi(e,t,n,r){return Pi(e,t,n,r),Li(e)}function j(e,t){return Pi(e,null,null,t),Li(e)}function Ii(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-at(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Li(e){if(50<Gd)throw Gd=0,Kd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ri={};function zi(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 Bi(e,t,n,r){return new zi(e,t,n,r)}function Vi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Hi(e,t){var n=e.alternate;return n===null?(n=Bi(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 Ui(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 Wi(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Vi(r)&&(s=1);else if(typeof r==`string`)s=uh(e,n,De.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case de:return e=Bi(31,n,t,a),e.elementType=de,e.lanes=o,e;case re:return Gi(n.children,a,o,t);case E:s=8,a|=24;break;case ie:return e=Bi(12,n,t,a|2),e.elementType=ie,e.lanes=o,e;case se:return e=Bi(13,n,t,a),e.elementType=se,e.lanes=o,e;case ce:return e=Bi(19,n,t,a),e.elementType=ce,e.lanes=o,e;case fe:case me:return e=a|32,e=Bi(30,n,t,e),e.elementType=me,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case oe:s=10;break a;case ae:s=9;break a;case D:s=11;break a;case le:s=14;break a;case ue:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Bi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Gi(e,t,n,r){return e=Bi(7,e,r,t),e.lanes=n,e}function Ki(e,t,n){return e=Bi(6,e,null,t),e.lanes=n,e}function qi(e){var t=Bi(18,null,null,0);return t.stateNode=e,t}function Ji(e,t,n){return t=Bi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Yi=new WeakMap;function Xi(e,t){if(typeof e==`object`&&e){var n=Yi.get(e);return n===void 0?(t={value:e,source:t,stack:Ve(t)},Yi.set(e,t),t):n}return{value:e,source:t,stack:Ve(t)}}var Zi=[],Qi=0,$i=null,ea=0,ta=[],na=0,ra=null,ia=1,aa=``;function oa(e,t){Zi[Qi++]=ea,Zi[Qi++]=$i,$i=e,ea=t}function sa(e,t,n){ta[na++]=ia,ta[na++]=aa,ta[na++]=ra,ra=e;var r=ia;e=aa;var i=32-at(r)-1;r&=~(1<<i),n+=1;var a=32-at(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ia=1<<32-at(t)+i|n<<i|r,aa=a+e}else ia=1<<a|n<<i|r,aa=e}function ca(e){e.return!==null&&(oa(e,1),sa(e,1,0))}function la(e){for(;e===$i;)$i=Zi[--Qi],Zi[Qi]=null,ea=Zi[--Qi],Zi[Qi]=null;for(;e===ra;)ra=ta[--na],ta[na]=null,aa=ta[--na],ta[na]=null,ia=ta[--na],ta[na]=null}function ua(e,t){ta[na++]=ia,ta[na++]=aa,ta[na++]=ra,ia=t.id,aa=t.overflow,ra=e}var da=null,fa=null,pa=!1,ma=null,M=!1,ha=Error(i(519));function ga(e){throw Sa(Xi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ha}function _a(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[kt]=e,t[At]=r,n){case`dialog`:ap(`cancel`,t),ap(`close`,t);break;case`iframe`:case`object`:case`embed`:ap(`load`,t);break;case`video`:case`audio`:for(n=0;n<np.length;n++)ap(np[n],t);break;case`source`:ap(`error`,t);break;case`img`:case`image`:case`link`:ap(`error`,t),ap(`load`,t);break;case`details`:ap(`toggle`,t);break;case`input`:ap(`invalid`,t),pn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:ap(`invalid`,t);break;case`textarea`:ap(`invalid`,t),_n(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||vp(t.textContent,n)?(r.popover!=null&&(ap(`beforetoggle`,t),ap(`toggle`,t)),r.onScroll!=null&&ap(`scroll`,t),r.onScrollEnd!=null&&ap(`scrollend`,t),r.onClick!=null&&(t.onclick=En),t=!0):t=!1,t||ga(e,!0)}function va(e){for(da=e.return;da;)switch(da.tag){case 5:case 31:case 13:M=!1;return;case 27:case 3:M=!0;return;default:da=da.return}}function ya(e){if(e!==da)return!1;if(!pa)return va(e),pa=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Ap(e.type,e.memoizedProps)),n=!n),n&&fa&&ga(e),va(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));fa=Om(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));fa=Om(e)}else t===27?(t=fa,zp(e.type)?(e=Dm,Dm=null,fa=e):fa=t):fa=da?Em(e.stateNode.nextSibling):null;return!0}function ba(){fa=da=null,pa=!1}function xa(){var e=ma;return e!==null&&(Od===null?Od=e:Od.push.apply(Od,e),ma=null),e}function Sa(e){ma===null?ma=[e]:ma.push(e)}var Ca=we(null),wa=null,Ta=null;function Ea(e,t,n){Ee(Ca,t._currentValue),t._currentValue=n}function Da(e){e._currentValue=Ca.current,Te(Ca)}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 ka(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 a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),Oa(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Aa(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;Jr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Ae.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[wh]:e.push(wh))}a=a.return}return e!==null&&ka(t,e,n,r),t.flags|=262144,e!==null}function ja(e){for(e=e.firstContext;e!==null;){if(!Jr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function N(e){wa=e,Ta=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ma(e){return P(wa,e)}function Na(e,t){return wa===null&&N(e),P(e,t)}function P(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ta===null){if(e===null)throw Error(i(308));Ta=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ta=Ta.next=t;return n}var Pa=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()})}},Fa=t.unstable_scheduleCallback,Ia=t.unstable_NormalPriority,La={$$typeof:oe,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ra(){return{controller:new Pa,data:new Map,refCount:0}}function za(e){e.refCount--,e.refCount===0&&Fa(Ia,function(){e.controller.abort()})}function Ba(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 Va=null;function Ha(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ua=null,Wa=0,Ga=0,Ka=null;function qa(e,t){if(Ua===null){var n=Ua=[];Wa=0,Ga=Zf(),Ka={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Wa++,t.then(Ja,Ja),t}function Ja(){if(--Wa===0&&(Va=null,Ua!==null)){Ka!==null&&(Ka.status=`fulfilled`);var e=Ua;Ua=null,Ga=0,Ka=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ya(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 Xa=O.S;O.S=function(e,t){if(jd=qe(),typeof t==`object`&&t&&typeof t.then==`function`&&qa(e,t),Va!==null)for(var n=Lf;n!==null;)Ba(n,Va),n=n.next;if(n=e.types,n!==null){for(var r=Lf;r!==null;)Ba(r,n),r=r.next;if(Ga!==0){r=Va,r===null&&(r=Va=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Xa!==null&&Xa(e,t)};var Za=we(null);function Qa(){var e=Za.current;return e===null?fd.pooledCache:e}function $a(e,t){t===null?Ee(Za,Za.current):Ee(Za,t.pool)}function eo(){var e=Qa();return e===null?null:{parent:La._currentValue,pool:e}}var to=Error(i(460)),no=Error(i(474)),ro=Error(i(542)),io={then:function(){}};function ao(e){return e=e.status,e===`fulfilled`||e===`rejected`}function oo(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(En,En),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,uo(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(En,En);else{if(e=fd,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,uo(e),e}throw co=t,to}}function so(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(co=e,to):e}}var co=null;function lo(){if(co===null)throw Error(i(459));var e=co;return co=null,e}function uo(e){if(e===to||e===ro)throw Error(i(483))}var fo=null,po=0;function mo(e){var t=po;return po+=1,fo===null&&(fo=[]),oo(fo,e,t)}function ho(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function go(e,t){throw t.$$typeof===ee?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function _o(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=Hi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Ki(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===re?(e=d(e,t,n.props.children,r,n.key),ho(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===ue&&so(i)===t.type)?(t=a(t,n.props),ho(t,n),t.return=e,t):(t=Wi(n.type,n.key,n.props,null,e.mode,r),ho(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=Ji(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=Gi(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=Ki(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case te:return n=Wi(t.type,t.key,t.props,null,e.mode,n),ho(n,t),n.return=e,n;case ne:return t=Ji(t,e.mode,n),t.return=e,t;case ue:return t=so(t),f(e,t,n)}if(be(t)||_e(t))return t=Gi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,mo(t),n);if(t.$$typeof===oe)return f(e,Na(e,t),n);go(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 te:return n.key===i?l(e,t,n,r):null;case ne:return n.key===i?u(e,t,n,r):null;case ue:return n=so(n),p(e,t,n,r)}if(be(n)||_e(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,mo(n),r);if(n.$$typeof===oe)return p(e,t,Na(e,n),r);go(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 te:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case ne:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case ue:return r=so(r),m(e,t,n,r,i)}if(be(r)||_e(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,mo(r),i);if(r.$$typeof===oe)return m(e,t,n,Na(t,r),i);go(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),pa&&oa(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 pa&&oa(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),pa&&oa(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),pa&&oa(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 pa&&oa(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),pa&&oa(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===re&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case te:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===re){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),ho(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ue&&so(l)===r.type){n(e,r.sibling),c=a(r,o.props),ho(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===re?(c=Gi(o.props.children,e.mode,c,o.key),ho(c,o),c.return=e,e=c):(c=Wi(o.type,o.key,o.props,null,e.mode,c),ho(c,o),c.return=e,e=c)}return s(e);case ne: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=Ji(o,e.mode,c),c.return=e,e=c}return s(e);case ue:return o=so(o),_(e,r,o,c)}if(be(o))return h(e,r,o,c);if(_e(o)){if(l=_e(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,mo(o),c);if(o.$$typeof===oe)return _(e,r,Na(e,o),c);go(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=Ki(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{po=0;var i=_(e,t,n,r);return fo=null,i}catch(t){if(t===to||t===ro)throw t;var a=Bi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var vo=_o(!0),yo=_o(!1),bo=!1;function xo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function So(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 Co(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function wo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,dd&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Li(e),Ii(e,null,n),t}return Pi(e,r,t,n),Li(e)}function To(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,St(e,n)}}function Eo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Do=!1;function Oo(){if(Do){var e=Ka;if(e!==null)throw e}}function ko(e,t,n,r){Do=!1;var i=e.updateQueue;bo=!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?(md&f)===f:(r&f)===f){f!==0&&f===Ga&&(Do=!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=T({},d,f);break a;case 2:bo=!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),Sd|=o,e.lanes=o,e.memoizedState=d}}function Ao(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function jo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ao(n[e],t)}var Mo=we(null),No=we(0);function Po(e,t){e=bd,Ee(No,e),Ee(Mo,t),bd=e|t.baseLanes}function Fo(){Ee(No,bd),Ee(Mo,Mo.current)}function Io(){bd=No.current,Te(Mo),Te(No)}var Lo=we(null),Ro=null;function zo(e){var t=e.alternate;Ee(Wo,Wo.current&1),Ee(Lo,e),Ro===null&&(t===null||Mo.current!==null||t.memoizedState!==null)&&(Ro=e)}function Bo(e){Ee(Wo,Wo.current),Ee(Lo,e),Ro===null&&(Ro=e)}function Vo(e){e.tag===22?(Ee(Wo,Wo.current),Ee(Lo,e),Ro===null&&(Ro=e)):Ho()}function Ho(){Ee(Wo,Wo.current),Ee(Lo,Lo.current)}function Uo(e){Te(Lo),Ro===e&&(Ro=null),Te(Wo)}var Wo=we(0);function Go(e,t){Ee(Lo,Lo.current),Ee(Wo,t)}function Ko(e){Te(Wo),Te(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)||wm(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,Yo=null,Xo=null,Zo=null,Qo=!1,$o=!1,es=!1,ts=0,ns=0,rs=null,is=0;function as(){throw Error(i(321))}function os(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Jr(e[n],t[n]))return!1;return!0}function ss(e,t,n,r,i,a){return Jo=a,Yo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,O.H=e===null||e.memoizedState===null?wc:Tc,es=!1,a=n(r,i),es=!1,$o&&(a=ls(t,n,r,i)),cs(e),a}function cs(e){O.H=Cc;var t=Xo!==null&&Xo.next!==null;if(Jo=0,Zo=Xo=Yo=null,Qo=!1,ns=0,rs=null,t)throw Error(i(300));e===null||Hc||(e=e.dependencies,e!==null&&ja(e)&&(Hc=!0))}function ls(e,t,n,r){Yo=e;var a=0;do{if($o&&(rs=null),ns=0,$o=!1,25<=a)throw Error(i(301));if(a+=1,Zo=Xo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}O.H=Ec,o=t(n,r)}while($o);return o}function us(){var e=O.H,t=e.useState()[0];return t=typeof t.then==`function`?_s(t):t,e=e.useState()[0],(Xo===null?null:Xo.memoizedState)!==e&&(Yo.flags|=1024),t}function ds(){var e=ts!==0;return ts=0,e}function fs(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function ps(e){if(Qo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Qo=!1}Jo=0,Zo=Xo=Yo=null,$o=!1,ns=ts=0,rs=null}function ms(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Zo===null?Yo.memoizedState=Zo=e:Zo=Zo.next=e,Zo}function hs(){if(Xo===null){var e=Yo.alternate;e=e===null?null:e.memoizedState}else e=Xo.next;var t=Zo===null?Yo.memoizedState:Zo.next;if(t!==null)Zo=t,Xo=e;else{if(e===null)throw Yo.alternate===null?Error(i(467)):Error(i(310));Xo=e,e={memoizedState:Xo.memoizedState,baseState:Xo.baseState,baseQueue:Xo.baseQueue,queue:Xo.queue,next:null},Zo===null?Yo.memoizedState=Zo=e:Zo=Zo.next=e}return Zo}function gs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function _s(e){var t=ns;return ns+=1,rs===null&&(rs=[]),e=oo(rs,e,t),t=Yo,(Zo===null?t.memoizedState:Zo.next)===null&&(t=t.alternate,O.H=t===null||t.memoizedState===null?wc:Tc),e}function vs(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return _s(e);if(e.$$typeof===he)return;if(e.$$typeof===oe)return Ma(e)}throw Error(i(438,String(e)))}function ys(e){var t=null,n=Yo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Yo.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=gs(),Yo.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]=pe;return t.index++,n}function bs(e,t){return typeof t==`function`?t(e):t}function xs(e){return Ss(hs(),Xo,e)}function Ss(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?(Jo&f)===f:(md&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===Ga&&(d=!0);else if((Jo&p)===p){u=u.next,p===Ga&&(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,Yo.lanes|=p,Sd|=p;f=u.action,es&&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,Yo.lanes|=f,Sd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Jr(o,e.memoizedState)&&(Hc=!0,d&&(n=Ka,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 Cs(e){var t=hs(),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);Jr(o,t.memoizedState)||(Hc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ws(e,t,n){var r=Yo,a=hs(),o=pa;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Jr((Xo||a).memoizedState,n);if(s&&(a.memoizedState=n,Hc=!0),a=a.queue,Ys(Ds.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Zo!==null&&!!(Zo.memoizedState.tag&1),Ws(e?9:8,{destroy:void 0},Es.bind(null,r,a,n,t),null),e){if(r.flags|=2048,fd===null)throw Error(i(349));o||Jo&127||Ts(r,t,n)}return n}function Ts(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Yo.updateQueue,t===null?(t=gs(),Yo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Es(e,t,n,r){t.value=n,t.getSnapshot=r,Os(t)&&ks(e)}function Ds(e,t,n){return n(function(){Os(t)&&ks(e)})}function Os(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Jr(e,n)}catch{return!0}}function ks(e){var t=j(e,2);t!==null&&Xd(t,e,2)}function As(e){var t=ms();if(typeof e==`function`){var n=e;if(e=n(),es){it(!0);try{n()}finally{it(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bs,lastRenderedState:e},t}function js(e,t,n,r){return e.baseState=n,Ss(e,Xo,typeof r==`function`?r:bs)}function Ms(e,t,n,r,a){if(bc(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)}};O.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ns(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ns(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=O.T,o={};o.types=a===null?null:a.types,O.T=o;try{var s=n(i,r),c=O.S;c!==null&&c(o,s),Ps(e,t,s)}catch(n){Is(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),O.T=a}}else try{a=n(i,r),Ps(e,t,a)}catch(n){Is(e,t,n)}}function Ps(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Fs(e,t,n)},function(n){return Is(e,t,n)}):Fs(e,t,n)}function Fs(e,t,n){t.status=`fulfilled`,t.value=n,Ls(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ns(e,n)))}function Is(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ls(t),t=t.next;while(t!==r)}e.action=null}function Ls(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Rs(e,t){return t}function zs(e,t){if(pa){var n=fd.formState;if(n!==null){a:{var r=Yo;if(pa){if(fa){b:{for(var i=fa,a=M;i.nodeType!==8;)if(!a||(i=Em(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){fa=Em(i.nextSibling),r=i.data===`F!`;break a}}ga(r)}r=!1}r&&(t=n[0])}}return n=ms(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rs,lastRenderedState:t},n.queue=r,n=_c.bind(null,Yo,r),r.dispatch=n,r=As(!1),a=yc.bind(null,Yo,!1,r.queue),r=ms(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ms.bind(null,Yo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Bs(e){return Vs(hs(),Xo,e)}function Vs(e,t,n){if(t=Ss(e,t,Rs)[0],e=xs(bs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=_s(t)}catch(e){throw e===to?ro:e}else r=t;t=hs();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Yo.flags|=2048,Ws(9,{destroy:void 0},Hs.bind(null,i,n),null)),[r,a,e]}function Hs(e,t){e.action=t}function Us(e){var t=hs(),n=Xo;if(n!==null)return Vs(t,n,e);hs(),t=t.memoizedState,n=hs();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ws(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Yo.updateQueue,t===null&&(t=gs(),Yo.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 Gs(){return hs().memoizedState}function Ks(e,t,n,r){var i=ms();Yo.flags|=e,i.memoizedState=Ws(1|t,{destroy:void 0},n,r===void 0?null:r)}function qs(e,t,n,r){var i=hs();r=r===void 0?null:r;var a=i.memoizedState.inst;Xo!==null&&r!==null&&os(r,Xo.memoizedState.deps)?i.memoizedState=Ws(t,a,n,r):(Yo.flags|=e,i.memoizedState=Ws(1|t,a,n,r))}function Js(e,t){Ks(8390656,8,e,t)}function Ys(e,t){qs(2048,8,e,t)}function Xs(e){Yo.flags|=4;var t=Yo.updateQueue;if(t===null)t=gs(),Yo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Zs(e){var t=hs().memoizedState;return Xs({ref:t,nextImpl:e}),function(){if(dd&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Qs(e,t){return qs(4,2,e,t)}function $s(e,t){return qs(4,4,e,t)}function ec(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 tc(e,t,n){n=n==null?null:n.concat([e]),qs(4,4,ec.bind(null,t,e),n)}function nc(){}function rc(e,t){var n=hs();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&os(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ic(e,t){var n=hs();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&os(t,r[1]))return r[0];if(r=e(),es){it(!0);try{e()}finally{it(!1)}}return n.memoizedState=[r,t],r}function ac(e,t,n){return n===void 0||Jo&1073741824&&!(md&261930)?e.memoizedState=t:(e.memoizedState=n,e=Jd(),Yo.lanes|=e,Sd|=e,n)}function oc(e,t,n,r){return Jr(n,t)?n:Mo.current===null?!(Jo&106)||Jo&1073741824&&!(md&261930)?(Hc=!0,e.memoizedState=n):(e=Jd(),Yo.lanes|=e,Sd|=e,t):(e=ac(e,n,r),Jr(e,t)||(Hc=!0),e)}function sc(e,t,n,r,i){var a=k.p;k.p=a!==0&&8>a?a:8;var o=O.T,s={};s.types=o===null?null:o.types,O.T=s,yc(e,!1,t,n);try{var c=i(),l=O.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?vc(e,t,Ya(c,r),qd(e)):vc(e,t,r,qd(e))}catch(n){vc(e,t,{then:function(){},status:`rejected`,reason:n},qd())}finally{k.p=a,o!==null&&s.types!==null&&(o.types=s.types),O.T=o}}function cc(){}function lc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=uc(e).queue;sc(e,a,t,xe,n===null?cc:function(){return dc(e),n(r)})}function uc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:xe,baseState:xe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:bs,lastRenderedState:xe},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:bs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function dc(e){var t=uc(e);t.next===null&&(t=e.alternate.memoizedState),vc(e,t.next.queue,{},qd())}function fc(){return Ma(wh)}function pc(){return hs().memoizedState}function mc(){return hs().memoizedState}function hc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=qd();e=Co(n);var r=wo(t,e,n);r!==null&&(Xd(r,t,n),To(r,t,n)),t={cache:Ra()},e.payload=t;return}t=t.return}}function gc(e,t,n){var r=qd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},bc(e)?xc(t,n):(n=Fi(e,t,n,r),n!==null&&(Xd(n,e,r),Sc(n,t,r)))}function _c(e,t,n){vc(e,t,n,qd())}function vc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(bc(e))xc(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,Jr(s,o))return Pi(e,t,i,0),fd===null&&Ni(),!1}catch{}if(n=Fi(e,t,i,r),n!==null)return Xd(n,e,r),Sc(n,t,r),!0}return!1}function yc(e,t,n,r){if(r={lane:2,revertLane:Zf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},bc(e)){if(t)throw Error(i(479))}else t=Fi(e,n,r,2),t!==null&&Xd(t,e,2)}function bc(e){var t=e.alternate;return e===Yo||t!==null&&t===Yo}function xc(e,t){$o=Qo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Sc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,St(e,n)}}var Cc={readContext:Ma,use:vs,useCallback:as,useContext:as,useEffect:as,useImperativeHandle:as,useLayoutEffect:as,useInsertionEffect:as,useMemo:as,useReducer:as,useRef:as,useState:as,useDebugValue:as,useDeferredValue:as,useTransition:as,useSyncExternalStore:as,useId:as,useHostTransitionStatus:as,useFormState:as,useActionState:as,useOptimistic:as,useMemoCache:as,useCacheRefresh:as,useEffectEvent:as},wc={readContext:Ma,use:vs,useCallback:function(e,t){return ms().memoizedState=[e,t===void 0?null:t],e},useContext:Ma,useEffect:Js,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Ks(4194308,4,ec.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ks(4194308,4,e,t)},useInsertionEffect:function(e,t){Ks(4,2,e,t)},useMemo:function(e,t){var n=ms();t=t===void 0?null:t;var r=e();if(es){it(!0);try{e()}finally{it(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ms();if(n!==void 0){var i=n(t);if(es){it(!0);try{n(t)}finally{it(!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=gc.bind(null,Yo,e),[r.memoizedState,e]},useRef:function(e){var t=ms();return e={current:e},t.memoizedState=e},useState:function(e){e=As(e);var t=e.queue,n=_c.bind(null,Yo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:nc,useDeferredValue:function(e,t){return ac(ms(),e,t)},useTransition:function(){var e=As(!1);return e=sc.bind(null,Yo,e.queue,!0,!1),ms().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Yo,a=ms();if(pa){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),fd===null)throw Error(i(349));md&127||Ts(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Js(Ds.bind(null,r,o,e),[e]),r.flags|=2048,Ws(9,{destroy:void 0},Es.bind(null,r,o,n,t),null),n},useId:function(){var e=ms(),t=fd.identifierPrefix;if(pa){var n=aa,r=ia;n=(r&~(1<<32-at(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=ts++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=is++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:fc,useFormState:zs,useActionState:zs,useOptimistic:function(e){var t=ms();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=yc.bind(null,Yo,!0,n),n.dispatch=t,[e,t]},useMemoCache:ys,useCacheRefresh:function(){return ms().memoizedState=hc.bind(null,Yo)},useEffectEvent:function(e){var t=ms(),n={impl:e};return t.memoizedState=n,function(){if(dd&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Tc={readContext:Ma,use:vs,useCallback:rc,useContext:Ma,useEffect:Ys,useImperativeHandle:tc,useInsertionEffect:Qs,useLayoutEffect:$s,useMemo:ic,useReducer:xs,useRef:Gs,useState:function(){return xs(bs)},useDebugValue:nc,useDeferredValue:function(e,t){return oc(hs(),Xo.memoizedState,e,t)},useTransition:function(){var e=xs(bs)[0],t=hs().memoizedState;return[typeof e==`boolean`?e:_s(e),t]},useSyncExternalStore:ws,useId:pc,useHostTransitionStatus:fc,useFormState:Bs,useActionState:Bs,useOptimistic:function(e,t){return js(hs(),Xo,e,t)},useMemoCache:ys,useCacheRefresh:mc,useEffectEvent:Zs},Ec={readContext:Ma,use:vs,useCallback:rc,useContext:Ma,useEffect:Ys,useImperativeHandle:tc,useInsertionEffect:Qs,useLayoutEffect:$s,useMemo:ic,useReducer:Cs,useRef:Gs,useState:function(){return Cs(bs)},useDebugValue:nc,useDeferredValue:function(e,t){var n=hs();return Xo===null?ac(n,e,t):oc(n,Xo.memoizedState,e,t)},useTransition:function(){var e=Cs(bs)[0],t=hs().memoizedState;return[typeof e==`boolean`?e:_s(e),t]},useSyncExternalStore:ws,useId:pc,useHostTransitionStatus:fc,useFormState:Us,useActionState:Us,useOptimistic:function(e,t){var n=hs();return Xo===null?(n.baseState=e,[e,n.queue.dispatch]):js(n,Xo,e,t)},useMemoCache:ys,useCacheRefresh:mc,useEffectEvent:Zs};function Dc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:T({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Oc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=qd(),i=Co(r);i.payload=t,n!=null&&(i.callback=n),t=wo(e,i,r),t!==null&&(Xd(t,e,r),To(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=qd(),i=Co(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=wo(e,i,r),t!==null&&(Xd(t,e,r),To(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=qd(),r=Co(n);r.tag=2,t!=null&&(r.callback=t),t=wo(e,r,n),t!==null&&(Xd(t,e,n),To(t,e,n))}};function kc(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?!Yr(n,r)||!Yr(i,a):!0}function Ac(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&&Oc.enqueueReplaceState(t,t.state,null)}function jc(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=T({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Mc(e){ki(e)}function Nc(e){console.error(e)}function Pc(e){ki(e)}function Fc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ic(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 Lc(e,t,n){return n=Co(n),n.tag=3,n.payload={element:null},n.callback=function(){Fc(e,t)},n}function Rc(e){return e=Co(e),e.tag=3,e}function zc(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(){Ic(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ic(t,n,r),typeof i!=`function`&&(Pd===null?Pd=new Set([this]):Pd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Bc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Aa(t,n,a,!0),n=Lo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Ro===null?lf():n.alternate===null&&xd===0&&(xd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===io?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),jf(e,r,a)),!1;case 22:return n.flags|=65536,r===io?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)),jf(e,r,a)),!1}throw Error(i(435,n.tag))}return jf(e,r,a),lf(),!1}if(pa)return t=Lo.current,t===null?(r!==ha&&(t=Error(i(423),{cause:r}),Sa(Xi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Xi(r,n),a=Lc(e.stateNode,r,a),Eo(e,a),xd!==4&&(xd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ha&&(e=Error(i(422),{cause:r}),Sa(Xi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Xi(o,n),Dd===null?Dd=[o]:Dd.push(o),xd!==4&&(xd=2),t===null)return!0;r=Xi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Lc(n.stateNode,r,e),Eo(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`&&(Pd===null||!Pd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Rc(a),zc(a,e,n,r),Eo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Vc=Error(i(461)),Hc=!1;function Uc(e,t,n,r){t.child=e===null?yo(t,null,n,r):vo(t,e.child,n,r)}function Wc(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 N(t),r=ss(e,t,n,o,a,i),s=ds(),e!==null&&!Hc?(fs(e,t,i),vl(e,t,i)):(pa&&s&&ca(t),t.flags|=1,Uc(e,t,r,i),t.child)}function Gc(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,Kc(e,t,a,r,i)):(e=Wi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!yl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Yr:n,n(o,r)&&e.ref===t.ref)return vl(e,t,i)}return t.flags|=1,e=Hi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Kc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Yr(a,r)&&e.ref===t.ref){if(Hc=!1,t.pendingProps=r=a,yl(e,i))e.flags&131072&&(Hc=!0);else return t.lanes=e.lanes,vl(e,t,i)}}return el(e,t,n,r,i)}function qc(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 Yc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&$a(t,a===null?null:a.cachePool),a===null?Fo():Po(t,a),Vo(t);else return r=t.lanes=536870912,Yc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&$a(t,null),Fo(),Ho()):($a(t,a.cachePool),Po(t,a),Ho(),t.memoizedState=null);return Uc(e,t,i,n),t.child}function Jc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Yc(e,t,n,r,i){var a=Qa();return a=a===null?null:{parent:La._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&$a(t,null),Fo(),Vo(t),e!==null&&Aa(e,t,r,!0),t.childLanes=i,null}function Xc(e,t){return t=ll({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Zc(e,t,n){return vo(t,e.child,null,n),e=Xc(t,t.pendingProps),e.flags|=2,Uo(t),t.memoizedState=null,e}function Qc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(pa){if(r.mode===`hidden`)return e=Xc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Jc(null,e);if(Bo(t),(e=fa)?(e=Sm(e,M),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ra===null?null:{id:ia,overflow:aa},retryLane:536870912,hydrationErrors:null},n=qi(e),n.return=t,t.child=n,da=t,fa=null)):e=null,e===null)throw ga(t);return t.lanes=536870912,null}return Xc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Bo(t),a){if(t.flags&256)t.flags&=-257,t=Zc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Hc||Aa(e,t,n,!1),a=(n&e.childLanes)!==0,Hc||a){if(Mo.current===null){if(r=fd,r!==null&&(s=Ct(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,j(e,s),Xd(r,e,s),Vc;lf()}t=Zc(e,t,n)}else e=o.treeContext,fa=Em(s.nextSibling),da=t,pa=!0,ma=null,M=!1,e!==null&&ua(t,e),t=Xc(t,r),t.flags|=134221824;return t}return e=Hi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function $c(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 el(e,t,n,r,i){return N(t),n=ss(e,t,n,r,void 0,i),r=ds(),e!==null&&!Hc?(fs(e,t,i),vl(e,t,i)):(pa&&r&&ca(t),t.flags|=1,Uc(e,t,n,i),t.child)}function tl(e,t,n,r,i,a){return N(t),t.updateQueue=null,n=ls(t,r,n,i),cs(e),r=ds(),e!==null&&!Hc?(fs(e,t,a),vl(e,t,a)):(pa&&r&&ca(t),t.flags|=1,Uc(e,t,n,a),t.child)}function nl(e,t,n,r,i){if(N(t),t.stateNode===null){var a=Ri,o=n.contextType;typeof o==`object`&&o&&(a=Ma(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Oc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},xo(t),o=n.contextType,a.context=typeof o==`object`&&o?Ma(o):Ri,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Dc(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&&Oc.enqueueReplaceState(a,a.state,null),ko(t,r,a,i),Oo(),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=jc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ri,typeof u==`object`&&u&&(o=Ma(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)&&Ac(t,a,r,o),bo=!1;var f=t.memoizedState;a.state=f,ko(t,r,a,i),Oo(),l=t.memoizedState,s||f!==l||bo?(typeof d==`function`&&(Dc(t,n,d,r),l=t.memoizedState),(c=bo||kc(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,So(e,t),o=t.memoizedProps,u=jc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ri,typeof l==`object`&&l&&(c=Ma(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)&&Ac(t,a,r,c),bo=!1,f=t.memoizedState,a.state=f,ko(t,r,a,i),Oo();var p=t.memoizedState;o!==d||f!==p||bo||e!==null&&e.dependencies!==null&&ja(e.dependencies)?(typeof s==`function`&&(Dc(t,n,s,r),p=t.memoizedState),(u=bo||kc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ja(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,$c(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=vo(t,e.child,null,i),t.child=vo(t,null,n,i)):Uc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=vl(e,t,i),e}function rl(e,t,n,r){return ba(),t.flags|=256,Uc(e,t,n,r),t.child}var il={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function al(e){return{baseLanes:e,cachePool:eo()}}function ol(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Td),e}function sl(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(pa){if(i?zo(t):Ho(),(e=fa)?(e=Sm(e,M),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ra===null?null:{id:ia,overflow:aa},retryLane:536870912,hydrationErrors:null},n=qi(e),n.return=t,t.child=n,da=t,fa=null)):e=null,e===null)throw ga(t);return t.lanes=wm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Ho(),i=t.mode,a=ll({mode:`hidden`,children:a},i),r=Gi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=al(n),r.childLanes=ol(e,o,n),t.memoizedState=il,Jc(null,r)):(zo(t),cl(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return dl(e,t,a,o,r,c,s,n)}return i?(Ho(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Hi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Gi(i,a,n,null),i.flags|=2):i=Hi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Jc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=al(n):(a=i.cachePool,a===null?a=eo():(s=La._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=ol(e,o,n),t.memoizedState=il,Jc(e.child,r)):(zo(t),n=e.child,e=n.sibling,n=Hi(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 cl(e,t){return t=ll({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function ll(e,t){return e=Bi(22,e,null,t),e.lanes=0,e}function ul(e,t,n){return vo(t,e.child,null,n),e=cl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function dl(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(zo(t),t.flags&=-257,ul(e,t,c)):t.memoizedState===null?(Ho(),o=a.fallback,s=t.mode,a=ll({mode:`visible`,children:a.children},s),o=Gi(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,vo(t,e.child,null,c),a=t.child,a.memoizedState=al(c),a.childLanes=ol(e,r,c),t.memoizedState=il,Jc(null,a)):(Ho(),t.child=e.child,t.flags|=128,null);if(zo(t),wm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,Sa({value:a,source:null,stack:null})),ul(e,t,c)}if(Hc||Aa(e,t,c,!1),r=(c&e.childLanes)!==0,Hc||r){if(Mo.current!==null)return ul(e,t,c);if(r=fd,r!==null&&(a=Ct(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,j(e,a),Xd(r,e,a),Vc;return Cm(o)||lf(),ul(e,t,c)}return Cm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,fa=Em(o.nextSibling),da=t,pa=!0,ma=null,M=!1,e!==null&&ua(t,e),t=cl(t,a.children),t.flags|=134221824,t)}function fl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Oa(e.return,t,n)}function pl(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&qo(n)===null&&(t=e),e=e.sibling}return t}function ml(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 hl(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 gl(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?(hl(e),Uc(e,t,r,n),hl(e)):Uc(e,t,r,n),r=pa?ea:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&fl(e,n,t);else if(e.tag===19)fl(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=pl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,hl(t)),ml(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}ml(t,!0,n,null,a,r);break;case`together`:ml(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=pl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ml(t,!1,i,n,a,r)}return t.child}function _l(e,t,n){var r=t.pendingProps;return Ea(t,t.type,r.value),Uc(e,t,r.children,n),t.child}function vl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Sd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Aa(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=Hi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Hi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function yl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ja(e)))}function bl(e,t,n){switch(t.tag){case 3:je(t,t.stateNode.containerInfo),Ea(t,La,e.memoizedState.cache),ba();break;case 27:case 5:Ne(t);break;case 4:je(t,t.stateNode.containerInfo);break;case 10:Ea(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=Aa(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?sl(e,t,n):(zo(t),e=vl(e,t,n),e===null?null:e.sibling)}zo(t);break;case 19:if(t.flags&128)return gl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(Aa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return gl(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,qc(e,t,n,t.pendingProps);case 24:Ea(t,La,e.memoizedState.cache)}return vl(e,t,n)}function xl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Hc=!0;else{if(!yl(e,n)&&!(t.flags&128))return Hc=!1,bl(e,t,n);Hc=!!(e.flags&131072)}}else Hc=!1,pa&&t.flags&1048576&&sa(t,ea,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=so(t.elementType),t.type=e,typeof e==`function`)Vi(e)?(r=jc(e,r),t.tag=1,t=nl(null,t,e,r,n)):(t.tag=0,t=el(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===D){t.tag=11,t=Wc(null,t,e,r,n);break a}if(a===le){t.tag=14,t=Gc(null,t,e,r,n);break a}if(a===oe){t.tag=10,t.type=e,t=_l(null,t,n);break a}}throw t=ye(e)||e,Error(i(306,t,``))}}return t;case 0:return el(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=jc(r,t.pendingProps),nl(e,t,r,a,n);case 3:a:{if(je(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,So(e,t),ko(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ea(t,La,r),r!==o.cache&&ka(t,[La],n,!0),Oo(),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=rl(e,t,r,n);break a}if(r!==a){a=Xi(Error(i(424)),t),Sa(a),t=rl(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(fa=Em(e.firstChild),da=t,pa=!0,ma=null,M=!0,n=yo(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ba(),r===a){t=vl(e,t,n);break a}Uc(e,t,r,n)}t=t.child}return t;case 26:return $c(e,t),e===null?(n=Xm(t.type,null,t.pendingProps,null))?t.memoizedState=n:pa||(t.stateNode=kp(t.type,t.pendingProps,ke.current,t)):t.memoizedState=Xm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ne(t),e===null&&pa&&(r=t.stateNode=Mm(t.type,t.pendingProps,ke.current),da=t,M=!0,a=fa,zp(t.type)?(Dm=a,fa=Em(r.firstChild)):fa=a),Uc(e,t,t.pendingProps.children,n),$c(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&pa&&((a=r=fa)&&(r=bm(r,t.type,t.pendingProps,M),r===null?a=!1:(t.stateNode=r,da=t,fa=Em(r.firstChild),M=!1,a=!0)),a||ga(t)),Ne(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ap(a,o)?r=null:s!==null&&Ap(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=ss(e,t,us,null,null,n),wh._currentValue=a),$c(e,t),Uc(e,t,r,n),t.child;case 6:return e===null&&pa&&((e=n=fa)&&(n=xm(n,t.pendingProps,M),n===null?e=!1:(t.stateNode=n,da=t,fa=null,e=!0)),e||ga(t)),null;case 13:return sl(e,t,n);case 4:return je(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=vo(t,null,r,n):Uc(e,t,r,n),t.child;case 11:return Wc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,$c(e,t),Uc(e,t,r,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 _l(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,N(t),a=Ma(a),r=r(a),t.flags|=1,Uc(e,t,r,n),t.child;case 14:return Gc(e,t,t.type,t.pendingProps,n);case 15:return Kc(e,t,t.type,t.pendingProps,n);case 19:return gl(e,t,n);case 31:return Qc(e,t,n);case 22:return qc(e,t,n,t.pendingProps);case 24:return N(t),r=Ma(La),e===null?(a=Qa(),a===null&&(a=fd,o=Ra(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},xo(t),Ea(t,La,a)):((e.lanes&n)!==0&&(So(e,t),ko(t,null,null,n),Oo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ea(t,La,r),r!==a.cache&&ka(t,[La],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ea(t,La,r))),Uc(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:pa&&ca(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:$c(e,t),Uc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Sl(e){e.flags|=4}function Cl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?dh(t,r):dh(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(of())e.flags|=8192;else throw co=io,no}}else e.flags&=-16777217}function wl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!fh(t)){if(of())e.flags|=8192;else throw co=io,no}}function Tl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:_t(),e.lanes|=t,Ed|=t)}function El(e,t){if(!pa)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function Dl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Ol(e,t,n){var r=t.pendingProps;switch(la(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Dl(t),null;case 1:return Dl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Da(La),Me(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ya(t)?Sl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,xa())),Dl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Sl(t),o===null?(Dl(t),Cl(t,a,null,r,n)):(Dl(t),wl(t,o))):o?o===e.memoizedState?(Dl(t),t.flags&=-16777217):(Sl(t),Dl(t),wl(t,o)):(e=e.memoizedProps,e!==r&&Sl(t),Dl(t),Cl(t,a,e,r,n)),null;case 27:if(Pe(t),n=ke.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Sl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Dl(t),t.subtreeFlags&=-33554433,null}e=De.current,ya(t)?_a(t,e):(e=Mm(a,r,n),t.stateNode=e,Sl(t))}return Dl(t),t.subtreeFlags&=-33554433,null;case 5:if(Pe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Sl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Dl(t),t.subtreeFlags&=-33554433,null}if(o=De.current,ya(t))_a(t,o);else{var s=Ep(ke.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[kt]=t,o[At]=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(F(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Sl(t)}}return Dl(t),t.subtreeFlags&=-33554433,Cl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Sl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ke.current,ya(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=da,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[kt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||vp(e.nodeValue,n)),e||ga(t,!0)}else e=Ep(e).createTextNode(r),e[kt]=t,t.stateNode=e}return Dl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ya(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[kt]=t}else ba(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Dl(t),e=!1}else n=xa(),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(i(558))}return Dl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ya(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[kt]=t}else ba(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Dl(t),a=!1}else a=xa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)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,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),Tl(t,t.updateQueue),Dl(t),null);case 4:return Me(),e===null&&cp(t.stateNode.containerInfo),t.flags|=67108864,Dl(t),null;case 10:return Da(t.type),Dl(t),null;case 19:if(Ko(t),r=t.memoizedState,r===null)return Dl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)El(r,!1);else{if(xd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=qo(e),o!==null){for(t.flags|=128,El(r,!1),e=o.updateQueue,t.updateQueue=e,Tl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ui(n,e),n=n.sibling;return Go(t,Wo.current&1|2),pa&&oa(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&qe()>Md&&(t.flags|=128,a=!0,El(r,!1),t.lanes=4194304)}}else{if(!a){if(e=qo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Tl(t,e),El(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!pa)return Dl(t),null}else 2*qe()-r.renderingStartTime>Md&&n!==536870912&&(t.flags|=128,a=!0,El(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=qe(),e.sibling=null,o=Wo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||pa?Go(t,o):(n=o,Ee(Lo,t),Ee(Wo,n),Ro===null&&(Ro=t)),pa&&oa(t,r.treeForkCount),e}return Dl(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)&&(Dl(t),t.subtreeFlags&6&&(t.flags|=8192)):Dl(t),n=t.updateQueue,n!==null&&Tl(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&&Te(Za),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Da(La),Dl(t),null;case 25:return null;case 30:return t.flags|=33554432,Dl(t),null}throw Error(i(156,t.tag))}function kl(e,t){switch(la(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Da(La),Me(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Pe(t),null;case 31:if(t.memoizedState!==null){if(Uo(t),t.alternate===null)throw Error(i(340));ba()}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(i(340));ba()}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 Me(),null;case 10:return Da(t.type),null;case 22:case 23:return Uo(t),Io(),e!==null&&Te(Za),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Da(La),null;case 25:return null;default:return null}}function Al(e,t){switch(la(t),t.tag){case 3:Da(La),Me();break;case 26:case 27:case 5:Pe(t);break;case 4:Me();break;case 31:t.memoizedState!==null&&Uo(t);break;case 13:Uo(t);break;case 19:Ko(t);break;case 10:Da(t.type);break;case 22:case 23:Uo(t),Io(),e!==null&&Te(Za);break;case 24:Da(La)}}function jl(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){Af(t,t.return,e)}}function Ml(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){Af(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Af(t,t.return,e)}}function Nl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{jo(t,n)}catch(t){Af(e,e.return,t)}}}function Pl(e,t,n){n.props=jc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Af(e,t,n)}}function Fl(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=Ei(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Zp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Qp(e);p(e.child,!1,hm,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){Af(e,t,n)}}function Il(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Af(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){Af(e,t,n)}else n.current=null}}function Ll(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++)_m(e.stateNode,t[n])}function Rl(e){for(var t=e.return;t!==null&&(Vl(t)&&_m(e.stateNode,t.stateNode),!Bl(t));)t=t.return}function zl(e){for(var t=e.return;t!==null&&(Vl(t)&&vm(e.stateNode,t.stateNode),!Bl(t));)t=t.return}function Bl(e){return e.tag===5||e.tag===3||e.tag===27}function Vl(e){return e&&e.tag===7&&e.stateNode!==null}function Hl(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){Af(e,e.return,t)}}function Ul(e,t,n){try{var r=e.stateNode;Sp(r,e.type,n,t),r[At]=t}catch(t){Af(e,e.return,t)}}function Wl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&zp(e.type)||e.tag===4}function Gl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Wl(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&&zp(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 Kl(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=En)),Ll(e,r),$t=!0;else if(i!==4&&(i===27&&(Ll(e,r),r=null,zp(e.type)&&(n=e.stateNode,t=null)),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,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Ll(e,r),$t=!0;else if(i!==4&&(i===27&&(Ll(e,r),r=null,zp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(ql(e,t,n,r),e=e.sibling;e!==null;)ql(e,t,n,r),e=e.sibling}function Jl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);F(t,r,n),t[kt]=e,t[At]=n}catch(t){Af(e,e.return,t)}}var Yl=!1,Xl=null;function Zl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Yl=!0)}var Ql=null;function $l(){var e=Ql;return Ql=null,e}var eu=0;function tu(e,t,n,r,i){return eu=0,nu(e.child,t,n,r,i)}function nu(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Gp(o);r.push(s),s.view&&(a=!0)}else a||Gp(o).view&&(a=!0);Yl=!0,Hp(o,eu===0?t:t+`_`+eu,n),eu++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||nu(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function ru(e,t){for(;e!==null;)e.tag===5?Up(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||ru(e.child,t)),e=e.sibling}function iu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(iu(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=Oi(t.default,t.share),t!==`none`&&(tu(e,n,t,null,!1)||ru(e.child,!1))}e=e.sibling}}function au(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=Ei(r,n),a=Oi(r.default,n.paired?r.share:r.enter);a===`none`?iu(e):tu(e,i,a,null,!1)?(iu(e),n.paired||t||Yd(e,r.onEnter)):ru(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)au(e,t),e=e.sibling;else iu(e)}function ou(e){if(Xl!==null&&Xl.size!==0){var t=Xl;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=Oi(n.default,n.share);if(a!==`none`&&(tu(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Yd(e,n.onShare)):ru(e.child,!1)),t.delete(r),t.size===0)break}}}ou(e)}e=e.sibling}}}function su(e){if(e.tag===30){var t=e.memoizedProps,n=Ei(t,e.stateNode),r=Xl===null?void 0:Xl.get(n),i=Oi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(tu(e,n,i,null,!1)?r===void 0?Yd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Xl.delete(n),Yd(e,t.onShare)):ru(e.child,!1)),Xl!==null&&ou(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)su(e),e=e.sibling;else Xl!==null&&ou(e)}function cu(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=Ei(t,e.stateNode);t=Oi(t.default,t.update),e.flags&=-5,t!==`none`&&tu(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&cu(e);e=e.sibling}}function lu(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,ru(e.child,!1))}lu(e)}e=e.sibling}}function uu(e){if(e.tag===30)e.stateNode.paired=null,ru(e.child,!1),lu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)uu(e),e=e.sibling;else lu(e)}function du(e){for(e=e.child;e!==null;)e.tag===30?ru(e.child,!1):e.subtreeFlags&33554432&&du(e),e=e.sibling}function fu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&eu<a.length){var l=a[eu],u=Gp(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&&Hp(c,eu===0?n:n+`_`+eu,i),s&&e.flags&4||(Ql===null&&(Ql=[]),Ql.push(c,eu===0?r:r+`_`+eu,t.memoizedProps)),eu++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:fu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function pu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=Ei(n,r),a=Oi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Kp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;eu=0,i=fu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Yd(e,n.onUpdate))}else e.subtreeFlags&33554432&&pu(e,t);e=e.sibling}}var mu=!1,hu=!1,gu=!1,_u=!1,vu=typeof WeakSet==`function`?WeakSet:Set,yu=null,bu=!1,xu=!1,Su=!1,Cu=!1;function wu(e,t,n){if(e=e.containerInfo,I=Nh,e=ei(e),ti(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(Tp={focusedElem:e,selectionRange:r},Nh=!1,n=(n&335544064)===n,yu=t,t=n?9270:1024;yu!==null;){if(e=yu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&su(r[a]);if(e.alternate===null&&e.flags&2)n&&Zl(e),Tu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&su(r),Tu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Zl(e),Tu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,yu=r):(n&&cu(e),Tu(n))}}Xl=null}function Tu(e){for(;yu!==null;){var t=yu,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=jc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){Af(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)ym(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:ym(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=Ei(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=Oi(a.default,a.update),a!==`none`&&tu(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,yu=r;break}yu=t.return}}function Eu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Ku(e,n),r&4&&jl(5,n);break;case 1:if(Ku(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Af(n,n.return,e)}else{var i=jc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Af(n,n.return,e)}}}r&64&&Nl(n),r&512&&Fl(n,n.return);break;case 3:if(Ku(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{jo(e,t)}catch(e){Af(n,n.return,e)}}break;case 27:t===null&&r&4&&Jl(n);case 26:case 5:Ku(e,n),t===null&&r&4&&Hl(n),r&512&&Fl(n,n.return);break;case 12:Ku(e,n);break;case 31:Ku(e,n),r&4&&Fu(e,n);break;case 13:Ku(e,n),r&4&&Iu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Pf.bind(null,n),Tm(e,n))));break;case 22:if(r=n.memoizedState!==null||mu,!r){var a=t!==null&&t.memoizedState!==null||hu;t=mu,i=hu,mu=r,(hu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Ju(e,n,r)):Ku(e,n),mu=t,hu=i}break;case 30:Ku(e,n),r&512&&Fl(n,n.return);break;case 7:r&512&&Fl(n,n.return);default:Ku(e,n)}}function Du(e,t){for(e=e.child;e!==null;)Ou(e,t),e=e.sibling}function Ou(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){Af(e,e.return,t)}ku(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,$t=!0}catch(t){Af(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Vp(s,!0):Vp(e.stateNode,!1)}catch(t){Af(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&Du(e,t);break;default:Du(e,t)}}function ku(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:Ou(n,r);break a;case 22:n.memoizedState===null&&ku(n,r);break a;default:ku(n,r)}}e=e.sibling}}function Au(e){var t=e.alternate;t!==null&&(e.alternate=null,Au(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Rt(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 ju=null,Mu=!1;function Nu(e,t,n){for(n=n.child;n!==null;)Pu(e,t,n),n=n.sibling}function Pu(e,t,n){if(rt&&typeof rt.onCommitFiberUnmount==`function`)try{rt.onCommitFiberUnmount(nt,n)}catch{}switch(n.tag){case 26:hu||Il(n,t),Nu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!hu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:hu||Il(n,t),zl(n);var r=ju,i=Mu;zp(n.type)&&(ju=n.stateNode,Mu=!1),Nu(e,t,n),Nm(n.stateNode,n.type,n.memoizedProps),ju=r,Mu=i;break;case 5:hu||Il(n,t),zl(n);case 6:if(n.tag===6&&zl(n),r=ju,i=Mu,ju=null,Nu(e,t,n),ju=r,Mu=i,ju!==null){if(Mu)try{(ju.nodeType===9?ju.body:ju.nodeName===`HTML`?ju.ownerDocument.body:ju).removeChild(n.stateNode),$t=!0}catch(e){Af(n,t,e)}else try{ju.removeChild(n.stateNode),$t=!0}catch(e){Af(n,t,e)}}break;case 18:ju!==null&&(Mu?(e=ju,Bp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),ag(e)):Bp(ju,n.stateNode));break;case 4:r=ju,i=Mu,ju=n.stateNode.containerInfo,Mu=!0,Nu(e,t,n),ju=r,Mu=i;break;case 0:case 11:case 14:case 15:Ml(2,n,t),hu||Ml(4,n,t),Nu(e,t,n);break;case 1:hu||(Il(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Pl(n,t,r)),Nu(e,t,n);break;case 21:Nu(e,t,n);break;case 22:hu=(r=hu)||n.memoizedState!==null,Nu(e,t,n),hu=r;break;case 30:Il(n,t),Nu(e,t,n);break;case 7:hu||Il(n,t),Nu(e,t,n);break;default:Nu(e,t,n)}}function Fu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ag(e)}catch(e){Af(t,t.return,e)}}}function Iu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ag(e)}catch(e){Af(t,t.return,e)}}function Lu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new vu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new vu),t;default:throw Error(i(435,e.tag))}}function Ru(e,t){var n=Lu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Ff.bind(null,e,t);t.then(r,r)}})}function zu(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(zp(l.type)){ju=l.stateNode,Mu=!1;break a}break;case 5:ju=l.stateNode,Mu=!1;break a;case 3:case 4:ju=l.stateNode.containerInfo,Mu=!0;break a}l=l.return}if(ju===null)throw Error(i(160));Pu(s,c,o),ju=null,Mu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Vu(t,e,n),t=t.sibling}var Bu=null;function Vu(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}zu(t,e,n),Hu(e),a&4&&(Ml(3,e,e.return),jl(3,e),Ml(5,e,e.return));break;case 1:zu(t,e,n),Hu(e),a&512&&(hu||r===null||Il(r,r.return)),a&64&&mu&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Bu,zu(t,e,n),Hu(e),a&512&&(hu||r===null||Il(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(mu)e.stateNode=kp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[It]||r[kt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),F(r,t,n),r[kt]=e,Ut(r),t=r;break a;case`link`:if(o=ch(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),F(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=ch(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),F(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[kt]=e,Ut(r),t=r}e.stateNode=t}}else mu||lh(o,e.type,e.stateNode)}else e.stateNode=rh(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Ul(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||hu||t.parentNode.removeChild(t)):a.count--,n===null?mu||lh(o,e.type,e.stateNode):rh(o,n,e.memoizedProps))}break;case 27:zu(t,e,n),Hu(e),a&512&&(hu||r===null||Il(r,r.return)),r!==null&&a&4&&Ul(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=gu,gu=!1,zu(t,e,n),gu=o,Hu(e),a&512&&(hu||r===null||Il(r,r.return)),e.flags&32){t=e.stateNode;try{vn(t,``),$t=!0}catch(t){Af(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Ul(e,t,r===null?t:r.memoizedProps)),a&1024&&(_u=!0);break;case 6:if(zu(t,e,n),Hu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,$t=!0}catch(t){Af(e,e.return,t)}}break;case 3:if($t=!1,sh=null,o=Bu,Bu=Lm(t.containerInfo),zu(t,e,n),Bu=o,Hu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{ag(t.containerInfo)}catch(t){Af(e,e.return,t)}_u&&(_u=!1,Uu(e)),$t=!1;break;case 4:a=gu,gu=mu,r=en(),o=Bu,Bu=Lm(e.stateNode.containerInfo),zu(t,e,n),Hu(e),Bu=o,$t&&xu&&(Su=!0),$t=r,gu=a;break;case 12:zu(t,e,n),Hu(e);break;case 31:zu(t,e,n),Hu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ru(e,t)));break;case 13:zu(t,e,n),Hu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(Ad=qe()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ru(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=mu,l=hu,u=gu;mu=c||o,gu=u||o,hu=l||s,zu(t,e,n),hu=l,gu=u,mu=c,Hu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||mu||hu||(t=s||hu,n=mu,r=hu,mu=o||mu,hu=t,qu(e,2),mu=n,hu=r),!o&&gu||Du(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Ru(e,n))));break;case 19:zu(t,e,n),Hu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ru(e,t)));break;case 30:a&512&&(hu||r===null||Il(r,r.return)),a=en(),o=xu,s=(n&335544064)===n,c=e.memoizedProps,xu=s&&Oi(c.default,c.update)!==`none`,zu(t,e,n),Hu(e),s&&r!==null&&$t&&(e.flags|=4),xu=o,$t=a;break;case 21:break;case 7:a&512&&(hu||r===null||Il(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:zu(t,e,n),Hu(e)}}function Hu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Wl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Vl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Bl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;ql(e,Gl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(vn(l,``),n.flags&=-33),ql(e,Gl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Kl(e,Gl(e),u,s);break;default:throw Error(i(161))}}catch(t){Af(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Uu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Uu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Nh=!0,t.reset(),Nh=!1),e=e.sibling}}function Wu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Gu(t,e),t=t.sibling;else pu(t,!1)}function Gu(e,t){var n=e.alternate;if(n===null)au(e,!1);else switch(e.tag){case 3:if(Cu=bu=!1,$l(),Wu(t,e),!bu&&!Su){if(e=Ql,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Up(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),Cu=!0}Ql=null;break;case 5:Wu(t,e);break;case 4:r=bu,bu=!1,Wu(t,e),bu&&(Su=!0),bu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Wu(t,e):au(e,!1));break;case 30:r=bu,i=$l(),bu=!1,Wu(t,e),bu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=Ei(a,o),o=Ei(n.memoizedProps,o);var s=Oi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,eu=0,t=fu(e,n,t,o,s,a,!0),eu!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Yd(e,e.memoizedProps.onUpdate),Ql=i):i!==null&&(i.push.apply(i,Ql),Ql=i),bu=e.flags&32?!0:r;break;default:Wu(t,e)}}function Ku(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Eu(e,t.alternate,t),t=t.sibling}function qu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Ml(4,n,n.return),qu(n,r);break;case 1:Il(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Pl(n,n.return,i),qu(n,r);break;case 27:r&2&&Nm(n.stateNode,n.type,n.memoizedProps);case 5:Il(n,n.return),n.tag!==5&&n.tag!==27||zl(n),qu(n,r);break;case 6:zl(n);break;case 26:Il(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||hu||i.parentNode.removeChild(i),qu(n,r);break;case 22:n.memoizedState===null&&qu(n,r);break;case 30:Il(n,n.return),qu(n,r);break;case 7:Il(n,n.return);default:qu(n,r)}e=e.sibling}}function Ju(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:Ju(i,a,n),jl(4,a);break;case 1:if(Ju(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Af(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++)Ao(l[i],c)}catch(e){Af(r,r.return,e)}}s&&o&64&&Nl(a),Fl(a,a.return);break;case 27:n&2&&Jl(a);case 5:a.tag!==5&&a.tag!==27||Rl(a),Ju(i,a,n),s&&r===null&&o&4&&Hl(a),Fl(a,a.return);break;case 6:Rl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||mu||lh(Lm(c.ownerDocument),a.type,c),Ju(i,a,n),s&&r===null&&o&4&&Hl(a),Fl(a,a.return);break;case 12:Ju(i,a,n);break;case 31:Ju(i,a,n),s&&o&4&&Fu(i,a);break;case 13:Ju(i,a,n),s&&o&4&&Iu(i,a);break;case 22:a.memoizedState===null&&Ju(i,a,n),Fl(a,a.return);break;case 30:Ju(i,a,n),Fl(a,a.return);break;case 7:Fl(a,a.return);default:Ju(i,a,n)}t=t.sibling}}function Yu(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&&za(n))}function Xu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&za(e))}function Zu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Qu(e,t,n,r),t=t.sibling;else i&&du(t)}function Qu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&uu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Zu(e,t,n,r),a&2048&&jl(9,t);break;case 1:Zu(e,t,n,r);break;case 3:Zu(e,t,n,r),i&&Cu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&za(a)));break;case 12:if(a&2048){Zu(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){Af(t,t.return,e)}}else Zu(e,t,n,r);break;case 31:Zu(e,t,n,r);break;case 13:Zu(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&&uu(t),o._visibility&2?Zu(e,t,n,r):(o._visibility|=2,$u(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&uu(s),o._visibility&2?Zu(e,t,n,r):ed(e,t)),a&2048&&Yu(s,t);break;case 24:Zu(e,t,n,r),a&2048&&Xu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(ru(a.child,!0),ru(t.child,!0))),Zu(e,t,n,r);break;default:Zu(e,t,n,r)}}function $u(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:$u(a,o,s,c,i),jl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,$u(a,o,s,c,i)):u._visibility&2?$u(a,o,s,c,i):ed(a,o),i&&l&2048&&Yu(o.alternate,o);break;case 24:$u(a,o,s,c,i),i&&l&2048&&Xu(o.alternate,o);break;default:$u(a,o,s,c,i)}t=t.sibling}}function ed(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:ed(n,r),i&2048&&Yu(r.alternate,r);break;case 24:ed(n,r),i&2048&&Xu(r.alternate,r);break;default:ed(n,r)}t=t.sibling}}var td=8192;function nd(e,t,n){if(e.subtreeFlags&td)for(e=e.child;e!==null;)rd(e,t,n),e=e.sibling}function rd(e,t,n){switch(e.tag){case 26:nd(e,t,n),e.flags&td&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&mh(n,e)):hh(n,Bu,e.memoizedState,e.memoizedProps));break;case 5:nd(e,t,n),e.flags&td&&(e=e.stateNode,(t&335544128)===t&&mh(n,e));break;case 3:case 4:var r=Bu;Bu=Lm(e.stateNode.containerInfo),nd(e,t,n),Bu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=td,td=16777216,nd(e,t,n),td=r):nd(e,t,n));break;case 30:if((e.flags&td)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Xl===null&&(Xl=new Map),Xl.set(r,i)}nd(e,t,n);break;default:nd(e,t,n)}}function id(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 ad(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];yu=r,cd(r,e)}id(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)od(e),e=e.sibling}function od(e){switch(e.tag){case 0:case 11:case 15:ad(e),e.flags&2048&&Ml(9,e,e.return);break;case 3:ad(e);break;case 12:ad(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,sd(e)):ad(e);break;default:ad(e)}}function sd(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];yu=r,cd(r,e)}id(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ml(8,t,t.return),sd(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,sd(t));break;default:sd(t)}e=e.sibling}}function cd(e,t){for(;yu!==null;){var n=yu;switch(n.tag){case 0:case 11:case 15:Ml(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:za(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,yu=r;else a:for(n=e;yu!==null;){r=yu;var i=r.sibling,a=r.return;if(Au(r),r===n){yu=null;break a}if(i!==null){i.return=a,yu=i;break a}yu=a}}}var ld={getCacheForType:function(e){var t=Ma(La),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ma(La).controller.signal}},ud=typeof WeakMap==`function`?WeakMap:Map,dd=0,fd=null,pd=null,md=0,hd=0,gd=null,_d=!1,vd=!1,yd=!1,bd=0,xd=0,Sd=0,Cd=0,wd=0,Td=0,Ed=0,Dd=null,Od=null,kd=!1,Ad=0,jd=0,Md=1/0,Nd=null,Pd=null,Fd=0,Id=null,Ld=null,Rd=0,zd=0,Bd=null,Vd=null,Hd=null,Ud=null,Wd=null,Gd=0,Kd=null;function qd(){return dd&2&&md!==0?md&-md:O.T===null?Et():Zf()}function Jd(){if(Td===0){if(!(md&536870912)||pa){var e=ut;ut<<=1,!(ut&3932160)&&(ut=262144),Td=e}else Td=536870912}return e=Lo.current,e!==null&&(e.flags|=32),Td}function Yd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Zp(Ei(e.memoizedProps,n))),Ud===null&&(Ud=[]),Ud.push(t.bind(null,r))}}function Xd(e,t,n){(e===fd&&(hd===2||hd===9)||e.cancelPendingCommit!==null)&&(rf(e,0),ef(e,md,Td,!1)),yt(e,n),(!(dd&2)||e!==fd)&&(e===fd&&(!(dd&2)&&(Cd|=n),xd===4&&ef(e,md,Td,!1)),Uf(e))}function Zd(e,t,n){if(dd&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||mt(e,t),a=r?ff(e,t):uf(e,t,!0),o=r;do{if(a===0){vd&&!r&&ef(e,t,0,!1);break}if(n=e.current.alternate,o&&!$d(n))a=uf(e,t,!1),o=!1;else{if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Dd;var l=c.current.memoizedState.isDehydrated;if(l&&(rf(c,s).flags|=256),s=uf(c,s,!1),s!==2&&s!==6){if(yd&&!l){c.errorRecoveryDisabledLanes|=o,Cd|=o,a=4;break a}o=Od,Od=a,o!==null&&(Od===null?Od=o:Od.push.apply(Od,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){rf(e,0),ef(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:ef(r,t,Td,!_d);break a;case 2:Od=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Ad+300-qe(),10<a)){if(ef(r,t,Td,!_d),pt(r,0,!0)!==0)break a;Rd=t,r.timeoutHandle=Np(Qd.bind(null,r,n,Od,Nd,kd,t,Td,Cd,Ed,_d,o,`Throttled`,-0,0),a);break a}Qd(r,n,Od,Nd,kd,t,Td,Cd,Ed,_d,o,null,-0,0)}break}}while(1);Uf(e)}function Qd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:En},Xl=null,rd(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=yh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?Ad-qe():(a&4194048)===a?jd-qe():0,m=_h(d,m),m!==null)?(Rd=a,e.cancelPendingCommit=m(yf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),ef(e,a,o,!l)):yf(e,t,a,n,r,i,o,s,c,l,u,d)}function $d(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(!Jr(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 ef(e,t,n,r){t=ht(e,t),t&=~wd,t&=~Cd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-at(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&xt(e,n,t)}function tf(){return dd&6?!0:(Wf(0,!1),!1)}function nf(){if(pd!==null){if(hd===0)var e=pd.return;else e=pd,Ta=wa=null,ps(e),fo=null,po=0,e=pd;for(;e!==null;)Al(e.alternate,e),e=e.return;pd=null}}function rf(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Pp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Rd=0,nf(),fd=e,pd=n=Hi(e.current,null),md=t,hd=0,gd=null,_d=!1,vd=mt(e,t),yd=!1,Ed=Td=wd=Cd=Sd=xd=0,Od=Dd=null,kd=!1,bd=ht(e,t),Ni(),n}function af(e,t){Yo=null,O.H=Cc,t===to||t===ro?(t=lo(),hd=3):t===no?(t=lo(),hd=4):hd=t===Vc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,gd=t,pd===null&&(xd=1,Fc(e,Xi(t,e.current)))}function of(){var e=Lo.current;return e===null?!0:(md&4194048)===md?Ro===null:(md&62914560)===md||md&536870912?e===Ro:!1}function sf(){var e=O.H;return O.H=Cc,e===null?Cc:e}function cf(){var e=O.A;return O.A=ld,e}function lf(){xd=4,_d||(md&4194048)!==md&&Lo.current!==null||(vd=!0),!(Sd&134217727)&&!(Cd&134217727)||fd===null||ef(fd,md,Td,!1)}function uf(e,t,n){var r=dd;dd|=2;var i=sf(),a=cf();(fd!==e||md!==t)&&(Nd=null,rf(e,t)),t=!1;var o=xd;a:do try{if(hd!==0&&pd!==null){var s=pd,c=gd;switch(hd){case 8:nf(),o=6;break a;case 3:case 2:case 9:case 6:Lo.current===null&&(t=!0);var l=hd;if(hd=0,gd=null,gf(e,s,c,l),n&&vd){o=0;break a}break;default:l=hd,hd=0,gd=null,gf(e,s,c,l)}}df(),o=xd;break}catch(t){af(e,t)}while(1);return t&&e.shellSuspendCounter++,Ta=wa=null,dd=r,O.H=i,O.A=a,pd===null&&(fd=null,md=0,Ni()),o}function df(){for(;pd!==null;)mf(pd)}function ff(e,t){var n=dd;dd|=2;var r=sf(),a=cf();fd!==e||md!==t?(Nd=null,Md=qe()+500,rf(e,t)):vd=mt(e,t);a:do try{if(hd!==0&&pd!==null){t=pd;var o=gd;b:switch(hd){case 1:hd=0,gd=null,gf(e,t,o,1);break;case 2:case 9:if(ao(o)){hd=0,gd=null,hf(t);break}t=function(){hd!==2&&hd!==9||fd!==e||(hd=7),Uf(e)},o.then(t,t);break a;case 3:hd=7;break a;case 4:hd=5;break a;case 7:ao(o)?(hd=0,gd=null,hf(t)):(hd=0,gd=null,gf(e,t,o,7));break;case 5:var s=null;switch(pd.tag){case 26:s=pd.memoizedState;case 5:case 27:var c=pd;if(s?fh(s):c.stateNode.complete){hd=0,gd=null;var l=c.sibling;if(l!==null)pd=l;else{var u=c.return;u===null?pd=null:(pd=u,_f(u))}break b}}hd=0,gd=null,gf(e,t,o,5);break;case 6:hd=0,gd=null,gf(e,t,o,6);break;case 8:nf(),xd=6;break a;default:throw Error(i(462))}}pf();break}catch(t){af(e,t)}while(1);return Ta=wa=null,O.H=r,O.A=a,dd=n,pd===null?(fd=null,md=0,Ni(),xd):0}function pf(){for(;pd!==null&&!Ge();)mf(pd)}function mf(e){var t=xl(e.alternate,e,bd);e.memoizedProps=e.pendingProps,t===null?_f(e):pd=t}function hf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=tl(n,t,t.pendingProps,t.type,void 0,md);break;case 11:t=tl(n,t,t.pendingProps,t.type.render,t.ref,md);break;case 5:ps(t);var r=t;r===da&&(pa?(va(r),r.tag===5&&r.stateNode!=null&&(fa=r.stateNode)):(va(r),pa=!0));default:Al(n,t),t=pd=Ui(t,bd),t=xl(n,t,bd)}e.memoizedProps=e.pendingProps,t===null?_f(e):pd=t}function gf(e,t,n,r){Ta=wa=null,ps(t),fo=null,po=0;var i=t.return;try{if(Bc(e,i,t,n,md)){xd=1,Fc(e,Xi(n,e.current)),pd=null;return}}catch(t){if(i!==null)throw pd=i,t;xd=1,Fc(e,Xi(n,e.current)),pd=null;return}t.flags&32768?(pa||r===1?e=!0:vd||md&536870912?e=!1:(_d=e=!0,(r===2||r===9||r===3||r===6)&&(r=Lo.current,r!==null&&r.tag===13&&(r.flags|=16384))),vf(t,e)):_f(t)}function _f(e){var t=e;do{if(t.flags&32768){vf(t,_d);return}e=t.return;var n=Ol(t.alternate,t,bd);if(n!==null){pd=n;return}if(t=t.sibling,t!==null){pd=t;return}pd=t=e}while(t!==null);xd===0&&(xd=5)}function vf(e,t){do{var n=kl(e.alternate,e);if(n!==null){n.flags&=32767,pd=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){pd=e;return}pd=e=n}while(e!==null);xd=6,pd=null}function yf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do Df();while(Fd!==0);if(dd&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===fd&&(pd=fd=null,md=0),Ld=t,Id=e,Rd=n,Bd=a,Vd=r,bf(e,t,n,s,c,l,f)}}function bf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(zd=s,s|=Mi,bt(e,n,s,r,i,a),Ud=null,(n&335544064)===n?(Wd=Ha(e),r=10262):(Wd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,If(Ze,function(){return Of(),null})):(e.callbackNode=null,e.callbackPriority=0),Yl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=O.T,O.T=null,i=k.p,k.p=2,a=dd,dd|=4;try{wu(e,t,n)}finally{dd=a,k.p=i,O.T=r}}Fd=1,Yl?Hd=Yp(o,e.containerInfo,Wd,Cf,wf,Sf,Tf,Of,xf,null,null):(Cf(),wf(),Tf())}function xf(e){if(Fd!==0){var t=Id.onRecoverableError;t(e,{componentStack:null})}}function Sf(){Fd===3&&(Fd=0,Gu(Ld,Id),Fd=4)}function Cf(){if(Fd===1){Fd=0;var e=Id,t=Ld,n=Rd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=O.T,O.T=null;var i=k.p;k.p=2;var a=dd;dd|=4;try{xu=Su=!1,Vu(t,e,n),n=Tp;var o=ei(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&$r(s.ownerDocument.documentElement,s)){if(c!==null&&ti(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Qr(s,h),v=Qr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}Nh=!!I,Tp=I=null}finally{dd=a,k.p=i,O.T=r}}e.current=t,Fd=2}}function wf(){if(Fd===2){Fd=0;var e=Id,t=Ld,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=O.T,O.T=null;var r=k.p;k.p=2;var i=dd;dd|=4;try{Eu(e,t.alternate,t)}finally{dd=i,k.p=r,O.T=n}}Fd=3}}function Tf(){if(Fd===4||Fd===3){Fd=0;var e=Hd;Hd=null,Ke();var t=Id,n=Ld,r=Rd,i=Vd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Fd=5:(Fd=0,Ld=Id=null,Ef(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Pd=null),Tt(r),n=n.stateNode,rt&&typeof rt.onCommitFiberRoot==`function`)try{rt.onCommitFiberRoot(nt,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=O.T,a=k.p,k.p=2,O.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{O.T=n,k.p=a}}if(i=Ud,o=Wd,Wd=null,i!==null&&(Ud=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);Rd&3&&Df(),Uf(t),a=t.pendingLanes,r&261930&&a&42?t===Kd?Gd++:(Gd=0,Kd=t):(Gd=0,Kd=null),Wf(0,!1)}}function Ef(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,za(t)))}function Df(){return Hd!==null&&(Hd.skipTransition(),Hd=null),Cf(),wf(),Tf(),Of()}function Of(){if(Fd!==5)return!1;var e=Id,t=zd;zd=0;var n=Tt(Rd),r=O.T,a=k.p;try{k.p=32>n?32:n,O.T=null,n=Bd,Bd=null;var o=Id,s=Rd;if(Fd=0,Ld=Id=null,Rd=0,dd&6)throw Error(i(331));var c=dd;if(dd|=4,od(o.current),Qu(o,o.current,s,n),dd=c,Wf(0,!1),rt&&typeof rt.onPostCommitFiberRoot==`function`)try{rt.onPostCommitFiberRoot(nt,o)}catch{}return!0}finally{k.p=a,O.T=r,Ef(e,t)}}function kf(e,t,n){t=Xi(n,t),t=Lc(e.stateNode,t,2),e=wo(e,t,2),e!==null&&(yt(e,2),Uf(e))}function Af(e,t,n){if(e.tag===3)kf(e,e,n);else for(;t!==null;){if(t.tag===3){kf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Pd===null||!Pd.has(r))){e=Xi(n,e),n=Rc(2),r=wo(t,n,2),r!==null&&(zc(n,r,t,e),yt(r,2),Uf(r));break}}t=t.return}}function jf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new ud;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)||(yd=!0,i.add(n),e=Mf.bind(null,e,t,n),t.then(e,e))}function Mf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,fd===e&&(md&n)===n&&(xd===4||xd===3&&(md&62914560)===md&&300>qe()-Ad?dd&2?wd|=n:rf(e,0):wd|=n,Ed===md&&(Ed=0)),Uf(e)}function Nf(e,t){t===0&&(t=_t()),e=j(e,t),e!==null&&(yt(e,t),Uf(e))}function Pf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Nf(e,n)}function Ff(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),Nf(e,n)}function If(e,t){return Ue(e,t)}var Lf=null,Rf=null,zf=!1,Bf=!1,Vf=!1,Hf=0;function Uf(e){e!==Rf&&e.next===null&&(Rf===null?Lf=Rf=e:Rf=Rf.next=e),Bf=!0,zf||(zf=!0,Xf())}function Wf(e,t){if(!Vf&&Bf){Vf=!0;do for(var n=!1,r=Lf;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-at(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Yf(r,a))}else a=md,a=pt(r,r===fd?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||mt(r,a)||(n=!0,Yf(r,a))}r=r.next}while(n);Vf=!1}}function Gf(){Kf()}function Kf(){Bf=zf=!1;var e=0;Hf!==0&&Mp()&&(e=Hf);for(var t=qe(),n=null,r=Lf;r!==null;){var i=r.next,a=qf(r,t);a===0?(r.next=null,n===null?Lf=i:n.next=i,i===null&&(Rf=n)):(n=r,(e!==0||a&3)&&(Bf=!0)),r=i}Fd!==0&&Fd!==5||Wf(e,!1),Hf!==0&&(Hf=0)}function qf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-at(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=gt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=fd,n=md,n=pt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(hd===2||hd===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&We(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||mt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&We(r),Tt(n)){case 2:case 8:n=Xe;break;case 32:n=Ze;break;case 268435456:n=$e;break;default:n=Ze}return r=Jf.bind(null,e),n=Ue(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&We(r),e.callbackPriority=2,e.callbackNode=null,2}function Jf(e,t){if(Fd!==0&&Fd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Df()&&e.callbackNode!==n)return null;var r=md;return r=pt(e,e===fd?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Zd(e,r,t),qf(e,qe()),e.callbackNode!=null&&e.callbackNode===n?Jf.bind(null,e):null)}function Yf(e,t){if(Df())return null;Zd(e,t,!0)}function Xf(){Lp(function(){dd&6?Ue(Ye,Gf):Kf()})}function Zf(){if(Hf===0){var e=Ga;e===0&&(e=lt,lt<<=1,!(lt&261888)&&(lt=256)),Hf=e}return Hf}function Qf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Tn(e)}function $f(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Qf((i[At]||null).action),o=r.submitter;o&&(t=(t=o[At]||null)?Qf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Kn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Hf!==0){var e=new FormData(i,o);lc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),lc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var ep=0;ep<Ci.length;ep++){var tp=Ci[ep];wi(tp.toLowerCase(),`on`+(tp[0].toUpperCase()+tp.slice(1)))}wi(pi,`onAnimationEnd`),wi(hi,`onAnimationIteration`),wi(_i,`onAnimationStart`),wi(`dblclick`,`onDoubleClick`),wi(`focusin`,`onFocus`),wi(`focusout`,`onBlur`),wi(vi,`onTransitionRun`),wi(yi,`onTransitionStart`),wi(bi,`onTransitionCancel`),wi(xi,`onTransitionEnd`),Jt(`onMouseEnter`,[`mouseout`,`mouseover`]),Jt(`onMouseLeave`,[`mouseout`,`mouseover`]),Jt(`onPointerEnter`,[`pointerout`,`pointerover`]),Jt(`onPointerLeave`,[`pointerout`,`pointerover`]),qt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),qt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),qt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),qt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),qt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),qt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var np=`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(` `),rp=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(np));function ip(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){ki(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){ki(e)}i.currentTarget=null,a=c}}}}function ap(e,t){var n=t[Mt];n===void 0&&(n=t[Mt]=new Set);var r=e+`__bubble`;n.has(r)||(lp(t,e,2,!1),n.add(r))}function op(e,t,n){var r=0;t&&(r|=4),lp(n,e,r,t)}var sp=`_reactListening`+Math.random().toString(36).slice(2);function cp(e){if(!e[sp]){e[sp]=!0,Gt.forEach(function(t){t!==`selectionchange`&&(rp.has(t)||op(t,!1,e),op(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[sp]||(t[sp]=!0,op(`selectionchange`,!1,t))}}function lp(e,t,n,r){switch(Bh(t)){case 2:var i=Ph;break;case 8:i=Fh;break;default:i=Ih}n=i.bind(null,t,n,e),i=void 0,!In||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 up(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=zt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}Nn(function(){var r=a,i=On(n),s=[];a:{var c=Si.get(e);if(c!==void 0){var l=Kn,u=e;switch(e){case`keypress`:if(Vn(n)===0)break a;case`keydown`:case`keyup`:l=ur;break;case`focusin`:u=`focus`,l=tr;break;case`focusout`:u=`blur`,l=tr;break;case`beforeblur`:case`afterblur`:l=tr;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=$n;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=er;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=pr;break;case pi:case hi:case _i:l=nr;break;case xi:l=mr;break;case`scroll`:case`scrollend`:l=Jn;break;case`wheel`:l=hr;break;case`copy`:case`cut`:case`paste`:l=rr;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=dr;break;case`submit`:l=fr;break;case`toggle`:case`beforetoggle`:l=gr}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=Pn(m,p),g!=null&&d.push(dp(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==Dn&&(u=n.relatedTarget||n.fromElement)&&(zt(u)||u[jt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?zt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=$n,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=dr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Vt(c),h=l==null?u:Vt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,zt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?w(c,l,pp):null,c!==null&&mp(s,u,c,d,!1),l!==null&&f!==null&&mp(s,f,l,d,!0)))}a:{if(c=r?Vt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Ir;else if(Ar(c)){if(Lr)_=Kr;else{_=Wr;var v=Ur}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Sn(r.elementType)&&(_=Ir):_=Gr;if(_&&=_(e,r)){jr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Vt(r):window,e){case`focusin`:(Ar(v)||v.contentEditable===`true`)&&(ri=v,ii=r,ai=null);break;case`focusout`:ai=ii=ri=null;break;case`mousedown`:oi=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:oi=!1,si(s,n,i);break;case`selectionchange`:if(ni)break;case`keydown`:case`keyup`:si(s,n,i)}var y;if(vr)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 Er?wr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(xr&&n.locale!==`ko`&&(Er||b!==`onCompositionStart`?b===`onCompositionEnd`&&Er&&(y=Bn()):(A=i,Rn=`value`in A?A.value:A.textContent,Er=!0)),v=fp(r,b),0<v.length&&(b=new ir(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=Tr(n),y!==null&&(b.data=y)))),(y=br?Dr(e,n):Or(e,n))&&(b=fp(r,`onBeforeInput`),0<b.length&&(v=new ir(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),$f(s,e,r,n,i)}ip(s,t)})}function dp(e,t,n){return{instance:e,listener:t,currentTarget:n}}function fp(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=Pn(e,n),i!=null&&r.unshift(dp(e,i,a)),i=Pn(e,t),i!=null&&r.push(dp(e,i,a))),e.tag===3)return r;e=e.return}return[]}function pp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function mp(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=Pn(n,a),l!=null&&o.unshift(dp(n,l,c))):i||(l=Pn(n,a),l!=null&&o.push(dp(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var hp=/\r\n?/g,gp=/\u0000|\uFFFD/g;function _p(e){return(typeof e==`string`?e:``+e).replace(hp,`
10
- `).replace(gp,``)}function vp(e,t){return t=_p(t),_p(e)===t}function yp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||vn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&vn(e,``+r);else return;break;case`className`:nn(e,`class`,r);break;case`tabIndex`:nn(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:nn(e,n,r);break;case`style`:xn(e,r,o);return;case`data`:if(t!==`object`){nn(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Tn(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`&&yp(e,t,`name`,a.name,a,null),yp(e,t,`formEncType`,a.formEncType,a,null),yp(e,t,`formMethod`,a.formMethod,a,null),yp(e,t,`formTarget`,a.formTarget,a,null)):(yp(e,t,`encType`,a.encType,a,null),yp(e,t,`method`,a.method,a,null),yp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Tn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=En);return;case`onScroll`:r!=null&&ap(`scroll`,e);return;case`onScrollEnd`:r!=null&&ap(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Tn(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`:ap(`beforetoggle`,e),ap(`toggle`,e),tn(e,`popover`,r);break;case`xlinkActuate`:rn(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:rn(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:rn(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:rn(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:rn(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:rn(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:rn(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:rn(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:rn(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:tn(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=Cn.get(n)||n,tn(e,n,r);else return}$t=!0}function bp(e,t,n,r,a,o){switch(n){case`style`:xn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)vn(e,r);else if(typeof r==`number`||typeof r==`bigint`)vn(e,``+r);else return;break;case`onScroll`:r!=null&&ap(`scroll`,e);return;case`onScrollEnd`:r!=null&&ap(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=En);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Kt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[At]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}$t=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):tn(e,n,r)}return}$t=!0}function F(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:ap(`error`,e),ap(`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:yp(e,t,o,s,n,null)}}a&&yp(e,t,`srcSet`,n.srcSet,n,null),r&&yp(e,t,`src`,n.src,n,null);return;case`input`:ap(`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:yp(e,t,r,d,n,null)}}pn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in ap(`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:yp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&hn(e,!!r,n,!0):hn(e,!!r,t,!1);return;case`textarea`:for(s in ap(`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:yp(e,t,s,c,n,null)}_n(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:yp(e,t,l,r,n,null)}return;case`dialog`:ap(`beforetoggle`,e),ap(`toggle`,e),ap(`cancel`,e),ap(`close`,e);break;case`iframe`:case`object`:ap(`load`,e);break;case`video`:case`audio`:for(r=0;r<np.length;r++)ap(np[r],e);break;case`image`:ap(`error`,e),ap(`load`,e);break;case`details`:ap(`toggle`,e);break;case`embed`:case`source`:case`link`:ap(`error`,e),ap(`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:yp(e,t,u,r,n,null)}return;default:if(Sn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&bp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&yp(e,t,c,r,n,null))}var xp={};function Sp(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)||yp(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&&($t=!0),o=m;break;case`name`:m!==f&&($t=!0),a=m;break;case`checked`:m!==f&&($t=!0),u=m;break;case`defaultChecked`:m!==f&&($t=!0),d=m;break;case`value`:m!==f&&($t=!0),s=m;break;case`defaultValue`:m!==f&&($t=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&yp(e,t,p,m,r,f)}}fn(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)||yp(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&($t=!0),p=o;break;case`defaultValue`:o!==l&&($t=!0),c=o;break;case`multiple`:o!==l&&($t=!0),s=o;default:o!==l&&yp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?hn(e,!!n,n?[]:``,!1):hn(e,!!n,t,!0)):hn(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:yp(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&($t=!0),p=a;break;case`defaultValue`:a!==o&&($t=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&yp(e,t,s,a,r,o)}gn(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:yp(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&&($t=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:yp(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)&&yp(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:yp(e,t,u,p,r,m)}return;default:if(Sn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&bp(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||bp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&yp(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||yp(e,t,f,p,r,m)}function Cp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function wp(){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&&Cp(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&&Cp(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 I=null,Tp=null;function Ep(e){return e.nodeType===9?e:e.ownerDocument}function Dp(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 Op(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 kp(e,t,n,r){return n=Ep(n).createElement(e),n[kt]=r,n[At]=t,F(n,e,t),Ut(n),n}function Ap(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 jp=null;function Mp(){var e=window.event;return e&&e.type===`popstate`?e!==jp&&(jp=e,!0):(jp=null,!1)}var Np=typeof setTimeout==`function`?setTimeout:void 0,Pp=typeof clearTimeout==`function`?clearTimeout:void 0,Fp=typeof Promise==`function`?Promise:void 0,Ip=typeof requestAnimationFrame==`function`?requestAnimationFrame:Np,Lp=typeof queueMicrotask==`function`?queueMicrotask:Fp===void 0?Np:function(e){return Fp.resolve(null).then(e).catch(Rp)};function Rp(e){setTimeout(function(){throw e})}function zp(e){return e===`head`}function Bp(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),ag(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Pm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Pm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[It]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Pm(e.ownerDocument.body)}n=i}while(n);ag(t)}function Vp(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 Hp(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 Up(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 Wp(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 Gp(e){return Wp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Kp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Wp(t,n,e)}function qp(e){return e.documentElement.clientHeight}function Jp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Yp(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`&&(qp(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+=ph(f),u>gh){s.length=o;break}f=new Promise(Jp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Xp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Xp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:T({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Xp.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},Xp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Zp(e){return{name:e,group:new Xp(`group`,e),imagePair:new Xp(`image-pair`,e),old:new Xp(`old`,e),new:new Xp(`new`,e)}}function Qp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Qp.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(rm(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=tm(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),p(this._fragmentFiber.child,!1,$p,e,s,r)}this._eventListeners=a}};function $p(e,t,n,r){return v(e).addEventListener(t,n,r),!1}Qp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=rm(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=tm(i.optionsOrUseCapture),p(this._fragmentFiber.child,!1,em,e,n,i),r.splice(t,1),a!==null&&a()}};function em(e,t,n,r){return v(e).removeEventListener(t,n,r),!1}function tm(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function nm(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function rm(e,t,n,r){if(e.length===0)return-1;r=nm(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&nm(a.optionsOrUseCapture)===r)return i}return-1}Qp.prototype.dispatchEvent=function(e){var t=m(this._fragmentFiber);if(t===null)return!0;t=v(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,tm(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,tm(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Qp.prototype.focus=function(e){p(this._fragmentFiber.child,!0,im,e,void 0,void 0)};function im(e,t){return e.tag!==6&&(e=v(e),Am(e,t))}Qp.prototype.focusLast=function(e){var t=[];p(this._fragmentFiber.child,!0,am,t,void 0,void 0);for(var n=t.length-1;0<=n&&!im(t[n],e);n--);};function am(e,t){return t.push(e),!1}Qp.prototype.blur=function(){var e=m(this._fragmentFiber);e!==null&&(e=v(e),e=Ep(e).activeElement,e!==null&&p(this._fragmentFiber.child,!1,om,e,void 0,void 0))};function om(e,t){return e.tag!==6&&(e=v(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Qp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),p(this._fragmentFiber.child,!1,sm,e,void 0,void 0)};function sm(e,t){return e.tag===6||(e=v(e),t.observe(e)),!1}Qp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),p(this._fragmentFiber.child,!1,cm,e,void 0,void 0);for(var n=t=0;n<lm.length;n++){var r=lm[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):lm[t++]=r}lm.length=t}};function cm(e,t){return e.tag===6||(e=v(e),t.unobserve(e)),!1}var lm=[],um=!1;function dm(e,t,n){lm.push({fragmentInstance:e,observer:t,instance:n}),um||(um=!0,jm(function(){um=!1;var e=lm;lm=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Qp.prototype.getClientRects=function(){var e=[];return p(this._fragmentFiber.child,!1,fm,e,void 0,void 0),e};function fm(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=v(e),t.push.apply(t,e.getClientRects());return!1}Qp.prototype.getRootNode=function(e){var t=m(this._fragmentFiber);return t===null?this:v(t).getRootNode(e)},Qp.prototype.compareDocumentPosition=function(e){var t=m(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];p(this._fragmentFiber.child,!1,am,n,void 0,void 0);var r=v(t);if(n.length===0){if(n=r,h(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=g(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=v(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=v(n[0]),i=v(n[n.length-1]);var a=h(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||pm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function pm(e,t,n,r,i){var a=zt(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=m(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=w(n,a,C),t===null?t=!1:(p(t,!0,x,a,n),a=y,y=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=w(r,a,C),t===null?t=!1:(p(t,!0,S,a,r),a=y,b=y=null,t=a!==null)),t):!1}function mm(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)}Qp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];p(this._fragmentFiber.child,!1,am,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=g(this._fragmentFiber);if(r=n?r[1]||r[0]||m(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=v(r),mm(e,n);return}if(r=v(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=v(a),mm(a,n)):v(a).scrollIntoView(e),r+=n?-1:1}};function hm(e,t){return e=v(e),gm(e,t),!1}function gm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function _m(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,tm(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<lm.length;i++){var a=lm[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(lm[r++]=a)}lm.length=r,n.observe(e)}),gm(e,t))}function vm(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,tm(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?dm(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function ym(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`:ym(n),Rt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function bm(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[It])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=Em(e.nextSibling),e===null)break}return null}function xm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=Em(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=Em(e.nextSibling),e===null))return null;return e}function Cm(e){return e.data===`$?`||e.data===`$~`}function wm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function Tm(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 Em(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 Dm=null;function Om(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return Em(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function km(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 Am(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 jm(e){Ip(function(){Ip(function(t){return e(t)})})}function Mm(e,t,n){switch(t=Ep(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 Nm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&yp(e,t,r,null,xp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===En&&(e.onclick=null),Rt(e)}function Pm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Rt(e)}var Fm=new Map,Im=new Set;function Lm(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 Rm=k.d;k.d={f:zm,r:Bm,D:Um,C:Wm,L:Gm,m:Km,X:Jm,S:qm,M:Ym};function zm(){var e=Rm.f(),t=tf();return e||t}function Bm(e){var t=Bt(e);t!==null&&t.tag===5&&t.type===`form`?dc(t):Rm.r(e)}var Vm=typeof document>`u`?null:document;function Hm(e,t,n){var r=Vm;if(r&&typeof t==`string`&&t){var i=dn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Im.has(i)||(Im.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),F(t,`link`,e),Ut(t),r.head.appendChild(t)))}}function Um(e){Rm.D(e),Hm(`dns-prefetch`,e,null)}function Wm(e,t){Rm.C(e,t),Hm(`preconnect`,e,t)}function Gm(e,t,n){Rm.L(e,t,n);var r=Vm;if(r&&e&&t){var i=`link[rel="preload"][as="`+dn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+dn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+dn(n.imageSizes)+`"]`)):i+=`[href="`+dn(e)+`"]`;var a=i;switch(t){case`style`:a=Zm(e);break;case`script`:a=th(e)}if(!(Fm.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Fm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Qm(a))||t===`script`&&r.querySelector(nh(a))))){var o=r.createElement(`link`);F(o,`link`,e),t===`style`&&(o[Lt]=!0,o.onload=o.onerror=function(){Wt(o)}),Ut(o),r.head.appendChild(o)}}}function Km(e,t){Rm.m(e,t);var n=Vm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+dn(r)+`"][href="`+dn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=th(e)}if(!Fm.has(a)&&(e=T({rel:`modulepreload`,href:e},t),Fm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(nh(a)))return}r=n.createElement(`link`),F(r,`link`,e),Ut(r),n.head.appendChild(r)}}}function qm(e,t,n){Rm.S(e,t,n);var r=Vm;if(r&&e){var i=Ht(r).hoistableStyles,a=Zm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Qm(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Fm.get(a))&&ah(e,n);var c=o=r.createElement(`link`);Ut(c),F(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,ih(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Jm(e,t){Rm.X(e,t);var n=Vm;if(n&&e){var r=Ht(n).hoistableScripts,i=th(e),a=r.get(i);a||(a=n.querySelector(nh(i)),a||(e=T({src:e,async:!0},t),(t=Fm.get(i))&&oh(e,t),a=n.createElement(`script`),Ut(a),F(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Ym(e,t){Rm.M(e,t);var n=Vm;if(n&&e){var r=Ht(n).hoistableScripts,i=th(e),a=r.get(i);a||(a=n.querySelector(nh(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=Fm.get(i))&&oh(e,t),a=n.createElement(`script`),Ut(a),F(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Xm(e,t,n,r){var a=(a=ke.current)?Lm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Zm(n.href),t=Ht(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Zm(n.href);var o=Ht(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(Qm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Fm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Fm.set(e,o)),eh(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=th(n),t=Ht(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Zm(e){return`href="`+dn(e)+`"`}function Qm(e){return`link[rel="stylesheet"][`+e+`]`}function $m(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function eh(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Lt]){r.loading=1;return}}else t=e.createElement(`link`),t[Lt]=!0,t.onload=t.onerror=Wt.bind(null,t),F(t,`link`,n),Ut(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 th(e){return`[src="`+dn(e)+`"]`}function nh(e){return`script[async]`+e}function rh(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+dn(n.href)+`"]`);if(r)return t.instance=r,Ut(r),r;var a=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Ut(r),F(r,`style`,a),ih(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Zm(n.href);var o=e.querySelector(Qm(a));if(o)return t.state.loading|=4,t.instance=o,Ut(o),o;r=$m(n),(a=Fm.get(a))&&ah(r,a),o=(e.ownerDocument||e).createElement(`link`),Ut(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),F(o,`link`,r),t.state.loading|=4,ih(o,n.precedence,e),t.instance=o;case`script`:return o=th(n.src),(a=e.querySelector(nh(o)))?(t.instance=a,Ut(a),a):(r=n,(a=Fm.get(o))&&(r=T({},n),oh(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Ut(a),F(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,ih(r,n.precedence,e));return t.instance}function ih(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 ah(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function oh(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var sh=null;function ch(e,t,n){if(sh===null){var r=new Map,i=sh=new Map;i.set(n,r)}else i=sh,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[It]||a[kt]||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 lh(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function uh(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 dh(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function fh(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function ph(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function mh(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=ph(t),e.suspenseyImages.push(t)),e=bh.bind(e),t.decode().then(e,e))}function hh(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=Zm(r.href),a=t.querySelector(Qm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=yh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Ut(a);return}a=t.ownerDocument||t,r=$m(r),(i=Fm.get(i))&&ah(r,i),a=a.createElement(`link`),Ut(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),F(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=yh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var gh=0;function _h(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&&gh===0&&(gh=62500*wp());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>gh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function vh(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 yh(){this.count--,vh(this)}function bh(){this.imgCount--,vh(this)}var xh=null;function Sh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,xh=new Map,t.forEach(Ch,e),xh=null,yh.call(e))}function Ch(e,t){if(!(t.state.loading&4)){var n=xh.get(e);if(n)var r=n.get(null);else{n=new Map,xh.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=yh.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 wh={$$typeof:oe,Provider:null,Consumer:null,_currentValue:xe,_currentValue2:xe,_threadCount:0};function Th(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=vt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vt(0),this.hiddenUpdates=vt(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 Eh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new Th(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Bi(3,null,null,t),e.current=a,a.stateNode=e,t=Ra(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},xo(a),e}function Dh(e){return e?(e=Ri,e):Ri}function Oh(e,t,n,r,i,a){i=Dh(i),r.context===null?r.context=i:r.pendingContext=i,r=Co(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=wo(e,r,t),n!==null&&(Xd(n,e,t),To(n,e,t))}function kh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ah(e,t){kh(e,t),(e=e.alternate)&&kh(e,t)}function jh(e){if(e.tag===13||e.tag===31){var t=j(e,67108864);t!==null&&Xd(t,e,67108864),Ah(e,67108864)}}function Mh(e){if(e.tag===13||e.tag===31){var t=qd();t=wt(t);var n=j(e,t);n!==null&&Xd(n,e,t),Ah(e,t)}}var Nh=!0;function Ph(e,t,n,r){var i=O.T;O.T=null;var a=k.p;try{k.p=2,Ih(e,t,n,r)}finally{k.p=a,O.T=i}}function Fh(e,t,n,r){var i=O.T;O.T=null;var a=k.p;try{k.p=8,Ih(e,t,n,r)}finally{k.p=a,O.T=i}}function Ih(e,t,n,r){if(Nh){var i=Lh(r);if(i===null)up(e,t,r,Rh,n),Yh(e,r);else if(Zh(i,e,t,n,r))r.stopPropagation();else if(Yh(e,r),t&4&&-1<Jh.indexOf(e)){for(;i!==null;){var a=Bt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ft(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-at(o);s.entanglements[1]|=c,o&=~c}Uf(a),!(dd&6)&&(Md=qe()+500,Wf(0,!1))}}break;case 31:case 13:s=j(a,2),s!==null&&Xd(s,a,2),tf(),Ah(a,2)}if(a=Lh(r),a===null&&up(e,t,r,Rh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else up(e,t,r,null,n)}}function Lh(e){return e=On(e),zh(e)}var Rh=null;function zh(e){if(Rh=null,e=zt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Rh=e,null}function Bh(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(Je()){case Ye:return 2;case Xe:return 8;case Ze:case Qe:return 32;case $e:return 268435456;default:return 32}default:return 32}}var Vh=!1,Hh=null,Uh=null,Wh=null,Gh=new Map,Kh=new Map,qh=[],Jh=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Yh(e,t){switch(e){case`focusin`:case`focusout`:Hh=null;break;case`dragenter`:case`dragleave`:Uh=null;break;case`mouseover`:case`mouseout`:Wh=null;break;case`pointerover`:case`pointerout`:Gh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Kh.delete(t.pointerId)}}function Xh(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=Bt(t),t!==null&&jh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Zh(e,t,n,r,i){switch(t){case`focusin`:return Hh=Xh(Hh,e,t,n,r,i),!0;case`dragenter`:return Uh=Xh(Uh,e,t,n,r,i),!0;case`mouseover`:return Wh=Xh(Wh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Gh.set(a,Xh(Gh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Kh.set(a,Xh(Kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Qh(e){var t=zt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,Dt(e.priority,function(){Mh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,Dt(e.priority,function(){Mh(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 $h(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Lh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Dn=r,n.target.dispatchEvent(r),Dn=null}else return t=Bt(n),t!==null&&jh(t),e.blockedOn=n,!1;t.shift()}return!0}function eg(e,t,n){$h(e)&&n.delete(t)}function tg(){Vh=!1,Hh!==null&&$h(Hh)&&(Hh=null),Uh!==null&&$h(Uh)&&(Uh=null),Wh!==null&&$h(Wh)&&(Wh=null),Gh.forEach(eg),Kh.forEach(eg)}function ng(e,n){e.blockedOn===n&&(e.blockedOn=null,Vh||(Vh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,tg)))}var rg=null;function ig(e){rg!==e&&(rg=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){rg===e&&(rg=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(zh(r||n)===null)continue;break}var a=Bt(n);a!==null&&(e.splice(t,3),t-=3,lc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function ag(e){function t(t){return ng(t,e)}Hh!==null&&ng(Hh,e),Uh!==null&&ng(Uh,e),Wh!==null&&ng(Wh,e),Gh.forEach(t),Kh.forEach(t);for(var n=0;n<qh.length;n++){var r=qh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<qh.length&&(n=qh[0],n.blockedOn===null);)Qh(n),n.blockedOn===null&&qh.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[At]||null;if(typeof a==`function`)o||ig(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[At]||null)s=o.formAction;else if(zh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),ig(n)}}}function og(){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 sg(e){this._internalRoot=e}cg.prototype.render=sg.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;Oh(n,qd(),e,t,null,null)},cg.prototype.unmount=sg.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Oh(e.current,2,null,e,null,null),tf(),t[jt]=null}};function cg(e){this._internalRoot=e}cg.prototype.unstable_scheduleHydration=function(e){if(e){var t=Et();e={blockedOn:null,target:e,priority:t};for(var n=0;n<qh.length&&t!==0&&t<qh[n].priority;n++);qh.splice(n,0,e),n===0&&Qh(e)}};var lg=n.version;if(lg!==`19.3.0`)throw Error(i(527,lg,`19.3.0`));k.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var ug={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:O,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var dg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!dg.isDisabled&&dg.supportsFiber)try{nt=dg.inject(ug),rt=dg}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Mc,s=Nc,c=Pc;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=Eh(e,1,!1,null,null,n,r,null,o,s,c,og),e[jt]=t.current,cp(e),new sg(t)}})),vi=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=_i()}))(),yi=`0.4.2`;function bi(e){return typeof e==`string`&&/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/.test(e)&&e.split(`.`).every(e=>Number.isSafeInteger(Number(e)))}function xi(e,t){if(!bi(e)||!bi(t))return!1;let n=e.split(`.`).map(Number),r=t.split(`.`).map(Number);for(let e=0;e<3;e++)if(n[e]!==r[e])return n[e]>r[e];return!1}function Si(e){let{gateway:t,frontend:n,installed:r,web:i}=e;if(t&&t.protocolVersion!==4)return`incompatible`;if(t&&(xi(t.installedVersion,t.runningVersion)||xi(r,t.runningVersion)||xi(n,t.runningVersion))||i&&(xi(i.installedVersion,i.runningVersion)||xi(t?.runningVersion,i.runningVersion)||xi(n,i.runningVersion)))return`restart-service`;if(i){if(xi(i.runningVersion,n))return`refresh-page`}else if(xi(r,n)||xi(t?.runningVersion,n))return`restart-tui`;return t?.checkState===`ok`&&xi(t.latestVersion,r)?`install`:`none`}var Ci=class extends Error{constructor(){super(`Application protocol incompatible. Update neko, then restart its TUI/Web or serve.`),this.name=`ApplicationProtocolError`}};function wi(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t)}function Ti(e){return Uint8Array.from(atob(e),e=>e.charCodeAt(0))}async function Ei(e,t){let n=await t.begin({name:e.name,mimeType:e.mimeType,size:e.bytes.length});try{for(let r=0;r<e.bytes.length;r+=262144)await t.append({id:n,offset:r,data:wi(e.bytes.subarray(r,r+262144))});return await t.finish(n),n}catch(e){throw await t.release(n).catch(()=>{}),e}}async function Di(e){let t=[],n=0,r=0,i=``;do{let a=await e(n);if(!Number.isSafeInteger(a.total)||a.total<=0||a.total>20971520||n>0&&(a.total!==r||a.mimeType!==i))throw Error(`Invalid image size or format`);if(r=a.total,i=a.mimeType,a.data.length>349528)throw Error(`Image chunk is too large`);let o=Ti(a.data);if(o.length>262144||n+o.length>r||!o.length&&n<r)throw Error(`Incomplete image`);t.push(o),n+=o.length}while(n<r);let a=new Uint8Array(n),o=0;for(let e of t)a.set(e,o),o+=e.length;return{name:`Image`,mimeType:i,bytes:a}}function Oi(e){let t=/^\/compact(?:\s+([\s\S]*))?$/.exec(e.trim());return t?t[1]?.trim()??``:null}var ki=(e,t=`New session`)=>e.title||e.firstPromptPreview||t,Ai=e=>e.lastMessageAt??e.createdAt,ji=(e,t)=>Ai(t)-Ai(e)||Number(t.id)-Number(e.id),Mi=(e,t)=>t.lastUsedAt-e.lastUsedAt||Number(t.id)-Number(e.id),Ni=(e,t)=>`${e.title} ${e.firstPromptPreview} ${e.id}`.toLocaleLowerCase().includes(t.trim().toLocaleLowerCase());function Pi(e,t,n=`en`){let r=Math.floor(Math.max(0,t-e)/6e4);if(r<1)return n===`zh`?`刚刚`:`now`;let i=Math.floor(r/60),a=Math.floor(i/24);if(a>=30)return new Date(e).toLocaleDateString(n===`zh`?`zh-CN`:`en-GB`);let o=a||i||r,s=a?[`天`,`d`]:i?[`小时`,`h`]:[`分钟`,`m`];return n===`zh`?`${o} ${s[0]}前`:`${o}${s[1]}`}var Fi=new Set([`superseded`,`upgrade_conflict`]),j=class extends Error{code;reason;retryable;details;constructor(e,t,n){super(`${e}${n?.reason?`/${n.reason}`:``}: ${t}`,{cause:n?.cause}),this.name=`ChordError`,this.code=e,this.reason=n?.reason,this.retryable=Fi.has(e),this.details=n?.details}},Ii=(e,t,n)=>new j(`invalid`,t,{reason:e,details:n}),Li=(e,t)=>e instanceof j?e:new j(`unavailable`,`${t}: ${e instanceof Error?e.message:String(e)}`,{cause:e});async function Ri(e,t){let n=[];for(let t of e)try{await t()}catch(e){n.push(e)}if(n.length===1)throw n[0];if(n.length>1)throw AggregateError(n,t)}function zi(e,t){return t[e.length]?.(...e)??(()=>{throw Error(`Invalid Arguments`)})()}function Bi(e,t,n){return e>=t&&e<=n}function Vi(e){return e===8205}function Hi(e){return Bi(e,55296,56319)}function Ui(e){return Bi(e,127462,127487)}function Wi(e){return Bi(e,65024,65039)}function Gi(e){return Bi(e,768,879)||Bi(e,6832,6911)||Bi(e,7616,7679)||Bi(e,65056,65071)}function Ki(e){return e>65535?2:1}function qi(e,t){for(;t<e.length;){let n=e.codePointAt(t);if(Gi(n)||Wi(n))t+=Ki(n);else break}return t}function Ji(e,t){let n=e.codePointAt(t),r=t+Ki(n);for(r=qi(e,r);r<e.length-1&&Vi(e.codePointAt(r));){let t=e.codePointAt(r+1);r+=1+Ki(t),r=qi(e,r)}return Ui(n)&&r<e.length&&Ui(e.codePointAt(r))&&(r+=Ki(e.codePointAt(r))),r}function Yi(e){return e>=768&&(Hi(e)||Gi(e)||Wi(e)||Vi(e))}function Xi(e){let t=0,n=0;for(;n<e.length;)n=Ji(e,n),t++;return t}function Zi(e,t){let n=0,r=0;for(;r<e.length;)if(r=Ji(e,r),++n>=t)return!0;return!1}function Qi(e,t){let n=0,r=0;for(;r<e.length;)if(r=Ji(e,r),++n>t)return!1;return!0}function $i(e,t){if(t===0)return!0;if(e.length<t)return!1;let n=0;for(;;){if(Yi(e.charCodeAt(n)))return Zi(e,t);if(++n>=t)return!0}}function ea(e,t){if(e.length<=t)return!0;let n=0;for(;;){if(Yi(e.charCodeAt(n)))return Qi(e,t);if(++n>t)return!1}}var ta=s({Counted:()=>ka,Entries:()=>Na,EntriesRegExp:()=>Ma,Every:()=>Ta,EveryAll:()=>Ea,GraphemeCount:()=>Sa,HasPropertyKey:()=>N,IsArray:()=>na,IsBigInt:()=>ra,IsBoolean:()=>ia,IsClassInstance:()=>ba,IsConstructor:()=>aa,IsDeepEqual:()=>Ra,IsEqual:()=>M,IsFunction:()=>oa,IsGreaterEqualThan:()=>va,IsGreaterThan:()=>ha,IsInteger:()=>sa,IsLessEqualThan:()=>_a,IsLessThan:()=>ga,IsMaxLength:()=>Ca,IsMinLength:()=>wa,IsMultipleOf:()=>ya,IsNull:()=>ca,IsNumber:()=>la,IsObject:()=>da,IsObjectNotArray:()=>ua,IsString:()=>fa,IsSymbol:()=>pa,IsUndefined:()=>ma,IsUnsafePropertyKey:()=>ja,IsValueLike:()=>xa,Keys:()=>P,ShiftLeft:()=>Aa,Some:()=>Da,SomeAll:()=>Oa,Symbols:()=>Pa,Values:()=>Fa});function na(e){return Array.isArray(e)}function ra(e){return M(typeof e,`bigint`)}function ia(e){return M(typeof e,`boolean`)}function aa(e){if(ma(e)||!oa(e))return!1;let t=Function.prototype.toString.call(e);return!!(/^class\s/.test(t)||/\[native code\]/.test(t))}function oa(e){return M(typeof e,`function`)}function sa(e){return Number.isInteger(e)}function ca(e){return M(e,null)}function la(e){return Number.isFinite(e)}function ua(e){return da(e)&&!na(e)}function da(e){return M(typeof e,`object`)&&!ca(e)}function fa(e){return M(typeof e,`string`)}function pa(e){return M(typeof e,`symbol`)}function ma(e){return M(e,void 0)}function M(e,t){return e===t}function ha(e,t){return e>t}function ga(e,t){return e<t}function _a(e,t){return e<=t}function va(e,t){return e>=t}function ya(e,t){if(ra(e)||ra(t))return BigInt(e)%BigInt(t)===0n;if(!la(e)||sa(e)&&1/t%1==0)return!0;let n=e%t;return Math.min(Math.abs(n),Math.abs(n-t),Math.abs(n+t))<1e-10}function ba(e){if(!da(e))return!1;let t=globalThis.Object.getPrototypeOf(e);return!ca(t)&&M(typeof t.constructor,`function`)&&!(M(t.constructor,globalThis.Object)||M(t.constructor.name,`Object`))}function xa(e){return ra(e)||ia(e)||ca(e)||la(e)||fa(e)||ma(e)}function Sa(e){return Xi(e)}function Ca(e,t){return ea(e,t)}function wa(e,t){return $i(e,t)}function Ta(e,t,n){return e.every((e,r)=>r<t||n(e,r))}function Ea(e,t,n){let r=!0;return e.forEach((e,i)=>{i>=t&&!n(e,i)&&(r=!1)}),r}function Da(e,t){return e.some((e,n)=>t(e,n))}function Oa(e,t){let n=!1;return e.forEach((e,r)=>{t(e,r)&&(n=!0)}),n}function ka(e,t){return e.reduce((e,n,r)=>t(n,r)?++e:e,0)}function Aa(e,t,n){return M(e.length,0)?n():t(e[0],e.slice(1))}function ja(e){return M(e,`__proto__`)||M(e,`constructor`)||M(e,`prototype`)}function N(e,t){return ja(t)?Object.prototype.hasOwnProperty.call(e,t):t in e}function Ma(e){return P(e).map(t=>[RegExp(`^${t}$`),e[t]])}function Na(e){return Object.entries(e)}function P(e){return Object.getOwnPropertyNames(e)}function Pa(e){return Object.getOwnPropertySymbols(e)}function Fa(e){return Object.values(e)}function Ia(e,t){if(!da(t))return!1;let n=P(e);return M(n.length,P(t).length)&&n.every(n=>Ra(e[n],t[n]))}function La(e,t){return na(t)&&M(e.length,t.length)&&e.every((n,r)=>Ra(e[r],t[r]))}function Ra(e,t){return na(e)?La(e,t):da(e)?Ia(e,t):M(e,t)}function za(e){return e instanceof Boolean}function Ba(e){return e instanceof Number}function Va(e){return e instanceof String}function Ha(e){return globalThis.ArrayBuffer.isView(e)}function Ua(e){return e instanceof globalThis.RegExp}function Wa(e){return e instanceof globalThis.Date}function Ga(e){return e instanceof globalThis.Set}function Ka(e){return e instanceof globalThis.Map}var qa=ta,Ja={immutableTypes:!1,maxErrors:8,maxInstantiationCount:128,useAcceleration:!0,exactOptionalPropertyTypes:!1,enumerableKind:!1,correctiveParse:!1,unionPrioritySort:!0};function Ya(){return Ja}function Xa(e){return N(e,`~refine`)&&na(e[`~refine`])&&Ta(e[`~refine`],0,e=>da(e)&&N(e,`check`)&&N(e,`error`)&&oa(e.check)&&oa(e.error))}function Za(e){return da(e)&&!na(e)}function Qa(e){return ia(e)}function $a(e){return Za(e)||Qa(e)}function eo(e){return N(e,`additionalItems`)&&$a(e.additionalItems)}function to(e){return N(e,`additionalProperties`)&&$a(e.additionalProperties)}function no(e){return N(e,`allOf`)&&na(e.allOf)&&e.allOf.every(e=>$a(e))}function ro(e){return N(e,`$anchor`)&&fa(e.$anchor)}function io(e){return N(e,`anyOf`)&&na(e.anyOf)&&e.anyOf.every(e=>$a(e))}function ao(e){return N(e,`const`)}function oo(e){return N(e,`contains`)&&$a(e.contains)}function so(e){return N(e,`default`)}function co(e){return N(e,`dependencies`)&&da(e.dependencies)&&Object.values(e.dependencies).every(e=>$a(e)||na(e)&&e.every(e=>fa(e)))}function lo(e){return N(e,`dependentRequired`)&&da(e.dependentRequired)&&Object.values(e.dependentRequired).every(e=>na(e)&&e.every(e=>fa(e)))}function uo(e){return N(e,`dependentSchemas`)&&da(e.dependentSchemas)&&Object.values(e.dependentSchemas).every(e=>$a(e))}function fo(e){return N(e,`$dynamicAnchor`)&&fa(e.$dynamicAnchor)}function po(e){return N(e,`$dynamicRef`)&&fa(e.$dynamicRef)}function mo(e){return N(e,`else`)&&$a(e.else)}function ho(e){return N(e,`enum`)&&na(e.enum)}function go(e){return N(e,`exclusiveMaximum`)&&(la(e.exclusiveMaximum)||ra(e.exclusiveMaximum))}function _o(e){return N(e,`exclusiveMinimum`)&&(la(e.exclusiveMinimum)||ra(e.exclusiveMinimum))}function vo(e){return N(e,`format`)&&fa(e.format)}function yo(e){return N(e,`$id`)&&fa(e.$id)}function bo(e){return N(e,`if`)&&$a(e.if)}function xo(e){return N(e,`items`)&&($a(e.items)||na(e.items)&&e.items.every(e=>$a(e)))}function So(e){return xo(e)&&na(e.items)}function Co(e){return N(e,`maximum`)&&(la(e.maximum)||ra(e.maximum))}function wo(e){return N(e,`maxContains`)&&la(e.maxContains)}function To(e){return N(e,`maxItems`)&&la(e.maxItems)}function Eo(e){return N(e,`maxLength`)&&la(e.maxLength)}function Do(e){return N(e,`maxProperties`)&&la(e.maxProperties)}function Oo(e){return N(e,`minimum`)&&(la(e.minimum)||ra(e.minimum))}function ko(e){return N(e,`minContains`)&&la(e.minContains)}function Ao(e){return N(e,`minItems`)&&la(e.minItems)}function jo(e){return N(e,`minLength`)&&la(e.minLength)}function Mo(e){return N(e,`minProperties`)&&la(e.minProperties)}function No(e){return N(e,`multipleOf`)&&(la(e.multipleOf)||ra(e.multipleOf))}function Po(e){return N(e,`not`)&&$a(e.not)}function Fo(e){return N(e,`oneOf`)&&na(e.oneOf)&&e.oneOf.every(e=>$a(e))}function Io(e){return N(e,`pattern`)&&(fa(e.pattern)||e.pattern instanceof RegExp)}function Lo(e){return N(e,`patternProperties`)&&da(e.patternProperties)&&Object.values(e.patternProperties).every(e=>$a(e))}function Ro(e){return N(e,`prefixItems`)&&na(e.prefixItems)&&e.prefixItems.every(e=>$a(e))}function zo(e){return N(e,`properties`)&&da(e.properties)&&Object.values(e.properties).every(e=>$a(e))}function Bo(e){return N(e,`propertyNames`)&&(da(e.propertyNames)||$a(e.propertyNames))}function Vo(e){return N(e,`$recursiveAnchor`)&&ia(e.$recursiveAnchor)}function Ho(e){return Vo(e)&&M(e.$recursiveAnchor,!0)}function Uo(e){return N(e,`$recursiveRef`)&&fa(e.$recursiveRef)}function Wo(e){return N(e,`$ref`)&&fa(e.$ref)}function Go(e){return N(e,`required`)&&na(e.required)&&e.required.every(e=>fa(e))}function Ko(e){return N(e,`then`)&&$a(e.then)}function qo(e){return N(e,`type`)&&(fa(e.type)||na(e.type)&&e.type.every(e=>fa(e)))}function Jo(e){return N(e,`uniqueItems`)&&ia(e.uniqueItems)}function Yo(e){return N(e,`unevaluatedItems`)&&$a(e.unevaluatedItems)}function Xo(e){return N(e,`unevaluatedProperties`)&&$a(e.unevaluatedProperties)}var Zo=class{constructor(){let e=new Set,t=new Set;this.stack=[{indices:e,keys:t}]}Push(){let e=new Set,t=new Set;return this.stack.push({indices:e,keys:t}),!0}Pop(){return this.stack.pop(),!0}AddIndex(e){return this.GetIndices().add(e),!0}AddKey(e){return this.GetKeys().add(e),!0}GetIndices(){return this.stack[this.stack.length-1].indices}GetKeys(){return this.stack[this.stack.length-1].keys}Merge(e){for(let t of e)t.GetIndices().forEach(e=>this.GetIndices().add(e)),t.GetKeys().forEach(e=>this.GetKeys().add(e));return!0}},Qo=class extends Zo{constructor(){super(),this.errors=[]}AtCapacity(){return this.errors.length>=Ya().maxErrors}AddError(e){return this.AtCapacity()||this.errors.push(e),!1}GetErrors(){return this.errors}};function $o(e,t,n,r){return Ta(n[`~refine`],0,(e,t)=>e.check(r))}function es(e,t,n,r,i,a){return Ea(i[`~refine`],0,(e,i)=>e.check(a)||t.AddError({keyword:`~refine`,schemaPath:n,instancePath:r,params:{index:i,message:e.error(a)}}))}function ts(e){return xo(e)&&na(e.items)}function ns(e,t,n,r){return!ts(n)||Ta(r,0,(r,i)=>ga(i,n.items.length)||bd(e,t,n.additionalItems,r)&&t.AddIndex(i))}function rs(e,t,n,r,i,a){return!ts(i)||Ta(a,0,(a,o)=>{let s=`${n}/additionalItems`,c=`${r}/${o}`;return ga(o,i.items.length)||Sd(e,t,s,c,i.additionalItems,a)&&t.AddIndex(o)})}function is(e){return new RegExp(e,`u`)}function as(e){return`^${e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}$`}function os(e){let t=[];return Lo(e)&&t.push(...P(e.patternProperties)),zo(e)&&t.push(...P(e.properties).map(as)),M(t.length,0)?`(?!)`:`(${t.join(`|`)})`}function ss(e,t,n,r){let i=is(os(n));return Ta(P(r),0,(a,o)=>i.test(a)||bd(e,t,n.additionalProperties,r[a])&&t.AddKey(a))}function cs(e,t,n,r,i,a){let o=is(os(i)),s=[];return Ea(P(a),0,(c,l)=>{let u=`${n}/additionalProperties`,d=`${r}/${c}`,f=o.test(c)||Sd(e,t,u,d,i.additionalProperties,a[c])&&t.AddKey(c);return f||s.push(c),f})||t.AddError({keyword:`additionalProperties`,schemaPath:n,instancePath:r,params:{additionalProperties:s}})}function ls(e,t,n,r){let i=n.allOf.reduce((t,n)=>{let i=new Zo;return xd(e,i,n,r)?[...t,i]:t},[]);return M(i.length,n.allOf.length)&&t.Merge(i)}function us(e,t,n,r,i,a){let o=[],s=i.allOf.reduce((t,i,s)=>{let c=`${n}/allOf/${s}`,l=new Qo,u=Cd(e,l,c,r,i,a);return u||o.push(l),u?[...t,l]:t},[]),c=M(s.length,i.allOf.length)&&t.Merge(s);return c||o.forEach(e=>e.GetErrors().forEach(e=>t.AddError(e))),c}function ds(e,t,n,r){let i=n.anyOf.reduce((t,n)=>{let i=new Zo;return xd(e,i,n,r)?[...t,i]:t},[]);return ha(i.length,0)&&t.Merge(i)}function fs(e,t,n,r,i,a){let o=[],s=i.anyOf.reduce((t,i,s)=>{let c=new Qo,l=Cd(e,c,`${n}/anyOf/${s}`,r,i,a);return l||o.push(c),l?[...t,c]:t},[]),c=ha(s.length,0)&&t.Merge(s);return c||o.forEach(e=>e.GetErrors().forEach(e=>t.AddError(e))),c||t.AddError({keyword:`anyOf`,schemaPath:n,instancePath:r,params:{}})}function ps(e,t,n,r){return n}function ms(e,t,n,r,i,a){return ps(e,t,i,a)||t.AddError({keyword:`boolean`,schemaPath:n,instancePath:r,params:{}})}function hs(e,t,n,r){return xa(n.const)?M(r,n.const):Ra(r,n.const)}function gs(e,t,n,r,i,a){return hs(e,t,i,a)||t.AddError({keyword:`const`,schemaPath:n,instancePath:r,params:{allowedValue:i.const}})}function _s(e){return!(ko(e)&&M(e.minContains,0))}function vs(e,t,n,r){return!_s(n)||!M(r.length,0)&&Oa(r,(r,i)=>xd(e,t,n.contains,r)&&t.AddIndex(i))}function ys(e,t,n,r,i,a){return vs(e,t,i,a)||t.AddError({keyword:`contains`,schemaPath:n,instancePath:r,params:{minContains:1}})}function bs(e,t,n,r){let i=M(P(r).length,0),a=Ta(Na(n.dependencies),0,([n,i])=>!N(r,n)||(na(i)?i.every(e=>N(r,e)):xd(e,t,i,r)));return i||a}function xs(e,t,n,r,i,a){let o=M(P(a).length,0),s=Ea(Na(i.dependencies),0,([i,o])=>{let s=`${n}/dependencies/${i}`;return!N(a,i)||(na(o)?o.every(e=>N(a,e)||t.AddError({keyword:`dependencies`,schemaPath:n,instancePath:r,params:{property:i,dependencies:o}})):Cd(e,t,s,r,o,a))});return o||s}function Ss(e,t,n,r){let i=M(P(r).length,0),a=Ta(Na(n.dependentRequired),0,([e,t])=>!N(r,e)||t.every(e=>N(r,e)));return i||a}function Cs(e,t,n,r,i,a){let o=M(P(a).length,0),s=Ea(Na(i.dependentRequired),0,([e,i])=>!N(a,e)||Ea(i,0,o=>N(a,o)||t.AddError({keyword:`dependentRequired`,schemaPath:n,instancePath:r,params:{property:e,dependencies:i}})));return o||s}function ws(e,t,n,r){let i=M(P(r).length,0),a=Ta(Na(n.dependentSchemas),0,([n,i])=>!N(r,n)||xd(e,t,i,r));return i||a}function Ts(e,t,n,r,i,a){let o=M(P(a).length,0),s=Ea(Na(i.dependentSchemas),0,([i,o])=>{let s=`${n}/dependentSchemas/${i}`;return!N(a,i)||Cd(e,t,s,r,o,a)});return o||s}function Es(e,t,n,r){let i=e.DynamicRef(n)??!1;return $a(i)&&xd(e,t,i,r)}function Ds(e,t,n,r,i,a){let o=e.DynamicRef(i)??!1;return $a(o)&&Cd(e,t,`#`,r,o,a)}function Os(e,t,n,r){return Da(n.enum,e=>xa(e)?M(r,e):Ra(r,e))}function ks(e,t,n,r,i,a){return Os(e,t,i,a)||t.AddError({keyword:`enum`,schemaPath:n,instancePath:r,params:{allowedValues:i.enum}})}function As(e,t,n,r){return ga(r,n.exclusiveMaximum)}function js(e,t,n,r,i,a){return As(e,t,i,a)||t.AddError({keyword:`exclusiveMaximum`,schemaPath:n,instancePath:r,params:{comparison:`<`,limit:i.exclusiveMaximum}})}function Ms(e,t,n,r){return ha(r,n.exclusiveMinimum)}function Ns(e,t,n,r,i,a){return Ms(e,t,i,a)||t.AddError({keyword:`exclusiveMinimum`,schemaPath:n,instancePath:r,params:{comparison:`>`,limit:i.exclusiveMinimum}})}var Ps=[0,31,28,31,30,31,30,31,31,30,31,30,31],Fs=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;function Is(e){return e%4==0&&(e%100!=0||e%400==0)}function Ls(e){let t=Fs.exec(e);if(!t)return!1;let n=+t[1],r=+t[2],i=+t[3];return r>=1&&r<=12&&i>=1&&i<=(r===2&&Is(n)?29:Ps[r])}var Rs=/^(\d\d):(\d\d):(\d\d)(?:\.\d+)?(?:([Zz])|([+-])(\d\d):(\d\d))?$/;function zs(e,t=!0){let n=Rs.exec(e);if(!n||t&&!n[4]&&!n[5])return!1;let r=+n[1],i=+n[2],a=+n[3];if(r>23||i>59||a>60)return!1;if(n[5]){let e=+n[6],t=+n[7];if(e>23||t>59)return!1}if(a<60)return!0;let o=n[5]===`-`?-1:1,s=+(n[6]||0),c=+(n[7]||0);return((r*60+i-o*(s*60+c))%1440+1440)%1440==1439}function Bs(e){let t=e.split(/T/i);return t.length===2&&Ls(t[0])&&zs(t[1])}var Vs=/^P((\d+Y(\d+M(\d+D)?)?|\d+M(\d+D)?|\d+D)(T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S))?|T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S)|\d+W)$/;function Hs(e){return Vs.test(e)}var Us=/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[^"\\]|\\[\x20-\x7e])*")@(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*|\[(?:IPv6:[a-f0-9:]+|(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3})\])$/i;function Ws(e){return Us.test(e)}var Gs=/^(?!-).*(?<!-)$/,Ks=/^(?!..--)/,qs=/^[a-zA-Z0-9-]*$/,Js=/[^\p{ASCII}]/u,Ys=/[0-9]/,Xs=/[\u{0660}-\u{0669}]/u,Zs=/[\u{06f0}-\u{06f9}]/u,Qs=/[\u{002e}\u{002c}\u{003a}\u{002f}]/u,$s=/[\u{002d}\u{002b}]/u,ec=/\p{Mn}/u,tc=/\p{Mc}/u,nc=/[\p{Mn}\p{Mc}\p{Me}]/u,rc=/\p{L}/u,ic=/\p{Nd}/u,ac=/\p{Script=Greek}/u,oc=/\p{Script=Hebrew}/u,sc=/[\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Han}]/u,cc=/[\p{Script=Arabic}\p{Script=Syriac}\p{Script=Thaana}\p{Script=Mandaic}]/u,lc=/[\u{094d}\u{09cd}\u{0a4d}\u{0acd}\u{0b4d}\u{0bcd}\u{0c4d}\u{0ccd}\u{0d3b}\u{0d3c}\u{0d4d}\u{0dca}\u{1b44}\u{1baa}\u{1bab}\u{a9c0}\u{11046}\u{1107f}\u{110b9}\u{11133}\u{11134}\u{111c0}\u{11235}\u{1134d}\u{11442}\u{114c2}\u{115bf}\u{1163f}\u{116b6}\u{11c3f}\u{11d44}\u{11d45}]/u,uc=/[\u{0640}\u{07fa}\u{302e}\u{302f}\u{3031}\u{3032}\u{3033}\u{3034}\u{3035}\u{303b}]/u,dc=/[\u{00b7}\u{0375}\u{05f3}\u{05f4}\u{200c}\u{200d}\u{30fb}]/u,fc=/[\u{00df}\u{03c2}\u{06fd}\u{06fe}\u{0f0b}\u{3007}]/u,pc=new RegExp([Ys,Zs].map(e=>e.source).join(`|`),`u`),mc=new RegExp([rc,$s,Qs,ic,ec,tc,dc,fc].map(e=>e.source).join(`|`),`u`);function hc(e){return Gs.test(e)&&Ks.test(e)&&qs.test(e)}var gc=36,_c=1,vc=26,yc=38,bc=700,xc=72,Sc=128;function Cc(){throw null}function wc(e){return e.toLowerCase().startsWith(`xn--`)}function Tc(e,t,n){e=n?Math.floor(e/bc):e>>1,e+=Math.floor(e/t);let r=0;for(;e>455;)e=Math.floor(e/35),r+=gc;return r+Math.floor(36*e/(e+yc))}function Ec(e){let t=[],n=Sc,r=0,i=xc,a=e.lastIndexOf(`-`);if(a>0)for(let n=0;n<a;n++){let r=e.charCodeAt(n);r>=128&&Cc(),t.push(r)}let o=a<0?0:a+1;for(;o<e.length;){let a=r,s=1,c=gc;for(;;){o>=e.length&&Cc();let t=e.charCodeAt(o++),n;t>=97&&t<=122?n=t-97:t>=48&&t<=57?n=t-48+26:Cc(),r+=n*s;let a=c<=i?_c:c>=i+vc?vc:c-i;if(n<a)break;s*=gc-a,c+=gc}let l=t.length+1;i=Tc(r-a,l,a===0),n+=Math.floor(r/l),r%=l,t.splice(r,0,n),r++}return String.fromCodePoint(...t)}function Dc(e){return e<26?String.fromCharCode(e+97):String.fromCharCode(e-26+48)}var Oc=new RegExp(Js.source,`gu`);function kc(e){let t=e.replace(Oc,``),n=t.length,r=n>0?[t,`-`]:[],i=Array.from(e,e=>e.codePointAt(0)),a=Sc,o=0,s=xc,c=n;for(;c<i.length;){let e=1/0;for(let t of i)t>=a&&t<e&&(e=t);o+=(e-a)*(c+1),a=e;for(let e of i)if(e<a&&o++,e===a){let e=o;for(let t=gc;;t+=gc){let n=t<=s?_c:t>=s+vc?vc:t-s;if(e<n)break;let i=n+(e-n)%(gc-n);r.push(Dc(i)),e=Math.floor((e-n)/(gc-n))}r.push(Dc(e)),s=Tc(o,c+1,c===n),o=0,c++}o++,a++}return r.join(``)}var Ac=/^(?:R|AL|AN|EN|ES|CS|ET|ON|BN|NSM)$/,jc=/^(?:L|EN|ES|CS|ET|ON|BN|NSM)$/,Mc=/^(?:R|AL|AN)$/;function Nc(e){if(wc(e))try{return Fc(Ec(e.slice(4).toLowerCase()))}catch{return!1}return Fc(e)}function Pc(e){let t=String.fromCodePoint(e);return pc.test(t)?`EN`:Xs.test(t)?`AN`:ec.test(t)?`NSM`:oc.test(t)?`R`:cc.test(t)?`AL`:rc.test(t)?`L`:`ON`}function Fc(e){for(let t of e)if(Mc.test(Pc(t.codePointAt(0))))return!0;return!1}function Ic(e){let t=!1,n=jc,r=!1,i=!1,a=!0;for(let o of e){let e=Pc(o.codePointAt(0));if(a){if(e!==`L`&&e!==`R`&&e!==`AL`)return!1;t=e===`R`||e===`AL`,n=t?Ac:jc,a=!1}if(!n.test(e))return!1;e===`EN`?r=!0:e===`AN`&&(i=!0)}return!(t&&r&&i)}function Lc(e){return Js.test(e)&&kc(e).length+4>63}function Rc(e){return e[0]===`-`||e[e.length-1]===`-`||e.slice(2).join(``).startsWith(`--`)}function zc(e){if(Lc(e)||Fc(e)&&!Ic(e))return!1;let t=[...e],n=t.map(e=>e.codePointAt(0)),r=n.length;if(Rc(t)||nc.test(t[0]))return!1;let i=!1;for(let e=0;e<r;e++){let r=n[e],a=t[e];if(uc.test(a)||!mc.test(a))return!1;sc.test(a)&&(i=!0);let o=n[e-1],s=n[e+1];switch(r){case 183:if(o!==108||s!==108)return!1;break;case 885:if(!s||!ac.test(t[e+1]))return!1;break;case 1523:case 1524:if(!o||!oc.test(t[e-1]))return!1;break;case 8204:if(!o||o<128&&!lc.test(t[e-1]))return!1;break;case 8205:if(!o||!lc.test(t[e-1]))return!1}}return!(e.includes(`・`)&&!i)}function Bc(e){if(!wc(e))return!1;try{let t=e.slice(4).toLowerCase();if(t.lastIndexOf(`-`)===0)return!1;let n=Ec(t);return Js.test(n)?zc(n):!1}catch{return!1}}function Vc(e){return e.length>0&&e.length<=63}function Hc(e){return Vc(e)&&(Bc(e)||hc(e))}function Uc(e){return e.length===0||e.length>253||e.charCodeAt(e.length-1)===46?!1:e.split(`.`).every(e=>Hc(e))}function Wc(e){return e.length>0&&e.length<=63}function Gc(e){return Wc(e)&&(Bc(e)||zc(e))}function Kc(e){return e.replace(/[\uff01-\uff5e]/g,e=>String.fromCharCode(e.charCodeAt(0)-65248)).normalize(`NFC`).replace(/[\u00ad\u034f\u180b-\u180d\u200b\ufe00-\ufe0f\u{e0100}-\u{e01ef}]/gu,``).replace(/[\u002E\u3002\uFF0E\uFF61]/g,`.`)}function qc(e){if(e.length===0||e.includes(` `))return!1;let t=Kc(e);if(t.length>253)return!1;let n=t.split(`.`),r=n.some(e=>Nc(e));return n.every(e=>Gc(e)&&(!r||Ic(e)))}function Jc(e){return Uc(e)}var Yc=/^(?:[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\u{0080}-\u{10FFFF}-]+(?:\.[A-Za-z0-9!#$%&'*+\/=?^_`{|}~\u{0080}-\u{10FFFF}-]+)*|"(?:[^"\\]|\\.)*")@[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?<!-)(?:\.[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?<!-))*$/iu;function Xc(e){return Yc.test(e.normalize(`NFC`))}function Zc(e){return qc(e)}var Qc=/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/;function $c(e){return Qc.test(e)}var el=/^(?:(?:(?:[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-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|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\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})?::)$/i;function tl(e){return el.test(e)}var nl=/[\x00-\x20\x7F\\]|%(?![0-9a-fA-F]{2})/,rl=/^[a-zA-Z][a-zA-Z0-9+\-.]*\/\//;function il(e){return!nl.test(e)&&!rl.test(e)&&URL.canParse(e,`http://example.com`)}var al=2048,ol=/\[[vV][0-9a-fA-F]+\.[^\]]+\]/,sl=/[\x00-\x20<>\^`{|}\\]/,cl=/%(?![0-9a-fA-F]{2})/;function ll(e){return e.length<al?e.replace(ol,`[::1]`):e}function ul(e){return sl.test(e)||cl.test(e)?!1:URL.canParse(ll(e))}var dl=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;function fl(e){return dl.test(e)}var pl=/^(?:\/(?:[^~/]|~0|~1)*)*$/;function ml(e){return pl.test(e)}function hl(e){try{return new RegExp(e,`u`),!0}catch{return!1}}var gl=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function _l(e){return gl.test(e)}var vl=/^(?:[a-z][a-z0-9+\-.]*:(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\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})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\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;function yl(e){return vl.test(e)}var bl=/^(?:(?:[^\x00-\x20"<>%\\^`{|}\x7f]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\d{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?:\.(?:[a-z0-9_]|%[0-9a-f]{2})+)*(?::[1-9]\d{0,3}|\*)?)*\})*$/i;function xl(e){return bl.test(e)}var Sl=/^[a-z][a-z0-9+\-.]*:(?:\/\/(?:(?:[-a-z0-9._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:[\da-f]{1,4}:){6}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|::(?:[\da-f]{1,4}:){5}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:[\da-f]{1,4})?::(?:[\da-f]{1,4}:){4}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,1}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){3}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4})?::(?:[\da-f]{1,4}:){2}(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4})?::[\da-f]{1,4}:(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4})?::(?:[\da-f]{1,4}:[\da-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))|(?:(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4})?::[\da-f]{1,4}|(?:(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4})?::)|v[0-9a-f]+\.[-a-z0-9._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\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;function Cl(e){return Sl.test(e)}function wl(e){return URL.canParse(e)}var Tl=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function El(e){return Tl.test(e)}var Dl=new Map;function Ol(){Dl.clear()}function kl(e,t){return Dl.get(e)?.(t)??!0}function Al(){Ol(),Dl.set(`date-time`,Bs),Dl.set(`date`,Ls),Dl.set(`duration`,Hs),Dl.set(`email`,Ws),Dl.set(`hostname`,Jc),Dl.set(`idn-email`,Xc),Dl.set(`idn-hostname`,Zc),Dl.set(`ipv4`,$c),Dl.set(`ipv6`,tl),Dl.set(`iri-reference`,il),Dl.set(`iri`,ul),Dl.set(`json-pointer-uri-fragment`,fl),Dl.set(`json-pointer`,ml),Dl.set(`regex`,hl),Dl.set(`relative-json-pointer`,_l),Dl.set(`time`,zs),Dl.set(`uri-reference`,yl),Dl.set(`uri-template`,xl),Dl.set(`uri`,Cl),Dl.set(`url`,wl),Dl.set(`uuid`,El)}Al();function jl(e,t,n,r){return kl(n.format,r)}function Ml(e,t,n,r,i,a){return jl(e,t,i,a)||t.AddError({keyword:`format`,schemaPath:n,instancePath:r,params:{format:i.format}})}function Nl(e,t,n,r){let i=!Ko(n)||n.then,a=!mo(n)||n.else;return xd(e,t,n.if,r)?xd(e,t,i,r):xd(e,t,a,r)}function Pl(e,t,n,r,i,a){let o=!Ko(i)||i.then,s=!mo(i)||i.else,c=new Qo,l=Cd(e,c,`${n}/if`,r,i.if,a)?Cd(e,c,`${n}/then`,r,o,a)||t.AddError({keyword:`if`,schemaPath:n,instancePath:r,params:{failingKeyword:`then`}}):Cd(e,t,`${n}/else`,r,s,a)||t.AddError({keyword:`if`,schemaPath:n,instancePath:r,params:{failingKeyword:`else`}});return l&&t.Merge([c]),l}function Fl(e,t,n,r){return Ta(n.items,0,(n,i)=>_a(r.length,i)||bd(e,t,n,r[i])&&t.AddIndex(i))}function Il(e,t,n,r,i,a){return Ea(i.items,0,(i,o)=>{let s=`${n}/items/${o}`,c=`${r}/${o}`;return _a(a.length,o)||Sd(e,t,s,c,i,a[o])&&t.AddIndex(o)})}function Ll(e,t,n,r){return Ta(r,Ro(n)?n.prefixItems.length:0,(r,i)=>bd(e,t,n.items,r)&&t.AddIndex(i))}function Rl(e,t,n,r,i,a){return Ea(a,Ro(i)?i.prefixItems.length:0,(a,o)=>Sd(e,t,`${n}/items`,`${r}/${o}`,i.items,a)&&t.AddIndex(o))}function zl(e,t,n,r){return So(n)?Fl(e,t,n,r):Ll(e,t,n,r)}function Bl(e,t,n,r,i,a){return So(i)?Il(e,t,n,r,i,a):Rl(e,t,n,r,i,a)}function Vl(e){return oo(e)}function Hl(e,t,n,r){return!Vl(n)||_a(ka(r,r=>xd(e,t,n.contains,r)),n.maxContains)}function Ul(e,t,n,r,i,a){let o=ko(i)?i.minContains:1;return Hl(e,t,i,a)||t.AddError({keyword:`contains`,schemaPath:n,instancePath:r,params:{minContains:o,maxContains:i.maxContains}})}function Wl(e,t,n,r){return _a(r,n.maximum)}function Gl(e,t,n,r,i,a){return Wl(e,t,i,a)||t.AddError({keyword:`maximum`,schemaPath:n,instancePath:r,params:{comparison:`<=`,limit:i.maximum}})}function Kl(e,t,n,r){return _a(r.length,n.maxItems)}function ql(e,t,n,r,i,a){return Kl(e,t,i,a)||t.AddError({keyword:`maxItems`,schemaPath:n,instancePath:r,params:{limit:i.maxItems}})}function Jl(e,t,n,r){return Ca(r,n.maxLength)}function Yl(e,t,n,r,i,a){return Jl(e,t,i,a)||t.AddError({keyword:`maxLength`,schemaPath:n,instancePath:r,params:{limit:i.maxLength}})}function Xl(e,t,n,r){return _a(P(r).length,n.maxProperties)}function Zl(e,t,n,r,i,a){return Xl(e,t,i,a)||t.AddError({keyword:`maxProperties`,schemaPath:n,instancePath:r,params:{limit:i.maxProperties}})}function Ql(e){return oo(e)}function $l(e,t,n,r){return!Ql(n)||va(ka(r,(r,i)=>xd(e,t,n.contains,r)&&t.AddIndex(i)),n.minContains)}function eu(e,t,n,r,i,a){return $l(e,t,i,a)||t.AddError({keyword:`contains`,schemaPath:n,instancePath:r,params:{minContains:i.minContains}})}function tu(e,t,n,r){return va(r,n.minimum)}function nu(e,t,n,r,i,a){return tu(e,t,i,a)||t.AddError({keyword:`minimum`,schemaPath:n,instancePath:r,params:{comparison:`>=`,limit:i.minimum}})}function ru(e,t,n,r){return va(r.length,n.minItems)}function iu(e,t,n,r,i,a){return ru(e,t,i,a)||t.AddError({keyword:`minItems`,schemaPath:n,instancePath:r,params:{limit:i.minItems}})}function au(e,t,n,r){return wa(r,n.minLength)}function ou(e,t,n,r,i,a){return au(e,t,i,a)||t.AddError({keyword:`minLength`,schemaPath:n,instancePath:r,params:{limit:i.minLength}})}function su(e,t,n,r){return va(P(r).length,n.minProperties)}function cu(e,t,n,r,i,a){return su(e,t,i,a)||t.AddError({keyword:`minProperties`,schemaPath:n,instancePath:r,params:{limit:i.minProperties}})}function lu(e,t,n,r){return ya(r,n.multipleOf)}function uu(e,t,n,r,i,a){return lu(e,t,i,a)||t.AddError({keyword:`multipleOf`,schemaPath:n,instancePath:r,params:{multipleOf:i.multipleOf}})}function du(e,t,n,r){let i=new Zo;return!xd(e,i,n.not,r)&&t.Merge([i])}function fu(e,t,n,r,i,a){return du(e,t,i,a)||t.AddError({keyword:`not`,schemaPath:n,instancePath:r,params:{}})}function pu(e,t,n,r){let i=n.oneOf.reduce((t,n)=>{let i=new Zo;return xd(e,i,n,r)?[...t,i]:t},[]);return M(i.length,1)&&t.Merge(i)}function mu(e,t,n,r,i,a){let o=[],s=[],c=i.oneOf.reduce((t,i,c)=>{let l=new Qo,u=Cd(e,l,`${n}/oneOf/${c}`,r,i,a);return u&&s.push(c),u||o.push(l),u?[...t,l]:t},[]),l=M(c.length,1)&&t.Merge(c);return!l&&M(s.length,0)&&o.forEach(e=>e.GetErrors().forEach(e=>t.AddError(e))),l||t.AddError({keyword:`oneOf`,schemaPath:n,instancePath:r,params:{passingSchemas:s}})}function hu(e,t,n,r){return(fa(n.pattern)?is(n.pattern):n.pattern).test(r)}function gu(e,t,n,r,i,a){return hu(e,t,i,a)||t.AddError({keyword:`pattern`,schemaPath:n,instancePath:r,params:{pattern:i.pattern}})}function _u(e,t,n,r){return Ta(Na(n.patternProperties),0,([n,i])=>{let a=is(n);return Ta(Na(r),0,([n,r])=>!a.test(n)||bd(e,t,i,r)&&t.AddKey(n))})}function vu(e,t,n,r,i,a){return Ea(Na(i.patternProperties),0,([i,o])=>{let s=`${n}/patternProperties/${i}`,c=is(i);return Ea(Na(a),0,([n,i])=>{let a=`${r}/${n}`;return!c.test(n)||Sd(e,t,s,a,o,i)&&t.AddKey(n)})})}function yu(e,t,n,r){return M(r.length,0)||Ta(n.prefixItems,0,(n,i)=>_a(r.length,i)||bd(e,t,n,r[i])&&t.AddIndex(i))}function bu(e,t,n,r,i,a){return M(a.length,0)||Ea(i.prefixItems,0,(i,o)=>{let s=`${n}/prefixItems/${o}`,c=`${r}/${o}`;return _a(a.length,o)||Sd(e,t,s,c,i,a[o])&&t.AddIndex(o)})}function xu(e,t){return e.includes(t)||Ya().exactOptionalPropertyTypes}function Su(e,t){return ma(e[t])}function Cu(e,t,n,r){let i=Go(n)?n.required:[];return Ta(Na(n.properties),0,([n,a])=>{let o=!N(r,n)||bd(e,t,a,r[n])&&t.AddKey(n);return xu(i,n)?o:Su(r,n)||o})}function wu(e,t,n,r,i,a){let o=Go(i)?i.required:[];return Ea(Na(i.properties),0,([i,s])=>{let c=`${n}/properties/${i}`,l=`${r}/${i}`,u=()=>!N(a,i)||Sd(e,t,c,l,s,a[i])&&t.AddKey(i);return xu(o,i)?u():Su(a,i)||u()})}function Tu(e,t,n,r){return Ta(P(r),0,(r,i)=>xd(e,t,n.propertyNames,r))}function Eu(e,t,n,r,i,a){let o=[];return Ea(P(a),0,(a,s)=>{let c=`${r}/${a}`,l=Cd(e,t,`${n}/propertyNames`,c,i.propertyNames,a);return l||o.push(a),l})||t.AddError({keyword:`propertyNames`,schemaPath:n,instancePath:r,params:{propertyNames:o}})}function Du(e,t,n,r){let i=e.RecursiveRef(n)??!1;return $a(i)&&xd(e,t,i,r)}function Ou(e,t,n,r,i,a){let o=e.RecursiveRef(i)??!1;return $a(o)&&Cd(e,t,`#`,r,o,a)}function ku(e,t,n,r){let i=e.Ref(n)??!1,a=new Zo,o=$a(i)&&xd(e,a,i,r);return o&&t.Merge([a]),o}function Au(e,t,n,r,i,a){let o=e.Ref(i)??!1,s=new Qo,c=$a(o)&&Cd(e,s,`#`,r,o,a);return c&&t.Merge([s]),c||s.GetErrors().forEach(e=>t.AddError(e)),c}function ju(e,t,n,r){return Ta(n.required,0,e=>N(r,e))}function Mu(e,t,n,r,i,a){let o=[];return Ea(i.required,0,e=>{let t=N(a,e);return t||o.push(e),t})||t.AddError({keyword:`required`,schemaPath:n,instancePath:r,params:{requiredProperties:o}})}function Nu(e,t,n,r,i){return M(n,`object`)?ua(i):M(n,`array`)?na(i):M(n,`boolean`)?ia(i):M(n,`integer`)?sa(i):M(n,`number`)?la(i):M(n,`null`)?ca(i):M(n,`string`)?fa(i):M(n,`bigint`)?ra(i):M(n,`constructor`)?aa(i):M(n,`function`)?oa(i):M(n,`symbol`)?pa(i):M(n,`undefined`)?ma(i):!M(n,`void`)||ma(i)}function Pu(e,t,n,r,i){return Da(n,n=>Nu(e,t,n,r,i))}function Fu(e,t,n,r){return na(n.type)?Pu(e,t,n.type,n,r):Nu(e,t,n.type,n,r)}function Iu(e,t,n,r,i,a){return(na(i.type)?Pu(e,t,i.type,i,a):Nu(e,t,i.type,i,a))||t.AddError({keyword:`type`,schemaPath:n,instancePath:r,params:{type:i.type}})}function Lu(e,t,n,r){let i=t.GetIndices();return Ta(r,0,(r,a)=>(i.has(a)||xd(e,t,n.unevaluatedItems,r))&&t.AddIndex(a))}function Ru(e,t,n,r,i,a){let o=t.GetIndices(),s=[];return Ea(a,0,(a,c)=>{let l=new Qo,u=(o.has(c)||Cd(e,l,n,r,i.unevaluatedItems,a))&&t.AddIndex(c);return u||s.push(c),u})||t.AddError({keyword:`unevaluatedItems`,schemaPath:n,instancePath:r,params:{unevaluatedItems:s}})}function zu(e,t,n,r){let i=t.GetKeys();return Ta(Na(r),0,([r,a])=>i.has(r)||xd(e,t,n.unevaluatedProperties,a)&&t.AddKey(r))}function Bu(e,t,n,r,i,a){let o=t.GetKeys(),s=[];return Ea(Na(a),0,([a,c])=>{let l=new Qo,u=o.has(a)||Cd(e,l,n,r,i.unevaluatedProperties,c)&&t.AddKey(a);return u||s.push(a),u})||t.AddError({keyword:`unevaluatedProperties`,schemaPath:n,instancePath:r,params:{unevaluatedProperties:s}})}function Vu(){throw Error(`Unreachable`)}function Hu(e){let t=new Set,n=e;for(;n&&n!==Object.prototype;){for(let e of Reflect.ownKeys(n))e!==`constructor`&&typeof e!=`symbol`&&t.add(e);n=Object.getPrototypeOf(n)}return[...t]}function Uu(e){return typeof e==`number`}var Wu;(function(e){e[e.Array=0]=`Array`,e[e.BigInt=1]=`BigInt`,e[e.Boolean=2]=`Boolean`,e[e.Date=3]=`Date`,e[e.Constructor=4]=`Constructor`,e[e.Function=5]=`Function`,e[e.Null=6]=`Null`,e[e.Number=7]=`Number`,e[e.Object=8]=`Object`,e[e.RegExp=9]=`RegExp`,e[e.String=10]=`String`,e[e.Symbol=11]=`Symbol`,e[e.TypeArray=12]=`TypeArray`,e[e.Undefined=13]=`Undefined`})(Wu||={});var Gu=BigInt(`14695981039346656037`),[Ku,qu]=[BigInt(`1099511628211`),BigInt(`18446744073709551616`)],Ju=Array.from({length:256}).map((e,t)=>BigInt(t)),Yu=new Float64Array(1),Xu=new DataView(Yu.buffer),Zu=new Uint8Array(Yu.buffer);function Qu(e){Gu^=Ju[e],Gu=Gu*Ku%qu}function $u(e){Qu(Wu.Array);for(let t of e)md(t)}function ed(e){Qu(Wu.BigInt),Xu.setBigInt64(0,e);for(let e of Zu)Qu(e)}function td(e){Qu(Wu.Boolean),Qu(+!!e)}function nd(e){Qu(Wu.Constructor),md(e.toString())}function rd(e){Qu(Wu.Date),md(e.getTime())}function id(e){Qu(Wu.Function),md(e.toString())}function ad(e){Qu(Wu.Null)}function od(e){Qu(Wu.Number),Xu.setFloat64(0,e,!0);for(let e of Zu)Qu(e)}function sd(e){Qu(Wu.Object);for(let t of Hu(e).sort())md(t),md(e[t])}function cd(e){Qu(Wu.RegExp),ud(e.toString())}var ld=new TextEncoder;function ud(e){Qu(Wu.String);for(let t of ld.encode(e))Qu(t)}function dd(e){Qu(Wu.Symbol),md(e.toString())}function fd(e){Qu(Wu.TypeArray);let t=new Uint8Array(e.buffer);for(let e=0;e<t.length;e++)Qu(t[e])}function pd(e){return Qu(Wu.Undefined)}function md(e){return Ha(e)?fd(e):Wa(e)?rd(e):Ua(e)?cd(e):za(e)?td(e.valueOf()):Va(e)?ud(e.valueOf()):Ba(e)?od(e.valueOf()):Uu(e)?od(e):na(e)?$u(e):ia(e)?td(e):ra(e)?ed(e):aa(e)?nd(e):ca(e)?ad(e):da(e)?sd(e):fa(e)?ud(e):pa(e)?dd(e):ma(e)?pd(e):oa(e)?id(e):Vu()}function hd(e){return Gu=BigInt(`14695981039346656037`),md(e),Gu}function gd(e){return hd(e).toString(16).padStart(16,`0`)}function _d(e){return!M(e.uniqueItems,!1)}function vd(e,t,n,r){if(!_d(n))return!0;let i=new Set(r.map(gd)).size,a=r.length;return M(i,a)}function yd(e,t,n,r,i,a){if(!_d(i))return!0;let o=new Set,s=a.reduce((e,t,n)=>{let r=gd(t);return o.has(r)?[...e,n]:(o.add(r),e)},[]);return M(s.length,0)||t.AddError({keyword:`uniqueItems`,schemaPath:n,instancePath:r,params:{duplicateItems:s}})}function bd(e,t,n,r){return t.Push()&&xd(e,t,n,r)&&t.Pop()}function xd(e,t,n,r){e.Push(n);let i=Qa(n)?ps(e,t,n,r):(!qo(n)||Fu(e,t,n,r))&&(!(da(r)&&!na(r))||(!Go(n)||ju(e,t,n,r))&&(!to(n)||ss(e,t,n,r))&&(!co(n)||bs(e,t,n,r))&&(!lo(n)||Ss(e,t,n,r))&&(!uo(n)||ws(e,t,n,r))&&(!Lo(n)||_u(e,t,n,r))&&(!zo(n)||Cu(e,t,n,r))&&(!Bo(n)||Tu(e,t,n,r))&&(!Mo(n)||su(e,t,n,r))&&(!Do(n)||Xl(e,t,n,r)))&&(!na(r)||(!eo(n)||ns(e,t,n,r))&&(!oo(n)||vs(e,t,n,r))&&(!xo(n)||zl(e,t,n,r))&&(!wo(n)||Hl(e,t,n,r))&&(!To(n)||Kl(e,t,n,r))&&(!ko(n)||$l(e,t,n,r))&&(!Ao(n)||ru(e,t,n,r))&&(!Ro(n)||yu(e,t,n,r))&&(!Jo(n)||vd(e,t,n,r)))&&(!fa(r)||(!Eo(n)||Jl(e,t,n,r))&&(!jo(n)||au(e,t,n,r))&&(!vo(n)||jl(e,t,n,r))&&(!Io(n)||hu(e,t,n,r)))&&(!(la(r)||ra(r))||(!go(n)||As(e,t,n,r))&&(!_o(n)||Ms(e,t,n,r))&&(!Co(n)||Wl(e,t,n,r))&&(!Oo(n)||tu(e,t,n,r))&&(!No(n)||lu(e,t,n,r)))&&(!Wo(n)||ku(e,t,n,r))&&(!Uo(n)||Du(e,t,n,r))&&(!po(n)||Es(e,t,n,r))&&(!ao(n)||hs(e,t,n,r))&&(!ho(n)||Os(e,t,n,r))&&(!bo(n)||Nl(e,t,n,r))&&(!Po(n)||du(e,t,n,r))&&(!no(n)||ls(e,t,n,r))&&(!io(n)||ds(e,t,n,r))&&(!Fo(n)||pu(e,t,n,r))&&(!Yo(n)||!na(r)||Lu(e,t,n,r))&&(!Xo(n)||!da(r)||zu(e,t,n,r))&&(!Xa(n)||$o(e,t,n,r));return e.Pop(n),i}function Sd(e,t,n,r,i,a){return t.Push()&&Cd(e,t,n,r,i,a)&&t.Pop()}function Cd(e,t,n,r,i,a){if(t.AtCapacity())return!1;e.Push(i);let o=Qa(i)?ms(e,t,n,r,i,a):!!(+(!qo(i)||Iu(e,t,n,r,i,a))&(!(da(a)&&!na(a))||!!(+(!Go(i)||Mu(e,t,n,r,i,a))&(!to(i)||cs(e,t,n,r,i,a))&(!co(i)||xs(e,t,n,r,i,a))&(!lo(i)||Cs(e,t,n,r,i,a))&(!uo(i)||Ts(e,t,n,r,i,a))&(!Lo(i)||vu(e,t,n,r,i,a))&(!zo(i)||wu(e,t,n,r,i,a))&(!Bo(i)||Eu(e,t,n,r,i,a))&(!Mo(i)||cu(e,t,n,r,i,a))&(!Do(i)||Zl(e,t,n,r,i,a))))&(!na(a)||!!(+(!eo(i)||rs(e,t,n,r,i,a))&(!oo(i)||ys(e,t,n,r,i,a))&(!xo(i)||Bl(e,t,n,r,i,a))&(!wo(i)||Ul(e,t,n,r,i,a))&(!To(i)||ql(e,t,n,r,i,a))&(!ko(i)||eu(e,t,n,r,i,a))&(!Ao(i)||iu(e,t,n,r,i,a))&(!Ro(i)||bu(e,t,n,r,i,a))&(!Jo(i)||yd(e,t,n,r,i,a))))&(!fa(a)||!!(+(!Eo(i)||Yl(e,t,n,r,i,a))&(!jo(i)||ou(e,t,n,r,i,a))&(!vo(i)||Ml(e,t,n,r,i,a))&(!Io(i)||gu(e,t,n,r,i,a))))&(!(la(a)||ra(a))||!!(+(!go(i)||js(e,t,n,r,i,a))&(!_o(i)||Ns(e,t,n,r,i,a))&(!Co(i)||Gl(e,t,n,r,i,a))&(!Oo(i)||nu(e,t,n,r,i,a))&(!No(i)||uu(e,t,n,r,i,a))))&(!Wo(i)||Au(e,t,n,r,i,a))&(!Uo(i)||Ou(e,t,n,r,i,a))&(!po(i)||Ds(e,t,n,r,i,a))&(!ao(i)||gs(e,t,n,r,i,a))&(!ho(i)||ks(e,t,n,r,i,a))&(!bo(i)||Pl(e,t,n,r,i,a))&(!Po(i)||fu(e,t,n,r,i,a))&(!no(i)||us(e,t,n,r,i,a))&(!io(i)||fs(e,t,n,r,i,a))&(!Fo(i)||mu(e,t,n,r,i,a))&(!Yo(i)||!na(a)||Ru(e,t,n,r,i,a))&(!Xo(i)||!da(a)||Bu(e,t,n,r,i,a)))&&(!Xa(i)||es(e,t,n,r,i,a));return e.Pop(i),o}function wd(e,t){return da(t)&&!ja(e)?t[e]:void 0}function Td(e,t){return e.reduce((e,t)=>wd(t,e),t)}function Ed(e){if(M(e.length,0))return[];let t=e.split(`/`).map(e=>e.replace(/~1/g,`/`).replace(/~0/g,`~`));return t.length>0&&t[0]===``?t.slice(1):t}function Dd(e,t){return Td(Ed(t),e)}var Od=`https://json-schema.org`;function kd(e,t){if(da(e)&&fo(e)&&M(e.$dynamicAnchor,t))return e;if(da(e))for(let n of P(e)){let r=kd(e[n],t);if(r)return r}}function Ad(e,t,n){if(M(e,n))return t.href;let r=Za(e)&&yo(e)?new URL(e.$id,t.href):t;if(na(e))for(let t of e){let e=Ad(t,r,n);if(!ma(e))return e}else if(da(e))for(let t of P(e)){let i=Ad(e[t],r,n);if(!ma(i))return i}}function jd(e,t,n){if(M(e.$id,n.hash))return e;let r=new URL(n.href,t.href);if(M(t.pathname,r.pathname))return n.hash.startsWith(`#`)?Pd(e,n):e}function Md(e,t,n){let r=new URL(`#${e.$anchor}`,t.href),i=new URL(n.href,t.href);return M(r.href,i.href)?e:void 0}function Nd(e,t,n){let r=new URL(`#${e.$dynamicAnchor}`,t.href),i=new URL(n.href,t.href);return M(r.href,i.href)?e:void 0}function Pd(e,t){if(t.href.endsWith(`#`))return e;if(!t.hash.startsWith(`#`))return;let n=decodeURIComponent(t.hash.slice(1));if(n.startsWith(`/`))return Dd(e,n)}function Fd(e,t,n){if(yo(e)){let r=jd(e,t,n);if(!ma(r))return r}if(ro(e)){let r=Md(e,t,n);if(!ma(r))return r}if(fo(e)){let r=Nd(e,t,n);if(!ma(r))return r}return Pd(e,n)}function Id(e,t,n){return e.reduce((e,r)=>{let i=zd(r,t,n);return ma(i)?e:i},void 0)}function Ld(e){return M(e,`const`)||M(e,`enum`)}function Rd(e,t,n){return P(e).reduce((r,i)=>{if(Ld(i))return r;let a=zd(e[i],t,n);return ma(a)?r:a},void 0)}function zd(e,t,n){let r=Za(e)&&yo(e)?new URL(e.$id,t.href):t;if(Za(e)){let t=Fd(e,r,n);if(!ma(t))return t}if(na(e))return Id(e,r,n);if(da(e))return Rd(e,r,n)}function Bd(e,t,n){return Ad(e,new URL(t||`.`,Od),n)}function Vd(e,t,n,r){let i=Xd(e,t,n,r,!1);return Za(i)&&yo(i)?i:void 0}function Hd(e){return e.href.split(`#`)[0]}function Ud(e,t){return N(e,t)?e[t]:void 0}function Wd(e,t,n){return zd(e,t,n)}function Gd(e,t,n){let r=Hd(n);if(M(r,Hd(t))||!N(e,r))return;let i=e[r],a=Za(i)&&yo(i)?new URL(i.$id,r):new URL(r);return M(n.hash,``)?i:zd(i,a,n)}function Kd(e,t,n,r,i){if(!r.$ref.startsWith(`#`)||N(e,`$schema`))return;let a=Bd(t,n,i);if(!(ma(a)||M(a,n)))return{target:i,base:a,root:t}}function qd(e,t,n){let r=e[t];if(Za(r))return{target:n,base:t,root:r}}function Jd(e,t,n,r,i){let a=i?qd(e.context,r,n):void 0;return ma(a)?Kd(e.root,e.lexicalSchema,e.referenceBase,t,n):a}function Yd(e,t,n,r,i,a){if(yo(i))return;let o=Vd(e,t,n,r);if(o&&!a.includes(o))return{target:i,resource:o}}function Xd(e,t,n,r,i=!0){let a=new URL(n||`.`,Od),o=i&&yo(t)?new URL(t.$id,a):a,s=new URL(r,o.href);return Ud(e,r)??Wd(t,o,s)??Gd(e,o,s)}function Zd(e,t,n,r,i,a){let o=new URL(n||`.`,Od),s=Xd(e,i.$dynamicRef.startsWith(`#`)?r:t,n,i.$dynamicRef,!1);if(ma(s)){let e=new URL(i.$dynamicRef,o).hash;if(!e.startsWith(`#/`)&&e.startsWith(`#`)){let n=decodeURIComponent(e.slice(1));return a.find(e=>M(e.$dynamicAnchor,n))??kd(t,n)}}else return!Za(s)||!fo(s)||new URL(i.$dynamicRef,o).hash.startsWith(`#/`)?s:a.find(e=>M(e.$dynamicAnchor,s.$dynamicAnchor))??s}function Qd(e,t){let n=e.inRetrievedFrame?e.lexicalSchema:e.root,r=t.$ref.startsWith(`#`)?e.lexicalSchema:n,i=Xd(e.context,r,e.referenceBase,t.$ref,!1);if(!i||!Za(i))return{schema:i};let a=new URL(t.$ref,e.referenceBase).href.split(`#`)[0],o=!M(a,e.resourceBase);return{schema:i,retrievedResource:Jd(e,t,i,a,o),resolvedResource:o?Yd(e.context,e.root,e.referenceBase,a,i,e.ids):void 0}}function $d(e,t){let n=Ho(e.lexicalSchema)?e.recursiveAnchors[0]:e.lexicalSchema;return Xd(e.context,n,e.lexicalBase,t.$recursiveRef,!1)}function ef(e,t){return Zd(e.context,e.root,e.lexicalBase,e.lexicalSchema,t,e.dynamicAnchors)}var tf=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},nf,rf,af,of,sf,cf,lf,uf,df,ff,pf,mf,hf,gf,_f,vf=class{constructor(e,t){nf.add(this),this.context=e,this.schema=t,this.ids=[],this.resourceIds=[],this.anchors=[],this.recursiveAnchors=[],this.dynamicAnchors=[],this.retrievedResources=new Map,this.retrievedFrames=[],this.resolvedResources=new Map,this.pendingResource=!0}LexicalBaseURL(){return tf(this,nf,`m`,of).call(this,this.ids)}Push(e){if(!Za(e))return;yo(e)&&tf(this,nf,`m`,mf).call(this,e),ro(e)&&this.anchors.push(e),Ho(e)&&this.recursiveAnchors.push(e),fo(e)&&this.dynamicAnchors.push(e);let t=this.retrievedResources.get(e);t&&this.retrievedFrames.push({schema:t.root,base:t.base,idDepth:this.ids.length,resourceDepth:this.resourceIds.length})}Pop(e){Za(e)&&(yo(e)&&tf(this,nf,`m`,hf).call(this,e),ro(e)&&this.anchors.pop(),Ho(e)&&this.recursiveAnchors.pop(),fo(e)&&this.dynamicAnchors.pop(),this.retrievedResources.has(e)&&this.retrievedFrames.pop(),tf(this,nf,`m`,_f).call(this,e))}Ref(e){let t=Qd(tf(this,nf,`m`,rf).call(this),e);return tf(this,nf,`m`,af).call(this,t),t.schema}RecursiveRef(e){let t=$d(tf(this,nf,`m`,rf).call(this),e);return t&&(this.pendingResource=!0),t}DynamicRef(e){let t=ef(tf(this,nf,`m`,rf).call(this),e);return t&&(this.pendingResource=!0),t}};nf=new WeakSet,rf=function(){return{context:this.context,root:this.schema,ids:this.ids,lexicalSchema:tf(this,nf,`m`,lf).call(this),lexicalBase:this.LexicalBaseURL(),referenceBase:tf(this,nf,`m`,cf).call(this),resourceBase:tf(this,nf,`m`,sf).call(this),recursiveAnchors:this.recursiveAnchors,dynamicAnchors:this.dynamicAnchors,inRetrievedFrame:this.retrievedFrames.length>0}},af=function(e){ma(e.schema)||(this.pendingResource=!0),ma(e.resolvedResource)||tf(this,nf,`m`,gf).call(this,e.resolvedResource.target,e.resolvedResource.resource),ma(e.retrievedResource)||this.retrievedResources.set(e.retrievedResource.target,{base:e.retrievedResource.base,root:e.retrievedResource.root})},of=function(e){let t=this.retrievedFrames[this.retrievedFrames.length-1],n=t?new URL(t.base):new URL(Od);return(t?e.slice(t.idDepth):e).reduce((e,t)=>new URL(t.$id,e),n).href},sf=function(){let e=this.retrievedFrames[this.retrievedFrames.length-1];return e?this.resourceIds.slice(e.resourceDepth).reduce((e,t)=>new URL(t.$id,e),new URL(e.base)).href:tf(this,nf,`m`,of).call(this,this.resourceIds)},cf=function(){if(this.retrievedFrames.length>0)return tf(this,nf,`m`,sf).call(this);let e=this.ids[this.ids.length-1];return e&&!/^[A-Za-z][A-Za-z0-9+.-]*:/.test(e.$id)?this.LexicalBaseURL():tf(this,nf,`m`,sf).call(this)},lf=function(){let e=this.retrievedFrames[this.retrievedFrames.length-1];return e?this.ids.length>e.idDepth?this.ids[this.ids.length-1]:e.schema:this.ids.length>0?this.ids[this.ids.length-1]:this.schema},uf=function(e){e.forEach(e=>tf(this,nf,`m`,ff).call(this,e,!1))},df=function(e){e.forEach(e=>tf(this,nf,`m`,pf).call(this,e,!1))},ff=function e(t,n=!0){if(Qa(t))return;if(na(t))return tf(this,nf,`m`,uf).call(this,t);if(!Za(t))return;let r=t;if(n||!yo(r)){!n&&fo(r)&&this.dynamicAnchors.push(r);for(let t of P(r))tf(this,nf,`m`,e).call(this,r[t],!1)}},pf=function e(t,n=!0){if(Qa(t))return;if(na(t))return tf(this,nf,`m`,df).call(this,t);if(!Za(t))return;let r=t;if(n||!yo(r)){!n&&fo(r)&&this.dynamicAnchors.pop();for(let t of P(r))tf(this,nf,`m`,e).call(this,r[t],!1)}},mf=function(e){this.ids.push(e);let t=this.pendingResource;this.pendingResource=!1,t&&this.resourceIds.push(e),tf(this,nf,`m`,ff).call(this,e,!0)},hf=function(e){this.ids.pop(),this.resourceIds.length>0&&M(this.resourceIds[this.resourceIds.length-1],e)&&this.resourceIds.pop(),tf(this,nf,`m`,pf).call(this,e,!0)},gf=function(e,t){tf(this,nf,`m`,mf).call(this,t),this.resolvedResources.set(e,t)},_f=function(e){if(!this.resolvedResources.has(e))return;let t=this.resolvedResources.get(e);tf(this,nf,`m`,hf).call(this,t),this.resolvedResources.delete(e)};function yf(e){switch(e.keyword){case`additionalProperties`:return`must not have additional properties`;case`anyOf`:return`must match a schema in anyOf`;case`boolean`:return`schema is false`;case`const`:return`must be equal to constant`;case`contains`:return`must contain at least 1 valid item`;case`dependencies`:return`must have properties ${e.params.dependencies.join(`, `)} when property ${e.params.property} is present`;case`dependentRequired`:return`must have properties ${e.params.dependencies.join(`, `)} when property ${e.params.property} is present`;case`enum`:return`must be equal to one of the allowed values`;case`exclusiveMaximum`:return`must be ${e.params.comparison} ${e.params.limit}`;case`exclusiveMinimum`:return`must be ${e.params.comparison} ${e.params.limit}`;case`format`:return`must match format "${e.params.format}"`;case`if`:return`must match "${e.params.failingKeyword}" schema`;case`maxItems`:return`must not have more than ${e.params.limit} items`;case`maxLength`:return`must not have more than ${e.params.limit} characters`;case`maxProperties`:return`must not have more than ${e.params.limit} properties`;case`maximum`:return`must be ${e.params.comparison} ${e.params.limit}`;case`minItems`:return`must not have fewer than ${e.params.limit} items`;case`minLength`:return`must not have fewer than ${e.params.limit} characters`;case`minProperties`:return`must not have fewer than ${e.params.limit} properties`;case`minimum`:return`must be ${e.params.comparison} ${e.params.limit}`;case`multipleOf`:return`must be multiple of ${e.params.multipleOf}`;case`not`:return`must not be valid`;case`oneOf`:return`must match exactly one schema in oneOf`;case`pattern`:return`must match pattern "${e.params.pattern}"`;case`propertyNames`:return`property names ${e.params.propertyNames.join(`, `)} are invalid`;case`required`:return`must have required properties ${e.params.requiredProperties.join(`, `)}`;case`type`:return typeof e.params.type==`string`?`must be ${e.params.type}`:`must be either ${e.params.type.join(` or `)}`;case`unevaluatedItems`:return`must not have unevaluated items`;case`unevaluatedProperties`:return`must not have unevaluated properties`;case`uniqueItems`:return`must not have duplicate items`;case`~refine`:return e.params.message;default:return`an unknown validation error occurred`}}var bf=yf;function xf(){return bf}var Sf={assign:0,create:0,clone:0,discard:0,update:0};function Cf(e){return Ya().immutableTypes?Object.freeze(e):e}function wf(e,t){return Sf.assign+=1,Cf({...e,...t})}function Tf(e){return e}function Ef(e){return N(e,`~kind`)||N(e,`~unsafe`)}function Df(e){let t={};for(let n of P(e)){if(ja(n))continue;let r=Object.getOwnPropertyDescriptor(e,n);r.value=Ff(r.value),M(r.enumerable,!0)?t[n]=r.value:Object.defineProperty(t,n,r)}return t}function Of(e){let t={};for(let n of P(e))ja(n)||(t[n]=Ff(e[n]));for(let n of Pa(e))t[n]=Ff(e[n]);return t}function kf(e){return ba(e)?Tf(e):Ef(e)?Df(e):Of(e)}function Af(e){return e.map(e=>Ff(e))}function jf(e){return e.slice()}function Mf(e){return new RegExp(e.source,e.flags)}function Nf(e){return new Map(Ff([...e.entries()]))}function Pf(e){return new Set(Ff([...e.values()]))}function Ff(e){return Ha(e)?jf(e):Ua(e)?Mf(e):Ka(e)?Nf(e):Ga(e)?Pf(e):na(e)?Af(e):da(e)?kf(e):e}function If(e){return Sf.clone+=1,Ff(e)}function Lf(e,t){for(let n of Object.keys(t))Object.defineProperty(e,n,{configurable:!0,writable:!0,enumerable:!1,value:t[n]});return e}function Rf(e,t){return{...e,...t}}function zf(e,t,n={}){Sf.create+=1;let r=Rf(t,n);return Cf(Ya().enumerableKind?Rf(r,e):Lf(r,e))}function Bf(e,t){Sf.discard+=1;let n={};for(let r of P(e)){if(t.includes(r))continue;let i=Object.getOwnPropertyDescriptor(e,r);i.value=If(i.value),Object.defineProperty(n,r,i)}return Cf(n)}function Vf(e,t,n){Sf.update+=1;let r=Ya(),i=If(e);for(let e of Object.keys(t))Object.defineProperty(i,e,{configurable:!0,writable:!0,enumerable:r.enumerableKind,value:t[e]});for(let e of Object.keys(n))Object.defineProperty(i,e,{configurable:!0,enumerable:!0,writable:!0,value:n[e]});return Cf(i)}function Hf(...e){let[t,n,r]=zi(e,{3:(e,t,n)=>[e,t,n],2:(e,t)=>[{},e,t]}),i=new vf(t,n),a=new Qo,o=Cd(i,a,`#`,``,n,r),s=a.GetErrors(),c=xf();return[o,s.map(e=>({...e,message:c(e)}))]}function Uf(...e){let[t,n,r]=zi(e,{3:(e,t,n)=>[e,t,n],2:(e,t)=>[{},e,t]});return xd(new vf(t,n),new Zo,n,r)}function Wf(...e){let[t,n,r]=zi(e,{3:(e,t,n)=>[e,t,n],2:(e,t)=>[{},e,t]});return Uf(t,n,r)}function Gf(...e){let[t,n,r]=zi(e,{3:(e,t,n)=>[e,t,n],2:(e,t)=>[{},e,t]}),[i,a]=Hf(t,n,r);return a}function Kf(e,t){return da(e)&&N(e,`~kind`)&&M(e[`~kind`],t)}function qf(e){return da(e)}function Jf(e,t,n){return zf({"~kind":`Deferred`},{type:`deferred`,action:e,parameters:t,options:n},{})}function Yf(e){return Kf(e,`Deferred`)}function Xf(e){return Vf(e,{"~readonly":!0},{})}function Zf(e,t){return Vf(Xf(e),{},t)}function Qf(e,t,n,r){return Zf(L(e,t,n),r)}function $f(e){return Vf(e,{"~optional":!0},{})}function ep(e,t){return Vf($f(e),{},t)}function tp(e,t,n,r){return ep(L(e,t,n),r)}function np(e,t){return zf({"~kind":`Array`},{type:`array`,items:e},t)}function rp(e){return Kf(e,`Array`)}function ip(e){return Bf(e,[`~kind`,`type`,`items`])}function ap(e,t,n={}){return zf({"~kind":`Constructor`},{type:`constructor`,parameters:e,instanceType:t},n)}function op(e){return Kf(e,`Constructor`)}function sp(e){return Bf(e,[`~kind`,`type`,`parameters`,`instanceType`])}function cp(e,t,n={}){return zf({"~kind":`Function`},{type:`function`,parameters:e,returnType:t},n)}function lp(e){return Kf(e,`Function`)}function up(e){return Bf(e,[`~kind`,`type`,`parameters`,`returnType`])}function dp(e,t){return zf({"~kind":`Ref`},{$ref:e},t)}function fp(e){return Kf(e,`Ref`)}function pp(e,t){return zf({"~kind":`Generic`},{type:`generic`,parameters:e,expression:t})}function mp(e){return Kf(e,`Generic`)}function hp(e){return zf({"~kind":`Any`},{},e)}function gp(e){return Kf(e,`Any`)}var _p=`(?!)`;function vp(e){return zf({"~kind":`Never`},{not:{}},e)}function yp(e){return Kf(e,`Never`)}function bp(e,t={}){return ep(e,t)}function F(e){return bp(e)}function xp(e){return qf(e)&&N(e,`~optional`)}function Sp(e){return P(e).filter(t=>!xp(e[t]))}function Cp(e){return P(e)}function wp(e){return Fa(e)}function I(e,t={}){let n=Sp(e);return zf({"~kind":`Object`},{type:`object`,...n.length>0?{required:n}:{},properties:e},t)}function Tp(e){return Kf(e,`Object`)}function Ep(e){return Bf(e,[`~kind`,`type`,`properties`,`required`])}function Dp(e){return zf({"~kind":`Unknown`},{},e)}function Op(e){return Kf(e,`Unknown`)}function kp(e,t,n){return zf({"~kind":`Cyclic`},{$defs:P(e).reduce((t,n)=>({...t,[n]:Vf(e[n],{},{$id:n})}),{}),$ref:t},n)}function Ap(e){return Kf(e,`Cyclic`)}function jp(e){return ua(e)&&N(e,`~unsafe`)&&ca(e[`~unsafe`])}function Mp(e){return Kf(e,`Infer`)}function Np(e,t,n,r={}){return zf({"~kind":`Dependent`},{if:e,then:t,else:n},r)}function Pp(e){return Kf(e,`Dependent`)}function Fp(e){return Bf(e,[`~kind`,`if`,`then`,`else`])}function Ip(e){return ua(e)}function Lp(e){return P(e).filter(e=>isNaN(e)).reduce((t,n)=>[...t,e[n]],[])}function Rp(e,t){return zf({"~kind":`Enum`},{enum:Ip(e)?Lp(e):e},t)}function zp(e){return Kf(e,`Enum`)}function Bp(e,t={}){return zf({"~kind":`Intersect`},{allOf:e},t)}function Vp(e){return Kf(e,`Intersect`)}function Hp(e){return Bf(e,[`~kind`,`allOf`])}function Up(e){return qf(e)&&N(e,`~immutable`)}function Wp(e,t={}){return Zf(e,t)}function Gp(e){return qf(e)&&N(e,`~readonly`)}var Kp=`-?(?:0|[1-9][0-9]*)n`;function qp(e){return zf({"~kind":`BigInt`},{type:`bigint`},e)}function Jp(e){return Kf(e,`BigInt`)}function Yp(e){return zf({"~kind":`Boolean`},{type:`boolean`},e)}function Xp(e){return Kf(e,`Boolean`)}var Zp=`-?(?:0|[1-9][0-9]*)`;function Qp(e){return zf({"~kind":`Integer`},{type:`integer`},e)}function $p(e){return Kf(e,`Integer`)}var em=class extends Error{constructor(e){super(`Invalid Literal value`),Object.defineProperty(this,"cause",{value:{value:e},writable:!1,configurable:!1,enumerable:!1})}};function tm(e){return ra(e)?`bigint`:ia(e)?`boolean`:la(e)?`number`:fa(e)?`string`:(()=>{throw new em(e)})()}function nm(e,t){return zf({"~kind":`Literal`},{type:tm(e),const:e},t)}function rm(e){return ra(e)||ia(e)||la(e)||fa(e)}function im(e){return om(e)&&la(e.const)}function am(e){return om(e)&&fa(e.const)}function om(e){return Kf(e,`Literal`)}function sm(e){return zf({"~kind":`Null`},{type:`null`},e)}function cm(e){return Kf(e,`Null`)}var lm=`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`;function um(e){return zf({"~kind":`Number`},{type:`number`},e)}function dm(e){return Kf(e,`Number`)}function fm(e){return zf({"~kind":`Symbol`},{type:`symbol`},e)}function pm(e){return Kf(e,`Symbol`)}function mm(e){return zf({"~kind":`String`},{type:`string`},e)}function hm(e){return Kf(e,`String`)}function gm(e,t={}){return zf({"~kind":`Union`},{anyOf:e},t)}function _m(e){return Kf(e,`Union`)}function vm(e){return Bf(e,[`~kind`,`anyOf`])}function ym(e){let t=Yg(e);return M(t.length,2)?t[0]:[]}function bm(e){return!0}function xm(e){return Aa(e,(e,t)=>Cm(e)?xm(t):!1,()=>!0)}function Sm(e){return!M(e.length,0)&&xm(e)}function Cm(e){return _m(e)?Sm(e.anyOf):om(e)?bm(e.const):!1}function wm(e){return Sm(e)}function Tm(e){return zf({"~kind":`TemplateLiteral`},{type:`string`,pattern:e},{})}function Em(e,t,n=[]){return Aa(e,(e,r)=>Em(r,t,[...n,`${e}${t}`]),()=>n)}function Dm(e,t){return M(e.length,0)?[`${t}`]:Em(e,t)}function Om(e,t,n=[]){return Aa(t,(t,r)=>Om(e,r,[...n,...km(e,t)]),()=>n)}function km(e,t){return _m(t)?Om(e,t.anyOf):om(t)?Dm(e,t.const):Vu()}function Am(e,t){return Aa(t,(t,n)=>Am(km(e,t),n),()=>e)}function jm(e){return e.map(e=>nm(e))}function Mm(e){return gm(jm(Am([],e)))}function Nm(e){return M(e.length,0)?Vu():M(e.length,1)&&om(e[0])?e[0]:Mm(e)}function Pm(e){let t=ym(e);return M(t.length,0)?mm():wm(t)?Nm(t):Tm(e)}function Fm(e){let t=Pm(e);return g_(t)?mm():t}function Im(e,t){return zf({"~kind":`Record`},{type:`object`,patternProperties:{[e]:t}})}function Lm(e){return Im(Uh,e)}function Rm(e){return I({true:e,false:e})}function zm(e,t={}){let[n,r,i]=[e,e.length,!1];return zf({"~kind":`Tuple`},{type:`array`,additionalItems:i,items:n,minItems:r},t)}function Bm(e){return Kf(e,`Tuple`)}function Vm(e){return Bf(e,[`~kind`,`type`,`items`,`minItems`,`additionalItems`])}function Hm(e){return Bf(e,[`~readonly`])}function Um(e,t){return Vf(Hm(e),{},t)}function Wm(e,t,n,r){return Um(L(e,t,n),r)}function Gm(e,t={}){return Um(e,t)}function Km(e){return Bf(e,[`~optional`])}function qm(e,t){return Vf(Km(e),{},t)}function Jm(e,t,n,r){return qm(L(e,t,n),r)}function Ym(e,t={}){return qm(e,t)}function Xm(e){return e.reduceRight((e,t,n)=>({[n]:t,...e}),{})}function Zm(e){return I(Xm(e.items))}function Qm(e){return Tp(e)||Bm(e)}function $m(e,t){return Gp(e)?!!Gp(t):!1}function eh(e,t){return xp(e)?!!xp(t):!1}function th(e,t){let n=$m(e,t),r=eh(e,t),i=Gm(Ym(yh([e,t])));return n&&r?Wp(bp(i)):n&&!r?Wp(i):!n&&r?bp(i):i}function nh(e,t,n){return n in e?n in t?th(e[n],t[n]):e[n]:n in t?t[n]:vp()}function rh(e,t){return[...new Set([...P(e),...P(t)])].reduce((n,r)=>({...n,[r]:nh(e,t,r)}),{})}function ih(e){return Tp(e)?e.properties:Bm(e)?Xm(e.items):{}}function ah(e,t){return I(rh(ih(e),ih(t)))}function oh(e,t){let n=by(e,t);return M(n,2)?e:M(n,3)||M(n,0)?t:vp()}function sh(e,t){let n=Qm(e),r=Qm(t);return n&&r?ah(e,t):n&&!r?e:!n&&r?t:oh(e,t)}function ch(e,t){return yp(e)||gp(e)?e:Op(e)||yp(t)||gp(t)?t:Op(t)?e:sh(e,t)}function lh(e,t){return _m(e)||_m(t)}function uh(e,t){let n=Sh(e),r=Sh(t);return lh(n,r)?yh([n,r]):ch(n,r)}function dh(e,t,n=[]){return Aa(t,(t,r)=>dh(e,r,[...n,uh(t,e)]),()=>M(n.length,0)?[e]:n)}function fh(e,t,n=[]){return Aa(e,(e,r)=>fh(r,t,[...n,...ph([e],t)]),()=>n)}function ph(e,t=[]){return Aa(e,(e,n)=>_m(e)?ph(n,fh(e.anyOf,t)):ph(n,dh(e,t)),()=>t)}function mh(e,t){return C_(yy({},e,t))?[]:[e]}function hh(e,t,n=[]){return Aa(e,(e,r)=>hh(r,t,[...n,...mh(e,t)]),()=>n)}function gh(e,t){let n=Sh(e);return xh(hh(_m(n)?n.anyOf:[n],t))}function _h(e,t,n){return xh([yh([e,t]),gh(n,e)])}function vh(e,t=[]){return Aa(e,(e,n)=>vh(n,[...t,nm(e)]),()=>xh(t))}function yh(e){return xh(wy(ph(e)))}function bh(e){return Sh(Fm(e))}function xh(e){return Ch(wy(e))}function Sh(e){return Pp(e)?_h(e.if,e.then,e.else):zp(e)?vh(e.enum):Vp(e)?yh(e.allOf):g_(e)?bh(e.pattern):_m(e)?xh(e.anyOf):e}function Ch(e){return M(e.length,1)?e[0]:M(e.length,0)?vp():gm(e)}function wh(e,t){return Rh(vh(e),t)}function Th(e,t){return Im(Vh,t)}function Eh(e,t){return Rh(yh(e),t)}function Dh(e,t){return fa(e)||la(e)?I({[e]:t}):M(e,!1)?I({false:t}):M(e,!0)?I({true:t}):I({})}function Oh(e,t){return Im(Hh,t)}function kh(e,t){return N(e,`pattern`)&&(fa(e.pattern)||e.pattern instanceof RegExp)?Im(e.pattern.toString(),t):Im(Uh,t)}function Ah(e,t){return wm(ym(e))?Rh(bh(e),t):Im(e,t)}function jh(e){return _m(e)?Mh(e.anyOf):[e]}function Mh(e,t=[]){return Aa(e,(e,n)=>Mh(n,[...t,...jh(e)]),()=>t)}function Nh(e){return e.some(e=>hm(e)||dm(e)||$p(e))}function Ph(e,t){return M(Nh(e),!0)?Im(Uh,t):void 0}function Fh(e,t){return e.reduce((e,n)=>om(n)&&(fa(n.const)||la(n.const))?{...e,[n.const]:t}:e,{})}function Ih(e,t){return I(Fh(e,t))}function Lh(e,t){let n=Mh(e),r=Ph(n,t);return qf(r)?r:Ih(n,t)}function Rh(e,t){return gp(e)?Lm(t):Xp(e)?Rm(t):zp(e)?wh(e.enum,t):$p(e)?Th(e,t):Vp(e)?Eh(e.allOf,t):om(e)?Dh(e.const,t):dm(e)?Oh(e,t):_m(e)?Lh(e.anyOf,t):hm(e)?kh(e,t):g_(e)?Ah(e.pattern,t):I({})}function zh(e,t,n){return EC([e])?Vf(Rh(e,t),{},n):Wh(e,t,n)}function Bh(e,t,n,r,i){return zh(L(e,t,n),L(e,t,r),i)}var Vh=`^${Zp}$`,Hh=`^${lm}$`,Uh=`^.*$`;function Wh(e,t,n={}){return Jf(`Record`,[e,t],n)}function Gh(e,t,n={}){return zh(e,t,n)}function Kh(e,t){return Im(e,t)}function qh(e){return M(e,Uh)?mm():M(e,Vh)?Qp():M(e,Hh)?um():Pm(e)}function Jh(e){return P(e.patternProperties)[0]}function Yh(e){return qh(Jh(e))}function Xh(e){return e.patternProperties[Jh(e)]}function Zh(e){return Kf(e,`Record`)}function Qh(e){return zf({"~kind":`Rest`},{type:`rest`,items:e},{})}function $h(e){return Kf(e,`Rest`)}function eg(e){return Kf(e,`This`)}function tg(e){return zf({"~kind":`Undefined`},{type:`undefined`},e)}function ng(e){return Kf(e,`Undefined`)}function rg(e){return Kf(e,`Void`)}function ig(e){return qp()}function ag(e){return mm()}function og(e){return um()}function sg(e){return Qp()}function cg(e){return vp()}function lg(e){return nm(e)}function ug(e){return e}function dg(e){return gm(e[1])}function fg(e){return e.length===3?[...e[0],...e[2]]:e.length===1?[...e[0]]:[]}function pg(e){return[e[0],...e[1]]}function mg(e){return e}function hg(e){return e[1]}function gg(e){return M(e.length,2)}function _g(e,t,n){return gg(e)?t(e[0],e[1]):n()}function vg(e,t){return M(t.indexOf(e),0)?[e,t.slice(e.length)]:[]}function yg(e,t){for(let n=0;n<e.length;n++){let r=vg(e[n],t);if(gg(r))return r}return[]}function bg(e,t){return Array.from({length:t-e+1},(t,n)=>String.fromCharCode(e+n))}var xg=[...bg(97,122),...bg(65,90)],Sg=[`0`,...bg(49,57)],Cg=`//`,wg=`/*`,Tg=`*/`;function Eg(e){let t=e.indexOf(Tg);return M(t,-1)?``:e.slice(t+2)}function Dg(e){let t=e.indexOf(`
11
- `);return M(t,-1)?``:e.slice(t)}function Og(e){return e.replace(/^[ \t\r\f\v]+/,``)}function kg(e){let t=Og(e);return t.startsWith(wg)?kg(Eg(t.slice(2))):t.startsWith(Cg)?kg(Dg(t.slice(2))):t}function Ag(e){let t=e.trimStart();return t.startsWith(wg)?Ag(Eg(t.slice(2))):t.startsWith(Cg)?Ag(Dg(t.slice(2))):t}[...Sg];function jg(e,t){return yg([e],t)}function Mg(e,t){return M(e,``)?[``,t]:e.startsWith(`
12
- `)?jg(e,kg(t)):e.startsWith(` `)?jg(e,t):jg(e,Ag(t))}[...xg,...Sg],[...Sg];function Ng(e){return M(e,``)?[]:[e.slice(0,1),e.slice(1)]}function Pg(e,t){return Aa(e,(e,n)=>t.startsWith(e)?!0:Pg(n,t),()=>!1)}function Fg(e,t,n=``){return _g(Ng(t),(r,i)=>Pg(e,t)?[n,t]:Fg(e,i,`${n}${r}`),()=>[])}function Ig(e,t){return _g(Fg(e,t),(e,t)=>M(e,``)?[]:[e,t],()=>[])}var Lg=(e,t,n=()=>[])=>e.length===2?t(e):n(),Rg=e=>Lg(Mg(`-?(?:0|[1-9][0-9]*)n`,e),([e,t])=>[ig(e),t]),zg=e=>Lg(Mg(`.*`,e),([e,t])=>[ag(e),t]),Bg=e=>Lg(Mg(`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`,e),([e,t])=>[og(e),t]),Vg=e=>Lg(Mg(`-?(?:0|[1-9][0-9]*)`,e),([e,t])=>[sg(e),t]),Hg=e=>Lg(Mg(`(?!)`,e),([e,t])=>[cg(e),t]),Ug=e=>Lg(Ig([`-?(?:0|[1-9][0-9]*)n`,`.*`,`-?(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?`,`-?(?:0|[1-9][0-9]*)`,`(?!)`,`(`,`)`,`$`,`|`],e),([e,t])=>[lg(e),t]),Wg=e=>Lg(Lg(Rg(e),([e,t])=>[e,t],()=>Lg(zg(e),([e,t])=>[e,t],()=>Lg(Bg(e),([e,t])=>[e,t],()=>Lg(Vg(e),([e,t])=>[e,t],()=>Lg(Hg(e),([e,t])=>[e,t],()=>Lg(Gg(e),([e,t])=>[e,t],()=>Lg(Ug(e),([e,t])=>[e,t],()=>[]))))))),([e,t])=>[ug(e),t]),Gg=e=>Lg(Lg(Mg(`(`,e),([e,t])=>Lg(Jg(t),([t,n])=>Lg(Mg(`)`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[dg(e),t]),Kg=e=>Lg(Lg(Lg(qg(e),([e,t])=>Lg(Mg(`|`,t),([t,n])=>Lg(Kg(n),([n,r])=>[[e,t,n],r]))),([e,t])=>[e,t],()=>Lg(Lg(qg(e),([e,t])=>[[e],t]),([e,t])=>[e,t],()=>Lg([[],e],([e,t])=>[e,t],()=>[]))),([e,t])=>[fg(e),t]),qg=e=>Lg(Lg(Wg(e),([e,t])=>Lg(Jg(t),([t,n])=>[[e,t],n])),([e,t])=>[pg(e),t]),Jg=e=>Lg(Lg(Kg(e),([e,t])=>[e,t],()=>Lg(qg(e),([e,t])=>[e,t],()=>[])),([e,t])=>[mg(e),t]),Yg=e=>Lg(Lg(Mg(`^`,e),([e,t])=>Lg(Jg(t),([t,n])=>Lg(Mg(`$`,n),([n,r])=>[[e,t,n],r]))),([e,t])=>[hg(e),t]);function Xg(e){return e.join(`|`)}function Zg(e){return e.slice(1,e.length-1)}function Qg(e,t,n){return l_(t,`${n}${e}`)}function $g(e,t){return l_(e,`${t}${Kp}`)}function e_(e,t){return l_(e,`${t}${Zp}`)}function t_(e,t){return l_(e,`${t}${lm}`)}function n_(e,t){return c_(gm([nm(`false`),nm(`true`)]),e,t)}function r_(e,t){return l_(e,`${t}.*`)}function i_(e,t,n){return l_(t,`${n}${Zg(e)}`)}function a_(e,t,n){return c_(f_(e,{}),t,n)}function o_(e,t,n){return c_(vh(e),t,n)}function s_(e,t,n,r=[]){return Aa(e,(e,i)=>s_(i,t,n,[...r,c_(e,[],``)]),()=>l_(t,`${n}(${Xg(r)})`))}function c_(e,t,n){return zp(e)?o_(e.enum,t,n):$p(e)?e_(t,n):om(e)?Qg(e.const,t,n):Jp(e)?$g(t,n):Xp(e)?n_(t,n):dm(e)?t_(t,n):hm(e)?r_(t,n):g_(e)?i_(e.pattern,t,n):h_(e)?a_(e.parameters[0],t,n):_m(e)?s_(e.anyOf,t,n):_p}function l_(e,t){return Aa(e,(e,n)=>c_(e,n,t),()=>t)}function u_(e){return`^${l_(e,``)}$`}function d_(e){return Tm(u_(e))}function f_(e,t){return EC(e)?Vf(d_(e),{},t):m_(e,t)}function p_(e,t,n,r){return f_(kC(e,t,n),r)}function m_(e,t={}){return Jf(`TemplateLiteral`,[e],t)}function h_(e){return qf(e)&&N(e,`action`)&&M(e.action,`TemplateLiteral`)}function g_(e){return Kf(e,`TemplateLiteral`)}function __(e){return zf({"~kind":`ExtendsUnion`},{inferred:e})}function v_(e){return da(e)&&N(e,`~kind`)&&N(e,`inferred`)&&M(e[`~kind`],`ExtendsUnion`)&&da(e.inferred)}function y_(e){return zf({"~kind":`ExtendsTrue`},{inferred:e})}function b_(e){return da(e)&&N(e,`~kind`)&&N(e,`inferred`)&&M(e[`~kind`],`ExtendsTrue`)&&da(e.inferred)}function x_(){return zf({"~kind":`ExtendsFalse`},{})}function S_(e){return da(e)&&N(e,`~kind`)&&M(e[`~kind`],`ExtendsFalse`)}function C_(e){return v_(e)||b_(e)}function w_(e,t,n){return C_(e)?t(e.inferred):n()}function T_(e,t,n,r){return w_(Uv(e,n,r),r=>y_(wf(wf(e,r),{[t]:n})),()=>x_())}function E_(e,t){return y_(e)}function D_(e,t,n,r,i){return w_(Uv(e,t,n),e=>w_(Uv(e,t,r),e=>y_(e),()=>x_()),()=>w_(Uv(e,t,i),e=>y_(e),()=>x_()))}function O_(e,t,n){return Uv(e,t,vh(n))}function k_(e,t,n){return Aa(n,(n,r)=>w_(Uv(e,t,n),e=>k_(e,t,r),()=>x_()),()=>y_(e))}function A_(e,t,n){return Uv(e,t,bh(n))}function j_(e,t,n){return Aa(n,(n,r)=>w_(Uv(e,t,n),e=>y_(e),()=>j_(e,t,r)),()=>x_())}function M_(e,t,n){return gp(n)?E_(e,t):Pp(n)?D_(e,t,n.if,n.then,n.else):zp(n)?O_(e,t,n.enum):Mp(n)?T_(e,n.name,t,n.extends):Vp(n)?k_(e,t,n.allOf):g_(n)?A_(e,t,n.pattern):_m(n)?j_(e,t,n.anyOf):Op(n)?y_(e):x_()}function N_(e,t,n){return Mp(n)?M_(e,t,n):gp(n)||Op(n)?y_(e):__(e)}function P_(e,t){let n=Up(e),r=Up(t);return n&&r||!n&&r?!0:!(n&&!r)}function F_(e,t,n,r){return rp(r)?P_(t,r)?Uv(e,n,r.items):x_():M_(e,t,r)}function I_(e,t,n){return Jp(n)?y_(e):M_(e,t,n)}function L_(e,t,n){return Xp(n)?y_(e):M_(e,t,n)}function R_(e,t,n,r,i){let a=Mp(r)?t:r,o=Mp(r)?r:t,s=xp(t),c=xp(r);return!s&&c?x_():w_(Uv(e,a,o),e=>V_(e,n,i),()=>x_())}function z_(e,t,n,r){return Aa(r,(r,i)=>R_(e,t,n,r,i),()=>xp(t)?y_(e):x_())}function B_(e,t,n){return Aa(t,(t,r)=>z_(e,t,r,n),()=>y_(e))}function V_(e,t,n){return B_(e,t,n)}function H_(e,t,n){return rg(n)?y_(e):Uv(e,t,n)}function U_(e,t,n,r){return gp(r)||Op(r)?y_(e):op(r)?w_(V_(e,t,r.parameters),e=>H_(e,n,r.instanceType),()=>x_()):x_()}function W_(e,t,n,r,i){return w_(Uv(e,t,i),()=>Uv(e,n,i),()=>Uv(e,r,i))}function G_(e,t,n){return Uv(e,vh(t),n)}function K_(e,t,n,r){return gp(r)||Op(r)?y_(e):lp(r)?w_(V_(e,t,r.parameters),e=>H_(e,n,r.returnType),()=>x_()):x_()}function q_(e,t,n){return $p(n)||dm(n)?y_(e):M_(e,t,n)}function J_(e,t,n){return Uv(e,yh(t),n)}function Y_(e,t,n){return t===n?y_(e):x_()}function X_(e,t,n){return om(n)?Y_(e,t,n.const):Jp(n)?y_(e):M_(e,nm(t),n)}function Z_(e,t,n){return om(n)?Y_(e,t,n.const):Xp(n)?y_(e):M_(e,nm(t),n)}function Q_(e,t,n){return om(n)?Y_(e,t,n.const):dm(n)?y_(e):M_(e,nm(t),n)}function $_(e,t,n){return om(n)?Y_(e,t,n.const):hm(n)?y_(e):M_(e,nm(t),n)}function ev(e,t,n){return ra(t.const)?X_(e,t.const,n):ia(t.const)?Z_(e,t.const,n):la(t.const)?Q_(e,t.const,n):fa(t.const)?$_(e,t.const,n):Vu()}function tv(e,t,n){return Mp(n)?M_(e,t,n):y_(e)}function nv(e,t,n){return cm(n)?y_(e):M_(e,t,n)}function rv(e,t,n){return dm(n)?y_(e):M_(e,t,n)}function iv(e,t,n){return xp(t)?xp(n)?y_(e):x_():y_(e)}function av(e,t,n){return Mp(n)&&yp(n.extends)?x_():w_(Uv(e,t,n),e=>iv(e,t,n),()=>x_())}function ov(e,t){return e.reduce((e,n)=>n in t&&C_(t[n])?{...e,...t[n].inferred}:Vu(),{})}function sv(e,t,n){let r={};for(let i of P(n))r[i]=i in t?av({},t[i],n[i]):xp(n[i])?Mp(n[i])?y_(wf(e,{[n[i].name]:n[i].extends})):y_(e):x_();let i=Fa(r).every(e=>C_(e)),a=i?ov(P(r),r):{};return i?y_(a):x_()}function cv(e,t,n){let r=sv(e,t,n);return C_(r)?y_(wf(e,r.inferred)):x_()}function lv(e,t,n){return cv(e,t,n)}function uv(e,t){return P(t).reduce((n,r)=>({...n,[r]:N(e,r)?_m(n[r])?gm([...n[r].anyOf,t[r]]):gm([e[r],t[r]]):t[r]}),e)}function dv(e,t,n,r){return Aa(t,(t,i)=>w_(Uv({},e[t],n),t=>dv(e,i,n,uv(r,t)),()=>x_()),()=>y_(r))}function fv(e,t,n,r){return dv(t,P(t),r,e)}function pv(e,t,n){return Zh(n)?fv(e,t,Jh(n),Xh(n)):Tp(n)?lv(e,t,n.properties):M_(e,I(t),n)}function mv(e,t){return M(P(t).length,0)?y_(e):x_()}function hv(e,t,n,r,i){return Uv(e,n,i)}function gv(e,t,n,r){return Zh(r)?hv(e,qh(t),n,qh(Jh(r)),Xh(r)):Tp(r)?mv(e,r.properties):gp(r)||Op(r)?y_(e):x_()}function _v(e,t,n){return hm(n)?y_(e):M_(e,t,n)}function vv(e,t,n){return pm(n)?y_(e):M_(e,t,n)}function yv(e,t,n){return Uv(e,bh(t),n)}function bv(e,t){return zf({"~kind":`Inferrable`},{name:e,type:t},{})}function xv(e){return da(e)&&N(e,`~kind`)&&N(e,`name`)&&N(e,`type`)&&M(e[`~kind`],`Inferrable`)&&fa(e.name)&&da(e.type)}function Sv(e){return $h(e)?Mp(e.items)?rp(e.items.extends)?bv(e.items.name,e.items.extends.items):Op(e.items.extends)?bv(e.items.name,e.items.extends):void 0:Vu():void 0}function Cv(e){return Mp(e)?bv(e.name,e.extends):void 0}function wv(e,t,n=[]){return Aa(e,(e,r)=>w_(Uv({},e,t),()=>wv(r,t,[...n,e]),()=>void 0),()=>n)}function Tv(e,t,n,r){let i=wv(n,r);return na(i)?y_(wf(e,{[t]:zm(i)})):x_()}function Ev(e,t,n,r){let i=wv(n,r);return na(i)?y_(wf(e,{[t]:gm(i)})):x_()}function Dv(e){return[...e].reverse()}function Ov(e,t){return t?Dv(e):e}function kv(e){let t=e.length>0?e[0]:void 0;return qf(qf(t)?Sv(t):void 0)}function Av(e,t,n,r,i,a){return w_(Uv(e,n,i),e=>Nv(e,t,r,a),()=>x_())}function jv(e,t,n,r,i){let a=Sv(r);return xv(a)?Tv(e,a.name,Ov(n,t),a.type):Aa(n,(n,a)=>Av(e,t,n,a,r,i),()=>x_())}function Mv(e,t,n,r){return Aa(r,(r,i)=>jv(e,t,n,r,i),()=>M(n.length,0)?y_(e):x_())}function Nv(e,t,n,r){return Mv(e,t,n,r)}function Pv(e,t,n){let r=OC(e,TC([],[]),n),i=kv(r);return Nv(e,i,Ov(t,i),Ov(r,i))}function Fv(e,t,n){let r=Cv(n);return xv(r)?Ev(e,r.name,t,r.type):Aa(t,(t,r)=>w_(Uv(e,t,n),e=>Fv(e,r,n),()=>x_()),()=>y_(e))}function Iv(e,t,n){let r=OC(e,TC([],[]),t);return Bm(n)?Pv(e,r,n.items):rp(n)?Fv(e,r,n.items):M_(e,zm(r),n)}function Lv(e,t,n){return rg(n)||ng(n)?y_(e):M_(e,t,n)}function Rv(e,t,n){return Aa(n,(n,r)=>w_(Uv(e,t,n),e=>y_(e),()=>Rv(e,t,r)),()=>x_())}function zv(e,t,n){return Aa(t,(t,r)=>w_(Rv(e,t,n),e=>zv(e,r,n),()=>x_()),()=>y_(e))}function Bv(e,t,n){let r=Cv(n);return xv(r)?Ev(e,r.name,t,r.type):_m(n)?zv(e,t,n.anyOf):zv(e,t,[n])}function Vv(e,t,n){return Mp(n)?M_(e,t,n):gp(n)||Op(n)?y_(e):x_()}function Hv(e,t,n){return rg(n)?y_(e):M_(e,t,n)}function Uv(e,t,n){return gp(t)?N_(e,t,n):rp(t)?F_(e,t,t.items,n):Jp(t)?I_(e,t,n):Xp(t)?L_(e,t,n):op(t)?U_(e,t.parameters,t.instanceType,n):Pp(t)?W_(e,t.if,t.then,t.else,n):zp(t)?G_(e,t.enum,n):lp(t)?K_(e,t.parameters,t.returnType,n):$p(t)?q_(e,t,n):Vp(t)?J_(e,t.allOf,n):om(t)?ev(e,t,n):yp(t)?tv(e,t,n):cm(t)?nv(e,t,n):dm(t)?rv(e,t,n):Tp(t)?pv(e,t.properties,n):Zh(t)?gv(e,Jh(t),Xh(t),n):hm(t)?_v(e,t,n):pm(t)?vv(e,t,n):g_(t)?yv(e,t.pattern,n):Bm(t)?Iv(e,t.items,n):ng(t)?Lv(e,t,n):_m(t)?Bv(e,t.anyOf,n):Op(t)?Vv(e,t,n):rg(t)?Hv(e,t,n):x_()}function Wv(e,t){return yh([...e,I(t)])}function Gv(e,t,n){return EC(e)?Vf(Wv(e,t),{},n):qv(e,t,n)}function Kv(e,t,n,r,i){return Gv(kC(e,t,n),DC(e,t,r),i)}function qv(e,t,n={}){return Jf(`Interface`,[e,t],n)}function Jv(e){return qf(e)&&N(e,`action`)&&M(e.action,`Interface`)}function Yv(e,t,n){return e.includes(n)?!0:Qv([...e,n],t,t[n])}function Xv(e,t,n){return Zv(e,t,wp(n))}function Zv(e,t,n){return Aa(n,(n,r)=>Qv(e,t,n)?!0:Zv(e,t,r),()=>!1)}function Qv(e,t,n){return fp(n)?Yv(e,t,n.$ref):rp(n)?Qv(e,t,n.items):op(n)?Zv(e,t,[...n.parameters,n.instanceType]):lp(n)?Zv(e,t,[...n.parameters,n.returnType]):Jv(n)?Xv(e,t,n.parameters[1]):Vp(n)?Zv(e,t,n.allOf):Tp(n)?Xv(e,t,n.properties):_m(n)?Zv(e,t,n.anyOf):Bm(n)?Zv(e,t,n.items):Zh(n)?Qv(e,t,Xh(n)):!1}function $v(e,t,n){return Qv(e,t,n)}function ey(e,t){return t.reduce((t,n)=>$v([n],e,e[n])?[...t,n]:t,[])}function ty(e){return ey(e,Cp(e))}function ny(e,t,n){return n.includes(t)?n:t in e?ay(e,e[t],[...n,t]):Vu()}function ry(e,t,n){return iy(e,wp(t),n)}function iy(e,t,n){return t.reduce((t,n)=>ay(e,n,t),n)}function ay(e,t,n){return fp(t)?ny(e,t.$ref,n):rp(t)?ay(e,t.items,n):op(t)?iy(e,[...t.parameters,t.instanceType],n):lp(t)?iy(e,[...t.parameters,t.returnType],n):Jv(t)?ry(e,t.parameters[1],n):Vp(t)?iy(e,t.allOf,n):Tp(t)?ry(e,t.properties,n):_m(t)?iy(e,t.anyOf,n):Bm(t)?iy(e,t.items,n):Zh(t)?ay(e,Xh(t),n):n}function oy(e,t,n){return ay(e,n,[t])}function sy(e){return hp()}function cy(e){return P(e).reduce((t,n)=>({...t,[n]:uy(e[n])}),{})}function ly(e){return e.reduce((e,t)=>[...e,uy(t)],[])}function uy(e){return fp(e)?sy(e.$ref):rp(e)?np(uy(e.items),ip(e)):op(e)?ap(ly(e.parameters),uy(e.instanceType)):lp(e)?cp(ly(e.parameters),uy(e.returnType)):Vp(e)?Bp(ly(e.allOf)):Tp(e)?I(cy(e.properties)):Zh(e)?Gh(Yh(e),uy(Xh(e))):_m(e)?gm(ly(e.anyOf)):Bm(e)?zm(ly(e.items)):e}function dy(e,t){return t in e?uy(e[t]):Dp()}function fy(e){return dy(e.$defs,e.$ref)}function py(e,t,n){let r=kC(e,TC([],[]),t),i=DC({},TC([],[]),n);return yh([...r,I(i)])}function my(e,t){return P(e).filter(e=>t.includes(e)).reduce((t,n)=>{let r=e[n],i=Jv(r)?py(e,r.parameters[0],r.parameters[1]):r;return{...t,[n]:i}},{})}function hy(e,t,n){return kp(my(e,oy(e,t,n)),t)}function gy(e,t){return t in e?fp(e[t])?gy(e,e[t].$ref):e[t]:vp()}function _y(e,t){return gy(e,t)}function vy(e){return Ap(e)?fy(e):jp(e)?Dp():e}function yy(e,t,n){return Uv(e,vy(t),vy(n))}function by(e,t){let n=[yy({},e,t),yy({},t,e)];return C_(n[0])&&C_(n[1])?0:C_(n[0])&&S_(n[1])?2:S_(n[0])&&C_(n[1])?3:1}function xy(e,t,n=[],r=t){return Aa(t,(t,i)=>{let a=by(e,t);return M(a,2)||M(a,0)?r:M(a,1)?xy(e,i,[...n,t],r):xy(e,i,n,r)},()=>[...n,e])}function Sy(e,t,n){let r=Sh(e);return gp(r)||Op(r)?[r]:yp(r)?Cy(t,n):Tp(r)?Cy(t,[...n,r]):Cy(t,xy(r,n))}function Cy(e,t=[]){return Aa(e,(e,n)=>Sy(e,n,t),()=>t)}function wy(e){return Mh(Cy(e))}function Ty(e,t){return Vf(Sh(e),{},t)}function Ey(e,t,n,r){return Ty(L(e,t,n),r)}function Dy(e,t=[]){return Yf(e)&&M(e.action,`Conditional`)?fp(e.parameters[0])?Dy(e.parameters[2],Dy(e.parameters[3],[...t,e.parameters[0].$ref])):Dy(e.parameters[2],Dy(e.parameters[3],t)):Yf(e)&&M(e.action,`Mapped`)&&Yf(e.parameters[1])&&M(e.parameters[1].action,`KeyOf`)&&fp(e.parameters[1].parameters[0])?[...t,e.parameters[1].parameters[0].$ref]:t}function Oy(e,t){return e.reduce((e,n)=>[...e,t.includes(n.name)],[])}function ky(e,t,n=[]){return Aa(e,(e,r)=>Aa(t,(t,i)=>ky(r,i,[...n,[t,e]]),()=>n),()=>n)}function Ay(e){return g_(e)?bh(e.pattern):zp(e)?vh(e.enum):e}function jy(e){let t=Ay(e);return _m(t)?[...t.anyOf]:[t]}function My(e,t){return e.reduce((e,n)=>[...e,[...n,t]],[])}function Ny(e,t){return t.reduce((t,n)=>[...t,...My(e,n)],[])}function Py(e){return e.reduce((e,t)=>M(t[0],!0)?Ny(e,jy(t[1])):Ny(e,[t[1]]),[[]])}function Fy(e,t,n){let r=ky(t,Oy(e,Dy(n)));return Yf(n)&&M(n.action,`Conditional`)||Yf(n)&&M(n.action,`Mapped`)?Py(r):[t]}function Iy(){return[`(not-resolvable)`,vp()]}function Ly(){return[`(not-generic)`,vp()]}function Ry(e,t,n){return[e,pp(t,n)]}function zy(e,t,n){return t in e?By(e,t,e[t],n):Iy()}function By(e,t,n,r){return mp(n)?Ry(t,n.parameters,n.expression):fp(n)?zy(e,n.$ref,r):Ly()}function Vy(e,t,n){return By(e,`(anonymous)`,t,n)}function Hy(e,t,n){if(Mp(t)||ab(t)||C_(yy({},t,n)))return;let r={parameter:e,expect:n,actual:t};throw Error(`Argument for parameter ${e} does not satisfy constraint`,{cause:r})}function Uy(e,t,n,r,i){let a=L(e,t,i);return Hy(n,a,r),wf(e,{[n]:a})}function Wy(e,t,n,r,i){let a=L(e,t,n.extends),o=L(e,t,n.equals);return Aa(i,(i,o)=>Gy(Uy(e,t,n.name,a,i),t,r,o),()=>Gy(Uy(e,t,n.name,a,o),t,r,[]))}function Gy(e,t,n,r){return Aa(n,(n,i)=>Wy(e,t,n,i,r),()=>e)}function Ky(e,t,n,r){return Gy(e,t,n,r)}var qy=0,Jy=0;function Yy(){if(!ga(Jy,Ya().maxInstantiationCount))throw Error(`Type instantiation is excessively deep and possibly infinite`)}function Xy(){Yy(),Jy++,qy++}function Zy(){qy--,M(qy,0)&&(Jy=0)}function Qy(e){return ha(e.callstack.length,0)?e.callstack[e.callstack.length-1]:``}function $y(e,t){return M(Qy(e),t)}function eb(e,t,n,r,i,a){Xy();try{let o=Ky(e,t,r,a),s=L(o,TC([...t.callstack,n.$ref],t.visited),i);return L(o,TC([],[]),s)}finally{Zy()}}function tb(e,t,n,r,i,a){return a.reduce((a,o)=>{let s=eb(e,t,n,r,i,o);return[...a,s]},[])}function nb(e,t,n,r,i,a){let o=tb(e,t,n,r,i,Fy(r,a,i));return M(o.length,1)?o[0]:xh(o)}function rb(e,t,n,r){let i=kC(e,t,r),a=Vy(e,n,r),o=a[0],s=a[1];return mp(s)?$y(t,o)?ib(dp(o),i):nb(e,t,dp(o),s.parameters,s.expression,i):ib(n,i)}function ib(e,t){return zf({"~kind":`Call`},{type:`call`,target:e,arguments:t},{})}function ab(e){return Kf(e,`Call`)}function ob(e){return Bf(e,[`~immutable`])}function sb(e,t){return Vf(ob(e),{},t)}function cb(e,t,n,r){return sb(L(e,t,n),r)}function lb(e,t){return e(t)}function ub(e,t){return fa(t)?nm(lb(e,t)):nm(t)}function db(e,t){return pb(e,bh(t))}function fb(e,t){return gm(t.map(t=>pb(e,t)))}function pb(e,t){return om(t)?ub(e,t.const):g_(t)?db(e,t.pattern):_m(t)?fb(e,t.anyOf):t}function mb(e,t={}){return Jf(`Capitalize`,[e],t)}function hb(e,t={}){return Jf(`Lowercase`,[e],t)}function gb(e,t={}){return Jf(`Uncapitalize`,[e],t)}function _b(e,t={}){return Jf(`Uppercase`,[e],t)}var vb=e=>e[0].toUpperCase()+e.slice(1),yb=e=>e.toLowerCase(),bb=e=>e[0].toLowerCase()+e.slice(1),xb=e=>e.toUpperCase();function Sb(e,t){return EC([e])?Vf(pb(vb,e),{},t):mb(e,t)}function Cb(e,t){return EC([e])?Vf(pb(yb,e),{},t):hb(e,t)}function wb(e,t){return EC([e])?Vf(pb(bb,e),{},t):gb(e,t)}function Tb(e,t){return EC([e])?Vf(pb(xb,e),{},t):_b(e,t)}function Eb(e,t,n,r){return Sb(L(e,t,n),r)}function Db(e,t,n,r){return Cb(L(e,t,n),r)}function Ob(e,t,n,r){return wb(L(e,t,n),r)}function kb(e,t,n,r){return Tb(L(e,t,n),r)}function Ab(e,t,n,r,i={}){return Jf(`Conditional`,[e,t,n,r],i)}function jb(e,t,n,r,i,a){let o=yy(e,n,r);return v_(o)?gm([L(o.inferred,t,i),L(e,t,a)]):b_(o)?L(o.inferred,t,i):L(e,t,a)}function Mb(e,t,n,r,i,a,o){return EC([n,r])?Vf(jb(e,t,n,r,i,a),{},o):Ab(n,r,i,a,o)}function Nb(e,t,n,r,i,a,o){return Mb(e,t,L(e,t,n),L(e,t,r),i,a,o)}function Pb(e,t={}){return Jf(`ConstructorParameters`,[e],t)}function Fb(e){let t=op(e)?e.parameters:[];return zm(OC({},TC([],[]),t))}function Ib(e,t){return EC([e])?Vf(Fb(e),{},t):Pb(e,t)}function Lb(e,t,n,r){return Ib(L(e,t,n),r)}function Rb(e,t,n={}){return Jf(`Exclude`,[e,t],n)}function zb(e,t,n){return EC([e,t])?Vf(gh(e,t),{},n):Rb(e,t,n)}function Bb(e,t,n,r,i){return zb(L(e,t,n),L(e,t,r),i)}function Vb(e,t,n={}){return Jf(`Extract`,[e,t],n)}function Hb(e,t){return C_(yy({},e,t))?[e]:[]}function Ub(e,t,n=[]){return Aa(e,(e,r)=>Ub(r,t,[...n,...Hb(e,t)]),()=>n)}function Wb(e,t){let n=Sh(e);return xh(Ub(_m(n)?n.anyOf:[n],t))}function Gb(e,t,n){return EC([e,t])?Vf(Wb(e,t),{},n):Vb(e,t,n)}function Kb(e,t,n,r,i){return Gb(L(e,t,n),L(e,t,r),i)}function qb(e,t,n={}){return Jf(`Index`,[e,t],n)}function Jb(e,t){return rx(_y(e,t))}function Yb(e,t,n){return rx(_h(e,t,n))}function Xb(e,t){let n=P(e).filter(e=>!N(t,e)),r=P(t).filter(t=>!N(e,t)),i=P(e).filter(e=>N(t,e)),a=n.reduce((t,n)=>({...t,[n]:e[n]}),{}),o=r.reduce((e,n)=>({...e,[n]:t[n]}),{}),s=i.reduce((n,r)=>({...n,[r]:yh([e[r],t[r]])}),{});return wf(wf(a,o),s)}function Zb(e){return e.reduce((e,t)=>Xb(e,rx(t)),{})}function Qb(e){return e}function $b(e){return rx(Zm(zm(e)))}function ex(e,t){return P(e).filter(e=>e in t).reduce((n,r)=>({...n,[r]:xh([e[r],t[r]])}),{})}function tx(e,t){return Aa(e,(e,n)=>tx(n,ex(t,rx(e))),()=>t)}function nx(e){return Aa(e,(e,t)=>tx(t,rx(e)),()=>Vu())}function rx(e){return Ap(e)?Jb(e.$defs,e.$ref):Pp(e)?Yb(e.if,e.then,e.else):Vp(e)?Zb(e.allOf):_m(e)?nx(e.anyOf):Bm(e)?$b(e.items):Tp(e)?Qb(e.properties):{}}function ix(e){return I(rx(e))}var ax=RegExp(`^(?:0|[1-9][0-9]*)$`);function ox(e){let t=`${e}`;return ax.test(t)?parseInt(t):e}function sx(e){return nm(ox(e))}function cx(e){return e.map(e=>lx(e))}function lx(e){return Vp(e)?Bp(cx(e.allOf)):_m(e)?gm(cx(e.anyOf)):om(e)?sx(e.const):e}function ux(e,t){return C_(yy({},lx(t),um()))?e:om(t)&&M(t.const,`length`)?um():vp()}function dx(e,t){return vx(_y(e,t))}function fx(e,t,n){return vx(_h(e,t,n))}function px(e){return vx(vh(e))}function mx(e){return vx(yh(e))}function hx(e){return[`${e}`]}function gx(e){return vx(bh(e))}function _x(e){return e.reduce((e,t)=>[...e,...vx(t)],[])}function vx(e){return Ap(e)?dx(e.$defs,e.$ref):Pp(e)?fx(e.if,e.then,e.else):zp(e)?px(e.enum):Vp(e)?mx(e.allOf):om(e)?hx(e.const):g_(e)?gx(e.pattern):_m(e)?_x(e.anyOf):[]}function yx(e){return vx(e)}function bx(e,t){return t.map(t=>xx(e,t))}function xx(e,t){return rp(t)?np(xx(e,t.items)):op(t)?ap(bx(e,t.parameters),xx(e,t.instanceType)):lp(t)?cp(bx(e,t.parameters),xx(e,t.returnType)):Bm(t)?zm(bx(e,t.items)):_m(t)?gm(bx(e,t.anyOf)):Vp(t)?Bp(bx(e,t.allOf)):eg(t)?I(e):t}function Sx(e,t){return xx(e,t)}function Cx(e,t){return Sx(e,t in e?e[t]:vp())}function wx(e,t){return t.reduce((t,n)=>[...t,Cx(e,n)],[])}function Tx(e,t){return xh(wx(e,yx(t)))}var Ex=new RegExp(Vh);function Dx(e){return e.filter(e=>Ex.test(e))}function Ox(e){return xh(wx(e,Dx(Cp(e))))}function kx(e,t){return dm(t)?Ox(e):Tx(e,t)}function Ax(e){return nm(ox(e))}function jx(e){return e.map(e=>Mx(e))}function Mx(e){return Vp(e)?Bp(jx(e.allOf)):_m(e)?gm(jx(e.anyOf)):om(e)?Ax(e.const):e}function Nx(e,t){return e.reduceRight((e,n,r)=>C_(yy({},nm(r),t))?[n,...e]:e,[])}function Px(e,t){return Ch(Nx(e,Mx(t)))}function Fx(e){return Ch(e)}function Ix(e,t){return om(t)&&M(t.const,`length`)?nm(e.length):dm(t)||$p(t)?Fx(e):Px(e,t)}function Lx(e,t){return rp(e)?ux(e.items,t):Tp(e)?kx(e.properties,t):Bm(e)?Ix(e.items,t):vp()}function Rx(e){return Ap(e)||Pp(e)||Vp(e)||_m(e)?ix(e):e}function zx(e,t,n){return EC([e,t])?Vf(Lx(Rx(e),t),{},n):qb(e,t,n)}function Bx(e,t,n,r,i){return zx(L(e,t,n),L(e,t,r),i)}function Vx(e,t={}){return Jf(`InstanceType`,[e],t)}function Hx(e){return op(e)?e.instanceType:vp()}function Ux(e,t){return EC([e])?Vf(Hx(e),{},t):Vx(e,t)}function Wx(e,t,n,r={}){return Ux(L(e,t,n),r)}function Gx(e,t={}){return Jf(`KeyOf`,[e],t)}function Kx(){return gm([um(),mm(),fm()])}function qx(e){return um()}function Jx(e){return e.reduce((e,t)=>rm(t)?[...e,nm(ox(t))]:Vu(),[])}function Yx(e){return Ch(Jx(P(e)))}function Xx(e){return Yh(e)}function Zx(e){return Ch(e.map((e,t)=>nm(t)))}function Qx(e){return gp(e)?Kx():rp(e)?qx(e.items):Tp(e)?Yx(e.properties):Zh(e)?Xx(e):Bm(e)?Zx(e.items):vp()}function $x(e){return Ap(e)||Pp(e)||Vp(e)||_m(e)?ix(e):e}function eS(e,t){return EC([e])?Vf(Qx($x(e)),{},t):Gx(e,t)}function tS(e,t,n,r){return eS(L(e,t,n),r)}function nS(e,t,n,r,i={}){return Jf(`Mapped`,[e,t,n,r],i)}function rS(e){return sS(bh(e))}function iS(e){return e.reduce((e,t)=>[...e,...sS(t)],[])}function aS(e){return sS(vh(e))}function oS(e){return la(e)?[nm(`${e}`)]:[nm(e)]}function sS(e){return zp(e)?aS(e.enum):om(e)?oS(e.const):g_(e)?rS(e.pattern):_m(e)?iS(e.anyOf):[e]}function cS(e){return sS(e)}function lS(e){return g_(e)?bh(e.pattern):e}function uS(e,t,n,r,i,a){let o=wf(e,{[n.name]:r}),s=lS(L(o,t,i)),c=L(o,t,a);return im(s)||am(s)?{[s.const]:c}:{}}function dS(e,t,n,r,i,a){return r.reduce((r,o)=>[...r,uS(e,t,n,o,i,a)],[])}function fS(e){return e.reduce((e,t)=>[...e,I(t)],[])}function pS(e,t,n,r,i,a){return yh(fS(dS(e,t,n,cS(r),i,a)))}function mS(e,t,n,r,i,a,o){return EC([r])?Vf(pS(e,t,n,r,i,a),{},o):nS(n,r,i,a,o)}function hS(e,t,n,r,i,a,o){return mS(e,t,n,L(e,t,r),i,a,o)}function gS(e,t,n){let r=wf(e,t);return P(t).filter(e=>n.includes(e)).reduce((e,n)=>({...e,[n]:hy(r,n,t[n])}),{})}function _S(e,t,n){let r=wf(e,t);return P(t).filter(e=>!n.includes(e)).reduce((e,n)=>({...e,[n]:L(r,TC([],[]),t[n])}),{})}function vS(e,t,n){let r=ty(t),i=gS(e,t,r),a=_S(e,t,r);return Vf({...i,...a},{},n)}function yS(e,t,n,r){return vS(e,n,r)}function bS(e,t={}){return Jf(`NonNullable`,[e],t)}function xS(e){return zb(e,gm([sm(),tg()]),{})}function SS(e,t){return EC([e])?Vf(xS(e),{},t):bS(e,t)}function CS(e,t,n,r){return SS(L(e,t,n),r)}function wS(e,t,n={}){return Jf(`Omit`,[e,t],n)}function TS(e){let t=ix(e);return Tp(t)?t.properties:Vu()}function ES(e,t){return P(e).reduce((n,r)=>t.includes(r)?n:{...n,[r]:e[r]},{})}function DS(e,t){return I(ES(TS(e),yx(t)))}function OS(e,t,n){return EC([e,t])?Vf(DS(e,t),{},n):wS(e,t,n)}function kS(e,t,n,r,i){return OS(L(e,t,n),L(e,t,r),i)}function AS(e,t={}){return Jf(`Parameters`,[e],t)}function jS(e){let t=lp(e)?e.parameters:[];return zm(OC({},TC([],[]),t))}function MS(e,t){return EC([e])?Vf(jS(e),{},t):AS(e,t)}function NS(e,t,n,r){return MS(L(e,t,n),r)}function PS(e,t={}){return Jf(`Partial`,[e],t)}function FS(e,t){let n=BS(_y(e,t));return kp(wf(e,{[t]:n}),t)}function IS(e,t,n){return BS(_h(e,t,n))}function LS(e){return BS(yh(e))}function RS(e){return gm(e.map(e=>BS(e)))}function zS(e){return I(P(e).reduce((t,n)=>({...t,[n]:bp(e[n])}),{}))}function BS(e){return Ap(e)?FS(e.$defs,e.$ref):Pp(e)?IS(e.if,e.then,e.else):Vp(e)?LS(e.allOf):_m(e)?RS(e.anyOf):Tp(e)?zS(e.properties):I({})}function VS(e,t){return EC([e])?Vf(BS(e),{},t):PS(e,t)}function HS(e,t,n,r){return VS(L(e,t,n),r)}function US(e,t,n={}){return Jf(`Pick`,[e,t],n)}function WS(e,t){return P(e).reduce((n,r)=>t.includes(r)?wf(n,{[r]:e[r]}):n,{})}function GS(e,t){return I(WS(TS(e),yx(t)))}function KS(e,t,n){return EC([e,t])?Vf(GS(e,t),{},n):US(e,t,n)}function qS(e,t,n,r,i){return KS(L(e,t,n),L(e,t,r),i)}function JS(e,t={}){return Jf(`ReadonlyObject`,[e],t)}function YS(e){return LC(np(e))}function XS(e,t){let n=nC(_y(e,t));return kp(wf(e,{[t]:n}),t)}function ZS(e,t,n){return nC(_h(e,t,n))}function QS(e){return nC(yh(e))}function $S(e){return I(P(e).reduce((t,n)=>({...t,[n]:Wp(e[n])}),{}))}function eC(e){return LC(zm(e))}function tC(e){return gm(e.map(e=>nC(e)))}function nC(e){return rp(e)?YS(e.items):Ap(e)?XS(e.$defs,e.$ref):Pp(e)?ZS(e.if,e.then,e.else):Vp(e)?QS(e.allOf):Tp(e)?$S(e.properties):Bm(e)?eC(e.items):_m(e)?tC(e.anyOf):e}function rC(e,t){return EC([e])?Vf(nC(e),{},t):JS(e)}function iC(e,t,n,r){return rC(L(e,t,n),r)}function aC(e,t,n,r){return t.visited.includes(r)?n:r in e?L(e,TC(t.callstack,[...t.visited,r]),e[r]):n}function oC(e,t){let n=dC(_y(e,t));return kp(wf(e,{[t]:n}),t)}function sC(e,t,n){return dC(_h(e,t,n))}function cC(e){return dC(yh(e))}function lC(e){return gm(e.map(e=>dC(e)))}function uC(e){return I(P(e).reduce((t,n)=>({...t,[n]:Ym(e[n])}),{}))}function dC(e){return Ap(e)?oC(e.$defs,e.$ref):Pp(e)?sC(e.if,e.then,e.else):Vp(e)?cC(e.allOf):_m(e)?lC(e.anyOf):Tp(e)?uC(e.properties):I({})}function fC(e,t={}){return Jf(`Required`,[e],t)}function pC(e,t){return EC([e])?Vf(dC(e),{},t):fC(e,t)}function mC(e,t,n,r){return pC(L(e,t,n),r)}function hC(e,t={}){return Jf(`ReturnType`,[e],t)}function gC(e){return lp(e)?e.returnType:vp()}function _C(e,t){return EC([e])?Vf(gC(e),{},t):hC(e,t)}function vC(e,t,n,r={}){return _C(L(e,t,n),r)}function yC(e,t){return Jf(`With`,[e,t],{})}function bC(e,t){return xC(e,t)}function xC(e,t){return EC([e])?Vf(e,{},t):yC(e,t)}function SC(e,t,n,r){return xC(L(e,t,n),r)}function CC(e){return $h(e)?Bm(e.items)?wC(e.items.items):Mp(e.items)||fp(e.items)?[e]:[vp()]:[e]}function wC(e){return e.reduce((e,t)=>[...e,...CC(t)],[])}function TC(e,t){return{callstack:e,visited:t}}function EC(e){return Aa(e,(e,t)=>!fp(e)&&EC(t),()=>!0)}function DC(e,t,n){return P(n).reduce((r,i)=>({...r,[i]:L(e,t,n[i])}),{})}function OC(e,t,n){return wC(kC(e,t,n))}function kC(e,t,n){return n.map(n=>L(e,t,n))}function AC(e,t){let n=xp(e)?ep(t,{}):t,r=Gp(e)?Zf(n,{}):n;return Up(e)?FC(r,{}):r}function jC(e,t,n,r,i){return M(n,`AddImmutable`)?IC(e,t,r[0],i):M(n,`RemoveImmutable`)?cb(e,t,r[0],i):M(n,`AddReadonly`)?Qf(e,t,r[0],i):M(n,`RemoveReadonly`)?Wm(e,t,r[0],i):M(n,`AddOptional`)?tp(e,t,r[0],i):M(n,`RemoveOptional`)?Jm(e,t,r[0],i):M(n,`Capitalize`)?Eb(e,t,r[0],i):M(n,`Conditional`)?Nb(e,t,r[0],r[1],r[2],r[3],i):M(n,`ConstructorParameters`)?Lb(e,t,r[0],i):M(n,`Evaluate`)?Ey(e,t,r[0],i):M(n,`Exclude`)?Bb(e,t,r[0],r[1],i):M(n,`Extract`)?Kb(e,t,r[0],r[1],i):M(n,`Index`)?Bx(e,t,r[0],r[1],i):M(n,`InstanceType`)?Wx(e,t,r[0],i):M(n,`Interface`)?Kv(e,t,r[0],r[1],i):M(n,`KeyOf`)?tS(e,t,r[0],i):M(n,`Lowercase`)?Db(e,t,r[0],i):M(n,`Mapped`)?hS(e,t,r[0],r[1],r[2],r[3],i):M(n,`Module`)?yS(e,t,r[0],i):M(n,`NonNullable`)?CS(e,t,r[0],i):M(n,`Pick`)?qS(e,t,r[0],r[1],i):M(n,`Parameters`)?NS(e,t,r[0],i):M(n,`Partial`)?HS(e,t,r[0],i):M(n,`Omit`)?kS(e,t,r[0],r[1],i):M(n,`ReadonlyObject`)?iC(e,t,r[0],i):M(n,`Record`)?Bh(e,t,r[0],r[1],i):M(n,`Required`)?mC(e,t,r[0],i):M(n,`ReturnType`)?vC(e,t,r[0],i):M(n,`TemplateLiteral`)?p_(e,t,r[0],i):M(n,`Uncapitalize`)?Ob(e,t,r[0],i):M(n,`Uppercase`)?kb(e,t,r[0],i):M(n,`With`)?SC(e,t,r[0],r[1]):Jf(n,r,i)}function MC(e,t,n){return AC(n,fp(n)?aC(e,t,n,n.$ref):rp(n)?np(L(e,t,n.items),ip(n)):ab(n)?rb(e,t,n.target,n.arguments):op(n)?ap(kC(e,t,n.parameters),L(e,t,n.instanceType),sp(n)):lp(n)?cp(kC(e,t,n.parameters),L(e,t,n.returnType),up(n)):Pp(n)?Np(L(e,t,n.if),L(e,t,n.then),L(e,t,n.else),Fp(n)):Vp(n)?Bp(kC(e,t,n.allOf),Hp(n)):Tp(n)?I(DC(e,t,n.properties),Ep(n)):Zh(n)?Kh(Jh(n),L(e,t,Xh(n))):$h(n)?Qh(L(e,t,n.items)):Bm(n)?zm(OC(e,t,n.items),Vm(n)):_m(n)?gm(kC(e,t,n.anyOf),vm(n)):n)}function L(e,t,n){return Yf(n)?jC(e,t,n.action,n.parameters,n.options):MC(e,t,n)}function NC(e,t){return L(e,TC([],[]),t)}function PC(e){return Vf(e,{"~immutable":!0},{})}function FC(e,t){return Vf(PC(e),{},t)}function IC(e,t,n,r){return FC(L(e,t,n),r)}function LC(e,t={}){return FC(e,t)}function RC(e,t={}){return Ty(e,t)}function zC(e,t){let n=by(e,t);return M(n,3)?1:+!!M(n,1)}function BC(e,t,n=[]){return Aa(t,(r,i)=>M(zC(e,r),1)?BC(e,i,[...n,r]):[...n,e,...t],()=>[...n,e])}function VC(e,t=[]){return Aa(e,(e,n)=>VC(n,BC(e,t)),()=>t)}function HC(e){return VC(e)}function UC(e,t,n){return na(n)?n.map(n=>ew(e,t.items,n)):n}function WC(e,t,n){return ew({...e,...t.$defs},dp(t.$ref),n)}function GC(e,t){let n=N(t,`unevaluatedProperties`)?{additionalProperties:t.unevaluatedProperties}:{},r=RC(NC(e,t));return Tp(r)?bC(r,n):r}function KC(e,t,n){return ew(e,GC(e,t),n)}function qC(e){return N(e,`additionalProperties`)?e.additionalProperties:void 0}function JC(e,t,n){if(!da(n)||na(n))return n;let r=qC(t);for(let i of P(n))N(t.properties,i)?n[i]=ew(e,t.properties[i],n[i]):ia(r)&&M(r,!0)||qf(r)&&Wf(e,r,n[i])?n[i]=ew(e,r,n[i]):delete n[i];return n}function YC(e,t,n){if(!da(n))return n;let r=qC(t),[i,a]=[new RegExp(Jh(t)),Xh(t)];for(let t of P(n))i.test(t)?n[t]=ew(e,a,n[t]):ia(r)&&M(r,!0)||qf(r)&&Wf(e,r,n[t])?n[t]=ew(e,r,n[t]):delete n[t];return n}function XC(e,t,n){return N(e,t.$ref)?ew(e,e[t.$ref],n):n}function ZC(e,t,n){if(!na(n))return n;let r=Math.min(n.length,t.items.length);for(let i=0;i<r;i++)n[i]=ew(e,t.items[i],n[i]);return ha(n.length,r)?n.slice(0,r):n}function QC(e){return If(e)}function $C(e,t,n){for(let r of t.anyOf){let t=ew(e,r,QC(n));if(Wf(e,r,t))return t}return n}function ew(e,t,n){return rp(t)?UC(e,t,n):Ap(t)?WC(e,t,n):Vp(t)?KC(e,t,n):Tp(t)?JC(e,t,n):Zh(t)?YC(e,t,n):fp(t)?XC(e,t,n):Bm(t)?ZC(e,t,n):_m(t)?$C(e,t,n):n}function tw(e,t){for(let n of qa.Keys(e))qa.HasPropertyKey(t,n)||(t[n]=e[n]);return t}function nw(e){let t={};for(let n of qa.Keys(e))t[n]=aw(e[n]);return t}function rw(e){return iw(HC(e))}function iw(e){return e.map(e=>aw(e))}function aw(e){return tw(e,rp(e)?np(aw(e.items),ip(e)):Vp(e)?Bp(iw(e.allOf)):_m(e)?gm(rw(e.anyOf)):Tp(e)?I(nw(e.properties)):Zh(e)?Gh(Yh(e),aw(Xh(e))):Bm(e)?zm(iw(e.items)):e)}function ow(e){return aw(e)}function sw(...e){let[t,n,r]=zi(e,{3:(e,t,n)=>[e,t,n],2:(e,t)=>[{},e,t]});return ew(t,Ya().unionPrioritySort?ow(n):n,r)}BigInt(2**53-1),BigInt(-(2**53-1));function cw(e,t,n){if(!na(n))return n;for(let r=0;r<n.length;r++)n[r]=_w(e,t.items,n[r]);return n}function lw(e,t,n){return _w({...e,...t.$defs},dp(t.$ref),n)}function uw(e,t){return ma(t)?oa(e.default)?e.default():QC(e.default):t}function dw(e,t,n){return _w(e,RC(NC(e,t)),n)}function fw(e,t,n){if(!da(n))return n;let r=P(t.properties);for(let i of r){let r=_w(e,t.properties[i],n[i]);(!ma(r)||!xp(t.properties[i])&&N(t.properties[i],`default`))&&(n[i]=r)}if(!to(t)||ia(t.additionalProperties))return n;for(let i of P(n))r.includes(i)||(n[i]=_w(e,t.additionalProperties,n[i]));return n}function pw(e,t,n){if(!da(n))return n;let[r,i]=[new RegExp(Jh(t)),Xh(t)];for(let t of P(n))r.test(t)&&so(i)&&(n[t]=_w(e,i,n[t]));if(!to(t))return n;for(let i of P(n))r.test(i)||(n[i]=_w(e,t.additionalProperties,n[i]));return n}function mw(e,t,n){return N(e,t.$ref)?_w(e,e[t.$ref],n):n}function hw(e,t,n){if(!na(n))return n;let[r,i]=[t.items,Math.max(t.items.length,n.length)];for(let t=0;t<i;t++)t<r.length&&(n[t]=_w(e,r[t],n[t]));return n}function gw(e,t,n){for(let r of t.anyOf){let t=_w(e,r,QC(n));if(Wf(e,r,t))return t}return n}function _w(e,t,n){let r=so(t)?uw(t,n):n;return rp(t)?cw(e,t,r):Ap(t)?lw(e,t,r):Vp(t)?dw(e,t,r):Tp(t)?fw(e,t,r):Zh(t)?pw(e,t,r):fp(t)?mw(e,t,r):Bm(t)?hw(e,t,r):_m(t)?gw(e,t,r):r}function vw(...e){let[t,n,r]=zi(e,{3:(e,t,n)=>[e,t,n],2:(e,t)=>[{},e,t]});return _w(t,n,r)}gm([I({type:nm(`insert`),path:mm(),value:Dp()}),Object({type:nm(`update`),path:mm(),value:Dp()}),I({type:nm(`delete`),path:mm()})]);var yw=e=>typeof e==`object`&&e?e:e===!1?{not:{}}:{};function bw(e){return typeof e!=`object`||!e?JSON.stringify(e)??`null`:Array.isArray(e)?`[${e.map(e=>bw(e)).join(`,`)}]`:`{${Object.keys(e).filter(t=>e[t]!==void 0).sort().map(t=>`${JSON.stringify(t)}:${bw(e[t])}`).join(`,`)}}`}function xw(e){let t=2166136261,n=1523705862;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);t=Math.imul(t^i,16777619),n=Math.imul(n^i,1540483477)^n>>>13}return(t>>>0).toString(16).padStart(8,`0`)+(n>>>0).toString(16).padStart(8,`0`)}function Sw(e,t){return e===t||bw(e)===bw(t)}function Cw(e,t,n,r){if(Wf(n,r))return;let i=[...Gf(n,r)].slice(0,3);throw Ii(e,`${t}: ${i.map(e=>`${e.instancePath||`/`} ${e.message}`).join(`; `)}`,i)}function ww(e,t,n){let r=sw(e,vw(e,QC(t??{})));return Cw(`input`,n,e,r),r}function Tw(e,t){return bw(Ew(yw(e),t))}function Ew(e,t){if(Array.isArray(t)){let n=e.items;return Array.isArray(n)?t.map((e,t)=>Ew(yw(n[t]),e)):t.map(e=>Ew(yw(n),e))}if(typeof t!=`object`||!t)return t;let n=yw(e.properties),r={};for(let[e,i]of Object.entries(t)){let t=yw(n[e]);`default`in t&&Sw(t.default,i)||(r[e]=Ew(t,i))}return r}var Dw=[`minLength`,`maxLength`,`pattern`,`format`,`minimum`,`maximum`,`exclusiveMinimum`,`exclusiveMaximum`,`multipleOf`,`minItems`,`maxItems`,`uniqueItems`,`minProperties`,`maxProperties`],Ow=e=>typeof e.type==`string`?[e.type]:Array.isArray(e.type)?e.type:void 0,kw=new Set([...Dw,`type`,`properties`,`required`,`additionalProperties`,`patternProperties`,`items`,`additionalItems`,`const`,`enum`,`anyOf`,`parameters`,`returnType`]),Aw=new Set([`title`,`description`,`default`,`examples`,`$id`,`$schema`,`$comment`,`readOnly`,`writeOnly`,`deprecated`]),jw=e=>Object.fromEntries(Object.entries(e).filter(([e])=>!Aw.has(e)));function Mw(e,t){let n=jw(yw(e)),r=jw(yw(t));if(Object.keys(r).length===0||Sw(n,r))return!0;if(Object.keys(r).some(e=>!kw.has(e))||r.additionalProperties!==void 0&&typeof r.additionalProperties!=`boolean`)return!1;if(Array.isArray(n.anyOf))return n.anyOf.every(e=>Mw(e,r));if(Array.isArray(r.anyOf))return r.anyOf.some(e=>Mw(n,e));if(`const`in r)return`const`in n&&Sw(n.const,r.const);if(Array.isArray(r.enum))return(`const`in n?[n.const]:Array.isArray(n.enum)?n.enum:void 0)?.every(e=>r.enum.some(t=>Sw(t,e)))??!1;for(let e of Dw)if(e in r&&!Sw(n[e],r[e]))return!1;let i=Ow(r),a=Ow(n);return i===void 0||a===void 0||!a.every(e=>i.includes(e)||e===`integer`&&i.includes(`number`))?!1:`const`in n||Array.isArray(n.enum)?!0:a.includes(`object`)&&!Nw(n,r)||a.includes(`array`)&&!Pw(n,r)?!1:!a.includes(`function`)||Fw(n,r)}function Nw(e,t){let n=yw(e.properties),r=yw(t.properties),i=new Set(e.required??[]);for(let e of t.required??[])if(!i.has(e))return!1;for(let[t,i]of Object.entries(r))if(t in n){if(!Mw(n[t],i))return!1}else if(typeof e.additionalProperties==`object`&&!Mw(e.additionalProperties,i))return!1;if(t.additionalProperties===!1&&(e.additionalProperties!==!1||Object.keys(n).some(e=>!(e in r))))return!1;let a=yw(t.patternProperties);if(Object.keys(a).length>0){let t=yw(e.patternProperties);if(e.additionalProperties!==!1&&Object.keys(t).length===0)return!1;for(let[e,i]of Object.entries(a)){let a=new RegExp(e,`u`);for(let[e,t]of Object.entries(n))if(!(e in r)&&a.test(e)&&!Mw(t,i))return!1;if(Object.keys(t).length>0&&(!(e in t)||!Mw(t[e],i)))return!1}for(let e of Object.keys(t))if(!(e in a))return!1}return!0}function Pw(e,t){return Array.isArray(t.items)?!Array.isArray(e.items)||e.items.length!==t.items.length?!1:e.items.every((e,n)=>Mw(e,t.items[n])):Array.isArray(e.items)?e.items.every(e=>Mw(e,t.items)):Mw(e.items,t.items)}function Fw(e,t){let n=e.parameters??[],r=t.parameters??[];return n.length>r.length||!n.every((e,t)=>Mw(r[t],e))?!1:Mw(e.returnType,t.returnType)}var Iw=Symbol(`chord.member`),Lw=(e,t)=>({[Iw]:`method`,args:e,result:t}),Rw=new Set([`kind`,`status`,`ready`,`shape`,`error`,`onShape`,`onStatus`,`release`,`then`,`contract`]);function zw(e,t,n){if(Rw.has(e))throw TypeError(`member name is reserved: ${e}`);let r=t[Iw];if(r===`method`){let e=t;return{kind:`method`,args:e.args,result:e.result}}if(r===`opaque`){if(n===`remote`)throw TypeError(`remote contracts cannot expose opaque members: ${e}`);return{kind:`opaque`,id:t.id}}return{kind:`state`,schema:t}}function Bw(e){return{...e,fingerprint:xw(bw(e.description))}}function Vw(e,t){if(!e)throw TypeError(`contract name is empty`);if(!Number.isInteger(t)||t<1)throw TypeError(`contract version must be a positive integer`)}function Hw(e,t){Vw(e,t.version);let n={};if(Object.keys(t.variants).length===0)throw TypeError(`remote contract ${e} has no variants`);for(let[r,i]of Object.entries(t.variants)){let t={};for(let[e,n]of Object.entries(i.state??{}))t[e]=zw(e,n,`remote`);for(let[n,a]of Object.entries(i.methods??{})){if(n in t)throw TypeError(`member ${n} is both state and method in ${e}.${r}`);if(t[n]=zw(n,a,`remote`),t[n].kind!==`method`)throw TypeError(`methods.${n} is not a method()`)}n[r]=t}let r={name:e,scope:`remote`,version:t.version,input:t.input,variants:n};return Bw({scope:`remote`,name:e,version:t.version,input:t.input,def:t,description:r})}function Uw(e){let{name:t,scope:n,version:r,input:i}=e;if(typeof t!=`string`||n!==`remote`&&n!==`local`||!Number.isInteger(r))throw new j(`invalid`,`malformed contract token`,{reason:`token`});let a={name:t,version:r,input:i,description:e,fingerprint:xw(bw(e))};return n===`remote`?{...a,scope:n,def:{version:r,input:i,variants:{}}}:{...a,scope:n,def:{version:r,input:i}}}function Ww(e,t){if(e.name!==t.name||e.scope!==t.scope)return`different type`;if(!Mw(t.input,e.input))return`input`;for(let[n,r]of Object.entries(t.variants)){let t=e.variants[n];if(t===void 0)return`variant ${n} missing`;for(let[e,i]of Object.entries(r)){let r=t[e];if(r===void 0||r.kind!==i.kind)return`${n}.${e} missing or of another kind`;if(r.kind===`method`&&i.kind===`method`){if(!Mw(i.args,r.args))return`${n}.${e} arguments`;if(!Mw(r.result,i.result))return`${n}.${e} result`}else if(r.kind===`state`&&i.kind===`state`){if(!Mw(r.schema,i.schema))return`${n}.${e} state`}else if(r.kind===`opaque`&&i.kind===`opaque`&&r.id!==i.id)return`${n}.${e} opaque ${r.id} != ${i.id}`}}}function Gw(e,t,n){if(e.fingerprint===n.fingerprint)return;if(e.version===n.version){let t=Ww(e.description,n.description);if(t===void 0)return;throw new j(`contract_mismatch`,`${e.name}@${e.version} does not cover the consumer's description (${t}); forgotten version bump?`)}let r=t?.[n.version];if(r===void 0)throw new j(`contract_mismatch`,`${e.name}: provider version ${e.version}, consumer version ${n.version}, no accepts adapter`);return r}var Kw=Symbol(`chord.decl`),qw=e=>typeof e==`object`&&e?e[Kw]:void 0,Jw=[],Yw=0,Xw=!1;function Zw(e){Jw.push(e),$w()}function Qw(e){Yw++;try{return e()}finally{Yw--,$w()}}function $w(){if(!(Xw||Yw>0)){Xw=!0;try{for(let e=Jw.shift();e!==void 0;e=Jw.shift())e()}finally{Xw=!1}}}var eT=65536,tT=4096,nT=new WeakSet,rT=(e,t)=>{nT.has(e)||(e.length>=tT?nT.add(e):e.push(t))},iT=e=>typeof e==`object`&&!!e,aT=(e,t,n)=>{e.length===0?rT(n,[`r`,t]):rT(n,[`s`,e,t])},oT=(e,t)=>{if(e===t)return!0;if(!iT(e)||!iT(t)||Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)){let n=t;if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(!oT(e[t],n[t]))return!1;return!0}let n=t,r=Object.keys(e);if(r.length!==Object.keys(n).length)return!1;for(let t of r)if(!Object.hasOwn(n,t)||!oT(e[t],n[t]))return!1;return!0},sT=(e,t)=>{if(e.length!==t.length)return;let n=new Map;for(let t=0;t<e.length;t++){let r=e[t],i=n.get(r);i===void 0?n.set(r,{indices:[t],used:0}):i.indices.push(t)}let r=Array(t.length);for(let e=0;e<t.length;e++){let i=n.get(t[e]);if(i===void 0||i.used===i.indices.length)return;r[e]=i.indices[i.used++]}return r},cT=(e,t,n,r)=>{if(e===t)return;if(t.length>e.length&&t.slice(0,e.length)===e){rT(r,[`a`,n,t.slice(e.length)]);return}let i=aO(e,t,eT);i===0?rT(r,[`s`,n,t]):(rT(r,[`t`,n,e.length-i]),t.length>i&&rT(r,[`a`,n,t.slice(i)]))},lT=2e5,uT=65536,dT=(e,t)=>e===t||oT(e,t),fT=(e,t,n,r)=>{if(e.length===0||t.length===0)return[];if(e.length*t.length>r)return;let i=t.length+1,a=new Uint32Array((e.length+1)*i);for(let r=e.length-1;r>=0;r--)for(let o=t.length-1;o>=0;o--){let s=r*i+o;a[s]=n(e[r],t[o])?a[(r+1)*i+o+1]+1:Math.max(a[(r+1)*i+o],a[r*i+o+1])}let o=[],s=0,c=0;for(;s<e.length&&c<t.length;)n(e[s],t[c])&&a[s*i+c]===a[(s+1)*i+c+1]+1?o.push([s++,c++]):a[(s+1)*i+c]>=a[s*i+c+1]?s+=1:c+=1;return o},pT=(e,t)=>{if(dT(e,t))return!0;if(!iT(e)||!iT(t)||Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.some((e,n)=>iT(e)&&e===t[n]);let n=e,r=t;for(let e of Object.keys(n)){let t=n[e];if(iT(t)&&Object.hasOwn(r,e)&&t===r[e])return!0}return!1},mT=(e,t)=>{let n=0,r=e.length;for(;n<r;){let i=n+r>>>1;e[i]<t?n=i+1:r=i}return n},hT=(e,t,n,r,i,a)=>{let o=n-t,s=a-i,c=[];if(s<o){let o=t;for(let t=i;t<a;t++){for(;o<n&&e[o]!==r[t];)o+=1;if(o===n)return;c.push([o++,t])}return c}if(o<s){let o=i;for(let i=t;i<n;i++){for(;o<a&&e[i]!==r[o];)o+=1;if(o===a)return;c.push([i,o++])}return c}},gT=(e,t,n,r)=>{let i=[],a=-1;for(let o=n;o<r;o++){let n=e.get(t[o]);if(n===void 0)continue;let r=n[mT(n,a+1)];r!==void 0&&(i.push([r,o]),a=r)}return i},_T=(e,t,n,r,i,a)=>{let o=new Map;for(let r=t;r<n;r++){let t=e[r],n=o.get(t);n===void 0?o.set(t,[r]):n.push(r)}let s=0;for(let e=i;e<a;e++)if(s+=o.get(r[e])?.length??0,s>lT)return gT(o,r,i,a);if(s===0)return[];let c=[],l=[],u=[];for(let e=i;e<a;e++){let t=o.get(r[e]);if(t!==void 0)for(let n=t.length-1;n>=0;n--){let r=t[n],i=mT(u,r),a=c.length;c.push({before:r,after:e,previous:i===0?-1:l[i-1]}),l[i]=a,u[i]=r}}let d=[],f=l[l.length-1]??-1;for(;f>=0;){let e=c[f];d.push([e.before,e.after]),f=e.previous}return d.reverse(),d},vT=(e,t,n,r,i,a,o,s,c,l)=>{let u=i,d=o,f=c;for(let[i,a]of l){if(nT.has(r))return;yT(e,t,n,r,u,i,d,a,f),f+=a-d,dT(e[i],t[a])||ST(e[i],t[a],[...n,f],r),f+=1,u=i+1,d=a+1}nT.has(r)||yT(e,t,n,r,u,a,d,s,f)};function yT(e,t,n,r,i,a,o,s,c){if(nT.has(r))return;for(;i<a&&o<s&&dT(e[i],t[o]);)i+=1,o+=1,c+=1;for(;i<a&&o<s&&dT(e[a-1],t[s-1]);)--a,--s;let l=a-i,u=s-o;if(l===0&&u===0)return;if(l===0||u===0){rT(r,[`p`,n,c,l,t.slice(o,s)]);return}if(l===u){let u=[];for(let n=0;n<l;n++)dT(e[i+n],t[o+n])&&u.push([i+n,o+n]);if(u.length>0){vT(e,t,n,r,i,a,o,s,c,u);return}}let d=hT(e,i,a,t,o,s);if(d!==void 0&&d.length>0){vT(e,t,n,r,i,a,o,s,c,d);return}let f=_T(e,i,a,t,o,s);if(f.length>0){vT(e,t,n,r,i,a,o,s,c,f);return}let p=fT(e.slice(i,a),t.slice(o,s),pT,uT);if(p!==void 0&&p.length>0){let l=p.map(([e,t])=>[i+e,o+t]);vT(e,t,n,r,i,a,o,s,c,l)}else l===1&&u===1?ST(e[i],t[o],[...n,c],r):rT(r,[`p`,n,c,l,t.slice(o,s)])}var bT=(e,t,n,r)=>{if(!(e===t||oT(e,t))){if(e.length===t.length&&e.length>1&&!dT(e[0],t[0])&&!dT(e[e.length-1],t[t.length-1])){let i=sT(e,t);if(i!==void 0){rT(r,[`m`,n,i]);return}}yT(e,t,n,r,0,e.length,0,t.length,0)}},xT=(e,t,n,r)=>{let i=Object.keys(e),a=Object.keys(t);if([...i,...a].some(e=>oO.has(e)))oT(e,t)||aT(n,t,r);else{for(let i of a){if(nT.has(r))return;Object.hasOwn(e,i)?ST(e[i],t[i],[...n,i],r):aT([...n,i],t[i],r)}for(let e of i){if(nT.has(r))return;Object.hasOwn(t,e)||rT(r,[`d`,[...n,e]])}}},ST=(e,t,n,r)=>{e===t||nT.has(r)||(typeof e==`string`&&typeof t==`string`&&n.length>0?cT(e,t,n,r):Array.isArray(e)&&Array.isArray(t)?bT(e,t,n,r):iT(e)&&iT(t)&&!Array.isArray(e)&&!Array.isArray(t)?xT(e,t,n,r):aT(n,t,r))},CT=e=>{if(e===null)return 4;if(typeof e==`string`)return e.length+2;if(typeof e==`number`)return String(e).length;if(typeof e==`boolean`)return e?4:5;if(Array.isArray(e)){let t=2;for(let n=0;n<e.length;n++)t+=CT(e[n])+(n===0?0:1);return t}let t=2,n=0;for(let r of Object.keys(e))t+=r.length+3+CT(e[r])+(n++===0?0:1);return t},wT=e=>{let t=2;for(let n=0;n<e.length;n++){let r=e[n];t+=(typeof r==`string`?r.length+2:String(r).length)+(n===0?0:1)}return t},TT=e=>{switch(e[0]){case`r`:return 6+CT(e[1]);case`s`:return 7+wT(e[1])+CT(e[2]);case`d`:return 6+wT(e[1]);case`a`:return 7+wT(e[1])+e[2].length+2;case`t`:return 7+wT(e[1])+String(e[2]).length;case`p`:return 10+wT(e[1])+String(e[2]).length+String(e[3]).length+CT(e[4]);case`m`:return 7+wT(e[1])+CT(e[2])}};function ET(e,t){let n=[];if(ST(e,t,[],n),nT.has(n))return[[`r`,t]];if(n.length===0||n[0]?.[0]===`r`)return n;let r=2;for(let e of n)r+=TT(e)+1;if(r<65536)return n;let i=CT(t)+6;return r>=i?[[`r`,t]]:n}var DT={value:void 0,writable:!0,enumerable:!0,configurable:!0};function OT(e,t){return kT(e,void 0,t?.omitUndefinedProperties===!0)}function kT(e,t,n){if(e===null||typeof e==`string`||typeof e==`boolean`)return e;if(typeof e==`number`){if(Number.isFinite(e))return e;throw TypeError(`Value contains a non-finite number and is not strict JSON`)}if(typeof e!=`object`)throw TypeError(`Value contains a non-JSON ${typeof e}; expected strict JSON`);let r=t??new Set;if(r.has(e))throw TypeError(`Value contains cycles and is not strict JSON`);r.add(e);try{if(Array.isArray(e)){if(Object.getPrototypeOf(e)!==Array.prototype||Reflect.ownKeys(e).length!==e.length+1)throw TypeError(`Value must contain strict JSON dense plain arrays`);let t=Array(e.length);for(let i=0;i<e.length;i++){let a=Object.getOwnPropertyDescriptor(e,i);if(a===void 0||!a.enumerable||!(`value`in a))throw TypeError(`Value must contain strict JSON enumerable indexed data properties`);AT(t,String(i),kT(a.value,r,n))}return t}let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)throw TypeError(`Value must contain strict JSON plain objects or arrays`);let i=Object.create(t);for(let t of Reflect.ownKeys(e)){if(typeof t==`symbol`)throw TypeError(`Value contains a symbol key and is not strict JSON`);let a=Object.getOwnPropertyDescriptor(e,t);if(!a.enumerable||!(`value`in a))throw TypeError(`Value must contain strict JSON enumerable data properties`);a.value===void 0&&n||AT(i,t,kT(a.value,r,n))}return i}finally{r.delete(e)}}function AT(e,t,n){DT.value=n,Object.defineProperty(e,t,DT),DT.value=void 0}var jT={value:void 0,writable:!0,enumerable:!0,configurable:!0};function MT(e,t){let n=e,r=new WeakSet;for(let e of t){if(e[0]===`r`){n=e[1];continue}if(e[0]===`p`||e[0]===`m`){let t=NT(n,e[1],e[1].length,r);if(n=t.root,!Array.isArray(t.target))throw TypeError(`Trusted array operation target is not an array`);e[0]===`p`?LT(t.target,e[2],e[3],e[4]):RT(t.target,e[2]);continue}let t=e[1],i=NT(n,t,t.length-1,r);n=i.root;let a=t[t.length-1];switch(e[0]){case`s`:IT(i.target,a,e[2]);break;case`d`:if(Array.isArray(i.target)){if(typeof a!=`number`)throw TypeError(`Trusted array deletion key is not numeric`);LT(i.target,a,1,[])}else Reflect.deleteProperty(i.target,a);break;case`a`:{let t=FT(i.target,a);if(typeof t!=`string`)throw TypeError(`Trusted append target is not a string`);IT(i.target,a,`${t}${e[2]}`);break}case`t`:{let t=FT(i.target,a);if(typeof t!=`string`)throw TypeError(`Trusted truncate target is not a string`);IT(i.target,a,t.slice(e[2]));break}}}return n}function NT(e,t,n,r){if(!zT(e))throw TypeError(`Trusted operation root is not a container`);let i=e;r.has(e)||(i=PT(e),r.add(i));let a=i;for(let e=0;e<n;e++){let n=t[e],i=FT(a,n);if(!zT(i))throw TypeError(`Trusted operation path is not a container`);if(r.has(i)){a=i;continue}let o=PT(i);IT(a,n,o),r.add(o),a=o}return{root:i,target:a}}function PT(e){if(Array.isArray(e))return Array.from(e);let t=Object.create(Object.getPrototypeOf(e)===null?null:Object.prototype);for(let n of Object.keys(e))IT(t,n,e[n]);return t}function FT(e,t){return e[t]}function IT(e,t,n){jT.value=n,Object.defineProperty(e,t,jT),jT.value=void 0}function LT(e,t,n,r){let i=e.length,a=r.length-n;a>0?(e.length=i+a,e.copyWithin(t+r.length,t+n,i)):a<0&&(e.copyWithin(t+r.length,t+n,i),e.length=i+a);for(let n=0;n<r.length;n++)IT(e,t+n,r[n])}function RT(e,t){if(e.length!==t.length)throw TypeError(`Trusted permutation length mismatch`);let n=e.slice();for(let r=0;r<t.length;r++)e[r]=n[t[r]]}function zT(e){return typeof e==`object`&&!!e}var BT=Symbol(`chord.delta.overlay.node`),VT=new WeakMap,HT={},UT=new Set([`push`,`pop`,`shift`,`unshift`,`splice`,`reverse`,`sort`,`fill`,`copyWithin`]),WT=4096,GT=128,KT={value:void 0,writable:!0,enumerable:!0,configurable:!0},qT=class{#e;value;base;ops;constructor(e,t,n){this.#e=e,this.value=t,this.base=e.baseValue,this.ops=n,VT.set(this,e)}get baseRevision(){return this.#e.baseRevision}abort(){eO(this.#e)}},JT=class{#e;#t;#n=!1;constructor(e){this.#e=e}get state(){let e=this.#e?.root?.proxy;if(e===void 0)throw TypeError(`Cannot use a settled overlay`);return e}prepare(){if(this.#n)throw Error(`Change has already been settled`);let e=this.#e;fE(e),e.status.value=`prepared`;try{e.replacement||(e.ops=e.dirty.length===0?[]:TD(e));let t=ZT(e);return this.#t=e.status,this.#n=!0,t}catch(t){throw e.status.value=`aborted`,nO(e),this.#n=!0,t}finally{this.#e=void 0}}abort(){this.#n?(this.#t?.value===`prepared`&&(this.#t.value=`aborted`),this.#t=void 0):(this.#n=!0,eO(this.#e),this.#e=void 0)}},YT=class{#e={};#t=new Set;#n;#r;#i=0;#a=256;constructor(e){this.#r=e,this.#n=new WeakRef(this)}get value(){return this.#r}get revision(){return this.#i}beginChange(){let e=$T(this.#n,this.#e,this.#i,this.#r,!1,this.#r);return this.#o(e),new JT(e)}prepareReplace(e){let t=$T(this.#n,this.#e,this.#i,e,!0,this.#r);t.status.value=`prepared`,this.#o(t);try{return ZT(t)}catch(e){throw t.status.value=`aborted`,nO(t),e}}adopt(e){let t=VT.get(e);if(t?.owner!==this.#e)throw Error(`Prepared change belongs to a different tracker`);if(t.status.value===`consumed`)throw Error(`Prepared change has already been used`);if(t.status.value===`aborted`)throw Error(`Prepared change has been aborted`);if(t.status.value===`stale`)throw Error(`Prepared change is stale`);if(t.status.value!==`prepared`)throw Error(`Prepared change is not ready`);if(t.baseRevision!==this.#i)throw t.status.value=`stale`,nO(t),Error(`Prepared change is stale`);if(this.#r!==e.base)throw t.status.value=`stale`,Error(`Prepared change is stale`);this.#r=e.value,t.status.value=`consumed`,this.#i+=1,this.#c(t)}releaseContext(e){e.registryRef!==void 0&&this.#t.delete(e.registryRef),e.registryRef=void 0}#o(e){let t=new WeakRef(e);e.registryRef=t,this.#t.add(t),--this.#a,this.#a===0&&(this.#s(),this.#a=Math.max(256,this.#t.size))}#s(){for(let e of this.#t)e.deref()===void 0&&this.#t.delete(e)}#c(e){for(let t of this.#t){let n=t.deref();n!==void 0&&n!==e&&((n.status.value===`open`||n.status.value===`prepared`)&&(n.status.value=`stale`),tO(n))}this.#t.clear(),this.#a=256}replacementBase(e){return e.baseRevision===this.#i?this.#r:void 0}};function XT(e){return new YT(e)}function ZT(e){let t=QD(e),n=e.baseValue,r=new qT(e,t.length===0?n:e.simpleObjectMaterialization?bD(e.root):QT(n,t),t);return e.nodes.length>4096?tO(e):nO(e),r}function QT(e,t){for(let n of t)if(n[0]===`p`||n[0]===`m`)return gO(e,t);return MT(e,t)}function $T(e,t,n,r,i,a){let o={owner:t,tracker:e,baseRevision:n,status:{value:`open`},root:void 0,bases:[],stored:[],dirty:[],nodes:[],rawNodes:new WeakMap,ops:void 0,replacement:i,replacementNoop:!1,baseValue:a,overlayReleased:!1,simpleObjectMaterialization:!1,registryRef:void 0};return o.root=nE(o,r,void 0),o}var eE={deleteProperty(e,t){return gE(lE(e),t)},defineProperty(e){throw fE(lE(e).context),TypeError(`Defining overlay properties is not supported`)},get(e,t){if(t===`then`){let t=e[BT];if(t===void 0||uE(t.context))return}let n=lE(e);return t===BT?n:pE(n,t)},getOwnPropertyDescriptor(e,t){return yE(lE(e),t)},getPrototypeOf(e){let t=lE(e);return dE(t.context),Object.getPrototypeOf(rE(t))},has(e,t){return _E(lE(e),t)},isExtensible(e){return dE(lE(e).context),!0},ownKeys(e){return vE(lE(e))},preventExtensions(e){throw fE(lE(e).context),TypeError(`Overlays cannot be made non-extensible`)},set(e,t,n){return hE(lE(e),t,n)},setPrototypeOf(e){throw fE(lE(e).context),TypeError(`Changing an overlay prototype is not supported`)}},tE=eE;function nE(e,t,n,r=0,i=``,a=void 0,o=!1){let s=e.rawNodes.get(t);if(s!==void 0)return s;let c=Array.isArray(t)?[]:{},l=e.bases.length,u=n?.baseIndex??-1;e.bases.push(t);let d={context:e,baseIndex:l,parentIndex:u,parentKind:r,parentKey:i,parentPlacement:o,target:c,proxy:c};return a!==void 0&&(d.parentSource=a),c[BT]=d,d.proxy=new Proxy(c,Array.isArray(t)?tE:eE),e.rawNodes.set(t,d),e.nodes.push(d),d}function rE(e){return e.context.bases[e.baseIndex]}function iE(e){return e.parentIndex<0?void 0:e.context.nodes[e.parentIndex]}function aE(e,t){if(!rO(t))return t;let n=e.stored.length;return e.stored.push(t),{index:n}}function oE(e,t){return typeof t==`object`&&t?e.stored[t.index]:t}function sE(e,t,n){return rO(n)?typeof t==`object`&&t?(e.stored[t.index]=n,t):aE(e,n):(typeof t==`object`&&t&&(e.stored[t.index]=HT),n)}function cE(e,t){typeof t==`object`&&t&&(e.stored[t.index]=HT)}function lE(e){let t=e[BT];if(t===void 0)throw TypeError(`Cannot use a settled overlay`);return t}function uE(e){return e.overlayReleased||e.status.value===`consumed`||e.status.value===`aborted`||e.status.value===`stale`}function dE(e){if(uE(e))throw TypeError(`Cannot use a settled overlay`)}function fE(e){if(dE(e),e.status.value!==`open`)throw TypeError(`Prepared overlays are read-only`)}function pE(e,t){if(dE(e.context),Array.isArray(rE(e))){let n=kE(e);if(t===`length`)return KE(n);if(UT.has(t))return lD[t];let r=JE(t);return r===void 0?Reflect.get(Array.prototype,t,e.proxy):mE(e,r)}if(typeof t==`symbol`)return Reflect.get(rE(e),t,e.proxy);let n=String(t);if(!EE(e,n))return CE(e,n)||Object.hasOwn(rE(e),n)?void 0:Reflect.get(rE(e),t,e.proxy);let r=DE(e,n);return rO(r)?nE(e.context,r,e,0,n,void 0,bE(e,n)).proxy:r}function mE(e,t){let n=kE(e);if(t>=KE(n))return;let r=qE(n,t),i=r.start+r.step*n.locatedOffset,a=YE(e,r,i);return rO(a)?nE(e.context,a,e,r.kind===`base`?1:2,i,r.kind===`insert`?r.source:void 0,r.kind===`insert`||XE(n,r,i)).proxy:a}function hE(e,t,n){if(fE(e.context),typeof t==`symbol`)throw TypeError(`Symbol writes are not supported`);if(Array.isArray(rE(e))){if(t===`length`)return iD(e,aD(n)),!0;let r=JE(t);if(r===void 0)throw TypeError(`Only array indices and length can be written`);if(r>KE(kE(e)))throw TypeError(`Overlay arrays cannot contain holes`);return rD(e,r,yD(n)),!0}let r=String(t);if(n===void 0)return gE(e,r);let i=yD(n),a=DE(e,r),o=CE(e,r);return!o&&!rO(i)&&a===i||(xE(e,r,i),o&&Object.hasOwn(rE(e),r)&&(e.readded===void 0&&(e.readded=new Set),e.readded.add(r)),TE(e,r),OE(e)),!0}function gE(e,t){if(fE(e.context),typeof t==`symbol`)throw TypeError(`Symbol writes are not supported`);if(Array.isArray(rE(e)))throw TypeError(`Overlay arrays cannot contain holes`);let n=String(t);return EE(e,n)&&(SE(e,n),e.readded?.delete(n),wE(e,n),OE(e)),!0}function _E(e,t){if(dE(e.context),Array.isArray(rE(e))){if(t===`length`)return!0;let n=JE(t);return n===void 0?t in Array.prototype:n<KE(kE(e))}return typeof t==`symbol`?t in rE(e):EE(e,String(t))}function vE(e){if(dE(e.context),Array.isArray(rE(e))){let t=KE(kE(e)),n=Array(t+1);for(let e=0;e<t;e++)n[e]=String(e);return n[t]=`length`,n}let t=e.deleteKey===void 0&&e.deletes===void 0&&e.readded===void 0&&(e.writeKey===void 0||Object.hasOwn(rE(e),e.writeKey));if(t&&e.writes!==void 0){for(let n of e.writes.keys())if(!Object.hasOwn(rE(e),n)){t=!1;break}}if(t)return Object.keys(rE(e));let n=Object.keys(rE(e)).filter(t=>!CE(e,t)&&!e.readded?.has(t)),r=new Set(n);if(e.writeKey!==void 0&&!r.has(e.writeKey)&&(n.push(e.writeKey),r.add(e.writeKey)),e.writes!==void 0)for(let t of e.writes.keys())r.has(t)||(n.push(t),r.add(t));let i=[],a=[];for(let e of n){let t=JE(e);t===void 0?a.push(e):i.push(t)}return i.sort((e,t)=>e-t),[...i.map(String),...a]}function yE(e,t){if(dE(e.context),Array.isArray(rE(e))){if(t===`length`){let t=KE(kE(e));return e.target.length=t,Reflect.getOwnPropertyDescriptor(e.target,`length`)}let n=JE(t);if(n===void 0||n>=KE(kE(e)))return}else if(typeof t==`symbol`||!EE(e,String(t)))return;return{configurable:!0,enumerable:!0,writable:e.context.status.value===`open`,value:pE(e,t)}}function bE(e,t){return e.writeKey===t||(e.writes?.has(t)??!1)}function xE(e,t,n){if(e.writes!==void 0){let r=e.writes.get(t);e.writes.set(t,r===void 0?aE(e.context,n):sE(e.context,r,n))}else e.writeKey===void 0||e.writeKey===t?(e.writeKey=t,e.writeValue=e.writeValue===void 0?aE(e.context,n):sE(e.context,e.writeValue,n)):(e.writes=new Map,e.writes.set(e.writeKey,e.writeValue),e.writes.set(t,aE(e.context,n)),e.writeKey=void 0,e.writeValue=void 0)}function SE(e,t){if(e.writeKey===t)e.writeKey=void 0,cE(e.context,e.writeValue),e.writeValue=void 0;else{let n=e.writes?.get(t);n!==void 0&&cE(e.context,n),e.writes?.delete(t)}}function CE(e,t){return e.deleteKey===t||(e.deletes?.has(t)??!1)}function wE(e,t){e.deletes===void 0?e.deleteKey===void 0||e.deleteKey===t?e.deleteKey=t:(e.deletes=new Set,e.deletes.add(e.deleteKey),e.deletes.add(t),e.deleteKey=void 0):e.deletes.add(t)}function TE(e,t){e.deleteKey===t?e.deleteKey=void 0:e.deletes?.delete(t)}function EE(e,t){return CE(e,t)?!1:bE(e,t)||Object.hasOwn(rE(e),t)}function DE(e,t){if(e.writeKey===t)return oE(e.context,e.writeValue);let n=e.writes?.get(t);return n===void 0?rE(e)[t]:oE(e.context,n)}function OE(e){if(!e.dirty){e.dirty=!0,e.context.dirty.push(e);for(let t=iE(e);t!==void 0;t=iE(t))t.subtreeDirty=!0}}function kE(e){if(e.array!==void 0)return e.array;let t=rE(e),n={root:void 0,pieces:void 0,baseOverrides:void 0,insertOverrides:void 0,structural:!1,generation:0,plan:void 0,seed:2654435769,locatedOffset:0,baseLocations:void 0,insertLocations:void 0};return t.length>0&&(n.root=FE(n,{kind:`base`,start:0,length:t.length,step:1})),e.array=n,n}function AE(e){return e.baseOverrides===void 0&&(e.baseOverrides=new Map),e.baseOverrides}function jE(e){return e.insertOverrides===void 0&&(e.insertOverrides=new Map),e.insertOverrides}function ME(e){let t=e.seed;return t^=t<<13,t^=t>>>17,t^=t<<5,e.seed=t>>>0,e.seed}function NE(e){return e?.elements??0}function PE(e){e.elements=NE(e.left)+e.piece.length+NE(e.right)}function FE(e,t){return{piece:t,left:void 0,right:void 0,priority:ME(e),elements:t.length}}function IE(e,t){return e===void 0?t:t===void 0?e:e.priority>=t.priority?(e.right=IE(e.right,t),PE(e),e):(t.left=IE(e,t.left),PE(t),t)}function LE(e,t,n){if(t===void 0)return[void 0,void 0];let r=NE(t.left);if(n<r){let[r,i]=LE(e,t.left,n);return t.left=i,PE(t),[r,t]}let i=r+t.piece.length;if(n>i){let[r,a]=LE(e,t.right,n-i);return t.right=r,PE(t),[t,a]}if(n===r){let e=t.left;return t.left=void 0,PE(t),[e,t]}if(n===i){let e=t.right;return t.right=void 0,PE(t),[t,e]}let a=n-r,o={...t.piece,length:a},s={...t.piece,start:t.piece.start+t.piece.step*a,length:t.piece.length-a};return[IE(t.left,FE(e,o)),IE(FE(e,s),t.right)]}function RE(e){for(;e.left!==void 0;)e=e.left;return e}function zE(e){for(;e.right!==void 0;)e=e.right;return e}function BE(e,t){return e.kind!==t.kind||e.kind===`insert`&&e.source!==t.source?!1:e.length===1&&t.length===1?Math.abs(t.start-e.start)===1:e.step===t.step&&e.start+e.step*e.length===t.start}function VE(e,t,n){if(t===void 0)return n;if(n===void 0)return t;let r=zE(t).piece,i=RE(n).piece;if(!BE(r,i))return IE(t,n);let[a]=LE(e,t,NE(t)-r.length),[,o]=LE(e,n,i.length),s=r.length===1?i.start-r.start:r.step;return VE(e,VE(e,a,FE(e,r.kind===`base`?{kind:`base`,start:r.start,length:r.length+i.length,step:s}:{kind:`insert`,source:r.source,start:r.start,length:r.length+i.length,step:s})),o)}function HE(e,t){e!==void 0&&(HE(e.left,t),t.push(e.piece),HE(e.right,t))}function UE(e){return e.pieces===void 0&&(e.pieces=[],HE(e.root,e.pieces)),e.pieces}function WE(e,t){eD(t);let n;for(let r of t)n=IE(n,FE(e,r));return n}function GE(e,t){e.root=WE(e,t),e.pieces=void 0,e.baseLocations=void 0,e.insertLocations=void 0}function KE(e){return NE(e.root)}function qE(e,t){let n=e.root;for(;n!==void 0;){let r=NE(n.left);if(t<r)n=n.left;else if(t>=r+n.piece.length)t-=r+n.piece.length,n=n.right;else return e.locatedOffset=t-r,n.piece}throw RangeError(`Array overlay index is out of range`)}function JE(e){if(typeof e!=`string`||e.length===0||e.length>10)return;if(e===`0`)return 0;let t=e.charCodeAt(0);if(t<49||t>57)return;let n=t-48;for(let t=1;t<e.length;t++){let r=e.charCodeAt(t)-48;if(r<0||r>9||(n=n*10+r,n>=4294967295))return}return n}function YE(e,t,n){let r=kE(e);if(t.kind===`base`){let t=r.baseOverrides?.get(n);return t===void 0?rE(e)[n]:oE(e.context,t)}let i=r.insertOverrides?.get(t.source),a=i?.has(n)?i.get(n):t.source.refs[n];return oE(e.context,a)}function XE(e,t,n){return t.kind===`base`?e.baseOverrides?.has(n)??!1:e.insertOverrides?.get(t.source)?.has(n)??!1}function ZE(e,t){e.right===void 0?e.piece.length+=t:ZE(e.right,t),PE(e)}function QE(e){e.pieces=void 0,e.baseLocations=void 0,e.insertLocations=void 0,e.plan=void 0}function $E(e,t,n,r){if(n===0&&r.length===0)return;let i=kE(e);if(n===0&&t===KE(i)&&r.length===1&&i.root!==void 0){let t=r[0],n=zE(i.root).piece;if(t.kind===`insert`&&n.kind===`insert`&&n.step===1&&n.start+n.length===n.source.refs.length){for(let e=0;e<t.length;e++)n.source.refs.push(t.source.refs[t.start+e]);ZE(i.root,t.length),QE(i),i.structural=!0,i.generation+=1,OE(e);return}}let[a,o]=LE(i,i.root,t),[,s]=LE(i,o,n);i.root=VE(i,VE(i,a,WE(i,r)),s),QE(i),i.structural=!0,i.generation+=1,OE(e)}function eD(e){for(let t=1;t<e.length;){let n=e[t-1],r=e[t],i=n.kind===r.kind&&(n.kind===`base`||n.source===r.source);i&&n.length===1&&r.length===1&&Math.abs(r.start-n.start)===1?(n.step=r.start-n.start,n.length=2,e.splice(t,1)):i&&n.step===r.step&&n.start+n.step*n.length===r.start?(n.length+=r.length,e.splice(t,1)):t+=1}}function tD(e,t,n=0){if(t.length===n)return[];let r=[];for(let i=n;i<t.length;i++)r.push(aE(e.context,t[i]));return[{kind:`insert`,source:{refs:r},start:0,length:r.length,step:1}]}function nD(e,t,n=0){if(t.length===n)return[];let r=e.context.stored.length;try{for(let r=n;r<t.length;r++)t[r]=aE(e.context,yD(t[r]))}catch(t){throw e.context.stored.length=r,t}return[{kind:`insert`,source:{refs:t},start:n,length:t.length-n,step:1}]}function rD(e,t,n){let r=kE(e),i=KE(r);if(t===i){$E(e,i,0,tD(e,[n]));return}let a=qE(r,t),o=a.start+a.step*r.locatedOffset,s=YE(e,a,o);if(rO(n)||s!==n){if(a.kind===`base`){let t=r.baseOverrides?.get(o);!rO(n)&&n===rE(e)[o]?(t!==void 0&&cE(e.context,t),r.baseOverrides?.delete(o)):t===void 0?AE(r).set(o,aE(e.context,n)):r.baseOverrides.set(o,sE(e.context,t,n))}else{let t=r.insertOverrides?.get(a.source),i=t?.get(o);!rO(n)&&n===oE(e.context,a.source.refs[o])?(i!==void 0&&cE(e.context,i),t?.delete(o),t?.size===0&&r.insertOverrides?.delete(a.source)):(t===void 0&&(t=new Map,jE(r).set(a.source,t)),i===void 0?t.set(o,aE(e.context,n)):t.set(o,sE(e.context,i,n)))}OE(e)}}function iD(e,t){let n=KE(kE(e));t!==n&&(t<n?$E(e,t,n-t,[]):$E(e,n,0,tD(e,Array.from({length:t-n},()=>null))))}function aD(e){let t=Number(e);if(!Number.isInteger(t)||t<0||t>=4294967296)throw RangeError(`Invalid array length`);return t}function oD(e){let t=Number(e);return Number.isNaN(t)||t===0?0:Number.isFinite(t)?Math.trunc(t):t}function sD(e,t){return e===-1/0?0:e<0?Math.max(t+e,0):Math.min(e,t)}function cD(e){if(!rO(e))return;let t=Reflect.get(e,BT);if(t!==void 0){if(!Array.isArray(rE(t)))throw TypeError(`Array mutator called on incompatible receiver`);return fE(t.context),t}}var lD={push(...e){let t=cD(this);if(t===void 0)return Reflect.apply(Array.prototype.push,this,e);let n=KE(kE(t));return $E(t,n,0,nD(t,e)),n+e.length},pop(){let e=cD(this);if(e===void 0)return Reflect.apply(Array.prototype.pop,this,[]);let t=KE(kE(e));if(t===0)return;let n=mE(e,t-1);return $E(e,t-1,1,[]),n},shift(){let e=cD(this);if(e===void 0)return Reflect.apply(Array.prototype.shift,this,[]);if(KE(kE(e))===0)return;let t=mE(e,0);return $E(e,0,1,[]),t},unshift(...e){let t=cD(this);return t===void 0?Reflect.apply(Array.prototype.unshift,this,e):($E(t,0,0,nD(t,e)),KE(kE(t)))},splice(...e){let t=cD(this);if(t===void 0)return Reflect.apply(Array.prototype.splice,this,e);let n=KE(kE(t)),r=e.length===0?0:sD(oD(e[0]),n),i=e.length===0?0:e.length===1?n-r:Math.min(Math.max(oD(e[1]),0),n-r),a=Array.from({length:i},(e,n)=>mE(t,r+n)),o=Math.min(2,e.length),s=Math.max(e.length-2,0);return $E(t,r,i,nD(t,e,o)),iD(t,n-i+s),a},reverse(){let e=cD(this);if(e===void 0)return Reflect.apply(Array.prototype.reverse,this,[]);let t=kE(e);if(KE(t)<2)return e.proxy;let n=[...UE(t)].reverse();for(let e of n)e.start+=e.step*(e.length-1),e.step=e.step===1?-1:1;return GE(t,n),t.structural=!0,t.generation+=1,t.plan=void 0,OE(e),e.proxy},sort(e){let t=cD(this);if(t===void 0)return Reflect.apply(Array.prototype.sort,this,[e]);if(e!==void 0&&typeof e!=`function`)throw TypeError(`Comparator must be a function`);let n=kE(t),r=[],i=[],a=[],o=Array(rE(t).length),s=[];for(let e of UE(n))for(let n=0;n<e.length;n++){let c=e.start+e.step*n;if(e.kind===`base`)s.push(c),o[c]=fD(t,c,r,i);else{r.push(e.source),i.push(c);let n=-r.length;s.push(n),a.push(fD(t,n,r,i))}}let c=new Map;for(let[e,r]of n.baseOverrides??[])c.set(e,oE(t.context,r));let l=new Map;for(let[e,r]of n.insertOverrides??[]){let n=new Map;for(let[e,i]of r)n.set(e,oE(t.context,i));l.set(e,n)}let u=n.generation;if(s.sort((t,n)=>{let r=t<0?a[-t-1]:o[t],i=n<0?a[-n-1]:o[n];if(typeof e==`function`)return Number(e(r,i));let s=String(r),c=String(i);return s<c?-1:+(s>c)}),c.size>0||l.size>0||(n.baseOverrides?.size??0)>0||(n.insertOverrides?.size??0)>0)for(let e of s)pD(t,e,r,i,c,l);let d=n.generation!==u,f=KE(n);return f>=s.length&&s.every((e,t)=>mD(n,t,e,r,i))||$E(t,0,Math.min(s.length,f),gD(s,r,i)),d&&hD(t),t.proxy},fill(e,t,n){let r=cD(this);if(r===void 0)return Reflect.apply(Array.prototype.fill,this,[e,t,n]);let i=KE(kE(r)),a=t===void 0?0:sD(oD(t),i),o=n===void 0?i:sD(oD(n),i);if(o<=a)return r.proxy;let s=Array.from({length:o-a},()=>yD(e));return $E(r,a,o-a,tD(r,s)),r.proxy},copyWithin(e,t,n){let r=cD(this);if(r===void 0)return Reflect.apply(Array.prototype.copyWithin,this,[e,t,n]);let i=KE(kE(r)),a=sD(oD(e),i),o=sD(oD(t),i),s=n===void 0?i:sD(oD(n),i),c=Math.min(Math.max(s-o,0),i-a);return $E(r,a,c,tD(r,Array.from({length:c},(e,t)=>yD(mE(r,o+t))))),r.proxy}};function uD(e,t){return e<0?t[-e-1]:void 0}function dD(e,t){return e<0?t[-e-1]:e}function fD(e,t,n,r){let i=kE(e),a=uD(t,n),o=dD(t,r),s=a===void 0?i.baseOverrides?.get(o):i.insertOverrides?.get(a)?.get(o),c=s===void 0?a===void 0?rE(e)[o]:oE(e.context,a.refs[o]):oE(e.context,s);return rO(c)?nE(e.context,c,e,a===void 0?1:2,o,a,a!==void 0||(i.baseOverrides?.has(o)??!1)).proxy:c}function pD(e,t,n,r,i,a){let o=kE(e),s=uD(t,n),c=dD(t,r);if(s===void 0){let t=o.baseOverrides?.get(c),n=i.get(c);n===void 0?(t!==void 0&&cE(e.context,t),o.baseOverrides?.delete(c)):t===void 0?AE(o).set(c,aE(e.context,n)):o.baseOverrides.set(c,sE(e.context,t,n));return}let l=o.insertOverrides?.get(s),u=l?.get(c),d=a.get(s)?.get(c);d===void 0?(u!==void 0&&cE(e.context,u),l?.delete(c),l?.size===0&&o.insertOverrides?.delete(s)):(l===void 0&&(l=new Map,jE(o).set(s,l)),u===void 0?l.set(c,aE(e.context,d)):l.set(c,sE(e.context,u,d)))}function mD(e,t,n,r,i){let a=qE(e,t),o=a.start+a.step*e.locatedOffset,s=uD(n,r);return o===dD(n,i)&&(a.kind===`base`&&s===void 0||a.kind===`insert`&&a.source===s)}function hD(e){let t=kE(e),n=new Set,r=new Map,i=[],a=!1;for(let o of UE(t))for(let t=0;t<o.length;t++){let s=o.start+o.step*t,c;if(o.kind===`base`)c=n.has(s),n.add(s);else{let e=r.get(o.source);e===void 0&&(e=new Set,r.set(o.source,e)),c=e.has(s),e.add(s)}c?(a=!0,_D(i,tD(e,[CD(YE(e,o,s),e.context)])[0])):_D(i,vD(o,s))}a&&(GE(t,i),t.structural=!0,t.generation+=1,t.plan=void 0,OE(e))}function gD(e,t,n){let r=[];for(let i of e){let e=i<0?t[-i-1]:void 0,a=i<0?n[-i-1]:i,o=r.at(-1),s=o!==void 0&&(e===void 0&&o.kind===`base`||e!==void 0&&o.kind===`insert`&&o.source===e);if(o!==void 0&&s){if(o.length===1){let e=a-o.start;if(e===1||e===-1){o.step=e,o.length=2;continue}}else if(o.start+o.step*o.length===a){o.length+=1;continue}}r.push(e===void 0?{kind:`base`,start:a,length:1,step:1}:{kind:`insert`,source:e,start:a,length:1,step:1})}return r}function _D(e,t){let n=e.at(-1),r=n!==void 0&&n.kind===t.kind&&(n.kind===`base`||n.source===t.source);if(n!==void 0&&r&&n.length===1&&t.length===1){let e=t.start-n.start;if(e===1||e===-1){n.step=e,n.length=2;return}}n!==void 0&&r&&n.step===t.step&&n.start+n.step*n.length===t.start?n.length+=t.length:e.push(t)}function vD(e,t){return e.kind===`base`?{kind:`base`,start:t,length:1,step:1}:{kind:`insert`,source:e.source,start:t,length:1,step:1}}function yD(e){let t=rO(e)?Reflect.get(e,BT):void 0;return t===void 0?OT(e):SD(t)}function bD(e){if(dE(e.context),Array.isArray(rE(e))){let t=kE(e),n=[];for(let r of UE(t))for(let t=0;t<r.length;t++){let i=r.start+r.step*t;n.push(xD(YE(e,r,i),e.context))}return n}let t=Object.create(Object.getPrototypeOf(rE(e)));for(let n of vE(e))wD(t,n,xD(DE(e,n),e.context));return t}function xD(e,t){if(!rO(e))return e;let n=t.rawNodes.get(e);return n===void 0||!n.dirty&&!n.subtreeDirty?e:bD(n)}function SD(e){if(dE(e.context),Array.isArray(rE(e))){let t=kE(e),n=[];for(let r of UE(t))for(let t=0;t<r.length;t++){let i=r.start+r.step*t;n.push(CD(YE(e,r,i),e.context))}return n}let t=Object.create(Object.getPrototypeOf(rE(e)));for(let n of vE(e))wD(t,n,CD(DE(e,n),e.context));return t}function CD(e,t){if(!rO(e))return OT(e);let n=t.rawNodes.get(e);return n===void 0?OT(e):SD(n)}function wD(e,t,n){KT.value=n,Object.defineProperty(e,t,KT),KT.value=void 0}function TD(e){let t=ED(e);if(t!==void 0)return t;let n=[],r=new Map,i=new Map,a=new Map;for(let t of e.dirty)if(MD(t,a),Array.isArray(rE(t))){let e=kE(t);if(!e.structural&&(e.baseOverrides?.size??0)>0){let n=a.get(t);n===void 0&&(n={indices:[],bits:void 0,length:rE(t).length},a.set(t,n));for(let t of e.baseOverrides.keys())jD(n,t)}}let o=new Map;for(let[e,t]of a){let n=YD(e);if(n===void 0||n.some(e=>typeof e==`string`&&oO.has(e)))continue;let r=ND(t);r.length>0&&o.set(e,r)}for(let t of e.dirty){let e=YD(t);if(e===void 0||AD(t,e,o))continue;i.set(t,e),!Array.isArray(rE(t))&&FD(t)&&r.set(t,e);let n=e.findIndex(e=>typeof e==`string`&&oO.has(e));if(n>=0){let i=t;for(let t=e.length;t>n;t--)i=iE(i);r.set(i,e.slice(0,n))}}for(let[e,t]of r)i.set(e,t);for(let e of o.keys()){let t=YD(e);t!==void 0&&!AD(e,t,o)&&i.set(e,t)}let s=0;for(let e of i.values())s=Math.max(s,e.length);let c=Array.from({length:s+1},()=>[]);for(let[e,t]of i)c[t.length].push(e);let l=new Set;for(let t of c)for(let a of t){let t=i.get(a);if(!(LD(a)||ID(a,l))){if(r.has(a))JD(n,t,bD(a)),l.add(a);else if(Array.isArray(rE(a))?GD(a,t,n,o.get(a)):zD(a,t,n),n.length>WT)return DD=void 0,[[`r`,bD(e.root)]]}}return DD=void 0,n}function ED(e){let t=[];for(let n of e.dirty){if(Array.isArray(rE(n))||FD(n)||LD(n))return;for(let e=iE(n);e!==void 0;e=iE(e))if(Array.isArray(rE(e)))return;let e=YD(n);if(e!==void 0){for(let t of e)if(typeof t==`string`&&oO.has(t))return;if(t.push(n),t.length>GT)return}}for(let e=1;e<t.length;e++){let n=t[e],r=n.preparedPath.length,i=e;for(;i>0&&t[i-1].preparedPath.length>r;)t[i]=t[i-1],--i;t[i]=n}let n=[],r=!0;for(let i of t)if(zD(i,i.preparedPath,n)&&(r=!1),n.length>WT)return[[`r`,bD(e.root)]];return e.simpleObjectMaterialization=r,n}var DD,OD=0;function kD(e){let t=e;for(let e=iE(t);e!==void 0;e=iE(t)){if(Array.isArray(rE(e))){let n=kE(e);if(t.parentKind!==1||n.structural)return!1;let r=t.parentKey,i=n.baseOverrides?.get(r);return(i===void 0?rE(e)[r]:oE(e.context,i))===rE(t)&&(DD=e,OD=r,!0)}t=e}return!1}function AD(e,t,n){for(let r=iE(e);r!==void 0;r=iE(r)){let e=n.get(r);if(e===void 0)continue;let i=YD(r);if(i===void 0||t.length<=i.length)continue;let a=!0;for(let e=0;e<i.length;e++)if(t[e]!==i[e]){a=!1;break}if(!a)continue;let o=t[i.length];if(typeof o==`number`&&PD(e,o))return!0}return!1}function jD(e,t){if(e.bits!==void 0)e.bits[t]=1;else if(e.indices.push(t),!(e.indices.length<256)){e.bits=new Uint8Array(e.length);for(let t of e.indices)e.bits[t]=1;e.indices.length=0}}function MD(e,t){if(!kD(e))return;let n=t.get(DD);n===void 0&&(n={indices:[],bits:void 0,length:rE(DD).length},t.set(DD,n)),jD(n,OD)}function ND(e){if(e.bits===void 0)return[];let t=[],n=e.bits;for(let e=0;e<n.length;){for(;e<n.length&&n[e]===0;)e+=1;if(e===n.length)break;let r=e,i=e,a=0,o=0;for(;e<n.length;){if(n[e]!==0)a+=1,i=e,o=0;else if(++o>1)break;e+=1}let s=i-r+1;a>=256&&a*2>=s&&t.push({start:r,length:s})}return t}function PD(e,t){for(let n of e)if(t>=n.start&&t<n.start+n.length)return!0;return!1}function FD(e){if(e.writeKey!==void 0&&oO.has(e.writeKey)||e.deleteKey!==void 0&&oO.has(e.deleteKey))return!0;if(e.writes!==void 0){for(let t of e.writes.keys())if(oO.has(t))return!0}if(e.deletes!==void 0){for(let t of e.deletes)if(oO.has(t))return!0}return!1}function ID(e,t){for(let n=iE(e);n!==void 0;n=iE(n))if(t.has(n))return!0;return!1}function LD(e){for(let t=e;t!==void 0;t=iE(t))if(iE(t)!==void 0&&t.parentPlacement)return!0;return!1}function RD(e,t,n,r,i){let a=[...t,r],o=e.readded?.has(r)||!Object.hasOwn(rE(e),r)?void 0:rE(e)[r],s=xD(i,e.context),c=qD(n,a,o,s);return rO(o)&&rO(s)&&!c}function zD(e,t,n){if(e.readded!==void 0)for(let r of e.readded)Object.hasOwn(rE(e),r)&&n.push([`d`,[...t,r]]);let r=!1;if(e.writeKey!==void 0&&(r=RD(e,t,n,e.writeKey,DE(e,e.writeKey))),e.writes!==void 0)for(let[i,a]of e.writes){if(n.length>WT)return r;RD(e,t,n,i,oE(e.context,a))&&(r=!0)}if(e.deleteKey!==void 0&&Object.hasOwn(rE(e),e.deleteKey)&&n.push([`d`,[...t,e.deleteKey]]),e.deletes!==void 0)for(let i of e.deletes){if(n.length>WT)return r;Object.hasOwn(rE(e),i)&&n.push([`d`,[...t,i]])}return r}function BD(e){let t=kE(e);if(t.plan!==void 0)return t.plan;let n=rE(e),r=UE(t);return t.plan=VD(n.length,r)??HD(n.length,r),t.plan}function VD(e,t){let n=[];for(let e of t)if(e.kind===`base`&&e.length!==0){if(e.step!==1&&e.length>1||n.length>0&&e.start<=n[n.length-1])return;n.push(e.start,e.start+e.length-1)}let r=[],i=e;for(let e=n.length-2;e>=-2;e-=2){let t=e>=0?n[e+1]+1:0;i>t&&r.push(t,i-t),e>=0&&(i=n[e])}return{removeRuns:r,permutation:void 0,insertRuns:UD(t)}}function HD(e,t){let n=new Uint8Array(e),r=[];for(let e of t)if(e.kind===`base`)for(let t=0;t<e.length;t++){let i=e.start+e.step*t;n[i]=1,r.push(i)}let i=[];for(let t=e;t>0;){if(n[t-1]!==0){--t;continue}let e=t-1;for(;e>0&&n[e-1]===0;)--e;i.push(e,t-e),t=e}let a=[];for(let e=0;e<n.length;e++)n[e]!==0&&a.push(e);let o;if(r.some((e,t)=>e!==a[t])){let e=new Map(a.map((e,t)=>[e,t]));o=r.map(t=>e.get(t))}return{removeRuns:i,permutation:o,insertRuns:UD(t)}}function UD(e){let t=[],n=0;for(let r=0;r<e.length;){let i=e[r];if(i.kind===`base`){n+=i.length,r+=1;continue}let a=r;for(;r<e.length&&e[r].kind===`insert`;)n+=e[r].length,r+=1;t.push(n-WD(e,a,r),a,r)}return t}function WD(e,t,n){let r=0;for(let i=t;i<n;i++)r+=e[i].length;return r}function GD(e,t,n,r){let i=kE(e),a=rE(e);if(r!==void 0)for(let i of r){if(n.length>WT)return;n.push([`p`,t,i.start,i.length,KD(e,i)])}if(i.structural){let r=BD(e);for(let e=0;e<r.removeRuns.length;e+=2){if(n.length>WT)return;n.push([`p`,t,r.removeRuns[e],r.removeRuns[e+1],[]])}r.permutation!==void 0&&n.push([`m`,t,r.permutation]);let a=UE(i);for(let i=0;i<r.insertRuns.length;i+=3){if(n.length>WT)return;let o=r.insertRuns[i],s=[];for(let t=r.insertRuns[i+1];t<r.insertRuns[i+2];t++){let n=a[t];for(let t=0;t<n.length;t++){let r=n.start+n.step*t;s.push(xD(YE(e,n,r),e.context))}}n.push([`p`,t,o,0,s])}}for(let[o,s]of i.baseOverrides??[]){if(n.length>WT)return;let c=ZD(i,1,o,void 0);c===void 0||r!==void 0&&PD(r,c)||qD(n,[...t,c],a[o],xD(oE(e.context,s),e.context))}}function KD(e,t){let n=kE(e),r=[];for(let i=t.start;i<t.start+t.length;i++){let t=qE(n,i),a=t.start+t.step*n.locatedOffset;r.push(xD(YE(e,t,a),e.context))}return r}function qD(e,t,n,r){if(!rO(r)&&n===r||rO(n)&&rO(r)&&$D(n,r))return!1;if(typeof n==`string`&&typeof r==`string`){if(r.length>n.length&&r.slice(0,n.length)===n)return e.push([`a`,t,r.slice(n.length)]),!0;let i=aO(n,r,65536);if(i>0)return e.push([`t`,t,n.length-i]),r.length>i&&e.push([`a`,t,r.slice(i)]),!0}return e.push([`s`,t,r]),!0}function JD(e,t,n){t.length===0?e.push([`r`,n]):e.push([`s`,t,n])}function YD(e){if(e.preparedPath!==void 0)return e.preparedPath;let t=iE(e);if(t===void 0)return e.preparedPath=[],e.preparedPath;let n=YD(t);if(n===void 0)return;if(e.parentKind===0){let r=e.parentKey;return!EE(t,r)||DE(t,r)!==rE(e)?void 0:(e.preparedPath=[...n,r],e.preparedPath)}let r=kE(t),i=ZD(r,e.parentKind,e.parentKey,e.parentSource);if(i!==void 0&&YE(t,qE(r,i),e.parentKey)===rE(e))return e.preparedPath=[...n,i],e.preparedPath}function XD(e){if(e.baseLocations!==void 0)return;e.baseLocations=[],e.insertLocations=new Map;let t=0;for(let n of UE(e)){let r=n.start+n.step*(n.length-1),i={piece:n,logicalStart:t,minimum:Math.min(n.start,r),maximum:Math.max(n.start,r)};if(n.kind===`base`)e.baseLocations.push(i);else{let t=e.insertLocations.get(n.source);t===void 0&&(t=[],e.insertLocations.set(n.source,t)),t.push(i)}t+=n.length}let n=(e,t)=>e.minimum-t.minimum;e.baseLocations.sort(n);for(let t of e.insertLocations.values())t.sort(n)}function ZD(e,t,n,r){if(t===1&&!e.structural)return n;XD(e);let i=t===1?e.baseLocations:e.insertLocations.get(r);if(i===void 0)return;let a=0,o=i.length;for(;a<o;){let e=a+o>>>1;i[e].minimum<=n?a=e+1:o=e}let s=i[a-1];if(s===void 0||n>s.maximum)return;let c=(n-s.piece.start)/s.piece.step;return c>=0&&c<s.piece.length?s.logicalStart+c:void 0}function QD(e){if(e.ops!==void 0)return e.ops;if(dE(e),e.replacement){let t=e.tracker.deref()?.replacementBase(e);e.replacementNoop=t!==void 0&&$D(t,rE(e.root)),e.ops=e.replacementNoop?[]:[[`r`,rE(e.root)]]}else e.ops=TD(e);return e.ops}function $D(e,t){if(e===t)return!0;if(!rO(e)||!rO(t)||Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)){let n=t;if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(!$D(e[t],n[t]))return!1;return!0}let n=t,r=Object.keys(e);if(r.length!==Object.keys(n).length)return!1;for(let t of r)if(!Object.hasOwn(n,t)||!$D(e[t],n[t]))return!1;return!0}function eO(e){e.status.value!==`aborted`&&e.status.value!==`consumed`&&e.status.value!==`stale`&&(e.status.value=`aborted`,nO(e))}function tO(e){e.tracker.deref()?.releaseContext(e),DD?.context===e&&(DD=void 0),e.overlayReleased=!0,e.dirty.length=0,e.nodes.length=0,e.rawNodes=void 0,e.ops=void 0,e.root=void 0,e.bases=void 0,e.stored=void 0,e.baseValue=void 0}function nO(e){e.tracker.deref()?.releaseContext(e),DD?.context===e&&(DD=void 0);for(let t of e.nodes)Array.isArray(t.target)&&(t.target.length=0),Reflect.deleteProperty(t.target,BT),t.writes?.clear(),t.deletes?.clear(),t.readded?.clear(),t.array?.pieces!==void 0&&(t.array.pieces.length=0),t.array!==void 0&&(t.array.root=void 0,t.array.baseLocations=void 0,t.array.insertLocations=void 0),t.array?.baseOverrides?.clear(),t.array?.insertOverrides?.clear(),t.parentSource=void 0,t.target=HT,t.proxy=HT,t.writeKey=void 0,t.writeValue=void 0,t.writes=void 0,t.deleteKey=void 0,t.deletes=void 0,t.readded=void 0,t.array=void 0,t.subtreeDirty=void 0,t.preparedPath=void 0;e.dirty.length=0,e.nodes.length=0,e.rawNodes=void 0,e.ops=void 0,e.root=void 0,e.bases=void 0,e.stored=void 0,e.baseValue=void 0,e.overlayReleased=!0}function rO(e){return typeof e==`object`&&!!e}var iO=e=>typeof e==`object`&&!!e;function aO(e,t,n,r=64,i=8){if(e.length===0||t.length===0||n===0)return 0;let a=e.length>n?e.slice(e.length-n):e;for(let e of[Math.min(r,t.length),1]){let n=t.slice(0,e),r=0;for(let e=a.indexOf(n);e!==-1&&!(++r>i);e=a.indexOf(n,e+1)){let n=a.length-e;if(n<=t.length&&a.slice(e)===t.slice(0,n))return n}if(e===1)break}return 0}var oO=new Set([`__proto__`,`constructor`,`prototype`]),sO=class extends Error{segment;constructor(e){super(`unsafe path segment: ${String(e)}`),this.segment=e,this.name=`UnsafePathError`}};function cO(e){if(!Array.isArray(e)||e.length===0)throw TypeError(`op is not a tuple`);switch(e[0]){case`r`:if(e.length!==2)throw TypeError(`r arity`);return;case`s`:if(e.length!==3)throw TypeError(`s arity`);lO(e[1],!0);return;case`d`:if(e.length!==2)throw TypeError(`d arity`);lO(e[1],!0);return;case`a`:if(e.length!==3||typeof e[2]!=`string`)throw TypeError(`a shape`);lO(e[1],!0);return;case`t`:if(e.length!==3||!Number.isInteger(e[2])||e[2]<0)throw TypeError(`t shape`);lO(e[1],!0);return;case`p`:if(e.length!==5)throw TypeError(`p arity`);if(lO(e[1]),!Number.isInteger(e[2])||e[2]<0)throw TypeError(`p index`);if(!Number.isInteger(e[3])||e[3]<0)throw TypeError(`p remove`);if(!Array.isArray(e[4]))throw TypeError(`p items`);return;case`m`:if(e.length!==3)throw TypeError(`m arity`);lO(e[1]),uO(e[2]);return;default:throw TypeError(`unknown op verb: ${String(e[0])}`)}}function lO(e,t=!1){if(!Array.isArray(e))throw TypeError(`path is not an array`);if(t&&e.length===0)throw TypeError(`path is empty`);fO(e)}function uO(e){if(!Array.isArray(e))throw TypeError(`m permutation is not an array`);let t=new Uint8Array(e.length);for(let n of e){if(!Number.isInteger(n)||n<0||n>=e.length||t[n]!==0)throw TypeError(`m permutation is not a bijection`);t[n]=1}}function dO(e){if(!Array.isArray(e)||e.length===0)throw TypeError(`op is not a tuple`);let[t]=e,n=e=>{if(typeof e==`number`){if(!Number.isInteger(e)||e<0)throw TypeError(`bad path id`)}else{if(!Array.isArray(e))throw TypeError(`path is not an array`);fO(e)}};switch(t){case`r`:if(e.length!==2)throw TypeError(`r arity`);return;case`s`:if(e.length===3)n(e[1]);else if(e.length!==2)throw TypeError(`s arity`);return;case`d`:if(e.length===2)n(e[1]);else if(e.length!==1)throw TypeError(`d arity`);return;case`a`:if(e.length===3){if(n(e[1]),typeof e[2]!=`string`)throw TypeError(`a value`)}else if(e.length===2){if(typeof e[1]!=`string`)throw TypeError(`a value`)}else throw TypeError(`a arity`);return;case`t`:if(e.length===3){if(n(e[1]),!Number.isInteger(e[2])||e[2]<0)throw TypeError(`t count`)}else if(e.length===2){if(!Number.isInteger(e[1])||e[1]<0)throw TypeError(`t count`)}else throw TypeError(`t arity`);return;case`p`:{let[t,r,i]=e.length===5?[e[2],e[3],e[4]]:e.length===4?[e[1],e[2],e[3]]:[];if(i===void 0)throw TypeError(`p arity`);if(e.length===5&&n(e[1]),!Number.isInteger(t)||t<0)throw TypeError(`p index`);if(!Number.isInteger(r)||r<0)throw TypeError(`p remove`);if(!Array.isArray(i))throw TypeError(`p items`);return}case`m`:if(e.length===3)n(e[1]);else if(e.length!==2)throw TypeError(`m arity`);uO(e[e.length-1]);return;case`#`:if(e.length!==3||!Number.isInteger(e[1])||e[1]<0||!Array.isArray(e[2]))throw TypeError(`# shape`);fO(e[2]);return;default:throw TypeError(`unknown op verb: ${String(t)}`)}}function fO(e){for(let t of e)if(typeof t==`string`){if(oO.has(t))throw new sO(t)}else if(!Number.isInteger(t)||t<0)throw new sO(t)}function pO(e,t){if(t>e.length)throw new sO(t)}var mO=class extends Error{path;constructor(e){super(`unresolvable path: ${JSON.stringify(e)}`),this.path=e,this.name=`PathError`}};function hO(e,t){let n=e;for(let e of t){if(cO(e),e[0]===`r`){n=e[1];continue}let t=e[1];if(fO(t),e[0]===`p`){let r=t.length===0?n:xO(n,t);if(!Array.isArray(r))throw new mO(t);r.splice(e[2],e[3]);let i=1e4;for(let t=0;t<e[4].length;t+=i)r.splice(e[2]+t,0,...e[4].slice(t,t+i));continue}if(e[0]===`m`){let r=t.length===0?n:xO(n,t);if(!Array.isArray(r)||r.length!==e[2].length)throw new mO(t);let i=r.slice();for(let t=0;t<e[2].length;t++)r[t]=i[e[2][t]];continue}let r=xO(n,t.slice(0,-1)),i=t[t.length-1];if(Array.isArray(r)){if(typeof i!=`number`)throw new sO(i);pO(r,i)}let a=e=>{Object.defineProperty(r,i,{value:e,writable:!0,enumerable:!0,configurable:!0})},o=()=>Object.hasOwn(r,i)?r[i]:void 0;switch(e[0]){case`s`:a(e[2]);break;case`d`:if(Array.isArray(r)){if(typeof i!=`number`||i>=r.length)throw new mO(t);r.splice(i,1)}else delete r[i];break;case`a`:{let n=o();if(typeof n!=`string`)throw new mO(t);a(`${n}${e[2]}`);break}case`t`:{let n=o();if(typeof n!=`string`)throw new mO(t);a(n.slice(e[2]));break}}}return n}function gO(e,t){return _O(e,[t])}function _O(e,t){let n=e,r=new WeakSet;for(let e of t)for(let t of e)if(cO(t),t[0]===`r`)n=t[1];else{if(t[0]===`p`){let e=vO(n,t,r);if(e!==void 0){n=e;continue}}n=yO(n,t[0]===`p`||t[0]===`m`?t[1]:t[1].slice(0,-1),r),n=hO(n,[t])}return n}function vO(e,t,n){let[,r,i,a,o]=t;if(a!==0)return;let s=e;for(let e of r){if(!(typeof e==`string`?!oO.has(e)&&iO(s)&&!Array.isArray(s):Number.isInteger(e)&&e>=0&&Array.isArray(s))||!Object.hasOwn(s,e))return;s=s[e]}if(!Array.isArray(s)||n.has(s)||i!==s.length)return;let c=s.concat(o);if(n.add(c),r.length===0)return c;let l=r.slice(0,-1),u=yO(e,l,n);return Object.defineProperty(xO(u,l),r[r.length-1],{value:c,writable:!0,enumerable:!0,configurable:!0}),u}function yO(e,t,n){let r=e=>{if(Array.isArray(e))return e.slice();if(!iO(e))throw new mO(t);let n=Object.create(Object.getPrototypeOf(e)===null?null:Object.prototype);for(let t of Object.keys(e))Object.defineProperty(n,t,{value:e[t],writable:!0,enumerable:!0,configurable:!0});return n};if(!iO(e))throw new mO(t);let i;n.has(e)?i=e:(i=r(e),n.add(i));let a=i;for(let e of t){if(!Object.hasOwn(a,e))throw new mO(t);if(Array.isArray(a)&&typeof e!=`number`)throw new sO(e);let i=a[e];if(!iO(i))throw new mO(t);if(n.has(i)){a=i;continue}let o=r(i);Object.defineProperty(a,e,{value:o,writable:!0,enumerable:!0,configurable:!0}),n.add(o),a=o}return i}function bO(e,t){let n=e;for(let e of t){if(!iO(n))throw new mO(t);if(Array.isArray(n)&&typeof e!=`number`)throw new sO(e);if(!Object.hasOwn(n,e))throw new mO(t);n=n[e]}return n}function xO(e,t){let n=bO(e,t);if(!iO(n))throw new mO(t);return n}var SO=e=>JSON.stringify(e);function CO(){let e=new Set,t=new Map,n=0,r;return{encode(i){r=void 0;let a=[];for(let o of i){if(o[0]===`r`){a.push(o),e.clear(),t.clear(),n=0,r=void 0;continue}let i=o[1],s=SO(i);if(s===r){switch(o[0]){case`s`:a.push([`s`,o[2]]);break;case`d`:a.push([`d`]);break;case`a`:a.push([`a`,o[2]]);break;case`t`:a.push([`t`,o[2]]);break;case`p`:a.push([`p`,o[2],o[3],o[4]]);break;case`m`:a.push([`m`,o[2]])}continue}let c=i,l=t.get(s);if(l!==void 0)c=l;else if(e.has(s)){let e=n++;t.set(s,e),a.push([`#`,e,i]),c=e}else e.add(s);switch(o[0]){case`s`:a.push([`s`,c,o[2]]);break;case`d`:a.push([`d`,c]);break;case`a`:a.push([`a`,c,o[2]]);break;case`t`:a.push([`t`,c,o[2]]);break;case`p`:a.push([`p`,c,o[2],o[3],o[4]]);break;case`m`:a.push([`m`,c,o[2]])}r=s}return a}}}function wO(){let e=new Map;return{decode(t){let n,r=[];for(let i of t){if(dO(i),i[0]===`#`){fO(i[2]),e.set(i[1],i[2]);continue}if(i[0]===`r`){r.push(i),e.clear(),n=void 0;continue}let t=i[0]===`d`&&i.length===1||i[0]!==`d`&&i[0]!==`p`&&i.length===2||i[0]===`p`&&i.length===4,a;if(t){if(n===void 0)throw new mO([]);a=n}else{let t=i[1];if(typeof t==`number`){let n=e.get(t);if(n===void 0)throw new mO(t);a=n}else a=t;n=a}if(i[0]!==`p`&&i[0]!==`m`&&a.length===0)throw new mO(a);switch(i[0]){case`s`:r.push([`s`,a,t?i[1]:i[2]]);break;case`d`:r.push([`d`,a]);break;case`a`:r.push([`a`,a,t?i[1]:i[2]]);break;case`t`:r.push([`t`,a,t?i[1]:i[2]]);break;case`p`:{let[e,n,o]=t?[i[1],i[2],i[3]]:[i[2],i[3],i[4]];r.push([`p`,a,e,n,o]);break}case`m`:r.push([`m`,a,t?i[1]:i[2]])}}return r}}}var TO=0,EO=class{#e=new Set;#t=new Set;#n;constructor(e){this.#n=e}subscribe(e,t){return this.#e.add(e),this.#r(e,t),()=>this.#e.delete(e)}events(e,t){return this.#t.add(e),this.#r(e,{type:`snap`,value:t}),()=>this.#t.delete(e)}emit(e){let t=[...this.#t],n=[...this.#e];Zw(()=>{for(let n of t)this.#t.has(n)&&this.#r(n,e);for(let t of n)this.#e.has(t)&&this.#r(t,e.value)})}#r(e,t){try{e(t)}catch(e){this.#n(e)}}},DO=class{key;seq=++TO;dependents=new Set;schemas=[];options;fanout;constructor(e,t){this.key=e,this.options=t,this.fanout=new EO(t.report)}subscribe(e){return this.fanout.subscribe(e,this.value)}events(e){return this.fanout.events(e,this.value)}validate(e){if(this.options.dev){for(let t of this.ownSchemas())Cw(`state`,`state ${this.key}`,t,e);for(let t of this.schemas)Cw(`state`,`state ${this.key}`,t,e)}}ownSchemas(){return[]}};function OO(e,t){let n=[];for(let r of e){if(r[0]===`r`||r[1].length===0)return[[`r`,t]];let e=r[1].slice(1);switch(r[0]){case`p`:n.push([`p`,e,r[2],r[3],r[4]]);break;case`m`:n.push([`m`,e,r[2]]);break;default:if(e.length===0)return[[`r`,t]];r[0]===`d`?n.push([`d`,e]):n.push([r[0],e,r[2]])}}return n}var kO=class extends DO{schema;#e;#t;constructor(e,t,n,r,i){super(e,i),Cw(`state`,`initial value of state ${e}`,t,n),this.schema=t,this.#e=XT({v:n}),this.#t=r}ownSchemas(){return[this.schema]}get value(){return this.#e.value.v}change(e,t){this.#t(e);let n=this.#e.beginChange(),r;try{let e=n.state,i=t(e.v);if(i instanceof Promise)throw TypeError(`cell.change callbacks must be synchronous`);i!==void 0&&(i!==e.v&&Cw(`state`,`state ${this.key}`,this.schema,i),e.v=i),r=n.prepare()}catch(e){throw n.abort(),e}this.#n(r,`ops`)}replace(e,t,n={}){this.#t(e);let r=this.value,i=n.diff??AO(r,t)?ET(r,t):void 0;this.#n(this.#e.prepareReplace({v:t}),`ops`,!0,i)}reset(e,t){this.schema=t,this.#n(this.#e.prepareReplace({v:e}),`reset`,!1)}#n(e,t,n=!0,r){if(e.ops.length===0&&t===`ops`){this.#e.adopt(e);return}let i=e.value.v,a;try{n&&this.validate(i),a=jO(this,i,n)}catch(t){throw e.abort(),t}Qw(()=>{this.#e.adopt(e);let n=r!==void 0&&r.length>0?r:OO(e.ops,i);this.fanout.emit(t===`reset`?{type:t,value:i}:{type:t,ops:n,value:i});for(let[e,t]of a)e.install(t)})}};function AO(e,t){if(e===null||t===null||typeof e!=`object`||typeof t!=`object`||e===t||Array.isArray(e)!==Array.isArray(t))return!1;for(let[n,r]of Object.entries(t))if(typeof r==`object`&&r&&e[n]===r)return!0;return!1}function jO(e,t,n=!0){let r=new Set,i=e=>{for(let t of e.dependents)r.has(t)||(r.add(t),i(t))};i(e);let a=new Map([[e,t]]),o=new Map;for(let e of[...r].sort((e,t)=>e.seq-t.seq)){let t=e.compute(e=>a.has(e)?a.get(e):e.value);n&&e.validate(t),a.set(e,t),o.set(e,t)}return o}var MO=e=>typeof e==`object`&&!!e&&typeof e.subscribe==`function`&&`value`in e,NO=class extends DO{sources;#e;#t;#n=[];constructor(e,t,n,r){super(e,r),this.sources=t.map(t=>{if(!MO(t))throw TypeError(`derive ${e}: sources must be readables`);return t}),this.#e=n,this.#t=void 0}get value(){return this.#t}attach(e){this.#t=e?.has(this)?e.get(this):this.compute(e=>e.value);for(let e of this.sources)e instanceof DO?e.dependents.add(this):this.#n.push(e.subscribe(()=>this.refresh()))}detach(){for(let e of this.sources)e instanceof DO&&e.dependents.delete(this);for(let e of this.#n.splice(0))e()}compute(e,t=this.#e){let n=t(...this.sources.map(e));if(n instanceof Promise)throw TypeError(`derive ${this.key}: fn must be synchronous`);return n}setFn(e){this.#e=e}refresh(){try{let e=this.compute(e=>e.value),t=jO(this,e);Qw(()=>{this.install(e);for(let[e,n]of t)e.install(n)})}catch(e){this.options.report(e)}}install(e){let t=this.#t;this.#t=e;let n=t===void 0||e===void 0?[[`r`,e??null]]:ET(t,e);n.length>0&&this.fanout.emit({type:`ops`,ops:n,value:e})}},PO=e=>e instanceof DO,FO=e=>new j(`not_ready`,`${e} is not ready`),IO=()=>{},LO=(e,t,n,r)=>({contract:e,factory:t,options:n,facet:r,stateVersion:n.state?.version??1}),RO=class{resource;constructor(e){this.resource=e}},zO=class{key;spec;deps;state=`closed`;#e;constructor(e,t,n){this.key=e,this.spec=t,this.deps=n}get value(){if(this.state===`unavailable`)throw new j(`unavailable`,`resource ${this.key} could not be restored`);if(this.state!==`open`)throw FO(`resource ${this.key}`);return this.#e}get exclusive(){return this.spec.exclusive===!0}async open(e,t){if(this.state!==`closed`)return;this.state=`opening`;let n;try{n=await this.spec.open({signal:e})}catch(e){throw this.state=`closed`,e}if(e.aborted)throw this.state=`closed`,await this.spec.close?.(n),new j(`aborted`,`resource ${this.key} opened after abort`);this.#e=n,this.state=`open`,t.push(this)}async close(e){if(this.state!==`open`)return;this.state=`closed`;let t=e.indexOf(this);t!==-1&&e.splice(t,1);let n=this.#e;this.#e=void 0,await this.spec.close?.(n)}markUnavailable(){this.state=`unavailable`,this.#e=void 0}},BO=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t,VO.set(this,e)}get key(){return this.#e.key}get value(){if(this.#t.inFactory>0)throw FO(`resource ${this.key} (inside a factory)`);return this.#e.value}},VO=new WeakMap,HO=e=>e instanceof zO?e:typeof e==`object`&&e?VO.get(e):void 0,UO=class{cells=new Map;cellSchemas=new Map;holds=new Map;resources=new Map;listeners=new Map;tasks=new Map;derives=new Map;deriveFns=new Map;registrations=new Map},WO=class e{host;signal;rootId;epoch;principal;holder;#e=[];#t=!1;get closed(){return this.#t}check(e){if(this.host!==e)throw Ii(`foreign_ctx`,`ctx belongs to another host`);if(this.#t)throw new j(`aborted`,`ctx expired: its call already settled`,{reason:`expired`});if(this.signal.aborted)throw new j(`aborted`,`ctx aborted`,{cause:this.signal.reason})}constructor(e,t){this.host=e,this.signal=t.signal,this.rootId=t.rootId,this.epoch=t.epoch,this.principal=t.principal,this.holder=t.holder??!1}get(e,t,n){this.check(this.host);let r=this.host.acquire(e,t,{principal:this.principal,...n},`call`);return this.#e.push(r),r.proxy}child(t){return new e(this.host,{signal:AbortSignal.any([this.signal,t.callAbort.signal]),rootId:this.rootId,epoch:this.epoch,principal:this.host.principal})}close(){this.#t=!0;for(let e of this.#e.splice(0))e.release()}};async function GO(e,t){if(t.aborted)throw new j(`aborted`,`call aborted`,{cause:t.reason});let n=IO,r=new Promise((e,r)=>{n=()=>r(new j(`aborted`,`call aborted`,{cause:t.reason})),t.addEventListener(`abort`,n,{once:!0})});try{return await Promise.race([e,r])}finally{t.removeEventListener(`abort`,n)}}var KO=new Set([`contract`,`status`,`ready`,`kind`,`shape`,`error`,`onShape`,`onStatus`,`release`]);function qO(e,t,n,r){if(e.size===0)return;let i=[...e];Zw(()=>{for(let e of i)try{e(t,n)}catch(e){r(e)}})}var JO=new WeakMap,YO=e=>typeof e==`object`&&e?JO.get(e):void 0,XO=class{#e;#t;#n=new Set;#r=new Set;#i;#a=IO;#o;constructor(e,t){this.#e=e,this.#t=t}get value(){return this.#s()?.value}subscribe(e){return this.#n.add(e),this.#o=this.value,this.#l(()=>e(this.#o)),this.bind(),()=>this.#c(this.#n,e)}events(e){return this.#r.add(e),this.#o=this.value,this.#l(()=>e({type:`snap`,value:this.#o})),this.bind(),()=>this.#c(this.#r,e)}bind(){let e=this.#n.size+this.#r.size>0?this.#s():void 0;if(e===this.#i||(this.#a(),this.#a=IO,this.#i=e,e===void 0))return;let t=!0;this.#a=e.events(e=>{let n=t;if(t=!1,n&&e.value===this.#o)return;this.#o=e.value;let r=n?{type:`reset`,value:e.value}:e,i=[...this.#r],a=[...this.#n];Zw(()=>{for(let e of i)this.#r.has(e)&&this.#l(()=>e(r));for(let t of a)this.#n.has(t)&&this.#l(()=>t(e.value))})})}stop(){this.#n.clear(),this.#r.clear(),this.bind()}#s(){let e=this.#e.currentView();if(e===void 0||!this.#e.inVariant(e,this.#t))return;let t=e[this.#t];return PO(t)||tk(t)?t:void 0}#c(e,t){e.delete(t),this.bind()}#l(e){try{e()}catch(e){this.#e.record.host.report(e)}}},ZO=class{record;contract;owner;address;proxy;ready;status;error;shapeListeners=new Set;goneListeners=new Set;readables=new Map;bindings=new Map;views=new WeakMap;callers=new Map;constructor(e,t,n){this.record=e,this.contract=t,this.owner=n,this.address=e.address,this.status=e.status===`live`?`live`:`loading`,this.ready=e.ready.then(()=>{if(this.status===`gone`)throw this.error;if(this.status===`released`)throw new j(`released`,`handle ${this.address} released`)}),this.ready.catch(IO),this.proxy=new Proxy(this,{get:(e,t)=>{if(KO.has(t)){let n=Reflect.get(e,t,e);return typeof n==`function`?n.bind(e):n}if(typeof t==`string`&&t!==`then`)return e.member(t)},has:(e,t)=>KO.has(t)||e.member(String(t))!==void 0}),JO.set(this.proxy,this)}get kind(){let e=this.currentView();return e===void 0?void 0:QO(e)}get shape(){let e=this.status===`live`?this.record.currentInstalled():void 0,t=e===void 0?void 0:this.#n(e);if(e!==void 0&&t!==void 0)return{kind:QO(t),members:Object.keys(t).filter(e=>e!==`kind`),contract:e.service.contract.fingerprint,epoch:e.epoch}}onShape(e){return this.shapeListeners.add(e),()=>this.shapeListeners.delete(e)}onStatus(e){return this.#e.add(e),()=>this.#e.delete(e)}#e=new Set;#t(){qO(this.#e,this.status,this.error,e=>this.record.host.report(e))}release(){this.status!==`released`&&this.status!==`gone`&&(this.status=`released`,this.#r(),this.#t(),this.record.release(this))}live(){this.status===`loading`&&(this.status=`live`,this.#t(),this.shapeChanged())}gone(e){if(this.status!==`released`&&this.status!==`gone`){this.status=`gone`,this.error=e,this.#r(),this.#t();for(let t of[...this.goneListeners])t(e)}}shapeChanged(){for(let e of this.readables.values())e.bind();let e=this.shape;if(e===void 0)return;let t=[...this.shapeListeners];Zw(()=>{for(let n of t)try{n(e)}catch(e){this.record.host.report(e)}})}terminalError(){return this.status===`gone`?this.error:new j(`released`,`handle ${this.address} released`)}viewOf(e){let t=this.bindings.get(e.service);if(this.bindings.has(e.service)||(t=Gw(e.service.contract,e.service.options.accepts,this.contract),this.bindings.set(e.service,t)),t===void 0)return e.behavior;let n=this.views.get(e.behavior);return n===void 0&&(n=t(e.behavior),this.views.set(e.behavior,n)),n}currentView(){if(this.status!==`live`)return;let e=this.record.currentInstalled();return e===void 0?void 0:this.#n(e)}#n(e){try{return this.viewOf(e)}catch(e){this.record.host.report(e);return}}describe(e,t){let n=this.contract.description.variants;if(e!==void 0)return n[e]?.[t];for(let e of Object.values(n))if(e[t]!==void 0)return e[t]}inVariant(e,t){return this.contract.scope!==`remote`||this.describe(QO(e),t)!==void 0}member(e){let t=this.describe(void 0,e),n=this.currentView(),r=n?.[e];if(t?.kind===`method`||t===void 0&&typeof r==`function`)return this.caller(e);if(t?.kind===`state`||t===void 0&&(PO(r)||tk(r))){let t=this.readables.get(e);return t===void 0&&(t=new XO(this,e),this.readables.set(e,t)),t}if(n!==void 0&&this.inVariant(n,e))return r instanceof RO?r.resource.value:r}caller(e){let t=this.callers.get(e);return t===void 0&&(t=(t,n)=>{if(this.record.host.inFactory>0)throw new j(`not_ready`,`${this.address}.${e} called inside a factory`);if(n!==void 0&&!(n instanceof WO))return Promise.reject(Ii(`foreign_ctx`,`ctx must come from a Chord host`));if(n===void 0||n.holder){try{n?.check(this.record.host)}catch(e){return Promise.reject(e)}return this.record.host.root(n=>this.record.call(this,e,t,n),{signal:n?.signal})}return this.record.call(this,e,t,n)},this.callers.set(e,t)),t}#r(){for(let e of this.readables.values())e.stop()}},QO=e=>typeof e.kind==`string`?e.kind:void 0,$O=(e,t)=>e===t||e!==void 0&&t!==void 0&&String(e)===String(t),ek=class{host;address;typeName;input;principal;eager;status=`activating`;ready=Promise.resolve();service;stateVersion=0;minEpoch=0;decls=new UO;pending=new Set;behaviors=new Map;holds=new Set;leases=new Map;openOrder=[];callAbort=new AbortController;activationAbort=new AbortController;gate;deferredRuntime=!1;#e=new Map;#t=new Set;#n=new Map;#r=[];#i;#a;constructor(e,t){this.host=e,this.address=t.address,this.typeName=t.typeName,this.input=t.input,this.principal=t.principal,this.eager=t.eager}start(e){this.ready=this.#o(e).then(()=>{for(let e of this.holds)e.live();this.#d()},e=>{this.status===`activating`&&(this.status=`failed`),this.host.forget(this);let t=Li(e,`activating ${this.address}`);for(let e of this.holds)e.gone(t);throw t}),this.ready.catch(IO)}async#o(e){await e?.catch(IO);let t=this.activationAbort.signal,n=()=>new j(`aborted`,`${this.address} abandoned`);if(t.aborted)throw n();let r=this.host.service(this.typeName);if(r===void 0)throw new j(`unavailable`,`${this.typeName} is not served`,{reason:`unknown_type`});this.service=r,this.stateVersion=r.stateVersion;let i=this.run(r,void 0);try{if(await this.open(i.created.resources,i.created.holds,t),t.aborted)throw n();this.host.checkRegistrations(this,i.decls),this.decls=i.decls;for(let[e,t]of this.host.retainedEpochs())t.get(this.typeName)===r&&this.behaviors.set(e,{epoch:e,service:r,behavior:i.behavior,decls:i.decls});let e=this.host.pendingEpoch();if(!this.behaviors.has(this.host.currentEpoch())&&(e===void 0||!this.behaviors.has(e)))throw new j(`superseded`,`${this.address}: code changed during activation`);for(let e of i.created.derives)e.attach();if(this.refreshSchemas(),this.deferredRuntime=!this.behaviors.has(this.host.currentEpoch()),this.deferredRuntime||(i.decls.registrations.size>0&&this.host.registriesChanged(this),this.startRuntime()),t.aborted)throw n();this.status=`live`}catch(e){this.callAbort.abort(e),this.stopListeners(),this.stopTasks();let t=this.decls.registrations.size>0&&!this.deferredRuntime;throw this.behaviors.clear(),this.decls=new UO,t&&this.host.registriesChanged(),await Promise.allSettled([...this.#t,...this.#r.splice(0)]),await this.unwind(i).catch(e=>this.host.report(e)),e}finally{this.pending.delete(i.decls)}}run(e,t){let n=new ik(this,t),r=e=>{this.pending.delete(e.decls),this.unwind(e).catch(e=>this.host.report(e))};this.pending.add(n.run(void 0).decls),this.host.inFactory++;let i;try{i=e.factory(this.input,this.principal,n)}catch(e){throw this.host.inFactory--,r(n.run(void 0)),e}this.host.inFactory--;let a=n.run(i);try{if(i instanceof Promise)throw Ii(`behavior`,`${this.typeName}: factories must be synchronous`);rk(e,a.behavior)}catch(e){throw r(a),e}return a}async open(e,t,n){let r=new Map,i=t=>{let a=r.get(t);return a===void 0&&(a=(async()=>{await Promise.all(t.deps.map(t=>t instanceof zO?e.includes(t)?i(t):void 0:t.ready)),await t.open(n,this.openOrder)})(),r.set(t,a)),a},a=(await Promise.allSettled([...e.map(i),...t.map(e=>e.ready)])).find(e=>e.status===`rejected`);if(a!==void 0)throw a.reason}async unwind(e){for(let t of e.created.derives)t.detach();await Ri([...[...e.created.resources].sort((e,t)=>this.openOrder.indexOf(t)-this.openOrder.indexOf(e)).map(e=>()=>e.close(this.openOrder)),...e.created.holds.map(e=>()=>e.release())],`${this.address}: cleanup failed`)}currentInstalled(){return this.behaviors.get(this.host.currentEpoch())??[...this.behaviors.values()].at(-1)}refreshSchemas(){let e=new Map;for(let t of this.behaviors.values())for(let[n,r]of nk(t.service,t.behavior))e.set(n,[...e.get(n)??[],...r]);for(let t of this.allDecls())for(let n of[...t.cells.values(),...t.derives.values()])n.schemas=e.get(n)??[]}allDecls(){let e=new Set([this.decls,...this.pending]);for(let t of this.behaviors.values())e.add(t.decls);return e}#s(e){return HO(e.source)??e.source}#c(e,t){let n=HO(t.source),r=n===void 0?t.source:n.value,i=t.select===void 0?r:t.select(r);if(typeof i?.subscribe!=`function`)throw Ii(`behavior`,`listener ${e}: source has no subscribe()`);return i}stageListeners(e){let t=new Map,n=new Set;try{for(let[r,i]of e.listeners){let e=this.#s(i),a=this.#e.get(r);if(a!==void 0&&a.origin===e&&$O(a.select,i.select)){n.add(r);continue}let o=this.#c(r,i),s={origin:e,select:i.select,unsubscribe:IO,buffer:[]};t.set(r,s),s.unsubscribe=o.subscribe(e=>{s.buffer===void 0?this.#l(r,e):s.buffer.push(e)})}}catch(e){for(let e of t.values())e.unsubscribe();throw e}return{activate:()=>{for(let[e,t]of this.#e)n.has(e)||(t.unsubscribe(),this.#e.delete(e));for(let[e,n]of t){this.#e.set(e,n);let t=n.buffer??[];n.buffer=void 0;for(let n of t)this.#l(e,n)}},discard:()=>{for(let e of t.values())e.unsubscribe()}}}startRuntime(){this.stageListeners(this.decls).activate(),this.startTasks()}startTasks(){for(let e of this.decls.tasks.keys())this.startTask(e,this.host.currentEpoch())}stopListeners(){for(let e of this.#e.values())e.unsubscribe();this.#e.clear()}startTask(e,t){let n=this.decls.tasks.get(e);if(n===void 0)return;let r=new AbortController,i=new WO(this.host,{signal:AbortSignal.any([r.signal,this.callAbort.signal]),rootId:`task:${this.address}:${e}`,epoch:t,principal:this.host.principal,holder:!0}),a=(async()=>{try{await n(i)}catch(e){i.signal.aborted||this.host.report(e)}finally{i.close(),this.#n.get(e)?.controller===r&&this.#n.delete(e)}})();this.#n.set(e,{controller:r,done:a})}stopTasks(){for(let e of this.#n.values())e.controller.abort(new j(`aborted`,`task stopped`)),this.#r.push(e.done);this.#n.clear()}#l(e,t){Zw(()=>{if(this.gate!==void 0){this.gate.queue.push({key:e,event:t});return}let n=this.decls.listeners.get(e);n===void 0||this.status!==`live`&&this.status!==`activating`||this.host.root(e=>{this.lease(e);let r=e.child(this);return this.#u(async()=>{try{await n.fn(t,r)}finally{r.close()}})}).catch(e=>this.host.report(e))})}openGate(){let e=this.gate;this.gate=void 0;for(let{key:t,event:n}of e?.queue??[])this.#l(t,n)}admit(e){if(this.host.failed!==void 0)throw new j(`unavailable`,`${this.host.name} failed and admits no work`,{reason:`host_failed`});if(!this.host.hasEpoch(e.epoch))throw new j(`superseded`,`epoch ${e.epoch} is retired`);if(e.epoch<this.minEpoch)throw new j(`upgrade_conflict`,`${this.address} was upgraded in epoch ${this.minEpoch}`);if(this.gate!==void 0&&!this.gate.grandfathered.has(e.rootId))throw new j(`upgrade_conflict`,`${this.address} is being upgraded`)}lease(e){this.leases.has(e.rootId)||(this.leases.set(e.rootId,e.epoch),this.host.touch(e.rootId,this))}guard=e=>{if(this.host.inFactory>0)throw Ii(`read_only`,`cells cannot be written while a factory runs`);if(e instanceof WO&&e.check(this.host),e.signal.aborted)throw new j(`aborted`,`write with an aborted ctx`);if(this.status===`disposed`)throw new j(`gone`,`${this.address} is disposed`);e.rootId.startsWith(`task:`)||this.admit(e)};async call(e,t,n,r){if(r.check(this.host),e.status===`released`||e.status===`gone`)throw e.terminalError();if(e.status===`loading`&&await GO(e.ready,r.signal),e.status!==`live`||this.status!==`live`)throw e.status===`live`?new j(`gone`,`${this.address} is ${this.status}`):e.terminalError();this.admit(r);let i=this.behaviors.get(r.epoch);if(i===void 0)throw new j(`superseded`,`${this.address} has no behavior for epoch ${r.epoch}`);let a=e.viewOf(i),o=QO(a),s=e.describe(e.contract.scope===`remote`?o:``,t),c=a[t];if(typeof c!=`function`||e.contract.scope===`remote`&&s?.kind!==`method`)throw new j(`not_in_variant`,`${this.address}: ${t} is not a method of variant ${o??`(local)`}`);let l=a===i.behavior?i.service.contract.description.variants[o??``]?.[t]:s,u=e.contract.scope===`remote`&&l?.kind===`method`?l:void 0,d=e.contract.scope===`remote`&&s?.kind===`method`?s.args:void 0,f=d===void 0?n:sw(d,QC(n)),p=u?sw(u.args,QC(f)):f;u&&Cw(`args`,`${this.address}.${t} args`,u.args,p),this.lease(r);let m=r.child(this),h;try{h=await this.#u(()=>c(p,m))}finally{m.close()}return u&&Cw(`result`,`${this.address}.${t} result`,u.result,h),h}#u(e){let t=(async()=>e())();this.#t.add(t);let n=()=>{this.#t.delete(t),this.#t.size===0&&this.#d()};return t.then(n,n),t}rootEnded(e){this.leases.delete(e);let t=this.gate;t?.grandfathered.delete(e)&&t.grandfathered.size===0&&t.drained()}addHold(e){this.holds.add(e),this.#i!==void 0&&clearTimeout(this.#i),this.#i=void 0}release(e){this.holds.delete(e)&&this.#d()}#d(){if(this.holds.size>0||this.#t.size>0||this.#i!==void 0)return;if(this.status===`activating`){this.#f(this.dispose(!1));return}if(this.status!==`live`)return;let e=this.service?.options.linger??0;e<=0?this.#f(this.dispose(!1)):(this.#i=setTimeout(()=>{this.#i=void 0,this.holds.size===0&&this.#t.size===0&&this.status===`live`&&this.#f(this.dispose(!1))},e),this.#i.unref?.())}#f(e){e.catch(e=>this.host.report(e))}dispose(e,t){return this.#a??=this.#p(e,t),this.#a}async#p(e,t){let n=this.status===`activating`;this.status=`disposing`,this.host.forget(this),this.#i!==void 0&&clearTimeout(this.#i),this.#i=void 0;let r=t??new j(`gone`,`${this.address} was disposed`);if(e){for(let e of this.holds)e.gone(r);this.callAbort.abort(r)}this.activationAbort.abort(r),n&&await this.ready.catch(IO);for(let e of this.holds)e.gone(r);let i=this.allDecls();this.stopTasks(),this.stopListeners(),await Promise.allSettled([...this.#t]);let a=[...i].some(e=>e.registrations.size>0)&&!this.deferredRuntime;this.behaviors.clear(),this.decls=new UO,a&&this.host.registriesChanged();let o=new Set;for(let e of i){for(let t of e.derives.values())t.detach();for(let t of e.holds.values())o.add(t)}try{await Ri([()=>Promise.allSettled(this.#r.splice(0)),...[...this.openOrder].reverse().map(e=>()=>e.close(this.openOrder)),...[...o].map(e=>()=>e.release())],`${this.address}: disposal failed`)}finally{this.status=`disposed`}}},tk=e=>typeof e==`object`&&!!e&&typeof e.events==`function`&&typeof e.subscribe==`function`;function nk(e,t){let n=new Map,r=e.contract;if(r.scope!==`remote`)return n;let i=r.description.variants[QO(t)??``]??{};for(let[e,r]of Object.entries(i)){let i=t[e];r.kind===`state`&&PO(i)&&n.set(i,[...n.get(i)??[],r.schema])}return n}function rk(e,t){let n=e.contract,r=e=>{throw Ii(`behavior`,`${n.name}: ${e}`)};(typeof t!=`object`||!t)&&r(`factory must return an object`);let i;if(n.scope===`remote`){let e=t.kind;(typeof e!=`string`||n.description.variants[e]===void 0)&&r(`unknown variant ${String(e)}`),i=n.description.variants[e];for(let n of Object.keys(t))n!==`kind`&&i[n]===void 0&&r(`${n} is not in variant ${String(e)}`)}else i=n.description.variants[``]??{};for(let[e,n]of Object.entries(i)){let i=t[e];n.kind===`method`&&typeof i!=`function`&&r(`${e} must be a method`),n.kind===`state`&&!PO(i)&&!tk(i)&&r(`${e} must be a cell, a derivation or a held object's state member`),n.kind===`opaque`&&i===void 0&&r(`${e} is missing`)}}var ik=class{#e;#t;#n=new UO;#r={holds:[],resources:[],derives:[]};constructor(e,t){this.#e=e,this.#t=t}run(e){return{behavior:e,decls:this.#n,created:this.#r}}*#i(e,t,n,r){if(typeof n!=`object`||!n)throw TypeError(`${t} takes an object of named declarations`);for(let[i,a]of Object.entries(n)){if(e.has(i))throw Ii(`duplicate`,`${this.#e.typeName}: duplicate ${t} name ${i}`);if(r!==void 0&&qw(a)!==r)throw TypeError(`${t}.${i} must be declared with ${r}()`);yield[i,a]}}state(e){let t={},n=this.#e.host;for(let[r,i]of this.#i(this.#n.cells,`state`,e,`cell`)){let e=this.#t?.cells.get(r)??new kO(r,i.schema,i.initial,this.#e.guard,{dev:n.dev,report:e=>n.report(e)});this.#n.cells.set(r,e),this.#n.cellSchemas.set(r,i.schema),t[r]=e}return t}get(e,t,n){let r=this.#e.host,i=this.#t!==void 0,a=r.addressOf(e,t,n?.principal??r.principal,n?.at,i),o=this.#n.holds.get(a);if(o!==void 0){if(o.contract.fingerprint!==e.fingerprint)throw Ii(`duplicate`,`${this.#e.typeName}: ${e.name} held twice with different contracts`);return o.proxy}let s=this.#t?.holds.get(a);if(s!==void 0&&s.contract.fingerprint===e.fingerprint&&s.status!==`gone`&&s.status!==`released`)return this.#n.holds.set(a,s),s.proxy;let c=r.acquire(e,t,n,`record`,this.#e,i);return this.#n.holds.set(a,c),this.#r.holds.push(c),c.proxy}resources(e){let t={};for(let[n,{spec:r}]of this.#i(this.#n.resources,`resources`,e,`resource`)){let e=(r.deps??[]).map(e=>{let t=YO(e)??HO(e);if(t===void 0)throw TypeError(`resource ${n}: deps must be handles or resources of this record`);return t}),i=this.#t?.resources.get(n),a=i!==void 0&&i.spec.rev===r.rev&&i.exclusive===(r.exclusive===!0)&&i.deps.length===e.length&&i.deps.every((t,n)=>t===e[n]),o=a?i:new zO(n,r,e);a||this.#r.resources.push(o),this.#n.resources.set(n,o),t[n]=new BO(o,this.#e.host)}return t}listen(e){for(let[t,n]of this.#i(this.#n.listeners,`listen`,e,`listener`))this.#n.listeners.set(t,n)}tasks(e){for(let[t,n]of this.#i(this.#n.tasks,`tasks`,e)){if(typeof n!=`function`)throw TypeError(`tasks.${t} must be a function`);this.#n.tasks.set(t,n)}}derive(e){let t={},n=this.#e.host;for(let[r,{sources:i,fn:a}]of this.#i(this.#n.derives,`derive`,e,`derivation`)){let e=this.#t?.derives.get(r),o;e!==void 0&&e.sources.length===i.length&&e.sources.every((e,t)=>e===i[t])?o=e:(o=new NO(r,i,a,{dev:n.dev,report:e=>n.report(e)}),this.#r.derives.push(o)),this.#n.derives.set(r,o),this.#n.deriveFns.set(r,a),t[r]=o}return t}expose(e){let t=HO(e);if(t===void 0||![...this.#n.resources.values()].includes(t))throw TypeError(`expose takes a resource declared by this record`);return new RO(t)}register(e,t){if(!this.#e.eager)throw Ii(`not_eager`,`${this.#e.typeName}: only eager records may register`);let n={};for(let[r,i]of Object.entries(t))n[`${e.name}\u0000${r}`]=i;for(let[t,r]of this.#i(this.#n.registrations,`register`,n))this.#n.registrations.set(t,{registry:e,key:t.slice(e.name.length+1),value:r})}},ak=()=>{};function ok(e){let{run:t,migrated:n,service:r,record:i}=e,a=nk(r,t.behavior);for(let[e,t]of n)for(let n of a.get(e)??[])Cw(`state`,`${i.address}: migrated state ${e.key}`,n,t);let o=new Map(n),s=[...t.decls.derives].sort(([,e],[,t])=>e.seq-t.seq);for(let[e,n]of s){let r=n.compute(e=>o.has(e)?o.get(e):e.value,t.decls.deriveFns.get(e));for(let t of a.get(n)??[])Cw(`state`,`${i.address}: derived ${e}`,t,r);o.set(n,r)}e.derived=o}function sk(e){let t=Li(e,`reload`);return/^reload aborted/.test(t.message.replace(/^[^:]*: /,``))?t:new j(t.code,`reload aborted: ${t.message}`,{cause:t,reason:t.reason,details:t.details})}async function ck(e,t,n){let r=await lk(e,t,n);try{return await r.prepare(),r.commit()}finally{uk(e)}}async function lk(e,t,n,r){if(e.reloading)throw new j(`unavailable`,`a reload is already running`,{reason:`reload_running`});e.reloading=!0;try{return new dk(e,await e.resolve(t),n,r)}catch(t){throw e.reloading=!1,sk(t)}}function uk(e){e.reloading=!1,e.maybeRetire()}var dk=class{host;facets;options;epoch;candidates=new Map;abort=new AbortController;closed=[];services=new Map;changed=new Set;removed=new Set;tables=new Map;gated=[];rolledBack=!1;deferred=new Map;constructor(e,t,n,r){this.host=e,this.facets=t,this.options=n,this.epoch=r}async prepare(){try{await this.waitForRetirement(),this.load(),this.checkProviders(),await this.prepareAll(),this.host.gating=this.changed,await this.withDeadline(this.prepareAll(),`activations in flight did not finish`),this.checkHolds(),this.tables=this.host.buildTables(this.entries()),await this.gate(),this.#e(),this.#t()}catch(e){throw await this.rollback(),sk(e)}}summary(){let e=[...this.candidates.values()].filter(({record:e})=>e.status===`live`);return{epoch:this.host.pending?.id??this.host.current.id,previous:this.host.current.id,changed:[...this.changed],removed:[...this.removed],prepared:e.map(({record:e})=>e.address),gated:this.gated.map(({record:e})=>e.address)}}#e(){if(this.rolledBack)throw new j(`aborted`,`reload aborted while preparing`,{reason:`aborted`})}#t(){for(let e of this.candidates.values())e.record.status===`live`&&(e.staged=e.record.stageListeners(e.run.decls));for(let e of this.host.records.values())e.status===`live`&&e.deferredRuntime&&this.deferred.set(e,e.stageListeners(e.decls))}async waitForRetirement(){let e=this.host;if(e.previous!==void 0){if(e.previous.roots.size>0){let t;await new Promise(n=>{e.retired=n,t=setTimeout(n,this.options.retireDeadline??5e3)}),clearTimeout(t),e.retired=ak}e.retire()}}load(){let e=new Set([...this.facets.map(e=>e.name),...this.options.remove??[]]),t=this.host.current.services;this.services=new Map([...t].filter(([,t])=>!e.has(t.facet)));for(let e of this.facets)e.setup(this.host.facetApi(((t,n,r={})=>this.host.serveInto(this.services,LO(t,n,r,e.name)))));for(let[e,n]of this.services)t.get(e)!==n&&this.changed.add(e);for(let e of t.keys())this.services.has(e)||this.removed.add(e);this.host.pending={id:this.host.nextEpochId(this.epoch),services:this.services,tables:new Map,roots:new Map}}async withDeadline(e,t){let n=this.options.gateDeadline??5e3,r,i=new Promise((e,i)=>{r=setTimeout(()=>i(new j(`aborted`,`${t} within ${n} ms`,{reason:`deadline`})),n)});try{return await Promise.race([e,i])}finally{clearTimeout(r)}}checkProviders(){for(let e of this.changed){let t=this.services.get(e).contract,n=this.host.current.services.get(e)?.contract;if(n===void 0||n.version!==t.version)continue;let r=Ww(t.description,n.description);if(r!==void 0)throw new j(`contract_mismatch`,`${e}@${t.version} changed incompatibly without a version bump (${r})`)}let e=new Map(this.host.facets);for(let t of this.facets)e.set(t.name,t);for(let t of this.options.remove??[])e.delete(t);for(let t of e.values())for(let e of t.uses??[]){let t=this.services.get(e.name);t!==void 0&&this.changed.has(e.name)&&Gw(t.contract,t.options.accepts,e)}}async prepareAll(){for(;;){let e=[...this.host.records.values()].filter(e=>this.changed.has(e.typeName)&&!this.candidates.has(e)&&e.service!==this.services.get(e.typeName)&&(e.status===`live`||e.status===`activating`));if(e.length===0)return;await Promise.allSettled(e.map(e=>e.ready)),this.#e();for(let t of e)t.status===`live`&&t.service!==this.services.get(t.typeName)&&(await this.prepareRecord(t),this.#e())}}async prepareRecord(e){let t=this.services.get(e.typeName),n=e.run(t,e.decls),r={record:e,service:t,run:n,reasons:[],atGate:[],replaced:[],migrated:new Map,derived:new Map,staged:void 0};this.candidates.set(e,r);let i=t.stateVersion!==e.stateVersion;i&&r.reasons.push(`state version ${e.stateVersion} -> ${t.stateVersion}`);for(let[t,r]of n.decls.cells)if(!(e.decls.cells.get(t)!==r||Sw(r.schema,n.decls.cellSchemas.get(t)))&&!i)throw Ii(`state`,`${e.address}: schema of state ${t} changed without a state-version bump`);for(let r of Object.keys(t.options.state?.migrate??{}))if(!n.decls.cells.has(r))throw Ii(`state`,`${e.address}: migrate for undeclared state ${r}`);let a=new Set;for(let e of n.created.resources)(e.exclusive||e.deps.some(e=>a.has(e)))&&a.add(e);for(let t of a){r.atGate.push(t);let n=e.decls.resources.get(t.key);t.exclusive&&n?.exclusive&&n.state===`open`&&r.replaced.push(n)}a.size>0&&r.reasons.push(`exclusive resource replaced`),r.reasons.length===0&&ok(r),await e.open(n.created.resources.filter(e=>!a.has(e)),n.created.holds,this.abort.signal)}checkHolds(){let e=new Set;for(let{record:t,run:n}of this.candidates.values())for(let r of t.decls.holds.values())[...n.decls.holds.values()].includes(r)||e.add(r);for(let t of this.host.records.values()){let n=this.services.get(t.typeName);if(n!==void 0&&this.changed.has(t.typeName))for(let r of t.holds)r!==this.host.eager.get(t.typeName)&&!e.has(r)&&r.owner!==`client`&&Gw(n.contract,n.options.accepts,r.contract)}}entries(){return this.host.liveDecls(!0).filter(([e])=>!this.removed.has(e.typeName)).map(([e,t])=>[e,this.candidates.get(e)?.run.decls??t])}async gate(){this.gated=[...this.candidates.values()].filter(e=>e.reasons.length>0&&e.record.status===`live`);let e=this.gated.map(({record:e})=>{let t=new Set(e.leases.keys());return new Promise(n=>{e.gate={grandfathered:t,queue:[],drained:n},e.stopTasks(),t.size===0&&n()})}),t=this.options.gateDeadline??5e3,n,r=await Promise.race([Promise.all(e).then(()=>!1),new Promise(e=>{n=setTimeout(()=>e(!0),t)})]);if(clearTimeout(n),r){let e=this.gated.flatMap(({record:e})=>[...e.gate?.grandfathered??[]]);throw new j(`aborted`,`gate deadline (${t} ms) missed; blocking roots: ${e.join(`, `)}`,{reason:`gate_deadline`,details:{blocking:e}})}this.#e();for(let e of this.gated){let{record:t}=e;for(let n of e.replaced)this.closed.push([t,n]),await n.close(t.openOrder);await t.open(e.atGate,[],this.abort.signal),this.#e()}for(let e of this.gated)this.migrate(e)}migrate(e){let{record:t,service:n,run:r}=e,i=n.options.state?.migrate??{},a=n.stateVersion!==t.stateVersion;for(let[n,o]of r.decls.cells){if(t.decls.cells.get(n)!==o)continue;let s=r.decls.cellSchemas.get(n),c=i[n],l;if(a&&c!==void 0)l=c(structuredClone(o.value),t.stateVersion);else if(!Sw(o.schema,s))l=o.value;else continue;Cw(`state`,`${t.address}: migrated state ${n}`,s,l),e.migrated.set(o,l)}ok(e)}async rollback(){if(this.rolledBack)return;this.rolledBack=!0,this.abort.abort(new j(`aborted`,`reload aborted`));let e=e=>this.host.report(e);for(let e of this.candidates.values())e.staged?.discard();for(let e of this.deferred.values())e.discard();for(let{record:t,run:n}of this.candidates.values())t.pending.delete(n.decls),await t.unwind(n).catch(e);for(let[t,n]of this.closed)n.state===`closed`&&await n.open(new AbortController().signal,t.openOrder).catch(r=>{n.markUnavailable(),e(new j(`unavailable`,`${t.address}: resource ${n.key} could not be restored`,{cause:r}))});for(let{record:e}of this.gated)if(e.gate!==void 0){e.openGate();for(let t of e.decls.tasks.keys())e.startTask(t,this.host.current.id)}let t=new j(`gone`,`reload aborted; type not served`);for(let n of[...this.host.records.values()])this.host.current.services.has(n.typeName)||await n.dispose(!0,t).catch(e);this.host.pending=void 0,this.host.gating=void 0}commit(e){try{return Qw(()=>{let t=this.#r();e?.();for(let e of this.#n.splice(0))e();return t})}catch(e){throw this.host.fail(e),sk(e)}}#n=[];#r(){let e=this.host,t=e.current,n=e.pending;e.pending=void 0,e.epochs.set(n.id,n),e.previous=t,e.current=n;let r=[];for(let i of[...e.records.values()]){if(this.removed.has(i.typeName))continue;let e=this.candidates.get(i);if(e===void 0){let e=i.behaviors.get(t.id);e!==void 0&&i.behaviors.set(n.id,{...e,epoch:n.id})}else i.status===`live`&&(this.install(e,n.id),r.push(i.address))}for(let{record:t,run:n,staged:r}of this.candidates.values())t.status!==`live`&&(r?.discard(),t.pending.delete(n.decls),t.unwind(n).catch(t=>e.report(t)));for(let[e,t]of this.deferred)e.status===`live`?(e.deferredRuntime=!1,t.activate(),this.#n.push(()=>e.startTasks())):t.discard();e.installTables(n,this.tables,!0);let i=new j(`gone`,`type no longer served`);for(let t of[...e.records.values()])this.removed.has(t.typeName)&&t.dispose(!0,i).catch(t=>e.report(t));for(let t of this.removed)e.eager.delete(t);for(let t of this.facets)e.facets.set(t.name,t);for(let t of this.options.remove??[])e.facets.delete(t);e.gating=void 0;for(let[t,n]of this.services)n.options.eager&&this.changed.has(t)&&e.eager.get(t)?.record?.status!==`live`&&this.#n.push(()=>e.startEager(n));return{epoch:n.id,previous:t.id,changed:[...this.changed],removed:[...this.removed],prepared:r,gated:this.gated.map(({record:e})=>e.address)}}install(e,t){let{record:n,run:r,service:i}=e,a=e.reasons.length>0;if(n.pending.delete(r.decls),n.stopTasks(),a){let e=new Set(r.decls.derives.values());for(let t of n.decls.derives.values())e.has(t)||t.detach()}if(n.decls=r.decls,n.service=i,n.stateVersion=i.stateVersion,n.behaviors.set(t,{epoch:t,service:i,behavior:r.behavior,decls:r.decls}),a){n.minEpoch=t;for(let e of[...n.behaviors.keys()])e!==t&&this.host.retireBehavior(n,e)}n.refreshSchemas();for(let[e,t]of r.decls.derives)t.setFn(r.decls.deriveFns.get(e));for(let[t,n]of r.decls.cells){let i=r.decls.cellSchemas.get(t);e.migrated.has(n)?n.reset(e.migrated.get(n),i):n.schema=i}let o=new Set(r.created.derives);for(let t of r.created.derives)t.attach(e.derived);for(let e of r.decls.derives.values())o.has(e)||e.refresh();e.staged?.activate(),this.#n.push(()=>n.startTasks()),n.openGate();let s=this.host.eager.get(n.typeName);if(s?.record===n&&s.contract.fingerprint!==i.contract.fingerprint){let e=new ZO(n,i.contract,`host`);n.addHold(e),this.host.eager.set(n.typeName,e),s.release()}for(let e of[...n.holds]){if(e.owner===`client`)try{Gw(i.contract,i.options.accepts,e.contract)}catch(t){e.gone(new j(`upgrade_required`,`${n.typeName} changed; reload the web facets`,{cause:t})),n.release(e);continue}e.shapeChanged()}}};function fk(e){return e instanceof j?e.reason===void 0?{code:e.code,message:e.message}:{code:e.code,message:e.message,reason:e.reason}:{code:`unavailable`,message:e instanceof Error?e.message:String(e)}}var pk=e=>new j(e.code,e.message.replace(/^[a-z_]+(\/[a-z_]+)?: /,``),{reason:e.reason}),mk=Qp({minimum:1}),hk=mm({minLength:1}),gk=I({rootId:hk,epoch:Qp({minimum:1})}),_k=I({code:mm(),message:mm(),reason:F(mm())}),vk=Qp({minimum:1}),yk=gm([I({t:nm(`hello`),name:hk,kind:gm([nm(`host`),nm(`client`)]),epoch:Qp({minimum:0})}),I({t:nm(`hold`),id:mk,at:hk,token:I({name:hk,scope:mm(),version:Qp(),input:Dp(),variants:Gh(mm(),Dp())}),input:Dp(),principal:F(Dp()),client:F(Yp())}),I({t:nm(`release`),id:mk}),I({t:nm(`shape`),id:mk,kind:F(mm()),members:np(mm()),contract:mm(),epoch:Qp()}),I({t:nm(`gone`),id:mk,error:_k}),I({t:nm(`call`),id:mk,hold:mk,member:hk,args:Dp(),root:F(gk)}),I({t:nm(`result`),id:mk,value:F(Dp()),error:F(_k)}),I({t:nm(`cancel`),id:mk}),I({t:nm(`sub`),id:mk,hold:mk,member:hk}),I({t:nm(`unsub`),id:mk}),I({t:nm(`state`),id:mk,snap:F(Dp()),reset:F(Dp()),ops:F(np(np(Dp()))),error:F(_k)}),I({t:nm(`ping`),n:Qp()}),I({t:nm(`pong`),n:Qp()}),I({t:nm(`bye`),reason:F(mm())}),I({t:nm(`root_end`),rootId:hk}),I({t:nm(`invalidate`),pattern:Gh(mm(),Dp())}),I({t:nm(`prepare`),reload:vk,epoch:Qp({minimum:1}),plugins:np(mm()),options:I({remove:F(np(mm())),gateDeadline:F(um()),retireDeadline:F(um())})}),I({t:nm(`vote`),reload:vk,error:F(_k),report:F(I({epoch:Qp(),previous:Qp(),changed:np(mm()),removed:np(mm()),prepared:np(mm()),gated:np(mm())}))}),I({t:nm(`commit`),reload:vk}),I({t:nm(`retire`),epoch:Qp({minimum:1})}),I({t:nm(`abort`),reload:vk})]),bk=e=>Wf(yk,e),xk=0,Sk=(e,t)=>{let n;for(let r of Object.entries(e??{}))t?.startsWith(r[0])&&(n===void 0||r[0].length>n[0].length)&&(n=r);return[...n?.[1]??[]]};function Ck(e,t,n){let r;return new Promise((i,a)=>{e.votes.set(t,{resolve:i,reject:a}),r=setTimeout(()=>{e.votes.delete(t),a(new j(`aborted`,`votes missing after ${n} ms`,{reason:`vote_deadline`}))},n)}).finally(()=>clearTimeout(r))}async function wk(e,t,n){let r=[...e.connections].filter(e=>e.role===`downstream`&&e.peer.kind===`host`&&e.open&&e.synced),i=e.peekNextEpoch(),a=await lk(e,t,n,i),o=++xk,s=n.voteDeadline??(n.gateDeadline??5e3)+(n.retireDeadline??5e3)+5e3,c=r.map(e=>{let t=e.name??`child`,r=Ck(e,o,s);return e.send({t:`prepare`,reload:o,epoch:i,plugins:Sk(n.remote,t),options:{remove:Sk(n.remoteRemove,t),gateDeadline:n.gateDeadline,retireDeadline:n.retireDeadline}}),r.then(e=>[t,e],e=>{let n=sk(e);throw new j(n.code,`${t}: ${n.message}`,{cause:n,reason:n.reason})})}),l=!1;try{let t=await Promise.allSettled([a.prepare().then(()=>{l=!0}),...c]),s=t.find(e=>e.status===`rejected`);if(s!==void 0){for(let e of r)e.votes.delete(o),e.send({t:`abort`,reload:o});throw l&&await a.rollback(),s.reason}let u=a.commit(()=>{for(let e of r)e.send({t:`commit`,reload:o}),e.peerEpoch=i});e.rememberRemoteModules(n.remote,n.remoteRemove);let d={};for(let e of t.slice(1)){if(e.status!==`fulfilled`)continue;let[t,n]=e.value;n!==void 0&&(d[t]=n)}return{...u,children:d}}finally{uk(e)}}async function Tk(e,t){for(;;){let n=e.current.id;if(!t.open)return;if(t.peerEpoch===n){t.markSynced(n);return}let r=++xk,i=Ck(t,r,3e4);t.send({t:`prepare`,reload:r,epoch:n,plugins:Sk(e.remoteModules,t.name),options:{remove:Sk(e.remoteRemoved,t.name)}}),await i,e.current.id===n?(t.send({t:`commit`,reload:r}),t.peerEpoch=n):t.send({t:`abort`,reload:r})}}var Ek=class{#e;#t;constructor(e){this.#e=e}handle(e,t){if(t.t===`prepare`){if(this.#t!==void 0){let n=new j(`unavailable`,`a reload is already running`,{reason:`reload_running`});e.send({t:`vote`,reload:t.reload,error:fk(n)});return}let n={id:t.reload,reload:void 0,state:`loading`,cancelled:!1};this.#t=n,this.#r(n,e,t).catch(e=>this.#e.report(e));return}let n=this.#t;if(n!==void 0&&n.id===t.reload){if(t.t===`abort`)this.#n(n);else if(n.state===`prepared`){this.#t=void 0;try{n.reload?.commit()}finally{uk(this.#e)}}}}parentLost(){this.#t!==void 0&&this.#n(this.#t)}#n(e){e.cancelled=!0,e.state===`prepared`?(this.#t=void 0,e.reload?.rollback().catch(e=>this.#e.report(e)).finally(()=>uk(this.#e))):e.reload?.rollback().catch(e=>this.#e.report(e))}async#r(e,t,n){let r=()=>new j(`aborted`,`reload aborted by the server`,{reason:`aborted`});try{if(e.reload=await lk(this.#e,n.plugins,n.options,n.epoch),e.cancelled||(e.state=`preparing`,await e.reload.prepare(),e.cancelled))throw r();e.state=`prepared`,t.send({t:`vote`,reload:n.reload,report:e.reload.summary()})}catch(r){e.reload!==void 0&&(await e.reload.rollback().catch(e=>this.#e.report(e)),uk(this.#e)),this.#t===e&&(this.#t=void 0),e.cancelled||t.send({t:`vote`,reload:n.reload,error:fk(r)})}}},Dk=e=>new j(`unavailable`,e),Ok=class{origin;frame;principal;client;generation;down;downId=0;closed=!1;calls=new Map;subs=new Map;#e=new Set;constructor(e,t,n,r){this.origin=e,this.frame=t,this.principal=n,this.client=r,this.generation=e.generation}get originId(){return this.frame.id}get current(){return!this.closed&&this.origin.open&&this.origin.generation===this.generation}ready(){return this.closed?Promise.reject(new j(`gone`,`relayed hold closed`)):this.down===void 0?new Promise((e,t)=>{this.#e.add({resolve:e,reject:t})}):Promise.resolve(this.down)}open(e){if(!this.closed){this.down=e,this.downId=e.nextId(),e.relayedHolds.set(this.downId,this),e.send({...this.frame,id:this.downId,principal:this.principal,...this.client?{client:!0}:{}});for(let[e,t]of this.subs)t.downId===void 0&&this.#t(e,t);for(let t of this.#e)t.resolve(e);this.#e.clear()}}subscribe(e,t){let n={member:t,downId:void 0};this.subs.set(e,n),this.origin.relaySubs.set(e,this),this.down!==void 0&&this.#t(e,n)}#t(e,t){let n=this.down;t.downId=n.nextId(),n.relayedSubs.set(t.downId,{relay:this,originSubId:e}),n.send({t:`sub`,id:t.downId,hold:this.downId,member:t.member})}unsubscribe(e,t=!0){let n=this.subs.get(e);n!==void 0&&(this.subs.delete(e),this.origin.relaySubs.delete(e),n.downId!==void 0&&this.down!==void 0&&(this.down.relayedSubs.delete(n.downId),t&&this.down.send({t:`unsub`,id:n.downId})))}close(e,t){if(!this.closed){this.closed=!0;for(let n of[...this.calls.values()])n.cancel(e,t.releaseDown);for(let e of[...this.subs.keys()])this.unsubscribe(e,t.releaseDown);this.origin.served.get(this.originId)?.kind===`relay`&&this.origin.served.delete(this.originId),this.down!==void 0&&(this.down.relayedHolds.delete(this.downId),t.releaseDown&&this.down.send({t:`release`,id:this.downId}));for(let t of this.#e)t.reject(e);this.#e.clear(),t.notify&&this.origin.send({t:`gone`,id:this.originId,error:fk(e)})}}},kk=class{relay;originId;downId;#e;#t=!1;constructor(e,t,n,r){this.relay=e,this.originId=t,this.downId=n,this.#e=r,e.calls.set(t,this),e.down?.relayedCalls.set(n,this)}finish(e,t){this.#t||(this.#t=!0,this.relay.calls.delete(this.originId),this.relay.down?.relayedCalls.delete(this.downId),e===void 0?this.#e.resolve(t):this.#e.reject(e))}cancel(e,t){this.#t||(t&&this.relay.down?.send({t:`cancel`,id:this.downId}),this.finish(e))}},Ak=class{host;link;role;peer;principal;restamp;generation=0;peerEpoch;synced;fencedEpochs=new Set;#e=new Map;#t;#n=new Set;#r=1;#i=Date.now();#a;remotes=new Map;calls=new Map;subs=new Map;served=new Map;incoming=new Map;feeds=new Map;relaySubs=new Map;relayedHolds=new Map;relayedCalls=new Map;relayedSubs=new Map;votes=new Map;constructor(e,t,n){this.host=e,this.link=t,this.role=n.role,this.peer=n.peer,this.principal=n.principal,this.restamp=n.restamp,this.synced=this.role!==`downstream`||this.peer.kind!==`host`,t.onClose(e=>this.#x(e)),t.receive(e=>this.#s(e)),this.send({t:`hello`,name:e.name,kind:e.kind,epoch:e.current.id});let r=n.pingInterval??15e3,i=n.pingTimeout??45e3,a=0;this.#a=setInterval(()=>{Date.now()-this.#i>i?t.close(`ping timeout`):this.send({t:`ping`,n:++a})},r),this.#a.unref?.()}get open(){return!this.link.closed}get name(){return this.role===`upstream`?this.#t:this.peer.name}send(e){this.link.send(e)}nextId(){return this.#r++}whenSynced(){return this.open?this.synced?Promise.resolve():new Promise((e,t)=>this.#n.add({resolve:e,reject:t})):Promise.reject(Dk(`link to ${this.name??`peer`} closed`))}markSynced(e){this.peerEpoch=e,this.synced=!0;for(let e of this.#n)e.resolve(void 0);this.#n.clear()}revoke(e){this.generation++;let t=new j(`gone`,`principal invalidated`);for(let e of[...this.served.values()])e.kind===`relay`&&e.relay.close(t,{releaseDown:!0,notify:!0});e===void 0?this.link.close(`principal invalidated`):this.principal=e}#o(e){this.host.report(new j(`invalid`,`link to ${this.name??`peer`}: ${e}`,{reason:`protocol`})),this.link.close(`protocol error: ${e}`)}hold(e){let t=this.nextId();this.remotes.set(t,e),e.bound(this,t);let n=e.principal;return this.send({t:`hold`,id:t,at:e.at,token:e.contract.description,input:e.input,...n===void 0?{}:{principal:n},...e.owner===`client`?{client:!0}:{}}),t}release(e){this.remotes.delete(e),this.send({t:`release`,id:e})}call(e,t,n,r,i){let a=this.nextId();return new Promise((o,s)=>{if(i.aborted){s(new j(`aborted`,`call aborted`));return}let c=()=>{this.calls.delete(a),this.send({t:`cancel`,id:a}),s(new j(`aborted`,`call aborted`,{cause:i.reason}))};i.addEventListener(`abort`,c,{once:!0});let l=()=>i.removeEventListener(`abort`,c);this.calls.set(a,{resolve:e=>{l(),o(e)},reject:e=>{l(),s(e)}});let u=r!==void 0&&this.host.kind===`host`;u&&this.host.rootSent(r.rootId,this),this.send({t:`call`,id:a,hold:e,member:t,args:n,...u?{root:r}:{}})})}sub(e,t,n){let r=this.nextId();return this.subs.set(r,n),this.send({t:`sub`,id:r,hold:e,member:t}),r}unsub(e){this.subs.delete(e)&&this.send({t:`unsub`,id:e})}#s(e){if(this.#i=Date.now(),!bk(e))this.#o(`malformed frame`);else try{this.#c(e)}catch(e){this.host.report(e)}}#c(e){switch(e.t){case`hello`:this.#l(e);return;case`ping`:this.send({t:`pong`,n:e.n});return;case`pong`:case`bye`:return;case`hold`:this.#f(e);return;case`release`:this.#p(e.id,!0);return;case`call`:this.#m(e);return;case`cancel`:this.incoming.get(e.id)?.abort(new j(`aborted`,`cancelled by caller`));return;case`sub`:this.#g(e);return;case`unsub`:this.#_(e.id);return;case`shape`:case`gone`:this.#v(e);return;case`result`:this.#y(e);return;case`state`:this.#b(e);return;case`root_end`:this.#e.delete(e.rootId),this.host.foreignRootEnded(e.rootId,this);return;case`invalidate`:case`prepare`:case`commit`:case`abort`:case`retire`:if(this.role!==`upstream`){this.#o(`${e.t} from a child`);return}e.t===`invalidate`?this.host.invalidatePrincipal(e.pattern).catch(e=>this.host.report(e)):e.t===`retire`?this.host.allowRetire(e.epoch):this.host.onReloadFrame(this,e);return;case`vote`:{if(this.role!==`downstream`||this.peer.kind!==`host`){this.#o(`vote from a non-participant`);return}let t=this.votes.get(e.reload);this.votes.delete(e.reload),e.error===void 0?t?.resolve(e.report):t?.reject(pk(e.error));return}}}#l(e){if(this.role===`upstream`){if(e.kind!==`host`){this.#o(`parent is not a host`);return}this.#t??=e.name}else e.kind!==this.peer.kind||this.peer.name!==void 0&&e.name!==this.peer.name?this.#o(`hello ${e.kind} ${e.name} does not match the accepted ${this.peer.kind} ${this.peer.name??``}`):this.peer.kind===`host`&&this.host.peerHello(this,e.epoch)}#u(e){return this.role===`downstream`?this.principal:e.principal??{host:this.#t??`parent`}}#d(e){return this.role===`downstream`?this.peer.kind===`client`:e.client===!0}#f(e){if(this.served.has(e.id)){this.#o(`duplicate hold id ${e.id}`);return}let t=this.#u(e),n=this.#d(e);if(e.at!==this.host.name){if(this.role===`upstream`){this.send({t:`gone`,id:e.id,error:fk(Dk(`${this.host.name} does not relay`))});return}let r=new Ok(this,e,t,n);this.served.set(e.id,{kind:`relay`,relay:r}),this.host.relay(r).catch(e=>r.close(e,{releaseDown:!0,notify:!0}));return}let r;try{let i=Uw(e.token);if(i.scope!==`remote`)throw Ii(`token`,`${i.name} is local; only remote types cross links`);let a=this.host.acquire(i,e.input,{principal:t},n?`client`:`connection`);if(!(a instanceof ZO))throw Dk(`not a local handle`);r=a}catch(t){this.send({t:`gone`,id:e.id,error:fk(n?Nk(t):t)});return}let i={kind:`local`,handle:r,principal:t,feeds:new Set};this.served.set(e.id,i);let a=()=>{let t=r.shape;t!==void 0&&this.served.get(e.id)===i&&this.send({t:`shape`,id:e.id,kind:t.kind,members:t.members,contract:t.contract,epoch:t.epoch})};r.onShape(a),r.goneListeners.add(t=>{this.served.get(e.id)===i&&(this.#p(e.id,!1),this.send({t:`gone`,id:e.id,error:fk(t)}))}),r.status===`live`&&a()}#p(e,t){let n=this.served.get(e);if(n!==void 0){if(this.served.delete(e),n.kind===`relay`)n.relay.close(new j(`released`,`relayed hold released`),{releaseDown:t,notify:!1});else{for(let e of n.feeds)this.#_(e);t&&n.handle.release()}}}#m(e){if(this.incoming.has(e.id)){this.#o(`duplicate call id ${e.id}`);return}let t=this.served.get(e.hold);if(t===void 0){this.send({t:`result`,id:e.id,error:fk(new j(`gone`,`unknown hold`))});return}let n=new AbortController;this.incoming.set(e.id,n);let r=this.peer.kind===`host`?this.#h(e.root):void 0,i={principal:t.kind===`local`?t.principal:t.relay.principal,signal:n.signal},a=t.kind===`local`?n=>t.handle.record.call(t.handle,e.member,e.args,n):r=>jk(t.relay,e,{rootId:r.rootId,epoch:r.epoch},n.signal,this.host);(r===void 0?this.host.root(a,i):this.host.joinRoot(r.rootId,r.epoch,a,{...i,from:this})).then(t=>this.send({t:`result`,id:e.id,value:t}),t=>this.send({t:`result`,id:e.id,error:fk(t)})).finally(()=>this.incoming.delete(e.id))}#h(e){if(e===void 0||this.role!==`downstream`||!this.fencedEpochs.has(e.epoch)||this.host.hasEpoch(e.epoch))return e;let t=this.#e.get(e.rootId);return t===void 0&&(t=this.host.current.id,this.#e.set(e.rootId,t)),{rootId:e.rootId,epoch:t}}#g(e){if(this.feeds.has(e.id)||this.relaySubs.has(e.id)){this.#o(`duplicate sub id ${e.id}`);return}let t=this.served.get(e.hold);if(t===void 0){this.send({t:`state`,id:e.id,error:fk(new j(`gone`,`unknown hold`))});return}if(t.kind===`relay`){t.relay.subscribe(e.id,e.member);return}let n=t.handle.member(e.member);if(n===void 0||typeof n.events!=`function`){this.send({t:`state`,id:e.id,error:fk(new j(`not_in_variant`,`${e.member} is not state`))});return}let r=CO(),i=n.events(n=>{if(n.type===`ops`)this.send({t:`state`,id:e.id,ops:r.encode(n.ops)});else if(n.value!==void 0){try{Mk(t.handle,e.member,n.value)}catch(t){this.send({t:`state`,id:e.id,error:fk(t)});return}r=CO(),this.send(n.type===`snap`?{t:`state`,id:e.id,snap:n.value}:{t:`state`,id:e.id,reset:n.value})}});this.feeds.set(e.id,i),t.feeds.add(e.id)}#_(e){let t=this.feeds.get(e);t!==void 0&&(this.feeds.delete(e),t()),this.relaySubs.get(e)?.unsubscribe(e)}#v(e){let t=this.relayedHolds.get(e.id);if(t!==void 0){e.t===`gone`?t.close(pk(e.error),{releaseDown:!1,notify:!0}):t.closed||t.origin.send({...e,id:t.originId});return}let n=this.remotes.get(e.id);n!==void 0&&(e.t===`gone`?(this.remotes.delete(e.id),n.gone(pk(e.error))):n.shaped({kind:e.kind,members:e.members,contract:e.contract,epoch:e.epoch}))}#y(e){let t=this.relayedCalls.get(e.id);if(t!==void 0){t.finish(e.error===void 0?void 0:pk(e.error),e.value);return}let n=this.calls.get(e.id);this.calls.delete(e.id),e.error===void 0?n?.resolve(e.value):n?.reject(pk(e.error))}#b(e){let t=this.relayedSubs.get(e.id);t===void 0?this.subs.get(e.id)?.(e):t.relay.origin.send({...e,id:t.originSubId})}#x(e){this.#a!==void 0&&clearInterval(this.#a);let t=Dk(`link to ${this.name??`peer`} closed: ${e}`);for(let e of[...this.served.keys()])this.#p(e,!0);for(let e of this.incoming.values())e.abort(t);this.incoming.clear();for(let e of this.calls.values())e.reject(t);this.calls.clear(),this.subs.clear();for(let e of this.votes.values())e.reject(t);this.votes.clear();for(let e of this.#n)e.reject(t);this.#n.clear();for(let e of[...this.relayedHolds.values()])e.close(t,{releaseDown:!1,notify:!0});this.relayedHolds.clear(),this.relayedCalls.clear(),this.relayedSubs.clear();for(let e of this.remotes.values())this.role===`upstream`?e.detached():e.gone(t);this.remotes.clear(),this.host.connectionClosed(this)}};async function jk(e,t,n,r,i){let a=()=>new j(`aborted`,`call cancelled`,{cause:r.reason});if(r.aborted)throw a();let o=()=>{},s=new Promise((e,t)=>{o=()=>t(a()),r.addEventListener(`abort`,o,{once:!0})});s.catch(()=>{});try{let o=await Promise.race([e.ready(),s]);if(e.closed)throw new j(`gone`,`relayed hold closed`);return await new Promise((s,c)=>{let l=new kk(e,t.id,o.nextId(),{resolve:s,reject:c});r.addEventListener(`abort`,()=>l.cancel(a(),!0),{once:!0}),i.rootSent(n.rootId,o),o.send({t:`call`,id:l.downId,hold:e.downId,member:t.member,args:t.args,root:n})})}finally{r.removeEventListener(`abort`,o)}}function Mk(e,t,n){if(n===void 0)return;let r=e.record.currentInstalled();if(r===void 0)return;let i=e.currentView(),a=QO(i===void 0?r.behavior:i),o=i!==void 0&&i!==r.behavior?e.contract.description.variants[a??``]?.[t]:r.service.contract.description.variants[QO(r.behavior)??``]?.[t];o?.kind===`state`&&Cw(`state`,`${e.address}.${t}`,o.schema,n)}function Nk(e){return e instanceof j&&e.code===`contract_mismatch`?new j(`upgrade_required`,e.message,{cause:e}):e}var Pk=()=>{},Fk=class{#e;#t;#n=new Set;#r=new Set;#i;#a=wO();#o;constructor(e,t){this.#e=e,this.#t=t}get value(){return this.#o}subscribe(e){return this.#n.add(e),this.#l(()=>e(this.#o)),this.bind(),()=>this.#c(this.#n,e)}events(e){return this.#r.add(e),this.#l(()=>e({type:`snap`,value:this.#o})),this.bind(),()=>this.#c(this.#r,e)}bind(){let e=this.#n.size+this.#r.size>0;e||(this.#o=void 0);let t=e?this.#e.binding:void 0;if(t!==void 0&&this.#i?.channel===t.channel||(this.#i!==void 0&&((this.#i.channel!==t?.channel||t===void 0)&&this.#i.channel.unsub(this.#i.id),this.#i=void 0),t===void 0))return;let n=t.channel;this.#a=wO();let r=n.sub(t.id,this.#t,e=>this.#s(e));this.#i={channel:n,id:r}}detach(){this.#i=void 0}stop(){this.#n.clear(),this.#r.clear(),this.bind()}#s(e){if(e.error!==void 0){this.#e.host.report(pk(e.error));return}let t;if(e.ops!==void 0||`snap`in e||`reset`in e){if(e.ops!==void 0){let n=this.#a.decode(e.ops);this.#o=gO(this.#o,n),t={type:`ops`,ops:n,value:this.#o}}else this.#a=wO(),this.#o=`snap`in e?e.snap:e.reset,t={type:`reset`,value:this.#o};for(let e of[...this.#r])this.#l(()=>e(t));for(let e of[...this.#n])this.#l(()=>e(this.#o))}}#c(e,t){e.delete(t),this.bind()}#l(e){try{e()}catch(e){this.#e.host.report(e)}}},Ik=class{record=void 0;host;contract;at;input;principal;owner;address;proxy;ready;status=`loading`;error;shape;binding;shapeListeners=new Set;#e=new Map;#t=new Map;#n;#r;constructor(e,t){this.host=e,this.contract=t.contract,this.at=t.at,this.input=t.input,this.principal=t.principal,this.owner=t.owner,this.address=t.address,this.ready=new Promise((e,t)=>{this.#n={resolve:e,reject:t}}),this.ready.catch(Pk),this.#r=this.#c(),this.proxy=new Proxy(this,{get:(e,t)=>{if(KO.has(t)){let n=Reflect.get(e,t,e);return typeof n==`function`?n.bind(e):n}if(typeof t==`string`&&t!==`then`)return e.member(t)}}),JO.set(this.proxy,this)}get kind(){return this.shape?.kind}onShape(e){return this.shapeListeners.add(e),()=>this.shapeListeners.delete(e)}onStatus(e){return this.#i.add(e),()=>this.#i.delete(e)}#i=new Set;#a(){qO(this.#i,this.status,this.error,e=>this.host.report(e))}release(){if(this.status===`released`||this.status===`gone`)return;this.status=`released`,this.#a();let e=new j(`released`,`handle ${this.address} released`);this.#n?.reject(e),this.#r.reject(e);for(let e of this.#e.values())e.stop();this.binding!==void 0&&this.binding.channel.release(this.binding.id),this.binding=void 0,this.host.forgetRemote(this)}bound(e,t){this.binding={channel:e,id:t}}shaped(e){if(this.status===`released`||this.status===`gone`)return;this.shape=e;let t=this.status===`loading`;this.status=`live`,t&&this.#a(),t&&(this.#n?.resolve(),this.#n=void 0,this.#r.resolve());for(let e of this.#e.values())e.bind();for(let t of[...this.shapeListeners])try{t(e)}catch(e){this.host.report(e)}}gone(e){if(this.status!==`released`&&this.status!==`gone`){this.status=`gone`,this.error=e,this.#a(),this.binding=void 0,this.#n?.reject(e),this.#r.reject(e);for(let e of this.#e.values())e.stop();this.host.forgetRemote(this)}}detached(){if(this.status!==`released`&&this.status!==`gone`){this.binding=void 0;for(let e of this.#e.values())e.detach();this.status===`live`&&(this.status=`loading`,this.#r=this.#c(),this.#a())}}member(e){let t=Object.values(this.contract.description.variants).map(t=>t[e]).find(e=>e!==void 0);if(t?.kind===`method`)return this.#o(e);if(t?.kind===`state`){let t=this.#e.get(e);return t===void 0&&(t=new Fk(this,e),this.#e.set(e,t)),t}}#o(e){let t=this.#t.get(e);return t===void 0&&(t=(t,n)=>{if(this.host.inFactory>0)throw new j(`not_ready`,`${this.address}.${e} called inside a factory`);if(n instanceof WO)try{n.check(n.host)}catch(e){return Promise.reject(e)}return n===void 0||n instanceof WO&&n.holder?this.host.root(n=>this.#s(e,t,n),{signal:n?.signal}):this.#s(e,t,n)},this.#t.set(e,t)),t}async#s(e,t,n){for(;;){if(this.status===`released`||this.status===`gone`)throw this.status===`gone`?this.error:new j(`released`,`handle ${this.address} released`);this.status===`loading`&&await GO(this.#r.promise,n.signal);let r=this.binding;if(r===void 0)continue;let i=this.shape?.kind;if(i===void 0||this.contract.description.variants[i]?.[e]?.kind!==`method`)throw new j(`not_in_variant`,`${this.address}: ${e} is not a method of variant ${i}`);let a=this.contract.description.variants[i]?.[e],o=a?.kind===`method`?sw(a.args,QC(t)):t;return r.channel.call(r.id,e,o,{rootId:n.rootId,epoch:n.epoch},n.signal)}}#c(){let e=Pk,t=Pk,n=new Promise((n,r)=>{e=n,t=r});return n.catch(Pk),{promise:n,resolve:e,reject:t}}},Lk=Object.freeze({host:!0}),Rk=e=>typeof e==`object`&&!(e instanceof URL),zk=new Map;function Bk(e={}){return new Vk(e)}var Vk=class{name;dev;principal=Lk;inFactory=0;failed;records=new Map;epochs=new Map;facets=new Map;eager=new Map;kind;connections=new Set;upstream;remotes=new Set;#e=new Map;#t=new Ek(this);remoteModules={};remoteRemoved={};#n=0;#r=new Map;#i=new Set;#a=Math.random().toString(36).slice(2,8);#o=new Map;current;previous;pending;gating;reloading=!1;retired=()=>{};#s;#c;#l;#u=new Map;#d=new Map;#f=new Map;#p=new Map;#m=1;#h=0;constructor(e){this.name=e.name??`host`,this.dev=e.dev??!1,this.#s=e.principalKey??bw,this.#c=e.onError??(e=>console.error(`chord:`,e)),this.#l=e.loader,this.current={id:this.#m,services:new Map,tables:new Map,roots:new Map},this.epochs.set(this.current.id,this.current),this.kind=e.kind??`host`,e.upstream!==void 0&&this.connect(e.upstream,e.upstreamOptions)}get epoch(){return this.current.id}get previousEpoch(){return this.previous?.id}nextEpochId(e){if(e!==void 0&&e<=this.current.id)throw Error(`epoch ${e} is not newer than ${this.current.id}`);return this.#m=e??this.#m+1,this.#m}report(e){this.#c(e)}serve=((e,t,n={})=>{if(this.reloading)throw Error(`host.serve during a reload; serve from a facet passed to reload()`);this.serveInto(this.current.services,LO(e,t,n,``)),n.eager&&this.startEager(this.current.services.get(e.name))});install(e,t={}){if(this.reloading)throw Error(`host.install during a reload`);if(this.facets.has(e.name))throw Error(`facet ${e.name} is already installed; use reload()`);let n=[];e.setup(this.facetApi(((t,r,i={})=>{let a=LO(t,r,i,e.name);this.serveInto(this.current.services,a),n.push(a)}))),this.facets.set(e.name,e);let r=n.filter(e=>e.options.eager).map(e=>this.startEager(e));return t.awaitEager===!1?Promise.resolve():this.#g(r)}async load(e,t={}){let n=await this.resolve(e);await Promise.all(n.map(e=>this.install(e,t)))}ready(){return this.#g(this.eager.values())}#g(e){let t=Promise.all([...e].map(e=>e.ready)).then(()=>{});return t.catch(()=>{}),t}async resolve(e){let t=e.filter(e=>!Rk(e));if(t.length>0&&this.#l===void 0)throw Error(`loading modules needs createHost({ loader }), e.g. nodeLoader from @earendil-works/chord/node`);let n=t.length>0&&this.#l!==void 0?await this.#l(t):[];return e.map(e=>Rk(e)?e:n.shift())}facetApi(e){return{serve:e,name:this.name,root:(e,t)=>this.root(e,t),registry:e=>this.registry(e)}}serveInto(e,t){if(e.has(t.contract.name))throw Error(`${t.contract.name} is already served`);e.set(t.contract.name,t)}startEager(e){let t=e.options.eager,n=typeof t==`object`?t.input:{},r=this.acquire(e.contract,n,void 0,`host`);return this.eager.set(e.contract.name,r),r.ready.catch(e=>this.report(e)),r}currentEpoch(){return this.current.id}hasEpoch(e){return this.epochs.has(e)}*retainedEpochs(){for(let[e,t]of this.epochs)yield[e,t.services];this.pending!==void 0&&(yield[this.pending.id,this.pending.services])}pendingEpoch(){return this.pending?.id}service(e){return this.current.services.get(e)??this.pending?.services.get(e)}addressOf(e,t,n,r,i=!1){if(r!==void 0&&r!==this.name)return Gk(r,e,t,n===this.principal?void 0:n);let a=this.#v(e.name,i);if(a===void 0)throw Kk(e.name,this.name);let o=ww(a.contract.input,t,`${e.name} input`);return this.#_(a,o,n)}#_(e,t,n){let r=n===this.principal?`host`:`p:${this.#s(n)}`;return`${e.contract.name}\u0000${Tw(e.contract.input,t)}\u0000${r}`}acquire(e,t,n,r,i,a=!1){if(n?.at!==void 0&&n.at!==this.name)return this.#x(e,t,n,r);let o=this.#v(e.name,a);if(o===void 0)throw Kk(e.name,this.name);Gw(o.contract,o.options.accepts,e);let s=n?.principal??this.principal,c=ww(o.contract.input,t,`${e.name} input`),l=this.#_(o,c,s),u=this.records.get(l);if(i!==void 0&&u!==void 0&&(u===i||qk(u,i)))throw Ii(`cycle`,`${i.address} -> ${l} would create a hold cycle`);if(u===void 0){if(this.gating?.has(e.name))throw new j(`upgrade_conflict`,`${e.name} is being upgraded; retry`,{reason:`gate`});let t=this.#u.get(l);t?.status===`disposed`&&this.#u.delete(l),u=new ek(this,{address:l,typeName:e.name,input:c,principal:s,eager:o.options.eager!==void 0&&o.options.eager!==!1&&s===this.principal}),this.records.set(l,u),u.start(t?.status===`disposing`?t.dispose(!1):void 0)}let d=new ZO(u,e,r);return u.addHold(d),d}forget(e){this.records.get(e.address)===e&&this.records.delete(e.address),e.status===`disposing`&&this.#u.set(e.address,e)}touch(e,t){let n=this.#d.get(e);n===void 0&&(n=new Set,this.#d.set(e,n)),n.add(t)}async root(e,t={}){let n=`${this.name}#${this.#a}:${++this.#h}`;return this.#i.add(n),this.joinRoot(n,t.epoch??this.current.id,e,t)}async joinRoot(e,t,n,r={}){let i=this.epochs.get(t);if(i===void 0)throw this.#i.delete(e),new j(`superseded`,`epoch ${t} is not retained by ${this.name}`);if(r.from!==void 0&&!this.#i.has(e)){let t=this.#r.get(e);t===void 0&&(t=new Set,this.#r.set(e,t)),t.add(r.from)}i.roots.set(e,(i.roots.get(e)??0)+1);let a=new WO(this,{signal:r.signal??new AbortController().signal,rootId:e,epoch:i.id,principal:r.principal??this.principal});try{return await n(a)}finally{a.close();let t=(i.roots.get(e)??1)-1;t>0?i.roots.set(e,t):(i.roots.delete(e),this.#r.has(e)||this.endRoot(e),this.maybeRetire())}}rootSent(e,t){let n=this.#o.get(e);n===void 0&&(n=new Set,this.#o.set(e,n)),n.add(t)}endRoot(e){this.#i.delete(e),this.#r.delete(e);for(let t of this.#d.get(e)??[])t.rootEnded(e);this.#d.delete(e);for(let t of this.#o.get(e)??[])t.send({t:`root_end`,rootId:e});this.#o.delete(e)}foreignRootEnded(e,t){let n=this.#r.get(e);n===void 0||!n.delete(t)||n.size>0||([...this.epochs.values()].some(t=>t.roots.has(e))?this.#r.delete(e):this.endRoot(e))}maybeRetire(){let e=this.previous;e===void 0||e.roots.size>0||this.kind!==`client`&&this.upstream!==void 0&&e.id>this.#n||this.retire()}allowRetire(e){this.#n=Math.max(this.#n,e),this.maybeRetire()}retire(){let e=this.previous;if(e!==void 0){this.previous=void 0,this.epochs.delete(e.id);for(let t of[...this.records.values()])this.retireBehavior(t,e.id);for(let t of this.connections)t.role===`downstream`&&t.peer?.kind===`host`&&t.send({t:`retire`,epoch:e.id});this.retired()}}retireBehavior(e,t){let n=e.behaviors.get(t);if(e.behaviors.delete(t),n===void 0||n.decls===e.decls)return;let r=e.allDecls(),i=e=>new Set([...r].flatMap(t=>[...e(t)])),a=i(e=>e.holds.values()),o=i(e=>e.resources.values()),s=i(e=>e.derives.values());for(let e of n.decls.derives.values())s.has(e)||e.detach();let c=[...n.decls.resources.values()].filter(e=>!o.has(e)).sort((t,n)=>e.openOrder.indexOf(n)-e.openOrder.indexOf(t)),l=[...n.decls.holds.values()].filter(e=>!a.has(e));e.refreshSchemas(),Ri([...c.map(t=>()=>t.close(e.openOrder)),...l.map(e=>()=>e.release())],`${e.address}: retiring epoch ${t} failed`).catch(e=>this.report(e))}registry(e){let t=t=>{let n=t===void 0?this.current:this.epochs.get(t.epoch);if(n===void 0)throw new j(`superseded`,`epoch ${t?.epoch} is retired`);return n.tables.get(e.name)??zk};return{table:t,get:(e,n)=>t(n).get(e),subscribe:n=>{let r=this.#p.get(e.name);r===void 0&&(r=new Set,this.#p.set(e.name,r));let i=n;return r.add(i),i(t(),this.current.id),()=>r.delete(i)}}}buildTables(e){let t=new Map;for(let[n,r]of e)for(let{registry:e,key:i,value:a}of r.registrations.values()){let r=t.get(e.name);r===void 0&&(r=new Map,t.set(e.name,r));let o=r.get(i);if(o!==void 0&&o.record!==n&&e.conflict===`error`)throw Ii(`registry_conflict`,`${e.name}: ${i} registered by ${o.record.address} and ${n.address}`);r.set(i,{value:a,record:n});let s=this.#f.get(e.name);s===void 0&&(s=new Map,this.#f.set(e.name,s)),s.has(i)||s.set(i,s.size)}let n=new Map;for(let[e,r]of t){let t=this.#f.get(e),i=[...r].sort(([e],[n])=>t.get(e)-t.get(n));n.set(e,new Map(i.map(([e,t])=>[e,t.value])))}return n}#v(e,t){return(t?this.pending?.services.get(e):void 0)??this.service(e)}liveDecls(e=!1){return[...this.records.values()].filter(t=>t.status===`live`&&(e||!t.deferredRuntime)).map(e=>[e,e.decls])}checkRegistrations(e,t){t.registrations.size!==0&&this.buildTables([...this.liveDecls().filter(([t])=>t!==e),[e,t]])}registriesChanged(e){let t=this.liveDecls().filter(([t])=>t!==e);e!==void 0&&t.push([e,e.decls]),this.installTables(this.current,this.buildTables(t))}fail(e){this.failed??=e,this.report(e)}installTables(e,t,n=!1){let r=e.tables;if(e.tables=t,e===this.current)for(let[i,a]of this.#p){let o=t.get(i)??zk;if(!n&&Uk(r.get(i)??zk,o))continue;let s=[...a];Zw(()=>{for(let t of s)try{t(o,e.id)}catch(e){this.report(e)}})}}get(e,t,n){return this.acquire(e,t,n,`external`).proxy}async invalidatePrincipal(e){let t=typeof e==`function`?e:t=>Wk(e,t),n=new j(`gone`,`principal invalidated`);for(let e of[...this.connections])e.role===`downstream`&&t(e.principal)&&e.revoke(e.restamp?.(e.principal));if(typeof e!=`function`)for(let t of this.connections)t.role===`downstream`&&t.peer.kind===`host`&&t.send({t:`invalidate`,pattern:e});await Hk([...this.records.values()].filter(e=>e.principal!==this.principal&&t(e.principal)),n,`invalidatePrincipal: disposal failed`)}accept(e,t){let n=t.kind??`client`;if(n===`host`&&t.name===void 0)throw TypeError(`accepting a host link needs its name`);this.#y(e,{...t,role:`downstream`,principal:t.principal,peer:{kind:n,name:n===`host`?t.name:void 0}})}connect(e,t={}){this.upstream?.open&&this.upstream.link.close(`replaced`);let n=this.#y(e,{...t,role:`upstream`,principal:void 0,peer:{kind:`host`,name:void 0}});this.upstream=n;for(let e of this.remotes)e.binding===void 0&&n.hold(e)}#y(e,t){let n=new Ak(this,e,t);return this.connections.add(n),n}route(e,t){this.#e.set(e,t)}peerHello(e,t){t===this.current.id?e.markSynced(t):t>this.current.id?(this.report(new j(`invalid`,`${e.name} runs epoch ${t}, ahead of ${this.current.id}`)),e.link.close(`epoch ahead of parent`)):(e.peerEpoch=t,e.fencedEpochs.add(t),Tk(this,e).catch(t=>{this.report(t),e.link.close(`reconciliation failed`)}))}connectionClosed(e){this.connections.delete(e);for(let[t,n]of[...this.#r])n.has(e)&&this.foreignRootEnded(t,e);for(let t of this.#o.values())t.delete(e);this.upstream===e&&(this.upstream=void 0,this.#t.parentLost())}forgetRemote(e){this.remotes.delete(e)}#b(e){return[...this.connections].find(t=>t.role===`downstream`&&t.peer.kind===`host`&&t.peer.name===e)}#x(e,t,n,r){let i=n.at;if(e.scope!==`remote`)throw Ii(`local`,`${e.name} is local and cannot be reached at ${i}`);let a=n.principal===void 0||n.principal===this.principal?void 0:n.principal,o=new Ik(this,{contract:e,at:i,input:t,principal:a,owner:r,address:Gk(i,e,t,a)});this.remotes.add(o);let s=e=>{e.then(e=>{o.status===`loading`&&o.binding===void 0&&e.hold(o)},e=>o.gone(e))},c=this.#b(i);if(this.upstream!==void 0)this.upstream.hold(o);else if(c!==void 0)s(c.whenSynced().then(()=>c));else{let e=this.#S(i);e===void 0?o.gone(new j(`unavailable`,`no route to ${i}`)):s(this.#C(e,i,a??this.principal))}return o}#S(e){let t;for(let n of this.#e)e.startsWith(n[0])&&(t===void 0||n[0].length>t[0].length)&&(t=n);return t?.[1]}async#C(e,t,n,r=()=>!0){let i=()=>new j(`forbidden`,`${t} refused for this principal`),a=()=>new j(`gone`,`principal invalidated while resolving`);if(!await e.authorize(n,t))throw i();if(!r())throw a();let o=await e.resolve(t);if(!r())throw a();if(!await e.authorize(n,t))throw i();if(!r())throw a();let s=[...this.connections].find(e=>e.link===o);if(s??=this.#y(o,{role:`downstream`,principal:e.principal?.(t)??{host:t},peer:{kind:`host`,name:t}}),await s.whenSynced(),!r())throw a();return s}async relay(e){let t=e.frame.at,n=this.#S(t);if(n===void 0)throw this.#b(t)===void 0?new j(`unavailable`,`no route to ${t}`):new j(`forbidden`,`no route authorizes ${t}`);let r=await this.#C(n,t,e.principal,()=>e.current);e.current&&e.open(r)}reload(e,t={}){return this.kind!==`client`&&this.upstream!==void 0?Promise.reject(new j(`unavailable`,`reloads are coordinated by the server`,{reason:`not_coordinator`})):[...this.connections].some(e=>e.role===`downstream`&&e.peer.kind===`host`)||t.remote!==void 0||t.remoteRemove!==void 0?wk(this,e,t):ck(this,e,t)}onReloadFrame(e,t){this.#t.handle(e,t)}rememberRemoteModules(e,t){for(let n of new Set([...Object.keys(e??{}),...Object.keys(t??{})])){let r=e?.[n]??[],i=t?.[n]??[];this.remoteModules[n]=[...new Set([...this.remoteModules[n]??[],...r])].filter(e=>!i.includes(e)),this.remoteRemoved[n]=[...new Set([...this.remoteRemoved[n]??[],...i])].filter(e=>!r.includes(e))}}peekNextEpoch(){return this.#m+1}async close(){this.eager.clear();let e=new j(`gone`,`host ${this.name} closed`);try{await Hk([...this.records.values()],e,`host close: disposal failed`)}finally{for(let e of[...this.connections])e.link.close(`host closed`)}}};async function Hk(e,t,n){let r=new Set(e),i=e=>{let t=new Set;for(let n of e.allDecls())for(let e of n.holds.values())e.record!==void 0&&t.add(e.record);return t},a=new Map(e.map(e=>[e,i(e)])),o=[];for(;r.size>0;){let e=new Set;for(let t of r)for(let n of a.get(t)??[])e.add(n);let n=[...r].filter(t=>!e.has(t));n.length===0&&(n=[...r]);for(let e of n)r.delete(e);let i=await Promise.allSettled(n.map(e=>e.dispose(!0,t)));for(let e of i)e.status===`rejected`&&o.push(e.reason)}if(o.length===1)throw o[0];if(o.length>1)throw AggregateError(o,n)}function Uk(e,t){if(e.size!==t.size)return!1;let n=[...e.keys()];return[...t].every(([t,r],i)=>n[i]===t&&e.get(t)===r)}var Wk=(e,t)=>typeof t==`object`&&!!t&&Object.entries(e).every(([e,n])=>Sw(t[e],n)),Gk=(e,t,n,r)=>`@${e}\u0000${t.name}\u0000${bw(n)}\u0000${r===void 0?`host`:bw(r)}`,Kk=(e,t)=>new j(`unavailable`,`${e} is not served by ${t}`,{reason:`unknown_type`});function qk(e,t){let n=new Set,r=[e];for(;r.length>0;){let e=r.pop();if(e===t)return!0;if(!n.has(e)){n.add(e);for(let t of e.allDecls())for(let e of t.holds.values())e.record!==void 0&&r.push(e.record)}}return!1}var Jk=class{#e;#t=[];#n=new Set;#r=!1;get closed(){return this.#r}send(e){this.#r||this.transmit(e)}receive(e){this.#e=e;for(let t of this.#t.splice(0))e(t)}onClose(e){this.#r?e(`closed`):this.#n.add(e)}close(e=`closed`){if(!this.#r){try{this.transmit({t:`bye`,reason:e})}catch{}this.ended(e)}}deliver(e){this.#r||(e.t===`bye`?this.ended(e.reason??`peer closed`):this.#e===void 0?this.#t.push(e):this.#e(e))}ended(e){if(!this.#r){this.#r=!0,this.#t=[];try{this.shutdown()}finally{for(let t of this.#n)t(e);this.#n.clear()}}}};function Yk(e){let t=JSON.parse(e);if(typeof t!=`object`||!t||typeof t.t!=`string`)throw TypeError(`not a frame`);return t}var Xk=1,Zk=class extends Jk{#e;#t=[];constructor(e){super(),this.#e=e,e.addEventListener(`open`,()=>{for(let t of this.#t.splice(0))e.send(t)}),e.addEventListener(`message`,e=>{try{this.deliver(Yk(typeof e.data==`string`?e.data:String(e.data)))}catch{this.close(`protocol error`)}}),e.addEventListener(`close`,()=>this.ended(`socket closed`))}transmit(e){let t=JSON.stringify(e);this.#e.readyState===Xk?this.#e.send(t):this.#t.push(t)}shutdown(){this.#t=[],this.#e.readyState<=Xk&&this.#e.close(1e3)}},Qk=e=>new Zk(e),$k=(e,t)=>[e,t];function eA(e,t){let n=Object.fromEntries(Object.entries(t.variants).map(([e,t])=>[e,{...t,methods:Object.fromEntries(Object.entries(t.methods??{}).map(([e,[t,n]])=>[e,Lw(t,n)]))}]));return Hw(e,{...t,variants:n})}var R=mm(),tA=um(),nA=Yp(),rA=sm(),z=Qp({minimum:0,maximum:2**53-1}),iA=gm([R,rA]),aA=Rp([`pending`,`running`,`done`]),oA=Rp([`project`,`user`,`builtin`]),sA=Rp([`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`]),cA=I({provider:R,modelId:R}),lA=I({model:F(cA),thinkingLevel:F(sA)},{additionalProperties:!1}),uA=I({input:tA,output:tA,cacheRead:tA,cacheWrite:tA,cost:tA}),dA=I({name:R,mimeType:R,width:z,height:z,bytes:z,entryId:z,contentIndex:z}),fA=I({name:R,location:R,body:R,args:R}),pA=I({callId:R,name:R,summary:R,detail:iA,phase:aA,output:iA,diff:iA,diffAdded:gm([tA,rA]),diffRemoved:gm([tA,rA]),diffTruncated:F(nA)}),mA=I({parentId:z,agentId:F(R),round:F(z),runnerId:F(z),inputEntryId:F(z),answerEntryId:F(z),roundUsage:F(gm([uA,rA])),taskId:z,callId:R,childId:z,role:Rp([`explore`,`plan`,`coder`]),title:R,createdAt:tA,startedAt:gm([tA,rA]),endedAt:gm([tA,rA]),status:Rp([`queued`,`running`,`completed`,`failed`,`cancelled`]),report:iA,approvalCount:F(z),historyThrough:F(z),historyUsage:F(uA)}),hA=I({agentId:R,parentId:z,childId:z,role:Rp([`explore`,`plan`,`coder`]),title:R,status:Rp([`idle`,`queued`,`running`]),activeRoundId:gm([z,rA]),lastRoundId:z,lastReport:F(iA),roundCount:z,taskTitle:R,approvalCount:z,createdAt:tA,historyThrough:F(z),historyUsage:F(uA)}),gA=I({jobId:R,title:R,command:R,cwd:R,status:Rp([`running`,`exited`,`failed`,`stopped`,`lost`]),startedAt:tA,endedAt:gm([tA,rA]),exitCode:gm([tA,rA]),reason:F(Rp([`timeout`,`spawn-error`,`restart`,`aborted`])),timeoutSeconds:F(tA),outputBytes:z}),_A=I({job:gA,text:R,offset:z,truncated:nA,dropped:z}),vA=I({historyBefore:F(gm([z,rA])),agents:F(np(hA)),jobs:F(np(gA)),rounds:F(np(mA)),subagents:F(np(mA)),taskUsage:F(uA),model:R,agent:I({model:gm([cA,rA]),thinkingLevel:gm([sA,rA])}),cwd:R,busy:nA,status:iA,usage:uA,contextUsage:F(I({tokens:gm([tA,rA]),window:tA,percent:gm([tA,rA])})),compaction:F(I({failure:F(I({taskId:z,reason:Rp([`manual`,`threshold`,`overflow`]),error:R})),active:np(I({taskId:z,reason:Rp([`manual`,`threshold`,`overflow`]),blocking:nA,attempt:z,retry:F(I({at:tA,error:R}))})),latest:gm([rA,I({taskId:z,phase:Rp([`summarizing`,`waiting-to-apply`,`applied`,`nothing`,`skipped`,`cancelled`,`failed`]),at:tA})])})),items:np(gm([I({type:nm(`user`),order:F(tA),key:R,id:z,text:R,images:F(np(dA)),skill:F(fA),defaultImagePrompt:F(I({version:Qp({minimum:1}),text:R}))}),I({type:nm(`assistant`),order:F(tA),key:R,id:z,thinking:R,text:R,stopReason:iA,errorMessage:iA,note:iA}),I({type:nm(`tool`),order:F(tA),key:R,images:F(np(dA)),callId:R,name:R,summary:R,detail:iA,phase:aA,isError:nA,output:iA,result:iA,durationMs:gm([tA,rA]),note:iA,diff:iA,diffAdded:gm([tA,rA]),diffRemoved:gm([tA,rA]),diffTruncated:F(nA)}),I({type:nm(`system`),order:F(tA),key:R,id:z,text:R,jobId:F(R)})])),streaming:gm([rA,I({thinking:R,text:R,toolCalls:np(pA)})])}),yA=I({workspaceRoot:R,lastUsedAt:tA,title:R,firstPromptPreview:R,createdAt:tA,lastMessageAt:gm([tA,rA]),model:gm([cA,rA]),status:Rp([`idle`,`running`,`error`]),id:R}),bA=I({revision:z,sessions:np(yA)}),xA=I({path:R,createdAt:tA}),SA=I({revision:z,workspaces:np(xA)}),CA=I({savedConfigured:nA,environmentConfigured:nA,source:Rp([`saved`,`environment`,`runtime`,`keyless`,`none`])}),wA=I({revision:z,statuses:I({deepseek:CA,tavily:CA})}),TA=I({sessionId:R,attachmentId:R}),EA=I({sessionId:R,attachmentId:R},{additionalProperties:!1}),DA=eA(`neko.session-directory`,{version:1,input:I({},{additionalProperties:!1}),variants:{ready:{state:{state:bA}}}}),OA=eA(`neko.session-management`,{version:1,input:I({},{additionalProperties:!1}),variants:{ready:{methods:{create:$k(I({...lA.properties,cwd:F(R)},{additionalProperties:!1}),yA),archive:$k(R,rA),attach:$k(R,TA),detach:$k(rA,rA),fork:$k(R,yA)}}}}),kA=I({maxWidth:F(z),maxHeight:F(z),maxBytes:F(z),jpegQuality:F(z)}),AA=I({maxRequestBytes:F(z),images:F(I({resize:F(kA),maxPerMessage:F(z),maxPerRequest:F(z)}))}),jA=I({provider:R,modelId:R,name:R,contextWindow:tA,input:np(R),inputLimits:F(AA),reasoning:nA,supportedThinkingLevels:np(sA),thinkingLevelAdjustments:I({off:sA,minimal:sA,low:sA,medium:sA,high:sA,xhigh:sA,max:sA})}),MA=eA(`neko.models`,{version:1,input:I({},{additionalProperties:!1}),variants:{ready:{methods:{list:$k(rA,np(jA))}}}}),NA=I({data:R,total:z,mimeType:R}),PA=eA(`neko.subagent`,{version:1,input:I({sessionId:R,attachmentId:R,taskId:F(z),agentId:F(R)}),variants:{ready:{state:{revision:z},methods:{chunk:$k(I({kind:Rp([`view`,`history`]),before:F(z),token:F(z),offset:z}),I({token:z,data:R,next:gm([z,rA])})),getImage:$k(I({entryId:z,contentIndex:z,offset:z}),NA),decideApproval:$k(I({id:z,version:R,decision:Rp([`allowed`,`denied`])}),Rp([`pending`,`allowed`,`denied`,`cancelled`])),stop:$k(gm([rA,I({taskId:z})]),rA)}}}}),FA=eA(`neko.chat`,{version:1,input:EA,variants:{ready:{state:{view:vA},methods:{submit:$k(I({content:R,images:F(np(R,{maxItems:4})),requestId:F(R),whenBusy:F(Rp([`steer`,`followUp`]))},{additionalProperties:!1}),rA),abort:$k(rA,rA),usage:$k(rA,uA),skills:$k(rA,np(I({name:R,description:R,location:R,level:oA}))),jobOutput:$k(I({jobId:R,since:F(z)},{additionalProperties:!1}),_A),jobStop:$k(I({jobId:R},{additionalProperties:!1}),gA),configure:$k(lA,rA),compact:$k(I({instructions:F(R)},{additionalProperties:!1}),rA),importImage:$k(R,I({id:R,name:R})),draftImage:$k(I({id:R,offset:z},{additionalProperties:!1}),NA),beginImage:$k(I({name:R,mimeType:R,size:Qp({minimum:1,maximum:20971520})},{additionalProperties:!1}),R),appendImage:$k(I({id:R,offset:z,data:mm({maxLength:35e4})},{additionalProperties:!1}),rA),finishImage:$k(R,rA),releaseImage:$k(R,rA),getImage:$k(I({entryId:z,contentIndex:z,offset:z},{additionalProperties:!1}),NA)}}}}),IA=I({path:R,query:F(R),showHidden:F(nA),cursor:F(R)},{additionalProperties:!1}),LA=I({path:R,parent:iA,entries:np(I({name:R,path:R,error:F(R)})),next:iA}),RA=eA(`neko.workspaces`,{version:1,input:I({},{additionalProperties:!1}),variants:{ready:{state:{state:SA},methods:{add:$k(I({path:R},{additionalProperties:!1}),xA),browse:$k(IA,LA)}}}}),zA=Rp([`deepseek`,`tavily`]),BA=eA(`neko.credentials`,{version:1,input:I({},{additionalProperties:!1}),variants:{ready:{state:{state:wA},methods:{save:$k(I({provider:zA,key:mm({minLength:1,maxLength:8192})},{additionalProperties:!1}),rA),remove:$k(I({provider:zA},{additionalProperties:!1}),rA)}}}}),VA=I({entries:np(I({name:R,path:R,kind:Rp([`file`,`directory`])}),{maxItems:100}),limited:nA,incomplete:nA}),HA=eA(`neko.workspace-files`,{version:1,input:I({},{additionalProperties:!1}),variants:{ready:{methods:{search:$k(I({workspaceRoot:R,query:R},{additionalProperties:!1}),VA)}}}}),UA=I({name:R,description:R,category:R,source:R,license:R,version:R,sha256:R,sizeBytes:z,uploadedAt:R,installed:I({project:nA,user:nA,builtin:nA}),activeLevel:gm([oA,rA])}),WA=I({body:R,files:np(R)}),GA=Rp([`user`,`project`]),KA=I({name:R,scope:GA,path:R,shadowedBy:F(GA)}),qA=eA(`neko.skill-market`,{version:1,input:I({},{additionalProperties:!1}),variants:{ready:{methods:{list:$k(I({query:F(R),workspaceRoot:F(R)},{additionalProperties:!1}),np(UA)),detail:$k(I({name:R,workspaceRoot:F(R)},{additionalProperties:!1}),UA),preview:$k(I({name:R},{additionalProperties:!1}),WA),install:$k(I({name:R,scope:GA,workspaceRoot:F(R),overwrite:F(nA)},{additionalProperties:!1}),KA),uninstall:$k(I({name:R,scope:GA,workspaceRoot:F(R)},{additionalProperties:!1}),rA)}}}}),JA=I({runningVersion:R,installedVersion:iA,protocolVersion:Qp({minimum:1}),latestVersion:iA,checkedAt:gm([z,rA]),checkState:Rp([`unknown`,`checking`,`ok`,`failed`,`development`])}),YA=eA(`neko.application-info`,{version:1,input:I({}),variants:{ready:{state:{info:JA},methods:{check:$k(rA,JA)}}}}),XA=16777216,ZA=e=>new TextEncoder().encode(e).byteLength;function QA(e,t=XA){let n=0,r=0,i=!1,a;return a=Qk({get readyState(){return e.readyState},send(n){if(ZA(n)+e.bufferedAmount>t)throw e.close(1009,`byte limit`),Error(`Link pending byte limit exceeded`);e.send(n)},close:(t,n)=>e.close(t,n),addEventListener(o,s){o===`message`?e.addEventListener(`message`,e=>{let n=ZA(String(e.data));i||(r+=n),n>t||r>t?a.close(`frame limit exceeded`):s(e)}):e.addEventListener(o,()=>{o===`open`&&(n=0);try{s()}catch{a.close(`socket error`)}})}}),e.addEventListener(`error`,()=>a.close(`socket error`)),{get closed(){return a.closed},send(r){if(a.closed)return;if(e.readyState>1){a.close(`socket closed`);return}let i=ZA(JSON.stringify(r));if(i>t||i+e.bufferedAmount+n>t)throw a.close(`pending byte limit exceeded`),Error(`Link byte limit exceeded`);e.readyState===0&&(n+=i),a.send(r)},receive(e){i=!0,r=0,a.receive(e)},onClose:e=>a.onClose(e),close:e=>a.close(e)}}function $A(e,t){let n,r=!1,i=0,a=[];return e.receive(o=>{if(!r){if(o.t!==`hello`||o.name!==t){e.close(`serverId mismatch`);return}r=!0}if(n)n(o);else{if(i+=ZA(JSON.stringify(o)),i>16777216){e.close(`receive queue limit exceeded`),a.length=0;return}a.push(o)}}),{get closed(){return e.closed},send:t=>e.send(t),receive(t){n=t,i=0;for(let n of a.splice(0)){if(e.closed)break;t(n)}},onClose:t=>e.onClose(t),close:t=>e.close(t)}}function ej(e){let t,n,r,i,a=()=>(n||(n=e(),i=n.onStatus((e,n)=>{if(e===`gone`){r=String(n??`Subagent unavailable`);for(let e of s)e(t)}})),n),o=()=>{i?.(),i=void 0,n?.release(),n=void 0},s=new Set,c,l=0,u=0,d=!1;async function f(e,t,n=()=>!0){let r,i=0,o=[];for(;;){if(!n())throw Error(`Transcript subscription closed`);let s=await a().chunk({kind:e,before:t,token:r,offset:i});if(!n())throw Error(`Transcript subscription closed`);if(o.push(s.data),r=s.token,s.next===null)return JSON.parse(o.join(``));i=s.next}}let p=async()=>{if(d||!s.size||!u)return;d=!0;let e=l,n=0;try{do{n=u;try{let n=await f(`view`,void 0,()=>l===e&&s.size>0);if(l!==e)return;r=void 0,t=n;for(let e of s)e(t)}catch(i){if(l!==e)return;if(u===n){r=String(i);for(let e of s)e(t)}}}while(u!==n)}finally{d=!1,l!==e&&s.size&&p()}};return{get error(){return r},view:{get value(){return t},subscribe(e){return s.add(e),e(t),c||=a().revision.subscribe(e=>{u=e??0,p()}),()=>{s.delete(e),s.size||(l++,c?.(),c=void 0,o())}}},history:async e=>{let t=l;try{return await f(`history`,e.before,()=>t===l)}finally{s.size||o()}},getImage:async(e,t)=>{try{return await a().getImage(e,t)}finally{s.size||o()}},decideApproval:async(e,t)=>{try{return await a().decideApproval(e,t)}finally{s.size||o()}},stop:async(e,t)=>{try{return await a().stop(e,t)}finally{s.size||o()}}}}var tj=class{#e=new Map;#t;#n;constructor(e,t){this.#t=e,this.#n=t}get pending(){return[...this.#e.values()].flatMap(({service:e,title:t})=>(e.view.value?.approvals??[]).filter(e=>e.status===`pending`).map(n=>({item:n,title:t,service:e}))).sort((e,t)=>e.item.createdAt-t.item.createdAt||e.item.id-t.item.id)}get error(){return[...this.#e.values()].find(({service:e})=>e.error)?.service.error}update(e){let t=e.filter(e=>e.approvalCount&&e.historyThrough===void 0);for(let[e,n]of this.#e)t.some(t=>(t.agentId??t.taskId)===e)||(this.#e.delete(e),n.stop());for(let e of t){let t=e.agentId??e.taskId;if(this.#e.has(t))continue;let n=this.#t(t),r={service:n,title:e.title,stop:()=>{}};this.#e.set(t,r),r.stop=n.view.subscribe(()=>this.#n())}this.#n()}close(){for(let e of this.#e.values())e.stop();this.#e.clear(),this.#n()}};function nj(e,t){return new Promise((n,r)=>{let i=()=>{},a=!1,o=(e,o)=>{a||(a=!0,clearTimeout(c),i(),t?.removeEventListener(`abort`,s),e?r(e):n(o))},s=()=>o(t?.reason??Error(`Cancelled`)),c=setTimeout(()=>o(Error(`Timed out waiting for first snapshot`)),5e3);i=e.subscribe(e=>{e!==void 0&&o(void 0,e)}),a&&i(),t?.addEventListener(`abort`,s,{once:!0}),t?.aborted&&s()})}var rj=`This gateway does not support background jobs. Restart the gateway to enable them.`;function ij(e){let t=()=>e.view.value?.jobs!==void 0,n=()=>{if(!t())throw Error(rj)};return{get supported(){return t()},list:()=>e.view.value?.jobs??[],async output(t,r){return n(),e.jobOutput({jobId:t,...r===void 0?{}:{since:r}})},async stop(t){return n(),e.jobStop({jobId:t})}}}function aj(e,t){let n=Bk({kind:`client`,upstream:$A(e,t),onError:()=>{}}),r=e=>n.get(e,{},{at:t}),i=r(YA),a=[i.info.subscribe(()=>{})],o,s=!1;function c(){let e=r(DA),t=r(OA),n=r(MA),i=r(RA),o=r(HA),s=r(BA),c=r(qA);return a.push(e.state.subscribe(()=>{}),i.state.subscribe(()=>{}),s.state.subscribe(()=>{})),{directory:e,management:t,models:n,workspaces:i,workspaceFiles:o,credentials:s,skillMarket:c}}let l=()=>{if(!s)throw Error(`Gateway protocol not checked`);return o||=c(),o},u,d,f,p=!1,m,h={application:i,subagent(e){if(!d)throw Error(`No active session`);let r={...d,...typeof e==`string`?{agentId:e}:{taskId:e}};return ej(()=>n.get(PA,r,{at:t}))},host:n,link:e,get directory(){return l().directory},get management(){return l().management},get models(){return l().models},get workspaces(){return l().workspaces},get workspaceFiles(){return l().workspaceFiles},get credentials(){return l().credentials},get skillMarket(){return l().skillMarket},get attachment(){return d},async ready(e){if(await oj(i.ready,e),(await nj(i.info,e)).protocolVersion!==4)throw new Ci;s=!0;let{directory:t,management:n,models:r,workspaces:a,credentials:o,workspaceFiles:c,skillMarket:u}=l();await oj(Promise.all([t.ready,n.ready,r.ready,a.ready,o.ready,c.ready,u.ready]),e),await Promise.all([nj(t.state,e),nj(a.state,e),nj(o.state,e)])},async attach(e,r){let i=await h.management.attach(e,r);if(u?.status===`live`&&u.view.value!==void 0&&d?.attachmentId===i.attachmentId)return u;f?.(),u?.release(),d=i;let a=n.get(FA,i,{at:t});u=a,f=a.view.subscribe(()=>{});try{if(await oj(a.ready,r?.signal),await nj(a.view,r?.signal),a!==u)throw Error(`Attachment changed`);return a}catch(e){throw a.release(),a===u&&(f?.(),f=void 0,u=void 0,d=void 0),e}},async detach(){f?.(),f=void 0,u?.release(),u=void 0,d=void 0,p||await h.management.detach(null)},async close(){return m||(p=!0,m=(async()=>{f?.(),u?.release();for(let e of a)e();await n.close()})(),m)}};return e.onClose(()=>{h.close().catch(()=>{})}),h}function oj(e,t){let n,r=()=>{};return Promise.race([e,new Promise((e,i)=>{n=setTimeout(()=>i(Error(`Gateway readiness timed out`)),5e3),r=()=>i(t?.reason??Error(`Cancelled`)),t?.addEventListener(`abort`,r,{once:!0}),t?.aborted&&r()})]).finally(()=>{clearTimeout(n),t?.removeEventListener(`abort`,r)})}function sj(e,t){return e.filter(e=>e.workspaceRoot===t).sort(ji)}var cj=class{subagent(e){if(!this.ready||!this.#t)throw Error(`会话未就绪`);return this.#t.subagent(e)}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];#u;#d;#f=[];#p;#m;#h=0;#g=0;#_=0;#v=!1;#y=!1;#b=!1;#x=!1;#S=!1;constructor(e){this.#e=e,this.#u=e.workspaceRoot,this.#d=e.preferredSession}get currentSessionId(){return this.#d}get workspaceRoot(){return this.#u}get ready(){return this.#y&&!this.#x&&this.#c!==void 0}get managementReady(){return this.#y&&!this.#x}async saveCredential(e,t){if(!this.#y||!this.#o)throw Error(`网关未连接`);await this.#o.save({provider:e,key:t})}async removeCredential(e){if(!this.#y||!this.#o)throw Error(`网关未连接`);await this.#o.remove({provider:e})}async start(){this.#e.events.onPhase(`connecting`),this.#e.events.onWorkspace(this.#u);try{await this.#j()}catch(e){this.#C(e),e instanceof Ci?(this.#b=!0,this.#e.events.onPhase(`error`),await this.#P()):this.#M()}}#C(e){this.#e.events.onError(e instanceof Ci?`版本不兼容,请运行 neko update 后重新启动本地 neko。`:e instanceof Error?e.message:String(e))}#w(e){if(this.#v||e!==this.#g)throw Error(`连接已变化,请重试`)}async#T(e){if(!this.managementReady)throw Error(`操作进行中或网关未连接,请稍后重试`);this.#x=!0,this.#e.events.onOperation(!0);let t=this.#g;try{await e(t)}finally{this.#x=!1,this.#e.events.onOperation(!1),t===this.#g&&this.#k()}}async selectWorkspace(e){await this.#T(async t=>{if(!this.#r?.state.value?.workspaces.some(t=>t.path===e))throw Error(`工作区不存在`);await this.#E(e,void 0,t)})}async addWorkspace(e){await this.#T(async t=>{let n=await this.#r.add({path:e});this.#w(t),await this.#E(n.path,void 0,t)})}async browse(e){if(!this.#y||!this.#r)throw Error(`网关未连接`);return this.#r.browse(e)}async attachTo(e){await this.#T(async t=>{if(!this.#l.find(t=>t.id===e&&t.workspaceRoot===this.#u))throw Error(`会话不属于当前工作区或已归档`);await this.#D(e,t)})}async createSession(){await this.#T(async e=>{let t=await this.#n.create({cwd:this.#u});this.#w(e),await this.#D(t.id,e)})}async archiveSession(e){await this.#T(async t=>{await this.#n.archive(e),this.#w(t),this.#l=this.#l.filter(t=>t.id!==e),this.#d===e&&await this.#E(this.#u,void 0,t)})}async#E(e,t,n){let r=sj(this.#l,e).sort(Mi),i=r.find(e=>e.id===t)??r[0];try{i?await this.#D(i.id,n):await this.#O(n),this.#w(n),this.#u=e,this.#e.events.onWorkspace(e)}catch(e){throw n===this.#g&&(this.#N(),this.#d=void 0,this.#e.events.onSessionChange(null)),e}}async#D(e,t){if(this.#d===e&&this.#c)return;let n=this.#t;this.#N();let r=this.#_;this.#d=void 0,this.#e.events.onSessionChange(null);let i=await n.attach(e);this.#w(t),this.#c=i,this.#d=e,this.#e.events.onSessionChange(e);let a=e=>{e&&t===this.#g&&r===this.#_&&this.#e.events.onView(e)};i.view.value&&a(i.view.value),this.#p=i.view.subscribe(a)}async#O(e){this.#N(),this.#d=void 0,this.#e.events.onSessionChange(null),await this.#t.detach(),this.#w(e)}#k(){this.managementReady&&this.#d&&!this.#l.some(e=>e.id===this.#d)&&this.#T(e=>this.#E(this.#u,void 0,e)).catch(e=>this.#C(e))}async configure(e){if(!this.ready)throw Error(`会话未就绪`);await this.#c.configure(e)}async submit(e,t=[],n=crypto.randomUUID(),r){if(r!==void 0&&r!==this.#d)throw Error(`会话已切换,草稿已保留`);if(!this.ready)throw Error(`会话未就绪`);let i=this.#c,a=[];try{for(let e of t)a.push(await Ei(e,{begin:e=>i.beginImage(e),append:e=>i.appendImage(e),finish:e=>i.finishImage(e),release:e=>i.releaseImage(e)}));await i.submit({content:e,requestId:n,images:a})}finally{for(let e of a)await i.releaseImage(e).catch(()=>{})}}async searchFiles(e,t,n){if(!this.managementReady||!this.#i||t!==this.#u)throw Error(`工作区未就绪`);return this.#t.host.root(n=>this.#i.search({workspaceRoot:t,query:e},n),{signal:n})}async workspaceImage(e,t,n){if(!this.ready||t!==this.#d)throw Error(`会话已切换,草稿已保留`);let r=this.#c;return this.#t.host.root(async t=>{let n=await r.importImage(e,t);try{return{...await Di(e=>r.draftImage({id:n.id,offset:e},t)),name:n.name}}finally{await r.releaseImage(n.id).catch(()=>{})}},{signal:n})}async compact(e,t){if(t!==void 0&&t!==this.#d)throw Error(`会话已切换,草稿已保留`);if(!this.ready)throw Error(`会话未就绪`);await this.#c.compact({instructions:e})}#A(e){if(!this.ready||e!==this.#d)throw Error(`会话已切换`);return ij(this.#c)}async jobOutput(e,t,n){return this.#A(e).output(t,n)}async jobStop(e,t){return this.#A(e).stop(t)}async image(e,t,n){if(n!==void 0&&n!==this.#d)throw Error(`会话已切换,草稿已保留`);if(!this.ready)throw Error(`会话未就绪`);let r=this.#c;return Di(n=>r.getImage({entryId:e,contentIndex:t,offset:n}))}abort(){this.ready&&this.#c.abort(null).catch(e=>this.#C(e))}async listSkills(e,t){if(!this.ready||e!==this.#d)throw Error(`会话未就绪`);return this.#t.host.root(e=>this.#c.skills(null,e),{signal:t})}async listModels(){return this.#a?.list(null)??[]}marketList(e){return this.#s?this.#s.list({...e?{query:e}:{},workspaceRoot:this.#u}):Promise.reject(Error(`网关未连接`))}marketDetail(e){return this.#s?this.#s.detail({name:e,workspaceRoot:this.#u}):Promise.reject(Error(`网关未连接`))}marketPreview(e){return this.#s?this.#s.preview({name:e}):Promise.reject(Error(`网关未连接`))}marketInstall(e,t,n){return this.#s?this.#s.install({name:e,scope:t,workspaceRoot:this.#u,...n?{overwrite:n}:{}}):Promise.reject(Error(`网关未连接`))}async marketUninstall(e,t){if(!this.#s)return Promise.reject(Error(`网关未连接`));await this.#s.uninstall({name:e,scope:t,workspaceRoot:this.#u})}async#j(){let e=++this.#g,t=this.#e.discover?await this.#e.discover():{gatewayWs:this.#e.url,serverId:this.#e.serverId};this.#w(e);let n=aj(QA(new WebSocket(t.gatewayWs)),t.serverId);this.#t=n,n.link.onClose(()=>{n===this.#t&&this.#M()});try{await n.ready()}catch(e){throw e instanceof Ci&&(this.#b=!0,this.#m&&=(clearTimeout(this.#m),void 0),this.#e.events.onPhase(`error`)),e}this.#w(e),this.#f.push(n.application.info.subscribe(t=>{e===this.#g&&this.#e.events.onUpdates?.(t??null)})),this.#e.events.onUpdates?.(n.application.info.value??null),this.#n=n.management,this.#r=n.workspaces,this.#i=n.workspaceFiles,this.#a=n.models,this.#o=n.credentials,this.#s=n.skillMarket,this.#f.push(this.#o.state.subscribe(t=>{e===this.#g&&this.#e.events.onCredentials?.(t??null)})),this.#o.state.value&&this.#e.events.onCredentials?.(this.#o.state.value);let r=n.directory,i=t=>{t&&e===this.#g&&(this.#l=t.sessions,this.#e.events.onDirectory(t),this.#k())};this.#f.push(r.state.subscribe(i)),this.#f.push(this.#r.state.subscribe(t=>{t&&e===this.#g&&this.#e.events.onWorkspaces(t)})),this.#S||=(await this.#r.add({path:this.#u}),this.#w(e),!0);let a=r.state.value,o=this.#r.state.value;if(!a||!o)throw Error(`工作区目录不可用,请重连`);i(a),this.#e.events.onWorkspaces(o),await this.#E(this.#u,this.#d,e),this.#w(e),this.#y=!0,this.#h=0,this.#e.events.onPhase(`ready`),this.#a.list(null).then(t=>{e===this.#g&&this.#e.events.onModels(t)}).catch(()=>{})}async checkUpdates(){if(!this.#t)throw Error(`网关未连接`);return this.#t.application.check(null)}#M(){if(this.#v||this.#b||this.#m)return;++this.#g,this.#y=!1,this.#N(),this.#e.events.onPhase(`reconnecting`),this.#e.events.onUpdates?.(null);let e=Math.min((this.#e.retryBaseMs??800)*++this.#h,this.#e.retryMaxMs??8e3);this.#m=setTimeout(()=>{this.#m=void 0,this.#P().then(()=>{if(!this.#v)return this.#j()}).catch(e=>{this.#C(e),e instanceof Ci?(this.#e.events.onPhase(`error`),this.#P()):this.#M()})},e)}#N(){++this.#_,this.#p?.(),this.#p=void 0,this.#c?.release(),this.#c=void 0,this.#e.events.onView(null)}async#P(){for(let e of this.#f.splice(0))e();this.#N(),this.#n=void 0,this.#r=void 0,this.#i=void 0,this.#o=void 0,this.#e.events.onCredentials?.(null),this.#a=void 0;let e=this.#t;this.#t=void 0,await e?.close().catch(()=>{})}dispose(){this.#v=!0,++this.#g,this.#y=!1,clearTimeout(this.#m),this.#P()}},lj={phase:`connecting`,updates:null,webInfo:null,credentials:null,workspaceRoot:``,workspaces:[],operating:!1,sessions:[],models:[],currentSessionId:null,view:null,notice:null},uj=new Set;function dj(e){lj=e;for(let e of uj)e()}function fj(e){return uj.add(e),()=>{uj.delete(e)}}function pj(){return(0,f.useSyncExternalStore)(fj,()=>lj)}function mj(){return lj}var hj={setUpdates(e){dj({...lj,updates:e})},setWebInfo(e){dj({...lj,webInfo:e})},setCredentials(e){e&&lj.credentials&&e.revision<lj.credentials.revision||dj({...lj,credentials:e})},setWorkspace(e){dj({...lj,workspaceRoot:e})},setWorkspaces(e){dj({...lj,workspaces:e})},setOperation(e){dj({...lj,operating:e})},setPhase(e){dj({...lj,phase:e})},setDirectory(e){dj({...lj,sessions:e})},setModels(e){dj({...lj,models:e})},setSession(e){dj({...lj,currentSessionId:e})},setView(e){dj({...lj,view:e})},notice(e){dj({...lj,notice:e})},clearNotice(){lj.notice!==null&&dj({...lj,notice:null})}},gj=`neko.upgrade-draft.v1`;function _j(e=sessionStorage){try{let t=JSON.parse(e.getItem(gj)??`null`);if(t?.version===1&&typeof t.serverId==`string`&&typeof t.workspace==`string`&&(typeof t.session==`string`||t.session===null)&&typeof t.text==`string`&&typeof t.requestId==`string`)return t}catch{}return null}function vj(e,t=sessionStorage){if(t.setItem(gj,JSON.stringify(e)),t.getItem(gj)!==JSON.stringify(e))throw Error(`Draft not saved`)}function yj(){sessionStorage.removeItem(gj)}var bj=0;async function xj(){let e=++bj,t=await fetch(`/api/info`,{cache:`no-store`,signal:AbortSignal.timeout(5e3)});if(!t.ok)throw Error(`GET /api/info 失败(${t.status})`);let n=await t.json();if(n.protocolCompatible===!1)throw new Ci;if(typeof n.gatewayWs!=`string`||typeof n.serverId!=`string`||typeof n.webVersion!=`string`||typeof n.workspaceRoot!=`string`||n.installedVersion!==null&&typeof n.installedVersion!=`string`)throw Error(`无效的网关信息`);return e===bj&&hj.setWebInfo({serverId:n.serverId,webVersion:n.webVersion,installedVersion:n.installedVersion,gatewaySpawned:n.gatewaySpawned===!0}),n}var Sj;function Cj(){(async()=>{let e;try{e=await xj()}catch(e){hj.setPhase(`error`),hj.notice({level:`error`,text:e instanceof Ci?`版本不兼容,请运行 neko update 后重新启动本地 neko。`:`获取网关信息失败:${e instanceof Error?e.message:String(e)}`});return}let t=_j(),n=t?.serverId===e.serverId?t:null;Sj=new cj({url:e.gatewayWs,serverId:e.serverId,workspaceRoot:n?.workspace??e.workspaceRoot,preferredSession:n?.session??void 0,discover:xj,events:{onPhase:hj.setPhase,onUpdates:hj.setUpdates,onCredentials:hj.setCredentials,onWorkspaces:e=>hj.setWorkspaces(e.workspaces),onWorkspace:hj.setWorkspace,onOperation:hj.setOperation,onError:e=>hj.notice({level:`error`,text:e}),onDirectory:e=>hj.setDirectory(e.sessions),onModels:hj.setModels,onSessionChange:hj.setSession,onView:hj.setView}}),await Sj.start();let r=()=>{document.visibilityState===`visible`&&xj().catch(()=>{})},i=setInterval(r,3e4);document.addEventListener(`visibilitychange`,r),window.addEventListener(`pagehide`,()=>{clearInterval(i),document.removeEventListener(`visibilitychange`,r)},{once:!0}),n?.text&&Sj.currentSessionId!==n.session&&hj.notice({level:`info`,text:`原会话不可用,升级草稿保留在关于与更新中`})})()}function wj(){hj.notice({level:`error`,text:`网关连接未就绪,请稍候或刷新页面。`})}var Tj={subagent(e){return Ej().subagent(e)},jobOutput(e,t,n){return Ej().jobOutput(e,t,n)},jobStop(e,t){return Ej().jobStop(e,t)},checkUpdates(){return Ej().checkUpdates()},saveCredential(e,t){return Ej().saveCredential(e,t)},removeCredential(e){return Ej().removeCredential(e)},configure(e,t){let n=Ej();return n.currentSessionId!==t||!n.ready?Promise.reject(Error(`会话已变化,请重试`)):n.configure(e)},submit(e,t=[],n,r){return Ej().submit(e,t,n,r)},searchFiles(e,t,n){return Ej().searchFiles(e,t,n)},workspaceImage(e,t,n){return Ej().workspaceImage(e,t,n)},compact(e,t){return Ej().compact(e,t)},listSkills(e,t){return Ej().listSkills(e,t)},marketList(e){return Ej().marketList(e)},marketDetail(e){return Ej().marketDetail(e)},marketPreview(e){return Ej().marketPreview(e)},marketInstall(e,t,n){return Ej().marketInstall(e,t,n)},marketUninstall(e,t){return Ej().marketUninstall(e,t)},image(e,t,n){return Ej().image(e,t,n)},abort(){Sj?.ready===!0?Sj.abort():wj()},selectSession(e){return Ej().attachTo(e)},selectWorkspace(e){return Ej().selectWorkspace(e)},addWorkspace(e){return Ej().addWorkspace(e)},browse(e){return Ej().browse(e)},createSession(){return Ej().createSession()},configureModel(e){Sj===void 0?wj():Sj.configure({model:e}).catch(e=>{hj.notice({level:`error`,text:e instanceof Error?e.message:String(e)})})},archiveSession(e){return Ej().archiveSession(e)}};function Ej(){if(!Sj)throw Error(`网关尚未连接`);return Sj}function Dj(e){hj.notice({level:`error`,text:e instanceof Error?e.message:String(e)})}function Oj(e,t){let n=e.slice(0,t),r=/(?:^|\s|[([{])(@(?:"[^"\n]*"?|[^\s"@]*))$/.exec(n);if(!r?.[1])return null;let i=r[1];return{start:t-i.length,end:t,query:i.slice(1).replace(/^"|"$/g,``)}}function kj(e,t=!1){let n=t&&!e.endsWith(`/`)?`${e}/`:e;return`@${/\s/.test(n)?`"${n}"`:n}`}function Aj(e,t,n,r){let i=kj(n,r),a=r?``:` `;return{text:e.slice(0,t.start)+i+a+e.slice(t.end),cursor:t.start+i.length+a.length-(r&&i.endsWith(`"`)?1:0)}}function jj(e){return e.skill===void 0?e.text:e.skill.args===``?`/skill:${e.skill.name}`:`/skill:${e.skill.name} ${e.skill.args}`}function Mj(e){return e.phase===`done`?e.isError?`error`:`ok`:e.phase}function Nj(e){return(e.phase===`done`?e.result:e.output)??``}function Pj(e){let t=e.width>0&&e.height>0?` · ${e.width}×${e.height}`:``;return`${e.name} · ${e.mimeType}${t}`}function Fj(e){return e<1e3?`${Math.round(e)}ms`:`${(e/1e3).toFixed(1)}s`}function Ij(e){return e.replace(/\s+/g,` `).trim()}function Lj(e){let t=[];for(let n of e){if(n.type!==`user`||n.subagentRoundId!==void 0)continue;let e=jj(n).trim();e!==``&&t.at(-1)!==e&&t.push(e)}return t.reverse().slice(0,100)}var Rj=e=>/^\/[^\s]*$/.test(e);function zj(e,t){let n=Rj(e)?e:`/`;return[{key:`compact`,label:`/compact`,description:`压缩上下文(可附加要求)`},...t.map(e=>({key:`skill:${e.name}`,label:`/skill:${e.name}`,description:e.description,...e.level===`builtin`?{badge:`内置`}:{}}))].filter(e=>e.label.startsWith(n))}function Bj(e,t=160){e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,t)}px`}function Vj(e,t,n,r,i){if(n.shiftKey||n.altKey||n.ctrlKey||n.metaKey||n.key!==`ArrowUp`&&n.key!==`ArrowDown`||i.start!==i.end)return null;let a=e!==null&&e.entries[e.index]===r?e:null;if(n.key===`ArrowUp`){if(i.start!==0)return null;let e=a?.entries??t,n=(a?.index??-1)+1,o=e[n];return o===void 0?null:{browse:{index:n,draft:a?.draft??r,entries:e},text:o,caret:`start`}}if(a===null||i.start!==r.length)return null;let o=a.index-1;return o<0?{browse:null,text:a.draft,caret:`end`}:{browse:{...a,index:o},text:a.entries[o]??``,caret:`end`}}function Hj(){return typeof window<`u`}function Uj(e){return Kj(e)?(e.nodeName||``).toLowerCase():`#document`}function Wj(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Gj(e){return((Kj(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Kj(e){return Hj()?e instanceof Node||e instanceof Wj(e).Node:!1}function qj(e){return Hj()?e instanceof Element||e instanceof Wj(e).Element:!1}function Jj(e){return Hj()?e instanceof HTMLElement||e instanceof Wj(e).HTMLElement:!1}function Yj(e){return!Hj()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Wj(e).ShadowRoot}function Xj(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=sM(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Zj(e){return/^(table|td|th)$/.test(Uj(e))}function Qj(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var $j=/transform|translate|scale|rotate|perspective|filter/,eM=/paint|layout|strict|content/,tM=e=>!!e&&e!==`none`,nM;function rM(e){let t=qj(e)?sM(e):e;return tM(t.transform)||tM(t.translate)||tM(t.scale)||tM(t.rotate)||tM(t.perspective)||!aM()&&(tM(t.backdropFilter)||tM(t.filter))||$j.test(t.willChange||``)||eM.test(t.contain||``)}function iM(e){let t=lM(e);for(;Jj(t)&&!oM(t);){if(rM(t))return t;if(Qj(t))return null;t=lM(t)}return null}function aM(){return nM??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),nM}function oM(e){return/^(html|body|#document)$/.test(Uj(e))}function sM(e){return Wj(e).getComputedStyle(e)}function cM(e){return qj(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function lM(e){if(Uj(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Yj(e)&&e.host||Gj(e);return Yj(t)?t.host:t}function uM(e){let t=lM(e);return oM(t)?(e.ownerDocument||e).body:Jj(t)&&Xj(t)?t:uM(t)}function dM(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=uM(e),i=r===e.ownerDocument?.body,a=Wj(r);if(i){let e=fM(a);return t.concat(a,a.visualViewport||[],Xj(r)?r:[],e&&n?dM(e):[])}return t.concat(r,dM(r,[],n))}function fM(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var pM=Math.min,mM=Math.max,hM=Math.round,gM=Math.floor,_M=e=>({x:e,y:e}),vM={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function yM(e,t,n){return mM(e,pM(t,n))}function bM(e,t){return typeof e==`function`?e(t):e}function xM(e){return e.split(`-`)[0]}function SM(e){return e.split(`-`)[1]}function CM(e){return e===`x`?`y`:`x`}function wM(e){return e===`y`?`height`:`width`}function TM(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function EM(e){return CM(TM(e))}function DM(e,t,n){n===void 0&&(n=!1);let r=SM(e),i=EM(e),a=wM(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=IM(o)),[o,IM(o)]}function OM(e){let t=IM(e);return[kM(e),t,kM(t)]}function kM(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var AM=[`left`,`right`],jM=[`right`,`left`],MM=[`top`,`bottom`],NM=[`bottom`,`top`];function PM(e,t,n){switch(e){case`top`:case`bottom`:return n?t?jM:AM:t?AM:jM;case`left`:case`right`:return t?MM:NM;default:return[]}}function FM(e,t,n,r){let i=SM(e),a=PM(xM(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(kM)))),a}function IM(e){let t=xM(e);return vM[t]+e.slice(t.length)}function LM(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function RM(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:LM(e)}function zM(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}var BM=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[href]:not([inert]):not([inert] *)`,`area[href]:not([inert]):not([inert] *)`,`button:not([inert]):not([inert] *)`,`[tabindex]:not(slot):not([inert]):not([inert] *)`,`audio[controls]:not([inert]):not([inert] *)`,`video[controls]:not([inert]):not([inert] *)`,`[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)`,`details>summary:first-of-type:not([inert]):not([inert] *)`,`details:not([inert]):not([inert] *)`].join(`,`),VM=typeof Element>`u`,HM=VM?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,UM=!VM&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},WM=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):WM(e.parentNode))},GM=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},KM=function(e,t,n){if(WM(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(BM));return t&&HM.call(e,BM)&&r.unshift(e),r=r.filter(n),r},qM=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!WM(a,!1)){if(a.tagName===`SLOT`){var o=a.assignedElements(),s=qM(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{HM.call(a,BM)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!WM(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=qM(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}}return r},JM=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},YM=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||GM(e))&&!JM(e)?0:e.tabIndex},XM=function(e,t){var n=YM(e);return n<0&&t&&!JM(e)?0:n},ZM=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},QM=function(e){return e.tagName===`INPUT`},$M=function(e){return QM(e)&&e.type===`hidden`},eN=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},tN=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},nN=function(e){if(!e.name)return!0;var t=e.form||UM(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=tN(r,e.form);return!i||i===e},rN=function(e){return QM(e)&&e.type===`radio`},iN=function(e){return rN(e)&&!nN(e)},aN=function(e){var t=e&&UM(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=UM(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},oN=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},sN=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});var i=getComputedStyle(e).visibility;if(i===`hidden`||i===`collapse`)return!0;var a=HM.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(HM.call(a,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var o=e;e;){var s=e.parentElement,c=UM(e);if(s&&!s.shadowRoot&&r(s)===!0)return oN(e);e=e.assignedSlot?e.assignedSlot:!s&&c!==e.ownerDocument?c.host:s}e=o}if(aN(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return oN(e);return!1},cN=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return HM.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},lN=function(e,t){return!(t.disabled||$M(t)||sN(t,e)||eN(t)||cN(t))},uN=function(e,t){return!(iN(t)||YM(t)<0||!lN(e,t))},dN=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},fN=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=XM(a,i),s=i?fN(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(ZM).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},pN=function(e,t){return t||={},fN(t.getShadowRoot?qM([e],t.includeContainer,{filter:uN.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:dN}):KM(e,t.includeContainer,uN.bind(null,t)))};function mN(){return/apple/i.test(navigator.vendor)}function hN(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function gN(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Yj(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function _N(e){return e?.ownerDocument||document}var vN=typeof document<`u`?f.useLayoutEffect:function(){},yN={...f}.useInsertionEffect||(e=>e());function bN(e){let t=f.useRef(()=>{});return yN(()=>{t.current=e}),f.useCallback(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}var xN=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`});function SN(e,t){let n=pN(e,xN()),r=n.length;if(r===0)return;let i=hN(_N(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function CN(e){return SN(_N(e).body,1)||e}function wN(e){return SN(_N(e).body,-1)||e}function TN(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!gN(n,r)}function EN(e){pN(e,xN()).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function DN(e){e.querySelectorAll(`[data-tabindex]`).forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}var ON=l(gi(),1);function kN(e,t,n){let{reference:r,floating:i}=e,a=TM(t),o=EM(t),s=wM(o),c=xM(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=SM(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function AN(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=bM(t,e),p=RM(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=zM(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=zM(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var jN=50,MN=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:AN},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=kN(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<jN&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=kN(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},NN=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=bM(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=xM(r),_=TM(o),v=xM(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[IM(o)]:OM(o)),x=p!==`none`;!d&&x&&b.push(...FM(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=DM(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===TM(t)||T.every(e=>TM(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=TM(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},PN=new Set([`left`,`top`]);async function FN(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=xM(n),s=SM(n),c=TM(n)===`y`,l=PN.has(o)?-1:1,u=a&&c?-1:1,d=bM(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var IN=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await FN(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},LN=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=bM(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=TM(i),p=CM(f),m=u[p],h=u[f],g=(e,t)=>yM(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},RN=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=bM(e,t),c=await i.detectOverflow(t,s),l=xM(n),u=SM(n),d=TM(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=pM(p-c[m],g),y=pM(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*mM(c.left,c.right):S=p-2*mM(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function zN(e){let t=sM(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Jj(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=hM(n)!==a||hM(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function BN(e){return qj(e)?e:e.contextElement}function VN(e){let t=BN(e);if(!Jj(t))return _M(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=zN(t),o=(a?hM(n.width):n.width)/r,s=(a?hM(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var HN=_M(0);function UN(e){let t=Wj(e);return!aM()||!t.visualViewport?HN:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function WN(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Wj(e)}function GN(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=BN(e),o=_M(1);t&&(r?qj(r)&&(o=VN(r)):o=VN(e));let s=WN(a,n,r)?UN(a):_M(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Wj(a),t=qj(r)?Wj(r):r,n=e,i=fM(n);for(;i&&t!==n;){let e=VN(i),t=i.getBoundingClientRect(),r=sM(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Wj(i),i=fM(n)}}return zM({width:u,height:d,x:c,y:l})}function KN(e,t){let n=cM(e).scrollLeft;return t?t.left+n:GN(Gj(e)).left+n}function qN(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-KN(e,n),y:n.top+t.scrollTop}}function JN(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Gj(r),s=t?Qj(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=_M(1),u=_M(0),d=Jj(r);if((d||!a)&&((Uj(r)!==`body`||Xj(o))&&(c=cM(r)),d)){let e=GN(r);l=VN(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?qN(o,c):_M(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function YN(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function XN(e){let t=cM(e),n=e.ownerDocument.body,r=mM(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=mM(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+KN(e),o=-t.scrollTop;return sM(n).direction===`rtl`&&(a+=mM(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var ZN=25;function QN(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Wj(e),a=Gj(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!aM()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(KN(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=ZN&&(s-=o)}return{width:s,height:c,x:l,y:u}}function $N(e,t){let n=GN(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=VN(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function eP(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=QN(e,n,t);else if(t===`document`)r=XN(Gj(e));else if(qj(t))r=$N(t,n);else{let n=UN(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return zM(r)}function tP(e,t){let n=t.get(e);if(n)return n;let r=dM(e,[],!1).filter(e=>qj(e)&&Uj(e)!==`body`),i=null,a=sM(e).position===`fixed`,o=a?lM(e):e;for(;qj(o)&&!oM(o);){let e=sM(o),t=rM(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=lM(o)}return t.set(e,r),r}function nP(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Qj(t)?[]:tP(t,this._c):[].concat(n),r],o=eP(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=eP(t,a[e],i);s=mM(n.top,s),c=pM(n.right,c),l=pM(n.bottom,l),u=mM(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function rP(e){let{width:t,height:n}=zN(e);return{width:t,height:n}}function iP(e,t,n){let r=Jj(t),i=Gj(t),a=n===`fixed`,o=GN(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=_M(0);if((r||!a)&&((Uj(t)!==`body`||Xj(i))&&(s=cM(t)),r)){let e=GN(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=KN(i));let l=i&&!r&&!a?qN(i,s):_M(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function aP(e){return sM(e).position===`static`}function oP(e,t){if(!Jj(e)||sM(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Gj(e)===n&&(n=n.ownerDocument.body),n}function sP(e,t){let n=Wj(e);if(Qj(e))return n;if(!Jj(e)){let t=lM(e);for(;t&&!oM(t);){if(qj(t)&&!aP(t))return t;t=lM(t)}return n}let r=oP(e,t);for(;r&&Zj(r)&&aP(r);)r=oP(r,t);return r&&oM(r)&&aP(r)&&!rM(r)?n:r||iM(e)||n}var cP=async function(e){let t=this.getOffsetParent||sP,n=this.getDimensions,r=await n(e.floating);return{reference:iP(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function lP(e){return sM(e).direction===`rtl`}var uP={convertOffsetParentRelativeRectToViewportRelativeRect:JN,getDocumentElement:Gj,getClippingRect:nP,getOffsetParent:sP,getElementRects:cP,getClientRects:YN,getDimensions:rP,getScale:VN,isElement:qj,isRTL:lP};function dP(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fP(e,t,n){let r=null,i,a=Gj(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=gM(d),h=gM(a.clientWidth-(u+f)),g=gM(a.clientHeight-(d+p)),_=gM(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:mM(0,pM(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!dP(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Wj(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function pP(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=BN(e),u=i||a?[...l?dM(l):[],...t?dM(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?fP(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?GN(e):null;c&&g();function g(){let t=GN(e);h&&!dP(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var mP=IN,hP=LN,gP=NN,_P=RN,vP=(e,t,n)=>{let r=new Map,i=n??{},a={...uP,...i.platform,_c:r};return MN(e,t,{...i,platform:a})},yP=typeof document<`u`?f.useLayoutEffect:function(){};function bP(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!bP(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!bP(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function xP(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function SP(e,t){let n=xP(e);return Math.round(t*n)/n}function CP(e){let t=f.useRef(e);return yP(()=>{t.current=e}),t}function wP(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=f.useState(r);bP(p,r)||m(r);let[h,g]=f.useState(null),[_,v]=f.useState(null),y=f.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=f.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=f.useRef(null),w=f.useRef(null),T=f.useRef(u),ee=c!=null,te=CP(c),ne=CP(i),re=CP(l),E=f.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};ne.current&&(e.platform=ne.current),vP(C.current,w.current,e).then(e=>{let t={...e,isPositioned:re.current!==!1};ie.current&&!bP(T.current,t)&&(T.current=t,ON.flushSync(()=>{d(t)}))})},[p,t,n,ne,re]);yP(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let ie=f.useRef(!1);yP(()=>(ie.current=!0,()=>{ie.current=!1}),[]),yP(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(te.current)return te.current(x,S,E);E()}},[x,S,E,te,ee]);let ae=f.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),oe=f.useMemo(()=>({reference:x,floating:S}),[x,S]),D=f.useMemo(()=>{let e={position:n,left:0,top:0};if(!oe.floating)return e;let t=SP(oe.floating,u.x),r=SP(oe.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...xP(oe.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,oe.floating,u.x,u.y]);return f.useMemo(()=>({...u,update:E,refs:ae,elements:oe,floatingStyles:D}),[u,E,ae,oe,D])}var TP=(e,t)=>{let n=mP(e);return{name:n.name,fn:n.fn,options:[e,t]}},EP=(e,t)=>{let n=hP(e);return{name:n.name,fn:n.fn,options:[e,t]}},DP=(e,t)=>{let n=gP(e);return{name:n.name,fn:n.fn,options:[e,t]}},OP=(e,t)=>{let n=_P(e);return{name:n.name,fn:n.fn,options:[e,t]}},kP=`ArrowLeft`,AP=`ArrowRight`,jP=`ArrowUp`,MP=`ArrowDown`,NP=[kP,AP],PP=[jP,MP];[...NP,...PP];var FP={...f},IP=!1,LP=0,RP=()=>`floating-ui-`+Math.random().toString(36).slice(2,6)+LP++;function zP(){let[e,t]=f.useState(()=>IP?RP():void 0);return vN(()=>{e??t(RP())},[]),f.useEffect(()=>{IP=!0},[]),e}var BP=FP.useId||zP;function VP(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}var HP=f.createContext(null),UP=f.createContext(null),WP=()=>f.useContext(HP)?.id||null,GP=()=>f.useContext(UP);function KP(e){return`data-floating-ui-`+e}var qP={border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`fixed`,whiteSpace:`nowrap`,width:`1px`,top:0,left:0},JP=f.forwardRef(function(e,t){let[n,r]=f.useState();vN(()=>{mN()&&r(`button`)},[]);let i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[KP(`focus-guard`)]:``,style:qP};return(0,A.jsx)(`span`,{...e,...i})}),YP={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},XP=f.createContext(null),ZP=KP(`portal`);function QP(e){e===void 0&&(e={});let{id:t,root:n}=e,r=BP(),i=eF(),[a,o]=f.useState(null),s=f.useRef(null);return vN(()=>()=>{a?.remove(),queueMicrotask(()=>{s.current=null})},[a]),vN(()=>{if(!r||s.current)return;let e=t?document.getElementById(t):null;if(!e)return;let n=document.createElement(`div`);n.id=r,n.setAttribute(ZP,``),e.appendChild(n),s.current=n,o(n)},[t,r]),vN(()=>{if(n===null||!r||s.current)return;let e=n||i?.portalNode;e&&!Kj(e)&&(e=e.current),e||=document.body;let a=null;t&&(a=document.createElement(`div`),a.id=t,e.appendChild(a));let c=document.createElement(`div`);c.id=r,c.setAttribute(ZP,``),e=a||e,e.appendChild(c),s.current=c,o(c)},[t,n,r,i]),a}function $P(e){let{children:t,id:n,root:r,preserveTabOrder:i=!0}=e,a=QP({id:n,root:r}),[o,s]=f.useState(null),c=f.useRef(null),l=f.useRef(null),u=f.useRef(null),d=f.useRef(null),p=o?.modal,m=o?.open,h=!!o&&!o.modal&&o.open&&i&&!!(r||a);return f.useEffect(()=>{if(!a||!i||p)return;function e(e){a&&TN(e)&&(e.type===`focusin`?DN:EN)(a)}return a.addEventListener(`focusin`,e,!0),a.addEventListener(`focusout`,e,!0),()=>{a.removeEventListener(`focusin`,e,!0),a.removeEventListener(`focusout`,e,!0)}},[a,i,p]),f.useEffect(()=>{a&&(m||DN(a))},[m,a]),(0,A.jsxs)(XP.Provider,{value:f.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:c,afterOutsideRef:l,beforeInsideRef:u,afterInsideRef:d,portalNode:a,setFocusManagerState:s}),[i,a]),children:[h&&a&&(0,A.jsx)(JP,{"data-type":`outside`,ref:c,onFocus:e=>{if(TN(e,a)){var t;(t=u.current)==null||t.focus()}else wN(o?o.domReference:null)?.focus()}}),h&&a&&(0,A.jsx)(`span`,{"aria-owns":a.id,style:YP}),a&&ON.createPortal(t,a),h&&a&&(0,A.jsx)(JP,{"data-type":`outside`,ref:l,onFocus:e=>{if(TN(e,a)){var t;(t=d.current)==null||t.focus()}else CN(o?o.domReference:null)?.focus(),o!=null&&o.closeOnFocusOut&&o?.onOpenChange(!1,e.nativeEvent,`focus-out`)}})]})}var eF=()=>f.useContext(XP);function tF(e){let{open:t=!1,onOpenChange:n,elements:r}=e,i=BP(),a=f.useRef({}),[o]=f.useState(()=>VP()),s=WP()!=null,[c,l]=f.useState(r.reference),u=bN((e,t,r)=>{a.current.openEvent=e?t:void 0,o.emit(`openchange`,{open:e,event:t,reason:r,nested:s}),n?.(e,t,r)}),d=f.useMemo(()=>({setPositionReference:l}),[]),p=f.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return f.useMemo(()=>({dataRef:a,open:t,onOpenChange:u,elements:p,events:o,floatingId:i,refs:d}),[t,u,p,o,i,d])}function nF(e){let{elements:t,...n}=e===void 0?{}:e,{nodeId:r}=n,i=tF({...n,elements:{reference:t?.reference??null,floating:t?.floating??null}}),a=n.rootContext||i,o=a.elements,[s,c]=f.useState(null),[l,u]=f.useState(null),d=o?.domReference||s,p=f.useRef(null),m=GP();vN(()=>{d&&(p.current=d)},[d]);let h=wP({...n,elements:{...o,...l&&{reference:l}}}),g=f.useCallback(e=>{let t=qj(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),h.refs.setReference(t)},[h.refs]),_=f.useCallback(e=>{(qj(e)||e===null)&&(p.current=e,c(e)),(qj(h.refs.reference.current)||h.refs.reference.current===null||e!==null&&!qj(e))&&h.refs.setReference(e)},[h.refs]),v=f.useMemo(()=>({...h.refs,setReference:_,setPositionReference:g,domReference:p}),[h.refs,_,g]),y=f.useMemo(()=>({...h.elements,domReference:d}),[h.elements,d]),b=f.useMemo(()=>({...h,...a,refs:v,elements:y,nodeId:r}),[h,v,y,r,a]);return vN(()=>{a.dataRef.current.floatingContext=b;let e=m?.nodesRef.current.find(e=>e.id===r);e&&(e.context=b)}),f.useMemo(()=>({...h,context:b,refs:v,elements:y}),[h,v,y,b])}function rF({anchor:e,id:t,title:n,items:r,selected:i,onSelect:a,onAccept:o,message:s,onRetry:c}){let{refs:l,floatingStyles:u,isPositioned:d}=nF({elements:{reference:e.current},placement:`top-start`,whileElementsMounted:pP,middleware:[TP(8),DP(),EP({padding:12}),OP({padding:12,apply({availableHeight:e,availableWidth:t,rects:n,elements:r}){Object.assign(r.floating.style,{maxHeight:`${Math.max(0,Math.min(320,e))}px`,width:`${Math.min(n.reference.width,t)}px`})}})]});return(0,f.useEffect)(()=>{document.getElementById(`${t}-${i}`)?.scrollIntoView({block:`nearest`})},[t,i]),(0,A.jsx)($P,{children:(0,A.jsxs)(`div`,{ref:l.setFloating,style:{...u,visibility:d?`visible`:`hidden`},className:`z-50 overflow-y-auto rounded-xl border border-sakura-200 bg-base p-1.5 shadow-soft`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-3 gap-y-1 px-3 py-2 text-xs text-ink-500`,children:[(0,A.jsx)(`span`,{children:n}),(0,A.jsx)(`span`,{children:`↑↓ 选择 · Enter / Tab 确认 · Esc 关闭`})]}),(0,A.jsx)(`div`,{id:t,role:`listbox`,tabIndex:-1,"aria-label":n,children:r.map((e,n)=>(0,A.jsxs)(`button`,{type:`button`,role:`option`,id:`${t}-${n}`,"aria-selected":n===i,tabIndex:-1,title:e.description,onMouseDown:e=>e.preventDefault(),onPointerMove:e=>{e.pointerType===`mouse`&&(e.movementX!==0||e.movementY!==0)&&a(n)},onClick:()=>o(n),className:`block w-full rounded-lg px-3 py-2 text-left ${n===i?`bg-sakura-100`:``}`,children:[(0,A.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,A.jsx)(`span`,{className:`truncate text-sm text-ink-900`,children:e.label}),e.badge&&(0,A.jsx)(`span`,{className:`shrink-0 rounded-md bg-ink-100 px-1.5 py-0.5 text-xs text-ink-600`,children:e.badge})]}),(0,A.jsx)(`span`,{className:`block truncate text-xs text-ink-500`,children:e.description})]},e.key))}),s&&(0,A.jsx)(`output`,{className:`block break-words px-3 py-2 text-sm text-ink-500`,children:s}),c&&(0,A.jsx)(`button`,{type:`button`,className:`px-3 py-2 text-sm text-ink-900 underline`,onMouseDown:e=>e.preventDefault(),onClick:c,children:`重试文件查询`})]})})}function iF(e,t,n,r,i){let[a,o]=(0,f.useState)(null),[s,c]=(0,f.useState)({entries:[],limited:!1,incomplete:!1}),[l,u]=(0,f.useState)(``),[d,p]=(0,f.useState)(0),[m,h]=(0,f.useState)(!1),g=(0,f.useRef)(0),_=(0,f.useId)(),v=()=>{g.current++,o(null),c({entries:[],limited:!1,incomplete:!1}),p(0)},y=()=>{let t=e.current;if(!t||!r)return v();let n=Oj(t.value,t.selectionStart);if(!n)return v();a&&n.start===a.start&&n.end===a.end&&n.query===a.query||(g.current++,c({entries:[],limited:!1,incomplete:!1}),u(`正在查找文件…`),h(!1),o(n),p(0))};(0,f.useEffect)(()=>{if(!a||!r){o(null);return}let e=new AbortController,t=++g.current,i=setTimeout(()=>{Tj.searchFiles(a.query,n,e.signal).then(n=>{e.signal.aborted||t!==g.current||(c(n),u(n.incomplete?`文件索引未完整,请输入子目录缩小范围`:n.entries.length?n.limited?`结果较多,请继续输入路径缩小范围`:``:`没有匹配的文件或目录`))}).catch(n=>{!e.signal.aborted&&t===g.current&&(h(!0),u(n instanceof Error?`查询失败:${n.message}`:`查询失败,请重试`))})},120);return()=>{clearTimeout(i),e.abort()}},[a,n,r]);let b=e=>{a&&(i(e,a),v())};return{refresh:y,close:v,keyDown:e=>{if(!a||e.nativeEvent.isComposing)return!1;if(e.key===`Escape`||e.key===`Tab`&&(e.shiftKey||!s.entries.length))return v(),e.key===`Escape`&&e.preventDefault(),e.key===`Escape`;if(e.key===`ArrowDown`||e.key===`ArrowUp`)return e.preventDefault(),p(t=>Math.max(0,Math.min(s.entries.length-1,t+(e.key===`ArrowDown`?1:-1)))),!0;if((e.key===`Enter`||e.key===`Tab`)&&!e.shiftKey){e.preventDefault();let t=s.entries[d];return t&&b(t),!0}return!1},panel:a&&r?(0,A.jsx)(rF,{anchor:t,id:_,title:`工作区文件`,selected:d,onSelect:p,onAccept:e=>{let t=s.entries[e];t&&b(t)},items:s.entries.map(e=>({key:e.path,label:`${e.kind===`directory`?`▸`:`▤`} ${e.name}${e.kind===`directory`?`/`:``}`,description:e.path})),message:l,onRetry:m?()=>{g.current++,h(!1),u(`正在查找文件…`),o(e=>e?{...e}:null)}:void 0}):null,open:!!a,controls:a?_:void 0,active:a&&s.entries[d]?`${_}-${d}`:void 0}}var aF=`(max-width: 768px)`;function oF({name:e,size:t=18,className:n}){return(0,A.jsx)(`svg`,{width:t,height:t,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:e===`more`?3:1.6,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,className:n,children:(0,A.jsx)(`path`,{d:{folder:`M3 6h6l2 2h10v11H3z`,plus:`M12 5v14M5 12h14`,chevron:`m8 10 4 4 4-4`,panel:`M3 4h18v16H3zM9 4v16`,search:`M20 20l-5-5M17 10a7 7 0 1 1-14 0 7 7 0 0 1 14 0`,more:`M5 12h.01M12 12h.01M19 12h.01`,chat:`M4 4h16v12H9l-5 4z`,close:`m6 6 12 12M6 18 18 6`,settings:`M12 3v3M12 18v3M3 12h3M18 12h3M5.6 5.6l2.1 2.1M16.3 16.3l2.1 2.1M5.6 18.4l2.1-2.1M16.3 7.7l2.1-2.1M17 12a5 5 0 1 1-10 0 5 5 0 0 1 10 0`,archive:`M3 4h18v4H3zM5 8v12h14V8M10 12h4`,up:`m5 12 7-7 7 7M12 5v14`,bolt:`M13 2 4 14h6l-1 8 9-12h-6l1-8z`,check:`M5 12.5l4.5 4.5L19 7.5`,clock:`M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18ZM12 7v5l3 2`,spinner:`M21 12a9 9 0 1 1-9-9`,store:`M4 9.5 5.6 4.5h12.8L20 9.5M4 9.5V20h16V9.5M4 9.5h16M9.5 20v-5.5h5V20`,info:`M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18ZM12 12v4M12 8h.01`,key:`M12.7 11.3 21 3m-4.2 1.8 3 3M8 19a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z`,download:`M12 4v10m0 0-4-4m4 4 4-4M5 20h14`,copy:`M9 9h11v11H9zM5 15H4V4h11v1`,trash:`M4.5 7h15M9.5 7V4.5h5V7m-7.5 0 .8 13h8.4l.8-13`,eye:`M2.5 12S6 6 12 6s9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Zm9.5 2.4a2.4 2.4 0 1 0 0-4.8 2.4 2.4 0 0 0 0 4.8Z`,phone:`M8 3h8a1.5 1.5 0 0 1 1.5 1.5v15A1.5 1.5 0 0 1 16 21H8a1.5 1.5 0 0 1-1.5-1.5v-15A1.5 1.5 0 0 1 8 3Zm2.5 14.5h3`,sparkles:`M12 4l1.8 4.7L18.5 10.5l-4.7 1.8L12 17l-1.8-4.7L5.5 10.5l4.7-1.8zM18.5 3l.8 2 2 .8-2 .8-.8 2-.8-2-2-.8 2-.8zM5 16l.7 1.8 1.8.7-1.8.7L5 21l-.7-1.8-1.8-.7 1.8-.7z`}[e]})})}function sF(){let[e,t]=(0,f.useState)(()=>window.matchMedia(aF).matches);return(0,f.useEffect)(()=>{let e=window.matchMedia(aF),n=()=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}var cF=0,lF=``;function uF(e){let t=(0,f.useRef)(null),n=(0,f.useId)();return(0,f.useEffect)(()=>{let e=document.activeElement,n=t.current;return cF===0&&(lF=document.body.style.overflow),cF+=1,document.body.style.overflow=`hidden`,n.showModal(),()=>{n.close(),--cF,cF===0&&(document.body.style.overflow=lF),e?.isConnected&&e.focus()}},[]),(0,ON.createPortal)((0,A.jsxs)(`dialog`,{ref:t,className:`chrome dialog ${e.drawer?`drawer`:``}`,"aria-labelledby":n,onCancel:t=>{t.preventDefault(),e.locked||e.onClose()},onKeyDown:e=>{if(e.key!==`Tab`)return;let t=[...e.currentTarget.querySelectorAll(`button:not(:disabled), input:not(:disabled), a[href], [tabindex='0']`)].filter(e=>e.getClientRects().length>0),n=t[0],r=t.at(-1);e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())},children:[(0,A.jsxs)(`div`,{className:`dialog-heading`,children:[(0,A.jsx)(`h2`,{id:n,children:e.title}),(0,A.jsx)(`button`,{type:`button`,className:`icon-btn`,"aria-label":`关闭`,title:`关闭`,disabled:e.locked,onClick:e.onClose,children:(0,A.jsx)(oF,{name:`close`})})]}),e.children]}),document.body)}function dF(e){let t=(0,f.useRef)(null),n=(0,f.useRef)(e.onClose);n.current=e.onClose;let[r,i]=(0,f.useState)({left:8,top:8});return(0,f.useLayoutEffect)(()=>{let r=t.current,a=()=>{let t=e.anchor.getBoundingClientRect(),n=t.bottom+4+r.offsetHeight>window.innerHeight?Math.max(8,t.top-r.offsetHeight-4):t.bottom+4;i({left:Math.max(8,Math.min(t.left,window.innerWidth-r.offsetWidth-8)),top:n})};a(),r.querySelector(`button:not(:disabled), input, a`)?.focus();let o=t=>{!r.contains(t.target)&&!e.anchor.contains(t.target)&&n.current()};return document.addEventListener(`pointerdown`,o),window.addEventListener(`resize`,a),()=>{document.removeEventListener(`pointerdown`,o),window.removeEventListener(`resize`,a),e.anchor.isConnected&&e.anchor.focus()}},[e.anchor]),(0,ON.createPortal)((0,A.jsx)(`div`,{ref:t,className:`chrome popover`,role:`dialog`,"aria-label":e.label,style:r,onKeyDown:t=>{if(t.key===`Escape`&&(t.preventDefault(),t.stopPropagation(),e.onClose()),t.key===`Tab`){e.onClose();return}if(t.key!==`ArrowDown`&&t.key!==`ArrowUp`)return;t.preventDefault();let n=[...t.currentTarget.querySelectorAll(`button:not(:disabled), a`)];n[(n.indexOf(document.activeElement)+(t.key===`ArrowDown`?1:-1)+n.length)%n.length]?.focus()},children:e.children}),e.anchor.closest(`dialog`)??document.body)}var fF=e=>e.split(/[\\/]/).filter(Boolean).at(-1)??e;function pF(e){return(0,A.jsx)(`button`,{type:`button`,className:`icon-btn focus-neko rounded hover:bg-black/5`,"aria-label":e.label,title:e.label,onClick:e.onClick,children:(0,A.jsx)(oF,{name:`close`,size:14})})}function mF(e){let{models:t,currentSessionId:n,view:r,phase:i,operating:a}=pj(),[o,s]=(0,f.useState)(null),c=t.find(t=>t.provider===e.current?.provider&&t.modelId===e.current?.modelId);o&&o.id!==n&&s(null);let l=c?.name??e.fallbackLabel;return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`button`,{type:`button`,disabled:!c||i!==`ready`||a,onClick:()=>n&&s({id:n}),className:`focus-neko min-w-0 truncate rounded-full px-2 py-1 text-left text-xs text-ink-500 hover:bg-sakura-50`,"aria-label":`模型与思考强度:${l} ${r?.agent.thinkingLevel??``}`,children:[l,` · `,r?.agent.thinkingLevel??`off`,` ▾`]}),o&&o.id===n&&c&&(0,A.jsx)(hF,{session:o.id,current:c,level:r?.agent.thinkingLevel??`off`,onClose:()=>s(e=>e===o?null:e)},o.id)]})}function hF(e){let{models:t}=pj(),[n,r]=(0,f.useState)(e.current),[i,a]=(0,f.useState)(e.level),[o,s]=(0,f.useState)(!1),c=(0,f.useRef)(!1),[l,u]=(0,f.useState)(``);async function d(){if(!c.current){c.current=!0,s(!0),u(``);try{await Tj.configure({model:{provider:n.provider,modelId:n.modelId},thinkingLevel:i},e.session),e.onClose()}catch{u(`配置失败,请重试。`)}finally{c.current=!1,s(!1)}}}return(0,A.jsx)(uF,{title:`模型与思考强度`,onClose:e.onClose,children:(0,A.jsxs)(`div`,{className:`space-y-5 p-5`,children:[(0,A.jsx)(`fieldset`,{className:`space-y-2`,"aria-label":`模型`,children:t.map(e=>(0,A.jsxs)(`button`,{type:`button`,disabled:o,"aria-pressed":e===n,onClick:()=>{r(e),a(e.thinkingLevelAdjustments[i])},className:`focus-neko block w-full rounded-xl border px-4 py-3 text-left text-sm ${e===n?`border-sakura-300 bg-sakura-50 text-sakura-800`:`border-sakura-200 bg-surface text-ink-700`}`,children:[e.name,e===n?` ✓`:``,(0,A.jsx)(`span`,{className:`mt-1 block text-xs text-ink-500`,children:e.input.includes(`image`)?`支持图片`:`仅文本`})]},`${e.provider}/${e.modelId}`))}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`mb-2 text-sm text-ink-600`,children:`思考强度`}),(0,A.jsx)(`fieldset`,{className:`flex flex-wrap gap-2`,"aria-label":`思考强度`,children:n.supportedThinkingLevels.map(e=>(0,A.jsx)(`button`,{type:`button`,disabled:o,"aria-pressed":i===e,onClick:()=>a(e),className:`focus-neko rounded-full border px-4 py-2 text-sm ${e===i?`border-tianyi-300 bg-tianyi-50 text-tianyi-800`:`border-sakura-200`}`,children:e},e))})]}),(0,A.jsx)(`p`,{className:`text-xs text-ink-500`,children:`仅当前会话,从下一次请求生效。`}),l&&(0,A.jsx)(`p`,{role:`alert`,className:`text-sm text-sakura-800`,children:l}),(0,A.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,A.jsx)(`button`,{type:`button`,onClick:e.onClose,className:`btn-outline rounded-full px-4 py-2 text-sm`,children:`取消`}),(0,A.jsx)(`button`,{type:`button`,disabled:o,onClick:()=>void d(),className:`btn-primary rounded-full px-5 py-2 text-sm`,children:o?`应用中…`:`应用`})]})]})})}var gF=new Map,_F=new Set,vF=new Set;function yF(){let e=mj(),t=e.currentSessionId,n=t??`none:${e.workspaceRoot}`,r=gF.get(n);if(vF.size||e.operating)hj.notice({level:`info`,text:`发送中,请稍后刷新`});else if([...gF.values()].some(e=>e.files.length))hj.notice({level:`info`,text:`先发送或移除附件,再刷新`});else if(!e.webInfo)hj.notice({level:`error`,text:`连接未就绪,请稍后重试`});else if([...gF.entries()].some(([e,t])=>e!==n&&t.text.trim()))hj.notice({level:`info`,text:`其他会话有草稿,请先发送或清空`});else{try{vj({version:1,serverId:e.webInfo.serverId,workspace:e.workspaceRoot,session:t,text:r?.text??``,requestId:r?.requestId??crypto.randomUUID()})}catch{hj.notice({level:`error`,text:`草稿保存失败,请先复制文字`});return}window.location.reload()}}var bF=e=>(_F.add(e),()=>{_F.delete(e)});function xF(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function SF(e){return`$${e.toFixed(e>=1?2:4)}`}function CF(e){let{currentSessionId:t,workspaceRoot:n}=pj();return(0,A.jsx)(TF,{sessionId:t??`none:${n}`,...e},t??`none:${n}`)}function wF({file:e}){let[t,n]=(0,f.useState)(``);return(0,f.useEffect)(()=>{let t=URL.createObjectURL(e);return n(t),()=>URL.revokeObjectURL(t)},[e]),(0,A.jsx)(`img`,{src:t||void 0,alt:e.name,className:`h-16 w-20 rounded-lg object-cover`})}function TF(e){let{credentials:t,view:n,models:r,workspaceRoot:i,phase:a,operating:o}=pj(),s=n?.compaction?.active??[];gF.has(e.sessionId)||gF.set(e.sessionId,{text:``,files:[],requestId:crypto.randomUUID()}),(0,f.useEffect)(()=>{let t=_j(),n=mj();if(t&&t.serverId===n.webInfo?.serverId&&t.workspace===i&&(t.session??`none:${i}`)===e.sessionId){gF.set(e.sessionId,{text:t.text,files:[],requestId:t.requestId}),yj();for(let e of _F)e()}},[e.sessionId,i]);let c=(0,f.useSyncExternalStore)(bF,()=>gF.get(e.sessionId)),[l,u]=(0,f.useState)(!1),[d,p]=(0,f.useState)(``),[m,h]=(0,f.useState)(!1),[g,_]=(0,f.useState)([]),[v,y]=(0,f.useState)(0),[b,x]=(0,f.useState)(``),S=(0,f.useId)(),[C,w]=(0,f.useState)(!1),T=(0,f.useRef)(null),ee=(0,f.useRef)(null),te=(0,f.useRef)(null),ne=(0,f.useRef)(c);ne.current=c;let re=(0,f.useRef)(!1),E=(0,f.useMemo)(()=>Lj(n?.items??[]),[n?.items]),ie=(0,f.useRef)(null),ae=(0,f.useRef)(null);(0,f.useLayoutEffect)(()=>{let e=T.current;if(!ae.current||!e)return;let t=ae.current===`start`?0:e.value.length;ae.current=null,e.setSelectionRange(t,t)}),(0,f.useLayoutEffect)(()=>{let e=T.current;e&&Bj(e)},[c.text,e.sessionId]),(0,f.useEffect)(()=>{let e=T.current;if(!e||typeof ResizeObserver>`u`)return;let t=e.clientWidth,n=new ResizeObserver(()=>{e.clientWidth!==t&&(t=e.clientWidth,Bj(e))});return n.observe(e),()=>n.disconnect()},[]);let oe=e=>{let t=e.currentTarget,n=Vj(ie.current,E,e,t.value,{start:t.selectionStart,end:t.selectionEnd});return n?(ie.current=n.browse,ae.current=n.caret,h(!1),se({text:n.text}),!0):!1},D=t=>{ne.current=t,gF.set(e.sessionId,t);for(let e of _F)e()},se=e=>D({...ne.current,...e,requestId:crypto.randomUUID()}),ce=n?.agent.model?.provider===`deepseek`&&t?.statuses.deepseek.source===`none`,le=r.find(e=>e.provider===n?.agent.model?.provider&&e.modelId===n?.agent.model?.modelId),ue=c.files.length>0&&le!==void 0&&!le.input.includes(`image`),de=e=>{let t=e.map(e=>({id:crypto.randomUUID(),file:e,processing:!0,error:[`image/png`,`image/jpeg`,`image/webp`].includes(e.type)?e.size>20971520?`单图不能超过 20 MiB`:void 0:`仅支持 PNG、JPEG、WebP`}));se({files:[...ne.current.files,...t]});for(let e of t)fe(e)},fe=async t=>{let n=t.error;if(!n)try{(await createImageBitmap(t.file)).close()}catch{n=`无法解码图片,请重新选择`}let r=gF.get(e.sessionId);if(!r?.files.some(e=>e.id===t.id))return;let i={...r,files:r.files.map(e=>e.id===t.id?{...e,error:n,processing:!1}:e)};D(i)},pe=(0,f.useRef)(null),me=(0,f.useRef)(!1);(0,f.useEffect)(()=>()=>{me.current||pe.current?.abort()},[]),(0,f.useEffect)(()=>{if(_([]),y(0),!m)return;if(e.sessionId.startsWith(`none:`)){x(`新建会话后可选择工作区技能`);return}if(a!==`ready`||o){x(`等待会话连接…`);return}let t=new AbortController;return x(`正在加载技能…`),Tj.listSkills(e.sessionId,t.signal).then(e=>{t.signal.aborted||(_(e),x(e.length?``:`当前工作区暂无可用技能`))}).catch(()=>{t.signal.aborted||x(`技能加载失败,请关闭菜单后重试`)}),()=>t.abort()},[e.sessionId,a,o,m]);let he=iF(T,ee,i,a===`ready`&&!o,(t,n)=>{let r=ne.current;if(t.kind===`file`&&/\.(png|jpe?g|webp)$/i.test(t.path)){if(pe.current)return;let a=new AbortController;pe.current=a,p(`正在读取图片…`),(async()=>{let o=e.sessionId;if(o.startsWith(`none:`)){me.current=!0,await Tj.createSession();let e=mj();if(e.workspaceRoot!==i||!e.currentSessionId)throw Error(`工作区已切换`);o=e.currentSessionId,gF.set(o,r);for(let e of _F)e()}let s=await Tj.workspaceImage(t.path,o,a.signal);if(a.signal.aborted||mj().currentSessionId!==o||mj().workspaceRoot!==i)return;let c=gF.get(o)??r,l={id:crypto.randomUUID(),file:new File([new Uint8Array(s.bytes)],s.name,{type:s.mimeType})},u=c.text===r.text?r.text.slice(0,n.start)+r.text.slice(n.end):c.text;gF.set(o,{...c,text:u,files:[...c.files,l],requestId:crypto.randomUUID()});for(let e of _F)e();p(``)})().catch(e=>{if(!a.signal.aborted){let t=e instanceof Error?e.message:`图片读取失败,请重试`;p(t),me.current&&hj.notice({level:`error`,text:t})}}).finally(()=>{pe.current===a&&(pe.current=null)});return}let a=Aj(r.text,n,t.path,t.kind===`directory`),o=T.current;if(o){o.focus(),o.setSelectionRange(n.start,n.end);let e=a.text.slice(n.start,a.text.length-(r.text.length-n.end));document.execCommand(`insertText`,!1,e)?se({text:o.value}):se({text:a.text}),requestAnimationFrame(()=>{o.setSelectionRange(a.cursor,a.cursor),t.kind===`directory`&&he.refresh()})}}),ge=n?.contextUsage,_e=n?.compaction?.latest,ve=_e&&![`summarizing`,`waiting-to-apply`].includes(_e.phase)?_e.at+(_e.phase===`failed`?1e4:5e3):null,[ye,be]=(0,f.useState)(ve!==null&&ve<=Date.now());(0,f.useEffect)(()=>{if(be(ve!==null&&ve<=Date.now()),ve===null||ve<=Date.now())return;let e=setTimeout(()=>be(!0),ve-Date.now());return()=>clearTimeout(e)},[ve]);let O=s.length?s.some(e=>e.retry)?`压缩重试中`:s.some(e=>e.blocking)?`等待上下文压缩`:`正在压缩上下文`:n?.compaction?.failure?`压缩失败:${n.compaction.failure.error}`:_e&&!ye?{applied:`上下文已压缩`,nothing:`当前无需压缩`,skipped:`已跳过过期摘要`,cancelled:`压缩已取消`,failed:`压缩失败,可重试`,summarizing:`正在压缩上下文`,"waiting-to-apply":`等待应用压缩摘要`}[_e.phase]:null,k=!s.length&&(!!n?.compaction?.failure||_e?.phase===`failed`),xe=n?.taskUsage??n?.usage??null,Se=async t=>{if(re.current||e.disabled)return;re.current=!0,u(!0),vF.add(e.sessionId),p(``);let n=ne.current;gF.set(e.sessionId,n);try{await Tj.compact(t,e.sessionId),ne.current===n&&gF.get(e.sessionId)===n&&Oi(n.text)!==null&&D({...n,text:``,requestId:crypto.randomUUID()}),h(!1)}catch(e){p(e instanceof Error?e.message:`压缩失败,请重试`)}finally{re.current=!1,u(!1),vF.delete(e.sessionId)}},Ce=async()=>{let t=Oi(ne.current.text);if(t!==null){await Se(t);return}let n=ne.current;if(gF.set(e.sessionId,n),!(re.current||e.disabled||e.busy||ce||ue||!n.text.trim()&&!n.files.length)){if(n.files.length>4||n.files.reduce((e,t)=>e+t.file.size,0)>41943040)p(`每条消息最多 4 张图片,总大小不超过 40 MiB`);else if(!n.files.some(e=>e.processing)){if(n.files.some(e=>e.error))p(`请先移除不支持的附件`);else{re.current=!0,u(!0),vF.add(e.sessionId),p(``);try{let t=[];for(let e of n.files)t.push({name:e.file.name,mimeType:e.file.type,bytes:new Uint8Array(await e.file.arrayBuffer())});let r=e.sessionId;if(r.startsWith(`none:`)){await Tj.createSession();let e=mj();if(e.workspaceRoot!==i||!e.currentSessionId)throw Error(`工作区已切换,草稿已保留`);r=e.currentSessionId,gF.set(r,n);for(let e of _F)e()}if(await Tj.submit(n.text.trim(),t,n.requestId,r),r!==e.sessionId){gF.set(r,{text:``,files:[],requestId:crypto.randomUUID()});for(let e of _F)e()}let a=gF.get(e.sessionId);a&&D({text:a.text===n.text?``:a.text,files:a.files.filter(e=>!n.files.some(t=>t.id===e.id)),requestId:crypto.randomUUID()})}catch(t){let n=t instanceof Error?t.message:`发送失败,请重试`;p(n),mj().currentSessionId!==e.sessionId&&hj.notice({level:`error`,text:n})}finally{re.current=!1,u(!1),vF.delete(e.sessionId)}}}}},we=zj(c.text,g),Te=Math.min(v,Math.max(0,we.length-1)),Ee=(e=Te)=>{let t=we[e];t&&(se({text:`${t.label} `}),h(!1),T.current?.focus())},De=e.busy||s.some(e=>e.reason===`manual`||e.blocking);return(0,A.jsx)(`section`,{"aria-label":`消息输入`,className:`relative shrink-0 px-3 pt-1 pb-3 sm:px-4 sm:pb-4`,onDragOver:e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),w(!0))},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||w(!1)},onDrop:e=>{e.preventDefault(),w(!1),de(Array.from(e.dataTransfer.files))},children:(0,A.jsxs)(`div`,{className:`chat-column`,children:[(0,A.jsxs)(`div`,{ref:ee,className:`composer-card ${De?`is-busy`:``} ${C?`ring-2 ring-sakura-300`:``}`,children:[(0,A.jsxs)(`div`,{className:`flex flex-col gap-1 px-4 pt-2.5 empty:pt-0`,children:[C&&(0,A.jsx)(`p`,{className:`text-sm text-sakura-700`,children:`松开以添加图片,不会自动发送`}),ce&&(0,A.jsxs)(`p`,{className:`text-sm text-sakura-700`,children:[`尚未配置 DeepSeek Key。`,(0,A.jsx)(Hr,{to:`/settings`,className:`focus-neko underline`,children:`前往设置`})]}),ue&&(0,A.jsx)(`p`,{className:`text-sm text-sakura-700`,children:`当前模型不支持图片,请切换模型或移除附件。`}),!le?.input.includes(`image`)&&n?.items.some(e=>e.type===`user`&&e.images?.length)&&(0,A.jsx)(`p`,{className:`text-xs text-ink-500`,children:`当前模型无法查看历史原图,仍可使用已有文字分析。`}),d&&(0,A.jsx)(`p`,{role:`alert`,className:`break-words text-sm text-sakura-700`,children:d})]}),!!c.files.length&&(0,A.jsx)(`ul`,{className:`flex max-h-40 flex-wrap gap-2 overflow-y-auto px-4 pt-2.5`,children:c.files.map(e=>(0,A.jsxs)(`li`,{className:`relative w-28 rounded-xl border border-sakura-200 bg-base p-2`,children:[(0,A.jsx)(wF,{file:e.file}),(0,A.jsx)(`span`,{className:`block truncate text-xs`,title:e.file.name,children:e.file.name}),e.processing&&(0,A.jsx)(`span`,{className:`text-xs text-ink-500`,children:`检查图片…`}),e.error&&(0,A.jsx)(`span`,{className:`text-xs text-sakura-700`,children:e.error}),(0,A.jsx)(`button`,{type:`button`,"aria-label":`移除 ${e.file.name}`,className:`focus-neko absolute right-0 top-0 rounded-full bg-base px-1`,onClick:()=>se({files:ne.current.files.filter(t=>t.id!==e.id)}),children:`×`})]},e.id))}),(0,A.jsx)(`textarea`,{ref:T,disabled:e.disabled,value:c.text,rows:1,placeholder:`输入消息,@ 引用文件,/ 命令`,"aria-label":`消息输入`,"aria-autocomplete":`list`,"aria-controls":he.controls??(m?S:void 0),"aria-activedescendant":he.active??(m&&we.length?`${S}-${Te}`:void 0),onClick:e=>{he.refresh(),h(Rj(e.currentTarget.value))},onBlur:()=>{he.close(),h(!1)},onCompositionStart:()=>{he.close(),h(!1)},onCompositionEnd:e=>{he.refresh(),h(Rj(e.currentTarget.value))},className:`max-h-40 min-h-10 min-w-0 w-full resize-none bg-transparent px-4 py-2 text-base text-ink-900 focus:outline-none`,onChange:e=>{ie.current=null,se({text:e.target.value}),y(0),h(!e.nativeEvent.isComposing&&Rj(e.target.value)),e.nativeEvent.isComposing||he.refresh()},onPaste:e=>{let t=Array.from(e.clipboardData.files);t.length&&(e.preventDefault(),de(t))},onKeyDown:e=>{e.nativeEvent.isComposing||he.keyDown(e)||(e.key===`Escape`&&m?(e.preventDefault(),h(!1)):m&&(e.key===`ArrowDown`||e.key===`ArrowUp`)?(e.preventDefault(),y(Math.max(0,Math.min(we.length-1,Te+(e.key===`ArrowDown`?1:-1))))):m&&e.key===`Tab`?!e.shiftKey&&we.length?(e.preventDefault(),Ee()):h(!1):(e.key===`ArrowUp`||e.key===`ArrowDown`)&&!m&&oe(e)?e.preventDefault():e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),m&&we.length?Ee():(h(!1),Ce())))}}),(0,A.jsxs)(`div`,{className:`composer-toolbar flex flex-wrap items-center gap-x-1 gap-y-1 border-t border-sakura-100 px-2 py-1.5`,children:[(0,A.jsx)(`input`,{ref:te,type:`file`,accept:`image/png,image/jpeg,image/webp`,multiple:!0,hidden:!0,onChange:e=>{de(Array.from(e.target.files??[])),e.target.value=``}}),(0,A.jsx)(`button`,{type:`button`,"aria-label":`添加图片`,title:`添加图片(最多 4 张)`,disabled:e.disabled,onClick:()=>te.current?.click(),className:`focus-neko inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-full text-ink-600 hover:bg-sakura-50`,children:(0,A.jsx)(oF,{name:`plus`})}),(0,A.jsx)(`button`,{type:`button`,"aria-label":`输入操作菜单`,"aria-expanded":m,className:`focus-neko inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-full text-ink-500 hover:bg-sakura-50`,onClick:()=>{he.close(),h(!m),T.current?.focus()},children:(0,A.jsx)(oF,{name:`more`})}),(0,A.jsx)(`div`,{className:`min-w-0 max-w-64 [&>button]:max-w-full`,children:(0,A.jsx)(mF,{current:n?.agent.model??null,fallbackLabel:n?.model??`…`})}),ge&&ge.window>0&&(0,A.jsxs)(`span`,{className:`shrink-0 rounded-full bg-tianyi-50 px-2 py-1 font-mono text-xs ${ge.percent!==null&&ge.percent>90?`text-sakura-700 font-semibold`:`text-ink-600`}`,title:ge.tokens===null?`暂无有效用量;首次回答或压缩后的新回答完成后更新`:`最近一次成功回答的上下文用量:${ge.tokens} / ${ge.window} tokens;非会话累计用量`,children:[`Ctx `,ge.percent===null?`?`:`${ge.percent.toFixed(1)}%`,`/`,xF(ge.window)]}),(0,A.jsx)(`output`,{"aria-live":`polite`,"aria-atomic":`true`,className:`contents`,children:O&&(0,A.jsx)(`span`,{className:`max-w-full whitespace-nowrap rounded-full border px-2 py-1 text-xs ${k?`border-sakura-300 bg-sakura-50 text-sakura-700`:`border-tianyi-200 bg-tianyi-50 text-ink-600`}`,title:_e?.phase===`nothing`&&!s.length?`保留近期上下文,暂无可压缩的旧内容;默认保留最近约 20,000 tokens`:void 0,children:O})}),(0,A.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[e.busy&&e.status!==null&&(0,A.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-64 items-center gap-1.5 text-xs font-medium text-sakura-700`,title:e.status,children:[(0,A.jsxs)(`span`,{className:`dots shrink-0`,"aria-hidden":!0,children:[(0,A.jsx)(`span`,{}),(0,A.jsx)(`span`,{}),(0,A.jsx)(`span`,{})]}),(0,A.jsx)(`span`,{className:`truncate`,children:e.status.replace(/\.\.\.$/,``)})]}),xe!==null&&(0,A.jsxs)(`button`,{type:`button`,className:`telemetry focus-neko shrink-0 rounded-full px-1.5 py-1 font-mono text-xs text-ink-500`,"aria-label":`任务总用量:输入 ${xe.input},输出 ${xe.output},缓存读 ${xe.cacheRead},成本 ${SF(xe.cost)}`,children:[`↑`,xF(xe.input),` ↓`,xF(xe.output),(0,A.jsxs)(`span`,{className:`telemetry-detail`,"aria-hidden":!0,children:[`输入 `,xe.input,` · 输出 `,xe.output,` · 缓存读 `,xe.cacheRead,` · `,SF(xe.cost)]})]}),(0,A.jsx)(`button`,{type:`button`,disabled:l||e.disabled||!c.text.trim()&&!c.files.length||Oi(c.text)===null&&(e.busy||ce||ue||c.files.some(e=>!!e.error||e.processing)),onClick:()=>void Ce(),className:`btn-primary focus-neko h-10 shrink-0 rounded-full px-3 text-sm disabled:opacity-50`,children:l?`处理中`:`发送`}),De&&(0,A.jsx)(`button`,{type:`button`,onClick:()=>Tj.abort(),className:`btn-stop focus-neko h-10 rounded-full px-2 text-sm`,title:`中止当前会话运行及可中止任务`,children:`停止`})]})]})]}),he.panel,m&&!he.open&&(0,A.jsx)(rF,{anchor:ee,id:S,title:`输入命令`,items:we,selected:Te,onSelect:y,message:b||(we.length?void 0:`没有匹配的命令或技能`),onAccept:Ee})]})})}var EF=[{key:`credentials`,label:`密钥`,icon:`key`,to:`/settings`},{key:`mobile`,label:`手机配对`,icon:`phone`,to:`/settings/mobile`},{key:`about`,label:`关于与更新`,icon:`info`,to:`/about`}];function DF({active:e,children:t}){return(0,A.jsxs)(`div`,{className:`flex min-h-dvh flex-col bg-base sm:flex-row`,children:[(0,A.jsxs)(`nav`,{"aria-label":`设置菜单`,className:`flex shrink-0 items-center gap-1 overflow-x-auto border-b border-sakura-100 px-4 py-2.5 sm:w-48 sm:flex-col sm:items-stretch sm:gap-1 sm:border-r sm:border-b-0 sm:px-3 sm:py-5`,children:[(0,A.jsx)(Hr,{to:`/`,className:`focus-neko mr-2 inline-flex shrink-0 items-center rounded-lg px-2 py-1.5 text-sm text-sakura-700 sm:mr-0 sm:mb-3`,children:`← 返回聊天`}),(0,A.jsx)(`span`,{className:`hidden px-2 pb-1 text-xs font-medium text-ink-400 sm:block`,children:`设置`}),EF.map(t=>(0,A.jsxs)(Hr,{to:t.to,"aria-current":e===t.key?`page`:void 0,className:`focus-neko inline-flex shrink-0 items-center gap-2 rounded-xl px-3 py-2 text-sm ${e===t.key?`bg-sakura-100 font-semibold text-sakura-800`:`text-ink-600 hover:bg-ink-100`}`,children:[(0,A.jsx)(oF,{name:t.icon,size:15}),t.label]},t.key))]}),(0,A.jsx)(`div`,{className:`min-w-0 flex-1`,children:t})]})}async function OF(){let e;try{await navigator.clipboard.writeText(`neko update`),e=`已复制 neko update,在运行 neko 的电脑上执行`}catch{e=`请复制命令:neko update`}return hj.notice({level:`info`,text:e}),e}function kF(){let{updates:e,webInfo:t}=pj();return Si({gateway:e,frontend:yi,installed:t?.installedVersion??null,web:t?{runningVersion:t.webVersion,installedVersion:t.installedVersion}:void 0})}function AF(){let e=kF(),[t,n]=(0,f.useState)(null);return e===`none`||t===e?null:(0,A.jsxs)(`output`,{className:`flex min-w-0 flex-wrap items-center justify-end gap-x-3 gap-y-1 border-b border-sakura-100 bg-sakura-50 px-4 py-1.5 text-xs text-ink-700`,children:[(0,A.jsx)(`span`,{children:e===`install`?`发现新版本 · 运行 neko update`:e===`refresh-page`?`页面已更新`:e===`incompatible`?`版本不兼容 · 更新并重启 neko`:`已升级 · 请重新启动本地 neko`}),e===`install`?(0,A.jsx)(`button`,{type:`button`,className:`focus-neko rounded px-2 py-1 text-sakura-700`,onClick:()=>void OF(),children:`复制命令`}):e===`refresh-page`?(0,A.jsx)(`button`,{type:`button`,className:`focus-neko rounded px-2 py-1 text-sakura-700`,onClick:yF,children:`刷新`}):(0,A.jsx)(Hr,{to:`/about`,className:`focus-neko rounded px-2 py-1 text-sakura-700`,children:`查看步骤`}),(0,A.jsx)(pF,{label:`关闭更新提示`,onClick:()=>n(e)})]})}function jF(){let{updates:e,webInfo:t,phase:n}=pj(),r=kF(),[i,a]=(0,f.useState)(!1),[o,s]=(0,f.useState)(``),c=_j();async function l(){if(!i){a(!0),s(``);try{let e=await Tj.checkUpdates();s(e.checkState===`ok`?`检查完成`:e.checkState===`development`?`开发版本不检查发布更新`:`检查失败,请重试`)}catch{s(`检查失败,请重试`)}finally{a(!1)}}}return(0,A.jsxs)(DF,{active:`about`,children:[(0,A.jsxs)(`div`,{className:`mx-auto w-full max-w-4xl px-5 pt-6 pb-3`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,A.jsx)(`h1`,{className:`text-xl font-bold text-ink-900`,children:`关于与更新`}),(0,A.jsx)(`span`,{className:`ml-auto text-xs text-ink-500`,children:n===`ready`?`已连接`:`连接中…`})]}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-ink-500`,children:`查看 neko 系统版本状态及软件更新。`})]}),(0,A.jsxs)(`main`,{className:`mx-auto flex w-full max-w-4xl flex-col gap-5 px-5 pb-8`,children:[(0,A.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,children:[(0,A.jsx)(`h2`,{className:`mb-4 text-base font-bold text-ink-900`,children:`版本状态`}),(0,A.jsxs)(`div`,{className:`flex flex-col divide-y divide-sakura-100`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between py-3`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{className:`text-sm font-medium text-ink-800`,children:`当前版本`}),(0,A.jsx)(`span`,{className:`ml-3 font-mono text-sm text-ink-600`,children:yi})]}),(0,A.jsx)(`div`,{children:i?(0,A.jsx)(`span`,{className:`rounded-full bg-ink-100 px-2.5 py-0.5 text-xs text-ink-600`,children:`检查中…`}):r===`incompatible`?(0,A.jsx)(`span`,{className:`rounded-full bg-sakura-100 px-2.5 py-0.5 text-xs font-semibold text-sakura-800`,children:`协议不兼容`}):r===`install`?(0,A.jsx)(`span`,{className:`rounded-full bg-sakura-100 px-2.5 py-0.5 text-xs font-semibold text-sakura-800`,children:`发现新版本`}):r===`restart-service`?(0,A.jsx)(`span`,{className:`rounded-full bg-tianyi-100 px-2.5 py-0.5 text-xs font-semibold text-tianyi-800`,children:`已就绪 · 待重启`}):r===`refresh-page`?(0,A.jsx)(`span`,{className:`rounded-full bg-tianyi-100 px-2.5 py-0.5 text-xs font-semibold text-tianyi-800`,children:`页面待更新`}):e?.checkState===`development`?(0,A.jsx)(`span`,{className:`rounded-full bg-ink-100 px-2.5 py-0.5 text-xs text-ink-600`,children:`开发版本`}):e?.checkState===`failed`?(0,A.jsx)(`span`,{className:`rounded-full bg-sakura-100 px-2.5 py-0.5 text-xs text-sakura-800`,children:`检查失败`}):(0,A.jsx)(`span`,{className:`rounded-full bg-tianyi-50 px-2.5 py-0.5 text-xs font-medium text-tianyi-800`,children:`已是最新`})})]}),r===`install`&&e?.latestVersion&&(0,A.jsxs)(`div`,{className:`mt-1 flex items-center justify-between rounded-xl bg-sakura-50/60 px-3 py-3`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{className:`text-sm font-semibold text-sakura-800`,children:`最新稳定版`}),(0,A.jsx)(`span`,{className:`ml-3 font-mono text-sm text-sakura-900`,children:e.latestVersion})]}),(0,A.jsx)(`span`,{className:`text-xs text-sakura-700`,children:`可运行 neko update 升级`})]}),r===`restart-service`&&(0,A.jsxs)(`div`,{className:`mt-1 flex items-center justify-between rounded-xl bg-tianyi-50/60 px-3 py-3`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{className:`text-sm font-semibold text-tianyi-800`,children:`已安装新版本`}),(0,A.jsx)(`span`,{className:`ml-3 font-mono text-sm text-tianyi-900`,children:e?.installedVersion??t?.installedVersion??`新版本`})]}),(0,A.jsx)(`span`,{className:`text-xs text-tianyi-700`,children:`重启 neko 进程后生效`})]}),r===`refresh-page`&&(0,A.jsxs)(`div`,{className:`mt-1 flex items-center justify-between rounded-xl bg-tianyi-50/60 px-3 py-3`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{className:`text-sm font-semibold text-tianyi-800`,children:`静态服务已更新`}),(0,A.jsx)(`span`,{className:`ml-3 font-mono text-sm text-tianyi-900`,children:t?.webVersion??`新版本`})]}),(0,A.jsx)(`span`,{className:`text-xs text-tianyi-700`,children:`刷新页面后生效`})]})]}),(0,A.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center gap-3`,children:[(0,A.jsx)(`button`,{type:`button`,className:`focus-neko rounded-full bg-sakura-100 px-4 py-1.5 text-sm font-semibold text-sakura-800 disabled:opacity-50`,disabled:i,onClick:()=>void l(),children:i?`检查中…`:`检查更新`}),r===`install`?(0,A.jsx)(`button`,{type:`button`,className:`focus-neko rounded-full bg-sakura-100 px-4 py-1.5 text-sm font-semibold text-sakura-800`,onClick:()=>void OF().then(s),children:`复制 neko update`}):(0,A.jsx)(`button`,{type:`button`,className:`focus-neko rounded-full border border-sakura-200 bg-surface px-4 py-1.5 text-sm text-ink-600 hover:bg-sakura-50`,onClick:()=>void OF().then(s),children:`复制 neko update`}),r===`refresh-page`&&(0,A.jsx)(`button`,{type:`button`,className:`focus-neko rounded-full bg-tianyi-100 px-4 py-1.5 text-sm font-semibold text-tianyi-800`,onClick:yF,children:`刷新页面`})]}),o&&(0,A.jsx)(`output`,{className:`mt-3 block text-xs text-tianyi-800`,children:o})]}),(0,A.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,children:[(0,A.jsx)(`h2`,{className:`mb-2 text-base font-bold text-ink-900`,children:`升级说明`}),(0,A.jsxs)(`p`,{className:`text-sm text-ink-600`,children:[`在终端运行`,` `,(0,A.jsx)(`code`,{className:`select-all rounded bg-ink-100 px-1.5 py-0.5 font-mono text-xs text-ink-800`,children:`neko update`}),`,完成后重启 neko 即可生效。`]}),c?.text&&(0,A.jsxs)(`details`,{className:`mt-4 border-t border-sakura-100 pt-3 text-sm`,children:[(0,A.jsx)(`summary`,{className:`focus-neko cursor-pointer font-medium text-ink-700`,children:`升级前保留的草稿`}),(0,A.jsx)(`p`,{className:`mt-2 max-h-48 overflow-y-auto whitespace-pre-wrap break-words rounded-xl bg-ink-50 p-3 font-mono text-xs text-ink-600 select-text`,children:c.text})]})]})]})]})}var MF={pending:`等待审批`,allowed:`已允许本次`,denied:`已拒绝`,cancelled:`已取消`},NF=e=>[...e].map(e=>{let t=e.charCodeAt(0);return t<32&&t!==9&&t!==10||t>=127&&t<=159||t>=8234&&t<=8238||t>=8294&&t<=8297?`\\u${t.toString(16).padStart(4,`0`)}`:e}).join(``);function PF({item:e,title:t,decide:n}){let[r,i]=(0,f.useState)(!1),[a,o]=(0,f.useState)(``),s=(0,f.useRef)(!1),c=async t=>{if(!(s.current||e.status!==`pending`)){s.current=!0,i(!0),o(``);try{await n(t)}catch(e){o(String(e))}finally{s.current=!1,i(!1)}}};return(0,A.jsxs)(`section`,{"aria-label":`Bash 审批`,className:`min-w-0 rounded-xl border border-sakura-200 bg-surface p-3 text-sm`,children:[(0,A.jsxs)(`output`,{className:`block font-medium text-sakura-800`,children:[t,` · Bash · `,MF[e.status]]}),(0,A.jsxs)(`p`,{className:`break-all text-xs text-ink-500`,children:[NF(e.cwd),` · 超时:`,e.timeout??`默认`]}),(0,A.jsx)(`textarea`,{readOnly:!0,rows:Math.min(6,Math.max(1,e.command.split(`
13
- `).length)),"aria-label":`完整命令`,value:NF(e.command),className:`focus-neko my-2 w-full resize-y whitespace-pre-wrap break-all rounded-lg bg-base p-2 font-mono text-xs`}),e.status===`pending`&&(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsx)(`button`,{type:`button`,disabled:r,className:`focus-neko rounded-lg bg-tianyi-100 px-3 py-1 text-tianyi-800 disabled:opacity-50`,onClick:()=>void c(`allowed`),children:`允许本次`}),(0,A.jsx)(`button`,{type:`button`,disabled:r,className:`focus-neko rounded-lg border border-sakura-300 px-3 py-1 disabled:opacity-50`,onClick:()=>void c(`denied`),children:`拒绝`})]}),a&&(0,A.jsx)(`p`,{role:`alert`,className:`break-all text-xs text-sakura-800`,children:a})]})}function FF(){let{phase:e,operating:t,currentSessionId:n,view:r}=pj(),[,i]=(0,f.useState)(0),a=(0,f.useRef)(null),[o,s]=(0,f.useState)(null),c=e===`ready`&&!t&&r!==null;if((0,f.useEffect)(()=>{if(!c||!n)return;let e=!0,t=new tj(e=>Tj.subagent(e),()=>{e&&i(e=>e+1)});return a.current=t,s(t),()=>{e=!1,a.current=null,t.close(),s(null)}},[c,n]),(0,f.useEffect)(()=>{c&&o===a.current&&o?.update(r?.subagents??[])},[o,c,r?.subagents]),!c||!o)return null;let l=o.pending;return!l.length&&!o.error?null:(0,A.jsxs)(`section`,{"aria-label":`待审批命令`,className:`max-h-[40dvh] shrink-0 space-y-2 overflow-auto px-3 py-2`,children:[l.map(({item:e,title:t,service:n})=>(0,A.jsx)(PF,{item:e,title:t,decide:t=>n.decideApproval({id:e.id,version:e.version,decision:t})},`${e.id}:${e.version}`)),o.error&&(0,A.jsx)(`p`,{role:`alert`,className:`text-sm text-sakura-800`,children:o.error})]})}function IF(e){let t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60);if(t<3600)return`${n}m ${t%60}s`;let r=Math.floor(t/3600);return t<86400?`${r}h ${n%60}m`:`${Math.floor(t/86400)}d ${r%24}h`}var LF=e=>e.split(`
14
- `).map(e=>e.trim()).find(Boolean)??``;function RF(e){return e.title.trim()||LF(e.command)||`(empty command)`}function zF(e,t){return e.status===`running`?IF(t-e.startedAt):e.reason===`timeout`?`timeout`:e.exitCode===null?e.reason===`restart`?`restart`:IF((e.endedAt??t)-e.startedAt):`exit ${e.exitCode}`}var BF=e=>Number.parseInt(e.replace(/^\D+/,``),10)||0;function VF(e,t){let n=[...e].sort((e,t)=>t.startedAt-e.startedAt||BF(t.jobId)-BF(e.jobId)).map(e=>{let n=e.status===`running`;return{job:e,label:RF(e),running:n,statusText:e.status,meta:zF(e,t),durationMs:Math.max(0,(e.endedAt??t)-e.startedAt)}});return{rows:n,running:n.filter(e=>e.running).length}}function HF(e){let t=e.split(`
15
- `),n=t[0]??``,r=t[1]?.startsWith(`Command: `)?t[1].slice(9):void 0,i=t.findIndex((e,t)=>t>0&&e.startsWith(`Last output (`)),a=i<0?void 0:t.slice(i+1).join(`
16
- `);return{head:n,command:r,output:a===``?void 0:a}}var UF=262144,WF=class{#e=``;#t=0;#n;#r;constructor(e=UF){this.#r=e}get text(){return this.#e}get dropped(){return this.#t}get offset(){return this.#n}apply(e,t=e=>e){if(this.#n===void 0?this.#t=e.dropped:e.truncated&&(this.#t+=e.dropped),this.#n=e.offset,this.#e+=t(e.text),this.#e.length>this.#r){let e=this.#e.length-this.#r;this.#e=this.#e.slice(e),this.#t+=e}}},GF={running:`运行中`,exited:`已退出`,failed:`失败`,stopped:`已停止`,lost:`已丢失`};function KF(e,t){let n=GF[e.status];return e.status===`running`?`${n} · ${IF(t-e.startedAt)}`:e.reason===`timeout`?`${n} · 超时`:e.reason===`spawn-error`?`${n} · 无法启动`:e.exitCode===null?e.reason===`restart`?`${n} · 网关重启`:`${n} · ${IF((e.endedAt??t)-e.startedAt)}`:`${n} · 退出码 ${e.exitCode}`}var qF=/\u001b(?:\[[0-?]*[ -/]*[@-~]|\][^\u0007\u001b]*(?:\u0007|\u001b\\)|[@-Z\\-_])/g,JF=/[\u0000-\u0008\u000b-\u001f\u007f]/g;function YF(e){return e.replace(qF,``).replace(/\r\n?/g,`
17
- `).replace(JF,``)}function XF(e,t=24){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}var ZF=1e3,QF=e=>e instanceof Error?e.message:String(e);function $F({sessionId:e,job:t}){let n=t.jobId,r=(0,f.useRef)(new WF),[,i]=(0,f.useState)(0),[a,o]=(0,f.useState)(``),[s,c]=(0,f.useState)(!0),[l,u]=(0,f.useState)(!1),d=(0,f.useRef)(!0),p=(0,f.useRef)(null),m=t.status===`running`,h=(0,f.useRef)(m);h.current=m;let[g,_]=(0,f.useState)(Date.now);(0,f.useEffect)(()=>{if(!m)return;let e=setInterval(()=>_(Date.now()),ZF);return()=>clearInterval(e)},[m]),(0,f.useEffect)(()=>{let t=!1,a,s=async()=>{let c=h.current;try{let l=await Tj.jobOutput(e,n,r.current.offset);if(t)return;r.current.apply(l,YF),o(``),i(e=>e+1),c&&(a=setTimeout(()=>void s(),ZF))}catch(e){t||o(QF(e))}};return s(),()=>{t=!0,clearTimeout(a)}},[e,n]),(0,f.useLayoutEffect)(()=>{let e=p.current;e&&d.current&&(e.scrollTop=e.scrollHeight)});let v=(0,f.useCallback)(()=>{let e=p.current;e&&(d.current=!0,c(!0),e.scrollTop=e.scrollHeight)},[]),y=()=>{l||(u(!0),Tj.jobStop(e,n).catch(e=>o(QF(e))).finally(()=>u(!1)))},b=r.current.text;return(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,A.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-1 border-b border-sakura-100 p-3 text-xs`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,A.jsx)(`span`,{className:`font-medium text-ink-800`,children:KF(t,g)}),m&&(0,A.jsx)(`button`,{type:`button`,disabled:l,className:`focus-neko rounded-lg border border-sakura-300 px-2 py-0.5 disabled:opacity-50`,onClick:y,children:l?`正在停止…`:`停止任务`})]}),(0,A.jsx)(`code`,{className:`max-h-20 overflow-auto whitespace-pre-wrap break-all text-ink-700`,children:t.command}),(0,A.jsx)(`span`,{className:`break-all text-ink-500`,children:t.cwd})]}),a&&(0,A.jsx)(`p`,{role:`alert`,className:`shrink-0 p-3 text-sm text-sakura-800`,children:a}),(0,A.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[(0,A.jsxs)(`div`,{ref:p,"data-testid":`job-output`,className:`h-full overflow-y-auto overflow-x-hidden p-3`,onScroll:e=>{let t=XF(e.currentTarget);d.current=t,c(t)},children:[r.current.dropped>0&&(0,A.jsxs)(`p`,{className:`mb-2 text-xs text-sakura-800`,children:[`… 已省略更早的 `,r.current.dropped,` 字节输出`]}),b===``?(0,A.jsx)(`p`,{className:`text-xs text-ink-500`,children:r.current.offset===void 0?`读取中…`:`暂无输出`}):(0,A.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-xs text-ink-800`,children:b})]}),!s&&(0,A.jsx)(`button`,{type:`button`,onClick:v,className:`focus-neko discrete-in absolute right-3 bottom-3 rounded-full border border-sakura-300 bg-surface px-3.5 py-1 text-xs font-medium text-sakura-800 hover:bg-sakura-50`,children:`回到底部 ↓`})]})]})}function eI({sessionId:e,jobs:t,open:n,onClose:r}){let[i,a]=(0,f.useState)(null),[o,s]=(0,f.useState)(Date.now),c=(0,f.useRef)(null),l=(0,f.useRef)(null),[u,d]=(0,f.useState)(()=>window.matchMedia(`(max-width: 1023px)`).matches);(0,f.useEffect)(()=>{let e=window.matchMedia(`(max-width: 1023px)`),t=()=>d(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let p=VF(t,o);(0,f.useEffect)(()=>{if(!n||p.running===0)return;let e=setInterval(()=>s(Date.now()),ZF);return()=>clearInterval(e)},[n,p.running]),(0,f.useEffect)(()=>{if(!n)return;let e=document.activeElement,t=u&&l.current?.parentElement?[...l.current.parentElement.children].filter(e=>e instanceof HTMLElement&&e!==l.current):[],r=t.map(e=>e.inert);return t.forEach(e=>{e.inert=!0}),c.current?.focus(),()=>{t.forEach((e,t)=>{e.inert=r[t]}),e?.isConnected&&e.focus()}},[n,u]);let m=p.rows.find(e=>e.job.jobId===i)??p.rows[0];return(0,A.jsxs)(`aside`,{ref:l,role:u?`dialog`:`complementary`,"aria-modal":u&&n?!0:void 0,"aria-label":`后台任务`,className:`${n?`flex`:`hidden`} fixed inset-0 z-30 min-w-0 flex-col border-l border-sakura-200 bg-base lg:static lg:z-auto lg:w-[min(42vw,40rem)] lg:shrink-0`,onKeyDown:e=>{if(e.currentTarget.contains(e.target)){if(e.key===`Tab`&&window.innerWidth<1024){let t=[...e.currentTarget.querySelectorAll(`button:not([disabled]),a[href],summary,[tabindex='0']`)].filter(e=>e.getClientRects().length>0),n=t[0],r=t.at(-1);e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())}e.key===`Escape`&&(e.stopPropagation(),r())}},children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between border-b border-sakura-200 px-4 py-1.5`,children:[(0,A.jsx)(`strong`,{className:`text-sm text-ink-800`,children:`后台任务`}),(0,A.jsx)(`button`,{ref:c,type:`button`,className:`focus-neko rounded-lg px-2 py-1 text-sm text-ink-600 hover:bg-sakura-50`,onClick:r,children:`关闭`})]}),p.rows.length===0?(0,A.jsx)(`p`,{className:`p-4 text-sm text-ink-500`,children:`这个会话还没有后台任务。`}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`div`,{className:`max-h-44 shrink-0 overflow-auto border-b border-sakura-100 p-2`,children:p.rows.map(e=>(0,A.jsxs)(`button`,{type:`button`,"aria-pressed":m?.job.jobId===e.job.jobId,className:`focus-neko flex w-full min-w-0 items-center gap-2 rounded-lg px-2 py-1.5 text-left text-sm ${m?.job.jobId===e.job.jobId?`bg-tianyi-100`:`hover:bg-sakura-50`}`,onClick:()=>a(e.job.jobId),children:[(0,A.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[(0,A.jsx)(`span`,{className:`text-tianyi-700`,children:e.job.jobId}),` · `,e.label]}),(0,A.jsx)(`span`,{className:`shrink-0 text-xs text-ink-500`,children:KF(e.job,o)})]},e.job.jobId))}),n&&m&&(0,A.jsx)($F,{sessionId:e,job:m.job},`${e}:${m.job.jobId}`)]})]})}function tI(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var nI=tI();function rI(e){nI=e}var iI={exec:()=>null};function aI(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function oI(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(cI.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var sI=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),cI={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:aI(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:aI(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:aI(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:aI(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:aI(e=>RegExp(`^ {0,${e}}(?:</?(?:${CI})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`,`i`)),blockquoteBeginRegex:aI(e=>RegExp(`^ {0,${e}}>`))},lI=/^(?:[ \t]*(?:\n|$))+/,uI=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,dI=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,fI=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,pI=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,mI=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,hI=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,gI=oI(hI).replace(/bull/g,mI).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),_I=oI(hI).replace(/bull/g,mI).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),vI=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,yI=/^[^\n]+/,bI=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,xI=oI(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,bI).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),SI=oI(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,mI).getRegex(),CI=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,wI=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,TI=oI(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,wI).replace(`tag`,CI).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),EI=e=>oI(vI).replace(`hr`,fI).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,CI).getRegex(),DI=EI(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),OI=EI(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),kI={blockquote:oI(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,OI).getRegex(),code:uI,def:xI,fences:dI,heading:pI,hr:fI,html:TI,lheading:gI,list:SI,newline:lI,paragraph:DI,table:iI,text:yI},AI=oI(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,fI).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,CI).getRegex(),jI={...kI,lheading:_I,table:AI,paragraph:oI(vI).replace(`hr`,fI).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,AI).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,CI).getRegex()},MI={...kI,html:oI(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,wI).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:iI,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:oI(vI).replace(`hr`,fI).replace(`heading`,` *#{1,6} *[^
18
- ]`).replace(`lheading`,gI).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},NI=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,PI=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,FI=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,II=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,LI=/[\p{P}\p{S}]/u,RI=/[\s\p{P}\p{S}]/u,zI=/[^\s\p{P}\p{S}]/u,BI=oI(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,RI).getRegex(),VI=/[\p{Pi}\p{Ps}"']/u,HI=/(?!~)[\p{P}\p{S}]/u,UI=/(?!~)[\s\p{P}\p{S}]/u,WI=/(?:[^\s\p{P}\p{S}]|~)/u,GI=oI(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,sI?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),KI=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,qI=oI(KI,`u`).replace(/punct/g,LI).getRegex(),JI=oI(KI,`u`).replace(/punct/g,HI).getRegex(),YI=oI(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,VI).replace(/punct/g,LI).getRegex(),XI=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,ZI=oI(XI,`gu`).replace(/notPunctSpace/g,zI).replace(/punctSpace/g,RI).replace(/punct/g,LI).getRegex(),QI=oI(XI,`gu`).replace(/notPunctSpace/g,WI).replace(/punctSpace/g,UI).replace(/punct/g,HI).getRegex(),$I=oI(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,zI).replace(/punctSpace/g,RI).replace(/punct/g,LI).getRegex(),eL=oI(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,zI).replace(/punctSpace/g,RI).replace(/punct/g,LI).getRegex(),tL=oI(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,zI).replace(/punctSpace/g,RI).replace(/punct/g,LI).getRegex(),nL=oI(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,LI).getRegex(),rL=oI(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,zI).replace(/punctSpace/g,RI).replace(/punct/g,LI).getRegex(),iL=oI(/\\(punct)/,`gu`).replace(/punct/g,LI).getRegex(),aL=oI(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),oL=oI(wI).replace(`(?:-->|$)`,`-->`).getRegex(),sL=oI(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,oL).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),cL=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,lL=oI(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,cL).getRegex(),uL=oI(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace(`label`,lL).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),dL=oI(/^!?\[(label)\]\[(ref)\]/).replace(`label`,lL).replace(`ref`,bI).getRegex(),fL=oI(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,bI).getRegex(),pL=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,mL=oI(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,cL).getRegex(),hL=oI(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,oI(/^!?\[(label)\]\[(ref)\]/).replace(`label`,mL).replace(`ref`,pL).getRegex()).replace(`nolink`,oI(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,pL).getRegex()).getRegex(),gL=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,_L=oI(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),vL={_backpedal:iI,anyPunctuation:iL,autolink:aL,blockSkip:GI,br:FI,code:PI,del:iI,delLDelim:iI,delRDelim:iI,emStrongLDelim:qI,emStrongRDelimAst:ZI,emStrongRDelimUnd:eL,escape:NI,link:uL,nolink:fL,punctuation:BI,reflink:dL,reflinkSearch:hL,tag:sL,text:II,url:iI},yL={...vL,emStrongLDelim:YI,emStrongRDelimAst:$I,emStrongRDelimUnd:tL,link:oI(/^!?\[(label)\]\((.*?)\)/).replace(`label`,lL).getRegex(),reflink:oI(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,lL).getRegex()},bL={...vL,emStrongRDelimAst:QI,emStrongLDelim:JI,delLDelim:nL,delRDelim:rL,url:oI(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,_L).replace(`protocol`,gL).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:oI(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,gL).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},xL={...bL,br:oI(FI).replace(`{2,}`,`*`).getRegex(),text:oI(bL.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},SL={normal:kI,gfm:jI,pedantic:MI},CL={normal:vL,gfm:bL,breaks:xL,pedantic:yL},wL={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},TL=e=>wL[e];function EL(e,t){if(t){if(cI.escapeTest.test(e))return e.replace(cI.escapeReplace,TL)}else if(cI.escapeTestNoEncode.test(e))return e.replace(cI.escapeReplaceNoEncode,TL);return e}function DL(e){return e.replace(cI.numericCharacterReference,(e,t,n)=>{let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:String.fromCodePoint(r)})}function OL(e){try{e=encodeURI(e).replace(cI.percentDecode,`%`)}catch{return null}return e}function kL(e,t){let n=e.replace(cI.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(cI.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(cI.slashPipe,`|`);return n}function AL(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function jL(e){let t=e.split(`
19
- `),n=t.length-1;for(;n>=0&&cI.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
20
- `)}function ML(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function NL(e,t){if(e.indexOf(t[0])===-1&&e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function PL(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function FL(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`;r.state.inLink=!0;let l=r.state.linkEmitted,u=r.state.inRawBlock;r.state.linkEmitted=!1;let d=r.inlineTokens(s),f=r.state.linkEmitted;if(r.state.linkEmitted=l,r.state.inLink=!1,!c){if(f){r.state.inRawBlock=u;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:d}}function IL(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
21
- `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(`
22
- `)}function LL(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var RL=class{options;rules;lexer;constructor(e){this.options=e||nI}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:jL(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=IL(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=AL(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:AL(t[0],`
23
- `),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:AL(t[0],`
24
- `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=AL(t[0],`
25
- `).split(`
26
- `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
27
- `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
28
- $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
29
- ${s}`:s,r=r?`${r}
30
- ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=e.join(`
31
- `),o=t.raw+`
32
- `+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s;let c=o.substring(s.raw.length).replace(/^\n/,``),l=c?c.split(`
33
- `).length:0,d=l?e.slice(0,-l):e;d.length>0&&(n=`${n}
34
- ${d.join(`
35
- `)}`),r=r.substring(0,r.length-t.text.length)+s.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
36
- `+e.join(`
37
- `),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
38
- `)}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(`
39
- `,1)[0],l=t[1].length,u=this.options.pedantic?PL(c,l):c.replace(this.rules.other.leadingSpaceTab,e=>PL(e,l)),d=e.split(`
40
- `,1)[0],f=!u.trim(),p=0;if(this.options.pedantic?(p=2,s=u.trimStart()):f?p=l+1:(p=u.search(this.rules.other.nonSpaceChar),p=p>4?1:p,s=u.slice(p),p+=l),f&&this.rules.other.blankLine.test(d)&&(r+=d+`
41
- `,e=e.substring(d.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(p),n=this.rules.other.hrRegex(p),i=this.rules.other.fencesBeginRegex(p),a=this.rules.other.headingBeginRegex(p),o=this.rules.other.htmlBeginRegex(p),c=this.rules.other.blockquoteBeginRegex(p);for(;e;){let l=e.split(`
42
- `,1)[0],m;if(d=l,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting,` `),m=d):m=d.replace(this.rules.other.leadingSpaceTab,e=>e.replace(this.rules.other.tabCharGlobal,` `)),i.test(d)||a.test(d)||o.test(d)||c.test(d)||t.test(d)||n.test(d))break;if(m.search(this.rules.other.nonSpaceChar)>=p||!d.trim())s+=`
43
- `+m.slice(p);else{if(f||u.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(u)||a.test(u)||n.test(u))break;s+=`
44
- `+d}f=!d.trim(),r+=l+`
45
- `,e=e.substring(l.length+1),u=m.slice(p)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of i.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=jL(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&NL(t[2],`()`)!==-1)return;let e=ML(t[1]).replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:AL(t[0],`
46
- `),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=kL(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
47
- `):[],a={type:`table`,raw:AL(t[0],`
48
- `),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(kL(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:AL(t[0],`
49
- `),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
50
- `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&LL(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=AL(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=NL(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=t[2],a=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],a=e[3])}else a=t[3]?t[3].slice(1,-1):``;return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i.slice(1):i.slice(1,-1)),FL(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,`$1`),title:a&&a.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&LL(e,n[1],r,this.rules))return;let i=t[ML((n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `))];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return FL(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:DL(t[0]),escaped:e}}}},zL=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||nI,this.options.tokenizer=this.options.tokenizer||new RL,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let t={other:cI,block:SL.normal,inline:CL.normal};this.options.pedantic?(t.block=SL.pedantic,t.inline=CL.pedantic):this.options.gfm&&(t.block=SL.gfm,t.inline=this.options.breaks?CL.breaks:CL.gfm),this.tokenizer.rules=t}static get rules(){return{block:SL,inline:CL}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(cI.carriageReturn,`
51
- `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(cI.tabCharGlobal,` `).replace(cI.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
52
- `:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
53
- `)?``:`
54
- `)+i.raw,n.text+=`
55
- `+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if((i=this.tokenizer.fences(e))||(i=this.tokenizer.heading(e))||(i=this.tokenizer.hr(e))||(i=this.tokenizer.blockquote(e))||(i=this.tokenizer.list(e))||(i=this.tokenizer.html(e))){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
56
- `)?``:`
57
- `)+i.raw,n.text+=`
58
- `+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if((i=this.tokenizer.table(e))||(i=this.tokenizer.lheading(e))){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
59
- `)?``:`
60
- `)+i.raw,r.text+=`
61
- `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length)}else if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
62
- `)?``:`
63
- `)+i.raw,n.text+=`
64
- `+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,ML(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=n&&e.includes(`)`);try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,ML(n.slice(r+1,-1))))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuation,e=>`+`.repeat(e.length)),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if((o=this.tokenizer.escape(e))||(o=this.tokenizer.tag(e))||(o=this.tokenizer.link(e))){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if((o=this.tokenizer.emStrong(e,n,i))||(o=this.tokenizer.codespan(e))||(o=this.tokenizer.br(e))||(o=this.tokenizer.del(e,n,i))||(o=this.tokenizer.autolink(e))||!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o)}else if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},BL=class{options;parser;constructor(e){this.options=e||nI}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(cI.notSpaceStart)?.[0],i=e?e.replace(cI.endingNewline,``)+`
65
- `:``;return r?`<pre><code class="language-`+EL(r)+`">`+(n?i:EL(i,!0))+`</code></pre>
66
- `:`<pre><code>`+(n?i:EL(i,!0))+`</code></pre>
67
- `}blockquote({tokens:e}){return`<blockquote>
68
- ${this.parser.parse(e)}</blockquote>
69
- `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
70
- `}hr(e){return`<hr>
71
- `}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
72
- `+r+`</`+i+`>
73
- `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
74
- `}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
75
- `}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
76
- <thead>
77
- `+t+`</thead>
78
- `+r+`</table>
79
- `}tablerow({text:e}){return`<tr>
80
- ${e}</tr>
81
- `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
82
- `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${EL(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?EL(n,!0):this.parser.parseInline(r),o=OL(e);if(o===null)return a;e=EL(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+EL(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=OL(e);if(i===null)return EL(n);e=i;let a=`<img src="${EL(e)}" alt="${EL(n)}"`;return t&&(a+=` title="${EL(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:EL(e.text)}},VL=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},HL=class e{options;renderer;textRenderer;constructor(e){this.options=e||nI,this.options.renderer=this.options.renderer||new BL,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new VL}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},UL=class{options;block;constructor(e){this.options=e||nI}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?zL.lex:zL.lexInline}provideParser(e=this.block){return e?HL.parse:HL.parseInline}},WL=class{defaults=tI();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=HL;Renderer=BL;TextRenderer=VL;Lexer=zL;Tokenizer=RL;Hooks=UL;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new BL(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new RL(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new UL;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=UL.passThroughHooks.has(n)?e=>{if(this.defaults.async&&UL.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return zL.lex(e,t??this.defaults)}parser(e,t){return HL.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?zL.lex:zL.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?HL.parse:HL.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?zL.lex:zL.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?HL.parse:HL.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
83
- Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+EL(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},GL=new WL;function KL(e,t){return GL.parse(e,t)}KL.options=KL.setOptions=function(e){return GL.setOptions(e),KL.defaults=GL.defaults,rI(KL.defaults),KL},KL.getDefaults=tI,KL.defaults=nI;function qL(...e){return GL.use(...e),KL.defaults=GL.defaults,rI(KL.defaults),KL}KL.use=qL,KL.walkTokens=function(e,t){return GL.walkTokens(e,t)},KL.parseInline=GL.parseInline,KL.Parser=HL,KL.parser=HL.parse,KL.Renderer=BL,KL.TextRenderer=VL,KL.Lexer=zL,KL.lexer=zL.lex,KL.Tokenizer=RL,KL.Hooks=UL,KL.parse=KL,KL.options,KL.setOptions,KL.walkTokens,KL.parseInline,HL.parse,zL.lex;var JL=/^image\/(png|jpeg|webp|gif)$/i,YL=/^(https?:|mailto:)/i,XL=49152,ZL=`default-src 'none'; img-src data:; style-src 'unsafe-inline'`,QL=`
84
- :root{color-scheme:light dark;--bg:#fff;--fg:#1f2328;--muted:#656d76;--border:#d0d7de;--user:#eef4ff;--code:#f6f8fa}
85
- @media(prefers-color-scheme:dark){:root{--bg:#0d1117;--fg:#e6edf3;--muted:#8b949e;--border:#30363d;--user:#16243a;--code:#161b22}}
86
- body{margin:0;background:var(--bg);color:var(--fg);font:15px/1.6 system-ui,-apple-system,"Segoe UI",sans-serif}
87
- main{max-width:860px;margin:0 auto;padding:24px 16px 64px}
88
- h1{font-size:1.5rem;margin:0 0 4px}
89
- .meta{color:var(--muted);font-size:.85rem;margin:0 0 24px}
90
- .msg{margin:16px 0;padding:12px 16px;border:1px solid var(--border);border-radius:12px}
91
- .msg.user{background:var(--user)}
92
- .role{font-size:.75rem;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);margin-bottom:6px}
93
- .text{white-space:pre-wrap;overflow-wrap:anywhere}
94
- .system{text-align:center;color:var(--muted);font-size:.85rem;margin:16px 0}
95
- .md>:first-child{margin-top:0}.md>:last-child{margin-bottom:0}
96
- .md pre,pre{background:var(--code);border-radius:8px;padding:10px 12px;overflow:auto;font-size:.85rem;white-space:pre-wrap;overflow-wrap:anywhere}
97
- .md code{background:var(--code);border-radius:4px;padding:1px 4px}.md pre code{background:none;padding:0}
98
- .md table{border-collapse:collapse}.md th,.md td{border:1px solid var(--border);padding:4px 8px}
99
- .md blockquote{margin:0;padding-left:12px;border-left:3px solid var(--border);color:var(--muted)}
100
- details{margin:8px 0}summary{cursor:pointer;color:var(--muted)}
101
- details.tool{border:1px solid var(--border);border-radius:8px;padding:6px 12px;margin:12px 0}
102
- details.tool.error>summary .status{color:#cf222e}
103
- .label{font-size:.75rem;color:var(--muted);margin-top:8px}
104
- .note{color:var(--muted);font-style:italic;margin-top:6px}
105
- figure{margin:8px 0}img{max-width:100%;height:auto;border-radius:8px}figcaption,.placeholder{color:var(--muted);font-size:.8rem}
106
- `,$L=e=>e.replaceAll(`&`,`&amp;`).replaceAll(`<`,`&lt;`).replaceAll(`>`,`&gt;`).replaceAll(`"`,`&quot;`).replaceAll(`'`,`&#39;`),eR=new WL({gfm:!0,breaks:!0,renderer:{html:({text:e})=>$L(e),link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n);if(!YL.test(e.trim()))return r;let i=t?` title="${$L(t)}"`:``;return`<a href="${$L(e)}"${i} rel="noopener noreferrer" target="_blank">${r}</a>`},image({href:e,text:t}){let n=`[image: ${$L(t||e)}]`;return YL.test(e.trim())?`<a href="${$L(e)}" rel="noopener noreferrer" target="_blank">${n}</a>`:n}}});async function tR(e,t){let n=new Map,r=0,i=0;for(let a of e)if(a.type===`user`||a.type===`tool`)for(let e of a.images??[]){let a=null;if(t===void 0)a=`not embedded`;else if(r+e.bytes>33554432)a=`over the embedding size limit`;else try{let i=await t(e);if(!JL.test(i.mimeType))a=`unsupported image type`;else if(r+i.bytes.length>33554432)a=`over the embedding size limit`;else{r+=i.bytes.length;let t=[];for(let e=0;e<i.bytes.length;e+=XL)t.push(wi(i.bytes.subarray(e,e+XL)));n.set(`${e.entryId}:${e.contentIndex}`,{src:`data:${i.mimeType.toLowerCase()};base64,${t.join(``)}`})}}catch{a=`image unavailable`}a!==null&&(n.set(`${e.entryId}:${e.contentIndex}`,{reason:a}),i++)}return{embedded:n,skipped:i}}function nR(e,t){return(e??[]).map(e=>{let n=t.get(`${e.entryId}:${e.contentIndex}`),r=$L(Pj(e));return n!==void 0&&`src`in n?`<figure><img src="${n.src}" alt="${$L(e.name)}"><figcaption>${r}</figcaption></figure>`:`<p class="placeholder">[image: ${r}${n!==void 0&&`reason`in n?` — ${n.reason}`:``}]</p>`}).join(``)}async function rR(e,t){let{embedded:n,skipped:r}=await tR(e.items,t.loadImage),i=$L(Ij(e.title)||`neko-session`),a=[];for(let r of e.items)if(r.type===`system`)a.push(`<div class="system">${$L(Ij(r.text))}</div>`);else if(r.type===`user`){let e=jj(r);a.push(`<section class="msg user"><div class="role">User</div>${e===``?``:`<div class="text">${$L(e)}</div>`}${nR(r.images,n)}</section>`)}else if(r.type===`assistant`){let e=t.includeThinking&&r.thinking.trim()!==``?`<details class="thinking"><summary>Thinking</summary><div class="text">${$L(r.thinking.trim())}</div></details>`:``,n=r.text.trim()===``?``:`<div class="md">${eR.parse(r.text.trim(),{async:!1})}</div>`,i=r.note===null?``:`<div class="note">${$L(Ij(r.note))}</div>`;a.push(`<section class="msg assistant"><div class="role">Assistant</div>${e}${n}${i}</section>`)}else{let e=Mj(r),t=Nj(r),i=[`<b>Tool</b> ${$L(r.name)}`,r.summary===``?``:`<span class="args">${$L(Ij(r.summary))}</span>`,e===`ok`?``:`<span class="status">[${e}]</span>`,r.durationMs===null?``:`<span class="duration">(${Fj(r.durationMs)})</span>`].filter(Boolean).join(` `);a.push(`<details class="tool ${e}"><summary>${i}</summary>${r.detail===null||r.detail===``?``:`<pre>${$L(r.detail)}</pre>`}${t===``?``:`<div class="label">${e===`running`?`Output so far`:`Result`}</div><pre>${$L(t)}</pre>`}${r.note===null?``:`<div class="note">${$L(Ij(r.note))}</div>`}${nR(r.images,n)}</details>`)}return{content:`<!doctype html>
107
- <html lang="en">
108
- <head>
109
- <meta charset="utf-8">
110
- <meta http-equiv="Content-Security-Policy" content="${ZL}">
111
- <meta name="viewport" content="width=device-width, initial-scale=1">
112
- <title>${i}</title>
113
- <style>${QL}</style>
114
- </head>
115
- <body>
116
- <main>
117
- <h1>${i}</h1>
118
- <p class="meta">${$L(Ij(e.model))} · ${$L(Ij(e.cwd))} · ${$L(e.exportedAt.toISOString())}</p>
119
- ${a.join(`
120
- `)}
121
- </main>
122
- </body>
123
- </html>
124
- `,skippedImages:r}}var iR={markdown:`md`,html:`html`,json:`json`},aR={markdown:`text/markdown;charset=utf-8`,html:`text/html;charset=utf-8`,json:`application/json;charset=utf-8`},oR=60;function sR(e){return e.type===`user`?jj(e):e.type===`assistant`?e.text.trim():``}function cR(e,t,n){let r=e.replace(/[\\/:*?"<>|\u0000-\u001f\u007f]/g,`-`).replace(/\s+/g,` `).replace(/-{2,}/g,`-`),i=Array.from(r).slice(0,oR).join(``).replace(/^[\s.-]+|[\s.-]+$/g,``)||`neko-session`,a=(e,t=2)=>String(e).padStart(t,`0`);return`${i}-${`${a(n.getFullYear(),4)}${a(n.getMonth()+1)}${a(n.getDate())}-${a(n.getHours())}${a(n.getMinutes())}${a(n.getSeconds())}`}.${iR[t]}`}async function lR(e,t,n){if(t.items.length===0)throw Error(`Nothing to export yet - start a conversation first`);let r=iR[e],i=aR[e];if(e===`html`){let{content:e,skippedImages:a}=await rR(t,n);return{content:e,mimeType:i,extension:r,skippedImages:a}}return{content:e===`markdown`?fR(t,n):mR(t,n),mimeType:i,extension:r,skippedImages:0}}function uR(e){let t=0;for(let n of e.matchAll(/`+/g))t=Math.max(t,n[0].length);let n="`".repeat(Math.max(3,t+1));return`${n}\n${e}\n${n}`}var dR=e=>e.replaceAll(`&`,`&amp;`).replaceAll(`<`,`&lt;`).replaceAll(`>`,`&gt;`);function fR(e,t){let n=[`# ${Ij(e.title)||`neko-session`}`,``,`- **Model:** ${Ij(e.model)}`,`- **Workspace:** ${Ij(e.cwd)}`,`- **Exported:** ${e.exportedAt.toISOString()}`,``],r=null,i=e=>{r!==e&&(r=e,n.push(`---`,``,e===`user`?`## User`:`## Assistant`,``))};for(let a of e.items)if(a.type===`system`)r=null,n.push(`---`,``,`*${dR(Ij(a.text))}*`,``);else if(a.type===`user`){i(`user`);let e=jj(a);e!==``&&n.push(e,``);for(let e of a.images??[])n.push(`> [image] ${dR(Pj(e))}`,``)}else a.type===`assistant`?(i(`assistant`),t.includeThinking&&a.thinking.trim()!==``&&n.push(`<details>`,`<summary>Thinking</summary>`,``,a.thinking.trim(),``,`</details>`,``),a.text.trim()!==``&&n.push(a.text.trim(),``),a.note!==null&&n.push(`> ${dR(Ij(a.note))}`,``)):(i(`assistant`),n.push(...pR(a)));return`${n.join(`
125
- `).trimEnd()}\n`}function pR(e){let t=Mj(e),n=[`<details>`,`<summary>${dR([`Tool: ${e.name}`,e.summary===``?``:`· ${Ij(e.summary)}`,t===`ok`?``:`[${t}]`,e.durationMs===null?``:`(${Fj(e.durationMs)})`].filter(Boolean).join(` `))}</summary>`,``];e.detail!==null&&e.detail!==``&&n.push(uR(e.detail),``);let r=Nj(e);r!==``&&n.push(t===`running`?`Output so far:`:`Result:`,``,uR(r),``),e.note!==null&&n.push(`> ${dR(Ij(e.note))}`,``);for(let t of e.images??[])n.push(`> [image] ${dR(Pj(t))}`,``);return n.push(`</details>`,``),n}function mR(e,t){let n=e.items.map(e=>{switch(e.type){case`user`:return{type:`user`,text:jj(e),images:(e.images??[]).map(({name:e,mimeType:t,width:n,height:r,bytes:i})=>({name:e,mimeType:t,width:n,height:r,bytes:i}))};case`assistant`:return{type:`assistant`,text:e.text,...t.includeThinking&&e.thinking.trim()!==``?{thinking:e.thinking}:{},stopReason:e.stopReason,note:e.note};case`tool`:return{type:`tool`,name:e.name,summary:e.summary,detail:e.detail,status:e.phase,isError:e.isError,result:Nj(e),durationMs:e.durationMs,note:e.note,images:(e.images??[]).map(({name:e,mimeType:t,width:n,height:r,bytes:i})=>({name:e,mimeType:t,width:n,height:r,bytes:i}))};default:return{type:`system`,text:e.text}}});return`${JSON.stringify({format:`neko-conversation`,version:1,session:{id:e.sessionId,title:e.title,model:e.model,cwd:e.cwd,exportedAt:e.exportedAt.toISOString()},items:n},null,2)}\n`}async function hR(e){if(navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(e);return}catch{}let t=document.activeElement,n=document.getSelection(),r=n?Array.from({length:n.rangeCount},(e,t)=>n.getRangeAt(t)):[],i=document.createElement(`textarea`);i.value=e,i.setAttribute(`readonly`,``),i.style.cssText=`position:fixed;top:0;left:-9999px;opacity:0`,document.body.append(i),i.select();let a=!1;try{a=document.execCommand(`copy`)}finally{if(i.remove(),n){n.removeAllRanges();for(let e of r)n.addRange(e)}t?.focus?.()}if(!a)throw Error(`Clipboard unavailable`)}var gR=1500,_R={idle:``,copied:`已复制`,failed:`复制失败`};function vR({text:e,label:t=`复制`}){let[n,r]=(0,f.useState)(`idle`),i=(0,f.useRef)(void 0);if((0,f.useEffect)(()=>()=>clearTimeout(i.current),[]),e===``)return null;let a=e=>{r(e),clearTimeout(i.current),i.current=setTimeout(()=>r(`idle`),gR)};return(0,A.jsxs)(`span`,{className:`copy-row`,"data-state":n,children:[(0,A.jsx)(`button`,{type:`button`,className:`copy-btn focus-neko`,"aria-label":t,title:t,onClick:()=>{hR(e).then(()=>a(`copied`),()=>a(`failed`))},children:(0,A.jsx)(oF,{name:n===`copied`?`check`:`copy`,size:15})}),(0,A.jsx)(`output`,{className:`copy-status`,"aria-live":`polite`,children:_R[n]})]})}var yR=(0,f.createContext)(null);function bR({image:e}){let{currentSessionId:t,phase:n}=pj(),r=(0,f.useContext)(yR),[i,a]=(0,f.useState)(``),[o,s]=(0,f.useState)(``),[c,l]=(0,f.useState)(!1),[u,d]=(0,f.useState)(0),p=(0,f.useRef)(null);return(0,f.useEffect)(()=>{if(!t)return;a(``);let i=!1,o=``,c=!1,l=new IntersectionObserver(l=>{!c&&l.some(e=>e.isIntersecting)&&n===`ready`&&(c=!0,(r?r(e.entryId,e.contentIndex):Tj.image(e.entryId,e.contentIndex,t)).then(e=>{i||(o=URL.createObjectURL(new Blob([e.bytes],{type:e.mimeType})),a(o),s(``))}).catch(()=>{i||s(`图片加载失败,点击重试`)}))});return p.current&&l.observe(p.current),()=>{i=!0,l.disconnect(),o&&URL.revokeObjectURL(o)}},[t,n,e.entryId,e.contentIndex,u,r]),(0,A.jsxs)(`div`,{ref:p,className:`max-w-full`,children:[(0,A.jsx)(`button`,{type:`button`,"aria-label":`查看图片 ${e.name}`,className:`focus-neko max-w-full rounded-xl border border-sakura-200 p-1`,onClick:()=>{o?(s(``),d(u+1)):i&&l(!0)},children:i?(0,A.jsx)(`img`,{src:i,alt:e.name,className:`max-h-40 max-w-full rounded-lg object-contain`}):(0,A.jsx)(`span`,{className:`text-sm`,children:o||`加载图片…`})}),c&&i&&(0,A.jsxs)(uF,{title:e.name,onClose:()=>l(!1),children:[(0,A.jsx)(`div`,{className:`min-h-0 overflow-auto bg-surface p-3 sm:p-4`,children:(0,A.jsx)(`img`,{src:i,alt:e.name,className:`max-h-[65dvh] w-full rounded-lg object-contain`})}),(0,A.jsx)(`div`,{className:`flex shrink-0 justify-end border-t border-sakura-200 bg-surface px-4 py-3`,children:(0,A.jsxs)(`a`,{href:i,download:e.name,className:`btn-primary focus-neko inline-flex min-h-10 items-center gap-2 rounded-full px-5 py-2 text-sm font-medium no-underline`,children:[(0,A.jsx)(`svg`,{"aria-hidden":`true`,width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,children:(0,A.jsx)(`path`,{d:`M12 3v12m-5-5 5 5 5-5M4 16v4h16v-4`})}),`保存图片`]})})]})]})}function xR({images:e}){return(0,A.jsx)(`div`,{className:`my-2 flex flex-wrap gap-2`,children:e.map(e=>(0,A.jsx)(bR,{image:e},`${e.entryId}:${e.contentIndex}`))})}function SR({text:e,jobId:t,job:n}){let{head:r,command:i,output:a}=HF(e),o=a===void 0?void 0:YF(a),s=(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`span`,{className:`font-medium text-tianyi-700`,children:[`后台任务 `,t]}),(0,A.jsx)(`span`,{className:`min-w-0 break-words text-ink-700`,children:r.replace(/^\[|\]$/g,``)}),n&&(0,A.jsxs)(`span`,{className:`rounded-full bg-ink-100 px-2 text-ink-600`,children:[`当前:`,KF(n,Date.now())]})]});return(0,A.jsx)(`div`,{className:`chat-row anim-other`,"data-job-report":t,children:(0,A.jsx)(`div`,{className:`min-w-0 rounded-xl border border-sakura-200 bg-surface px-3 py-2 text-xs`,children:o===void 0?(0,A.jsx)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:s}):(0,A.jsxs)(`details`,{children:[(0,A.jsx)(`summary`,{className:`focus-neko flex cursor-pointer flex-wrap items-center gap-x-2 gap-y-1`,children:s}),i!==void 0&&(0,A.jsxs)(`code`,{className:`mt-2 block whitespace-pre-wrap break-all text-ink-600`,children:[`$ `,i]}),(0,A.jsx)(`pre`,{className:`mt-1 max-h-72 overflow-auto whitespace-pre-wrap break-words font-mono text-ink-800`,children:o})]})})})}function CR(e,t){this.v=e,this.k=t}function wR(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function TR(e){if(Array.isArray(e))return e}function ER(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function DR(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
126
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function OR(e,t){return TR(e)||ER(e,t)||kR(e,t)||DR()}function kR(e,t){if(e){if(typeof e==`string`)return wR(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wR(e,t):void 0}}function AR(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof CR;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}AR.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},AR.prototype.next=function(e){return this._invoke(`next`,e)},AR.prototype.throw=function(e){return this._invoke(`throw`,e)},AR.prototype.return=function(e){return this._invoke(`return`,e)};var jR=Object.entries,MR=Object.setPrototypeOf,NR=Object.isFrozen,PR=Object.getPrototypeOf,FR=Object.getOwnPropertyDescriptor,IR=Object.freeze,LR=Object.seal,RR=Object.create,zR=typeof Reflect<`u`&&Reflect,BR=zR.apply,VR=zR.construct;IR||=function(e){return e},LR||=function(e){return e},BR||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},VR||=function(e){return new e(...[...arguments].slice(1))};var HR=cz(Array.prototype.forEach);Array.prototype.indexOf;var UR=cz(Array.prototype.lastIndexOf),WR=cz(Array.prototype.pop),GR=cz(Array.prototype.push);Array.prototype.slice;var KR=cz(Array.prototype.splice),qR=Array.isArray,JR=cz(String.prototype.toLowerCase),YR=cz(String.prototype.toString),XR=cz(String.prototype.match),ZR=cz(String.prototype.replace),QR=cz(String.prototype.indexOf),$R=cz(String.prototype.trim),ez=cz(Number.prototype.toString),tz=cz(Boolean.prototype.toString),nz=typeof BigInt>`u`?null:cz(BigInt.prototype.toString),rz=typeof Symbol>`u`?null:cz(Symbol.prototype.toString),iz=cz(Object.prototype.hasOwnProperty),az=cz(Object.prototype.toString),oz=cz(RegExp.prototype.test),sz=lz(TypeError);function cz(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return BR(e,t,n)}}function lz(e){return function(){return VR(e,[...arguments])}}function uz(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:JR;if(MR&&MR(e,null),!qR(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(NR(t)||(t[r]=e),i=e)}e[i]=!0}return e}function dz(e){for(let t=0;t<e.length;t++)iz(e,t)||(e[t]=null);return e}function fz(e){let t=RR(null);for(let r of jR(e)){var n=OR(r,2);let i=n[0],a=n[1];iz(e,i)&&(t[i]=qR(a)?dz(a):a&&typeof a==`object`&&a.constructor===Object?fz(a):a)}return t}function pz(e){switch(typeof e){case`string`:return e;case`number`:return ez(e);case`boolean`:return tz(e);case`bigint`:return nz?nz(e):`0`;case`symbol`:return rz?rz(e):`Symbol()`;case`undefined`:return az(e);case`function`:case`object`:{if(e===null)return az(e);let t=e,n=mz(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:az(e)}return az(e)}default:return az(e)}}function mz(e,t){for(;e!==null;){let n=FR(e,t);if(n){if(n.get)return cz(n.get);if(typeof n.value==`function`)return cz(n.value)}e=PR(e)}function n(){return null}return n}function hz(e){try{return oz(e,``),!0}catch{return!1}}var gz=IR(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),_z=IR(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),vz=IR([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),yz=IR([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),bz=IR(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),xz=IR([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Sz=IR([`#text`]),Cz=IR(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),wz=IR(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Tz=IR(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Ez=IR([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Dz=LR(/{{[\w\W]*|^[\w\W]*}}/g),Oz=LR(/<%[\w\W]*|^[\w\W]*%>/g),kz=LR(/\${[\w\W]*/g),Az=LR(/^data-[\-\w.\u00B7-\uFFFF]+$/),jz=LR(/^aria-[\-\w]+$/),Mz=LR(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Nz=LR(/^(?:\w+script|data):/i),Pz=LR(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Fz=LR(/^html$/i),Iz=LR(/^[a-z][.\w]*(-[.\w]+)+$/i),Lz=LR(/<[/\w!]/g),Rz=LR(/<[/\w]/g),zz=LR(/<\/no(script|embed|frames)/i),Bz=LR(/\/>/i),Vz={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Hz=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],Uz=IR(uz({},Hz)),Wz=function(){let e={};return HR(Hz,t=>{e[t]=LR(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),IR(e)}(),Gz=function(){return typeof window>`u`?null:window},Kz=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},qz=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Jz=function(e,t,n,r){return iz(e,t)&&qR(e[t])?uz(r.base?fz(r.base):{},e[t],r.transform):n},Yz=function(e,t,n){let r=iz(e,t)?e[t]:void 0;return r&&typeof r==`object`?fz(r):n()};function Xz(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Gz(),t=e=>Xz(e);if(t.version=`3.4.16`,t.removed=[],!e||!e.document||e.document.nodeType!==Vz.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=mz(d,`cloneNode`),p=mz(d,`remove`),m=mz(d,`removeAttributeNode`),h=mz(d,`nextSibling`),g=mz(d,`childNodes`),_=mz(d,`parentNode`),v=mz(d,`shadowRoot`),y=mz(d,`attributes`),b=o&&o.prototype?mz(o.prototype,`nodeType`):null,x=o&&o.prototype?mz(o.prototype,`nodeName`):null,S=o&&o.prototype?mz(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},w=function(e){return x?x(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let T,ee=``,te,ne=!1,re=0,E=function(){if(re>0)throw sz(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},ie=function(e){E(),re++;try{return T.createHTML(e)}finally{re--}},ae=function(e){E(),re++;try{return T.createScriptURL(e)}finally{re--}},oe=function(){return ne||=(te=Kz(u,i),!0),te},D=n,se=D.implementation,ce=D.createNodeIterator,le=D.createDocumentFragment,ue=D.getElementsByTagName,de=r.importNode,fe=qz();t.isSupported=typeof jR==`function`&&typeof _==`function`&&se&&se.createHTMLDocument!==void 0;let pe=Dz,me=Oz,he=kz,ge=Az,_e=jz,ve=Nz,ye=Pz,be=Iz,O=Mz,k=null,xe=uz({},[...gz,..._z,...vz,...bz,...Sz]),Se=null,Ce=uz({},[...Cz,...wz,...Tz,...Ez]),we=Object.seal(RR(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Te=null,Ee=null,De=Object.seal(RR(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Oe=!0,ke=!0,Ae=!1,je=!0,Me=!1,Ne=!0,Pe=!1,Fe=!1,Ie=null,Le=null,Re=!1,ze=!1,Be=!1,Ve=!1,He=!0,Ue=!1,We=`user-content-`,Ge=!0,Ke=!1,qe={},Je=null,Ye=uz({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Xe=null,Ze=uz({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Qe=null,$e=uz({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),et=`http://www.w3.org/1998/Math/MathML`,tt=`http://www.w3.org/2000/svg`,nt=`http://www.w3.org/1999/xhtml`,rt=nt,it=!1,at=null,ot=uz({},[et,tt,nt],YR),st=IR([`mi`,`mo`,`mn`,`ms`,`mtext`]),ct=uz({},st),lt=IR([`annotation-xml`]),ut=uz({},lt),dt=uz({},[`title`,`style`,`font`,`a`,`script`]),ft=null,pt=[`application/xhtml+xml`,`text/html`],mt=null,ht=null,gt=n.createElement(`form`),_t=function(e){return e instanceof RegExp||e instanceof Function},vt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ht&&ht===e)return;(!e||typeof e!=`object`)&&(e={}),e=fz(e),ft=pt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,mt=ft===`application/xhtml+xml`?YR:JR,k=Jz(e,`ALLOWED_TAGS`,xe,{transform:mt}),Se=Jz(e,`ALLOWED_ATTR`,Ce,{transform:mt}),at=Jz(e,`ALLOWED_NAMESPACES`,ot,{transform:YR}),Qe=Jz(e,`ADD_URI_SAFE_ATTR`,$e,{transform:mt,base:$e}),Xe=Jz(e,`ADD_DATA_URI_TAGS`,Ze,{transform:mt,base:Ze}),Je=Jz(e,`FORBID_CONTENTS`,Ye,{transform:mt}),Te=Jz(e,`FORBID_TAGS`,fz({}),{transform:mt}),Ee=Jz(e,`FORBID_ATTR`,fz({}),{transform:mt}),qe=iz(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?fz(e.USE_PROFILES):e.USE_PROFILES:!1,Oe=e.ALLOW_ARIA_ATTR!==!1,ke=e.ALLOW_DATA_ATTR!==!1,Ae=e.ALLOW_UNKNOWN_PROTOCOLS||!1,je=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Me=e.SAFE_FOR_TEMPLATES||!1,Ne=e.SAFE_FOR_XML!==!1,Pe=e.WHOLE_DOCUMENT||!1,ze=e.RETURN_DOM||!1,Be=e.RETURN_DOM_FRAGMENT||!1,Ve=e.RETURN_TRUSTED_TYPE||!1,Re=e.FORCE_BODY||!1,He=e.SANITIZE_DOM!==!1,Ue=e.SANITIZE_NAMED_PROPS||!1,Ge=e.KEEP_CONTENT!==!1,Ke=e.IN_PLACE||!1,O=hz(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Mz,rt=typeof e.NAMESPACE==`string`?e.NAMESPACE:nt,ct=Yz(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>uz({},st)),ut=Yz(e,`HTML_INTEGRATION_POINTS`,()=>uz({},lt));let t=Yz(e,`CUSTOM_ELEMENT_HANDLING`,()=>RR(null));if(we=RR(null),iz(t,`tagNameCheck`)&&_t(t.tagNameCheck)&&(we.tagNameCheck=t.tagNameCheck),iz(t,`attributeNameCheck`)&&_t(t.attributeNameCheck)&&(we.attributeNameCheck=t.attributeNameCheck),iz(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(we.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),LR(we),Me&&(ke=!1),Be&&(ze=!0),qe&&(k=uz({},Sz),Se=RR(null),qe.html===!0&&(uz(k,gz),uz(Se,Cz)),qe.svg===!0&&(uz(k,_z),uz(Se,wz),uz(Se,Ez)),qe.svgFilters===!0&&(uz(k,vz),uz(Se,wz),uz(Se,Ez)),qe.mathMl===!0&&(uz(k,bz),uz(Se,Tz),uz(Se,Ez))),De.tagCheck=null,De.attributeCheck=null,iz(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?De.tagCheck=e.ADD_TAGS:qR(e.ADD_TAGS)&&(k===xe&&(k=fz(k)),uz(k,e.ADD_TAGS,mt))),iz(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?De.attributeCheck=e.ADD_ATTR:qR(e.ADD_ATTR)&&(Se===Ce&&(Se=fz(Se)),uz(Se,e.ADD_ATTR,mt))),iz(e,`ADD_FORBID_CONTENTS`)&&qR(e.ADD_FORBID_CONTENTS)&&(Je===Ye&&(Je=fz(Je)),uz(Je,e.ADD_FORBID_CONTENTS,mt)),Ge&&(k[`#text`]=!0),Pe&&uz(k,[`html`,`head`,`body`]),k.table&&(uz(k,[`tbody`]),delete Te.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw sz(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw sz(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=T;T=e.TRUSTED_TYPES_POLICY;try{ee=ie(``)}catch(e){throw T=t,e}}else e.TRUSTED_TYPES_POLICY===null?(T=void 0,ee=``):(T===void 0&&(T=oe()),T&&typeof ee==`string`&&(ee=ie(``)));IR&&IR(e),ht=e},yt=uz({},[..._z,...vz,...yz]),bt=uz({},[...bz,...xz]),xt=function(e,t,n){return t.namespaceURI===nt?e===`svg`:t.namespaceURI===et?e===`svg`&&(n===`annotation-xml`||ct[n]):!!yt[e]},St=function(e,t,n){return t.namespaceURI===nt?e===`math`:t.namespaceURI===tt?e===`math`&&ut[n]:!!bt[e]},Ct=function(e,t,n){return t.namespaceURI===tt&&!ut[n]||t.namespaceURI===et&&!ct[n]?!1:!bt[e]&&(dt[e]||!yt[e])},wt=function(e){let t=_(e);(!t||!t.tagName)&&(t={namespaceURI:rt,tagName:`template`});let n=JR(e.tagName),r=JR(t.tagName);return at[e.namespaceURI]?e.namespaceURI===tt?xt(n,t,r):e.namespaceURI===et?St(n,t,r):e.namespaceURI===nt?Ct(n,t,r):!!(ft===`application/xhtml+xml`&&at[e.namespaceURI]):!1},Tt=function(e){GR(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw sz(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},Et=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},Dt=function(e){At(e);let t=g(e);if(t){let e=[];HR(t,t=>{GR(e,t)}),HR(e,e=>{try{p(e)}catch{}})}let n=y(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&Et(e,r,i)}},Ot=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}GR(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(ze||Be)try{Tt(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},kt=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||Se[mt(i)]||Et(e,r,i)}},At=function(e){let t=[e];for(;t.length>0;){let e=t.pop();C(e)===Vz.element&&kt(e);let n=g(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},jt=function(e,t){return Ne?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Mt=function(e){if(!Ne)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=C(e);if(n===Vz.processingInstruction||n===Vz.comment&&oz(Rz,e.data)){try{p(e)}catch{}continue}if(n===Vz.element){let t=e,n=mt(w(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&jt(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=g(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},Nt=function(e){let t=null,r=null;if(Re)e=`<remove></remove>`+e;else{let t=XR(e,/^[\r\n\t ]+/);r=t&&t[0]}ft===`application/xhtml+xml`&&rt===nt&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=T?ie(e):e;if(rt===nt)try{t=new l().parseFromString(i,ft)}catch{}if(!t||!t.documentElement){t=se.createDocument(rt,`template`,null);try{t.documentElement.innerHTML=it?ee:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),rt===nt?ue.call(t,Pe?`html`:`body`)[0]:Pe?t.documentElement:a},Pt=function(e){let t=S?S(e):e.ownerDocument;return ce.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Ft=function(e){return e=ZR(e,pe,` `),e=ZR(e,me,` `),e=ZR(e,he,` `),e},It=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=ce.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=Ft(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&HR(i,e=>{Rt(e.content)&&It(e.content)})},Lt=function(e){let t=x?x(e):null;return typeof t!=`string`||mt(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},Rt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===Vz.documentFragment}catch{return!1}},zt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function Bt(e,n,r){e.length!==0&&HR(e,e=>{e.call(t,n,r,ht)})}let Vt=function(e,t){return!!(Ne&&e.hasChildNodes()&&!zt(e.firstElementChild)&&oz(Lz,e.textContent)&&oz(Lz,e.innerHTML)||Ne&&e.namespaceURI===nt&&Uz[t]&&(zt(e.firstElementChild)||typeof e.textContent==`string`&&oz(Wz[t],e.textContent))||e.nodeType===Vz.processingInstruction||Ne&&e.nodeType===Vz.comment&&oz(Rz,e.data))},Ht=function(e,t){return e instanceof RegExp?oz(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Ut=function(e,t,n){if(!Te[t]&&Yt(t)&&Ht(we.tagNameCheck,t))return!1;if(Ge&&!Je[t]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return Tt(e),!0},Wt=function(e,t,n,r){return e.length===0?t:t===n||t===r?fz(t):t},Gt=function(e,t){return e===t||_(e)!==null?!1:(Ke&&At(e),!0)},Kt=function(e,n){if(Bt(fe.beforeSanitizeElements,e,null),Gt(e,n))return!0;if(Lt(e))return Tt(e),!0;let r=mt(w(e));if(k=Wt(fe.uponSanitizeElement,k,xe,Ie),Bt(fe.uponSanitizeElement,e,{tagName:r,allowedTags:k}),Gt(e,n))return!0;if(Vt(e,r))return Tt(e),!0;if(Te[r]||!(De.tagCheck instanceof Function&&De.tagCheck(r))&&!k[r]){let t=Ut(e,r,n);return t===!1&&(Bt(fe.afterSanitizeElements,e,null),Gt(e,n))?!0:t}if(C(e)===Vz.element&&!wt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&oz(zz,e.innerHTML))return Tt(e),!0;if(Me&&e.nodeType===Vz.text){let n=Ft(e.textContent);e.textContent!==n&&(GR(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Bt(fe.afterSanitizeElements,e,null),Gt(e,n)},qt=function(e,t,r){if(Ee[t]||jt(t,e)||He&&(t===`id`||t===`name`)&&(r in n||r in gt))return!1;let i=Se[t]||De.attributeCheck instanceof Function&&De.attributeCheck(t,e);return ke&&oz(ge,t)||Oe&&oz(_e,t)?!0:i?Qe[t]||oz(O,ZR(r,ye,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&QR(r,`data:`)===0&&Xe[e]||Ae&&!oz(ve,ZR(r,ye,``))?!0:!r:Yt(e)&&Ht(we.tagNameCheck,e)&&Ht(we.attributeNameCheck,t,e)||t===`is`&&we.allowCustomizedBuiltInElements&&Ht(we.tagNameCheck,r)},Jt=uz({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Yt=function(e){return!Jt[JR(e)]&&oz(be,e)},Xt=function(e,t,n,r){if(T&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return ie(r);case`TrustedScriptURL`:return ae(r)}return r},Zt=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!Lt(e)||(Tt(e),!1)}catch{return Ot(t,e),!1}},Qt=function(e,n){if(Bt(fe.beforeSanitizeAttributes,e,null),Gt(e,n))return;let r=e.attributes;if(!r||Lt(e))return;Se=Wt(fe.uponSanitizeAttribute,Se,Ce,Le);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:Se,forceKeepAttr:void 0},a=r.length,o=mt(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=mt(s),d=l,f=s===`value`?d:$R(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,Bt(fe.uponSanitizeAttribute,e,i),f=i.attrValue,Ue&&(u===`id`||u===`name`)&&QR(f,We)!==0&&(Ot(s,e,n),f=We+f,p=!0),Ne&&oz(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)||u===`attributename`&&XR(f,`href`)?Ot(s,e,n):i.forceKeepAttr||(i.keepAttr?!je&&oz(Bz,f)?Ot(s,e,n):(Me&&(f=Ft(f)),qt(o,u,f)?(f=Xt(o,u,c,f),f!==d&&Zt(e,s,c,f)&&p&&WR(t.removed)):Ot(s,e,n)):Ot(s,e,n))}Bt(fe.afterSanitizeAttributes,e,null),Gt(e,n)},$t=function(e){let t=null,n=Pt(e);for(Bt(fe.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Bt(fe.uponSanitizeShadowNode,t,null),Kt(t,e),Qt(t,e),Rt(t.content)&&$t(t.content),C(t)===Vz.element){let e=v(t);Rt(e)&&(en(e),$t(e))}Bt(fe.afterSanitizeShadowDOM,e,null)},en=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){$t(e.shadow);continue}let n=e.node,r=C(n)===Vz.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&mt(e)===`template`){let e=n.content;Rt(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);Rt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(it=!e,it&&(e=`<!-->`),typeof e!=`string`&&!zt(e)&&(e=pz(e),typeof e!=`string`))throw sz(`dirty is not a string, aborting`);if(!t.isSupported)return e;Fe?(k=Ie,Se=Le):vt(n),(fe.uponSanitizeElement.length>0||fe.uponSanitizeAttribute.length>0)&&(k=fz(k)),fe.uponSanitizeAttribute.length>0&&(Se=fz(Se)),t.removed=[];let c=Ke&&typeof e!=`string`&&zt(e);if(c){Mt(e);let t=w(e);if(typeof t==`string`){let n=mt(t);if(!k[n]||Te[n])throw Dt(e),sz(`root node is forbidden and cannot be sanitized in-place`)}if(Lt(e))throw Dt(e),sz(`root node is clobbered and cannot be sanitized in-place`);try{en(e)}catch(t){throw Dt(e),t}}else if(zt(e))i=Nt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===Vz.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),en(i);else{if(!ze&&!Me&&!Pe&&e.indexOf(`<`)===-1)return T&&Ve?ie(e):e;if(i=Nt(e),!i)return ze?null:Ve?ee:``}i&&Re&&Tt(i.firstChild);let l=c?e:i;try{let e=Pt(l);for(;o=e.nextNode();)Kt(o,l),Qt(o,l),Rt(o.content)&&$t(o.content)}catch(n){throw c&&(Dt(e),HR(t.removed,e=>{e.element&&At(e.element)})),n}if(c){let n=!1;if(HR(t.removed,t=>{t.element&&(t.element===e&&(n=!0),At(t.element))}),n)throw sz(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return Me&&It(e),e}if(ze){if(Me&&It(i),Be)for(s=le.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(Se.shadowroot||Se.shadowrootmode)&&(s=de.call(r,s,!0)),s}let u=Pe?i.outerHTML:i.innerHTML;return Pe&&k[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&oz(Fz,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
127
- `+u),Me&&(u=Ft(u)),T&&Ve?ie(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};vt(e),Fe=!0,Ie=k,Le=Se},t.clearConfig=function(){ht=null,Fe=!1,Ie=null,Le=null,T=te,ee=``},t.isValidAttribute=function(e,t,n){ht||vt({});let r=mt(e),i=mt(t);return qt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&iz(fe,e)&&GR(fe[e],t)},t.removeHook=function(e,t){if(iz(fe,e)){if(t!==void 0){let n=UR(fe[e],t);return n===-1?void 0:KR(fe[e],n,1)[0]}return WR(fe[e])}},t.removeHooks=function(e){iz(fe,e)&&(fe[e]=[])},t.removeAllHooks=function(){fe=qz()},t}var Zz=Xz(),Qz=l(o(((e,t)=>{function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error(`map is read-only`)}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error(`set is read-only`)}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let r=e[t],i=typeof r;(i===`object`||i===`function`)&&!Object.isFrozen(r)&&n(r)}),e}var r=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function i(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#x27;`)}function a(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var o=`</span>`,s=e=>!!e.scope,c=(e,{prefix:t})=>{if(e.startsWith(`language:`))return e.replace(`language:`,`language-`);if(e.includes(`.`)){let n=e.split(`.`);return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${`_`.repeat(t+1)}`)].join(` `)}return`${t}${e}`},l=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!s(e))return;let t=c(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){s(e)&&(this.buffer+=o)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},u=(e={})=>{let t={children:[]};return Object.assign(t,e),t},d=class e{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=u({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t==`string`?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!=`string`&&t.children&&(t.children.every(e=>typeof e==`string`)?t.children=[t.children.join(``)]:t.children.forEach(t=>{e._collapse(t)}))}},f=class extends d{constructor(e){super(),this.options=e}addText(e){e!==``&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function p(e){return e?typeof e==`string`?e:e.source:null}function m(e){return _(`(?=`,e,`)`)}function h(e){return _(`(?:`,e,`)*`)}function g(e){return _(`(?:`,e,`)?`)}function _(...e){return e.map(e=>p(e)).join(``)}function v(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function y(...e){return`(`+(v(e).capture?``:`?:`)+e.map(e=>p(e)).join(`|`)+`)`}function b(e){return RegExp(e.toString()+`|`).exec(``).length-1}function x(e,t){let n=e&&e.exec(t);return n&&n.index===0}var S=new RegExp(y(/\[(?:[^\\\]]|\\.)*\]/,/\(\?<(?![=!])[^>]+>/,/\(\?'[^']+'/,/\(\??/,/\\([1-9][0-9]*)/,/\\./));function C(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=p(e),i=``;for(;r.length>0;){let e=S.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]===`\\`&&e[1]?i+=`\\`+String(Number(e[1])+t):(i+=e[0],(e[0]===`(`||/^\(\?[<']/.test(e[0]))&&n++)}return i}).map(e=>`(${e})`).join(t)}var w=/\b\B/,T=`[a-zA-Z]\\w*`,ee=`[a-zA-Z_]\\w*`,te=`\\b\\d+(\\.\\d+)?`,ne=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,re=`\\b(0b[01]+)`,E=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,ie=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=_(t,/.*\b/,e.binary,/\b.*/)),a({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},ae={begin:`\\\\[\\s\\S]`,relevance:0},oe={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[ae]},D={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[ae]},se={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},ce=function(e,t,n={}){let r=a({scope:`comment`,begin:e,end:t,contains:[]},n);r.contains.push({scope:`doctag`,begin:`[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)`,end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=y(`I`,`a`,`is`,`so`,`us`,`to`,`at`,`if`,`in`,`it`,`on`,/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:_(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},le=ce(`//`,`$`),ue=ce(`/\\*`,`\\*/`),de=ce(`#`,`$`),fe=Object.freeze({__proto__:null,APOS_STRING_MODE:oe,BACKSLASH_ESCAPE:ae,BINARY_NUMBER_MODE:{scope:`number`,begin:re,relevance:0},BINARY_NUMBER_RE:re,COMMENT:ce,C_BLOCK_COMMENT_MODE:ue,C_LINE_COMMENT_MODE:le,C_NUMBER_MODE:{scope:`number`,begin:ne,relevance:0},C_NUMBER_RE:ne,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:de,IDENT_RE:T,MATCH_NOTHING_RE:w,METHOD_GUARD:{begin:`\\.\\s*[a-zA-Z_]\\w*`,relevance:0},NUMBER_MODE:{scope:`number`,begin:te,relevance:0},NUMBER_RE:te,PHRASAL_WORDS_MODE:se,QUOTE_STRING_MODE:D,REGEXP_MODE:{scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ae,{begin:/\[/,end:/\]/,relevance:0,contains:[ae]}]},RE_STARTERS_RE:E,SHEBANG:ie,TITLE_MODE:{scope:`title`,begin:T,relevance:0},UNDERSCORE_IDENT_RE:ee,UNDERSCORE_TITLE_MODE:{scope:`title`,begin:ee,relevance:0}});function pe(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function me(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function he(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=pe,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function ge(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function _e(e,t){if(e.match){if(e.begin||e.end)throw Error(`begin & end are not supported with match`);e.begin=e.match,delete e.match}}function ve(e,t){e.relevance===void 0&&(e.relevance=1)}var ye=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error(`beforeMatch cannot be used with starts`);let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=_(n.beforeMatch,m(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},be=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],O=`keyword`;function k(e,t,n=O){let r=Object.create(null);return typeof e==`string`?i(n,e.split(` `)):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,k(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split(`|`);r[n[0]]=[e,xe(n[0],n[1])]})}}function xe(e,t){return t?Number(t):+!Se(e)}function Se(e){return be.includes(e.toLowerCase())}var Ce={},we=e=>{console.error(e)},Te=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Ee=(e,t)=>{Ce[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),Ce[`${e}/${t}`]=!0)},De=Error();function Oe(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=b(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function ke(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw we(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),De;if(typeof e.beginScope!=`object`||e.beginScope===null)throw we(`beginScope must be object`),De;Oe(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function Ae(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw we(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),De;if(typeof e.endScope!=`object`||e.endScope===null)throw we(`endScope must be object`),De;Oe(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function je(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Me(e){je(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),ke(e),Ae(e)}function Ne(e){function t(t,n){return new RegExp(p(t),`m`+(e.case_insensitive?`i`:``)+(e.unicodeRegex?`u`:``)+(n?`g`:``))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=b(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(C(e,{joinWith:`|`}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type===`begin`&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:`begin`})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:`end`}),e.illegal&&t.addRule(e.illegal,{type:`illegal`}),t}function o(n,r){let a=n;if(n.isCompiled)return a;[me,_e,Me,ye].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[he,ge,ve].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords==`object`&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=k(n.keywords,e.case_insensitive),a.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,a.beginRe=t(a.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(a.endRe=t(a.end)),a.terminatorEnd=p(a.end)||``,n.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(n.end?`|`:``)+r.terminatorEnd)),n.illegal&&(a.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return Fe(e===`self`?n:e)})),n.contains.forEach(function(e){o(e,a)}),n.starts&&o(n.starts,r),a.matcher=i(a),a}if(e.compilerExtensions||=[],e.contains&&e.contains.includes(`self`))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=a(e.classNameAliases||{}),o(e)}function Pe(e){return e?e.endsWithParent||Pe(e.starts):!1}function Fe(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Pe(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var Ie=`11.12.0`,Le=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},Re=i,ze=a,Be=Symbol(`nomatch`),Ve=7,He=function(e){let t=Object.create(null),i=Object.create(null),a=[],o=!0,s=`Could not find the language '{}', did you forget to load/include a language module?`,c={disableAutodetect:!0,name:`Plain text`,contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:`hljs-`,cssSelector:`pre code`,languages:null,__emitter:f};function u(e){return l.noHighlightRe.test(e)}function d(e){let t=e.className+` `;t+=e.parentNode?e.parentNode.className:``;let n=l.languageDetectRe.exec(t);if(n){let t=oe(n[1]);return t||(Te(s.replace(`{}`,n[1])),Te(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>u(e)||oe(e))}function p(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(Ee(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),Ee(`10.7.0`,`Please use highlight(code, options) instead.
128
- https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(n=!0);let a={code:r,language:i};de(`before:highlight`,a);let o=a.result?a.result:v(a.language,a.code,n);return o.code=a.code,de(`after:highlight`,o),o}function v(e,n,i,a){let c=Object.create(null);function u(e,t){return e.keywords[t]}function d(){if(!E.keywords){ae.addText(D);return}let e=0;E.keywordPatternRe.lastIndex=0;let t=E.keywordPatternRe.exec(D),n=``;for(;t;){n+=D.substring(e,t.index);let r=te.case_insensitive?t[0].toLowerCase():t[0],i=u(E,r);if(i){let[e,a]=i;if(ae.addText(n),n=``,c[r]=(c[r]||0)+1,c[r]<=Ve&&(se+=a),e.startsWith(`_`))n+=t[0];else{let n=te.classNameAliases[e]||e;m(t[0],n)}}else n+=t[0];e=E.keywordPatternRe.lastIndex,t=E.keywordPatternRe.exec(D)}n+=D.substring(e),ae.addText(n)}function f(){if(D===``)return;let e=null;if(typeof E.subLanguage==`string`){if(!t[E.subLanguage]){ae.addText(D);return}e=v(E.subLanguage,D,!0,ie[E.subLanguage]),ie[E.subLanguage]=e._top}else e=S(D,E.subLanguage.length?E.subLanguage:null);E.relevance>0&&(se+=e.relevance),ae.__addSublanguage(e._emitter,e.language)}function p(){E.subLanguage==null?d():f(),D=``}function m(e,t){e!==``&&(ae.startScope(t),ae.addText(e),ae.endScope())}function h(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=te.classNameAliases[e[n]]||e[n],i=t[n];r?m(i,r):(D=i,d(),D=``),n++}}function g(e,t){return e.scope&&typeof e.scope==`string`&&ae.openNode(te.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(m(D,te.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),D=``):e.beginScope._multi&&(h(e.beginScope,t),D=``)),E=Object.create(e,{parent:{value:E}}),E}function _(e,t,n){let i=x(e.endRe,n);if(i){if(e[`on:end`]){let n=new r(e);e[`on:end`](t,n),n.isMatchIgnored&&(i=!1)}if(i){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return _(e.parent,t,n)}function y(e){return E.matcher.regexIndex===0?(D+=e[0],1):(ue=!0,0)}function b(e){let t=e[0],n=e.rule,i=new r(n),a=[n.__beforeBegin,n[`on:begin`]];for(let n of a)if(n&&(n(e,i),i.isMatchIgnored))return y(t);return n.skip?D+=t:(n.excludeBegin&&(D+=t),p(),!n.returnBegin&&!n.excludeBegin&&(D=t)),g(n,e),n.returnBegin?0:t.length}function C(e){let t=e[0],r=n.substring(e.index),i=_(E,e,r);if(!i)return Be;let a=E;E.endScope&&E.endScope._wrap?(p(),m(t,E.endScope._wrap)):E.endScope&&E.endScope._multi?(p(),h(E.endScope,e)):a.skip?D+=t:(a.returnEnd||a.excludeEnd||(D+=t),p(),a.excludeEnd&&(D=t));do E.scope&&ae.closeNode(),!E.skip&&!E.subLanguage&&(se+=E.relevance),E=E.parent;while(E!==i.parent);return i.starts&&g(i.starts,e),a.returnEnd?0:t.length}function w(){let e=[];for(let t=E;t!==te;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>ae.openNode(e))}let T={};function ee(t,r){let a=r&&r[0];if(D+=t,a==null)return p(),0;if(T.type===`begin`&&r.type===`end`&&T.index===r.index&&a===``){if(D+=n.slice(r.index,r.index+1),!o){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=T.rule,t}return 1}if(T=r,r.type===`begin`)return b(r);if(r.type===`illegal`&&!i){let e=Error(`Illegal lexeme "`+a+`" for mode "`+(E.scope||`<unnamed>`)+`"`);throw e.mode=E,e}if(r.type===`end`){let e=C(r);if(e!==Be)return e}if(r.type===`illegal`&&a===``)return r.index===n.length||(D+=`
129
- `),1;if(le>1e5&&le>r.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return D+=a,a.length}let te=oe(e);if(!te)throw we(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let ne=Ne(te),re=``,E=a||ne,ie={},ae=new l.__emitter(l);w();let D=``,se=0,ce=0,le=0,ue=!1;try{if(te.__emitTokens)te.__emitTokens(n,ae);else{for(E.matcher.considerAll();;){le++,ue?ue=!1:E.matcher.considerAll(),E.matcher.lastIndex=ce;let e=E.matcher.exec(n);if(!e)break;let t=ee(n.substring(ce,e.index),e);ce=e.index+t}ee(n.substring(ce))}return ae.finalize(),re=ae.toHTML(),{language:e,value:re,relevance:se,illegal:!1,_emitter:ae,_top:E}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:Re(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:ce,context:n.slice(ce-100,ce+100),mode:t.mode,resultSoFar:re},_emitter:ae};if(o)return{language:e,value:Re(n),illegal:!1,relevance:0,errorRaised:t,_emitter:ae,_top:E};throw t}}function b(e){let t={value:Re(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}function S(e,n){n=n||l.languages||Object.keys(t);let r=b(e),i=n.filter(oe).filter(se).map(t=>v(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(oe(e.language).supersetOf===t.language)return 1;if(oe(t.language).supersetOf===e.language)return-1}return 0}),s=a;return s.secondBest=o,s}function C(e,t,n){let r=t&&i[t]||n;e.classList.add(`hljs`),e.classList.add(`language-${r}`)}function w(e){let t=null,n=d(e);if(u(n))return;if(de(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn(`One of your code blocks includes unescaped HTML. This is a potentially serious security risk.`),console.warn(`https://github.com/highlightjs/highlight.js/wiki/security`),console.warn(`The element with unescaped HTML:`),console.warn(e)),l.throwUnescapedHTML))throw new Le(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?p(r,{language:n,ignoreIllegals:!0}):S(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,C(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),de(`after:highlightElement`,{el:e,result:i,text:r})}function T(e){l=ze(l,e)}let ee=()=>{re(),Ee(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function te(){re(),Ee(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let ne=!1;function re(){function e(){re()}document.readyState===`loading`?(ne||window.addEventListener(`DOMContentLoaded`,e,!1),ne=!0):document.querySelectorAll(l.cssSelector).forEach(w)}function E(n,r){let i=null;try{i=r(e)}catch(e){if(we(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)we(e);else throw e;i=c}i.name||(i.name=n),t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&D(i.aliases,{languageName:n})}function ie(e){delete t[e];for(let t of Object.keys(i))i[t]===e&&delete i[t]}function ae(){return Object.keys(t)}function oe(e){return e=(e||``).toLowerCase(),t[e]||t[i[e]]}function D(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function se(e){let t=oe(e);return t&&!t.disableAutodetect}function ce(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function le(e){ce(e),a.push(e)}function ue(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function de(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function pe(e){return Ee(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),Ee(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:re,highlightElement:w,highlightBlock:pe,configure:T,initHighlighting:ee,initHighlightingOnLoad:te,registerLanguage:E,unregisterLanguage:ie,listLanguages:ae,getLanguage:oe,registerAliases:D,autoDetection:se,inherit:ze,addPlugin:le,removePlugin:ue}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=Ie,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in fe)typeof fe[e]==`object`&&n(fe[e]);return Object.assign(e,fe),e},Ue=He({});Ue.newInstance=()=>He({}),t.exports=Ue,Ue.HighlightJS=Ue,Ue.default=Ue}))()).default;function $z(e){let t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:[`self`,{begin:/:-/,contains:[n]}]};Object.assign(n,{className:`variable`,variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,`(?![\\w\\d])(?![$])`)},r]});let i={className:`subst`,begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:`comment`}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:`string`})]}},s={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let c={match:/\\"/},l={className:`string`,begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:`number`},e.NUMBER_MODE,n]},f=e.SHEBANG({binary:`(${[`fish`,`bash`,`zsh`,`sh`,`csh`,`ksh`,`tcsh`,`dash`,`scsh`].join(`|`)})`,relevance:10}),p={className:`function`,begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=[`if`,`then`,`else`,`elif`,`fi`,`time`,`for`,`while`,`until`,`in`,`do`,`done`,`case`,`esac`,`coproc`,`function`,`select`],h=[`true`,`false`],g={match:/(\/[a-z._-]+)+/},_=[`break`,`cd`,`continue`,`eval`,`exec`,`exit`,`export`,`getopts`,`hash`,`pwd`,`readonly`,`return`,`shift`,`test`,`times`,`trap`,`umask`,`unset`],v=[`alias`,`bind`,`builtin`,`caller`,`command`,`declare`,`echo`,`enable`,`help`,`let`,`local`,`logout`,`mapfile`,`printf`,`read`,`readarray`,`source`,`sudo`,`type`,`typeset`,`ulimit`,`unalias`],y=`autoload.bg.bindkey.bye.cap.chdir.clone.comparguments.compcall.compctl.compdescribe.compfiles.compgroups.compquote.comptags.comptry.compvalues.dirs.disable.disown.echotc.echoti.emulate.fc.fg.float.functions.getcap.getln.history.integer.jobs.kill.limit.log.noglob.popd.print.pushd.pushln.rehash.sched.setcap.setopt.stat.suspend.ttyctl.unfunction.unhash.unlimit.unsetopt.vared.wait.whence.where.which.zcompile.zformat.zftp.zle.zmodload.zparseopts.zprof.zpty.zregexparse.zsocket.zstyle.ztcp`.split(`.`),b=`chcon.chgrp.chown.chmod.cp.dd.df.dir.dircolors.ln.ls.mkdir.mkfifo.mknod.mktemp.mv.realpath.rm.rmdir.shred.sync.touch.truncate.vdir.b2sum.base32.base64.cat.cksum.comm.csplit.cut.expand.fmt.fold.head.join.md5sum.nl.numfmt.od.paste.ptx.pr.sha1sum.sha224sum.sha256sum.sha384sum.sha512sum.shuf.sort.split.sum.tac.tail.tr.tsort.unexpand.uniq.wc.arch.basename.chroot.date.dirname.du.echo.env.expr.factor.groups.hostid.id.link.logname.nice.nohup.nproc.pathchk.pinky.printenv.printf.pwd.readlink.runcon.seq.sleep.stat.stdbuf.stty.tee.test.timeout.tty.uname.unlink.uptime.users.who.whoami.yes`.split(`.`);return{name:`Bash`,aliases:[`sh`,`zsh`],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:h,built_in:[..._,...v,`set`,`shopt`,...y,...b]},contains:[f,e.SHEBANG(),p,d,a,o,g,s,c,l,u,n]}}function eB(e){let t=e.regex;return{name:`Diff`,aliases:[`patch`],contains:[{className:`meta`,relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+,\d+ +\+\d+ +@@/,/^@@ +-\d+ +\+\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:`comment`,variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:`addition`,begin:/^\+/,end:/$/},{className:`deletion`,begin:/^-/,end:/$/},{className:`addition`,begin:/^!/,end:/$/}]}}var tB=`[A-Za-z$_][0-9A-Za-z$_]*`,nB=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),rB=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],iB=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),aB=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],oB=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],sB=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`self`,`global`],cB=[].concat(oB,iB,aB);function lB(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=tB,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);((a=o.match(/^\s*=/))||(a=o.match(/^\s+extends\s+/))&&a.index===0)&&t.ignoreMatch()}},s={$pattern:tB,keyword:nB,literal:rB,built_in:cB,"variable.language":sB},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:r+`(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...iB,...aB]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},ee={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function te(e){return t.concat(`(?!`,e.join(`|`),`)`)}let ne={match:t.concat(/\b/,te([...oB,`super`,`import`,`await`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},re={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},E={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},ie=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,ae={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(ie)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},ae,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:ie,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},re,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},ne,ee,S,E,{match:/\$[(.]/}]}}var uB={scope:`number`,match:`([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity`,relevance:0};function dB(e){let t={className:`attr`,begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:`punctuation`,relevance:0},r=[`true`,`false`,`null`],i={scope:`literal`,beginKeywords:r.join(` `)};return{name:`JSON`,aliases:[`jsonc`,`json5`],keywords:{literal:r},contains:[t,n,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,i,uB,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:`\\S`}}function fB(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:`>`,subLanguage:`xml`,relevance:0},r={match:/^ {0,3}([-*_])[ \t]*(?:\1[ \t]*){2,}$/},i={className:`code`,variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:`(~{3,})[^~](.|\\n)*?\\1~*[ ]*`},{begin:"```",end:"```+[ ]*$"},{begin:`~~~`,end:`~~~+[ ]*$`},{begin:"`.+?`"},{begin:`(?=^( {4}|\\t))`,contains:[{begin:`^( {4}|\\t)`,end:`(\\n)$`}],relevance:0}]},a={className:`bullet`,begin:`^[ ]*([*+-]|(\\d+\\.))(?=\\s+)`,end:`\\s+`,excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:`symbol`,begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:`link`,begin:/:\s*/,end:/$/,excludeBegin:!0}]},s={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:`string`,relevance:0,begin:`\\[`,end:`\\]`,excludeBegin:!0,returnEnd:!0},{className:`link`,relevance:0,begin:`\\]\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0},{className:`symbol`,relevance:0,begin:`\\]\\[`,end:`\\]`,excludeBegin:!0,excludeEnd:!0}]},c={className:`strong`,contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},l={className:`emphasis`,contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(c,{contains:[]}),d=e.inherit(l,{contains:[]});c.contains.push(d),l.contains.push(u);let f=[n,s];return[c,l,u,d].forEach(e=>{e.contains=e.contains.concat(f)}),f=f.concat(c,l),{name:`Markdown`,aliases:[`md`,`mkdown`,`mkd`],contains:[{className:`section`,variants:[{begin:`^#{1,6}`,end:`$`,contains:f},{begin:`(?=^.+?\\n[=-]{2,}$)`,contains:[{begin:`^[=-]*$`},{begin:`^`,end:`\\n`,contains:f}]}]},n,a,r,c,l,{className:`quote`,begin:`^>\\s+`,contains:f,end:`$`},i,s,o,{scope:`literal`,match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function pB(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=`and.as.assert.async.await.break.case.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.lazy.match.nonlocal|10.not.or.pass.raise.return.try.while.with.yield`.split(`.`),i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:`__import__.abs.aiter.all.anext.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozendict.frozenset.getattr.globals.hasattr.hash.help.hex.id.input.int.isinstance.issubclass.iter.len.list.locals.map.max.memoryview.min.next.object.oct.open.ord.pow.print.property.range.repr.reversed.round.sentinel.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip`.split(`.`),literal:[`__debug__`,`Ellipsis`,`False`,`None`,`NotImplemented`,`True`],type:[`Any`,`Callable`,`Coroutine`,`Dict`,`List`,`Literal`,`Generic`,`Optional`,`Sequence`,`Set`,`Tuple`,`Type`,`Union`]},a={className:`meta`,begin:/^(>>>|\.\.\.) /},o={className:`subst`,begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},c={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l=`[0-9](_?[0-9])*`,u=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,d=`\\b|${r.join(`|`)}`,f={className:`number`,relevance:0,variants:[{begin:`(\\b(${l})|(${u}))[eE][+-]?(${l})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${l})[jJ](?=${d})`}]},p={className:`comment`,begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:`params`,variants:[{className:``,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:[`self`,a,f,c,e.HASH_COMMENT_MODE]}]};return o.contains=[c,f,a],{name:`Python`,aliases:[`py`,`gyp`,`ipython`],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,f,{scope:`variable.language`,match:/\bself\b/},{beginKeywords:`if`,relevance:0},{match:/\bor\b/,scope:`keyword`},c,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:`keyword`,3:`title.class`,6:`title.class.inherited`}},{className:`meta`,begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,m,c]}]}}var mB=`[A-Za-z$_][0-9A-Za-z$_]*`,hB=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),gB=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],_B=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),vB=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],yB=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],bB=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`self`,`global`],xB=[].concat(yB,_B,vB);function SB(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=mB,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);((a=o.match(/^\s*=/))||(a=o.match(/^\s+extends\s+/))&&a.index===0)&&t.ignoreMatch()}},s={$pattern:mB,keyword:hB,literal:gB,built_in:xB,"variable.language":bB},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:r+`(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[..._B,...vB]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},ee={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function te(e){return t.concat(`(?!`,e.join(`|`),`)`)}let ne={match:t.concat(/\b/,te([...yB,`super`,`import`,`await`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},re={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},E={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},ie=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,ae={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(ie)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},ae,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:ie,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},re,{match:`\\$`+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},ne,ee,S,E,{match:/\$[(.]/}]}}function CB(e){let t=e.regex,n=SB(e),r=mB,i=[`any`,`void`,`number`,`boolean`,`string`,`object`,`never`,`symbol`,`bigint`,`unknown`],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:`keyword`,3:`title.class`}},o={beginKeywords:`interface`,end:/\{/,excludeEnd:!0,keywords:{keyword:`interface extends`,built_in:i},contains:[n.exports.CLASS_REFERENCE]},s={className:`meta`,relevance:10,begin:/^\s*['"]use strict['"]/},c={$pattern:mB,keyword:hB.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:gB,built_in:xB.concat(i),"variable.language":bB},l={className:`meta`,begin:`@`+r},u=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error(`can not find mode to replace`);e.contains.splice(r,1,n)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(l);let d=n.contains.find(e=>e.scope===`attr`),f=Object.assign({},d,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,f]),n.contains=n.contains.concat([l,a,o,f]),u(n,`shebang`,e.SHEBANG()),u(n,`use_strict`,s);let p=n.contains.find(e=>e.label===`func.def`);return p.relevance=0,Object.assign(n,{name:`TypeScript`,aliases:[`ts`,`tsx`,`mts`,`cts`]}),n}function wB(e){let t=`true false yes no null`,n=`[\\w#;/?:@&=+$,.~*'()[\\]]+`,r={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},o={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},s=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),c={className:`number`,begin:`\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b`},l={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},u={begin:/\{/,end:/\}/,contains:[l],illegal:`\\n`,relevance:0},d={begin:`\\[`,end:`\\]`,contains:[l],illegal:`\\n`,relevance:0},f=[r,{className:`meta`,begin:`^---\\s*$`,relevance:10},{className:`string`,begin:`[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*`},{begin:`<%[%=-]?`,end:`[%-]?%>`,subLanguage:`ruby`,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:`!\\w+!`+n},{className:`type`,begin:`!<`+n+`>`},{className:`type`,begin:`!`+n},{className:`type`,begin:`!!`+n},{className:`meta`,begin:`&`+e.UNDERSCORE_IDENT_RE+`$`},{className:`meta`,begin:`\\*`+e.UNDERSCORE_IDENT_RE+`$`},{className:`bullet`,begin:`-(?=[ ]|$)`,relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},c,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},u,d,a,o],p=[...f];return p.pop(),p.push(s),l.contains=p,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:f}}Qz.registerLanguage(`bash`,$z),Qz.registerLanguage(`diff`,eB),Qz.registerLanguage(`javascript`,lB),Qz.registerLanguage(`json`,dB),Qz.registerLanguage(`markdown`,fB),Qz.registerLanguage(`python`,pB),Qz.registerLanguage(`typescript`,CB),Qz.registerLanguage(`yaml`,wB);var TB={shell:`bash`};function EB(e){if(e===void 0)return!1;let t=TB[e.trim().toLowerCase()]??e.trim().toLowerCase();return t!==``&&Qz.getLanguage(t)!==void 0}function DB(e,t){let n=t===void 0?``:TB[t.trim().toLowerCase()]??t.trim().toLowerCase();if(n!==``&&Qz.getLanguage(n)!==void 0)try{return Qz.highlight(e,{language:n}).value}catch{}return OB(e)}function OB(e){return e.replaceAll(`&`,`&amp;`).replaceAll(`<`,`&lt;`).replaceAll(`>`,`&gt;`).replaceAll(`"`,`&quot;`)}var B=class e extends Error{constructor(t,n){var r=`KaTeX parse error: `+t,i,a,o=n&&n.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?r+=` at end of input: `:r+=` at position `+(i+1)+`: `;var c=s.slice(i,a).replace(/[^]/g,`$&̲`),l=i>15?`…`+s.slice(i-15,i):s.slice(0,i),u=a+15<s.length?s.slice(a,a+15)+`…`:s.slice(a);r+=l+c+u}super(r),this.name=`ParseError`,this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,e.prototype),this.position=i,i!=null&&a!=null&&(this.length=a-i),this.rawMessage=t}},kB=/([A-Z])/g,AB=e=>e.replace(kB,`-$1`).toLowerCase(),jB={"&":`&amp;`,">":`&gt;`,"<":`&lt;`,'"':`&quot;`,"'":`&#x27;`},MB=/[&><"']/g,NB=e=>String(e).replace(MB,e=>jB[e]),PB=e=>e.type===`ordgroup`||e.type===`color`?e.body.length===1?PB(e.body[0]):e:e.type===`font`?PB(e.body):e,FB=new Set([`mathord`,`textord`,`atom`]),IB=e=>FB.has(PB(e).type),LB=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?t[2]!==`:`||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():`_relative`},RB={displayMode:{type:`boolean`,description:`Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.`,cli:`-d, --display-mode`},output:{type:{enum:[`htmlAndMathml`,`html`,`mathml`]},description:`Determines the markup language of the output.`,cli:`-F, --format <type>`},leqno:{type:`boolean`,description:`Render display math in leqno style (left-justified tags).`},fleqn:{type:`boolean`,description:`Render display math flush left.`},throwOnError:{type:`boolean`,default:!0,cli:`-t, --no-throw-on-error`,cliDescription:`Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error.`},errorColor:{type:`string`,default:`#cc0000`,cli:`-c, --error-color <color>`,cliDescription:`A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.`,cliProcessor:e=>`#`+e},macros:{type:`object`,cli:`-m, --macro <def>`,cliDescription:`Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).`,cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:`number`,description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:`--min-rule-thickness <size>`,cliProcessor:parseFloat},colorIsTextColor:{type:`boolean`,description:`Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.`,cli:`-b, --color-is-text-color`},strict:{type:[{enum:[`warn`,`ignore`,`error`]},`boolean`,`function`],description:`Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.`,cli:`-S, --strict`,cliDefault:!1},trust:{type:[`boolean`,`function`],description:`Trust the input, enabling all HTML features such as \\url.`,cli:`-T, --trust`},maxSize:{type:`number`,default:1/0,description:`If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large`,processor:e=>Math.max(0,e),cli:`-s, --max-size <n>`,cliProcessor:parseInt},maxExpand:{type:`number`,default:1e3,description:`Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.`,processor:e=>Math.max(0,e),cli:`-e, --max-expand <n>`,cliProcessor:e=>e===`Infinity`?1/0:parseInt(e)},globalGroup:{type:`boolean`,cli:!1}};function zB(e){if(typeof e!=`string`)return e.enum[0];switch(e){case`boolean`:return!1;case`string`:return``;case`number`:return 0;case`object`:return{};default:throw Error(`Unexpected schema type; settings must declare an explicit default.`)}}function BB(e){return Object.prototype.hasOwnProperty.call(e,`default`)&&e.default!==void 0?e.default:zB(Array.isArray(e.type)?e.type[0]:e.type)}function VB(e,t,n,r){var i=Object.prototype.hasOwnProperty.call(n,t)?n[t]:void 0,a=Object.prototype.hasOwnProperty.call(r,`processor`)?r.processor:void 0;e[t]=i===void 0?BB(r):a?a(i):i}var HB=class{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e||={};for(var t of Object.keys(RB)){var n=RB[t];n&&VB(this,t,e,n)}}isTrusted(e){if(`url`in e&&e.url&&!e.protocol){var t=LB(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},UB=class{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return QB[$B[this.id]]}sub(){return QB[eV[this.id]]}fracNum(){return QB[tV[this.id]]}fracDen(){return QB[nV[this.id]]}cramp(){return QB[rV[this.id]]}text(){return QB[iV[this.id]]}isTight(){return this.size>=2}},WB=0,GB=1,KB=2,qB=3,JB=4,YB=5,XB=6,ZB=7,QB=[new UB(WB,0,!1),new UB(GB,0,!0),new UB(KB,1,!1),new UB(qB,1,!0),new UB(JB,2,!1),new UB(YB,2,!0),new UB(XB,3,!1),new UB(ZB,3,!0)],$B=[JB,YB,JB,YB,XB,ZB,XB,ZB],eV=[YB,YB,YB,YB,ZB,ZB,ZB,ZB],tV=[KB,qB,JB,YB,XB,ZB,XB,ZB],nV=[qB,qB,YB,YB,ZB,ZB,ZB,ZB],rV=[GB,GB,qB,qB,YB,YB,ZB,ZB],iV=[WB,GB,KB,qB,KB,qB,KB,qB],aV={DISPLAY:QB[WB],TEXT:QB[KB],SCRIPT:QB[JB],SCRIPTSCRIPT:QB[XB]},oV=[{name:`latin`,blocks:[[256,591],[768,879]]},{name:`cyrillic`,blocks:[[1024,1279]]},{name:`armenian`,blocks:[[1328,1423]]},{name:`brahmic`,blocks:[[2304,4255]]},{name:`georgian`,blocks:[[4256,4351]]},{name:`cjk`,blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:`hangul`,blocks:[[44032,55215]]}];function sV(e){for(var t=0;t<oV.length;t++)for(var n=oV[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}var cV=[];oV.forEach(e=>e.blocks.forEach(e=>cV.push(...e)));function lV(e){for(var t=0;t<cV.length;t+=2)if(e>=cV[t]&&e<=cV[t+1])return!0;return!1}var uV=e=>e+` `+e,dV=80,fV=function(e,t){return`M95,`+(622+e+t)+`
130
- c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
131
- c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
132
- c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
133
- s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
134
- c69,-144,104.5,-217.7,106.5,-221
135
- l`+e/2.075+` -`+e+`
136
- c5.3,-9.3,12,-14,20,-14
137
- H400000v`+(40+e)+`H845.2724
138
- s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
139
- c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
140
- M`+(834+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},pV=function(e,t){return`M263,`+(601+e+t)+`c0.7,0,18,39.7,52,119
141
- c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
142
- c340,-704.7,510.7,-1060.3,512,-1067
143
- l`+e/2.084+` -`+e+`
144
- c4.7,-7.3,11,-11,19,-11
145
- H40000v`+(40+e)+`H1012.3
146
- s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
147
- c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
148
- s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
149
- c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
150
- M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},mV=function(e,t){return`M983 `+(10+e+t)+`
151
- l`+e/3.13+` -`+e+`
152
- c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
153
- H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
154
- s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
155
- c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
156
- c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
157
- c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
158
- c53.7,-170.3,84.5,-266.8,92.5,-289.5z
159
- M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},hV=function(e,t){return`M424,`+(2398+e+t)+`
160
- c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
161
- c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
162
- s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
163
- s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
164
- l`+e/4.223+` -`+e+`c4,-6.7,10,-10,18,-10 H400000
165
- v`+(40+e)+`H1014.6
166
- s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
167
- c-2,6,-10,9,-24,9
168
- c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+` `+t+`
169
- h400000v`+(40+e)+`h-400000z`},gV=function(e,t){return`M473,`+(2713+e+t)+`
170
- c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+` -`+e+`
171
- c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
172
- s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
173
- c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
174
- c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
175
- s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
176
- 606zM`+(1001+e)+` `+t+`h400000v`+(40+e)+`H1017.7z`},_V=function(e){var t=e/2;return`M400000 `+e+` H0 L`+t+` 0 l65 45 L145 `+(e-80)+` H400000z`},vV=function(e,t,n){var r=n-54-t-e;return`M702 `+(e+t)+`H400000`+(40+e)+`
177
- H742v`+r+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
178
- h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
179
- c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
180
- 219 661 l218 661zM702 `+t+`H400000v`+(40+e)+`H742z`},yV=function(e,t,n){t=1e3*t;var r=``;switch(e){case`sqrtMain`:r=fV(t,dV);break;case`sqrtSize1`:r=pV(t,dV);break;case`sqrtSize2`:r=mV(t,dV);break;case`sqrtSize3`:r=hV(t,dV);break;case`sqrtSize4`:r=gV(t,dV);break;case`sqrtTall`:r=vV(t,dV,n)}return r},bV=function(e,t){switch(e){case`⎜`:return uV(`M291 0 H417 V`+t+` H291z`);case`∣`:return uV(`M145 0 H188 V`+t+` H145z`);case`∥`:return uV(`M145 0 H188 V`+t+` H145z`)+uV(`M367 0 H410 V`+t+` H367z`);case`⎟`:return uV(`M457 0 H583 V`+t+` H457z`);case`⎢`:return uV(`M319 0 H403 V`+t+` H319z`);case`⎥`:return uV(`M263 0 H347 V`+t+` H263z`);case`⎪`:return uV(`M384 0 H504 V`+t+` H384z`);case`⏐`:return uV(`M312 0 H355 V`+t+` H312z`);case`‖`:return uV(`M257 0 H300 V`+t+` H257z`)+uV(`M478 0 H521 V`+t+` H478z`);default:return``}},xV={doubleleftarrow:`M262 157
181
- l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
182
- 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
183
- 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
184
- c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
185
- 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
186
- -86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
187
- -2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
188
- m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
189
- -10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
190
- 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
191
- -33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
192
- -17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
193
- -13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
194
- c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
195
- -107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
196
- 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
197
- -5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
198
- c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
199
- 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
200
- 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
201
- l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
202
- -45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
203
- 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
204
- 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
205
- 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
206
- -331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
207
- H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
208
- 435 0h399565z`,leftgroupunder:`M400000 262
209
- H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
210
- 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
211
- -3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
212
- -18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
213
- -196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
214
- 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
215
- -4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
216
- -10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
217
- m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
218
- 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
219
- 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
220
- -152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
221
- 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
222
- -2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
223
- v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
224
- -83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
225
- -68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
226
- 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:uV(`M40 281 V428 H0 V94 H40 V241 H400000 v40z`),leftbracketunder:uV(`M0 0 h120 V290 H399995 v120 H0z`),leftbracketover:uV(`M0 440 h120 V150 H399995 v-120 H0z`),leftmapsto:uV(`M40 281 V448H0V74H40V241H400000v40z`),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
227
- -.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
228
- c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
229
- 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:uV(`M0 50 h400000 v40H0z m0 194h40000v40H0z`),midbrace:`M200428 334
230
- c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
231
- -53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
232
- 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
233
- 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
234
- c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
235
- 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
236
- 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
237
- -5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
238
- -320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
239
- m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
240
- 60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
241
- -451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
242
- m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
243
- c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
244
- -480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
245
- m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
246
- 85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
247
- -707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
248
- m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
249
- c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
250
- -16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
251
- 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
252
- 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
253
- -40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
254
- -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
255
- 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
256
- -6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
257
- s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
258
- c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
259
- 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
260
- -174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
261
- 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
262
- 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
263
- -3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
264
- -10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
265
- 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
266
- -18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
267
- 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
268
- m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
269
- 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
270
- -7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
271
- -27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
272
- 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
273
- 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
274
- -64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
275
- m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
276
- 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
277
- -13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
278
- 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:uV(`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`),rightbracketunder:uV(`M399995 0 h-120 V290 H0 v120 H400000z`),rightbracketover:uV(`M399995 440 h-120 V150 H0 v-120 H399995z`),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
279
- 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
280
- -52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
281
- -167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
282
- 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
283
- -70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
284
- -40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
285
- -37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
286
- 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
287
- c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
288
- 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
289
- 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
290
- -19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
291
- 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
292
- -2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
293
- 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
294
- 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
295
- -68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
296
- -8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
297
- 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
298
- c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
299
- 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
300
- -11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
301
- 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
302
- 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
303
- -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
304
- -11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
305
- 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
306
- 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
307
- -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
308
- 3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
309
- 10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
310
- -1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
311
- -7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
312
- H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
313
- c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
314
- c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
315
- -11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
316
- -11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
317
- -11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
318
- -5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
319
- -11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
320
- -11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
321
- -11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
322
- c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
323
- c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
324
- s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
325
- 121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
326
- s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
327
- c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
328
- M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
329
- -27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
330
- 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
331
- -84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
332
- -119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
333
- -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
334
- 151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
335
- c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
336
- c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
337
- c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
338
- c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
339
- M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
340
- c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
341
- -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
342
- c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
343
- M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
344
- c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
345
- 1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
346
- -152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
347
- M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
348
- c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
349
- -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
350
- c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
351
- M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},SV=function(e,t){switch(e){case`lbrack`:return`M403 1759 V84 H666 V0 H319 V1759 v`+t+` v1759 v84 h347 v-84
352
- H403z M403 1759 V0 H319 V1759 v`+t+` v1759 v84 h84z`;case`rbrack`:return`M347 1759 V0 H0 V84 H263 V1759 v`+t+` v1759 H0 v84 H347z
353
- M347 1759 V0 H263 V1759 v`+t+` v1759 h84z`;case`vert`:return`M145 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
354
- c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
355
- c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z`;case`doublevert`:return`M145 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
356
- c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
357
- c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z
358
- M367 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
359
- c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
360
- c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+t+` v585 h43z`;case`lfloor`:return`M319 602 V0 H403 V602 v`+t+` v1715 h263 v84 H319z
361
- MM319 602 V0 H403 V602 v`+t+` v1715 H319z`;case`rfloor`:return`M319 602 V0 H403 V602 v`+t+` v1799 H0 v-84 H319z
362
- MM319 602 V0 H403 V602 v`+t+` v1715 H319z`;case`lceil`:return`M403 1759 V84 H666 V0 H319 V1759 v`+t+` v602 h84z
363
- M403 1759 V0 H319 V1759 v`+t+` v602 h84z`;case`rceil`:return`M347 1759 V0 H0 V84 H263 V1759 v`+t+` v602 h84z
364
- M347 1759 V0 h-84 V1759 v`+t+` v602 h84z`;case`lparen`:return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
365
- c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
366
- -36,557 l0,`+(t+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
367
- 949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
368
- c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
369
- -544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
370
- l0,-`+(t+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
371
- -210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case`rparen`:return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
372
- 63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
373
- c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(t+9)+`
374
- c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
375
- c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
376
- c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
377
- c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
378
- l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
379
- -470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw Error(`Unknown stretchy delimiter.`)}};function CV(e){return`toText`in e}var wV=class{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e=``,t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map(e=>{if(CV(e))return e.toText();throw Error(`Expected MathDomNode with toText, got `+e.constructor.name)}).join(``)}},TV={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},EV={ex:!0,em:!0,mu:!0},DV=function(e){return typeof e!=`string`&&(e=e.unit),e in TV||e in EV||e===`ex`},OV=function(e,t){var n;if(e.unit in TV)n=TV[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit===`mu`)n=t.fontMetrics().cssEmPerMu;else{var r=t.style.isTight()?t.havingStyle(t.style.text()):t;if(e.unit===`ex`)n=r.fontMetrics().xHeight;else if(e.unit===`em`)n=r.fontMetrics().quad;else throw new B(`Invalid unit: '`+e.unit+`'`);r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},V=function(e){return+e.toFixed(4)+`em`},kV=function(e){return e.filter(e=>e).join(` `)},AV=function(e){var t=``;for(var n of Object.keys(e)){var r=e[n];r!==void 0&&(t+=AB(n)+`:`+r+`;`)}return t},jV=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push(`mtight`);var r=t.getColor();r&&(this.style.color=r)}},MV=function(e){var t=document.createElement(e);t.className=kV(this.classes),Object.assign(t.style,this.style);for(var n of Object.keys(this.attributes))t.setAttribute(n,this.attributes[n]);for(var r=0;r<this.children.length;r++)t.appendChild(this.children[r].toNode());return t},NV=/[\s"'>/=\x00-\x1f]/,PV=function(e){var t=`<`+e;this.classes.length&&(t+=` class="`+NB(kV(this.classes))+`"`);var n=AV(this.style);n&&(t+=` style="`+NB(n)+`"`);for(var r of Object.keys(this.attributes)){if(NV.test(r))throw new B(`Invalid attribute name '`+r+`'`);t+=` `+r+`="`+NB(this.attributes[r])+`"`}t+=`>`;for(var i=0;i<this.children.length;i++)t+=this.children[i].toMarkup();return t+=`</`+e+`>`,t},FV=class{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,jV.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return MV.call(this,`span`)}toMarkup(){return PV.call(this,`span`)}},IV=class{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,jV.call(this,t,r),this.children=n||[],this.setAttribute(`href`,e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return MV.call(this,`a`)}toMarkup(){return PV.call(this,`a`)}},LV=class{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=[`mord`],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement(`img`);return e.src=this.src,e.alt=this.alt,e.className=`mord`,Object.assign(e.style,this.style),e}toMarkup(){var e=`<img src="`+NB(this.src)+`"`+(` alt="`+NB(this.alt)+`"`),t=AV(this.style);return t&&(e+=` style="`+NB(t)+`"`),e+=`'/>`,e}},RV={î:`ı̂`,ï:`ı̈`,í:`ı́`,ì:`ı̀`},zV=class{constructor(e,t,n,r,i,a,o,s){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=r||0,this.skew=i||0,this.width=a||0,this.classes=o||[],this.style=s||{},this.maxFontSize=0;var c=sV(this.text.charCodeAt(0));c&&this.classes.push(c+`_fallback`),/[îïíì]/.test(this.text)&&(this.text=RV[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;return this.italic>0&&(t=document.createElement(`span`),t.style.marginRight=V(this.italic)),this.classes.length>0&&(t||=document.createElement(`span`),t.className=kV(this.classes)),Object.keys(this.style).length>0&&(t||=document.createElement(`span`),Object.assign(t.style,this.style)),t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t=`<span`;this.classes.length&&(e=!0,t+=` class="`,t+=NB(kV(this.classes)),t+=`"`);var n=``;this.italic>0&&(n+=`margin-right:`+V(this.italic)+`;`),n+=AV(this.style),n&&(e=!0,t+=` style="`+NB(n)+`"`);var r=NB(this.text);return e?(t+=`>`,t+=r,t+=`</span>`,t):r}},BV=class{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e=`<svg xmlns="http://www.w3.org/2000/svg"`;for(var t of Object.keys(this.attributes))e+=` `+t+`="`+NB(this.attributes[t])+`"`;e+=`>`;for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+=`</svg>`,e}},VV=class{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return this.alternate?e.setAttribute(`d`,this.alternate):e.setAttribute(`d`,xV[this.pathName]),e}toMarkup(){return this.alternate?`<path d="`+NB(this.alternate)+`"/>`:`<path d="`+NB(xV[this.pathName])+`"/>`}},HV=class{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`line`);for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e=`<line`;for(var t of Object.keys(this.attributes))e+=` `+t+`="`+NB(this.attributes[t])+`"`;return e+=`/>`,e}};function UV(e){if(e instanceof zV)return e;throw Error(`Expected symbolNode but got `+String(e)+`.`)}function WV(e){if(e instanceof FV)return e;throw Error(`Expected span<HtmlDomNode> but got `+String(e)+`.`)}var GV=e=>e instanceof FV||e instanceof IV||e instanceof wV,KV={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},qV={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},JV={Å:`A`,Ð:`D`,Þ:`o`,å:`a`,ð:`d`,þ:`o`,А:`A`,Б:`B`,В:`B`,Г:`F`,Д:`A`,Е:`E`,Ж:`K`,З:`3`,И:`N`,Й:`N`,К:`K`,Л:`N`,М:`M`,Н:`H`,О:`O`,П:`N`,Р:`P`,С:`C`,Т:`T`,У:`y`,Ф:`O`,Х:`X`,Ц:`U`,Ч:`h`,Ш:`W`,Щ:`W`,Ъ:`B`,Ы:`X`,Ь:`B`,Э:`3`,Ю:`X`,Я:`R`,а:`a`,б:`b`,в:`a`,г:`r`,д:`y`,е:`e`,ж:`m`,з:`e`,и:`n`,й:`n`,к:`n`,л:`n`,м:`m`,н:`n`,о:`o`,п:`n`,р:`p`,с:`c`,т:`o`,у:`y`,ф:`b`,х:`x`,ц:`n`,ч:`n`,ш:`w`,щ:`w`,ъ:`a`,ы:`m`,ь:`a`,э:`e`,ю:`m`,я:`r`};function YV(e,t){KV[e]=t}function XV(e,t,n){if(!KV[t])throw Error(`Font metrics not found for font: `+t+`.`);var r=e.charCodeAt(0),i=KV[t][r];if(!i&&e[0]in JV&&(r=JV[e[0]].charCodeAt(0),i=KV[t][r]),!i&&n===`text`&&lV(r)&&(i=KV[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var ZV={};function QV(e){var t=e>=5?0:e>=3?1:2;if(!ZV[t]){var n=ZV[t]={cssEmPerMu:qV.quad[t]/18};for(var r of Object.keys(qV))n[r]=qV[r][t]}return ZV[t]}var $V={math:{},text:{}};function H(e,t,n,r,i,a){$V[e][i]={font:t,group:n,replace:r},a&&r&&($V[e][r]=$V[e][i])}var U=`math`,W=`text`,G=`main`,K=`ams`,eH=`accent-token`,q=`bin`,tH=`close`,nH=`inner`,rH=`mathord`,iH=`op-token`,aH=`open`,oH=`punct`,J=`rel`,sH=`spacing`,Y=`textord`;H(U,G,J,`≡`,`\\equiv`,!0),H(U,G,J,`≺`,`\\prec`,!0),H(U,G,J,`≻`,`\\succ`,!0),H(U,G,J,`∼`,`\\sim`,!0),H(U,G,J,`⊥`,`\\perp`),H(U,G,J,`⪯`,`\\preceq`,!0),H(U,G,J,`⪰`,`\\succeq`,!0),H(U,G,J,`≃`,`\\simeq`,!0),H(U,G,J,`∣`,`\\mid`,!0),H(U,G,J,`≪`,`\\ll`,!0),H(U,G,J,`≫`,`\\gg`,!0),H(U,G,J,`≍`,`\\asymp`,!0),H(U,G,J,`∥`,`\\parallel`),H(U,G,J,`⋈`,`\\bowtie`,!0),H(U,G,J,`⌣`,`\\smile`,!0),H(U,G,J,`⊑`,`\\sqsubseteq`,!0),H(U,G,J,`⊒`,`\\sqsupseteq`,!0),H(U,G,J,`≐`,`\\doteq`,!0),H(U,G,J,`⌢`,`\\frown`,!0),H(U,G,J,`∋`,`\\ni`,!0),H(U,G,J,`∝`,`\\propto`,!0),H(U,G,J,`⊢`,`\\vdash`,!0),H(U,G,J,`⊣`,`\\dashv`,!0),H(U,G,J,`∋`,`\\owns`),H(U,G,oH,`.`,`\\ldotp`),H(U,G,oH,`⋅`,`\\cdotp`),H(U,G,oH,`⋅`,`·`),H(W,G,Y,`⋅`,`·`),H(U,G,Y,`#`,`\\#`),H(W,G,Y,`#`,`\\#`),H(U,G,Y,`&`,`\\&`),H(W,G,Y,`&`,`\\&`),H(U,G,Y,`ℵ`,`\\aleph`,!0),H(U,G,Y,`∀`,`\\forall`,!0),H(U,G,Y,`ℏ`,`\\hbar`,!0),H(U,G,Y,`∃`,`\\exists`,!0),H(U,G,Y,`∇`,`\\nabla`,!0),H(U,G,Y,`♭`,`\\flat`,!0),H(U,G,Y,`ℓ`,`\\ell`,!0),H(U,G,Y,`♮`,`\\natural`,!0),H(U,G,Y,`♣`,`\\clubsuit`,!0),H(U,G,Y,`℘`,`\\wp`,!0),H(U,G,Y,`♯`,`\\sharp`,!0),H(U,G,Y,`♢`,`\\diamondsuit`,!0),H(U,G,Y,`ℜ`,`\\Re`,!0),H(U,G,Y,`♡`,`\\heartsuit`,!0),H(U,G,Y,`ℑ`,`\\Im`,!0),H(U,G,Y,`♠`,`\\spadesuit`,!0),H(U,G,Y,`§`,`\\S`,!0),H(W,G,Y,`§`,`\\S`),H(U,G,Y,`¶`,`\\P`,!0),H(W,G,Y,`¶`,`\\P`),H(U,G,Y,`†`,`\\dag`),H(W,G,Y,`†`,`\\dag`),H(W,G,Y,`†`,`\\textdagger`),H(U,G,Y,`‡`,`\\ddag`),H(W,G,Y,`‡`,`\\ddag`),H(W,G,Y,`‡`,`\\textdaggerdbl`),H(U,G,tH,`⎱`,`\\rmoustache`,!0),H(U,G,aH,`⎰`,`\\lmoustache`,!0),H(U,G,tH,`⟯`,`\\rgroup`,!0),H(U,G,aH,`⟮`,`\\lgroup`,!0),H(U,G,q,`∓`,`\\mp`,!0),H(U,G,q,`⊖`,`\\ominus`,!0),H(U,G,q,`⊎`,`\\uplus`,!0),H(U,G,q,`⊓`,`\\sqcap`,!0),H(U,G,q,`∗`,`\\ast`),H(U,G,q,`⊔`,`\\sqcup`,!0),H(U,G,q,`◯`,`\\bigcirc`,!0),H(U,G,q,`∙`,`\\bullet`,!0),H(U,G,q,`‡`,`\\ddagger`),H(U,G,q,`≀`,`\\wr`,!0),H(U,G,q,`⨿`,`\\amalg`),H(U,G,q,`&`,`\\And`),H(U,G,J,`⟵`,`\\longleftarrow`,!0),H(U,G,J,`⇐`,`\\Leftarrow`,!0),H(U,G,J,`⟸`,`\\Longleftarrow`,!0),H(U,G,J,`⟶`,`\\longrightarrow`,!0),H(U,G,J,`⇒`,`\\Rightarrow`,!0),H(U,G,J,`⟹`,`\\Longrightarrow`,!0),H(U,G,J,`↔`,`\\leftrightarrow`,!0),H(U,G,J,`⟷`,`\\longleftrightarrow`,!0),H(U,G,J,`⇔`,`\\Leftrightarrow`,!0),H(U,G,J,`⟺`,`\\Longleftrightarrow`,!0),H(U,G,J,`↦`,`\\mapsto`,!0),H(U,G,J,`⟼`,`\\longmapsto`,!0),H(U,G,J,`↗`,`\\nearrow`,!0),H(U,G,J,`↩`,`\\hookleftarrow`,!0),H(U,G,J,`↪`,`\\hookrightarrow`,!0),H(U,G,J,`↘`,`\\searrow`,!0),H(U,G,J,`↼`,`\\leftharpoonup`,!0),H(U,G,J,`⇀`,`\\rightharpoonup`,!0),H(U,G,J,`↙`,`\\swarrow`,!0),H(U,G,J,`↽`,`\\leftharpoondown`,!0),H(U,G,J,`⇁`,`\\rightharpoondown`,!0),H(U,G,J,`↖`,`\\nwarrow`,!0),H(U,G,J,`⇌`,`\\rightleftharpoons`,!0),H(U,K,J,`≮`,`\\nless`,!0),H(U,K,J,``,`\\@nleqslant`),H(U,K,J,``,`\\@nleqq`),H(U,K,J,`⪇`,`\\lneq`,!0),H(U,K,J,`≨`,`\\lneqq`,!0),H(U,K,J,``,`\\@lvertneqq`),H(U,K,J,`⋦`,`\\lnsim`,!0),H(U,K,J,`⪉`,`\\lnapprox`,!0),H(U,K,J,`⊀`,`\\nprec`,!0),H(U,K,J,`⋠`,`\\npreceq`,!0),H(U,K,J,`⋨`,`\\precnsim`,!0),H(U,K,J,`⪹`,`\\precnapprox`,!0),H(U,K,J,`≁`,`\\nsim`,!0),H(U,K,J,``,`\\@nshortmid`),H(U,K,J,`∤`,`\\nmid`,!0),H(U,K,J,`⊬`,`\\nvdash`,!0),H(U,K,J,`⊭`,`\\nvDash`,!0),H(U,K,J,`⋪`,`\\ntriangleleft`),H(U,K,J,`⋬`,`\\ntrianglelefteq`,!0),H(U,K,J,`⊊`,`\\subsetneq`,!0),H(U,K,J,``,`\\@varsubsetneq`),H(U,K,J,`⫋`,`\\subsetneqq`,!0),H(U,K,J,``,`\\@varsubsetneqq`),H(U,K,J,`≯`,`\\ngtr`,!0),H(U,K,J,``,`\\@ngeqslant`),H(U,K,J,``,`\\@ngeqq`),H(U,K,J,`⪈`,`\\gneq`,!0),H(U,K,J,`≩`,`\\gneqq`,!0),H(U,K,J,``,`\\@gvertneqq`),H(U,K,J,`⋧`,`\\gnsim`,!0),H(U,K,J,`⪊`,`\\gnapprox`,!0),H(U,K,J,`⊁`,`\\nsucc`,!0),H(U,K,J,`⋡`,`\\nsucceq`,!0),H(U,K,J,`⋩`,`\\succnsim`,!0),H(U,K,J,`⪺`,`\\succnapprox`,!0),H(U,K,J,`≆`,`\\ncong`,!0),H(U,K,J,``,`\\@nshortparallel`),H(U,K,J,`∦`,`\\nparallel`,!0),H(U,K,J,`⊯`,`\\nVDash`,!0),H(U,K,J,`⋫`,`\\ntriangleright`),H(U,K,J,`⋭`,`\\ntrianglerighteq`,!0),H(U,K,J,``,`\\@nsupseteqq`),H(U,K,J,`⊋`,`\\supsetneq`,!0),H(U,K,J,``,`\\@varsupsetneq`),H(U,K,J,`⫌`,`\\supsetneqq`,!0),H(U,K,J,``,`\\@varsupsetneqq`),H(U,K,J,`⊮`,`\\nVdash`,!0),H(U,K,J,`⪵`,`\\precneqq`,!0),H(U,K,J,`⪶`,`\\succneqq`,!0),H(U,K,J,``,`\\@nsubseteqq`),H(U,K,q,`⊴`,`\\unlhd`),H(U,K,q,`⊵`,`\\unrhd`),H(U,K,J,`↚`,`\\nleftarrow`,!0),H(U,K,J,`↛`,`\\nrightarrow`,!0),H(U,K,J,`⇍`,`\\nLeftarrow`,!0),H(U,K,J,`⇏`,`\\nRightarrow`,!0),H(U,K,J,`↮`,`\\nleftrightarrow`,!0),H(U,K,J,`⇎`,`\\nLeftrightarrow`,!0),H(U,K,J,`△`,`\\vartriangle`),H(U,K,Y,`ℏ`,`\\hslash`),H(U,K,Y,`▽`,`\\triangledown`),H(U,K,Y,`◊`,`\\lozenge`),H(U,K,Y,`Ⓢ`,`\\circledS`),H(U,K,Y,`®`,`\\circledR`),H(W,K,Y,`®`,`\\circledR`),H(U,K,Y,`∡`,`\\measuredangle`,!0),H(U,K,Y,`∄`,`\\nexists`),H(U,K,Y,`℧`,`\\mho`),H(U,K,Y,`Ⅎ`,`\\Finv`,!0),H(U,K,Y,`⅁`,`\\Game`,!0),H(U,K,Y,`‵`,`\\backprime`),H(U,K,Y,`▲`,`\\blacktriangle`),H(U,K,Y,`▼`,`\\blacktriangledown`),H(U,K,Y,`■`,`\\blacksquare`),H(U,K,Y,`⧫`,`\\blacklozenge`),H(U,K,Y,`★`,`\\bigstar`),H(U,K,Y,`∢`,`\\sphericalangle`,!0),H(U,K,Y,`∁`,`\\complement`,!0),H(U,K,Y,`ð`,`\\eth`,!0),H(W,G,Y,`ð`,`ð`),H(U,K,Y,`╱`,`\\diagup`),H(U,K,Y,`╲`,`\\diagdown`),H(U,K,Y,`□`,`\\square`),H(U,K,Y,`□`,`\\Box`),H(U,K,Y,`◊`,`\\Diamond`),H(U,K,Y,`¥`,`\\yen`,!0),H(W,K,Y,`¥`,`\\yen`,!0),H(U,K,Y,`✓`,`\\checkmark`,!0),H(W,K,Y,`✓`,`\\checkmark`),H(U,K,Y,`ℶ`,`\\beth`,!0),H(U,K,Y,`ℸ`,`\\daleth`,!0),H(U,K,Y,`ℷ`,`\\gimel`,!0),H(U,K,Y,`ϝ`,`\\digamma`,!0),H(U,K,Y,`ϰ`,`\\varkappa`),H(U,K,aH,`┌`,`\\@ulcorner`,!0),H(U,K,tH,`┐`,`\\@urcorner`,!0),H(U,K,aH,`└`,`\\@llcorner`,!0),H(U,K,tH,`┘`,`\\@lrcorner`,!0),H(U,K,J,`≦`,`\\leqq`,!0),H(U,K,J,`⩽`,`\\leqslant`,!0),H(U,K,J,`⪕`,`\\eqslantless`,!0),H(U,K,J,`≲`,`\\lesssim`,!0),H(U,K,J,`⪅`,`\\lessapprox`,!0),H(U,K,J,`≊`,`\\approxeq`,!0),H(U,K,q,`⋖`,`\\lessdot`),H(U,K,J,`⋘`,`\\lll`,!0),H(U,K,J,`≶`,`\\lessgtr`,!0),H(U,K,J,`⋚`,`\\lesseqgtr`,!0),H(U,K,J,`⪋`,`\\lesseqqgtr`,!0),H(U,K,J,`≑`,`\\doteqdot`),H(U,K,J,`≓`,`\\risingdotseq`,!0),H(U,K,J,`≒`,`\\fallingdotseq`,!0),H(U,K,J,`∽`,`\\backsim`,!0),H(U,K,J,`⋍`,`\\backsimeq`,!0),H(U,K,J,`⫅`,`\\subseteqq`,!0),H(U,K,J,`⋐`,`\\Subset`,!0),H(U,K,J,`⊏`,`\\sqsubset`,!0),H(U,K,J,`≼`,`\\preccurlyeq`,!0),H(U,K,J,`⋞`,`\\curlyeqprec`,!0),H(U,K,J,`≾`,`\\precsim`,!0),H(U,K,J,`⪷`,`\\precapprox`,!0),H(U,K,J,`⊲`,`\\vartriangleleft`),H(U,K,J,`⊴`,`\\trianglelefteq`),H(U,K,J,`⊨`,`\\vDash`,!0),H(U,K,J,`⊪`,`\\Vvdash`,!0),H(U,K,J,`⌣`,`\\smallsmile`),H(U,K,J,`⌢`,`\\smallfrown`),H(U,K,J,`≏`,`\\bumpeq`,!0),H(U,K,J,`≎`,`\\Bumpeq`,!0),H(U,K,J,`≧`,`\\geqq`,!0),H(U,K,J,`⩾`,`\\geqslant`,!0),H(U,K,J,`⪖`,`\\eqslantgtr`,!0),H(U,K,J,`≳`,`\\gtrsim`,!0),H(U,K,J,`⪆`,`\\gtrapprox`,!0),H(U,K,q,`⋗`,`\\gtrdot`),H(U,K,J,`⋙`,`\\ggg`,!0),H(U,K,J,`≷`,`\\gtrless`,!0),H(U,K,J,`⋛`,`\\gtreqless`,!0),H(U,K,J,`⪌`,`\\gtreqqless`,!0),H(U,K,J,`≖`,`\\eqcirc`,!0),H(U,K,J,`≗`,`\\circeq`,!0),H(U,K,J,`≜`,`\\triangleq`,!0),H(U,K,J,`∼`,`\\thicksim`),H(U,K,J,`≈`,`\\thickapprox`),H(U,K,J,`⫆`,`\\supseteqq`,!0),H(U,K,J,`⋑`,`\\Supset`,!0),H(U,K,J,`⊐`,`\\sqsupset`,!0),H(U,K,J,`≽`,`\\succcurlyeq`,!0),H(U,K,J,`⋟`,`\\curlyeqsucc`,!0),H(U,K,J,`≿`,`\\succsim`,!0),H(U,K,J,`⪸`,`\\succapprox`,!0),H(U,K,J,`⊳`,`\\vartriangleright`),H(U,K,J,`⊵`,`\\trianglerighteq`),H(U,K,J,`⊩`,`\\Vdash`,!0),H(U,K,J,`∣`,`\\shortmid`),H(U,K,J,`∥`,`\\shortparallel`),H(U,K,J,`≬`,`\\between`,!0),H(U,K,J,`⋔`,`\\pitchfork`,!0),H(U,K,J,`∝`,`\\varpropto`),H(U,K,J,`◀`,`\\blacktriangleleft`),H(U,K,J,`∴`,`\\therefore`,!0),H(U,K,J,`∍`,`\\backepsilon`),H(U,K,J,`▶`,`\\blacktriangleright`),H(U,K,J,`∵`,`\\because`,!0),H(U,K,J,`⋘`,`\\llless`),H(U,K,J,`⋙`,`\\gggtr`),H(U,K,q,`⊲`,`\\lhd`),H(U,K,q,`⊳`,`\\rhd`),H(U,K,J,`≂`,`\\eqsim`,!0),H(U,G,J,`⋈`,`\\Join`),H(U,K,J,`≑`,`\\Doteq`,!0),H(U,K,q,`∔`,`\\dotplus`,!0),H(U,K,q,`∖`,`\\smallsetminus`),H(U,K,q,`⋒`,`\\Cap`,!0),H(U,K,q,`⋓`,`\\Cup`,!0),H(U,K,q,`⩞`,`\\doublebarwedge`,!0),H(U,K,q,`⊟`,`\\boxminus`,!0),H(U,K,q,`⊞`,`\\boxplus`,!0),H(U,K,q,`⋇`,`\\divideontimes`,!0),H(U,K,q,`⋉`,`\\ltimes`,!0),H(U,K,q,`⋊`,`\\rtimes`,!0),H(U,K,q,`⋋`,`\\leftthreetimes`,!0),H(U,K,q,`⋌`,`\\rightthreetimes`,!0),H(U,K,q,`⋏`,`\\curlywedge`,!0),H(U,K,q,`⋎`,`\\curlyvee`,!0),H(U,K,q,`⊝`,`\\circleddash`,!0),H(U,K,q,`⊛`,`\\circledast`,!0),H(U,K,q,`⋅`,`\\centerdot`),H(U,K,q,`⊺`,`\\intercal`,!0),H(U,K,q,`⋒`,`\\doublecap`),H(U,K,q,`⋓`,`\\doublecup`),H(U,K,q,`⊠`,`\\boxtimes`,!0),H(U,K,J,`⇢`,`\\dashrightarrow`,!0),H(U,K,J,`⇠`,`\\dashleftarrow`,!0),H(U,K,J,`⇇`,`\\leftleftarrows`,!0),H(U,K,J,`⇆`,`\\leftrightarrows`,!0),H(U,K,J,`⇚`,`\\Lleftarrow`,!0),H(U,K,J,`↞`,`\\twoheadleftarrow`,!0),H(U,K,J,`↢`,`\\leftarrowtail`,!0),H(U,K,J,`↫`,`\\looparrowleft`,!0),H(U,K,J,`⇋`,`\\leftrightharpoons`,!0),H(U,K,J,`↶`,`\\curvearrowleft`,!0),H(U,K,J,`↺`,`\\circlearrowleft`,!0),H(U,K,J,`↰`,`\\Lsh`,!0),H(U,K,J,`⇈`,`\\upuparrows`,!0),H(U,K,J,`↿`,`\\upharpoonleft`,!0),H(U,K,J,`⇃`,`\\downharpoonleft`,!0),H(U,G,J,`⊶`,`\\origof`,!0),H(U,G,J,`⊷`,`\\imageof`,!0),H(U,K,J,`⊸`,`\\multimap`,!0),H(U,K,J,`↭`,`\\leftrightsquigarrow`,!0),H(U,K,J,`⇉`,`\\rightrightarrows`,!0),H(U,K,J,`⇄`,`\\rightleftarrows`,!0),H(U,K,J,`↠`,`\\twoheadrightarrow`,!0),H(U,K,J,`↣`,`\\rightarrowtail`,!0),H(U,K,J,`↬`,`\\looparrowright`,!0),H(U,K,J,`↷`,`\\curvearrowright`,!0),H(U,K,J,`↻`,`\\circlearrowright`,!0),H(U,K,J,`↱`,`\\Rsh`,!0),H(U,K,J,`⇊`,`\\downdownarrows`,!0),H(U,K,J,`↾`,`\\upharpoonright`,!0),H(U,K,J,`⇂`,`\\downharpoonright`,!0),H(U,K,J,`⇝`,`\\rightsquigarrow`,!0),H(U,K,J,`⇝`,`\\leadsto`),H(U,K,J,`⇛`,`\\Rrightarrow`,!0),H(U,K,J,`↾`,`\\restriction`),H(U,G,Y,`‘`,"`"),H(U,G,Y,`$`,`\\$`),H(W,G,Y,`$`,`\\$`),H(W,G,Y,`$`,`\\textdollar`),H(U,G,Y,`%`,`\\%`),H(W,G,Y,`%`,`\\%`),H(U,G,Y,`_`,`\\_`),H(W,G,Y,`_`,`\\_`),H(W,G,Y,`_`,`\\textunderscore`),H(U,G,Y,`∠`,`\\angle`,!0),H(U,G,Y,`∞`,`\\infty`,!0),H(U,G,Y,`′`,`\\prime`),H(U,G,Y,`△`,`\\triangle`),H(U,G,Y,`Γ`,`\\Gamma`,!0),H(U,G,Y,`Δ`,`\\Delta`,!0),H(U,G,Y,`Θ`,`\\Theta`,!0),H(U,G,Y,`Λ`,`\\Lambda`,!0),H(U,G,Y,`Ξ`,`\\Xi`,!0),H(U,G,Y,`Π`,`\\Pi`,!0),H(U,G,Y,`Σ`,`\\Sigma`,!0),H(U,G,Y,`Υ`,`\\Upsilon`,!0),H(U,G,Y,`Φ`,`\\Phi`,!0),H(U,G,Y,`Ψ`,`\\Psi`,!0),H(U,G,Y,`Ω`,`\\Omega`,!0),H(U,G,Y,`A`,`Α`),H(U,G,Y,`B`,`Β`),H(U,G,Y,`E`,`Ε`),H(U,G,Y,`Z`,`Ζ`),H(U,G,Y,`H`,`Η`),H(U,G,Y,`I`,`Ι`),H(U,G,Y,`K`,`Κ`),H(U,G,Y,`M`,`Μ`),H(U,G,Y,`N`,`Ν`),H(U,G,Y,`O`,`Ο`),H(U,G,Y,`P`,`Ρ`),H(U,G,Y,`T`,`Τ`),H(U,G,Y,`X`,`Χ`),H(U,G,Y,`¬`,`\\neg`,!0),H(U,G,Y,`¬`,`\\lnot`),H(U,G,Y,`⊤`,`\\top`),H(U,G,Y,`⊥`,`\\bot`),H(U,G,Y,`∅`,`\\emptyset`),H(U,K,Y,`∅`,`\\varnothing`),H(U,G,rH,`α`,`\\alpha`,!0),H(U,G,rH,`β`,`\\beta`,!0),H(U,G,rH,`γ`,`\\gamma`,!0),H(U,G,rH,`δ`,`\\delta`,!0),H(U,G,rH,`ϵ`,`\\epsilon`,!0),H(U,G,rH,`ζ`,`\\zeta`,!0),H(U,G,rH,`η`,`\\eta`,!0),H(U,G,rH,`θ`,`\\theta`,!0),H(U,G,rH,`ι`,`\\iota`,!0),H(U,G,rH,`κ`,`\\kappa`,!0),H(U,G,rH,`λ`,`\\lambda`,!0),H(U,G,rH,`μ`,`\\mu`,!0),H(U,G,rH,`ν`,`\\nu`,!0),H(U,G,rH,`ξ`,`\\xi`,!0),H(U,G,rH,`ο`,`\\omicron`,!0),H(U,G,rH,`π`,`\\pi`,!0),H(U,G,rH,`ρ`,`\\rho`,!0),H(U,G,rH,`σ`,`\\sigma`,!0),H(U,G,rH,`τ`,`\\tau`,!0),H(U,G,rH,`υ`,`\\upsilon`,!0),H(U,G,rH,`ϕ`,`\\phi`,!0),H(U,G,rH,`χ`,`\\chi`,!0),H(U,G,rH,`ψ`,`\\psi`,!0),H(U,G,rH,`ω`,`\\omega`,!0),H(U,G,rH,`ε`,`\\varepsilon`,!0),H(U,G,rH,`ϑ`,`\\vartheta`,!0),H(U,G,rH,`ϖ`,`\\varpi`,!0),H(U,G,rH,`ϱ`,`\\varrho`,!0),H(U,G,rH,`ς`,`\\varsigma`,!0),H(U,G,rH,`φ`,`\\varphi`,!0),H(U,G,q,`∗`,`*`,!0),H(U,G,q,`+`,`+`),H(U,G,q,`−`,`-`,!0),H(U,G,q,`⋅`,`\\cdot`,!0),H(U,G,q,`∘`,`\\circ`,!0),H(U,G,q,`÷`,`\\div`,!0),H(U,G,q,`±`,`\\pm`,!0),H(U,G,q,`×`,`\\times`,!0),H(U,G,q,`∩`,`\\cap`,!0),H(U,G,q,`∪`,`\\cup`,!0),H(U,G,q,`∖`,`\\setminus`,!0),H(U,G,q,`∧`,`\\land`),H(U,G,q,`∨`,`\\lor`),H(U,G,q,`∧`,`\\wedge`,!0),H(U,G,q,`∨`,`\\vee`,!0),H(U,G,Y,`√`,`\\surd`),H(U,G,aH,`⟨`,`\\langle`,!0),H(U,G,aH,`∣`,`\\lvert`),H(U,G,aH,`∥`,`\\lVert`),H(U,G,tH,`?`,`?`),H(U,G,tH,`!`,`!`),H(U,G,tH,`⟩`,`\\rangle`,!0),H(U,G,tH,`∣`,`\\rvert`),H(U,G,tH,`∥`,`\\rVert`),H(U,G,J,`=`,`=`),H(U,G,J,`:`,`:`),H(U,G,J,`≈`,`\\approx`,!0),H(U,G,J,`≅`,`\\cong`,!0),H(U,G,J,`≥`,`\\ge`),H(U,G,J,`≥`,`\\geq`,!0),H(U,G,J,`←`,`\\gets`),H(U,G,J,`>`,`\\gt`,!0),H(U,G,J,`∈`,`\\in`,!0),H(U,G,J,``,`\\@not`),H(U,G,J,`⊂`,`\\subset`,!0),H(U,G,J,`⊃`,`\\supset`,!0),H(U,G,J,`⊆`,`\\subseteq`,!0),H(U,G,J,`⊇`,`\\supseteq`,!0),H(U,K,J,`⊈`,`\\nsubseteq`,!0),H(U,K,J,`⊉`,`\\nsupseteq`,!0),H(U,G,J,`⊨`,`\\models`),H(U,G,J,`←`,`\\leftarrow`,!0),H(U,G,J,`≤`,`\\le`),H(U,G,J,`≤`,`\\leq`,!0),H(U,G,J,`<`,`\\lt`,!0),H(U,G,J,`→`,`\\rightarrow`,!0),H(U,G,J,`→`,`\\to`),H(U,K,J,`≱`,`\\ngeq`,!0),H(U,K,J,`≰`,`\\nleq`,!0),H(U,G,sH,`\xA0`,`\\ `),H(U,G,sH,`\xA0`,`\\space`),H(U,G,sH,`\xA0`,`\\nobreakspace`),H(W,G,sH,`\xA0`,`\\ `),H(W,G,sH,`\xA0`,` `),H(W,G,sH,`\xA0`,`\\space`),H(W,G,sH,`\xA0`,`\\nobreakspace`),H(U,G,sH,``,`\\nobreak`),H(U,G,sH,``,`\\allowbreak`),H(U,G,oH,`,`,`,`),H(U,G,oH,`;`,`;`),H(U,K,q,`⊼`,`\\barwedge`,!0),H(U,K,q,`⊻`,`\\veebar`,!0),H(U,G,q,`⊙`,`\\odot`,!0),H(U,G,q,`⊕`,`\\oplus`,!0),H(U,G,q,`⊗`,`\\otimes`,!0),H(U,G,Y,`∂`,`\\partial`,!0),H(U,G,q,`⊘`,`\\oslash`,!0),H(U,K,q,`⊚`,`\\circledcirc`,!0),H(U,K,q,`⊡`,`\\boxdot`,!0),H(U,G,q,`△`,`\\bigtriangleup`),H(U,G,q,`▽`,`\\bigtriangledown`),H(U,G,q,`†`,`\\dagger`),H(U,G,q,`⋄`,`\\diamond`),H(U,G,q,`⋆`,`\\star`),H(U,G,q,`◃`,`\\triangleleft`),H(U,G,q,`▹`,`\\triangleright`),H(U,G,aH,`{`,`\\{`),H(W,G,Y,`{`,`\\{`),H(W,G,Y,`{`,`\\textbraceleft`),H(U,G,tH,`}`,`\\}`),H(W,G,Y,`}`,`\\}`),H(W,G,Y,`}`,`\\textbraceright`),H(U,G,aH,`{`,`\\lbrace`),H(U,G,tH,`}`,`\\rbrace`),H(U,G,aH,`[`,`\\lbrack`,!0),H(W,G,Y,`[`,`\\lbrack`,!0),H(U,G,tH,`]`,`\\rbrack`,!0),H(W,G,Y,`]`,`\\rbrack`,!0),H(U,G,aH,`(`,`\\lparen`,!0),H(U,G,tH,`)`,`\\rparen`,!0),H(W,G,Y,`<`,`\\textless`,!0),H(W,G,Y,`>`,`\\textgreater`,!0),H(U,G,aH,`⌊`,`\\lfloor`,!0),H(U,G,tH,`⌋`,`\\rfloor`,!0),H(U,G,aH,`⌈`,`\\lceil`,!0),H(U,G,tH,`⌉`,`\\rceil`,!0),H(U,G,Y,`\\`,`\\backslash`),H(U,G,Y,`∣`,`|`),H(U,G,Y,`∣`,`\\vert`),H(W,G,Y,`|`,`\\textbar`,!0),H(U,G,Y,`∥`,`\\|`),H(U,G,Y,`∥`,`\\Vert`),H(W,G,Y,`∥`,`\\textbardbl`),H(W,G,Y,`~`,`\\textasciitilde`),H(W,G,Y,`\\`,`\\textbackslash`),H(W,G,Y,`^`,`\\textasciicircum`),H(U,G,J,`↑`,`\\uparrow`,!0),H(U,G,J,`⇑`,`\\Uparrow`,!0),H(U,G,J,`↓`,`\\downarrow`,!0),H(U,G,J,`⇓`,`\\Downarrow`,!0),H(U,G,J,`↕`,`\\updownarrow`,!0),H(U,G,J,`⇕`,`\\Updownarrow`,!0),H(U,G,iH,`∐`,`\\coprod`),H(U,G,iH,`⋁`,`\\bigvee`),H(U,G,iH,`⋀`,`\\bigwedge`),H(U,G,iH,`⨄`,`\\biguplus`),H(U,G,iH,`⋂`,`\\bigcap`),H(U,G,iH,`⋃`,`\\bigcup`),H(U,G,iH,`∫`,`\\int`),H(U,G,iH,`∫`,`\\intop`),H(U,G,iH,`∬`,`\\iint`),H(U,G,iH,`∭`,`\\iiint`),H(U,G,iH,`∏`,`\\prod`),H(U,G,iH,`∑`,`\\sum`),H(U,G,iH,`⨂`,`\\bigotimes`),H(U,G,iH,`⨁`,`\\bigoplus`),H(U,G,iH,`⨀`,`\\bigodot`),H(U,G,iH,`∮`,`\\oint`),H(U,G,iH,`∯`,`\\oiint`),H(U,G,iH,`∰`,`\\oiiint`),H(U,G,iH,`⨆`,`\\bigsqcup`),H(U,G,iH,`∫`,`\\smallint`),H(W,G,nH,`…`,`\\textellipsis`),H(U,G,nH,`…`,`\\mathellipsis`),H(W,G,nH,`…`,`\\ldots`,!0),H(U,G,nH,`…`,`\\ldots`,!0),H(U,G,nH,`⋯`,`\\@cdots`,!0),H(U,G,nH,`⋱`,`\\ddots`,!0),H(U,G,Y,`⋮`,`\\varvdots`),H(W,G,Y,`⋮`,`\\varvdots`),H(U,G,eH,`ˊ`,`\\acute`),H(U,G,eH,`ˋ`,`\\grave`),H(U,G,eH,`¨`,`\\ddot`),H(U,G,eH,`~`,`\\tilde`),H(U,G,eH,`ˉ`,`\\bar`),H(U,G,eH,`˘`,`\\breve`),H(U,G,eH,`ˇ`,`\\check`),H(U,G,eH,`^`,`\\hat`),H(U,G,eH,`⃗`,`\\vec`),H(U,G,eH,`˙`,`\\dot`),H(U,G,eH,`˚`,`\\mathring`),H(U,G,rH,``,`\\@imath`),H(U,G,rH,``,`\\@jmath`),H(U,G,Y,`ı`,`ı`),H(U,G,Y,`ȷ`,`ȷ`),H(W,G,Y,`ı`,`\\i`,!0),H(W,G,Y,`ȷ`,`\\j`,!0),H(W,G,Y,`ß`,`\\ss`,!0),H(W,G,Y,`æ`,`\\ae`,!0),H(W,G,Y,`œ`,`\\oe`,!0),H(W,G,Y,`ø`,`\\o`,!0),H(W,G,Y,`Æ`,`\\AE`,!0),H(W,G,Y,`Œ`,`\\OE`,!0),H(W,G,Y,`Ø`,`\\O`,!0),H(W,G,eH,`ˊ`,`\\'`),H(W,G,eH,`ˋ`,"\\`"),H(W,G,eH,`ˆ`,`\\^`),H(W,G,eH,`˜`,`\\~`),H(W,G,eH,`ˉ`,`\\=`),H(W,G,eH,`˘`,`\\u`),H(W,G,eH,`˙`,`\\.`),H(W,G,eH,`¸`,`\\c`),H(W,G,eH,`˚`,`\\r`),H(W,G,eH,`ˇ`,`\\v`),H(W,G,eH,`¨`,`\\"`),H(W,G,eH,`˝`,`\\H`),H(W,G,eH,`◯`,`\\textcircled`);var cH={"--":!0,"---":!0,"``":!0,"''":!0};H(W,G,Y,`–`,`--`,!0),H(W,G,Y,`–`,`\\textendash`),H(W,G,Y,`—`,`---`,!0),H(W,G,Y,`—`,`\\textemdash`),H(W,G,Y,`‘`,"`",!0),H(W,G,Y,`‘`,`\\textquoteleft`),H(W,G,Y,`’`,`'`,!0),H(W,G,Y,`’`,`\\textquoteright`),H(W,G,Y,`“`,"``",!0),H(W,G,Y,`“`,`\\textquotedblleft`),H(W,G,Y,`”`,`''`,!0),H(W,G,Y,`”`,`\\textquotedblright`),H(U,G,Y,`°`,`\\degree`,!0),H(W,G,Y,`°`,`\\degree`),H(W,G,Y,`°`,`\\textdegree`,!0),H(U,G,Y,`£`,`\\pounds`),H(U,G,Y,`£`,`\\mathsterling`,!0),H(W,G,Y,`£`,`\\pounds`),H(W,G,Y,`£`,`\\textsterling`,!0),H(U,K,Y,`✠`,`\\maltese`),H(W,K,Y,`✠`,`\\maltese`);for(var lH=`0123456789/@."`,uH=0;uH<lH.length;uH++){var dH=lH.charAt(uH);H(U,G,Y,dH,dH)}for(var fH=`0123456789!@*()-=+";:?/.,`,pH=0;pH<fH.length;pH++){var mH=fH.charAt(pH);H(W,G,Y,mH,mH)}for(var hH=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,gH=0;gH<hH.length;gH++){var _H=hH.charAt(gH);H(U,G,rH,_H,_H),H(W,G,Y,_H,_H)}H(U,K,Y,`C`,`ℂ`),H(W,K,Y,`C`,`ℂ`),H(U,K,Y,`H`,`ℍ`),H(W,K,Y,`H`,`ℍ`),H(U,K,Y,`N`,`ℕ`),H(W,K,Y,`N`,`ℕ`),H(U,K,Y,`P`,`ℙ`),H(W,K,Y,`P`,`ℙ`),H(U,K,Y,`Q`,`ℚ`),H(W,K,Y,`Q`,`ℚ`),H(U,K,Y,`R`,`ℝ`),H(W,K,Y,`R`,`ℝ`),H(U,K,Y,`Z`,`ℤ`),H(W,K,Y,`Z`,`ℤ`),H(U,G,rH,`h`,`ℎ`),H(W,G,rH,`h`,`ℎ`);for(var vH,yH=0;yH<hH.length;yH++){var bH=hH.charAt(yH);vH=String.fromCharCode(55349,56320+yH),H(U,G,rH,bH,vH),H(W,G,Y,bH,vH),vH=String.fromCharCode(55349,56372+yH),H(U,G,rH,bH,vH),H(W,G,Y,bH,vH),vH=String.fromCharCode(55349,56424+yH),H(U,G,rH,bH,vH),H(W,G,Y,bH,vH),vH=String.fromCharCode(55349,56580+yH),H(U,G,rH,bH,vH),H(W,G,Y,bH,vH),vH=String.fromCharCode(55349,56684+yH),H(U,G,rH,bH,vH),H(W,G,Y,bH,vH),vH=String.fromCharCode(55349,56736+yH),H(U,G,rH,bH,vH),H(W,G,Y,bH,vH),vH=String.fromCharCode(55349,56788+yH),H(U,G,rH,bH,vH),H(W,G,Y,bH,vH),vH=String.fromCharCode(55349,56840+yH),H(U,G,rH,bH,vH),H(W,G,Y,bH,vH),vH=String.fromCharCode(55349,56944+yH),H(U,G,rH,bH,vH),H(W,G,Y,bH,vH),yH<26&&(vH=String.fromCharCode(55349,56632+yH),H(U,G,rH,bH,vH),H(W,G,Y,bH,vH),vH=String.fromCharCode(55349,56476+yH),H(U,G,rH,bH,vH),H(W,G,Y,bH,vH))}vH=String.fromCharCode(55349,56668),H(U,G,rH,`k`,vH),H(W,G,Y,`k`,vH);for(var xH=0;xH<10;xH++){var SH=xH.toString();vH=String.fromCharCode(55349,57294+xH),H(U,G,rH,SH,vH),H(W,G,Y,SH,vH),vH=String.fromCharCode(55349,57314+xH),H(U,G,rH,SH,vH),H(W,G,Y,SH,vH),vH=String.fromCharCode(55349,57324+xH),H(U,G,rH,SH,vH),H(W,G,Y,SH,vH),vH=String.fromCharCode(55349,57334+xH),H(U,G,rH,SH,vH),H(W,G,Y,SH,vH)}for(var CH=`ÐÞþ`,wH=0;wH<CH.length;wH++){var TH=CH.charAt(wH);H(U,G,rH,TH,TH),H(W,G,Y,TH,TH)}var EH={mathClass:`mathbf`,textClass:`textbf`,font:`Main-Bold`},DH={mathClass:`mathnormal`,textClass:`textit`,font:`Math-Italic`},OH={mathClass:`boldsymbol`,textClass:`boldsymbol`,font:`Main-BoldItalic`},kH={mathClass:`mathscr`,textClass:`textscr`,font:`Script-Regular`},AH={mathClass:``,textClass:``,font:``},jH={mathClass:`mathfrak`,textClass:`textfrak`,font:`Fraktur-Regular`},MH={mathClass:`mathbb`,textClass:`textbb`,font:`AMS-Regular`},NH={mathClass:`mathboldfrak`,textClass:`textboldfrak`,font:`Fraktur-Regular`},PH={mathClass:`mathsf`,textClass:`textsf`,font:`SansSerif-Regular`},FH={mathClass:`mathboldsf`,textClass:`textboldsf`,font:`SansSerif-Bold`},IH={mathClass:`mathitsf`,textClass:`textitsf`,font:`SansSerif-Italic`},LH={mathClass:`mathtt`,textClass:`texttt`,font:`Typewriter-Regular`},RH=[EH,EH,DH,DH,OH,OH,kH,AH,AH,AH,jH,jH,MH,MH,NH,NH,PH,PH,FH,FH,IH,IH,AH,AH,LH,LH],zH=[EH,AH,PH,FH,LH],BH=e=>{var t=e.charCodeAt(0),n=e.charCodeAt(1),r=(t-55296)*1024+(n-56320)+65536;if(119808<=r&&r<120484)return RH[Math.floor((r-119808)/26)];if(120782<=r&&r<=120831)return zH[Math.floor((r-120782)/10)];if(r===120485||r===120486)return RH[0];if(120486<r&&r<120782)return AH;throw new B(`Unsupported character: `+e)};function VH(e){var t=e.strict,n=e.errorCode,r=e.errorMsg,i=e.token,a=e.report,o=t;if(typeof t==`function`){if(a)o=t(n,r,i);else try{o=t(n,r,i)}catch{o=`error`}}switch(o){case!0:case`error`:if(a)throw new B(`LaTeX-incompatible input and strict mode is set to 'error': `+(r+` [`+n+`]`),i);return!0;case!1:case`ignore`:if(!a)return!1;break;default:if(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(r+` [`+n+`]`)),!a)return!1}}var HH=function(e,t,n){if($V[n][e]){var r=$V[n][e].replace;r&&(e=r)}return{value:e,metrics:XV(e,t,n)}},UH=function(e,t,n,r,i){var a=HH(e,t,n),o=a.metrics;e=a.value;var s;if(o){var c=o.italic;(n===`text`||r&&r.font===`mathit`)&&(c=0),s=new zV(e,o.height,o.depth,c,o.skew,o.width,i)}else VH({strict:r.strict,errorCode:`symbolNotInFont`,errorMsg:`No character metrics for '`+e+`' in style '`+t+`' and mode '`+n+`'`,report:!0}),s=new zV(e,0,0,0,0,0,i);s.maxFontSize=r.sizeMultiplier,r.style.isTight()&&s.classes.push(`mtight`);var l=r.getColor();return l&&(s.style.color=l),s},WH=function(e,t,n,r){return r===void 0&&(r=[]),n.font===`boldsymbol`&&HH(e,`Main-Bold`,t).metrics?UH(e,`Main-Bold`,t,n,r.concat([`mathbf`])):e===`\\`||$V[t][e].font===`main`?UH(e,`Main-Regular`,t,n,r):UH(e,`AMS-Regular`,t,n,r.concat([`amsrm`]))},GH=function(e,t,n){return n!==`textord`&&HH(e,`Math-BoldItalic`,t).metrics?{fontName:`Math-BoldItalic`,fontClass:`boldsymbol`}:{fontName:`Main-Bold`,fontClass:`mathbf`}},KH=function(e,t){var n=e.type===`mathord`?`mathord`:`textord`,r=e.mode,i=e.text,a=[`mord`],o=t.font,s=t.fontFamily,c=t.fontWeight,l=t.fontShape,u=r===`math`||r===`text`&&!!o,d=u?o:s,f=``,p=``;if(i.charCodeAt(0)===55349){var m=BH(i);f=m.font,p=m[r+`Class`]}if(f)return UH(i,f,r,t,a.concat(p));if(d){var h,g;if(d===`boldsymbol`){var _=GH(i,r,n);h=_.fontName,g=[_.fontClass]}else u?(h=aU[o].fontName,g=[o]):(h=iU(s,c,l),g=[s,c,l]);if(HH(i,h,r).metrics)return UH(i,h,r,t,a.concat(g));if(Object.prototype.hasOwnProperty.call(cH,i)&&h.slice(0,10)===`Typewriter`){for(var v=[],y=0;y<i.length;y++)v.push(UH(i[y],h,r,t,a.concat(g)));return $H(v)}}if(n===`mathord`)return UH(i,`Math-Italic`,r,t,a.concat([`mathnormal`]));if(n===`textord`){var b=$V[r][i]&&$V[r][i].font;if(b===`ams`)return UH(i,iU(`amsrm`,c,l),r,t,a.concat(`amsrm`,c,l));if(b===`main`||!b)return UH(i,iU(`textrm`,c,l),r,t,a.concat(c,l));var x=iU(b,c,l);return UH(i,x,r,t,a.concat(x,c,l))}throw Error(`unexpected type: `+n+` in makeOrd`)},qH=(e,t)=>{if(kV(e.classes)!==kV(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||e.italic!==0&&e.hasClass(`mathnormal`))return!1;if(e.classes.length===1){var n=e.classes[0];if(n===`mbin`||n===`mord`)return!1}for(var r of Object.keys(e.style))if(e.style[r]!==t.style[r])return!1;for(var i of Object.keys(t.style))if(e.style[i]!==t.style[i])return!1;return!0},JH=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof zV&&r instanceof zV&&qH(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--)}return e},YH=function(e){for(var t=0,n=0,r=0,i=0;i<e.children.length;i++){var a=e.children[i];a.height>t&&(t=a.height),a.depth>n&&(n=a.depth),a.maxFontSize>r&&(r=a.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},X=function(e,t,n,r){var i=new FV(e,t,n,r);return YH(i),i},XH=(e,t,n,r)=>new FV(e,t,n,r),ZH=function(e,t,n){var r=X([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=V(r.height),r.maxFontSize=1,r},QH=function(e,t,n,r){var i=new IV(e,t,n,r);return YH(i),i},$H=function(e){var t=new wV(e);return YH(t),t},eU=function(e,t){return e instanceof wV?X([],[e],t):e},tU=function(e){if(e.positionType===`individualShift`){for(var t=e.children,n=[t[0]],r=-t[0].shift-t[0].elem.depth,i=r,a=1;a<t.length;a++){var o=-t[a].shift-i-t[a].elem.depth,s=o-(t[a-1].elem.height+t[a-1].elem.depth);i+=o,n.push({type:`kern`,size:s}),n.push(t[a])}return{children:n,depth:r}}var c;if(e.positionType===`top`){for(var l=e.positionData,u=0;u<e.children.length;u++){var d=e.children[u];l-=d.type===`kern`?d.size:d.elem.height+d.elem.depth}c=l}else if(e.positionType===`bottom`)c=-e.positionData;else{var f=e.children[0];if(f.type!==`elem`)throw Error(`First child must have type "elem".`);if(e.positionType===`shift`)c=-f.elem.depth-e.positionData;else if(e.positionType===`firstBaseline`)c=-f.elem.depth;else throw Error(`Invalid positionType `+e.positionType+`.`)}return{children:e.children,depth:c}},nU=function(e,t){for(var n=tU(e),r=n.children,i=n.depth,a=0,o=0;o<r.length;o++){var s=r[o];if(s.type===`elem`){var c=s.elem;a=Math.max(a,c.maxFontSize,c.height)}}a+=2;var l=X([`pstrut`],[]);l.style.height=V(a);for(var u=[],d=i,f=i,p=i,m=0;m<r.length;m++){var h=r[m];if(h.type===`kern`)p+=h.size;else{var g=h.elem,_=h.wrapperClasses||[],v=h.wrapperStyle||{},y=X(_,[l,g],void 0,v);y.style.top=V(-a-p-g.depth),h.marginLeft&&(y.style.marginLeft=h.marginLeft),h.marginRight&&(y.style.marginRight=h.marginRight),u.push(y),p+=g.height+g.depth}d=Math.min(d,p),f=Math.max(f,p)}var b=X([`vlist`],u);b.style.height=V(f);var x;if(d<0){var S=X([`vlist`],[X([],[])]);S.style.height=V(-d),x=[X([`vlist-r`],[b,X([`vlist-s`],[new zV(`​`)])]),X([`vlist-r`],[S])]}else x=[X([`vlist-r`],[b])];var C=X([`vlist-t`],x);return x.length===2&&C.classes.push(`vlist-t2`),C.height=f,C.depth=-d,C},rU=(e,t)=>{var n=X([`mspace`],[],t),r=OV(e,t);return n.style.marginRight=V(r),n},iU=(e,t,n)=>{var r,i;switch(e){case`amsrm`:r=`AMS`;break;case`textrm`:r=`Main`;break;case`textsf`:r=`SansSerif`;break;case`texttt`:r=`Typewriter`;break;default:r=e}return i=t===`textbf`&&n===`textit`?`BoldItalic`:t===`textbf`?`Bold`:n===`textit`?`Italic`:`Regular`,r+`-`+i},aU={mathbf:{variant:`bold`,fontName:`Main-Bold`},mathrm:{variant:`normal`,fontName:`Main-Regular`},textit:{variant:`italic`,fontName:`Main-Italic`},mathit:{variant:`italic`,fontName:`Main-Italic`},mathnormal:{variant:`italic`,fontName:`Math-Italic`},mathsfit:{variant:`sans-serif-italic`,fontName:`SansSerif-Italic`},mathbb:{variant:`double-struck`,fontName:`AMS-Regular`},mathcal:{variant:`script`,fontName:`Caligraphic-Regular`},mathfrak:{variant:`fraktur`,fontName:`Fraktur-Regular`},mathscr:{variant:`script`,fontName:`Script-Regular`},mathsf:{variant:`sans-serif`,fontName:`SansSerif-Regular`},mathtt:{variant:`monospace`,fontName:`Typewriter-Regular`}},oU={vec:[`vec`,.471,.714],oiintSize1:[`oiintSize1`,.957,.499],oiintSize2:[`oiintSize2`,1.472,.659],oiiintSize1:[`oiiintSize1`,1.304,.499],oiiintSize2:[`oiiintSize2`,1.98,.659]},sU=function(e,t){var n=oU[e],r=n[0],i=n[1],a=n[2],o=XH([`katex-overlay`],[new BV([new VV(r)],{width:V(i),height:V(a),style:`width:`+V(i),viewBox:`0 0 `+1e3*i+` `+1e3*a,preserveAspectRatio:`xMinYMin`})],t);return o.height=a,o.style.height=V(a),o.style.width=V(i),o},cU={number:3,unit:`mu`},lU={number:4,unit:`mu`},uU={number:5,unit:`mu`},dU={mord:{mop:cU,mbin:lU,mrel:uU,minner:cU},mop:{mord:cU,mop:cU,mrel:uU,minner:cU},mbin:{mord:lU,mop:lU,mopen:lU,minner:lU},mrel:{mord:uU,mop:uU,mopen:uU,minner:uU},mopen:{},mclose:{mop:cU,mbin:lU,mrel:uU,minner:cU},mpunct:{mord:cU,mop:cU,mrel:uU,mopen:cU,mclose:cU,mpunct:cU,minner:cU},minner:{mord:cU,mop:cU,mbin:lU,mrel:uU,mopen:cU,mpunct:cU,minner:cU}},fU={mord:{mop:cU},mop:{mord:cU,mop:cU},mbin:{},mrel:{},mopen:{},mclose:{mop:cU},mpunct:{},minner:{mop:cU}},pU={},mU={},hU={};function Z(e){for(var t=e.type,n=e.names,r=e.htmlBuilder,i=e.mathmlBuilder,a=0;a<n.length;++a)pU[n[a]]=e;t&&(r&&(mU[t]=r),i&&(hU[t]=i))}function gU(e){var t=e.type,n=e.htmlBuilder,r=e.mathmlBuilder;n&&(mU[t]=n),r&&(hU[t]=r)}var _U=function(e){return e.type===`ordgroup`&&e.body.length===1?e.body[0]:e},vU=function(e){return e.type===`ordgroup`?e.body:[e]},yU=new Set([`leftmost`,`mbin`,`mopen`,`mrel`,`mop`,`mpunct`]),bU=new Set([`rightmost`,`mrel`,`mclose`,`mpunct`]),xU={display:aV.DISPLAY,text:aV.TEXT,script:aV.SCRIPT,scriptscript:aV.SCRIPTSCRIPT},SU={mord:`mord`,mop:`mop`,mbin:`mbin`,mrel:`mrel`,mopen:`mopen`,mclose:`mclose`,mpunct:`mpunct`,minner:`minner`},CU=function(e,t,n,r){r===void 0&&(r=[null,null]);for(var i=[],a=0;a<e.length;a++){var o=kU(e[a],t);if(o instanceof wV){var s=o.children;i.push(...s)}else i.push(o)}if(JH(i),!n)return i;var c=t;if(e.length===1){var l=e[0];l.type===`sizing`?c=t.havingSize(l.size):l.type===`styling`&&(c=t.havingStyle(xU[l.style]))}var u=X([r[0]||`leftmost`],[],t),d=X([r[1]||`rightmost`],[],t),f=n===`root`;return wU(i,(e,t)=>{var n=t.classes[0],r=e.classes[0];n===`mbin`&&bU.has(r)?t.classes[0]=`mord`:r===`mbin`&&yU.has(n)&&(e.classes[0]=`mord`)},{node:u},d,f),wU(i,(e,t)=>{var n=DU(t),r=DU(e),i=n&&r?e.hasClass(`mtight`)?fU[n]?.[r]:dU[n]?.[r]:null;if(i)return rU(i,c)},{node:u},d,f),i},wU=function(e,t,n,r,i){r&&e.push(r);for(var a=0;a<e.length;a++){var o=e[a],s=TU(o);if(s)wU(s.children,t,n,null,i);else{var c=!o.hasClass(`mspace`);if(c){var l=t(o,n.node);l&&(n.insertAfter?n.insertAfter(l):(e.unshift(l),a++))}c?n.node=o:i&&o.hasClass(`katex-newline`)&&(n.node=X([`leftmost`])),n.insertAfter=(t=>n=>{e.splice(t+1,0,n),a++})(a)}}r&&e.pop()},TU=function(e){return e instanceof wV||e instanceof IV||e instanceof FV&&e.hasClass(`enclosing`)?e:null},EU=function(e,t){var n=TU(e);if(n){var r=n.children;if(r.length){if(t===`right`)return EU(r[r.length-1],`right`);if(t===`left`)return EU(r[0],`left`)}}return e},DU=function(e,t){return e?(t&&(e=EU(e,t)),SU[e.classes[0]]||null):null},OU=function(e,t){var n=[`nulldelimiter`].concat(e.baseSizingClasses());return X(t.concat(n))},kU=function(e,t,n){if(!e)return X();if(mU[e.type]){var r=mU[e.type](e,t);if(n&&t.size!==n.size){r=X(t.sizingClasses(n),[r],t);var i=t.sizeMultiplier/n.sizeMultiplier;r.height*=i,r.depth*=i}return r}throw new B(`Got group of unknown type: '`+e.type+`'`)};function AU(e,t){var n=X([`katex-base`],e,t),r=X([`katex-strut`]);return r.style.height=V(n.height+n.depth),n.depth&&(r.style.verticalAlign=V(-n.depth)),n.children.unshift(r),n}function jU(e,t){var n=null;e.length===1&&e[0].type===`tag`&&(n=e[0].tag,e=e[0].body);var r=CU(e,t,`root`),i;r.length===2&&r[1].hasClass(`katex-tag`)&&(i=r.pop());for(var a=[],o=[],s=0;s<r.length;s++)if(o.push(r[s]),r[s].hasClass(`mbin`)||r[s].hasClass(`mrel`)||r[s].hasClass(`allowbreak`)){for(var c=!1;s<r.length-1&&r[s+1].hasClass(`mspace`)&&!r[s+1].hasClass(`katex-newline`);)s++,o.push(r[s]),r[s].hasClass(`nobreak`)&&(c=!0);c||(a.push(AU(o,t)),o=[])}else r[s].hasClass(`katex-newline`)&&(o.pop(),o.length>0&&(a.push(AU(o,t)),o=[]),a.push(r[s]));o.length>0&&a.push(AU(o,t));var l;n?(l=AU(CU(n,t,!0),t),l.classes=[`katex-tag`],a.push(l)):i&&a.push(i);var u=X([`katex-html`],a);if(u.setAttribute(`aria-hidden`,`true`),l){var d=l.children[0];d.style.height=V(u.height+u.depth),u.depth&&(d.style.verticalAlign=V(-u.depth))}return u}function MU(e){return new wV(e)}var Q=class{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,this.type);for(var t of Object.entries(this.attributes)){var n=t[0],r=t[1];e.setAttribute(n,r)}this.classes.length>0&&(e.className=kV(this.classes));for(var i=0;i<this.children.length;i++)if(this.children[i]instanceof NU&&this.children[i+1]instanceof NU){for(var a=this.children[i].toText()+this.children[++i].toText();this.children[i+1]instanceof NU;)a+=this.children[++i].toText();e.appendChild(new NU(a).toNode())}else e.appendChild(this.children[i].toNode());return e}toMarkup(){var e=`<`+this.type;for(var t of Object.entries(this.attributes)){var n=t[0],r=t[1];e+=` `+n+`="`,e+=NB(r),e+=`"`}this.classes.length>0&&(e+=` class ="`+NB(kV(this.classes))+`"`),e+=`>`;for(var i=0;i<this.children.length;i++)e+=this.children[i].toMarkup();return e+=`</`+this.type+`>`,e}toText(){return this.children.map(e=>e.toText()).join(``)}},NU=class{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return NB(this.toText())}toText(){return this.text}},PU=class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?` `:e>=.1666&&e<=.1667?` `:e>=.2222&&e<=.2223?` `:e>=.2777&&e<=.2778?`  `:e>=-.05556&&e<=-.05555?` ⁣`:e>=-.1667&&e<=-.1666?` ⁣`:e>=-.2223&&e<=-.2222?` ⁣`:e>=-.2778&&e<=-.2777?` ⁣`:null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`mspace`);return e.setAttribute(`width`,V(this.width)),e}toMarkup(){return this.character?`<mtext>`+this.character+`</mtext>`:`<mspace width="`+V(this.width)+`"/>`}toText(){return this.character?this.character:` `}},FU=new Set([`\\imath`,`\\jmath`]),IU=new Set([`mrow`,`mtable`]),LU=function(e,t,n){var r,i;return $V[t][e]&&$V[t][e].replace&&e.charCodeAt(0)!==55349&&(!Object.prototype.hasOwnProperty.call(cH,e)||(n==null||(r=n.fontFamily)==null?void 0:r.slice(4,6))!==`tt`&&(n==null||(i=n.font)==null?void 0:i.slice(4,6))!==`tt`)&&(e=$V[t][e].replace),new NU(e)},RU=function(e){return e.length===1?e[0]:new Q(`mrow`,e)},zU={mathit:`italic`,boldsymbol:e=>e.type===`textord`?`bold`:`bold-italic`,mathbf:`bold`,mathbb:`double-struck`,mathsfit:`sans-serif-italic`,mathfrak:`fraktur`,mathscr:`script`,mathcal:`script`,mathsf:`sans-serif`,mathtt:`monospace`},BU=(e,t)=>{if(e.mode===`text`){if(t.fontFamily===`texttt`)return`monospace`;if(t.fontFamily===`textsf`)return t.fontShape===`textit`&&t.fontWeight===`textbf`?`sans-serif-bold-italic`:t.fontShape===`textit`?`sans-serif-italic`:t.fontWeight===`textbf`?`bold-sans-serif`:`sans-serif`;if(t.fontShape===`textit`&&t.fontWeight===`textbf`)return`bold-italic`;if(t.fontShape===`textit`)return`italic`;if(t.fontWeight===`textbf`)return`bold`}var n=t.font;if(!n||n===`mathnormal`)return null;var r=e.mode,i=zU[n];if(i)return typeof i==`function`?i(e):i;var a=e.text;if(FU.has(a))return null;if($V[r][a]){var o=$V[r][a].replace;o&&(a=o)}var s=aU[n].fontName;return XV(a,s,r)?aU[n].variant:null};function VU(e){if(!e)return!1;if(e.type===`mi`&&e.children.length===1){var t=e.children[0];return t instanceof NU&&t.text===`.`}if(e.type===`mo`&&e.children.length===1&&e.getAttribute(`separator`)===`true`&&e.getAttribute(`lspace`)===`0em`&&e.getAttribute(`rspace`)===`0em`){var n=e.children[0];return n instanceof NU&&n.text===`,`}return!1}var HU=function(e,t,n){if(e.length===1){var r=WU(e[0],t);return n&&r instanceof Q&&r.type===`mo`&&(r.setAttribute(`lspace`,`0em`),r.setAttribute(`rspace`,`0em`)),[r]}for(var i=[],a,o=0;o<e.length;o++){var s=WU(e[o],t);if(s instanceof Q&&a instanceof Q){if(s.type===`mtext`&&a.type===`mtext`&&s.getAttribute(`mathvariant`)===a.getAttribute(`mathvariant`)||s.type===`mn`&&a.type===`mn`||VU(s)&&a.type===`mn`){a.children.push(...s.children);continue}if(s.type===`mn`&&VU(a))s.children=[...a.children,...s.children],i.pop();else if((s.type===`msup`||s.type===`msub`)&&s.children.length>=1&&(a.type===`mn`||VU(a))){var c=s.children[0];c instanceof Q&&c.type===`mn`&&(c.children=[...a.children,...c.children],i.pop())}else if(a.type===`mi`&&a.children.length===1){var l=a.children[0];if(l instanceof NU&&l.text===`̸`&&(s.type===`mo`||s.type===`mi`||s.type===`mn`)){var u=s.children[0];u instanceof NU&&u.text.length>0&&(u.text=u.text.slice(0,1)+`̸`+u.text.slice(1),i.pop())}}}i.push(s),a=s}return i},UU=function(e,t,n){return RU(HU(e,t,n))},WU=function(e,t){if(!e)return new Q(`mrow`);if(hU[e.type])return hU[e.type](e,t);throw new B(`Got group of unknown type: '`+e.type+`'`)};function GU(e,t,n,r,i){var a=HU(e,n),o=a.length===1&&a[0]instanceof Q&&IU.has(a[0].type)?a[0]:new Q(`mrow`,a),s=new Q(`annotation`,[new NU(t)]);s.setAttribute(`encoding`,`application/x-tex`);var c=new Q(`math`,[new Q(`semantics`,[o,s])]);return c.setAttribute(`xmlns`,`http://www.w3.org/1998/Math/MathML`),r&&c.setAttribute(`display`,`block`),X([i?`katex`:`katex-mathml`],[c])}var KU=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],qU=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],JU=function(e,t){return t.size<2?e:KU[e-1][t.size-1]},YU=class e{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.strict=void 0,this.style=t.style,this.color=t.color,this.size=t.size||e.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||``,this.fontFamily=t.fontFamily||``,this.fontWeight=t.fontWeight||``,this.fontShape=t.fontShape||``,this.sizeMultiplier=qU[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this.strict=t.strict,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness,strict:this.strict};return Object.assign(n,t),new e(n)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:JU(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:qU[e-1]})}havingBaseStyle(t){t||=this.style.text();var n=JU(e.BASESIZE,t);return this.size===n&&this.textSize===e.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:``})}withTextFontWeight(e){return this.extend({fontWeight:e,font:``})}withTextFontShape(e){return this.extend({fontShape:e,font:``})}sizingClasses(e){return e.size===this.size?[]:[`katex-sizing`,`reset-size`+e.size,`size`+this.size]}baseSizingClasses(){return this.size===e.BASESIZE?[]:[`katex-sizing`,`reset-size`+this.size,`size`+e.BASESIZE]}fontMetrics(){return this._fontMetrics||=QV(this.size),this._fontMetrics}getColor(){return this.phantom?`transparent`:this.color}};YU.BASESIZE=6;var XU=e=>new YU({style:e.displayMode?aV.DISPLAY:aV.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness,strict:e.strict}),ZU=function(e,t){if(t.displayMode){var n=[`katex-display`];t.leqno&&n.push(`leqno`),t.fleqn&&n.push(`fleqn`),e=X(n,[e])}return e},QU=function(e,t,n){var r=XU(n),i;return n.output===`mathml`?GU(e,t,r,n.displayMode,!0):(i=n.output===`html`?X([`katex`],[jU(e,r)]):X([`katex`],[GU(e,t,r,n.displayMode,!1),jU(e,r)]),ZU(i,n))},$U=function(e,t){return ZU(X([`katex`],[jU(e,XU(t))]),t)},eW={widehat:`^`,widecheck:`ˇ`,widetilde:`~`,utilde:`~`,overleftarrow:`←`,underleftarrow:`←`,xleftarrow:`←`,overrightarrow:`→`,underrightarrow:`→`,xrightarrow:`→`,underbrace:`⏟`,overbrace:`⏞`,underbracket:`⎵`,overbracket:`⎴`,overgroup:`⏠`,undergroup:`⏡`,overleftrightarrow:`↔`,underleftrightarrow:`↔`,xleftrightarrow:`↔`,Overrightarrow:`⇒`,xRightarrow:`⇒`,overleftharpoon:`↼`,xleftharpoonup:`↼`,overrightharpoon:`⇀`,xrightharpoonup:`⇀`,xLeftarrow:`⇐`,xLeftrightarrow:`⇔`,xhookleftarrow:`↩`,xhookrightarrow:`↪`,xmapsto:`↦`,xrightharpoondown:`⇁`,xleftharpoondown:`↽`,xrightleftharpoons:`⇌`,xleftrightharpoons:`⇋`,xtwoheadleftarrow:`↞`,xtwoheadrightarrow:`↠`,xlongequal:`=`,xtofrom:`⇄`,xrightleftarrows:`⇄`,xrightequilibrium:`⇌`,xleftequilibrium:`⇋`,"\\cdrightarrow":`→`,"\\cdleftarrow":`←`,"\\cdlongequal":`=`},tW=function(e){var t=new Q(`mo`,[new NU(eW[e.replace(/^\\/,``)])]);return t.setAttribute(`stretchy`,`true`),t},nW={overrightarrow:[[`rightarrow`],.888,522,`xMaxYMin`],overleftarrow:[[`leftarrow`],.888,522,`xMinYMin`],underrightarrow:[[`rightarrow`],.888,522,`xMaxYMin`],underleftarrow:[[`leftarrow`],.888,522,`xMinYMin`],xrightarrow:[[`rightarrow`],1.469,522,`xMaxYMin`],"\\cdrightarrow":[[`rightarrow`],3,522,`xMaxYMin`],xleftarrow:[[`leftarrow`],1.469,522,`xMinYMin`],"\\cdleftarrow":[[`leftarrow`],3,522,`xMinYMin`],Overrightarrow:[[`doublerightarrow`],.888,560,`xMaxYMin`],xRightarrow:[[`doublerightarrow`],1.526,560,`xMaxYMin`],xLeftarrow:[[`doubleleftarrow`],1.526,560,`xMinYMin`],overleftharpoon:[[`leftharpoon`],.888,522,`xMinYMin`],xleftharpoonup:[[`leftharpoon`],.888,522,`xMinYMin`],xleftharpoondown:[[`leftharpoondown`],.888,522,`xMinYMin`],overrightharpoon:[[`rightharpoon`],.888,522,`xMaxYMin`],xrightharpoonup:[[`rightharpoon`],.888,522,`xMaxYMin`],xrightharpoondown:[[`rightharpoondown`],.888,522,`xMaxYMin`],xlongequal:[[`longequal`],.888,334,`xMinYMin`],"\\cdlongequal":[[`longequal`],3,334,`xMinYMin`],xtwoheadleftarrow:[[`twoheadleftarrow`],.888,334,`xMinYMin`],xtwoheadrightarrow:[[`twoheadrightarrow`],.888,334,`xMaxYMin`],overleftrightarrow:[[`leftarrow`,`rightarrow`],.888,522],overbrace:[[`leftbrace`,`midbrace`,`rightbrace`],1.6,548],underbrace:[[`leftbraceunder`,`midbraceunder`,`rightbraceunder`],1.6,548],underleftrightarrow:[[`leftarrow`,`rightarrow`],.888,522],xleftrightarrow:[[`leftarrow`,`rightarrow`],1.75,522],xLeftrightarrow:[[`doubleleftarrow`,`doublerightarrow`],1.75,560],xrightleftharpoons:[[`leftharpoondownplus`,`rightharpoonplus`],1.75,716],xleftrightharpoons:[[`leftharpoonplus`,`rightharpoondownplus`],1.75,716],xhookleftarrow:[[`leftarrow`,`righthook`],1.08,522],xhookrightarrow:[[`lefthook`,`rightarrow`],1.08,522],overlinesegment:[[`leftlinesegment`,`rightlinesegment`],.888,522],underlinesegment:[[`leftlinesegment`,`rightlinesegment`],.888,522],overbracket:[[`leftbracketover`,`rightbracketover`],1.6,440],underbracket:[[`leftbracketunder`,`rightbracketunder`],1.6,410],overgroup:[[`leftgroup`,`rightgroup`],.888,342],undergroup:[[`leftgroupunder`,`rightgroupunder`],.888,342],xmapsto:[[`leftmapsto`,`rightarrow`],1.5,522],xtofrom:[[`leftToFrom`,`rightToFrom`],1.75,528],xrightleftarrows:[[`baraboveleftarrow`,`rightarrowabovebar`],1.75,901],xrightequilibrium:[[`baraboveshortleftharpoon`,`rightharpoonaboveshortbar`],1.75,716],xleftequilibrium:[[`shortbaraboveleftharpoon`,`shortrightharpoonabovebar`],1.75,716]},rW=new Set([`widehat`,`widecheck`,`widetilde`,`utilde`]),iW=function(e,t){function n(){var n=4e5,r=e.label.slice(1);if(rW.has(r)&&`base`in e){var i=e.base.type===`ordgroup`?e.base.body.length:1,a,o,s;if(i>5)r===`widehat`||r===`widecheck`?(a=420,n=2364,s=.42,o=r+`4`):(a=312,n=2340,s=.34,o=`tilde4`);else{var c=[1,1,2,2,3,3][i];r===`widehat`||r===`widecheck`?(n=[0,1062,2364,2364,2364][c],a=[0,239,300,360,420][c],s=[0,.24,.3,.3,.36,.42][c],o=r+c):(n=[0,600,1033,2339,2340][c],a=[0,260,286,306,312][c],s=[0,.26,.286,.3,.306,.34][c],o=`tilde`+c)}return{span:XH([],[new BV([new VV(o)],{width:`100%`,height:V(s),viewBox:`0 0 `+n+` `+a,preserveAspectRatio:`none`})],t),minWidth:0,height:s}}var l=[],u=nW[r];if(!u)throw Error(`No SVG data for "`+r+`".`);var d=u[0],f=u[1],p=u[2],m=p/1e3,h=d.length,g,_;if(h===1){if(u.length!==4)throw Error(`Expected 4-tuple for single-path SVG data "`+r+`".`);g=[`hide-tail`],_=[u[3]]}else if(h===2)g=[`halfarrow-left`,`halfarrow-right`],_=[`xMinYMin`,`xMaxYMin`];else if(h===3)g=[`brace-left`,`brace-center`,`brace-right`],_=[`xMinYMin`,`xMidYMin`,`xMaxYMin`];else throw Error(`Correct katexImagesData or update code here to support
380
- `+h+` children.`);for(var v=0;v<h;v++){var y=new BV([new VV(d[v])],{width:`400em`,height:V(m),viewBox:`0 0 `+n+` `+p,preserveAspectRatio:_[v]+` slice`}),b=XH([g[v]],[y],t);if(h===1)return{span:b,minWidth:f,height:m};b.style.height=V(m),l.push(b)}return{span:X([`katex-stretchy`],l,t),minWidth:f,height:m}}var r=n(),i=r.span,a=r.minWidth,o=r.height;return i.height=o,i.style.height=V(o),a>0&&(i.style.minWidth=V(a)),i},aW=function(e,t,n,r,i){var a,o=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(a=X([`katex-stretchy`,t],[],i),t===`fbox`){var s=i.color&&i.getColor();s&&(a.style.borderColor=s)}}else{var c=[];/^[bx]cancel$/.test(t)&&c.push(new HV({x1:`0`,y1:`0`,x2:`100%`,y2:`100%`,"stroke-width":`0.046em`})),/^x?cancel$/.test(t)&&c.push(new HV({x1:`0`,y1:`100%`,x2:`100%`,y2:`0`,"stroke-width":`0.046em`})),a=XH([],[new BV(c,{width:`100%`,height:V(o)})],i)}return a.height=o,a.style.height=V(o),a},oW=[`bin`,`close`,`inner`,`open`,`punct`,`rel`],sW=[`accent-token`,`mathord`,`op-token`,`spacing`,`textord`],cW=new Set(oW),lW=new Set(sW);function uW(e){return cW.has(e)}function dW(e,t){if(!e||e.type!==t)throw Error(`Expected node of type `+t+`, but got `+(e?`node of type `+e.type:String(e)));return e}function fW(e){var t=pW(e);if(!t)throw Error(`Expected node of symbol group type, but got `+(e?`node of type `+e.type:String(e)));return t}function pW(e){return e.type===`atom`||lW.has(e.type)?e:null}function mW(e,t,n){var r=``;for(var i of e.body)if(i.type===`textord`)r+=i.text;else if(n&&i.type===`spacing`&&i.text===` `)r+=` `;else throw new B(t,e);return r}var hW=e=>{if(e instanceof zV)return e;if(GV(e)&&e.children.length===1)return hW(e.children[0])},gW=(e,t)=>{var n,r,i;e&&e.type===`supsub`?(r=dW(e.base,`accent`),n=r.base,e.base=n,i=WV(kU(e,t)),e.base=r):(r=dW(e,`accent`),n=r.base);var a=kU(n,t.havingCrampedStyle()),o=r.isShifty&&IB(n),s=0;o&&(s=hW(a)?.skew??0);var c=r.label===`\\c`,l=c?a.height+a.depth:Math.min(a.height,t.fontMetrics().xHeight),u;if(r.isStretchy)u=iW(r,t),u=nU({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`elem`,elem:u,wrapperClasses:[`svg-align`],wrapperStyle:s>0?{width:`calc(100% - `+V(2*s)+`)`,marginLeft:V(2*s)}:void 0}]});else{var d,f;r.label===`\\vec`?(d=sU(`vec`,t),f=oU.vec[1]):(d=KH({type:`textord`,mode:r.mode,text:r.label},t),d=UV(d),d.italic=0,f=d.width,c&&(l+=d.depth)),u=X([`accent-body`],[d]);var p=r.label===`\\textcircled`;p&&(u.classes.push(`accent-full`),l=a.height);var m=s;p||(m-=f/2),u.style.left=V(m),r.label===`\\textcircled`&&(u.style.top=`.2em`),u=nU({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:-l},{type:`elem`,elem:u}]})}var h=X([`mord`,`katex-accent`],[u],t);return i?(i.children[0]=h,i.height=Math.max(h.height,i.height),i.classes[0]=`mord`,i):h},_W=(e,t)=>{var n=e.isStretchy?tW(e.label):new Q(`mo`,[LU(e.label,e.mode)]),r=new Q(`mover`,[WU(e.base,t),n]);return r.setAttribute(`accent`,`true`),r},vW=new RegExp([`\\acute`,`\\grave`,`\\ddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`].map(e=>`\\`+e).join(`|`));Z({type:`accent`,names:[`\\acute`,`\\grave`,`\\ddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`,`\\widecheck`,`\\widehat`,`\\widetilde`,`\\overrightarrow`,`\\overleftarrow`,`\\Overrightarrow`,`\\overleftrightarrow`,`\\overgroup`,`\\overlinesegment`,`\\overleftharpoon`,`\\overrightharpoon`],numArgs:1,handler:(e,t)=>{var n=_U(t[0]),r=!vW.test(e.funcName),i=!r||e.funcName===`\\widehat`||e.funcName===`\\widetilde`||e.funcName===`\\widecheck`;return{type:`accent`,mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:gW,mathmlBuilder:_W}),Z({type:`accent`,names:[`\\'`,"\\`",`\\^`,`\\~`,`\\=`,`\\u`,`\\.`,`\\"`,`\\c`,`\\r`,`\\H`,`\\v`,`\\textcircled`],numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`primitive`],handler:(e,t)=>{var n=t[0],r=e.parser.mode;return r===`math`&&(VH({strict:e.parser.settings.strict,errorCode:`mathVsTextAccents`,errorMsg:`LaTeX's accent `+e.funcName+` works only in text mode`,report:!0}),r=`text`),{type:`accent`,mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}}}),Z({type:`accentUnder`,names:[`\\underleftarrow`,`\\underrightarrow`,`\\underleftrightarrow`,`\\undergroup`,`\\underlinesegment`,`\\utilde`],numArgs:1,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=t[0];return{type:`accentUnder`,mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=kU(e.base,t),r=iW(e,t),i=e.label===`\\utilde`?.12:0;return X([`mord`,`accentunder`],[nU({positionType:`top`,positionData:n.height,children:[{type:`elem`,elem:r,wrapperClasses:[`svg-align`]},{type:`kern`,size:i},{type:`elem`,elem:n}]})],t)},mathmlBuilder:(e,t)=>{var n=tW(e.label),r=new Q(`munder`,[WU(e.base,t),n]);return r.setAttribute(`accentunder`,`true`),r}});var yW=e=>{var t=new Q(`mpadded`,e?[e]:[]);return t.setAttribute(`width`,`+0.6em`),t.setAttribute(`lspace`,`0.3em`),t};Z({type:`xArrow`,names:[`\\xleftarrow`,`\\xrightarrow`,`\\xLeftarrow`,`\\xRightarrow`,`\\xleftrightarrow`,`\\xLeftrightarrow`,`\\xhookleftarrow`,`\\xhookrightarrow`,`\\xmapsto`,`\\xrightharpoondown`,`\\xrightharpoonup`,`\\xleftharpoondown`,`\\xleftharpoonup`,`\\xrightleftharpoons`,`\\xleftrightharpoons`,`\\xlongequal`,`\\xtwoheadrightarrow`,`\\xtwoheadleftarrow`,`\\xtofrom`,`\\xrightleftarrows`,`\\xrightequilibrium`,`\\xleftequilibrium`,`\\\\cdrightarrow`,`\\\\cdleftarrow`,`\\\\cdlongequal`],numArgs:1,numOptionalArgs:1,handler(e,t,n){var r=e.parser,i=e.funcName;return{type:`xArrow`,mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,r=t.havingStyle(n.sup()),i=eU(kU(e.body,r,t),t),a=e.label.slice(0,2)===`\\x`?`x`:`cd`;i.classes.push(a+`-arrow-pad`);var o;e.below&&(r=t.havingStyle(n.sub()),o=eU(kU(e.below,r,t),t),o.classes.push(a+`-arrow-pad`));var s=iW(e,t),c=-t.fontMetrics().axisHeight+.5*s.height,l=-t.fontMetrics().axisHeight-.5*s.height-.111;(i.depth>.25||e.label===`\\xleftequilibrium`)&&(l-=i.depth);var u;if(o){var d=-t.fontMetrics().axisHeight+o.height+.5*s.height+.111;u=nU({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c,wrapperClasses:[`svg-align`]},{type:`elem`,elem:o,shift:d}]})}else u=nU({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c,wrapperClasses:[`svg-align`]}]});return X([`mrel`,`x-arrow`],[u],t)},mathmlBuilder(e,t){var n=tW(e.label);n.setAttribute(`minsize`,e.label.charAt(0)===`x`?`1.75em`:`3.0em`);var r;if(e.body){var i=yW(WU(e.body,t));r=e.below?new Q(`munderover`,[n,yW(WU(e.below,t)),i]):new Q(`mover`,[n,i])}else e.below?r=new Q(`munder`,[n,yW(WU(e.below,t))]):(r=yW(),r=new Q(`mover`,[n,r]));return r}});function bW(e,t){var n=CU(e.body,t,!0);return X([e.mclass],n,t)}function xW(e,t){var n,r=HU(e.body,t);return e.mclass===`minner`?n=new Q(`mpadded`,r):e.mclass===`mord`?e.isCharacterBox?(n=r[0],n.type=`mi`):n=new Q(`mi`,r):(e.isCharacterBox?(n=r[0],n.type=`mo`):n=new Q(`mo`,r),e.mclass===`mbin`?(n.attributes.lspace=`0.22em`,n.attributes.rspace=`0.22em`):e.mclass===`mpunct`?(n.attributes.lspace=`0em`,n.attributes.rspace=`0.17em`):(e.mclass===`mopen`||e.mclass===`mclose`)&&(n.attributes.lspace=`0em`,n.attributes.rspace=`0em`)),n}Z({type:`mclass`,names:[`\\mathord`,`\\mathbin`,`\\mathrel`,`\\mathopen`,`\\mathclose`,`\\mathpunct`,`\\mathinner`],numArgs:1,primitive:!0,handler(e,t){var n=e.parser,r=e.funcName,i=t[0];return{type:`mclass`,mode:n.mode,mclass:`m`+r.slice(5),body:vU(i),isCharacterBox:IB(i)}},htmlBuilder:bW,mathmlBuilder:xW});var SW=e=>{var t=e.type===`ordgroup`&&e.body.length?e.body[0]:e;return t.type===`atom`&&(t.family===`bin`||t.family===`rel`)?`m`+t.family:`mord`};Z({type:`mclass`,names:[`\\@binrel`],numArgs:2,handler(e,t){return{type:`mclass`,mode:e.parser.mode,mclass:SW(t[0]),body:vU(t[1]),isCharacterBox:IB(t[1])}}}),Z({type:`mclass`,names:[`\\stackrel`,`\\overset`,`\\underset`],numArgs:2,handler(e,t){var n=e.parser,r=e.funcName,i=t[1],a=t[0],o=r===`\\stackrel`?`mrel`:SW(i),s={type:`op`,mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!==`\\stackrel`,body:vU(i)},c=r===`\\underset`?{type:`supsub`,mode:a.mode,base:s,sub:a}:{type:`supsub`,mode:a.mode,base:s,sup:a};return{type:`mclass`,mode:n.mode,mclass:o,body:[c],isCharacterBox:IB(c)}}}),Z({type:`pmb`,names:[`\\pmb`],numArgs:1,allowedInText:!0,handler(e,t){return{type:`pmb`,mode:e.parser.mode,mclass:SW(t[0]),body:vU(t[0])}},htmlBuilder(e,t){var n=CU(e.body,t,!0),r=X([e.mclass],n,t);return r.style.textShadow=`0.02em 0.01em 0.04px`,r},mathmlBuilder(e,t){var n=new Q(`mstyle`,HU(e.body,t));return n.setAttribute(`style`,`text-shadow: 0.02em 0.01em 0.04px`),n}});var CW={">":`\\\\cdrightarrow`,"<":`\\\\cdleftarrow`,"=":`\\\\cdlongequal`,A:`\\uparrow`,V:`\\downarrow`,"|":`\\Vert`,".":`no arrow`},wW=()=>({type:`styling`,body:[],mode:`math`,style:`display`,resetFont:!0}),TW=e=>e.type===`textord`&&e.text===`@`,EW=(e,t)=>(e.type===`mathord`||e.type===`atom`)&&e.text===t;function DW(e,t,n){var r=CW[e];switch(r){case`\\\\cdrightarrow`:case`\\\\cdleftarrow`:return n.callFunction(r,[t[0]],[t[1]]);case`\\uparrow`:case`\\downarrow`:var i=n.callFunction(`\\\\cdleft`,[t[0]],[]),a={type:`atom`,text:r,mode:`math`,family:`rel`},o={type:`ordgroup`,mode:`math`,body:[i,n.callFunction(`\\Big`,[a],[]),n.callFunction(`\\\\cdright`,[t[1]],[])]};return n.callFunction(`\\\\cdparent`,[o],[]);case`\\\\cdlongequal`:return n.callFunction(`\\\\cdlongequal`,[],[]);case`\\Vert`:return n.callFunction(`\\Big`,[{type:`textord`,text:`\\Vert`,mode:`math`}],[]);default:return{type:`textord`,text:` `,mode:`math`}}}function OW(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set(`\\cr`,`\\\\\\relax`),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,`\\\\`)),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n===`&`||n===`\\\\`)e.consume();else if(n===`\\end`){t[t.length-1].length===0&&t.pop();break}else throw new B(`Expected \\\\ or \\cr or \\end`,e.nextToken)}for(var r=[],i=[r],a=0;a<t.length;a++){for(var o=t[a],s=wW(),c=0;c<o.length;c++)if(!TW(o[c]))s.body.push(o[c]);else{r.push(s),c+=1;var l=fW(o[c]).text,u=[,,];if(u[0]={type:`ordgroup`,mode:`math`,body:[]},u[1]={type:`ordgroup`,mode:`math`,body:[]},!`=|.`.includes(l)){if(`<>AV`.includes(l))for(var d=0;d<2;d++){for(var f=!0,p=c+1;p<o.length;p++){if(EW(o[p],l)){f=!1,c=p;break}if(TW(o[p]))throw new B(`Missing a `+l+` character to complete a CD arrow.`,o[p]);u[d].body.push(o[p])}if(f)throw new B(`Missing a `+l+` character to complete a CD arrow.`,o[c])}else throw new B(`Expected one of "<>AV=|." after @`,o[c])}var m={type:`styling`,body:[DW(l,u,e)],mode:`math`,style:`display`,resetFont:!0};r.push(m),s=wW()}a%2==0?r.push(s):r.shift(),r=[],i.push(r)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:`array`,mode:`math`,body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:Array(i[0].length).fill({type:`align`,align:`c`,pregap:.25,postgap:.25}),colSeparationType:`CD`,hLinesBeforeRow:Array(i.length+1).fill([])}}Z({type:`cdlabel`,names:[`\\\\cdleft`,`\\\\cdright`],numArgs:1,handler(e,t){var n=e.parser,r=e.funcName;return{type:`cdlabel`,mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=eU(kU(e.label,n,t),t);return r.classes.push(`cd-label-`+e.side),r.style.bottom=V(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new Q(`mrow`,[WU(e.label,t)]);return n=new Q(`mpadded`,[n]),n.setAttribute(`width`,`0`),e.side===`left`&&n.setAttribute(`lspace`,`-1width`),n.setAttribute(`voffset`,`0.7em`),n=new Q(`mstyle`,[n]),n.setAttribute(`displaystyle`,`false`),n.setAttribute(`scriptlevel`,`1`),n}}),Z({type:`cdlabelparent`,names:[`\\\\cdparent`],numArgs:1,handler(e,t){return{type:`cdlabelparent`,mode:e.parser.mode,fragment:t[0]}},htmlBuilder(e,t){var n=eU(kU(e.fragment,t),t);return n.classes.push(`cd-vert-arrow`),n},mathmlBuilder(e,t){return new Q(`mrow`,[WU(e.fragment,t)])}}),Z({type:`textord`,names:[`\\@char`],numArgs:1,allowedInText:!0,handler(e,t){var n=e.parser,r=mW(dW(t[0],`ordgroup`),`\\@char has non-numeric argument`),i=parseInt(r),a;if(isNaN(i))throw new B(`\\@char has non-numeric argument `+r);if(i<0||i>1114111)throw new B(`\\@char with invalid code point `+r);return i<=65535?a=String.fromCharCode(i):(i-=65536,a=String.fromCharCode((i>>10)+55296,(i&1023)+56320)),{type:`textord`,mode:n.mode,text:a}}}),Z({type:`color`,names:[`\\textcolor`],numArgs:2,allowedInText:!0,argTypes:[`color`,`original`],handler(e,t){var n=e.parser,r=dW(t[0],`color-token`).color,i=t[1];return{type:`color`,mode:n.mode,color:r,body:vU(i)}},htmlBuilder:(e,t)=>$H(CU(e.body,t.withColor(e.color),!1)),mathmlBuilder:(e,t)=>{var n=new Q(`mstyle`,HU(e.body,t.withColor(e.color)));return n.setAttribute(`mathcolor`,e.color),n}}),Z({type:`color`,names:[`\\color`],numArgs:1,allowedInText:!0,argTypes:[`color`],handler(e,t){var n=e.parser,r=e.breakOnTokenText,i=dW(t[0],`color-token`).color;n.gullet.macros.set(`\\current@color`,i);var a=n.parseExpression(!0,r);return{type:`color`,mode:n.mode,color:i,body:a}}}),Z({type:`cr`,names:[`\\\\`],numArgs:0,numOptionalArgs:0,allowedInText:!0,handler(e){var t=e.parser,n=t.gullet.future().text===`[`?t.parseSizeGroup(!0):null,r=!t.settings.displayMode||!VH({strict:t.settings.strict,errorCode:`newLineInDisplayMode`,errorMsg:`In LaTeX, \\\\ or \\newline does nothing in display mode`,report:!1});return{type:`cr`,mode:t.mode,newLine:r,size:n&&dW(n,`size`).value}},htmlBuilder(e,t){var n=X([`mspace`],[],t);return e.newLine&&(n.classes.push(`katex-newline`),e.size&&(n.style.marginTop=V(OV(e.size,t)))),n},mathmlBuilder(e,t){var n=new Q(`mspace`);return e.newLine&&(n.setAttribute(`linebreak`,`newline`),e.size&&n.setAttribute(`height`,V(OV(e.size,t)))),n}});var kW={"\\global":`\\global`,"\\long":`\\\\globallong`,"\\\\globallong":`\\\\globallong`,"\\def":`\\gdef`,"\\gdef":`\\gdef`,"\\edef":`\\xdef`,"\\xdef":`\\xdef`,"\\let":`\\\\globallet`,"\\futurelet":`\\\\globalfuture`},AW=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new B(`Expected a control sequence`,e);return t},jW=e=>{var t=e.gullet.popToken();return t.text===`=`&&(t=e.gullet.popToken(),t.text===` `&&(t=e.gullet.popToken())),t},MW=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);i??=(n.noexpand=!0,{tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};Z({type:`internal`,names:[`\\global`,`\\long`,`\\\\globallong`],numArgs:0,allowedInText:!0,handler(e){var t=e.parser,n=e.funcName;t.consumeSpaces();var r=t.fetch();if(kW[r.text])return(n===`\\global`||n===`\\\\globallong`)&&(r.text=kW[r.text]),dW(t.parseFunction(),`internal`);throw new B(`Invalid token after macro prefix`,r)}}),Z({type:`internal`,names:[`\\def`,`\\gdef`,`\\edef`,`\\xdef`],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var t=e.parser,n=e.funcName,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new B(`Expected a control sequence`,r);for(var a=0,o,s=[[]];t.gullet.future().text!==`{`;)if(r=t.gullet.popToken(),r.text===`#`){if(t.gullet.future().text===`{`){o=t.gullet.future(),s[a].push(`{`);break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new B(`Invalid argument number "`+r.text+`"`);if(parseInt(r.text)!==a+1)throw new B(`Argument number "`+r.text+`" out of order`);a++,s.push([])}else if(r.text===`EOF`)throw new B(`Expected a macro definition`);else s[a].push(r.text);var c=t.gullet.consumeArg().tokens;return o&&c.unshift(o),(n===`\\edef`||n===`\\xdef`)&&(c=t.gullet.expandTokens(c),c.reverse()),t.gullet.macros.set(i,{tokens:c,numArgs:a,delimiters:s},n===kW[n]),{type:`internal`,mode:t.mode}}}),Z({type:`internal`,names:[`\\let`,`\\\\globallet`],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var t=e.parser,n=e.funcName,r=AW(t.gullet.popToken());return t.gullet.consumeSpaces(),MW(t,r,jW(t),n===`\\\\globallet`),{type:`internal`,mode:t.mode}}}),Z({type:`internal`,names:[`\\futurelet`,`\\\\globalfuture`],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var t=e.parser,n=e.funcName,r=AW(t.gullet.popToken()),i=t.gullet.popToken(),a=t.gullet.popToken();return MW(t,r,a,n===`\\\\globalfuture`),t.gullet.pushToken(a),t.gullet.pushToken(i),{type:`internal`,mode:t.mode}}});var NW=function(e,t,n){var r=XV($V.math[e]&&$V.math[e].replace||e,t,n);if(!r)throw Error(`Unsupported symbol `+e+` and font size `+t+`.`);return r},PW=function(e,t,n,r){var i=n.havingBaseStyle(t),a=X(r.concat(i.sizingClasses(n)),[e],n),o=i.sizeMultiplier/n.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},FW=function(e,t,n){var r=t.havingBaseStyle(n),i=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push(`delimcenter`),e.style.top=V(i),e.height-=i,e.depth+=i},IW=function(e,t,n,r,i,a){var o=PW(UH(e,`Main-Regular`,i,r),t,r,a);return n&&FW(o,r,t),o},LW=function(e,t,n,r){return UH(e,`Size`+t+`-Regular`,n,r)},RW=function(e,t,n,r,i,a){var o=LW(e,t,i,r),s=PW(X([`delimsizing`,`size`+t],[o],r),aV.TEXT,r,a);return n&&FW(s,r,aV.TEXT),s},zW=function(e,t,n,r){return{type:`elem`,elem:X([`delimsizinginner`,t===`Size1-Regular`?`delim-size1`:`delim-size4`],[X([],[UH(e,t,n,r)])])}},BW=function(e,t,n){var r=KV[`Size4-Regular`][e.charCodeAt(0)]?KV[`Size4-Regular`][e.charCodeAt(0)][4]:KV[`Size1-Regular`][e.charCodeAt(0)][4],i=XH([],[new BV([new VV(`inner`,bV(e,Math.round(1e3*t)))],{width:V(r),height:V(t),style:`width:`+V(r),viewBox:`0 0 `+1e3*r+` `+Math.round(1e3*t),preserveAspectRatio:`xMinYMin`})],n);return i.height=t,i.style.height=V(t),i.style.width=V(r),{type:`elem`,elem:i}},VW=.008,HW={type:`kern`,size:-1*VW},UW=new Set([`|`,`\\lvert`,`\\rvert`,`\\vert`]),WW=new Set([`\\|`,`\\lVert`,`\\rVert`,`\\Vert`]),GW=function(e,t,n,r,i,a){var o,s,c,l,u=``,d=0;o=c=l=e,s=null;var f=`Size1-Regular`;e===`\\uparrow`?c=l=`⏐`:e===`\\Uparrow`?c=l=`‖`:e===`\\downarrow`?o=c=`⏐`:e===`\\Downarrow`?o=c=`‖`:e===`\\updownarrow`?(o=`\\uparrow`,c=`⏐`,l=`\\downarrow`):e===`\\Updownarrow`?(o=`\\Uparrow`,c=`‖`,l=`\\Downarrow`):UW.has(e)?(c=`∣`,u=`vert`,d=333):WW.has(e)?(c=`∥`,u=`doublevert`,d=556):e===`[`||e===`\\lbrack`?(o=`⎡`,c=`⎢`,l=`⎣`,f=`Size4-Regular`,u=`lbrack`,d=667):e===`]`||e===`\\rbrack`?(o=`⎤`,c=`⎥`,l=`⎦`,f=`Size4-Regular`,u=`rbrack`,d=667):e===`\\lfloor`||e===`⌊`?(c=o=`⎢`,l=`⎣`,f=`Size4-Regular`,u=`lfloor`,d=667):e===`\\lceil`||e===`⌈`?(o=`⎡`,c=l=`⎢`,f=`Size4-Regular`,u=`lceil`,d=667):e===`\\rfloor`||e===`⌋`?(c=o=`⎥`,l=`⎦`,f=`Size4-Regular`,u=`rfloor`,d=667):e===`\\rceil`||e===`⌉`?(o=`⎤`,c=l=`⎥`,f=`Size4-Regular`,u=`rceil`,d=667):e===`(`||e===`\\lparen`?(o=`⎛`,c=`⎜`,l=`⎝`,f=`Size4-Regular`,u=`lparen`,d=875):e===`)`||e===`\\rparen`?(o=`⎞`,c=`⎟`,l=`⎠`,f=`Size4-Regular`,u=`rparen`,d=875):e===`\\{`||e===`\\lbrace`?(o=`⎧`,s=`⎨`,l=`⎩`,c=`⎪`,f=`Size4-Regular`):e===`\\}`||e===`\\rbrace`?(o=`⎫`,s=`⎬`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):e===`\\lgroup`||e===`⟮`?(o=`⎧`,l=`⎩`,c=`⎪`,f=`Size4-Regular`):e===`\\rgroup`||e===`⟯`?(o=`⎫`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):e===`\\lmoustache`||e===`⎰`?(o=`⎧`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):(e===`\\rmoustache`||e===`⎱`)&&(o=`⎫`,l=`⎩`,c=`⎪`,f=`Size4-Regular`);var p=NW(o,f,i),m=p.height+p.depth,h=NW(c,f,i),g=h.height+h.depth,_=NW(l,f,i),v=_.height+_.depth,y=0,b=1;if(s!==null){var x=NW(s,f,i);y=x.height+x.depth,b=2}var S=m+v+y,C=S+Math.max(0,Math.ceil((t-S)/(b*g)))*b*g,w=r.fontMetrics().axisHeight;n&&(w*=r.sizeMultiplier);var T=C/2-w,ee=[];if(u.length>0){var te=C-m-v,ne=Math.round(C*1e3),re=SV(u,Math.round(te*1e3)),E=new VV(u,re),ie=V(d/1e3),ae=V(ne/1e3),oe=XH([],[new BV([E],{width:ie,height:ae,viewBox:`0 0 `+d+` `+ne})],r);oe.height=ne/1e3,oe.style.width=ie,oe.style.height=ae,ee.push({type:`elem`,elem:oe})}else{if(ee.push(zW(l,f,i,r)),ee.push(HW),s===null){var D=C-m-v+2*VW;ee.push(BW(c,D,r))}else{var se=(C-m-v-y)/2+2*VW;ee.push(BW(c,se,r)),ee.push(HW),ee.push(zW(s,f,i,r)),ee.push(HW),ee.push(BW(c,se,r))}ee.push(HW),ee.push(zW(o,f,i,r))}var ce=r.havingBaseStyle(aV.TEXT);return PW(X([`delimsizing`,`mult`],[nU({positionType:`bottom`,positionData:T,children:ee})],ce),aV.TEXT,r,a)},KW=80,qW=.08,JW=function(e,t,n,r,i){return XH([`hide-tail`],[new BV([new VV(e,yV(e,r,n))],{width:`400em`,height:V(t),viewBox:`0 0 400000 `+n,preserveAspectRatio:`xMinYMin slice`})],i)},YW=function(e,t){var n=t.havingBaseSizing(),r=aG(`\\surd`,e*n.sizeMultiplier,rG,n),i=n.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,s,c,l,u;return r.type===`small`?(l=1e3+1e3*a+KW,e<1?i=1:e<1.4&&(i=.7),s=(1+a+qW)/i,c=(1+a)/i,o=JW(`sqrtMain`,s,l,a,t),o.style.minWidth=`0.853em`,u=.833/i):r.type===`large`?(l=(1e3+KW)*$W[r.size],c=($W[r.size]+a)/i,s=($W[r.size]+a+qW)/i,o=JW(`sqrtSize`+r.size,s,l,a,t),o.style.minWidth=`1.02em`,u=1/i):(s=e+a+qW,c=e+a,l=Math.floor(1e3*e+a)+KW,o=JW(`sqrtTall`,s,l,a,t),o.style.minWidth=`0.742em`,u=1.056),o.height=c,o.style.height=V(s),{span:o,advanceWidth:u,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},XW=new Set([`(`,`\\lparen`,`)`,`\\rparen`,`[`,`\\lbrack`,`]`,`\\rbrack`,`\\{`,`\\lbrace`,`\\}`,`\\rbrace`,`\\lfloor`,`\\rfloor`,`⌊`,`⌋`,`\\lceil`,`\\rceil`,`⌈`,`⌉`,`\\surd`]),ZW=new Set([`\\uparrow`,`\\downarrow`,`\\updownarrow`,`\\Uparrow`,`\\Downarrow`,`\\Updownarrow`,`|`,`\\|`,`\\vert`,`\\Vert`,`\\lvert`,`\\rvert`,`\\lVert`,`\\rVert`,`\\lgroup`,`\\rgroup`,`⟮`,`⟯`,`\\lmoustache`,`\\rmoustache`,`⎰`,`⎱`]),QW=new Set([`<`,`>`,`\\langle`,`\\rangle`,`/`,`\\backslash`,`\\lt`,`\\gt`]),$W=[0,1.2,1.8,2.4,3],eG=function(e,t,n,r,i){if(e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`),XW.has(e)||QW.has(e))return RW(e,t,!1,n,r,i);if(ZW.has(e))return GW(e,$W[t],!1,n,r,i);throw new B(`Illegal delimiter: '`+e+`'`)},tG=[{type:`small`,style:aV.SCRIPTSCRIPT},{type:`small`,style:aV.SCRIPT},{type:`small`,style:aV.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4}],nG=[{type:`small`,style:aV.SCRIPTSCRIPT},{type:`small`,style:aV.SCRIPT},{type:`small`,style:aV.TEXT},{type:`stack`}],rG=[{type:`small`,style:aV.SCRIPTSCRIPT},{type:`small`,style:aV.SCRIPT},{type:`small`,style:aV.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4},{type:`stack`}],iG=function(e){if(e.type===`small`)return`Main-Regular`;if(e.type===`large`)return`Size`+e.size+`-Regular`;if(e.type===`stack`)return`Size4-Regular`;var t=e.type;throw Error(`Add support for delim type '`+t+`' here.`)},aG=function(e,t,n,r){for(var i=Math.min(2,3-r.style.size);i<n.length;i++){var a=n[i];if(a.type===`stack`)break;var o=NW(e,iG(a),`math`),s=o.height+o.depth;if(a.type===`small`){var c=r.havingBaseStyle(a.style);s*=c.sizeMultiplier}if(s>t)return a}return n[n.length-1]},oG=function(e,t,n,r,i,a){e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`);var o=QW.has(e)?tG:XW.has(e)?rG:nG,s=aG(e,t,o,r);return s.type===`small`?IW(e,s.style,n,r,i,a):s.type===`large`?RW(e,s.size,n,r,i,a):GW(e,t,n,r,i,a)},sG=function(e,t,n,r,i,a){var o=r.fontMetrics().axisHeight*r.sizeMultiplier,s=901,c=5/r.fontMetrics().ptPerEm,l=Math.max(t-o,n+o);return oG(e,Math.max(l/500*s,2*l-c),!0,r,i,a)},cG={"\\bigl":{mclass:`mopen`,size:1},"\\Bigl":{mclass:`mopen`,size:2},"\\biggl":{mclass:`mopen`,size:3},"\\Biggl":{mclass:`mopen`,size:4},"\\bigr":{mclass:`mclose`,size:1},"\\Bigr":{mclass:`mclose`,size:2},"\\biggr":{mclass:`mclose`,size:3},"\\Biggr":{mclass:`mclose`,size:4},"\\bigm":{mclass:`mrel`,size:1},"\\Bigm":{mclass:`mrel`,size:2},"\\biggm":{mclass:`mrel`,size:3},"\\Biggm":{mclass:`mrel`,size:4},"\\big":{mclass:`mord`,size:1},"\\Big":{mclass:`mord`,size:2},"\\bigg":{mclass:`mord`,size:3},"\\Bigg":{mclass:`mord`,size:4}},lG=new Set(`(,\\lparen,),\\rparen,[,\\lbrack,],\\rbrack,\\{,\\lbrace,\\},\\rbrace,\\lfloor,\\rfloor,⌊,⌋,\\lceil,\\rceil,⌈,⌉,<,>,\\langle,⟨,\\rangle,⟩,\\lt,\\gt,\\lvert,\\rvert,\\lVert,\\rVert,\\lgroup,\\rgroup,⟮,⟯,\\lmoustache,\\rmoustache,⎰,⎱,/,\\backslash,|,\\vert,\\|,\\Vert,\\uparrow,\\Uparrow,\\downarrow,\\Downarrow,\\updownarrow,\\Updownarrow,.`.split(`,`));function uG(e){return`isMiddle`in e}function dG(e,t){var n=pW(e);if(n&&lG.has(n.text))return n;throw n?new B(`Invalid delimiter '`+n.text+`' after '`+t.funcName+`'`,e):new B(`Invalid delimiter type '`+e.type+`'`,e)}Z({type:`delimsizing`,names:[`\\bigl`,`\\Bigl`,`\\biggl`,`\\Biggl`,`\\bigr`,`\\Bigr`,`\\biggr`,`\\Biggr`,`\\bigm`,`\\Bigm`,`\\biggm`,`\\Biggm`,`\\big`,`\\Big`,`\\bigg`,`\\Bigg`],numArgs:1,argTypes:[`primitive`],handler:(e,t)=>{var n=dG(_U(t[0]),e);return{type:`delimsizing`,mode:e.parser.mode,size:cG[e.funcName].size,mclass:cG[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim===`.`?X([e.mclass]):eG(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!==`.`&&t.push(LU(e.delim,e.mode));var n=new Q(`mo`,t);e.mclass===`mopen`||e.mclass===`mclose`?n.setAttribute(`fence`,`true`):n.setAttribute(`fence`,`false`),n.setAttribute(`stretchy`,`true`);var r=V($W[e.size]);return n.setAttribute(`minsize`,r),n.setAttribute(`maxsize`,r),n}});function fG(e){if(!e.body)throw Error(`Bug: The leftright ParseNode wasn't fully parsed.`)}Z({type:`leftright-right`,names:[`\\right`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=e.parser.gullet.macros.get(`\\current@color`);if(n&&typeof n!=`string`)throw new B(`\\current@color set to non-string in \\right`);return{type:`leftright-right`,mode:e.parser.mode,delim:dG(t[0],e).text,color:n}}}),Z({type:`leftright`,names:[`\\left`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=dG(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect(`\\right`,!1);var a=dW(r.parseFunction(),`leftright-right`);return{type:`leftright`,mode:r.mode,body:i,left:n.text,right:a.delim,rightColor:a.color}},htmlBuilder:(e,t)=>{fG(e);for(var n=CU(e.body,t,!0,[`mopen`,`mclose`]),r=0,i=0,a=!1,o=0;o<n.length;o++){var s=n[o];uG(s)?a=!0:(r=Math.max(n[o].height,r),i=Math.max(n[o].depth,i))}r*=t.sizeMultiplier,i*=t.sizeMultiplier;var c=e.left===`.`?OU(t,[`mopen`]):sG(e.left,r,i,t,e.mode,[`mopen`]);if(n.unshift(c),a)for(var l=1;l<n.length;l++){var u=n[l];if(uG(u)){var d=u.isMiddle;n[l]=sG(d.delim,r,i,d.options,e.mode,[])}}var f;if(e.right===`.`)f=OU(t,[`mclose`]);else{var p=e.rightColor?t.withColor(e.rightColor):t;f=sG(e.right,r,i,p,e.mode,[`mclose`])}return n.push(f),X([`minner`],n,t)},mathmlBuilder:(e,t)=>{fG(e);var n=HU(e.body,t);if(e.left!==`.`){var r=new Q(`mo`,[LU(e.left,e.mode)]);r.setAttribute(`fence`,`true`),n.unshift(r)}if(e.right!==`.`){var i=new Q(`mo`,[LU(e.right,e.mode)]);i.setAttribute(`fence`,`true`),e.rightColor&&i.setAttribute(`mathcolor`,e.rightColor),n.push(i)}return RU(n)}}),Z({type:`middle`,names:[`\\middle`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=dG(t[0],e);if(!e.parser.leftrightDepth)throw new B(`\\middle without preceding \\left`,n);return{type:`middle`,mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim===`.`?n=OU(t,[]):(n=eG(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t}),n},mathmlBuilder:(e,t)=>{var n=new Q(`mo`,[e.delim===`\\vert`||e.delim===`|`?LU(`|`,`text`):LU(e.delim,e.mode)]);return n.setAttribute(`fence`,`true`),n.setAttribute(`lspace`,`0.05em`),n.setAttribute(`rspace`,`0.05em`),n}}),Z({type:`enclose`,names:[`\\colorbox`],numArgs:2,allowedInText:!0,argTypes:[`color`,`hbox`],handler(e,t,n){var r=e.parser,i=e.funcName,a=dW(t[0],`color-token`).color,o=t[1];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:a,body:o}},htmlBuilder:(e,t)=>{var n=eU(kU(e.body,t),t),r=e.label.slice(1),i=t.sizeMultiplier,a,o,s=IB(e.body);if(r===`sout`)a=X([`katex-stretchy`,`katex-sout`]),a.height=t.fontMetrics().defaultRuleThickness/i,o=-.5*t.fontMetrics().xHeight;else if(r===`phase`){var c=OV({number:.6,unit:`pt`},t),l=OV({number:.35,unit:`ex`},t),u=t.havingBaseSizing();i/=u.sizeMultiplier;var d=n.height+n.depth+c+l;n.style.paddingLeft=V(d/2+c);var f=Math.floor(1e3*d*i);a=XH([`hide-tail`],[new BV([new VV(`phase`,_V(f))],{width:`400em`,height:V(f/1e3),viewBox:`0 0 400000 `+f,preserveAspectRatio:`xMinYMin slice`})],t),a.style.height=V(d),o=n.depth+c+l}else{/cancel/.test(r)?s||n.classes.push(`cancel-pad`):r===`angl`?n.classes.push(`anglpad`):n.classes.push(`boxpad`);var p,m,h=0;/box/.test(r)?(h=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),p=t.fontMetrics().fboxsep+(r===`colorbox`?0:h),m=p):r===`angl`?(h=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),p=4*h,m=Math.max(0,.25-n.depth)):(p=s?.2:0,m=p),a=aW(n,r,p,m,t),/fbox|boxed|fcolorbox/.test(r)?(a.style.borderStyle=`solid`,a.style.borderWidth=V(h)):r===`angl`&&h!==.049&&(a.style.borderTopWidth=V(h),a.style.borderRightWidth=V(h)),o=n.depth+m,e.backgroundColor&&(a.style.backgroundColor=e.backgroundColor,e.borderColor&&(a.style.borderColor=e.borderColor))}var g;if(e.backgroundColor)g=nU({positionType:`individualShift`,children:[{type:`elem`,elem:a,shift:o},{type:`elem`,elem:n,shift:0}]});else{var _=/cancel|phase/.test(r)?[`svg-align`]:[];g=nU({positionType:`individualShift`,children:[{type:`elem`,elem:n,shift:0},{type:`elem`,elem:a,shift:o,wrapperClasses:_}]})}return/cancel/.test(r)&&(g.height=n.height,g.depth=n.depth),/cancel/.test(r)&&!s?X([`mord`,`cancel-lap`],[g],t):X([`mord`],[g],t)},mathmlBuilder:(e,t)=>{var n,r=new Q(e.label.includes(`colorbox`)?`mpadded`:`menclose`,[WU(e.body,t)]);switch(e.label){case`\\cancel`:r.setAttribute(`notation`,`updiagonalstrike`);break;case`\\bcancel`:r.setAttribute(`notation`,`downdiagonalstrike`);break;case`\\phase`:r.setAttribute(`notation`,`phasorangle`);break;case`\\sout`:r.setAttribute(`notation`,`horizontalstrike`);break;case`\\fbox`:r.setAttribute(`notation`,`box`);break;case`\\angl`:r.setAttribute(`notation`,`actuarial`);break;case`\\fcolorbox`:case`\\colorbox`:if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute(`width`,`+`+2*n+`pt`),r.setAttribute(`height`,`+`+2*n+`pt`),r.setAttribute(`lspace`,n+`pt`),r.setAttribute(`voffset`,n+`pt`),e.label===`\\fcolorbox`){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute(`style`,`border: `+V(i)+` solid `+e.borderColor)}break;case`\\xcancel`:r.setAttribute(`notation`,`updiagonalstrike downdiagonalstrike`)}return e.backgroundColor&&r.setAttribute(`mathbackground`,e.backgroundColor),r}}),Z({type:`enclose`,names:[`\\fcolorbox`],numArgs:3,allowedInText:!0,argTypes:[`color`,`color`,`hbox`],handler(e,t,n){var r=e.parser,i=e.funcName,a=dW(t[0],`color-token`).color,o=dW(t[1],`color-token`).color,s=t[2];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:o,borderColor:a,body:s}}}),Z({type:`enclose`,names:[`\\fbox`],numArgs:1,argTypes:[`hbox`],allowedInText:!0,handler(e,t){return{type:`enclose`,mode:e.parser.mode,label:`\\fbox`,body:t[0]}}}),Z({type:`enclose`,names:[`\\cancel`,`\\bcancel`,`\\xcancel`,`\\phase`],numArgs:1,handler(e,t){var n=e.parser,r=e.funcName,i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}}}),Z({type:`enclose`,names:[`\\sout`],numArgs:1,allowedInText:!0,handler(e,t){var n=e.parser,r=e.funcName;n.mode===`math`&&VH({strict:n.settings.strict,errorCode:`mathVsSout`,errorMsg:`LaTeX's \\sout works only in text mode`,report:!0});var i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}}}),Z({type:`enclose`,names:[`\\angl`],numArgs:1,argTypes:[`hbox`],allowedInText:!1,handler(e,t){return{type:`enclose`,mode:e.parser.mode,label:`\\angl`,body:t[0]}}});var pG={};function mG(e){for(var t=e.type,n=e.names,r=e.props,i=e.handler,a=e.htmlBuilder,o=e.mathmlBuilder,s={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},c=0;c<n.length;++c)pG[n[c]]=s;a&&(mU[t]=a),o&&(hU[t]=o)}var hG={};function $(e,t){hG[e]=t}var gG=class e{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(t,n){return n?!t||!t.loc||!n.loc||t.loc.lexer!==n.loc.lexer?null:new e(t.loc.lexer,t.loc.start,n.loc.end):t&&t.loc}},_G=class e{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(t,n){return new e(n,gG.range(this,t))}};function vG(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for(n===`\\relax`&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);n===`\\hline`||n===`\\hdashline`;)e.consume(),t.push(n===`\\hdashline`),e.consumeSpaces(),n=e.fetch().text;return t}var yG=e=>{if(!e.parser.settings.displayMode)throw new B(`{`+e.envName+`} can be used only in display mode.`)},bG=new Set([`gather`,`gather*`]);function xG(e){if(!e.includes(`ed`))return!e.includes(`*`)}function SG(e,t,n){var r=t.hskipBeforeAndAfter,i=t.addJot,a=t.cols,o=t.arraystretch,s=t.colSeparationType,c=t.autoTag,l=t.singleRow,u=t.emptySingleRow,d=t.maxNumCols,f=t.leqno;if(e.gullet.beginGroup(),l||e.gullet.macros.set(`\\cr`,`\\\\\\relax`),!o){var p=e.gullet.expandMacroAsText(`\\arraystretch`);if(p==null)o=1;else if(o=parseFloat(p),!o||o<0)throw new B(`Invalid \\arraystretch: `+p)}e.gullet.beginGroup();var m=[],h=[m],g=[],_=[],v=c==null?void 0:[];function y(){c&&e.gullet.macros.set(`\\@eqnsw`,`1`,!0)}function b(){v&&(e.gullet.macros.get(`\\df@tag`)?(v.push(e.subparse([new _G(`\\df@tag`)])),e.gullet.macros.set(`\\df@tag`,void 0,!0)):v.push(!!c&&e.gullet.macros.get(`\\@eqnsw`)===`1`))}for(y(),_.push(vG(e));;){var x=e.parseExpression(!1,l?`\\end`:`\\\\`);e.gullet.endGroup(),e.gullet.beginGroup();var S={type:`ordgroup`,mode:e.mode,body:x};n&&(S={type:`styling`,mode:e.mode,style:n,resetFont:!0,body:[S]}),m.push(S);var C=e.fetch().text;if(C===`&`){if(d&&m.length===d){if(l||s)throw new B(`Too many tab characters: &`,e.nextToken);VH({strict:e.settings.strict,errorCode:`textEnv`,errorMsg:`Too few columns specified in the {array} column argument.`,report:!0})}e.consume()}else if(C===`\\end`){b(),m.length===1&&S.type===`styling`&&S.body.length===1&&S.body[0].type===`ordgroup`&&S.body[0].body.length===0&&(h.length>1||!u)&&!Array.isArray(v?.[v.length-1])&&!(c&&v?.[v.length-1]===!0)&&h.pop(),_.length<h.length+1&&_.push([]);break}else if(C===`\\\\`){e.consume();var w=void 0;e.gullet.future().text!==` `&&(w=e.parseSizeGroup(!0)),g.push(w?w.value:null),b(),_.push(vG(e)),m=[],h.push(m),y()}else throw new B(`Expected & or \\\\ or \\cr or \\end`,e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:`array`,mode:e.mode,addJot:i,arraystretch:o,body:h,cols:a,rowGaps:g,hskipBeforeAndAfter:r,hLinesBeforeRow:_,colSeparationType:s,tags:v,leqno:f}}function CG(e){return e.slice(0,1)===`d`?`display`:`text`}var wG=function(e,t){var n,r,i=e.body.length,a=e.hLinesBeforeRow,o=0,s=Array(i),c=[],l=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),u=1/t.fontMetrics().ptPerEm,d=5*u;e.colSeparationType&&e.colSeparationType===`small`&&(d=.2778*(t.havingStyle(aV.SCRIPT).sizeMultiplier/t.sizeMultiplier));var f=e.colSeparationType===`CD`?OV({number:3,unit:`ex`},t):12*u,p=3*u,m=e.arraystretch*f,h=.7*m,g=.3*m,_=0;function v(e){for(var t=0;t<e.length;++t)t>0&&(_+=.25),c.push({pos:_,isDashed:e[t]})}for(v(a[0]),n=0;n<e.body.length;++n){var y=e.body[n],b=h,x=g;o<y.length&&(o=y.length);var S={cells:Array(y.length),height:0,depth:0,pos:0};for(r=0;r<y.length;++r){var C=kU(y[r],t);x<C.depth&&(x=C.depth),b<C.height&&(b=C.height),S.cells[r]=C}var w=e.rowGaps[n],T=0;w&&(T=OV(w,t),T>0&&(T+=g,x<T&&(x=T),T=0)),e.addJot&&n<e.body.length-1&&(x+=p),S.height=b,S.depth=x,_+=b,S.pos=_,_+=x+T,s[n]=S,v(a[n+1])}var ee=_/2+t.fontMetrics().axisHeight,te=e.cols||[],ne=[],re,E,ie=[];if(e.tags&&e.tags.some(e=>e))for(n=0;n<i;++n){var ae=s[n],oe=ae.pos-ee,D=e.tags[n],se=void 0;se=D===!0?X([`eqn-num`],[],t):D===!1?X([],[],t):X([],CU(D,t,!0),t),se.depth=ae.depth,se.height=ae.height,ie.push({type:`elem`,elem:se,shift:oe})}for(r=0,E=0;r<o||E<te.length;++r,++E){for(var ce=te[E],le=!0;(ue=ce)?.type===`separator`;){var ue;if(le||(re=X([`arraycolsep`],[]),re.style.width=V(t.fontMetrics().doubleRuleSep),ne.push(re)),ce.separator===`|`||ce.separator===`:`){var de=ce.separator===`|`?`solid`:`dashed`,fe=X([`vertical-separator`],[],t);fe.style.height=V(_),fe.style.borderRightWidth=V(l),fe.style.borderRightStyle=de,fe.style.margin=`0 `+V(-l/2);var pe=_-ee;pe&&(fe.style.verticalAlign=V(-pe)),ne.push(fe)}else throw new B(`Invalid separator type: `+ce.separator);E++,ce=te[E],le=!1}if(!(r>=o)){var me=void 0;(r>0||e.hskipBeforeAndAfter)&&(me=ce?.pregap??d,me!==0&&(re=X([`arraycolsep`],[]),re.style.width=V(me),ne.push(re)));var he=[];for(n=0;n<i;++n){var ge=s[n],_e=ge.cells[r];if(_e){var ve=ge.pos-ee;_e.depth=ge.depth,_e.height=ge.height,he.push({type:`elem`,elem:_e,shift:ve})}}var ye=nU({positionType:`individualShift`,children:he}),be=X([`col-align-`+(ce?.align||`c`)],[ye]);ne.push(be),(r<o-1||e.hskipBeforeAndAfter)&&(me=ce?.postgap??d,me!==0&&(re=X([`arraycolsep`],[]),re.style.width=V(me),ne.push(re)))}}var O=X([`mtable`],ne);if(c.length>0){for(var k=ZH(`katex-hline`,t,l),xe=ZH(`katex-hdashline`,t,l),Se=[{type:`elem`,elem:O,shift:0}];c.length>0;){var Ce=c.pop(),we=Ce.pos-ee;Ce.isDashed?Se.push({type:`elem`,elem:xe,shift:we}):Se.push({type:`elem`,elem:k,shift:we})}O=nU({positionType:`individualShift`,children:Se})}if(ie.length===0)return X([`mord`],[O],t);var Te=X([`katex-tag`],[nU({positionType:`individualShift`,children:ie})],t);return $H([O,Te])},TG={c:`center `,l:`left `,r:`right `},EG=function(e,t){for(var n=[],r=new Q(`mtd`,[],[`mtr-glue`]),i=new Q(`mtd`,[],[`mml-eqn-num`]),a=0;a<e.body.length;a++){for(var o=e.body[a],s=[],c=0;c<o.length;c++)s.push(new Q(`mtd`,[WU(o[c],t)]));e.tags&&e.tags[a]&&(s.unshift(r),s.push(r),e.leqno?s.unshift(i):s.push(i)),n.push(new Q(`mtr`,s))}var l=new Q(`mtable`,n),u=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);l.setAttribute(`rowspacing`,V(u));var d=``,f=``;if(e.cols&&e.cols.length>0){var p=e.cols,m=``,h=!1,g=0,_=p.length;p[0].type===`separator`&&(d+=`top `,g=1),p[p.length-1].type===`separator`&&(d+=`bottom `,--_);for(var v=g;v<_;v++){var y=p[v];y.type===`align`?(f+=TG[y.align],h&&(m+=`none `),h=!0):y.type===`separator`&&(h&&=(m+=y.separator===`|`?`solid `:`dashed `,!1))}l.setAttribute(`columnalign`,f.trim()),/[sd]/.test(m)&&l.setAttribute(`columnlines`,m.trim())}if(e.colSeparationType===`align`){for(var b=e.cols||[],x=``,S=1;S<b.length;S++)x+=S%2?`0em `:`1em `;l.setAttribute(`columnspacing`,x.trim())}else e.colSeparationType===`alignat`||e.colSeparationType===`gather`?l.setAttribute(`columnspacing`,`0em`):e.colSeparationType===`small`?l.setAttribute(`columnspacing`,`0.2778em`):e.colSeparationType===`CD`?l.setAttribute(`columnspacing`,`0.5em`):l.setAttribute(`columnspacing`,`1em`);var C=``,w=e.hLinesBeforeRow;d+=w[0].length>0?`left `:``,d+=w[w.length-1].length>0?`right `:``;for(var T=1;T<w.length-1;T++)C+=w[T].length===0?`none `:w[T][0]?`dashed `:`solid `;return/[sd]/.test(C)&&l.setAttribute(`rowlines`,C.trim()),d!==``&&(l=new Q(`menclose`,[l]),l.setAttribute(`notation`,d.trim())),e.arraystretch&&e.arraystretch<1&&(l=new Q(`mstyle`,[l]),l.setAttribute(`scriptlevel`,`1`)),l},DG=function(e,t){e.envName.includes(`ed`)||yG(e);var n=[],r=e.envName===`split`,i=SG(e.parser,{cols:n,addJot:!0,autoTag:r?void 0:xG(e.envName),emptySingleRow:!0,colSeparationType:e.envName.includes(`at`)?`alignat`:`align`,maxNumCols:r?2:void 0,leqno:e.parser.settings.leqno},`display`),a=0,o=0,s={type:`ordgroup`,mode:e.mode,body:[]};if(t[0]&&t[0].type===`ordgroup`){var c=`Number of columns should be a positive integer`,l=mW(t[0],c);if(!/^[0-9]+$/.test(l)||Number(l)<1)throw new B(c,t[0]);a=Number(l),o=a*2}var u=!o;i.body.forEach(function(e){for(var t=1;t<e.length;t+=2)dW(dW(e[t],`styling`).body[0],`ordgroup`).body.unshift(s);if(u)o<e.length&&(o=e.length);else{var n=e.length/2;if(a<n)throw new B(`Too many math in a row: `+(`expected `+a+`, but got `+n),e[0])}});for(var d=0;d<o;++d){var f=`r`,p=0;d%2==1?f=`l`:d>0&&u&&(p=1),n[d]={type:`align`,align:f,pregap:p,postgap:0}}return i.colSeparationType=u?`align`:`alignat`,i};mG({type:`array`,names:[`array`,`darray`],props:{numArgs:1},handler(e,t){var n=(pW(t[0])?[t[0]]:dW(t[0],`ordgroup`).body).map(function(e){var t=fW(e).text;if(`lcr`.includes(t))return{type:`align`,align:t};if(t===`|`)return{type:`separator`,separator:`|`};if(t===`:`)return{type:`separator`,separator:`:`};throw new B(`Unknown column alignment: `+t,e)}),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return SG(e.parser,r,CG(e.envName))},htmlBuilder:wG,mathmlBuilder:EG}),mG({type:`array`,names:[`matrix`,`pmatrix`,`bmatrix`,`Bmatrix`,`vmatrix`,`Vmatrix`,`matrix*`,`pmatrix*`,`bmatrix*`,`Bmatrix*`,`vmatrix*`,`Vmatrix*`],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:[`(`,`)`],bmatrix:[`[`,`]`],Bmatrix:[`\\{`,`\\}`],vmatrix:[`|`,`|`],Vmatrix:[`\\Vert`,`\\Vert`]}[e.envName.replace(`*`,``)],n=`c`,r={hskipBeforeAndAfter:!1,cols:[{type:`align`,align:n}]};if(e.envName.charAt(e.envName.length-1)===`*`){var i=e.parser;if(i.consumeSpaces(),i.fetch().text===`[`){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,!`lcr`.includes(n))throw new B(`Expected l or c or r`,i.nextToken);i.consume(),i.consumeSpaces(),i.expect(`]`),i.consume(),r.cols=[{type:`align`,align:n}]}}var a=SG(e.parser,r,CG(e.envName)),o=Math.max(0,...a.body.map(e=>e.length));return a.cols=Array(o).fill({type:`align`,align:n}),t?{type:`leftright`,mode:e.mode,body:[a],left:t[0],right:t[1],rightColor:void 0}:a},htmlBuilder:wG,mathmlBuilder:EG}),mG({type:`array`,names:[`smallmatrix`],props:{numArgs:0},handler(e){var t=SG(e.parser,{arraystretch:.5},`script`);return t.colSeparationType=`small`,t},htmlBuilder:wG,mathmlBuilder:EG}),mG({type:`array`,names:[`subarray`],props:{numArgs:1},handler(e,t){var n=(pW(t[0])?[t[0]]:dW(t[0],`ordgroup`).body).map(function(e){var t=fW(e).text;if(`lc`.includes(t))return{type:`align`,align:t};throw new B(`Unknown column alignment: `+t,e)});if(n.length>1)throw new B(`{subarray} can contain only one column`);var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5},i=SG(e.parser,r,`script`);if(i.body.length>0&&i.body[0].length>1)throw new B(`{subarray} can contain only one column`);return i},htmlBuilder:wG,mathmlBuilder:EG}),mG({type:`array`,names:[`cases`,`dcases`,`rcases`,`drcases`],props:{numArgs:0},handler(e){var t=SG(e.parser,{arraystretch:1.2,cols:[{type:`align`,align:`l`,pregap:0,postgap:1},{type:`align`,align:`l`,pregap:0,postgap:0}]},CG(e.envName));return{type:`leftright`,mode:e.mode,body:[t],left:e.envName.includes(`r`)?`.`:`\\{`,right:e.envName.includes(`r`)?`\\}`:`.`,rightColor:void 0}},htmlBuilder:wG,mathmlBuilder:EG}),mG({type:`array`,names:[`align`,`align*`,`aligned`,`split`],props:{numArgs:0},handler:DG,htmlBuilder:wG,mathmlBuilder:EG}),mG({type:`array`,names:[`gathered`,`gather`,`gather*`],props:{numArgs:0},handler(e){bG.has(e.envName)&&yG(e);var t={cols:[{type:`align`,align:`c`}],addJot:!0,colSeparationType:`gather`,autoTag:xG(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return SG(e.parser,t,`display`)},htmlBuilder:wG,mathmlBuilder:EG}),mG({type:`array`,names:[`alignat`,`alignat*`,`alignedat`],props:{numArgs:1},handler:DG,htmlBuilder:wG,mathmlBuilder:EG}),mG({type:`array`,names:[`equation`,`equation*`],props:{numArgs:0},handler(e){yG(e);var t={autoTag:xG(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return SG(e.parser,t,`display`)},htmlBuilder:wG,mathmlBuilder:EG}),mG({type:`array`,names:[`CD`],props:{numArgs:0},handler(e){return yG(e),OW(e.parser)},htmlBuilder:wG,mathmlBuilder:EG}),$(`\\nonumber`,`\\gdef\\@eqnsw{0}`),$(`\\notag`,`\\nonumber`),Z({type:`text`,names:[`\\hline`,`\\hdashline`],numArgs:0,allowedInText:!0,allowedInMath:!0,handler(e,t){throw new B(e.funcName+` valid only within array environment`)}});var OG=pG;Z({type:`environment`,names:[`\\begin`,`\\end`],numArgs:1,argTypes:[`text`],handler(e,t){var n=e.parser,r=e.funcName,i=t[0];if(i.type!==`ordgroup`)throw new B(`Invalid environment name`,i);var a=mW(i,`Environment name should contain only text characters and spaces`,!0);if(r===`\\begin`){if(!Object.prototype.hasOwnProperty.call(OG,a))throw new B(`No such environment: `+a,i);var o=OG[a],s=n.parseArguments(`\\begin{`+a+`}`,o),c=s.args,l=s.optArgs,u={mode:n.mode,envName:a,parser:n},d=o.handler(u,c,l);n.expect(`\\end`,!1);var f=n.nextToken,p=dW(n.parseFunction(),`environment`);if(p.name!==a)throw new B(`Mismatch: \\begin{`+a+`} matched by \\end{`+p.name+`}`,f);return d}return{type:`environment`,mode:n.mode,name:a,nameGroup:i}}});var kG=(e,t)=>{var n=e.font,r=t.withFont(n);return kU(e.body,r)},AG=(e,t)=>{var n=e.font,r=t.withFont(n);return WU(e.body,r)},jG={"\\Bbb":`\\mathbb`,"\\bold":`\\mathbf`,"\\frak":`\\mathfrak`};Z({type:`font`,names:[`\\mathrm`,`\\mathit`,`\\mathbf`,`\\mathnormal`,`\\mathsfit`,`\\mathbb`,`\\mathcal`,`\\mathfrak`,`\\mathscr`,`\\mathsf`,`\\mathtt`,`\\Bbb`,`\\bold`,`\\frak`],numArgs:1,allowedInArgument:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=_U(t[0]),a=r in jG?jG[r]:r;return{type:`font`,mode:n.mode,font:a.slice(1),body:i}},htmlBuilder:kG,mathmlBuilder:AG}),Z({type:`mclass`,names:[`\\boldsymbol`,`\\bm`],numArgs:1,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`mclass`,mode:n.mode,mclass:SW(r),body:[{type:`font`,mode:n.mode,font:`boldsymbol`,body:r}],isCharacterBox:IB(r)}}}),Z({type:`font`,names:[`\\rm`,`\\sf`,`\\tt`,`\\bf`,`\\it`,`\\cal`],numArgs:0,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=e.breakOnTokenText,a=n.mode,o=n.parseExpression(!0,i);return{type:`font`,mode:a,font:`math`+r.slice(1),body:{type:`ordgroup`,mode:n.mode,body:o}}}});var MG=(e,t)=>{var n=t.style,r=n.fracNum(),i=n.fracDen(),a=t.havingStyle(r),o=kU(e.numer,a,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,c=3.5/t.fontMetrics().ptPerEm;o.height=o.height<s?s:o.height,o.depth=o.depth<c?c:o.depth}a=t.havingStyle(i);var l=kU(e.denom,a,t),u,d,f;e.hasBarLine?(e.barSize?(d=OV(e.barSize,t),u=ZH(`frac-line`,t,d)):u=ZH(`frac-line`,t),d=u.height,f=u.height):(u=null,d=0,f=t.fontMetrics().defaultRuleThickness);var p,m,h;n.size===aV.DISPLAY.size?(p=t.fontMetrics().num1,m=d>0?3*f:7*f,h=t.fontMetrics().denom1):(d>0?(p=t.fontMetrics().num2,m=f):(p=t.fontMetrics().num3,m=3*f),h=t.fontMetrics().denom2);var g;if(u){var _=t.fontMetrics().axisHeight;p-o.depth-(_+.5*d)<m&&(p+=m-(p-o.depth-(_+.5*d))),_-.5*d-(l.height-h)<m&&(h+=m-(_-.5*d-(l.height-h)));var v=-(_-.5*d);g=nU({positionType:`individualShift`,children:[{type:`elem`,elem:l,shift:h},{type:`elem`,elem:u,shift:v},{type:`elem`,elem:o,shift:-p}]})}else{var y=p-o.depth-(l.height-h);y<m&&(p+=.5*(m-y),h+=.5*(m-y)),g=nU({positionType:`individualShift`,children:[{type:`elem`,elem:l,shift:h},{type:`elem`,elem:o,shift:-p}]})}a=t.havingStyle(n),g.height*=a.sizeMultiplier/t.sizeMultiplier,g.depth*=a.sizeMultiplier/t.sizeMultiplier;var b=n.size===aV.DISPLAY.size?t.fontMetrics().delim1:n.size===aV.SCRIPTSCRIPT.size?t.havingStyle(aV.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,x=e.leftDelim==null?OU(t,[`mopen`]):oG(e.leftDelim,b,!0,t.havingStyle(n),e.mode,[`mopen`]),S=e.continued?X([]):e.rightDelim==null?OU(t,[`mclose`]):oG(e.rightDelim,b,!0,t.havingStyle(n),e.mode,[`mclose`]);return X([`mord`].concat(a.sizingClasses(t)),[x,X([`mfrac`],[g]),S],t)},NG=(e,t)=>{var n=new Q(`mfrac`,[WU(e.numer,t),WU(e.denom,t)]);if(!e.hasBarLine)n.setAttribute(`linethickness`,`0px`);else if(e.barSize){var r=OV(e.barSize,t);n.setAttribute(`linethickness`,V(r))}if(e.leftDelim!=null||e.rightDelim!=null){var i=[];if(e.leftDelim!=null){var a=new Q(`mo`,[new NU(e.leftDelim.replace(`\\`,``))]);a.setAttribute(`fence`,`true`),i.push(a)}if(i.push(n),e.rightDelim!=null){var o=new Q(`mo`,[new NU(e.rightDelim.replace(`\\`,``))]);o.setAttribute(`fence`,`true`),i.push(o)}return RU(i)}return n},PG=(e,t)=>t?{type:`styling`,mode:e.mode,style:t,body:[e]}:e;Z({type:`genfrac`,names:[`\\cfrac`,`\\dfrac`,`\\frac`,`\\tfrac`,`\\dbinom`,`\\binom`,`\\tbinom`,`\\\\atopfrac`,`\\\\bracefrac`,`\\\\brackfrac`],numArgs:2,allowedInArgument:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=t[0],a=t[1],o,s=null,c=null;switch(r){case`\\cfrac`:case`\\dfrac`:case`\\frac`:case`\\tfrac`:o=!0;break;case`\\\\atopfrac`:o=!1;break;case`\\dbinom`:case`\\binom`:case`\\tbinom`:o=!1,s=`(`,c=`)`;break;case`\\\\bracefrac`:o=!1,s=`\\{`,c=`\\}`;break;case`\\\\brackfrac`:o=!1,s=`[`,c=`]`;break;default:throw Error(`Unrecognized genfrac command`)}var l=r===`\\cfrac`,u=null;return l||r.startsWith(`\\d`)?u=`display`:r.startsWith(`\\t`)&&(u=`text`),PG({type:`genfrac`,mode:n.mode,numer:i,denom:a,continued:l,hasBarLine:o,leftDelim:s,rightDelim:c,barSize:null},u)},htmlBuilder:MG,mathmlBuilder:NG}),Z({type:`infix`,names:[`\\over`,`\\choose`,`\\atop`,`\\brace`,`\\brack`],numArgs:0,infix:!0,handler(e){var t=e.parser,n=e.funcName,r=e.token,i;switch(n){case`\\over`:i=`\\frac`;break;case`\\choose`:i=`\\binom`;break;case`\\atop`:i=`\\\\atopfrac`;break;case`\\brace`:i=`\\\\bracefrac`;break;case`\\brack`:i=`\\\\brackfrac`;break;default:throw Error(`Unrecognized infix genfrac command`)}return{type:`infix`,mode:t.mode,replaceWith:i,token:r}}});var FG=[`display`,`text`,`script`,`scriptscript`],IG=function(e){var t=null;return e.length>0&&(t=e,t=t===`.`?null:t),t};Z({type:`genfrac`,names:[`\\genfrac`],numArgs:6,allowedInArgument:!0,argTypes:[`math`,`math`,`size`,`text`,`math`,`math`],handler(e,t){var n=e.parser,r=t[4],i=t[5],a=_U(t[0]),o=a.type===`atom`&&a.family===`open`?IG(a.text):null,s=_U(t[1]),c=s.type===`atom`&&s.family===`close`?IG(s.text):null,l=dW(t[2],`size`),u,d=null;l.isBlank?u=!0:(d=l.value,u=d.number>0);var f=null,p=t[3];if(p.type===`ordgroup`){if(p.body.length>0){var m=dW(p.body[0],`textord`);f=FG[Number(m.text)]}}else p=dW(p,`textord`),f=FG[Number(p.text)];return PG({type:`genfrac`,mode:n.mode,numer:r,denom:i,continued:!1,hasBarLine:u,barSize:d,leftDelim:o,rightDelim:c},f)}}),Z({type:`infix`,names:[`\\above`],numArgs:1,argTypes:[`size`],infix:!0,handler(e,t){var n=e.parser;e.funcName;var r=e.token;return{type:`infix`,mode:n.mode,replaceWith:`\\\\abovefrac`,size:dW(t[0],`size`).value,token:r}}}),Z({type:`genfrac`,names:[`\\\\abovefrac`],numArgs:3,argTypes:[`math`,`size`,`math`],handler:(e,t)=>{var n=e.parser;e.funcName;var r=t[0],i=dW(t[1],`infix`).size;if(!i)throw Error(`\\\\abovefrac expected size, but got `+String(i));var a=t[2],o=i.number>0;return{type:`genfrac`,mode:n.mode,numer:r,denom:a,continued:!1,hasBarLine:o,barSize:i,leftDelim:null,rightDelim:null}}});var LG=(e,t)=>{var n=t.style,r,i;e.type===`supsub`?(r=e.sup?kU(e.sup,t.havingStyle(n.sup()),t):kU(e.sub,t.havingStyle(n.sub()),t),i=dW(e.base,`horizBrace`)):i=dW(e,`horizBrace`);var a=kU(i.base,t.havingBaseStyle(aV.DISPLAY)),o=iW(i,t),s=i.isOver?nU({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:.1},{type:`elem`,elem:o,wrapperClasses:[`svg-align`]}]}):nU({positionType:`bottom`,positionData:a.depth+.1+o.height,children:[{type:`elem`,elem:o,wrapperClasses:[`svg-align`]},{type:`kern`,size:.1},{type:`elem`,elem:a}]});if(r){var c=X([`minner`,i.isOver?`mover`:`munder`],[s],t);s=i.isOver?nU({positionType:`firstBaseline`,children:[{type:`elem`,elem:c},{type:`kern`,size:.2},{type:`elem`,elem:r}]}):nU({positionType:`bottom`,positionData:c.depth+.2+r.height+r.depth,children:[{type:`elem`,elem:r},{type:`kern`,size:.2},{type:`elem`,elem:c}]})}return X([`minner`,i.isOver?`mover`:`munder`],[s],t)};Z({type:`horizBrace`,names:[`\\overbrace`,`\\underbrace`,`\\overbracket`,`\\underbracket`],numArgs:1,handler(e,t){var n=e.parser,r=e.funcName;return{type:`horizBrace`,mode:n.mode,label:r,isOver:r.includes(`\\over`),base:t[0]}},htmlBuilder:LG,mathmlBuilder:(e,t)=>{var n=tW(e.label);return new Q(e.isOver?`mover`:`munder`,[WU(e.base,t),n])}}),Z({type:`href`,names:[`\\href`],numArgs:2,argTypes:[`url`,`original`],allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=t[1],i=dW(t[0],`url`).url;return n.settings.isTrusted({command:`\\href`,url:i})?{type:`href`,mode:n.mode,href:i,body:vU(r)}:n.formatUnsupportedCmd(`\\href`)},htmlBuilder:(e,t)=>{var n=CU(e.body,t,!1);return QH(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=UU(e.body,t);return n instanceof Q||(n=new Q(`mrow`,[n])),n.setAttribute(`href`,e.href),n}}),Z({type:`href`,names:[`\\url`],numArgs:1,argTypes:[`url`],allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=dW(t[0],`url`).url;if(!n.settings.isTrusted({command:`\\url`,url:r}))return n.formatUnsupportedCmd(`\\url`);for(var i=[],a=0;a<r.length;a++){var o=r[a];o===`~`&&(o=`\\textasciitilde`),i.push({type:`textord`,mode:`text`,text:o})}var s={type:`text`,mode:n.mode,font:`\\texttt`,body:i};return{type:`href`,mode:n.mode,href:r,body:vU(s)}}}),Z({type:`hbox`,names:[`\\hbox`],numArgs:1,argTypes:[`text`],allowedInText:!0,primitive:!0,handler(e,t){return{type:`hbox`,mode:e.parser.mode,body:vU(t[0])}},htmlBuilder(e,t){return $H(CU(e.body,t.withFont(``),!1))},mathmlBuilder(e,t){return new Q(`mrow`,HU(e.body,t.withFont(``)))}}),Z({type:`html`,names:[`\\htmlClass`,`\\htmlId`,`\\htmlStyle`,`\\htmlData`],numArgs:2,argTypes:[`raw`,`original`],allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName;e.token;var i=dW(t[0],`raw`).string,a=t[1];n.settings.strict&&VH({strict:n.settings.strict,errorCode:`htmlExtension`,errorMsg:`HTML extension is disabled on strict mode`,report:!0});var o,s={};switch(r){case`\\htmlClass`:s.class=i,o={command:`\\htmlClass`,class:i};break;case`\\htmlId`:s.id=i,o={command:`\\htmlId`,id:i};break;case`\\htmlStyle`:s.style=i,o={command:`\\htmlStyle`,style:i};break;case`\\htmlData`:for(var c=`{,}`,l=[],u=``,d=0;d<i.length;d++)i.startsWith(c,d)?(u+=`,`,d+=c.length-1):i[d]===`,`?(l.push(u),u=``):u+=i[d];l.push(u);for(var f=0;f<l.length;f++){var p=l[f],m=p.indexOf(`=`);if(m<0)throw new B(`\\htmlData key/value '`+p+`' missing equals sign`);var h=p.slice(0,m),g=p.slice(m+1);s[`data-`+h.trim()]=g}o={command:`\\htmlData`,attributes:s};break;default:throw Error(`Unrecognized html command`)}return n.settings.isTrusted(o)?{type:`html`,mode:n.mode,attributes:s,body:vU(a)}:n.formatUnsupportedCmd(r)},htmlBuilder:(e,t)=>{var n=CU(e.body,t,!1),r=[`enclosing`];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=X(r,n,t);for(var a of Object.entries(e.attributes)){var o=a[0],s=a[1];o!==`class`&&i.setAttribute(o,s)}return i},mathmlBuilder:(e,t)=>UU(e.body,t)}),Z({type:`htmlmathml`,names:[`\\html@mathml`],numArgs:2,allowedInArgument:!0,allowedInText:!0,handler:(e,t)=>({type:`htmlmathml`,mode:e.parser.mode,html:vU(t[0]),mathml:vU(t[1])}),htmlBuilder:(e,t)=>$H(CU(e.html,t,!1)),mathmlBuilder:(e,t)=>UU(e.mathml,t)});var RG=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:`bp`};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new B(`Invalid size: '`+e+`' in \\includegraphics`);var n={number:+(t[1]+t[2]),unit:t[3]};if(!DV(n))throw new B(`Invalid unit: '`+n.unit+`' in \\includegraphics.`);return n};Z({type:`includegraphics`,names:[`\\includegraphics`],numArgs:1,numOptionalArgs:1,argTypes:[`raw`,`url`],allowedInText:!1,handler:(e,t,n)=>{var r=e.parser,i={number:0,unit:`em`},a={number:.9,unit:`em`},o={number:0,unit:`em`},s=``;if(n[0])for(var c=dW(n[0],`raw`).string.split(`,`),l=0;l<c.length;l++){var u=c[l].split(`=`);if(u.length===2){var d=u[1].trim();switch(u[0].trim()){case`alt`:s=d;break;case`width`:i=RG(d);break;case`height`:a=RG(d);break;case`totalheight`:o=RG(d);break;default:throw new B(`Invalid key: '`+u[0]+`' in \\includegraphics.`)}}}var f=dW(t[0],`url`).url;return s===``&&(s=f,s=s.replace(/^.*[\\/]/,``),s=s.substring(0,s.lastIndexOf(`.`))),r.settings.isTrusted({command:`\\includegraphics`,url:f})?{type:`includegraphics`,mode:r.mode,alt:s,width:i,height:a,totalheight:o,src:f}:r.formatUnsupportedCmd(`\\includegraphics`)},htmlBuilder:(e,t)=>{var n=OV(e.height,t),r=0;e.totalheight.number>0&&(r=OV(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=OV(e.width,t));var a={height:V(n+r)};i>0&&(a.width=V(i)),r>0&&(a.verticalAlign=V(-r));var o=new LV(e.src,e.alt,a);return o.height=n,o.depth=r,o},mathmlBuilder:(e,t)=>{var n=new Q(`mglyph`,[]);n.setAttribute(`alt`,e.alt);var r=OV(e.height,t),i=0;if(e.totalheight.number>0&&(i=OV(e.totalheight,t)-r,n.setAttribute(`valign`,V(-i))),n.setAttribute(`height`,V(r+i)),e.width.number>0){var a=OV(e.width,t);n.setAttribute(`width`,V(a))}return n.setAttribute(`src`,e.src),n}}),Z({type:`kern`,names:[`\\kern`,`\\mkern`,`\\hskip`,`\\mskip`],numArgs:1,argTypes:[`size`],primitive:!0,allowedInText:!0,handler(e,t){var n=e.parser,r=e.funcName,i=dW(t[0],`size`);if(n.settings.strict){var a=r[1]===`m`,o=i.value.unit===`mu`;a?(o||VH({strict:n.settings.strict,errorCode:`mathVsTextUnits`,errorMsg:`LaTeX's `+r+` supports only mu units, `+(`not `+i.value.unit+` units`),report:!0}),n.mode!==`math`&&VH({strict:n.settings.strict,errorCode:`mathVsTextUnits`,errorMsg:`LaTeX's `+r+` works only in math mode`,report:!0})):o&&VH({strict:n.settings.strict,errorCode:`mathVsTextUnits`,errorMsg:`LaTeX's `+r+` doesn't support mu units`,report:!0})}return{type:`kern`,mode:n.mode,dimension:i.value}},htmlBuilder(e,t){return rU(e.dimension,t)},mathmlBuilder(e,t){return new PU(OV(e.dimension,t))}}),Z({type:`lap`,names:[`\\mathllap`,`\\mathrlap`,`\\mathclap`],numArgs:1,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=t[0];return{type:`lap`,mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;e.alignment===`clap`?(n=X([],[kU(e.body,t)]),n=X([`katex-inner`],[n],t)):n=X([`katex-inner`],[kU(e.body,t)]);var r=X([`katex-fix`],[]),i=X([e.alignment],[n,r],t),a=X([`katex-strut`]);return a.style.height=V(i.height+i.depth),i.depth&&(a.style.verticalAlign=V(-i.depth)),i.children.unshift(a),i=X([`katex-thinbox`],[i],t),X([`mord`,`katex-vbox`],[i],t)},mathmlBuilder:(e,t)=>{var n=new Q(`mpadded`,[WU(e.body,t)]);if(e.alignment!==`rlap`){var r=e.alignment===`llap`?`-1`:`-0.5`;n.setAttribute(`lspace`,r+`width`)}return n.setAttribute(`width`,`0px`),n}}),Z({type:`styling`,names:[`\\(`,`$`],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(e,t){var n=e.funcName,r=e.parser,i=r.mode;r.switchMode(`math`);var a=n===`\\(`?`\\)`:`$`,o=r.parseExpression(!1,a);return r.expect(a),r.switchMode(i),{type:`styling`,mode:r.mode,style:`text`,resetFont:!0,body:o}}}),Z({type:`text`,names:[`\\)`,`\\]`],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(e,t){throw new B(`Mismatched `+e.funcName)}});var zG=(e,t)=>{switch(t.style.size){case aV.DISPLAY.size:return e.display;case aV.TEXT.size:return e.text;case aV.SCRIPT.size:return e.script;case aV.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Z({type:`mathchoice`,names:[`\\mathchoice`],numArgs:4,primitive:!0,handler:(e,t)=>({type:`mathchoice`,mode:e.parser.mode,display:vU(t[0]),text:vU(t[1]),script:vU(t[2]),scriptscript:vU(t[3])}),htmlBuilder:(e,t)=>$H(CU(zG(e,t),t,!1)),mathmlBuilder:(e,t)=>UU(zG(e,t),t)});var BG=(e,t,n,r,i,a,o)=>{e=X([],[e]);var s=n&&IB(n),c,l;if(t){var u=kU(t,r.havingStyle(i.sup()),r);l={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var d=kU(n,r.havingStyle(i.sub()),r);c={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}var f;if(l&&c)f=nU({positionType:`bottom`,positionData:r.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+e.depth+o,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:V(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:V(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]});else if(c)f=nU({positionType:`top`,positionData:e.height-o,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:V(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e}]});else if(l)f=nU({positionType:`bottom`,positionData:e.depth+o,children:[{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:V(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]});else return e;var p=[f];if(c&&a!==0&&!s){var m=X([`mspace`],[],r);m.style.marginRight=V(a),p.unshift(m)}return X([`mop`,`op-limits`],p,r)},VG=new Set([`\\smallint`]),HG=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=dW(e.base,`op`),i=!0):a=dW(e,`op`);var o=t.style,s=!1;o.size===aV.DISPLAY.size&&a.symbol&&!VG.has(a.name)&&(s=!0);var c,l;if(a.symbol){var u=s?`Size2-Regular`:`Size1-Regular`,d=``;if((a.name===`\\oiint`||a.name===`\\oiiint`)&&(d=a.name.slice(1),a.name=d===`oiint`?`\\iint`:`\\iiint`),c=UH(a.name,u,`math`,t,[`mop`,`op-symbol`,s?`large-op`:`small-op`]),l=c.italic,d.length>0){var f=sU(d+`Size`+(s?`2`:`1`),t);c=nU({positionType:`individualShift`,children:[{type:`elem`,elem:c,shift:0},{type:`elem`,elem:f,shift:s?.08:0}]}),a.name=`\\`+d,c.classes.unshift(`mop`),c.italic=l}}else if(a.body){var p=CU(a.body,t,!0);p.length===1&&p[0]instanceof zV?(c=p[0],c.classes[0]=`mop`):c=X([`mop`],p,t)}else{for(var m=[],h=1;h<a.name.length;h++)m.push(WH(a.name[h],a.mode,t));c=X([`mop`],m,t)}var g=0,_=0;return(c instanceof zV||a.name===`\\oiint`||a.name===`\\oiiint`)&&!a.suppressBaseShift&&(g=(c.height-c.depth)/2-t.fontMetrics().axisHeight,_=c.italic??0),i?BG(c,n,r,t,o,_,g):(g&&(c.style.position=`relative`,c.style.top=V(g)),c)},UG=(e,t)=>{var n;if(e.symbol)n=new Q(`mo`,[LU(e.name,e.mode)]),VG.has(e.name)&&n.setAttribute(`largeop`,`false`);else if(e.body)n=new Q(`mo`,HU(e.body,t));else{n=new Q(`mi`,[new NU(e.name.slice(1))]);var r=new Q(`mo`,[LU(`⁡`,`text`)]);n=e.parentIsSupSub?new Q(`mrow`,[n,r]):MU([n,r])}return n},WG={"∏":`\\prod`,"∐":`\\coprod`,"∑":`\\sum`,"⋀":`\\bigwedge`,"⋁":`\\bigvee`,"⋂":`\\bigcap`,"⋃":`\\bigcup`,"⨀":`\\bigodot`,"⨁":`\\bigoplus`,"⨂":`\\bigotimes`,"⨄":`\\biguplus`,"⨆":`\\bigsqcup`};Z({type:`op`,names:`\\coprod.\\bigvee.\\bigwedge.\\biguplus.\\bigcap.\\bigcup.\\intop.\\prod.\\sum.\\bigotimes.\\bigoplus.\\bigodot.\\bigsqcup.\\smallint.∏.∐.∑.⋀.⋁.⋂.⋃.⨀.⨁.⨂.⨄.⨆`.split(`.`),numArgs:0,handler:(e,t)=>{var n=e.parser,r=e.funcName;return r.length===1&&(r=WG[r]),{type:`op`,mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:HG,mathmlBuilder:UG}),Z({type:`op`,names:[`\\mathop`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`op`,mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:vU(r)}}});var GG={"∫":`\\int`,"∬":`\\iint`,"∭":`\\iiint`,"∮":`\\oint`,"∯":`\\oiint`,"∰":`\\oiiint`};Z({type:`op`,names:`\\arcsin.\\arccos.\\arctan.\\arctg.\\arcctg.\\arg.\\ch.\\cos.\\cosec.\\cosh.\\cot.\\cotg.\\coth.\\csc.\\ctg.\\cth.\\deg.\\dim.\\exp.\\hom.\\ker.\\lg.\\ln.\\log.\\sec.\\sin.\\sinh.\\sh.\\tan.\\tanh.\\tg.\\th`.split(`.`),numArgs:0,handler(e){var t=e.parser,n=e.funcName;return{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}}}),Z({type:`op`,names:[`\\det`,`\\gcd`,`\\inf`,`\\lim`,`\\max`,`\\min`,`\\Pr`,`\\sup`],numArgs:0,handler(e){var t=e.parser,n=e.funcName;return{type:`op`,mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}}}),Z({type:`op`,names:[`\\int`,`\\iint`,`\\iiint`,`\\oint`,`\\oiint`,`\\oiiint`,`∫`,`∬`,`∭`,`∮`,`∯`,`∰`],numArgs:0,allowedInArgument:!0,handler(e){var t=e.parser,n=e.funcName;return n.length===1&&(n=GG[n]),{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}}});var KG=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=dW(e.base,`operatorname`),i=!0):a=dW(e,`operatorname`);var o;if(a.body.length>0){for(var s=CU(a.body.map(e=>{var t=`text`in e?e.text:void 0;return typeof t==`string`?{type:`textord`,mode:e.mode,text:t}:e}),t.withFont(`mathrm`),!0),c=0;c<s.length;c++){var l=s[c];l instanceof zV&&(l.text=l.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`))}o=X([`mop`],s,t)}else o=X([`mop`],[],t);return i?BG(o,n,r,t,t.style,0,0):o};Z({type:`operatorname`,names:[`\\operatorname@`,`\\operatornamewithlimits`],numArgs:1,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=t[0];return{type:`operatorname`,mode:n.mode,body:vU(i),alwaysHandleSupSub:r===`\\operatornamewithlimits`,limits:!1,parentIsSupSub:!1}},htmlBuilder:KG,mathmlBuilder:(e,t)=>{for(var n=HU(e.body,t.withFont(`mathrm`)),r=!0,i=0;i<n.length;i++){var a=n[i];if(!(a instanceof PU)){if(a instanceof Q)switch(a.type){case`mi`:case`mn`:case`mspace`:case`mtext`:break;case`mo`:var o=a.children[0];a.children.length===1&&o instanceof NU?o.text=o.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`):r=!1;break;default:r=!1}else r=!1}}r&&(n=[new NU(n.map(e=>e.toText()).join(``))]);var s=new Q(`mi`,n);s.setAttribute(`mathvariant`,`normal`);var c=new Q(`mo`,[LU(`⁡`,`text`)]);return e.parentIsSupSub?new Q(`mrow`,[s,c]):MU([s,c])}}),$(`\\operatorname`,`\\@ifstar\\operatornamewithlimits\\operatorname@`),gU({type:`ordgroup`,htmlBuilder(e,t){return e.semisimple?$H(CU(e.body,t,!1)):X([`mord`],CU(e.body,t,!0),t)},mathmlBuilder(e,t){return UU(e.body,t,!0)}}),Z({type:`overline`,names:[`\\overline`],numArgs:1,handler(e,t){var n=e.parser,r=t[0];return{type:`overline`,mode:n.mode,body:r}},htmlBuilder(e,t){var n=kU(e.body,t.havingCrampedStyle()),r=ZH(`overline-line`,t),i=t.fontMetrics().defaultRuleThickness;return X([`mord`,`katex-overline`],[nU({positionType:`firstBaseline`,children:[{type:`elem`,elem:n},{type:`kern`,size:3*i},{type:`elem`,elem:r},{type:`kern`,size:i}]})],t)},mathmlBuilder(e,t){var n=new Q(`mo`,[new NU(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new Q(`mover`,[WU(e.body,t),n]);return r.setAttribute(`accent`,`true`),r}}),Z({type:`phantom`,names:[`\\phantom`],numArgs:1,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`phantom`,mode:n.mode,body:vU(r)}},htmlBuilder:(e,t)=>$H(CU(e.body,t.withPhantom(),!1)),mathmlBuilder:(e,t)=>new Q(`mphantom`,HU(e.body,t))}),$(`\\hphantom`,`\\smash{\\phantom{#1}}`),Z({type:`vphantom`,names:[`\\vphantom`],numArgs:1,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`vphantom`,mode:n.mode,body:r}},htmlBuilder:(e,t)=>X([`mord`,`rlap`],[X([`katex-inner`],[kU(e.body,t.withPhantom())]),X([`katex-fix`],[])],t),mathmlBuilder:(e,t)=>{var n=new Q(`mpadded`,[new Q(`mphantom`,HU(vU(e.body),t))]);return n.setAttribute(`width`,`0px`),n}}),Z({type:`raisebox`,names:[`\\raisebox`],numArgs:2,argTypes:[`size`,`hbox`],allowedInText:!0,handler(e,t){var n=e.parser,r=dW(t[0],`size`).value,i=t[1];return{type:`raisebox`,mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=kU(e.body,t);return nU({positionType:`shift`,positionData:-OV(e.dy,t),children:[{type:`elem`,elem:n}]})},mathmlBuilder(e,t){var n=new Q(`mpadded`,[WU(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute(`voffset`,r),n}});var qG=(e,t)=>({type:`reflectbox`,mode:e.parser.mode,body:t[0]});Z({type:`reflectbox`,names:[`\\reflectbox`],numArgs:1,argTypes:[`hbox`],allowedInText:!0,handler:qG,htmlBuilder(e,t){return X([`mord`,`reflectbox`],[kU(e.body,t)],t)},mathmlBuilder(e,t){return WU(e.body,t)}}),Z({type:`reflectbox`,names:[`\\mathreflectbox`],numArgs:1,argTypes:[`math`],handler:qG}),Z({type:`internal`,names:[`\\relax`],numArgs:0,allowedInText:!0,allowedInArgument:!0,handler(e){return{type:`internal`,mode:e.parser.mode}}}),Z({type:`rule`,names:[`\\rule`],numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`size`,`size`,`size`],handler(e,t,n){var r=e.parser,i=n[0],a=dW(t[0],`size`),o=dW(t[1],`size`);return{type:`rule`,mode:r.mode,shift:i&&dW(i,`size`).value,width:a.value,height:o.value}},htmlBuilder(e,t){var n=X([`mord`,`katex-rule`],[],t),r=OV(e.width,t),i=OV(e.height,t),a=e.shift?OV(e.shift,t):0;return n.style.borderRightWidth=V(r),n.style.borderTopWidth=V(i),n.style.bottom=V(a),n.width=r,n.height=i+a,n.depth=-a,n.maxFontSize=i*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=OV(e.width,t),r=OV(e.height,t),i=e.shift?OV(e.shift,t):0,a=t.color&&t.getColor()||`black`,o=new Q(`mspace`);o.setAttribute(`mathbackground`,a),o.setAttribute(`width`,V(n)),o.setAttribute(`height`,V(r));var s=new Q(`mpadded`,[o]);return i>=0?s.setAttribute(`height`,V(i)):(s.setAttribute(`height`,V(i)),s.setAttribute(`depth`,V(-i))),s.setAttribute(`voffset`,V(i)),s}});function JG(e,t,n){for(var r=CU(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,a=0;a<r.length;a++){var o=r[a].classes.indexOf(`katex-sizing`);o<0?Array.prototype.push.apply(r[a].classes,t.sizingClasses(n)):r[a].classes[o+1]===`reset-size`+t.size&&(r[a].classes[o+1]=`reset-size`+n.size),r[a].height*=i,r[a].depth*=i}return $H(r)}var YG=[`\\tiny`,`\\sixptsize`,`\\scriptsize`,`\\footnotesize`,`\\small`,`\\normalsize`,`\\large`,`\\Large`,`\\LARGE`,`\\huge`,`\\Huge`];Z({type:`sizing`,names:YG,numArgs:0,allowedInText:!0,handler:(e,t)=>{var n=e.breakOnTokenText,r=e.funcName,i=e.parser,a=i.parseExpression(!1,n);return{type:`sizing`,mode:i.mode,size:YG.indexOf(r)+1,body:a}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return JG(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=new Q(`mstyle`,HU(e.body,n));return r.setAttribute(`mathsize`,V(n.sizeMultiplier)),r}}),Z({type:`smash`,names:[`\\smash`],numArgs:1,numOptionalArgs:1,allowedInText:!0,handler:(e,t,n)=>{var r=e.parser,i=!1,a=!1,o=n[0]&&dW(n[0],`ordgroup`);if(o)for(var s,c=0;c<o.body.length;++c){var l=o.body[c];if(s=fW(l).text,s===`t`)i=!0;else if(s===`b`)a=!0;else{i=!1,a=!1;break}}else i=!0,a=!0;var u=t[0];return{type:`smash`,mode:r.mode,body:u,smashHeight:i,smashDepth:a}},htmlBuilder:(e,t)=>{var n=X([],[kU(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0),e.smashDepth&&(n.depth=0),e.smashHeight&&e.smashDepth)return X([`mord`,`katex-smash`],[n],t);if(n.children)for(var r=0;r<n.children.length;r++)e.smashHeight&&(n.children[r].height=0),e.smashDepth&&(n.children[r].depth=0);return X([`mord`],[nU({positionType:`firstBaseline`,children:[{type:`elem`,elem:n}]})],t)},mathmlBuilder:(e,t)=>{var n=new Q(`mpadded`,[WU(e.body,t)]);return e.smashHeight&&n.setAttribute(`height`,`0px`),e.smashDepth&&n.setAttribute(`depth`,`0px`),n}}),Z({type:`sqrt`,names:[`\\sqrt`],numArgs:1,numOptionalArgs:1,handler(e,t,n){var r=e.parser,i=n[0],a=t[0];return{type:`sqrt`,mode:r.mode,body:a,index:i}},htmlBuilder(e,t){var n=kU(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=eU(n,t);var r=t.fontMetrics().defaultRuleThickness,i=r;t.style.id<aV.TEXT.id&&(i=t.fontMetrics().xHeight);var a=r+i/4,o=YW(n.height+n.depth+a+r,t),s=o.span,c=o.ruleWidth,l=o.advanceWidth,u=s.height-c;u>n.height+n.depth+a&&(a=(a+u-n.height-n.depth)/2);var d=s.height-n.height-a-c;n.style.paddingLeft=V(l);var f=nU({positionType:`firstBaseline`,children:[{type:`elem`,elem:n,wrapperClasses:[`svg-align`]},{type:`kern`,size:-(n.height+d)},{type:`elem`,elem:s},{type:`kern`,size:c}]});if(e.index){var p=t.havingStyle(aV.SCRIPTSCRIPT),m=kU(e.index,p,t);return X([`mord`,`sqrt`],[X([`katex-root`],[nU({positionType:`shift`,positionData:-(.6*(f.height-f.depth)),children:[{type:`elem`,elem:m}]})]),f],t)}return X([`mord`,`sqrt`],[f],t)},mathmlBuilder(e,t){var n=e.body,r=e.index;return r?new Q(`mroot`,[WU(n,t),WU(r,t)]):new Q(`msqrt`,[WU(n,t)])}});var XG={display:aV.DISPLAY,text:aV.TEXT,script:aV.SCRIPT,scriptscript:aV.SCRIPTSCRIPT};function ZG(e){return e in XG}Z({type:`styling`,names:[`\\displaystyle`,`\\textstyle`,`\\scriptstyle`,`\\scriptscriptstyle`],numArgs:0,allowedInText:!0,primitive:!0,handler(e,t){var n=e.breakOnTokenText,r=e.funcName,i=e.parser,a=i.parseExpression(!0,n),o=r.slice(1,r.length-5);if(!ZG(o))throw Error(`Unknown style: `+o);return{type:`styling`,mode:i.mode,style:o,body:a}},htmlBuilder(e,t){var n=XG[e.style],r=t.havingStyle(n);return e.resetFont&&(r=r.withFont(``)),JG(e.body,r,t)},mathmlBuilder(e,t){var n=XG[e.style],r=t.havingStyle(n);e.resetFont&&(r=r.withFont(``));var i=new Q(`mstyle`,HU(e.body,r)),a={display:[`0`,`true`],text:[`0`,`false`],script:[`1`,`false`],scriptscript:[`2`,`false`]}[e.style];return i.setAttribute(`scriptlevel`,a[0]),i.setAttribute(`displaystyle`,a[1]),i}});var QG=function(e,t){var n=e.base;return n?n.type===`op`?n.limits&&(t.style.size===aV.DISPLAY.size||n.alwaysHandleSupSub)?HG:null:n.type===`operatorname`?n.alwaysHandleSupSub&&(t.style.size===aV.DISPLAY.size||n.limits)?KG:null:n.type===`accent`?IB(n.base)?gW:null:n.type===`horizBrace`&&!e.sub===n.isOver?LG:null:null};gU({type:`supsub`,htmlBuilder(e,t){var n=QG(e,t);if(n)return n(e,t);var r=e.base,i=e.sup,a=e.sub,o=kU(r,t),s,c,l=t.fontMetrics(),u=0,d=0,f=r&&IB(r);if(i){var p=t.havingStyle(t.style.sup());s=kU(i,p,t),f||(u=o.height-p.fontMetrics().supDrop*p.sizeMultiplier/t.sizeMultiplier)}if(a){var m=t.havingStyle(t.style.sub());c=kU(a,m,t),f||(d=o.depth+m.fontMetrics().subDrop*m.sizeMultiplier/t.sizeMultiplier)}var h=t.style===aV.DISPLAY?l.sup1:t.style.cramped?l.sup3:l.sup2,g=t.sizeMultiplier,_=V(.5/l.ptPerEm/g),v=null;if(c){var y=e.base&&e.base.type===`op`&&e.base.name&&(e.base.name===`\\oiint`||e.base.name===`\\oiiint`);(o instanceof zV||y)&&(v=V(-(o.italic??0)))}var b;if(s&&c){u=Math.max(u,h,s.depth+.25*l.xHeight),d=Math.max(d,l.sub2);var x=4*l.defaultRuleThickness;if(u-s.depth-(c.height-d)<x){d=x-(u-s.depth)+c.height;var S=.8*l.xHeight-(u-s.depth);S>0&&(u+=S,d-=S)}b=nU({positionType:`individualShift`,children:[{type:`elem`,elem:c,shift:d,marginRight:_,marginLeft:v},{type:`elem`,elem:s,shift:-u,marginRight:_}]})}else if(c)d=Math.max(d,l.sub1,c.height-.8*l.xHeight),b=nU({positionType:`shift`,positionData:d,children:[{type:`elem`,elem:c,marginLeft:v,marginRight:_}]});else if(s)u=Math.max(u,h,s.depth+.25*l.xHeight),b=nU({positionType:`shift`,positionData:-u,children:[{type:`elem`,elem:s,marginRight:_}]});else throw Error(`supsub must have either sup or sub.`);return X([DU(o,`right`)||`mord`],[o,X([`msupsub`],[b])],t)},mathmlBuilder(e,t){var n=!1,r,i;e.base&&e.base.type===`horizBrace`&&(i=!!e.sup,i===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&(e.base.type===`op`||e.base.type===`operatorname`)&&(e.base.parentIsSupSub=!0);var a=[WU(e.base,t)];e.sub&&a.push(WU(e.sub,t)),e.sup&&a.push(WU(e.sup,t));var o;if(n)o=r?`mover`:`munder`;else if(!e.sub){var s=e.base;o=s&&s.type===`op`&&s.limits&&(t.style===aV.DISPLAY||s.alwaysHandleSupSub)||s&&s.type===`operatorname`&&s.alwaysHandleSupSub&&(s.limits||t.style===aV.DISPLAY)?`mover`:`msup`}else if(e.sup){var c=e.base;o=c&&c.type===`op`&&c.limits&&t.style===aV.DISPLAY||c&&c.type===`operatorname`&&c.alwaysHandleSupSub&&(t.style===aV.DISPLAY||c.limits)?`munderover`:`msubsup`}else{var l=e.base;o=l&&l.type===`op`&&l.limits&&(t.style===aV.DISPLAY||l.alwaysHandleSupSub)||l&&l.type===`operatorname`&&l.alwaysHandleSupSub&&(l.limits||t.style===aV.DISPLAY)?`munder`:`msub`}return new Q(o,a)}}),gU({type:`atom`,htmlBuilder(e,t){return WH(e.text,e.mode,t,[`m`+e.family])},mathmlBuilder(e,t){var n=new Q(`mo`,[LU(e.text,e.mode)]);if(e.family===`bin`){var r=BU(e,t);r===`bold-italic`&&n.setAttribute(`mathvariant`,r)}else e.family===`punct`?n.setAttribute(`separator`,`true`):(e.family===`open`||e.family===`close`)&&n.setAttribute(`stretchy`,`false`);return n}});var $G={mi:`italic`,mn:`normal`,mtext:`normal`};gU({type:`mathord`,htmlBuilder(e,t){return KH(e,t)},mathmlBuilder(e,t){var n=new Q(`mi`,[LU(e.text,e.mode,t)]),r=BU(e,t)||`italic`;return r!==$G[n.type]&&n.setAttribute(`mathvariant`,r),n}}),gU({type:`textord`,htmlBuilder(e,t){return KH(e,t)},mathmlBuilder(e,t){var n=LU(e.text,e.mode,t),r=BU(e,t)||`normal`,i=e.mode===`text`?new Q(`mtext`,[n]):/[0-9]/.test(e.text)?new Q(`mn`,[n]):e.text===`\\prime`?new Q(`mo`,[n]):new Q(`mi`,[n]);return r!==$G[i.type]&&i.setAttribute(`mathvariant`,r),i}});var eK=new Map([[`\\nobreak`,`nobreak`],[`\\allowbreak`,`allowbreak`]]),tK=new Map([[` `,{}],[`\\ `,{}],[`~`,{className:`nobreak`}],[`\\space`,{}],[`\\nobreakspace`,{className:`nobreak`}]]);gU({type:`spacing`,htmlBuilder(e,t){var n=tK.get(e.text),r=eK.get(e.text);if(n){var i=n.className||``;if(e.mode===`text`){var a=KH(e,t);return a.classes.push(i),a}return X([`mspace`,i],[WH(e.text,e.mode,t)],t)}if(r)return X([`mspace`,r],[],t);throw new B(`Unknown type of space "`+e.text+`"`)},mathmlBuilder(e,t){var n;if(tK.has(e.text))n=new Q(`mtext`,[new NU(`\xA0`)]);else if(eK.has(e.text))return new Q(`mspace`);else throw new B(`Unknown type of space "`+e.text+`"`);return n}});var nK=()=>{var e=new Q(`mtd`,[]);return e.setAttribute(`width`,`50%`),e};gU({type:`tag`,mathmlBuilder(e,t){var n=new Q(`mtable`,[new Q(`mtr`,[nK(),new Q(`mtd`,[UU(e.body,t)]),nK(),new Q(`mtd`,[UU(e.tag,t)])])]);return n.setAttribute(`width`,`100%`),n}});var rK={"\\text":void 0,"\\textrm":`textrm`,"\\textsf":`textsf`,"\\texttt":`texttt`,"\\textnormal":`textrm`},iK={"\\textbf":`textbf`,"\\textmd":`textmd`},aK={"\\textit":`textit`,"\\textup":`textup`},oK=(e,t)=>{var n=e.font;return n?rK[n]?t.withTextFontFamily(rK[n]):iK[n]?t.withTextFontWeight(iK[n]):n===`\\emph`?t.fontShape===`textit`?t.withTextFontShape(`textup`):t.withTextFontShape(`textit`):t.withTextFontShape(aK[n]):t};Z({type:`text`,names:[`\\text`,`\\textrm`,`\\textsf`,`\\texttt`,`\\textnormal`,`\\textbf`,`\\textmd`,`\\textit`,`\\textup`,`\\emph`],numArgs:1,argTypes:[`text`],allowedInArgument:!0,allowedInText:!0,handler(e,t){var n=e.parser,r=e.funcName,i=t[0];return{type:`text`,mode:n.mode,body:vU(i),font:r}},htmlBuilder(e,t){var n=oK(e,t);return X([`mord`,`text`],CU(e.body,n,!0),n)},mathmlBuilder(e,t){var n=oK(e,t);return UU(e.body,n)}}),Z({type:`underline`,names:[`\\underline`],numArgs:1,allowedInText:!0,handler(e,t){return{type:`underline`,mode:e.parser.mode,body:t[0]}},htmlBuilder(e,t){var n=kU(e.body,t),r=ZH(`underline-line`,t),i=t.fontMetrics().defaultRuleThickness;return X([`mord`,`katex-underline`],[nU({positionType:`top`,positionData:n.height,children:[{type:`kern`,size:i},{type:`elem`,elem:r},{type:`kern`,size:3*i},{type:`elem`,elem:n}]})],t)},mathmlBuilder(e,t){var n=new Q(`mo`,[new NU(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new Q(`munder`,[WU(e.body,t),n]);return r.setAttribute(`accentunder`,`true`),r}}),Z({type:`vcenter`,names:[`\\vcenter`],numArgs:1,argTypes:[`original`],allowedInText:!1,handler(e,t){return{type:`vcenter`,mode:e.parser.mode,body:t[0]}},htmlBuilder(e,t){var n=kU(e.body,t),r=t.fontMetrics().axisHeight;return nU({positionType:`shift`,positionData:.5*(n.height-r-(n.depth+r)),children:[{type:`elem`,elem:n}]})},mathmlBuilder(e,t){return new Q(`mrow`,[new Q(`mpadded`,[WU(e.body,t)],[`vcenter`])])}}),Z({type:`verb`,names:[`\\verb`],numArgs:0,allowedInText:!0,handler(e,t,n){throw new B(`\\verb ended by end of line instead of matching delimiter`)},htmlBuilder(e,t){for(var n=sK(e),r=[],i=t.havingStyle(t.style.text()),a=0;a<n.length;a++){var o=n[a];o===`~`&&(o=`\\textasciitilde`),r.push(UH(o,`Typewriter-Regular`,e.mode,i,[`mord`,`texttt`]))}return X([`mord`,`text`].concat(i.sizingClasses(t)),JH(r),i)},mathmlBuilder(e,t){var n=new Q(`mtext`,[new NU(sK(e))]);return n.setAttribute(`mathvariant`,`monospace`),n}});var sK=e=>e.body.replace(/ /g,e.star?`␣`:`\xA0`),cK=pU,lK=`[ \r
381
- ]`,uK=`\\\\[a-zA-Z@]+`,dK=`\\\\[^\ud800-\udfff]`,fK=`(`+uK+`)`+lK+`*`,pK=`\\\\(
382
- |[ \r ]+
383
- ?)[ \r ]*`,mK=`[̀-ͯ]`,hK=RegExp(mK+`+$`),gK=`(`+lK+`+)|`+(pK+`|`)+`([!-\\[\\]-‧‪-퟿豈-￿]`+(mK+`*`)+`|[\ud800-\udbff][\udc00-\udfff]`+(mK+`*`)+`|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5`+(`|`+fK)+(`|`+dK+`)`),_K=class{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(gK,`g`),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new _G(`EOF`,new gG(this,t,t));var n=this.tokenRegex.exec(e);if(n===null||n.index!==t)throw new B(`Unexpected character: '`+e[t]+`'`,new _G(e[t],new gG(this,t,t+1)));var r=n[6]||n[3]||(n[2]?`\\ `:` `);if(this.catcodes[r]===14){var i=e.indexOf(`
384
- `,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=e.length,VH({strict:this.settings.strict,errorCode:`commentAtEnd`,errorMsg:`% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)`,report:!0})):this.tokenRegex.lastIndex=i+1,this.lex()}return new _G(r,new gG(this,t,this.tokenRegex.lastIndex))}},vK=class{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new B(`Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug`);var e=this.undefStack.pop();for(var t of Object.keys(e))e[t]===void 0?delete this.current[t]:this.current[t]=e[t]}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return Object.prototype.hasOwnProperty.call(this.current,e)||Object.prototype.hasOwnProperty.call(this.builtins,e)}get(e){if(Object.prototype.hasOwnProperty.call(this.current,e))return this.current[e];if(Object.prototype.hasOwnProperty.call(this.builtins,e))return this.builtins[e]}set(e,t,n){if(n===void 0&&(n=!1),n){for(var r=0;r<this.undefStack.length;r++)delete this.undefStack[r][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!Object.prototype.hasOwnProperty.call(i,e)&&(i[e]=Object.prototype.hasOwnProperty.call(this.current,e)?this.current[e]:void 0)}t==null?delete this.current[e]:this.current[e]=t}},yK=hG;$(`\\noexpand`,function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),$(`\\expandafter`,function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),$(`\\@firstoftwo`,function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),$(`\\@secondoftwo`,function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),$(`\\@ifnextchar`,function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),$(`\\@ifstar`,`\\@ifnextchar *{\\@firstoftwo{#1}}`),$(`\\TextOrMath`,function(e){var t=e.consumeArgs(2);return e.mode===`text`?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var bK={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};$(`\\char`,function(e){var t=e.popToken(),n,r=0;if(t.text===`'`)n=8,t=e.popToken();else if(t.text===`"`)n=16,t=e.popToken();else if(t.text==="`"){if(t=e.popToken(),t.text[0]===`\\`)r=t.text.charCodeAt(1);else if(t.text===`EOF`)throw new B("\\char` missing argument");else r=t.text.charCodeAt(0)}else n=10;if(n){if(r=bK[t.text],r==null||r>=n)throw new B(`Invalid base-`+n+` digit `+t.text);for(var i;(i=bK[e.future().text])!=null&&i<n;)r*=n,r+=i,e.popToken()}return`\\@char{`+r+`}`});var xK=(e,t,n,r)=>{var i=e.consumeArg().tokens;if(i.length!==1)throw new B(`\\newcommand's first argument must be a macro name`);var a=i[0].text,o=e.isDefined(a);if(o&&!t)throw new B(`\\newcommand{`+a+`} attempting to redefine `+(a+`; use \\renewcommand`));if(!o&&!n)throw new B(`\\renewcommand{`+a+`} when command `+a+` does not yet exist; use \\newcommand`);var s=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text===`[`){for(var c=``,l=e.expandNextToken();l.text!==`]`&&l.text!==`EOF`;)c+=l.text,l=e.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new B(`Invalid number of arguments: `+c);s=parseInt(c),i=e.consumeArg().tokens}return o&&r||e.macros.set(a,{tokens:i,numArgs:s}),``};$(`\\newcommand`,e=>xK(e,!1,!0,!1)),$(`\\renewcommand`,e=>xK(e,!0,!1,!1)),$(`\\providecommand`,e=>xK(e,!0,!0,!0)),$(`\\message`,e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join(``)),``}),$(`\\errmessage`,e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join(``)),``}),$(`\\show`,e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),cK[n],$V.math[n],$V.text[n]),``}),$(`\\bgroup`,`{`),$(`\\egroup`,`}`),$(`~`,`\\nobreakspace`),$(`\\lq`,"`"),$(`\\rq`,`'`),$(`\\aa`,`\\r a`),$(`\\AA`,`\\r A`),$(`\\textcopyright`,"\\html@mathml{\\textcircled{c}}{\\char`©}"),$(`\\copyright`,`\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}`),$(`\\textregistered`,"\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),$(`ℬ`,`\\mathscr{B}`),$(`ℰ`,`\\mathscr{E}`),$(`ℱ`,`\\mathscr{F}`),$(`ℋ`,`\\mathscr{H}`),$(`ℐ`,`\\mathscr{I}`),$(`ℒ`,`\\mathscr{L}`),$(`ℳ`,`\\mathscr{M}`),$(`ℛ`,`\\mathscr{R}`),$(`ℭ`,`\\mathfrak{C}`),$(`ℌ`,`\\mathfrak{H}`),$(`ℨ`,`\\mathfrak{Z}`),$(`\\Bbbk`,`\\Bbb{k}`),$(`\\llap`,`\\mathllap{\\textrm{#1}}`),$(`\\rlap`,`\\mathrlap{\\textrm{#1}}`),$(`\\clap`,`\\mathclap{\\textrm{#1}}`),$(`\\mathstrut`,`\\vphantom{(}`),$(`\\underbar`,`\\underline{\\text{#1}}`),$(`\\not`,`\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}`),$(`\\neq`,"\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),$(`\\ne`,`\\neq`),$(`≠`,`\\neq`),$(`\\notin`,"\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),$(`∉`,`\\notin`),$(`≘`,"\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),$(`≙`,"\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),$(`≚`,"\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),$(`≛`,"\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),$(`≝`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),$(`≞`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),$(`≟`,"\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),$(`⟂`,`\\perp`),$(`‼`,`\\mathclose{!\\mkern-0.8mu!}`),$(`∌`,`\\notni`),$(`⌜`,`\\ulcorner`),$(`⌝`,`\\urcorner`),$(`⌞`,`\\llcorner`),$(`⌟`,`\\lrcorner`),$(`©`,`\\copyright`),$(`®`,`\\textregistered`),$(`\\ulcorner`,`\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}`),$(`\\urcorner`,`\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}`),$(`\\llcorner`,`\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}`),$(`\\lrcorner`,`\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}`),$(`\\vdots`,`{\\varvdots\\rule{0pt}{15pt}}`),$(`⋮`,`\\vdots`),$(`\\varGamma`,`\\mathit{\\Gamma}`),$(`\\varDelta`,`\\mathit{\\Delta}`),$(`\\varTheta`,`\\mathit{\\Theta}`),$(`\\varLambda`,`\\mathit{\\Lambda}`),$(`\\varXi`,`\\mathit{\\Xi}`),$(`\\varPi`,`\\mathit{\\Pi}`),$(`\\varSigma`,`\\mathit{\\Sigma}`),$(`\\varUpsilon`,`\\mathit{\\Upsilon}`),$(`\\varPhi`,`\\mathit{\\Phi}`),$(`\\varPsi`,`\\mathit{\\Psi}`),$(`\\varOmega`,`\\mathit{\\Omega}`),$(`\\substack`,`\\begin{subarray}{c}#1\\end{subarray}`),$(`\\colon`,`\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax`),$(`\\boxed`,`\\fbox{$\\displaystyle{#1}$}`),$(`\\iff`,`\\DOTSB\\;\\Longleftrightarrow\\;`),$(`\\implies`,`\\DOTSB\\;\\Longrightarrow\\;`),$(`\\impliedby`,`\\DOTSB\\;\\Longleftarrow\\;`),$(`\\dddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}`),$(`\\ddddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}`);var SK={",":`\\dotsc`,"\\not":`\\dotsb`,"+":`\\dotsb`,"=":`\\dotsb`,"<":`\\dotsb`,">":`\\dotsb`,"-":`\\dotsb`,"*":`\\dotsb`,":":`\\dotsb`,"\\DOTSB":`\\dotsb`,"\\coprod":`\\dotsb`,"\\bigvee":`\\dotsb`,"\\bigwedge":`\\dotsb`,"\\biguplus":`\\dotsb`,"\\bigcap":`\\dotsb`,"\\bigcup":`\\dotsb`,"\\prod":`\\dotsb`,"\\sum":`\\dotsb`,"\\bigotimes":`\\dotsb`,"\\bigoplus":`\\dotsb`,"\\bigodot":`\\dotsb`,"\\bigsqcup":`\\dotsb`,"\\And":`\\dotsb`,"\\longrightarrow":`\\dotsb`,"\\Longrightarrow":`\\dotsb`,"\\longleftarrow":`\\dotsb`,"\\Longleftarrow":`\\dotsb`,"\\longleftrightarrow":`\\dotsb`,"\\Longleftrightarrow":`\\dotsb`,"\\mapsto":`\\dotsb`,"\\longmapsto":`\\dotsb`,"\\hookrightarrow":`\\dotsb`,"\\doteq":`\\dotsb`,"\\mathbin":`\\dotsb`,"\\mathrel":`\\dotsb`,"\\relbar":`\\dotsb`,"\\Relbar":`\\dotsb`,"\\xrightarrow":`\\dotsb`,"\\xleftarrow":`\\dotsb`,"\\DOTSI":`\\dotsi`,"\\int":`\\dotsi`,"\\oint":`\\dotsi`,"\\iint":`\\dotsi`,"\\iiint":`\\dotsi`,"\\iiiint":`\\dotsi`,"\\idotsint":`\\dotsi`,"\\DOTSX":`\\dotsx`},CK=new Set([`bin`,`rel`]);$(`\\dots`,function(e){var t=`\\dotso`,n=e.expandAfterFuture().text;return n in SK?t=SK[n]:(n.slice(0,4)===`\\not`||n in $V.math&&CK.has($V.math[n].group))&&(t=`\\dotsb`),t});var wK={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};$(`\\dotso`,function(e){return e.future().text in wK?`\\ldots\\,`:`\\ldots`}),$(`\\dotsc`,function(e){var t=e.future().text;return t in wK&&t!==`,`?`\\ldots\\,`:`\\ldots`}),$(`\\cdots`,function(e){return e.future().text in wK?`\\@cdots\\,`:`\\@cdots`}),$(`\\dotsb`,`\\cdots`),$(`\\dotsm`,`\\cdots`),$(`\\dotsi`,`\\!\\cdots`),$(`\\dotsx`,`\\ldots\\,`),$(`\\DOTSI`,`\\relax`),$(`\\DOTSB`,`\\relax`),$(`\\DOTSX`,`\\relax`),$(`\\tmspace`,`\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax`),$(`\\,`,`\\tmspace+{3mu}{.1667em}`),$(`\\thinspace`,`\\,`),$(`\\>`,`\\mskip{4mu}`),$(`\\:`,`\\tmspace+{4mu}{.2222em}`),$(`\\medspace`,`\\:`),$(`\\;`,`\\tmspace+{5mu}{.2777em}`),$(`\\thickspace`,`\\;`),$(`\\!`,`\\tmspace-{3mu}{.1667em}`),$(`\\negthinspace`,`\\!`),$(`\\negmedspace`,`\\tmspace-{4mu}{.2222em}`),$(`\\negthickspace`,`\\tmspace-{5mu}{.277em}`),$(`\\enspace`,`\\kern.5em `),$(`\\enskip`,`\\hskip.5em\\relax`),$(`\\quad`,`\\hskip1em\\relax`),$(`\\qquad`,`\\hskip2em\\relax`),$(`\\tag`,`\\@ifstar\\tag@literal\\tag@paren`),$(`\\tag@paren`,`\\tag@literal{({#1})}`),$(`\\tag@literal`,e=>{if(e.macros.get(`\\df@tag`))throw new B(`Multiple \\tag`);return`\\gdef\\df@tag{\\text{#1}}`}),$(`\\bmod`,`\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}`),$(`\\pod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)`),$(`\\pmod`,`\\pod{{\\rm mod}\\mkern6mu#1}`),$(`\\mod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1`),$(`\\newline`,`\\\\\\relax`),$(`\\TeX`,`\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}`);var TK=V(KV[`Main-Regular`][84][1]-.7*KV[`Main-Regular`][65][1]);$(`\\LaTeX`,`\\textrm{\\html@mathml{`+(`L\\kern-.36em\\raisebox{`+TK+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{LaTeX}}`),$(`\\KaTeX`,`\\textrm{\\html@mathml{`+(`K\\kern-.17em\\raisebox{`+TK+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{KaTeX}}`),$(`\\hspace`,`\\@ifstar\\@hspacer\\@hspace`),$(`\\@hspace`,`\\hskip #1\\relax`),$(`\\@hspacer`,`\\rule{0pt}{0pt}\\hskip #1\\relax`),$(`\\ordinarycolon`,`:`),$(`\\vcentcolon`,`\\mathrel{\\mathop\\ordinarycolon}`),$(`\\dblcolon`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}`),$(`\\coloneqq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}`),$(`\\Coloneqq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}`),$(`\\coloneq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}`),$(`\\Coloneq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}`),$(`\\eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}`),$(`\\Eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}`),$(`\\eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}`),$(`\\Eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}`),$(`\\colonapprox`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}`),$(`\\Colonapprox`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}`),$(`\\colonsim`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}`),$(`\\Colonsim`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}`),$(`∷`,`\\dblcolon`),$(`∹`,`\\eqcolon`),$(`≔`,`\\coloneqq`),$(`≕`,`\\eqqcolon`),$(`⩴`,`\\Coloneqq`),$(`\\ratio`,`\\vcentcolon`),$(`\\coloncolon`,`\\dblcolon`),$(`\\colonequals`,`\\coloneqq`),$(`\\coloncolonequals`,`\\Coloneqq`),$(`\\equalscolon`,`\\eqqcolon`),$(`\\equalscoloncolon`,`\\Eqqcolon`),$(`\\colonminus`,`\\coloneq`),$(`\\coloncolonminus`,`\\Coloneq`),$(`\\minuscolon`,`\\eqcolon`),$(`\\minuscoloncolon`,`\\Eqcolon`),$(`\\coloncolonapprox`,`\\Colonapprox`),$(`\\coloncolonsim`,`\\Colonsim`),$(`\\simcolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),$(`\\simcoloncolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}`),$(`\\approxcolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),$(`\\approxcoloncolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}`),$(`\\notni`,"\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),$(`\\limsup`,`\\DOTSB\\operatorname*{lim\\,sup}`),$(`\\liminf`,`\\DOTSB\\operatorname*{lim\\,inf}`),$(`\\injlim`,`\\DOTSB\\operatorname*{inj\\,lim}`),$(`\\projlim`,`\\DOTSB\\operatorname*{proj\\,lim}`),$(`\\varlimsup`,`\\DOTSB\\operatorname*{\\overline{lim}}`),$(`\\varliminf`,`\\DOTSB\\operatorname*{\\underline{lim}}`),$(`\\varinjlim`,`\\DOTSB\\operatorname*{\\underrightarrow{lim}}`),$(`\\varprojlim`,`\\DOTSB\\operatorname*{\\underleftarrow{lim}}`),$(`\\gvertneqq`,`\\html@mathml{\\@gvertneqq}{≩}`),$(`\\lvertneqq`,`\\html@mathml{\\@lvertneqq}{≨}`),$(`\\ngeqq`,`\\html@mathml{\\@ngeqq}{≱}`),$(`\\ngeqslant`,`\\html@mathml{\\@ngeqslant}{≱}`),$(`\\nleqq`,`\\html@mathml{\\@nleqq}{≰}`),$(`\\nleqslant`,`\\html@mathml{\\@nleqslant}{≰}`),$(`\\nshortmid`,`\\html@mathml{\\@nshortmid}{∤}`),$(`\\nshortparallel`,`\\html@mathml{\\@nshortparallel}{∦}`),$(`\\nsubseteqq`,`\\html@mathml{\\@nsubseteqq}{⊈}`),$(`\\nsupseteqq`,`\\html@mathml{\\@nsupseteqq}{⊉}`),$(`\\varsubsetneq`,`\\html@mathml{\\@varsubsetneq}{⊊}`),$(`\\varsubsetneqq`,`\\html@mathml{\\@varsubsetneqq}{⫋}`),$(`\\varsupsetneq`,`\\html@mathml{\\@varsupsetneq}{⊋}`),$(`\\varsupsetneqq`,`\\html@mathml{\\@varsupsetneqq}{⫌}`),$(`\\imath`,`\\html@mathml{\\@imath}{ı}`),$(`\\jmath`,`\\html@mathml{\\@jmath}{ȷ}`),$(`\\llbracket`,"\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),$(`\\rrbracket`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),$(`⟦`,`\\llbracket`),$(`⟧`,`\\rrbracket`),$(`\\lBrace`,"\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),$(`\\rBrace`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),$(`↤`,`\\mapsfrom`),$(`\\mapsfrom`,"\\html@mathml{\\mathrel{\\mathreflectbox{\\mapsto}}}{\\mathrel{\\char`↤}}"),$(`⦃`,`\\lBrace`),$(`⦄`,`\\rBrace`),$(`\\minuso`,"\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),$(`⦵`,`\\minuso`),$(`\\darr`,`\\downarrow`),$(`\\dArr`,`\\Downarrow`),$(`\\Darr`,`\\Downarrow`),$(`\\lang`,`\\langle`),$(`\\rang`,`\\rangle`),$(`\\uarr`,`\\uparrow`),$(`\\uArr`,`\\Uparrow`),$(`\\Uarr`,`\\Uparrow`),$(`\\N`,`\\mathbb{N}`),$(`\\R`,`\\mathbb{R}`),$(`\\Z`,`\\mathbb{Z}`),$(`\\alef`,`\\aleph`),$(`\\alefsym`,`\\aleph`),$(`\\Alpha`,`\\mathrm{A}`),$(`\\Beta`,`\\mathrm{B}`),$(`\\bull`,`\\bullet`),$(`\\Chi`,`\\mathrm{X}`),$(`\\clubs`,`\\clubsuit`),$(`\\cnums`,`\\mathbb{C}`),$(`\\Complex`,`\\mathbb{C}`),$(`\\Dagger`,`\\ddagger`),$(`\\diamonds`,`\\diamondsuit`),$(`\\empty`,`\\emptyset`),$(`\\Epsilon`,`\\mathrm{E}`),$(`\\Eta`,`\\mathrm{H}`),$(`\\exist`,`\\exists`),$(`\\harr`,`\\leftrightarrow`),$(`\\hArr`,`\\Leftrightarrow`),$(`\\Harr`,`\\Leftrightarrow`),$(`\\hearts`,`\\heartsuit`),$(`\\image`,`\\Im`),$(`\\infin`,`\\infty`),$(`\\Iota`,`\\mathrm{I}`),$(`\\isin`,`\\in`),$(`\\Kappa`,`\\mathrm{K}`),$(`\\larr`,`\\leftarrow`),$(`\\lArr`,`\\Leftarrow`),$(`\\Larr`,`\\Leftarrow`),$(`\\lrarr`,`\\leftrightarrow`),$(`\\lrArr`,`\\Leftrightarrow`),$(`\\Lrarr`,`\\Leftrightarrow`),$(`\\Mu`,`\\mathrm{M}`),$(`\\natnums`,`\\mathbb{N}`),$(`\\Nu`,`\\mathrm{N}`),$(`\\Omicron`,`\\mathrm{O}`),$(`\\plusmn`,`\\pm`),$(`\\rarr`,`\\rightarrow`),$(`\\rArr`,`\\Rightarrow`),$(`\\Rarr`,`\\Rightarrow`),$(`\\real`,`\\Re`),$(`\\reals`,`\\mathbb{R}`),$(`\\Reals`,`\\mathbb{R}`),$(`\\Rho`,`\\mathrm{P}`),$(`\\sdot`,`\\cdot`),$(`\\sect`,`\\S`),$(`\\spades`,`\\spadesuit`),$(`\\sub`,`\\subset`),$(`\\sube`,`\\subseteq`),$(`\\supe`,`\\supseteq`),$(`\\Tau`,`\\mathrm{T}`),$(`\\thetasym`,`\\vartheta`),$(`\\weierp`,`\\wp`),$(`\\Zeta`,`\\mathrm{Z}`),$(`\\argmin`,`\\DOTSB\\operatorname*{arg\\,min}`),$(`\\argmax`,`\\DOTSB\\operatorname*{arg\\,max}`),$(`\\plim`,`\\DOTSB\\mathop{\\operatorname{plim}}\\limits`),$(`\\bra`,`\\mathinner{\\langle{#1}|}`),$(`\\ket`,`\\mathinner{|{#1}\\rangle}`),$(`\\braket`,`\\mathinner{\\langle{#1}\\rangle}`),$(`\\Bra`,`\\left\\langle#1\\right|`),$(`\\Ket`,`\\left|#1\\right\\rangle`);var EK=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.consumeArg().tokens,o=t.macros.get(`|`),s=t.macros.get(`\\|`);t.macros.beginGroup();var c=t=>n=>{e&&(n.macros.set(`|`,o),i.length&&n.macros.set(`\\|`,s));var a=t;return!t&&i.length&&n.future().text===`|`&&(n.popToken(),a=!0),{tokens:a?i:r,numArgs:0}};t.macros.set(`|`,c(!1)),i.length&&t.macros.set(`\\|`,c(!0));var l=t.consumeArg().tokens,u=t.expandTokens([...a,...l,...n]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};$(`\\bra@ket`,EK(!1)),$(`\\bra@set`,EK(!0)),$(`\\Braket`,`\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}`),$(`\\Set`,`\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}`),$(`\\set`,`\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}`),$(`\\angln`,`{\\angl n}`),$(`\\blue`,`\\textcolor{##6495ed}{#1}`),$(`\\orange`,`\\textcolor{##ffa500}{#1}`),$(`\\pink`,`\\textcolor{##ff00af}{#1}`),$(`\\red`,`\\textcolor{##df0030}{#1}`),$(`\\green`,`\\textcolor{##28ae7b}{#1}`),$(`\\gray`,`\\textcolor{gray}{#1}`),$(`\\purple`,`\\textcolor{##9d38bd}{#1}`),$(`\\blueA`,`\\textcolor{##ccfaff}{#1}`),$(`\\blueB`,`\\textcolor{##80f6ff}{#1}`),$(`\\blueC`,`\\textcolor{##63d9ea}{#1}`),$(`\\blueD`,`\\textcolor{##11accd}{#1}`),$(`\\blueE`,`\\textcolor{##0c7f99}{#1}`),$(`\\tealA`,`\\textcolor{##94fff5}{#1}`),$(`\\tealB`,`\\textcolor{##26edd5}{#1}`),$(`\\tealC`,`\\textcolor{##01d1c1}{#1}`),$(`\\tealD`,`\\textcolor{##01a995}{#1}`),$(`\\tealE`,`\\textcolor{##208170}{#1}`),$(`\\greenA`,`\\textcolor{##b6ffb0}{#1}`),$(`\\greenB`,`\\textcolor{##8af281}{#1}`),$(`\\greenC`,`\\textcolor{##74cf70}{#1}`),$(`\\greenD`,`\\textcolor{##1fab54}{#1}`),$(`\\greenE`,`\\textcolor{##0d923f}{#1}`),$(`\\goldA`,`\\textcolor{##ffd0a9}{#1}`),$(`\\goldB`,`\\textcolor{##ffbb71}{#1}`),$(`\\goldC`,`\\textcolor{##ff9c39}{#1}`),$(`\\goldD`,`\\textcolor{##e07d10}{#1}`),$(`\\goldE`,`\\textcolor{##a75a05}{#1}`),$(`\\redA`,`\\textcolor{##fca9a9}{#1}`),$(`\\redB`,`\\textcolor{##ff8482}{#1}`),$(`\\redC`,`\\textcolor{##f9685d}{#1}`),$(`\\redD`,`\\textcolor{##e84d39}{#1}`),$(`\\redE`,`\\textcolor{##bc2612}{#1}`),$(`\\maroonA`,`\\textcolor{##ffbde0}{#1}`),$(`\\maroonB`,`\\textcolor{##ff92c6}{#1}`),$(`\\maroonC`,`\\textcolor{##ed5fa6}{#1}`),$(`\\maroonD`,`\\textcolor{##ca337c}{#1}`),$(`\\maroonE`,`\\textcolor{##9e034e}{#1}`),$(`\\purpleA`,`\\textcolor{##ddd7ff}{#1}`),$(`\\purpleB`,`\\textcolor{##c6b9fc}{#1}`),$(`\\purpleC`,`\\textcolor{##aa87ff}{#1}`),$(`\\purpleD`,`\\textcolor{##7854ab}{#1}`),$(`\\purpleE`,`\\textcolor{##543b78}{#1}`),$(`\\mintA`,`\\textcolor{##f5f9e8}{#1}`),$(`\\mintB`,`\\textcolor{##edf2df}{#1}`),$(`\\mintC`,`\\textcolor{##e0e5cc}{#1}`),$(`\\grayA`,`\\textcolor{##f6f7f7}{#1}`),$(`\\grayB`,`\\textcolor{##f0f1f2}{#1}`),$(`\\grayC`,`\\textcolor{##e3e5e6}{#1}`),$(`\\grayD`,`\\textcolor{##d6d8da}{#1}`),$(`\\grayE`,`\\textcolor{##babec2}{#1}`),$(`\\grayF`,`\\textcolor{##888d93}{#1}`),$(`\\grayG`,`\\textcolor{##626569}{#1}`),$(`\\grayH`,`\\textcolor{##3b3e40}{#1}`),$(`\\grayI`,`\\textcolor{##21242c}{#1}`),$(`\\kaBlue`,`\\textcolor{##314453}{#1}`),$(`\\kaGreen`,`\\textcolor{##71B307}{#1}`);var DK={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},OK=class{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new vK(yK,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new _K(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),this.future().text!==`[`)return null;t=this.popToken();var i=this.consumeArg([`]`]);r=i.tokens,n=i.end}else{var a=this.consumeArg();r=a.tokens,t=a.start,n=a.end}return this.pushToken(new _G(`EOF`,n.loc)),this.pushTokens(r),new _G(``,gG.range(t,n))}consumeSpaces(){for(;this.future().text===` `;)this.stack.pop()}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text===`{`)++a;else if(i.text===`}`){if(--a,a===-1)throw new B(`Extra }`,i)}else if(i.text===`EOF`)throw new B(`Unexpected end of input in a macro argument, expected '`+(e&&n?e[o]:`}`)+`'`,i);if(e&&n){if((a===0||a===1&&e[o]===`{`)&&i.text===e[o]){if(++o,o===e.length){t.splice(-o,o);break}}else o=0}}while(a!==0||n);return r.text===`{`&&t[t.length-1].text===`}`&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:r,end:i}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new B(`The length of delimiters doesn't match the number of args!`);for(var n=t[0],r=0;r<n.length;r++){var i=this.popToken();if(n[r]!==i.text)throw new B(`Use of the macro doesn't match its definition`,i)}}for(var a=[],o=0;o<e;o++)a.push(this.consumeArg(t&&t[o+1]).tokens);return a}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new B(`Too many expansions: infinite loop or need to increase maxExpand setting`)}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(r==null||e&&r.unexpandable){if(e&&r==null&&n[0]===`\\`&&!this.isDefined(n))throw new B(`Undefined control sequence: `+n);return this.pushToken(t),!1}this.countExpansion(1);var i=r.tokens,a=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var s=i[o];if(s.text===`#`){if(o===0)throw new B(`Incomplete placeholder at end of macro body`,s);if(s=i[--o],s.text===`#`)i.splice(o+1,1);else if(/^[1-9]$/.test(s.text))i.splice(o,2,...a[s.text-1]);else throw new B(`Not a valid argument number`,s)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text=`\\relax`),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new _G(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var r=this.stack.pop();r.treatAsRelax&&=(r.noexpand=!1,!1),t.push(r)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(e=>e.text).join(``)}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var r=typeof t==`function`?t(this):t;if(typeof r==`string`){var i=0;if(r.includes(`#`))for(var a=r.replace(/##/g,``);a.includes(`#`+(i+1));)++i;for(var o=new _K(r,this.settings),s=[],c=o.lex();c.text!==`EOF`;)s.push(c),c=o.lex();return s.reverse(),{tokens:s,numArgs:i}}return r}isDefined(e){return this.macros.has(e)||Object.prototype.hasOwnProperty.call(cK,e)||Object.prototype.hasOwnProperty.call($V.math,e)||Object.prototype.hasOwnProperty.call($V.text,e)||Object.prototype.hasOwnProperty.call(DK,e)}isExpandable(e){var t=this.macros.get(e);return t==null?Object.prototype.hasOwnProperty.call(cK,e)&&!cK[e].primitive:typeof t==`string`||typeof t==`function`||!t.unexpandable}},kK=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,AK=Object.freeze({"₊":`+`,"₋":`-`,"₌":`=`,"₍":`(`,"₎":`)`,"₀":`0`,"₁":`1`,"₂":`2`,"₃":`3`,"₄":`4`,"₅":`5`,"₆":`6`,"₇":`7`,"₈":`8`,"₉":`9`,ₐ:`a`,ₑ:`e`,ₕ:`h`,ᵢ:`i`,ⱼ:`j`,ₖ:`k`,ₗ:`l`,ₘ:`m`,ₙ:`n`,ₒ:`o`,ₚ:`p`,ᵣ:`r`,ₛ:`s`,ₜ:`t`,ᵤ:`u`,ᵥ:`v`,ₓ:`x`,ᵦ:`β`,ᵧ:`γ`,ᵨ:`ρ`,ᵩ:`ϕ`,ᵪ:`χ`,"⁺":`+`,"⁻":`-`,"⁼":`=`,"⁽":`(`,"⁾":`)`,"⁰":`0`,"¹":`1`,"²":`2`,"³":`3`,"⁴":`4`,"⁵":`5`,"⁶":`6`,"⁷":`7`,"⁸":`8`,"⁹":`9`,ᴬ:`A`,ᴮ:`B`,ᴰ:`D`,ᴱ:`E`,ᴳ:`G`,ᴴ:`H`,ᴵ:`I`,ᴶ:`J`,ᴷ:`K`,ᴸ:`L`,ᴹ:`M`,ᴺ:`N`,ᴼ:`O`,ᴾ:`P`,ᴿ:`R`,ᵀ:`T`,ᵁ:`U`,ⱽ:`V`,ᵂ:`W`,ᵃ:`a`,ᵇ:`b`,ᶜ:`c`,ᵈ:`d`,ᵉ:`e`,ᶠ:`f`,ᵍ:`g`,ʰ:`h`,ⁱ:`i`,ʲ:`j`,ᵏ:`k`,ˡ:`l`,ᵐ:`m`,ⁿ:`n`,ᵒ:`o`,ᵖ:`p`,ʳ:`r`,ˢ:`s`,ᵗ:`t`,ᵘ:`u`,ᵛ:`v`,ʷ:`w`,ˣ:`x`,ʸ:`y`,ᶻ:`z`,ᵝ:`β`,ᵞ:`γ`,ᵟ:`δ`,ᵠ:`ϕ`,ᵡ:`χ`,ᶿ:`θ`}),jK={"́":{text:`\\'`,math:`\\acute`},"̀":{text:"\\`",math:`\\grave`},"̈":{text:`\\"`,math:`\\ddot`},"̃":{text:`\\~`,math:`\\tilde`},"̄":{text:`\\=`,math:`\\bar`},"̆":{text:`\\u`,math:`\\breve`},"̌":{text:`\\v`,math:`\\check`},"̂":{text:`\\^`,math:`\\hat`},"̇":{text:`\\.`,math:`\\dot`},"̊":{text:`\\r`,math:`\\mathring`},"̋":{text:`\\H`},"̧":{text:`\\c`}},MK={á:`á`,à:`à`,ä:`ä`,ǟ:`ǟ`,ã:`ã`,ā:`ā`,ă:`ă`,ắ:`ắ`,ằ:`ằ`,ẵ:`ẵ`,ǎ:`ǎ`,â:`â`,ấ:`ấ`,ầ:`ầ`,ẫ:`ẫ`,ȧ:`ȧ`,ǡ:`ǡ`,å:`å`,ǻ:`ǻ`,ḃ:`ḃ`,ć:`ć`,ḉ:`ḉ`,č:`č`,ĉ:`ĉ`,ċ:`ċ`,ç:`ç`,ď:`ď`,ḋ:`ḋ`,ḑ:`ḑ`,é:`é`,è:`è`,ë:`ë`,ẽ:`ẽ`,ē:`ē`,ḗ:`ḗ`,ḕ:`ḕ`,ĕ:`ĕ`,ḝ:`ḝ`,ě:`ě`,ê:`ê`,ế:`ế`,ề:`ề`,ễ:`ễ`,ė:`ė`,ȩ:`ȩ`,ḟ:`ḟ`,ǵ:`ǵ`,ḡ:`ḡ`,ğ:`ğ`,ǧ:`ǧ`,ĝ:`ĝ`,ġ:`ġ`,ģ:`ģ`,ḧ:`ḧ`,ȟ:`ȟ`,ĥ:`ĥ`,ḣ:`ḣ`,ḩ:`ḩ`,í:`í`,ì:`ì`,ï:`ï`,ḯ:`ḯ`,ĩ:`ĩ`,ī:`ī`,ĭ:`ĭ`,ǐ:`ǐ`,î:`î`,ǰ:`ǰ`,ĵ:`ĵ`,ḱ:`ḱ`,ǩ:`ǩ`,ķ:`ķ`,ĺ:`ĺ`,ľ:`ľ`,ļ:`ļ`,ḿ:`ḿ`,ṁ:`ṁ`,ń:`ń`,ǹ:`ǹ`,ñ:`ñ`,ň:`ň`,ṅ:`ṅ`,ņ:`ņ`,ó:`ó`,ò:`ò`,ö:`ö`,ȫ:`ȫ`,õ:`õ`,ṍ:`ṍ`,ṏ:`ṏ`,ȭ:`ȭ`,ō:`ō`,ṓ:`ṓ`,ṑ:`ṑ`,ŏ:`ŏ`,ǒ:`ǒ`,ô:`ô`,ố:`ố`,ồ:`ồ`,ỗ:`ỗ`,ȯ:`ȯ`,ȱ:`ȱ`,ő:`ő`,ṕ:`ṕ`,ṗ:`ṗ`,ŕ:`ŕ`,ř:`ř`,ṙ:`ṙ`,ŗ:`ŗ`,ś:`ś`,ṥ:`ṥ`,š:`š`,ṧ:`ṧ`,ŝ:`ŝ`,ṡ:`ṡ`,ş:`ş`,ẗ:`ẗ`,ť:`ť`,ṫ:`ṫ`,ţ:`ţ`,ú:`ú`,ù:`ù`,ü:`ü`,ǘ:`ǘ`,ǜ:`ǜ`,ǖ:`ǖ`,ǚ:`ǚ`,ũ:`ũ`,ṹ:`ṹ`,ū:`ū`,ṻ:`ṻ`,ŭ:`ŭ`,ǔ:`ǔ`,û:`û`,ů:`ů`,ű:`ű`,ṽ:`ṽ`,ẃ:`ẃ`,ẁ:`ẁ`,ẅ:`ẅ`,ŵ:`ŵ`,ẇ:`ẇ`,ẘ:`ẘ`,ẍ:`ẍ`,ẋ:`ẋ`,ý:`ý`,ỳ:`ỳ`,ÿ:`ÿ`,ỹ:`ỹ`,ȳ:`ȳ`,ŷ:`ŷ`,ẏ:`ẏ`,ẙ:`ẙ`,ź:`ź`,ž:`ž`,ẑ:`ẑ`,ż:`ż`,Á:`Á`,À:`À`,Ä:`Ä`,Ǟ:`Ǟ`,Ã:`Ã`,Ā:`Ā`,Ă:`Ă`,Ắ:`Ắ`,Ằ:`Ằ`,Ẵ:`Ẵ`,Ǎ:`Ǎ`,Â:`Â`,Ấ:`Ấ`,Ầ:`Ầ`,Ẫ:`Ẫ`,Ȧ:`Ȧ`,Ǡ:`Ǡ`,Å:`Å`,Ǻ:`Ǻ`,Ḃ:`Ḃ`,Ć:`Ć`,Ḉ:`Ḉ`,Č:`Č`,Ĉ:`Ĉ`,Ċ:`Ċ`,Ç:`Ç`,Ď:`Ď`,Ḋ:`Ḋ`,Ḑ:`Ḑ`,É:`É`,È:`È`,Ë:`Ë`,Ẽ:`Ẽ`,Ē:`Ē`,Ḗ:`Ḗ`,Ḕ:`Ḕ`,Ĕ:`Ĕ`,Ḝ:`Ḝ`,Ě:`Ě`,Ê:`Ê`,Ế:`Ế`,Ề:`Ề`,Ễ:`Ễ`,Ė:`Ė`,Ȩ:`Ȩ`,Ḟ:`Ḟ`,Ǵ:`Ǵ`,Ḡ:`Ḡ`,Ğ:`Ğ`,Ǧ:`Ǧ`,Ĝ:`Ĝ`,Ġ:`Ġ`,Ģ:`Ģ`,Ḧ:`Ḧ`,Ȟ:`Ȟ`,Ĥ:`Ĥ`,Ḣ:`Ḣ`,Ḩ:`Ḩ`,Í:`Í`,Ì:`Ì`,Ï:`Ï`,Ḯ:`Ḯ`,Ĩ:`Ĩ`,Ī:`Ī`,Ĭ:`Ĭ`,Ǐ:`Ǐ`,Î:`Î`,İ:`İ`,Ĵ:`Ĵ`,Ḱ:`Ḱ`,Ǩ:`Ǩ`,Ķ:`Ķ`,Ĺ:`Ĺ`,Ľ:`Ľ`,Ļ:`Ļ`,Ḿ:`Ḿ`,Ṁ:`Ṁ`,Ń:`Ń`,Ǹ:`Ǹ`,Ñ:`Ñ`,Ň:`Ň`,Ṅ:`Ṅ`,Ņ:`Ņ`,Ó:`Ó`,Ò:`Ò`,Ö:`Ö`,Ȫ:`Ȫ`,Õ:`Õ`,Ṍ:`Ṍ`,Ṏ:`Ṏ`,Ȭ:`Ȭ`,Ō:`Ō`,Ṓ:`Ṓ`,Ṑ:`Ṑ`,Ŏ:`Ŏ`,Ǒ:`Ǒ`,Ô:`Ô`,Ố:`Ố`,Ồ:`Ồ`,Ỗ:`Ỗ`,Ȯ:`Ȯ`,Ȱ:`Ȱ`,Ő:`Ő`,Ṕ:`Ṕ`,Ṗ:`Ṗ`,Ŕ:`Ŕ`,Ř:`Ř`,Ṙ:`Ṙ`,Ŗ:`Ŗ`,Ś:`Ś`,Ṥ:`Ṥ`,Š:`Š`,Ṧ:`Ṧ`,Ŝ:`Ŝ`,Ṡ:`Ṡ`,Ş:`Ş`,Ť:`Ť`,Ṫ:`Ṫ`,Ţ:`Ţ`,Ú:`Ú`,Ù:`Ù`,Ü:`Ü`,Ǘ:`Ǘ`,Ǜ:`Ǜ`,Ǖ:`Ǖ`,Ǚ:`Ǚ`,Ũ:`Ũ`,Ṹ:`Ṹ`,Ū:`Ū`,Ṻ:`Ṻ`,Ŭ:`Ŭ`,Ǔ:`Ǔ`,Û:`Û`,Ů:`Ů`,Ű:`Ű`,Ṽ:`Ṽ`,Ẃ:`Ẃ`,Ẁ:`Ẁ`,Ẅ:`Ẅ`,Ŵ:`Ŵ`,Ẇ:`Ẇ`,Ẍ:`Ẍ`,Ẋ:`Ẋ`,Ý:`Ý`,Ỳ:`Ỳ`,Ÿ:`Ÿ`,Ỹ:`Ỹ`,Ȳ:`Ȳ`,Ŷ:`Ŷ`,Ẏ:`Ẏ`,Ź:`Ź`,Ž:`Ž`,Ẑ:`Ẑ`,Ż:`Ż`,ά:`ά`,ὰ:`ὰ`,ᾱ:`ᾱ`,ᾰ:`ᾰ`,έ:`έ`,ὲ:`ὲ`,ή:`ή`,ὴ:`ὴ`,ί:`ί`,ὶ:`ὶ`,ϊ:`ϊ`,ΐ:`ΐ`,ῒ:`ῒ`,ῑ:`ῑ`,ῐ:`ῐ`,ό:`ό`,ὸ:`ὸ`,ύ:`ύ`,ὺ:`ὺ`,ϋ:`ϋ`,ΰ:`ΰ`,ῢ:`ῢ`,ῡ:`ῡ`,ῠ:`ῠ`,ώ:`ώ`,ὼ:`ὼ`,Ύ:`Ύ`,Ὺ:`Ὺ`,Ϋ:`Ϋ`,Ῡ:`Ῡ`,Ῠ:`Ῠ`,Ώ:`Ώ`,Ὼ:`Ὼ`},NK=class e{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode=`math`,this.gullet=new OK(e,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new B(`Expected '`+e+`', got '`+this.fetch().text+`'`,this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken??=this.gullet.expandNextToken(),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set(`\\color`,`\\textcolor`);try{var e=this.parseExpression(!1);return this.expect(`EOF`),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new _G(`}`)),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect(`}`),this.nextToken=t,n}parseExpression(t,n){for(var r=[];;){this.mode===`math`&&this.consumeSpaces();var i=this.fetch();if(e.endOfExpression.has(i.text)||n&&i.text===n||t&&cK[i.text]&&cK[i.text].infix)break;var a=this.parseAtom(n);if(!a)break;a.type!==`internal`&&r.push(a)}return this.mode===`text`&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){for(var t=-1,n,r=0;r<e.length;r++){var i=e[r];if(i.type===`infix`){if(t!==-1)throw new B(`only one infix operator per group`,i.token);t=r,n=i.replaceWith}}if(t!==-1&&n){var a,o,s=e.slice(0,t),c=e.slice(t+1);return a=s.length===1&&s[0].type===`ordgroup`?s[0]:{type:`ordgroup`,mode:this.mode,body:s},o=c.length===1&&c[0].type===`ordgroup`?c[0]:{type:`ordgroup`,mode:this.mode,body:c},[n===`\\\\abovefrac`?this.callFunction(n,[a,e[t],o],[]):this.callFunction(n,[a,o],[])]}return e}handleSupSubscript(e){var t=this.fetch(),n=t.text;this.consume(),this.consumeSpaces();var r;do r=this.parseGroup(e);while(r?.type===`internal`);if(!r)throw new B(`Expected group after '`+n+`'`,t);return r}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:`textord`,mode:`text`,text:e[n]});var r={type:`text`,mode:this.mode,body:t};return{type:`color`,mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){var t=this.parseGroup(`atom`,e);if(t?.type===`internal`||this.mode===`text`)return t;for(var n,r;;){this.consumeSpaces();var i=this.fetch();if(i.text===`\\limits`||i.text===`\\nolimits`){if(t&&t.type===`op`)t.limits=i.text===`\\limits`,t.alwaysHandleSupSub=!0;else if(t&&t.type===`operatorname`)t.alwaysHandleSupSub&&(t.limits=i.text===`\\limits`);else throw new B(`Limit controls must follow a math operator`,i);this.consume()}else if(i.text===`^`){if(n)throw new B(`Double superscript`,i);n=this.handleSupSubscript(`superscript`)}else if(i.text===`_`){if(r)throw new B(`Double subscript`,i);r=this.handleSupSubscript(`subscript`)}else if(i.text===`'`){if(n)throw new B(`Double superscript`,i);var a={type:`textord`,mode:this.mode,text:`\\prime`},o=[a];for(this.consume();this.fetch().text===`'`;)o.push(a),this.consume();this.fetch().text===`^`&&o.push(this.handleSupSubscript(`superscript`)),n={type:`ordgroup`,mode:this.mode,body:o}}else if(AK[i.text]){var s=kK.test(i.text),c=[];for(c.push(new _G(AK[i.text])),this.consume();;){var l=this.fetch().text;if(!AK[l]||kK.test(l)!==s)break;c.unshift(new _G(AK[l])),this.consume()}var u=this.subparse(c);s?r={type:`ordgroup`,mode:`math`,body:u}:n={type:`ordgroup`,mode:`math`,body:u}}else break}return n&&r?{type:`supsub`,mode:this.mode,base:t,sup:n,sub:r}:n?{type:`supsub`,mode:this.mode,base:t,sup:n}:r?{type:`supsub`,mode:this.mode,base:t,sub:r}:t}parseFunction(e,t){var n=this.fetch(),r=n.text,i=cK[r];if(!i)return null;if(this.consume(),t&&t!==`atom`&&!i.allowedInArgument)throw new B(`Got function '`+r+`' with no arguments`+(t?` as `+t:``),n);if(this.mode===`text`&&!i.allowedInText)throw new B(`Can't use function '`+r+`' in text mode`,n);if(this.mode===`math`&&i.allowedInMath===!1)throw new B(`Can't use function '`+r+`' in math mode`,n);var a=this.parseArguments(r,i),o=a.args,s=a.optArgs;return this.callFunction(r,o,s,n,e)}callFunction(e,t,n,r,i){var a={funcName:e,parser:this,token:r,breakOnTokenText:i},o=cK[e];if(o&&o.handler)return o.handler(a,t,n);throw new B(`No function handler for `+e)}parseArguments(e,t){var n=t.numOptionalArgs??0,r=t.numArgs+n;if(r===0)return{args:[],optArgs:[]};for(var i=[],a=[],o=0;o<r;o++){var s=t.argTypes?.[o],c=o<n;(`primitive`in t&&t.primitive&&s==null||t.type===`sqrt`&&o===1&&a[0]==null)&&(s=`primitive`);var l=this.parseGroupOfType(`argument to '`+e+`'`,s,c);if(c)a.push(l);else if(l!=null)i.push(l);else throw new B(`Null argument, please report this as a bug`)}return{args:i,optArgs:a}}parseGroupOfType(e,t,n){switch(t){case`color`:return this.parseColorGroup(n);case`size`:return this.parseSizeGroup(n);case`url`:return this.parseUrlGroup(n);case`math`:case`text`:return this.parseArgumentGroup(n,t);case`hbox`:var r=this.parseArgumentGroup(n,`text`);return r==null?null:{type:`styling`,mode:r.mode,body:[r],style:`text`,resetFont:!0};case`raw`:var i=this.parseStringGroup(n);return i==null?null:{type:`raw`,mode:`text`,string:i.text};case`primitive`:if(n)throw new B(`A primitive argument cannot be optional`);var a=this.parseGroup(e);if(a==null)throw new B(`Expected group as `+e,this.fetch());return a;case`original`:case void 0:return this.parseArgumentGroup(n);default:throw new B(`Unknown group type as `+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===` `;)this.consume()}parseStringGroup(e){var t=this.gullet.scanArgument(e);if(t==null)return null;for(var n=``,r;(r=this.fetch()).text!==`EOF`;)n+=r.text,this.consume();return this.consume(),t.text=n,t}parseRegexGroup(e,t){for(var n=this.fetch(),r=n,i=``,a;(a=this.fetch()).text!==`EOF`&&e.test(i+a.text);)r=a,i+=r.text,this.consume();if(i===``)throw new B(`Invalid `+t+`: '`+n.text+`'`,n);return n.range(r,i)}parseColorGroup(e){var t=this.parseStringGroup(e);if(t==null)return null;var n=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new B(`Invalid color: '`+t.text+`'`,t);var r=n[0];return/^[0-9a-f]{6}$/i.test(r)&&(r=`#`+r),{type:`color-token`,mode:this.mode,color:r}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),t=!e&&this.gullet.future().text!==`{`?this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,`size`):this.parseStringGroup(e),!t)return null;!e&&t.text.length===0&&(t.text=`0pt`,n=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new B(`Invalid size: '`+t.text+`'`,t);var i={number:+(r[1]+r[2]),unit:r[3]};if(!DV(i))throw new B(`Invalid unit: '`+i.unit+`'`,t);return{type:`size`,mode:this.mode,value:i,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode(`%`,13),this.gullet.lexer.setCatcode(`~`,12);var t=this.parseStringGroup(e);if(this.gullet.lexer.setCatcode(`%`,14),this.gullet.lexer.setCatcode(`~`,13),t==null)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,`$1`);return{type:`url`,mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(n==null)return null;var r=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var i=this.parseExpression(!1,`EOF`);this.expect(`EOF`),this.gullet.endGroup();var a={type:`ordgroup`,mode:this.mode,loc:n.loc,body:i};return t&&this.switchMode(r),a}parseGroup(e,t){var n=this.fetch(),r=n.text,i;if(r===`{`||r===`\\begingroup`){this.consume();var a=r===`{`?`}`:`\\endgroup`;this.gullet.beginGroup();var o=this.parseExpression(!1,a),s=this.fetch();this.expect(a),this.gullet.endGroup(),i={type:`ordgroup`,mode:this.mode,loc:gG.range(n,s),body:o,semisimple:r===`\\begingroup`||void 0}}else if(i=this.parseFunction(t,e)||this.parseSymbol(),i==null&&r[0]===`\\`&&!Object.prototype.hasOwnProperty.call(DK,r)){if(this.settings.throwOnError)throw new B(`Undefined control sequence: `+r,n);i=this.formatUnsupportedCmd(r),this.consume()}return i}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var r=e[n];if(r.type===`textord`){var i=r.text,a=e[n+1];if(a&&a.type===`textord`){if(i===`-`&&a.text===`-`){var o=e[n+2];n+1<t&&o&&o.type===`textord`&&o.text===`-`?(e.splice(n,3,{type:`textord`,mode:`text`,loc:gG.range(r,o),text:`---`}),t-=2):(e.splice(n,2,{type:`textord`,mode:`text`,loc:gG.range(r,a),text:`--`}),--t)}(i===`'`||i==="`")&&a.text===i&&(e.splice(n,2,{type:`textord`,mode:`text`,loc:gG.range(r,a),text:i+i}),--t)}}}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r=n.charAt(0)===`*`;if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new B(`\\verb assertion failed --
385
- please report what input caused this bug`);return n=n.slice(1,-1),{type:`verb`,mode:`text`,body:n,star:r}}Object.prototype.hasOwnProperty.call(MK,t[0])&&!$V[this.mode][t[0]]&&(this.settings.strict&&this.mode===`math`&&VH({strict:this.settings.strict,errorCode:`unicodeTextInMathMode`,errorMsg:`Accented Unicode text character "`+t[0]+`" used in math mode`,report:!0,token:e}),t=MK[t[0]]+t.slice(1));var i=hK.exec(t);i&&(t=t.substring(0,i.index),t===`i`?t=`ı`:t===`j`&&(t=`ȷ`));var a;if($V[this.mode][t]){this.settings.strict&&this.mode===`math`&&CH.includes(t)&&VH({strict:this.settings.strict,errorCode:`unicodeTextInMathMode`,errorMsg:`Latin-1/Unicode text character "`+t[0]+`" used in math mode`,report:!0,token:e});var o=$V[this.mode][t].group,s=gG.range(e);a=uW(o)?{type:`atom`,mode:this.mode,family:o,loc:s,text:t}:{type:o,mode:this.mode,loc:s,text:t}}else if(t.charCodeAt(0)>=128)this.settings.strict&&(lV(t.charCodeAt(0))?this.mode===`math`&&VH({strict:this.settings.strict,errorCode:`unicodeTextInMathMode`,errorMsg:`Unicode text character "`+t[0]+`" used in math mode`,report:!0,token:e}):VH({strict:this.settings.strict,errorCode:`unknownSymbol`,errorMsg:`Unrecognized Unicode character "`+t[0]+`"`+(` (`+t.charCodeAt(0)+`)`),report:!0,token:e})),a={type:`textord`,mode:`text`,loc:gG.range(e),text:t};else return null;if(this.consume(),i)for(var c=0;c<i[0].length;c++){var l=i[0][c];if(!jK[l])throw new B(`Unknown accent ' `+l+`'`,e);var u=jK[l][this.mode]||jK[l].text;if(!u)throw new B(`Accent `+l+` unsupported in `+this.mode+` mode`,e);a={type:`accent`,mode:this.mode,loc:gG.range(e),label:u,isStretchy:!1,isShifty:!0,base:a}}return a}};NK.endOfExpression=new Set([`}`,`\\endgroup`,`\\end`,`\\right`,`&`]);var PK=function(e,t){if(!(typeof e==`string`||e instanceof String))throw TypeError(`KaTeX can only parse string typed expression`);var n=new NK(e,t);delete n.gullet.macros.current[`\\df@tag`];var r=n.parse();if(delete n.gullet.macros.current[`\\current@color`],delete n.gullet.macros.current[`\\color`],n.gullet.macros.get(`\\df@tag`)){if(!t.displayMode)throw new B(`\\tag works only in display equations`);r=[{type:`tag`,mode:`text`,body:r,tag:n.subparse([new _G(`\\df@tag`)])}]}return r},FK=function(e,t,n){t.textContent=``;var r=zK(e,n).toNode();t.appendChild(r)};typeof document<`u`&&document.compatMode!==`CSS1Compat`&&(typeof console<`u`&&console.warn(`Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype.`),FK=function(){throw new B(`KaTeX doesn't work in quirks mode.`)});var IK=function(e,t){return zK(e,t).toMarkup()},LK=function(e,t){return PK(e,new HB(t))},RK=function(e,t,n){if(n.throwOnError||!(e instanceof B))throw e;var r=X([`katex-error`],[new zV(t)]);return r.setAttribute(`title`,e.toString()),r.setAttribute(`style`,`color:`+n.errorColor),r},zK=function(e,t){var n=new HB(t);try{return QU(PK(e,n),e,n)}catch(t){return RK(t,e,n)}},BK={version:`0.19.0`,render:FK,renderToString:IK,ParseError:B,SETTINGS_SCHEMA:RB,__parse:LK,__renderToDomTree:zK,__renderToHTMLTree:function(e,t){var n=new HB(t);try{return $U(PK(e,n),n)}catch(t){return RK(t,e,n)}},__setFontMetrics:YV,__defineSymbol:H,__defineFunction:Z,__defineMacro:$,__domTree:{Span:FV,Anchor:IV,SymbolNode:zV,SvgNode:BV,PathNode:VV,LineNode:HV}},VK=500,HK=new Map;function UK(e,t){let n=`${+!!t}:${e}`;if(HK.has(n)){let e=HK.get(n)??null;return HK.delete(n),HK.set(n,e),e}let r;try{let n=BK.renderToString(e,{displayMode:t,output:`htmlAndMathml`,throwOnError:!0,trust:!1,strict:`ignore`,maxExpand:1e3,maxSize:50});r=Zz.sanitize(n,{USE_PROFILES:{html:!0,svg:!0,mathMl:!0}})}catch{r=null}return HK.set(n,r),HK.size>VK&&HK.delete(HK.keys().next().value),r}var WK=null;function GK(e,t){let n=WK;WK=e;try{return t()}finally{WK=n}}function KK(e,t){let n=RegExp(`<span data-math="${t.nonce}:(\\d+)"></span>`,`g`);return e.replace(n,(e,n)=>t.items[Number(n)]??e)}function qK(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`)}function JK(e,t,n){let r=UK(e,t);return r===null||WK===null?qK(n):(WK.items.push(r),`<span data-math="${WK.nonce}:${WK.items.length-1}"></span>`)}var YK=/^\$\$[ \t]*\n?([\s\S]+?)\n?[ \t]*\$\$[ \t]*(?:\n|$)/,XK=/^(\$\$?)(?![\s$])((?:\\[\s\S]|[^$\\])+?)(?<!\s)\1(?!\d)/,ZK=new WL({extensions:[{name:`mathBlock`,level:`block`,start:e=>e.match(/^\$\$/m)?.index,tokenizer(e){let t=YK.exec(e);if(t?.[1]?.trim())return{type:`mathBlock`,raw:t[0],text:t[1].trim()}},renderer:e=>`<p>${JK(e.text,!0,e.raw.trimEnd())}</p>\n`},{name:`mathInline`,level:`inline`,start:e=>e.indexOf(`$`),tokenizer(e){let t=XK.exec(e);if(t?.[2])return{type:`mathInline`,raw:t[0],text:t[2],display:t[1]===`$$`}},renderer:e=>JK(e.text,e.display,e.raw)}],renderer:{code({text:e,lang:t}){return`<pre><code class="${EB(t)?`hljs language-${t??``}`:`hljs`}">${DB(e,t)}</code></pre>`}}});function QK(e){let t={nonce:crypto.randomUUID(),items:[]},n=GK(t,()=>ZK.parse(e,{async:!1,gfm:!0,breaks:!0}));return KK(Zz.sanitize(n,{USE_PROFILES:{html:!0}}),t)}function $K({text:e}){let t=(0,f.useMemo)(()=>QK(e),[e]);return(0,A.jsx)(`div`,{className:`md`,dangerouslySetInnerHTML:{__html:t}})}function eq({invocation:e}){let[t,n]=(0,f.useState)(!1);return(0,A.jsxs)(`div`,{className:`overflow-hidden rounded-card border border-sakura-200 bg-surface text-left shadow-soft`,children:[(0,A.jsxs)(`button`,{type:`button`,onClick:()=>n(!t),"aria-expanded":t,className:`focus-neko flex w-full items-center gap-2 px-3 py-2`,children:[(0,A.jsx)(`span`,{className:`text-sakura-500`,children:(0,A.jsx)(oF,{name:`sparkles`,size:14})}),(0,A.jsxs)(`span`,{className:`shrink-0 font-mono text-sm font-semibold text-sakura-800`,children:[`skill:`,e.name]}),(0,A.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-ink-600`,title:e.location,children:e.location}),(0,A.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 text-ink-400`,children:t?`▾`:`▸`})]}),t&&(0,A.jsx)(`div`,{className:`border-t border-sakura-100 px-3 py-2`,children:(0,A.jsx)(`pre`,{className:`max-h-48 overflow-auto whitespace-pre-wrap rounded-lg bg-ink-50 p-2 font-mono text-xs text-ink-700`,children:e.body.trim()})})]})}function tq({text:e}){let[t,n]=(0,f.useState)(!1);return e.trim()===``?null:(0,A.jsxs)(`div`,{className:`rounded-xl border border-dashed border-sakura-300 bg-sakura-50/70`,children:[(0,A.jsxs)(`button`,{type:`button`,onClick:()=>{n(!t)},className:`focus-neko flex w-full items-center gap-1.5 px-3 py-1.5 text-left text-xs text-ink-600 italic`,children:[(0,A.jsx)(`span`,{"aria-hidden":!0,children:t?`▾`:`▸`}),`思考过程…`]}),t&&(0,A.jsx)(`div`,{className:`px-3 pb-2 text-sm whitespace-pre-wrap text-ink-600 italic`,children:e})]})}function nq(e,t=`edit`){if(t===`write`)return e.startsWith(`+ `)?{prefix:`+`,lineNum:``,content:e.slice(2)}:null;let n=e.match(/^([+\- ])( *\d+) (.*)$/),r=n?.[1];return r!==`+`&&r!==`-`&&r!==` `?null:{prefix:r,lineNum:n?.[2]??``,content:n?.[3]??``}}function rq(e,t){if(e===`write`){let e=t.trim();return e===``?null:e}if(e===`edit`){let e=(t.match(/^(.*) \(\d+ edits\)$/)?.[1]??``).trim();return e===``?null:e}return null}function iq(e){if(e==null)return;let t=e.split(`/`).pop()??``,n=t.lastIndexOf(`.`);if(n<=0)return;let r=t.slice(n+1).trim().toLowerCase();return EB(r)?r:void 0}function aq(e,t,n=`edit`){let r=e.split(`
386
- `),i=r.map(e=>nq(e,n)),a=[],o=[],s=[],c=[];for(let e=0;e<i.length;e++){let t=i[e];t==null?(s.push(-1),c.push(-1)):(t.prefix===`-`?s.push(-1):(s.push(a.length),a.push(t.content)),t.prefix===`+`?c.push(-1):(c.push(o.length),o.push(t.content)))}let l=t!==void 0&&EB(t)?t:void 0;if(l!==void 0)try{return{kind:`highlighted`,rows:oq(r,i,s,c,sq(Qz.highlight(a.join(`
387
- `),{language:l}).value),sq(Qz.highlight(o.join(`
388
- `),{language:l}).value))}}catch{}return{kind:`plain`,rows:oq(r,i,s,c,a.map(OB),o.map(OB))}}function oq(e,t,n,r,i,a){return t.map((t,o)=>{if(t===null)return{kind:`context`,gutter:``,html:OB(e[o]??``)};let s=`${t.prefix}${t.lineNum}`;if(t.prefix===`-`)return{kind:`removed`,gutter:s,html:a[r[o]??-1]??``};let c=i[n[o]??-1]??``;return t.prefix===`+`?{kind:`added`,gutter:s,html:c}:{kind:`context`,gutter:s,html:c}})}function sq(e){let t=[],n=[],r=/<span class="([^"]*)">|<\/span>|\n/g,i=``,a=0;for(let o of e.matchAll(r)){let r=o.index;i+=e.slice(a,r),a=r+o[0].length,o[0]===`
389
- `?(t.push(i+n.map(()=>`</span>`).join(``)),i=n.map(e=>`<span class="${e}">`).join(``)):o[1]===void 0?(n.pop(),i+=o[0]):(n.push(o[1]),i+=o[0])}return t.push(i+e.slice(a)),t}var cq={pending:{label:`待执行`,icon:`clock`,spin:!1,className:`border-ink-200 bg-ink-100 text-ink-600`},running:{label:`运行中`,icon:`spinner`,spin:!0,className:`border-tianyi-300 bg-tianyi-100 text-tianyi-900`},doneOk:{label:`完成`,icon:`check`,spin:!1,className:`border-ink-200 bg-ink-50 text-ink-600`},doneError:{label:`失败`,icon:`close`,spin:!1,className:`border-2 border-sakura-500 bg-sakura-100 text-sakura-900 font-semibold`}};function lq(e){let[t,n]=(0,f.useState)(!1),r=e.phase===`done`?e.isError?cq.doneError:cq.doneOk:cq[e.phase],i=e.phase===`done`&&e.durationMs!==void 0&&e.durationMs!==null?` · ${(e.durationMs/1e3).toFixed(1)}s`:``,a=(0,f.useMemo)(()=>{if(!t||e.diff==null)return null;let n=iq(rq(e.name,e.summary));return aq(e.diff,n,e.name===`write`?`write`:`edit`).rows.map(e=>({...e,html:Zz.sanitize(e.html,{USE_PROFILES:{html:!0}})}))},[t,e.diff,e.name,e.summary]),o=e.diffAdded??null,s=e.diffRemoved??null,c=o!==null&&s!==null?o>0&&s>0?`(+${o}/-${s})`:o>0?`(+${o})`:s>0?`(-${s})`:null:null,l=e.detail!==null&&!(e.name===`write`&&e.diff!=null&&!e.diffTruncated),u=l||e.output!=null||e.result!=null||e.note!=null||e.diff!=null;return(0,A.jsxs)(`div`,{className:`overflow-hidden rounded-card border border-tianyi-200 bg-surface shadow-soft`,children:[(0,A.jsxs)(`button`,{type:`button`,"aria-expanded":u?t:void 0,onClick:()=>{u&&n(!t)},className:`focus-neko flex w-full items-center gap-2 px-3 py-2 text-left`,children:[(0,A.jsx)(`span`,{className:`text-tianyi-500`,children:(0,A.jsx)(oF,{name:`bolt`,size:14})}),(0,A.jsx)(`span`,{className:`font-mono text-sm font-semibold text-tianyi-800`,children:e.name}),(0,A.jsxs)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-ink-600`,children:[e.summary,c!==null&&(0,A.jsxs)(`span`,{className:`text-ink-400`,children:[` `,c]})]}),(0,A.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-full border px-2 py-0.5 text-xs font-medium ${r.className}`,children:[(0,A.jsx)(oF,{name:r.icon,size:12,className:r.spin?`animate-spin`:void 0}),r.label,i]}),u&&(0,A.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 text-ink-400`,children:t?`▾`:`▸`})]}),t&&(0,A.jsxs)(`div`,{className:`space-y-2 border-t border-tianyi-100 px-3 py-2`,children:[a!==null&&(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`div`,{className:`mb-1 text-xs font-medium text-tianyi-700`,children:`代码变更`}),e.diffTruncated&&(0,A.jsx)(`div`,{className:`mb-1 text-xs text-ink-600`,children:`代码变更预览已截断,可在下方查看完整写入内容。`}),(0,A.jsx)(`div`,{className:`max-h-48 overflow-auto rounded-lg bg-ink-50 p-2 font-mono text-xs text-ink-700`,children:a.map((e,t)=>(0,A.jsxs)(`div`,{className:`whitespace-pre ${e.kind===`added`?`diff-line-add`:e.kind===`removed`?`diff-line-del`:``}`,children:[(0,A.jsx)(`span`,{className:`diff-gutter`,children:e.gutter}),(0,A.jsx)(`span`,{dangerouslySetInnerHTML:{__html:e.html}})]},t))})]}),l&&(0,A.jsxs)(`div`,{children:[e.name===`write`&&e.diffTruncated&&(0,A.jsx)(`div`,{className:`mb-1 text-xs font-medium text-tianyi-700`,children:`完整写入内容`}),(0,A.jsx)(`pre`,{className:`max-h-48 overflow-auto rounded-lg bg-ink-50 p-2 font-mono text-xs text-ink-700`,children:e.detail})]}),e.output!=null&&e.output!==``&&(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`div`,{className:`mb-1 text-xs font-medium text-tianyi-700`,children:`输出`}),(0,A.jsx)(`pre`,{className:`max-h-48 overflow-auto rounded-lg bg-tianyi-50 p-2 font-mono text-xs text-ink-700`,children:e.output})]}),e.result!=null&&e.result!==``&&(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`div`,{className:`mb-1 text-xs font-medium ${e.isError?`text-sakura-800`:`text-ink-600`}`,children:e.isError?`错误输出`:`结果`}),(0,A.jsx)(`pre`,{className:`max-h-48 overflow-auto rounded-lg p-2 font-mono text-xs ${e.isError?`bg-sakura-50 text-sakura-900`:`bg-ink-50 text-ink-700`}`,children:e.result})]}),e.note!=null&&(0,A.jsx)(`div`,{className:`text-xs italic text-ink-500`,children:e.note})]})]})}var uq=48;function dq(){let e=`var(--color-sakura-200)`,t=`var(--color-sakura-300)`,n=`var(--color-tianyi-800)`;return(0,A.jsxs)(`svg`,{width:`132`,height:`112`,viewBox:`0 0 132 112`,fill:`none`,"aria-hidden":`true`,children:[(0,A.jsx)(`title`,{children:`neko 小猫`}),(0,A.jsx)(`path`,{d:`M30 46 L24 14 L54 30 Z`,fill:e,stroke:t,strokeWidth:`2.5`,strokeLinejoin:`round`}),(0,A.jsx)(`path`,{d:`M102 46 L108 14 L78 30 Z`,fill:e,stroke:t,strokeWidth:`2.5`,strokeLinejoin:`round`}),(0,A.jsx)(`path`,{d:`M32 39 L29 23 L46 32 Z`,fill:t,opacity:`0.55`}),(0,A.jsx)(`path`,{d:`M100 39 L103 23 L86 32 Z`,fill:t,opacity:`0.55`}),(0,A.jsx)(`ellipse`,{cx:`66`,cy:`66`,rx:`44`,ry:`38`,fill:`var(--color-surface)`,stroke:e,strokeWidth:`2.5`}),(0,A.jsx)(`circle`,{cx:`50`,cy:`62`,r:`5`,fill:n}),(0,A.jsx)(`circle`,{cx:`82`,cy:`62`,r:`5`,fill:n}),(0,A.jsx)(`circle`,{cx:`51.8`,cy:`60`,r:`1.6`,fill:`var(--color-surface)`}),(0,A.jsx)(`circle`,{cx:`83.8`,cy:`60`,r:`1.6`,fill:`var(--color-surface)`}),(0,A.jsx)(`ellipse`,{cx:`40`,cy:`74`,rx:`6.5`,ry:`3.6`,fill:t,opacity:`0.65`}),(0,A.jsx)(`ellipse`,{cx:`92`,cy:`74`,rx:`6.5`,ry:`3.6`,fill:t,opacity:`0.65`}),(0,A.jsx)(`path`,{d:`M62 71 q4 4.5 4 1 q0 -3.5 4 -1`,stroke:`var(--color-sakura-800)`,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`}),(0,A.jsx)(`path`,{d:`M18 64 L32 66 M19 72 L32 70`,stroke:e,strokeWidth:`2`,strokeLinecap:`round`}),(0,A.jsx)(`path`,{d:`M114 64 L100 66 M113 72 L100 70`,stroke:e,strokeWidth:`2`,strokeLinecap:`round`})]})}function fq({text:e,images:t,skill:n,defaultImagePrompt:r,copy:i}){return n===void 0?(0,A.jsxs)(`div`,{className:`chat-row anim-user flex flex-col items-end`,children:[(0,A.jsxs)(`div`,{className:`bubble-user chat-bubble px-4 py-2.5 whitespace-pre-wrap${r?` [&>div]:mt-0`:``}`,children:[e,r&&(0,A.jsxs)(`details`,{className:`min-w-0 text-sm`,children:[(0,A.jsx)(`summary`,{className:`cursor-pointer min-h-8 py-1 text-ink-500 focus-visible:outline-2 focus-visible:outline-sakura-500`,children:`默认图片提示`}),(0,A.jsx)(`p`,{className:`pt-2 whitespace-pre-wrap break-words`,children:r.text})]}),t&&(0,A.jsx)(xR,{images:t})]}),(0,A.jsx)(vR,{text:i})]}):(0,A.jsxs)(`div`,{className:`chat-row anim-user flex flex-col items-end`,children:[(0,A.jsxs)(`div`,{className:`chat-bubble flex min-w-0 flex-col items-stretch gap-1.5`,children:[(0,A.jsx)(eq,{invocation:n}),n.args!==``&&(0,A.jsx)(`div`,{className:`bubble-user px-4 py-2.5 whitespace-pre-wrap`,children:n.args})]}),(0,A.jsx)(vR,{text:i})]})}function pq({thinking:e,text:t}){return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(tq,{text:e}),t.trim()!==``&&(0,A.jsx)($K,{text:t})]})}function mq({item:e}){return e.text.trim()===``&&e.thinking.trim()===``&&e.note===null?null:(0,A.jsxs)(`div`,{className:`chat-row anim-other flex flex-col items-start`,children:[(0,A.jsxs)(`div`,{className:`bubble-assistant space-y-1.5 px-4 py-2.5`,children:[(0,A.jsx)(pq,{thinking:e.thinking,text:e.text}),e.note!==null&&(0,A.jsxs)(`div`,{className:`text-xs text-sakura-800 italic`,children:[`⚠ `,e.note]})]}),(0,A.jsx)(vR,{text:sR(e),label:`复制回答`})]})}function hq({text:e}){return(0,A.jsx)(`div`,{className:`chat-row anim-other flex justify-center`,children:(0,A.jsx)(`span`,{className:`rounded-full bg-ink-100 px-3 py-1 text-xs text-ink-600`,children:e})})}function gq({item:e}){return(0,A.jsxs)(`div`,{className:`chat-row anim-other`,children:[(0,A.jsx)(lq,{name:e.name,summary:e.summary,detail:e.detail,phase:e.phase,isError:e.isError,output:e.output,result:e.result,durationMs:e.durationMs,note:e.note,diff:e.diff,diffAdded:e.diffAdded,diffRemoved:e.diffRemoved,diffTruncated:e.diffTruncated}),e.images&&(0,A.jsx)(xR,{images:e.images})]})}function _q({streaming:e,busy:t}){let n=e.text.trim()!==``||e.thinking.trim()!==``;return(0,A.jsxs)(A.Fragment,{children:[n&&(0,A.jsx)(`div`,{className:`chat-row stream-block flex justify-start`,children:(0,A.jsxs)(`div`,{className:`bubble-assistant space-y-1.5 px-4 py-2.5`,children:[(0,A.jsx)(pq,{thinking:e.thinking,text:e.text}),t&&(0,A.jsx)(`span`,{className:`stream-caret`,"aria-hidden":!0})]})}),e.toolCalls.map(e=>(0,A.jsx)(`div`,{className:`chat-row anim-other`,children:(0,A.jsx)(lq,{name:e.name,summary:e.summary,detail:e.detail,phase:e.phase,output:e.output,diff:e.diff,diffAdded:e.diffAdded,diffRemoved:e.diffRemoved,diffTruncated:e.diffTruncated})},`st${e.callId}`))]})}function vq({view:e,busy:t,onSubagent:n,emptyLabel:r,onLoadEarlier:i,tray:a,focusEntry:o}){let s=(0,f.useRef)(null),c=(0,f.useRef)(``),l=(0,f.useRef)(!0),u=(0,f.useRef)(!1),[d,p]=(0,f.useState)(!1),m=e?.items??[],h=e?.streaming??null,g=e=>{let t=s.current;t!==null&&t.scrollTo({top:t.scrollHeight,behavior:e?`smooth`:`auto`})};return(0,f.useEffect)(()=>{if(!l.current)return;let e=s.current;e!==null&&e.scrollTo({top:e.scrollHeight})}),(0,f.useEffect)(()=>{if(!o||!m.some(e=>e.type===`user`&&e.id===o.id))return;let e=`${o.id}:${o.nonce}`;if(c.current===e)return;let t=s.current,n=t?.querySelector(`[data-entry-id="${o.id}"]`);t&&n&&(c.current=e,l.current=!1,t.scrollTop+=n.getBoundingClientRect().top-t.getBoundingClientRect().top,p(!0))},[o,m]),(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,A.jsx)(`div`,{ref:s,onScroll:()=>{let e=s.current;if(e===null)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight<uq;if(l.current=t,p(!t),e.scrollTop<=24&&i&&!u.current){u.current=!0,l.current=!1;let t=e.scrollTop,n=e.scrollHeight;i().finally(()=>{requestAnimationFrame(()=>{s.current===e&&(e.scrollTop=t+e.scrollHeight-n),u.current=!1})})}},className:`min-h-0 flex-1 overflow-y-auto`,children:(0,A.jsxs)(`div`,{className:`chat-column flex flex-col gap-3 px-4 py-5`,children:[m.length===0&&h===null&&(r?(0,A.jsx)(`p`,{className:`p-4 text-sm text-ink-500`,children:r}):(0,A.jsxs)(`div`,{className:`mt-[14vh] flex flex-col items-center gap-4 text-center`,children:[(0,A.jsx)(`div`,{className:`welcome-cat`,children:(0,A.jsx)(dq,{})}),(0,A.jsxs)(`div`,{className:`text-4xl font-extrabold tracking-tight`,children:[(0,A.jsx)(`span`,{className:`logo-gradient`,children:`neko`}),(0,A.jsx)(`span`,{className:`text-tianyi-600`,children:`.`}),(0,A.jsx)(`span`,{className:`logo-gradient`,children:`harness`})]}),(0,A.jsx)(`p`,{className:`max-w-sm text-sm text-ink-600`,children:`输入消息开始吧 ✦`})]})),m.map(t=>{switch(t.type){case`user`:{let n=e?.rounds?.find(e=>e.inputEntryId===t.id||e.taskId===t.subagentRoundId);return(0,A.jsxs)(`div`,{"data-entry-id":t.id,children:[n&&(0,A.jsxs)(`details`,{className:`chat-row border-t border-sakura-200 pt-2 text-xs text-ink-500`,children:[(0,A.jsxs)(`summary`,{className:`cursor-pointer`,children:[`任务 `,n.round??``,` · `,n.title,` ·`,` `,{queued:`排队中`,running:`运行中`,completed:`已完成`,failed:`失败`,cancelled:`已停止`}[n.status]]}),(0,A.jsx)(`p`,{className:`pt-1`,children:n.roundUsage?`本轮 ↑${n.roundUsage.input} ↓${n.roundUsage.output} · 缓存 ${n.roundUsage.cacheRead}/${n.roundUsage.cacheWrite} · $${n.roundUsage.cost.toFixed(4)}`:`本轮用量未记录`})]}),(0,A.jsx)(fq,{text:t.text,copy:sR(t),images:t.images,skill:t.skill,defaultImagePrompt:t.defaultImagePrompt})]},t.key)}case`assistant`:return(0,A.jsx)(mq,{item:t},t.key);case`tool`:{let r=e?.subagents?.find(e=>e.callId===t.callId);return r&&n?(0,A.jsxs)(`button`,{type:`button`,onClick:()=>n(r.taskId),className:`focus-neko rounded-2xl border border-sakura-200 bg-surface p-4 text-left`,children:[(0,A.jsx)(`span`,{className:`text-tianyi-700`,children:r.role}),` · `,r.title,(0,A.jsxs)(`span`,{className:`block text-xs text-ink-500`,children:[r.status===`completed`?`已完成`:r.status===`cancelled`?`已停止`:r.status===`failed`?`失败`:r.status===`queued`?`排队中`:`运行中`,` `,r.approvalCount?`· 待审批 ${r.approvalCount}`:`· 查看完整过程`]})]},t.key):(0,A.jsxs)(`div`,{children:[(0,A.jsx)(gq,{item:t}),e?.approvals?.filter(e=>e.callId===t.callId&&e.status!==`pending`).map(e=>(0,A.jsxs)(`p`,{className:`chat-row text-xs text-ink-500`,children:[`审批 ·`,` `,{allowed:`已允许本次`,denied:`已拒绝`,cancelled:`已取消`}[e.status]]},e.id))]},t.key)}case`system`:return t.jobId===void 0?(0,A.jsx)(hq,{text:t.text},t.key):(0,A.jsx)(SR,{text:t.text,jobId:t.jobId,job:e?.jobs?.find(e=>e.jobId===t.jobId)},t.key);default:return null}}),h!==null&&(0,A.jsx)(_q,{streaming:h,busy:t})]})}),(d||a)&&(0,A.jsxs)(`div`,{className:`discrete-in flex shrink-0 items-center justify-center gap-2 border-t border-sakura-100 bg-base/70 py-1.5`,children:[a,d&&(0,A.jsx)(`button`,{type:`button`,onClick:()=>{l.current=!0,p(!1),g(!0)},className:`focus-neko rounded-full border border-sakura-300 bg-surface px-3.5 py-1 text-xs font-medium text-sakura-800 hover:bg-sakura-50`,children:`回到底部 ↓`})]})]})}var yq=Date.now(),bq=new Set,xq,Sq=()=>{yq=Date.now();for(let e of bq)e()},Cq=e=>(bq.add(e),bq.size===1&&(Sq(),xq=setInterval(Sq,6e4),window.addEventListener(`focus`,Sq)),()=>{bq.delete(e),bq.size||(clearInterval(xq),window.removeEventListener(`focus`,Sq))}),wq=()=>(0,f.useSyncExternalStore)(Cq,()=>yq);function Tq(e){let t=/^([A-Za-z]:)[\\/]/.exec(e)?.[1];if(t!==void 0){let n=`${t}\\`,r=e.slice(n.length).split(/[\\/]+/).filter(Boolean);return{root:`/`,rootLabel:`此电脑`,crumbs:[{label:t,path:n},...r.map((e,t)=>({label:e,path:n+r.slice(0,t+1).join(`\\`)}))]}}let n=e.split(`/`).filter(Boolean);return{root:`/`,rootLabel:`/`,crumbs:n.map((e,t)=>({label:e,path:`/${n.slice(0,t+1).join(`/`)}`}))}}function Eq({initialPath:e,onClose:t}){let[n,r]=(0,f.useState)(e),[i,a]=(0,f.useState)(e),[o,s]=(0,f.useState)(``),[c,l]=(0,f.useState)(!1),[u,d]=(0,f.useState)(null),[p,m]=(0,f.useState)(!0),[h,g]=(0,f.useState)(!1),[_,v]=(0,f.useState)(``),[y,b]=(0,f.useState)(0),x=(0,f.useRef)(0),S=(0,f.useRef)(null),C=(0,f.useRef)(!1);(0,f.useEffect)(()=>{let e=++x.current;return m(!0),v(``),d(null),Tj.browse({path:n,query:o,showHidden:c}).then(t=>{e===x.current&&(d(t),a(e=>e===n?t.path:e),m(!1))},t=>{e===x.current&&(v(String(t)),m(!1))}),()=>{++x.current}},[n,o,c,y]);let w=e=>{S.current?.focus(),r(e),a(e),s(``),b(e=>e+1)},T=async()=>{if(!u?.next||p)return;let e=++x.current;m(!0),v(``);try{let t=await Tj.browse({path:n,query:o,showHidden:c,cursor:u.next});e===x.current&&d({...t,entries:[...u.entries,...t.entries]})}catch(t){e===x.current&&v(String(t))}finally{e===x.current&&m(!1)}},ee=async()=>{if(!(!u||p||C.current)){C.current=!0,g(!0),v(``);try{await Tj.addWorkspace(u.path),t()}catch(e){v(String(e))}finally{C.current=!1,g(!1)}}},{root:te,rootLabel:ne,crumbs:re}=Tq(u?.path??n);return(0,A.jsxs)(uF,{title:`添加工作区`,onClose:t,locked:h,children:[(0,A.jsxs)(`div`,{className:`picker-controls`,children:[(0,A.jsx)(`p`,{className:`text-ink-500`,children:`选择 Harness 所在电脑上的文件夹`}),(0,A.jsxs)(`nav`,{className:`breadcrumbs`,"aria-label":`目录路径`,children:[(0,A.jsx)(`button`,{type:`button`,disabled:h,onClick:()=>w(te),children:ne}),re.map(e=>(0,A.jsxs)(`button`,{type:`button`,disabled:h,onClick:()=>w(e.path),children:[e.label,` /`]},e.path))]}),(0,A.jsxs)(`form`,{className:`path-form`,onSubmit:e=>{e.preventDefault(),w(i)},children:[(0,A.jsx)(`input`,{ref:S,"aria-label":`完整目录路径`,value:i,disabled:h,onChange:e=>a(e.target.value)}),(0,A.jsx)(`button`,{className:`btn-outline`,type:`submit`,disabled:h,children:`前往`})]}),(0,A.jsxs)(`div`,{className:`filter-row`,children:[(0,A.jsx)(`input`,{"aria-label":`筛选文件夹`,placeholder:`筛选文件夹…`,value:o,disabled:h,onChange:e=>s(e.target.value)}),(0,A.jsxs)(`label`,{children:[(0,A.jsx)(`input`,{type:`checkbox`,checked:c,disabled:h,onChange:e=>l(e.target.checked)}),`隐藏目录`]})]})]}),(0,A.jsxs)(`fieldset`,{className:`folder-list`,"aria-label":`文件夹列表`,"aria-busy":p,onKeyDown:e=>{if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;e.preventDefault();let t=[...e.currentTarget.querySelectorAll(`button:not(:disabled)`)];t[(t.indexOf(document.activeElement)+(e.key===`ArrowDown`?1:-1)+t.length)%t.length]?.focus()},children:[_&&(0,A.jsxs)(`div`,{role:`alert`,className:`error-text`,children:[_,(0,A.jsx)(`button`,{type:`button`,className:`btn-outline`,disabled:h,onClick:()=>b(e=>e+1),children:`重试`})]}),u?.parent&&(0,A.jsxs)(`button`,{type:`button`,className:`chrome-row`,disabled:h||p,onClick:()=>w(u.parent),children:[(0,A.jsx)(oF,{name:`up`}),`上级目录`]}),u?.entries.map(e=>(0,A.jsxs)(`button`,{type:`button`,className:`chrome-row`,disabled:h||p||!!e.error,title:e.error??e.path,onClick:()=>w(e.path),children:[(0,A.jsx)(oF,{name:`folder`}),(0,A.jsx)(`span`,{className:`truncate min-w-0`,children:e.name}),e.error&&(0,A.jsx)(`span`,{className:`text-ink-500`,children:`不可访问`})]},e.path)),p&&(0,A.jsx)(`output`,{className:`empty-text`,children:`正在读取目录…`}),!p&&u?.entries.length===0&&(0,A.jsx)(`p`,{className:`empty-text`,children:`没有匹配的子文件夹,可选择当前目录`}),u?.next&&(0,A.jsx)(`button`,{type:`button`,className:`btn-outline`,disabled:p||h,onClick:()=>void T(),children:`加载更多`})]}),(0,A.jsxs)(`div`,{className:`picker-footer`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`strong`,{children:fF(u?.path??n)}),(0,A.jsx)(`p`,{className:`path-text`,children:u?.path??n})]}),(0,A.jsxs)(`div`,{className:`actions`,children:[(0,A.jsx)(`button`,{type:`button`,className:`btn-outline`,disabled:h,onClick:t,children:`取消`}),(0,A.jsx)(`button`,{type:`button`,className:`btn-primary px-3 py-1.5`,disabled:!u||p||h||!!_,onClick:()=>void ee(),children:h?`正在添加…`:`选择文件夹`})]})]})]})}function Dq({open:e,onClose:t}){let n=pj(),r=wq(),i=sF(),[a,o]=(0,f.useState)(null),s=n.sessions.find(e=>e.id===a?.id),[c,l]=(0,f.useState)(!1),[u,d]=(0,f.useState)(null),[p,m]=(0,f.useState)(``),[h,g]=(0,f.useState)(``),_=n.phase!==`ready`||n.operating,v=sj(n.sessions,n.workspaceRoot).filter(e=>Ni(e,h)),y=e=>{e.then(()=>{i&&t()}).catch(Dj)};if(!e)return null;let b=(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`div`,{className:`sidebar-top`,children:[(0,A.jsxs)(`div`,{className:`workspace-heading`,children:[(0,A.jsxs)(`button`,{type:`button`,className:`workspace-trigger`,"aria-label":`切换工作区`,"aria-expanded":a!==null&&!a.id,disabled:_,onClick:e=>o({anchor:e.currentTarget}),children:[(0,A.jsx)(`span`,{className:`workspace-mark`,children:(0,A.jsx)(oF,{name:`folder`})}),(0,A.jsx)(`span`,{className:`truncate min-w-0`,children:fF(n.workspaceRoot)||`工作区`}),(0,A.jsx)(oF,{name:`chevron`})]}),!i&&(0,A.jsx)(`button`,{type:`button`,className:`icon-btn`,"aria-label":`收起侧栏`,title:`收起侧栏`,onClick:t,children:(0,A.jsx)(oF,{name:`panel`})})]}),(0,A.jsxs)(`button`,{type:`button`,className:`chrome-row font-medium`,disabled:_,onClick:()=>y(Tj.createSession()),children:[(0,A.jsx)(oF,{name:`plus`}),`新建会话`]}),(0,A.jsxs)(`div`,{className:`search-box`,children:[(0,A.jsx)(oF,{name:`search`}),(0,A.jsx)(`input`,{"aria-label":`搜索当前工作区会话`,placeholder:`搜索会话…`,value:h,onChange:e=>g(e.target.value)})]})]}),(0,A.jsxs)(`div`,{className:`section-label`,children:[`会话 `,(0,A.jsx)(`span`,{children:v.length})]}),(0,A.jsxs)(`div`,{className:`session-scroll`,children:[(0,A.jsx)(`ul`,{className:`session-list`,children:v.map(e=>(0,A.jsxs)(`li`,{className:`session-row ${e.id===n.currentSessionId?`is-active`:``}`,children:[(0,A.jsxs)(`button`,{type:`button`,className:`chrome-row session-select`,disabled:_,"aria-current":e.id===n.currentSessionId?`page`:void 0,"aria-describedby":`session-tip-${e.id}`,onClick:()=>y(Tj.selectSession(e.id)),children:[(0,A.jsx)(oF,{name:`chat`}),(0,A.jsxs)(`span`,{className:`session-copy`,children:[(0,A.jsx)(`span`,{className:`truncate min-w-0`,children:ki(e,`新会话`)}),(0,A.jsxs)(`span`,{className:`session-meta`,children:[(0,A.jsx)(`time`,{dateTime:new Date(Ai(e)).toISOString(),children:Pi(Ai(e),r,`zh`)}),e.status===`running`?` · 运行中`:e.status===`error`?` · 出错`:``]}),(0,A.jsxs)(`span`,{className:`session-tooltip`,role:`tooltip`,id:`session-tip-${e.id}`,children:[ki(e,`新会话`),(0,A.jsx)(`br`,{}),new Date(Ai(e)).toLocaleString(`zh-CN`)]})]})]}),(0,A.jsx)(`button`,{type:`button`,className:`icon-btn row-more`,disabled:_,"aria-label":`${ki(e,`新会话`)}的操作`,title:`会话操作`,onClick:t=>o({anchor:t.currentTarget,id:e.id}),children:(0,A.jsx)(oF,{name:`more`})})]},e.id))}),v.length===0&&(0,A.jsx)(`div`,{className:`empty-text`,children:n.phase===`ready`?h?`没有匹配的会话`:`此工作区暂无会话`:`等待网关连接…`})]}),(0,A.jsxs)(`div`,{className:`sidebar-bottom`,children:[(0,A.jsx)(`span`,{className:`path-text`,title:n.workspaceRoot,children:n.workspaceRoot}),(0,A.jsxs)(Hr,{to:`/skills`,className:`chrome-row`,onClick:()=>{i&&t()},children:[(0,A.jsx)(oF,{name:`store`}),`技能市场`]}),(0,A.jsxs)(Hr,{to:`/settings`,className:`chrome-row`,onClick:()=>{i&&t()},children:[(0,A.jsx)(oF,{name:`settings`}),`设置`]})]})]});return(0,A.jsxs)(A.Fragment,{children:[i?(0,A.jsx)(uF,{title:`工作区与会话`,drawer:!0,onClose:t,children:b}):(0,A.jsx)(`aside`,{className:`chrome sidebar`,"aria-label":`工作区与会话`,children:b}),a&&(0,A.jsx)(dF,{anchor:a.anchor,label:a.id?`会话操作`:`选择工作区`,onClose:()=>o(null),children:a.id?(0,A.jsxs)(A.Fragment,{children:[s&&(0,A.jsxs)(`div`,{className:`session-details`,children:[(0,A.jsx)(`strong`,{children:ki(s,`新会话`)}),(0,A.jsx)(`small`,{children:new Date(Ai(s)).toLocaleString(`zh-CN`)})]}),(0,A.jsxs)(`button`,{type:`button`,className:`chrome-row`,onClick:()=>{d(a.id),m(``),o(null)},children:[(0,A.jsx)(oF,{name:`archive`}),`归档会话`]})]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`div`,{className:`section-label`,children:`工作区`}),(0,A.jsx)(`div`,{className:`workspace-options`,children:n.workspaces.map(e=>(0,A.jsxs)(`button`,{type:`button`,className:`workspace-option ${e.path===n.workspaceRoot?`is-active`:``}`,title:e.path,onClick:()=>{o(null),g(``),y(Tj.selectWorkspace(e.path))},children:[(0,A.jsx)(oF,{name:`folder`}),(0,A.jsxs)(`span`,{children:[(0,A.jsx)(`strong`,{children:fF(e.path)}),(0,A.jsx)(`small`,{children:e.path})]}),e.path===n.workspaceRoot&&(0,A.jsx)(`span`,{role:`img`,"aria-label":`当前工作区`,children:`✓`})]},e.path))}),(0,A.jsxs)(`button`,{type:`button`,className:`chrome-row add-workspace`,onClick:()=>{o(null),l(!0)},children:[(0,A.jsx)(oF,{name:`plus`}),`添加工作区`]})]})}),c&&(0,A.jsx)(Eq,{initialPath:n.workspaceRoot,onClose:()=>l(!1)}),u&&(0,A.jsx)(uF,{title:`归档会话`,locked:n.operating,onClose:()=>d(null),children:(0,A.jsxs)(`div`,{className:`confirm-body`,children:[(0,A.jsxs)(`p`,{children:[`归档“`,ki(n.sessions.find(e=>e.id===u)??{title:``,firstPromptPreview:``},`新会话`),`”?会话将从列表中隐藏,工作区和文件仍会保留。`]}),p&&(0,A.jsx)(`p`,{role:`alert`,className:`error-text`,children:p}),(0,A.jsxs)(`div`,{className:`actions`,children:[(0,A.jsx)(`button`,{type:`button`,className:`btn-outline`,disabled:n.operating,onClick:()=>d(null),children:`取消`}),(0,A.jsx)(`button`,{type:`button`,className:`btn-primary`,disabled:n.operating,onClick:()=>{Tj.archiveSession(u).then(()=>d(null)).catch(e=>m(String(e)))},children:`确认归档`})]})]})})]})}function Oq(e,t){let n=new Map(e.map(e=>[e.key,e]));for(let e of t){let t=n.get(e.key);(t?.type!==`tool`||e.type!==`tool`||t.phase!==`done`||e.phase===`done`)&&n.set(e.key,e)}return[...n.values()].sort((e,t)=>(e.order??0)-(t.order??0))}var kq={idle:`空闲`,queued:`排队中`,running:`运行中`,completed:`已完成`,failed:`失败`,cancelled:`已停止`};function Aq({entry:e,active:t,target:n}){let{phase:r,operating:i,view:a}=pj(),[o,s]=(0,f.useState)(null),[c,l]=(0,f.useState)(``),[u,d]=(0,f.useState)([]),[p,m]=(0,f.useState)(),[h,g]=(0,f.useState)(!1),[,_]=(0,f.useState)(Date.now);(0,f.useEffect)(()=>{if(!t||e.activeRoundId===null)return;let n=setInterval(()=>_(Date.now()),1e3);return()=>clearInterval(n)},[t,e.activeRoundId]);let v=r===`ready`&&!i&&a!==null,y=(0,f.useMemo)(()=>v&&t?Tj.subagent(e.agentId):null,[v,t,e.agentId]),b=(0,f.useRef)(0);(0,f.useEffect)(()=>{let e=++b.current;if(g(!1),m(void 0),!y)return;let t=y.view.subscribe(t=>{e===b.current&&y.error&&l(y.error),e===b.current&&t&&(s(e=>(e?.items.length&&!t.items.some(t=>e.items.some(e=>e.key===t.key))&&m(t.historyBefore),{...t,items:Oq(e?.items??[],t.items)})),m(e=>e===void 0?t.historyBefore:e),y.error||l(``))});return()=>{b.current++,t()}},[y]);let x=(0,f.useMemo)(()=>y?(e,t)=>Di(n=>y.getImage({entryId:e,contentIndex:t,offset:n})):null,[y]),S=(0,f.useMemo)(()=>o?{...o,items:Oq(u,o.items)}:null,[o,u]),C=(0,f.useCallback)(async()=>{if(!y||h||p==null)return;let e=b.current;g(!0);try{let t=await y.history(p==null?{}:{before:p});if(e!==b.current)return;d(e=>Oq(e,t.items)),m(t.next)}catch(t){e===b.current&&l(String(t))}finally{e===b.current&&g(!1)}},[y,h,p]),w=n?o?.rounds?.find(e=>e.taskId===n.taskId)?.inputEntryId:void 0,T=o?.rounds?.find(t=>t.taskId===(e.activeRoundId??e.lastRoundId));return(0,f.useEffect)(()=>{t&&w!==void 0&&S&&!S.items.some(e=>e.type===`user`&&e.id===w)&&p!=null&&!h&&C()},[t,w,S,p,h,C]),(0,A.jsxs)(`div`,{className:`${t?`flex`:`hidden`} min-h-0 flex-1 flex-col`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-sakura-100 p-3 text-xs`,children:[(0,A.jsxs)(`span`,{children:[e.historyThrough===void 0?``:`历史 · `,kq[e.status]]}),o&&(0,A.jsxs)(`span`,{title:`子智能体累计用量`,children:[`↑`,o.usage.input,` ↓`,o.usage.output,` · $`,o.usage.cost.toFixed(4)]}),T&&(0,A.jsxs)(`span`,{title:`当前或最近任务耗时`,children:[Math.max(0,Math.round(((T.endedAt??Date.now())-T.createdAt)/1e3)),`s`]}),e.historyThrough===void 0&&(e.status===`running`||e.status===`queued`)&&(0,A.jsx)(`button`,{type:`button`,className:`focus-neko rounded-lg border border-sakura-300 px-2 leading-[14px]`,onClick:()=>{y?.stop({taskId:e.activeRoundId}).catch(e=>l(String(e)))},children:`停止此任务`})]}),c&&(0,A.jsx)(`p`,{role:`alert`,className:`p-3 text-sm text-sakura-800`,children:c}),(0,A.jsx)(yR.Provider,{value:x,children:(0,A.jsx)(vq,{view:S,focusEntry:w!==void 0&&n?{id:w,nonce:n.nonce}:void 0,onLoadEarlier:t&&p!=null?C:void 0,busy:o?.busy??!1,emptyLabel:e.status===`queued`?`任务排队中…`:`暂无内容`})})]})}function jq({entries:e,selected:t,open:n,onSelect:r,onClose:i,approval:a,target:o}){let[s,c]=(0,f.useState)([]),l=(0,f.useRef)(null),u=(0,f.useRef)(null),[d,p]=(0,f.useState)(()=>window.matchMedia(`(max-width: 1023px)`).matches);return(0,f.useEffect)(()=>{let e=window.matchMedia(`(max-width: 1023px)`),t=()=>p(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]),(0,f.useEffect)(()=>{t!==null&&c(e=>e.includes(t)?e:[...e,t])},[t]),(0,f.useEffect)(()=>{if(!n)return;let e=document.activeElement,t=d&&u.current?.parentElement?[...u.current.parentElement.children].filter(e=>e instanceof HTMLElement&&e!==u.current):[],r=t.map(e=>e.inert);return t.forEach(e=>{e.inert=!0}),l.current?.focus(),()=>{t.forEach((e,t)=>{e.inert=r[t]}),e?.isConnected&&e.focus()}},[n,d]),(0,A.jsxs)(`aside`,{ref:u,role:d?`dialog`:`complementary`,"aria-modal":d&&n?!0:void 0,"aria-label":`子智能体`,className:`${n?`flex`:`hidden`} fixed inset-0 z-30 min-w-0 flex-col border-l border-sakura-200 bg-base lg:static lg:z-auto lg:w-[min(42vw,40rem)] lg:shrink-0`,onKeyDown:e=>{if(e.currentTarget.contains(e.target)){if(e.key===`Tab`&&window.innerWidth<1024){let t=[...e.currentTarget.querySelectorAll(`button:not([disabled]),a[href],summary,[tabindex='0']`)].filter(e=>e.getClientRects().length>0),n=t[0],r=t.at(-1);e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())}e.key===`Escape`&&(e.stopPropagation(),i())}},children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between border-b border-sakura-200 px-4 py-1.5`,children:[(0,A.jsx)(`strong`,{className:`text-sm text-ink-800`,children:`子智能体`}),(0,A.jsx)(`button`,{ref:l,type:`button`,className:`focus-neko rounded-lg px-2 py-1 text-sm text-ink-600 hover:bg-sakura-50`,onClick:i,children:`关闭`})]}),(0,A.jsx)(`div`,{className:`max-h-44 shrink-0 overflow-auto border-b border-sakura-100 p-2`,children:e.map(e=>(0,A.jsxs)(`button`,{type:`button`,"aria-pressed":t===e.agentId,className:`focus-neko flex w-full min-w-0 items-center gap-2 rounded-lg px-2 py-1.5 text-left text-sm ${t===e.agentId?`bg-tianyi-100`:`hover:bg-sakura-50`}`,onClick:()=>r(e.agentId),children:[(0,A.jsxs)(`span`,{className:`min-w-0 truncate`,children:[(0,A.jsx)(`span`,{className:`text-tianyi-700`,children:e.role}),` · `,e.title]}),(0,A.jsxs)(`span`,{className:`shrink-0 text-xs text-ink-500`,children:[e.roundCount,` 轮`]})]},e.agentId))}),s.map(r=>{let i=e.find(e=>e.agentId===r);return i?(0,A.jsx)(Aq,{entry:i,active:n&&r===t,target:r===t?o:void 0},r):null}),a]})}var Mq=class extends Error{constructor(){super(`会话已切换,导出已取消`),this.name=`ExportCancelledError`}};async function Nq(e){let{snapshot:t}=e,n=e.now??new Date,r=!1,i=await lR(e.format,{...t,exportedAt:n},{includeThinking:e.includeThinking,loadImage:n=>e.currentSessionId()===t.sessionId?e.readImage(n,t.sessionId):(r=!0,Promise.reject(new Mq))});if(r)throw new Mq;return{...i,fileName:cR(t.title,e.format,n)}}function Pq(e){let t=e.skippedImages>0?`,${e.skippedImages} 张图片未能内嵌`:``;return`已导出 ${e.fileName}${t}`}function Fq(e,t,n){let r=URL.createObjectURL(new Blob([t],{type:n})),i=document.createElement(`a`);i.href=r,i.download=e,i.hidden=!0,document.body.append(i);try{i.click()}finally{i.remove(),setTimeout(()=>URL.revokeObjectURL(r),0)}}var Iq=[{format:`markdown`,label:`Markdown (.md)`},{format:`html`,label:`HTML (.html)`},{format:`json`,label:`JSON (.json)`}];function Lq(){let{view:e,currentSessionId:t,sessions:n}=pj(),[r,i]=(0,f.useState)(null),[a,o]=(0,f.useState)(!1),[s,c]=(0,f.useState)(!1),l=(0,f.useRef)(!1),u=e===null||t===null||e.items.length===0,d=s?`导出中…`:u?`当前会话还没有内容可导出`:`导出会话`,p=async r=>{if(l.current||e===null||t===null)return;l.current=!0,c(!0),i(null);let o=n.find(e=>e.id===t);try{let n=await Nq({format:r,includeThinking:a,snapshot:{sessionId:t,title:o?ki(o,`新会话`):`新会话`,model:e.model,cwd:e.cwd,items:e.items},currentSessionId:()=>mj().currentSessionId,readImage:(e,t)=>Tj.image(e.entryId,e.contentIndex,t)});Fq(n.fileName,n.content,n.mimeType),hj.notice({level:`info`,text:Pq(n)})}catch(e){hj.notice({level:`error`,text:e instanceof Mq?e.message:`导出失败:${e instanceof Error?e.message:String(e)}`})}finally{l.current=!1,c(!1)}};return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`button`,{type:`button`,className:`icon-btn export-btn`,"aria-label":`导出会话`,"aria-haspopup":`dialog`,"aria-expanded":r!==null,"aria-disabled":s||void 0,disabled:u&&!s,title:d,onClick:e=>{s||i(r===null?e.currentTarget:null)},children:[(0,A.jsx)(oF,{name:`download`}),(0,A.jsx)(`span`,{className:`export-label`,children:s?`导出中…`:`导出`})]}),r&&(0,A.jsxs)(dF,{anchor:r,label:`导出会话`,onClose:()=>i(null),children:[(0,A.jsx)(`div`,{className:`section-label`,children:`导出格式`}),Iq.map(({format:e,label:t})=>(0,A.jsxs)(`button`,{type:`button`,className:`chrome-row`,onClick:()=>void p(e),children:[(0,A.jsx)(oF,{name:`download`}),t]},e)),(0,A.jsxs)(`button`,{type:`button`,role:`switch`,"aria-checked":a,className:`chrome-row export-option`,onClick:()=>o(!a),children:[(0,A.jsx)(`span`,{className:`export-check`,"aria-hidden":`true`,children:a?`✓`:``}),`包含思考过程`]})]})]})}var Rq={ready:`已连接`,connecting:`连接中…`,reconnecting:`重连中…`,error:`连接失败`};function zq(e){let{workspaceRoot:t,currentSessionId:n,operating:r,sessions:i,view:a}=pj(),o=a?.jobs,s=o?.filter(e=>e.status===`running`).length??0,c=i.find(e=>e.id===n);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`header`,{className:`chrome topbar`,children:[(0,A.jsx)(`button`,{type:`button`,className:`icon-btn`,"aria-label":`切换侧栏`,title:`切换侧栏`,"aria-expanded":e.sidebarOpen,onClick:e.onToggleSessions,children:(0,A.jsx)(oF,{name:`panel`})}),(0,A.jsxs)(`span`,{className:`topbar-path`,title:t,children:[(0,A.jsx)(oF,{name:`folder`}),(0,A.jsx)(`span`,{className:`truncate min-w-0`,children:fF(t)||`工作区`})]}),(0,A.jsx)(`span`,{className:`text-ink-500`,children:`/`}),(0,A.jsx)(`span`,{className:`truncate min-w-0`,title:c?ki(c,`新会话`):void 0,children:c?ki(c,`新会话`):`新会话`}),(0,A.jsx)(`output`,{className:`conn-status ${e.conn===`ready`?`is-connected`:e.conn===`error`?`is-error`:``}`,children:r?`切换中…`:Rq[e.conn]}),o!==void 0&&o.length>0&&e.onToggleJobs&&(0,A.jsxs)(`button`,{type:`button`,className:`focus-neko shrink-0 whitespace-nowrap rounded-full border border-sakura-300 px-2.5 py-0.5 text-xs text-sakura-800 hover:bg-sakura-50`,"aria-expanded":e.jobsOpen,title:`后台任务`,onClick:e.onToggleJobs,children:[`任务`,s>0?` · ${s} 运行中`:` ${o.length}`]}),(0,A.jsx)(Lq,{})]}),(0,A.jsx)(AF,{})]})}var Bq=8e3;function Vq(){let{view:e,phase:t,notice:n,operating:r,workspaceRoot:i,currentSessionId:a}=pj(),o=sF();(0,f.useEffect)(()=>{if(n?.level!==`info`)return;let e=setTimeout(hj.clearNotice,Bq);return()=>clearTimeout(e)},[n]);let s=(0,f.useRef)(0),[c,l]=(0,f.useState)(()=>window.matchMedia(`(max-width: 1023px)`).matches);(0,f.useEffect)(()=>{let e=window.matchMedia(`(max-width: 1023px)`),t=()=>l(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let[u,d]=(0,f.useState)({}),p=e?.agents;(0,f.useEffect)(()=>{a&&p?.length&&d(e=>({...e,[a]:{open:e[a]?.open??!0,...e[a]?.target?{target:e[a].target}:{},selected:e[a]?.selected??p[0].agentId,entries:p}}))},[p,a]);let[m,h]=(0,f.useState)(null),g=m!==null&&m===a,_=(e,t)=>{if(!a)return;h(null);let n=++s.current;d(r=>({...r,[a]:{open:!0,selected:e,entries:p??[],...t===void 0?{}:{target:{taskId:t,nonce:n}}}}))},v=t=>{let n=e?.subagents?.find(e=>e.taskId===t);n?.agentId&&_(n.agentId,t)},[y,b]=(0,f.useState)(()=>!window.matchMedia(aF).matches);(0,f.useEffect)(()=>{b(!o)},[o]);let x=c&&!!u[a??``]?.open,S=e?.busy??!1,C=e?.status??null;return(0,A.jsxs)(`div`,{className:`flex h-dvh`,children:[(0,A.jsx)(`a`,{href:`#main-content`,className:`skip-link`,children:`跳到主内容`}),(0,A.jsx)(Dq,{open:y,onClose:()=>b(!1)}),(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,A.jsx)(zq,{sidebarOpen:y,conn:t,onToggleSessions:()=>b(!y),jobsOpen:g,onToggleJobs:()=>{!g&&a&&d(e=>e[a]?{...e,[a]:{...e[a],open:!1}}:e),h(g?null:a??null)}}),n!==null&&(0,A.jsxs)(`div`,{className:`discrete-in flex items-center gap-2 border-b py-1 pr-2 pl-9 text-xs ${n.level===`error`?`border-sakura-300 bg-sakura-100 text-sakura-900`:`border-tianyi-200 bg-tianyi-50 text-tianyi-900`}`,role:`alert`,children:[(0,A.jsx)(`span`,{className:`min-w-0 flex-1 text-center`,children:n.text}),(0,A.jsx)(pF,{label:`关闭提示`,onClick:hj.clearNotice})]}),(0,A.jsxs)(`main`,{id:`main-content`,tabIndex:-1,className:`flex min-h-0 flex-1 flex-col focus:outline-none`,children:[!a&&t===`ready`&&!r?(0,A.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 px-6 text-center`,children:[(0,A.jsx)(`h1`,{className:`text-xl font-semibold text-ink-900`,children:fF(i)}),(0,A.jsx)(`p`,{className:`text-sm text-ink-600`,children:`在这个工作区开始新的会话`}),(0,A.jsx)(`button`,{type:`button`,className:`btn-primary focus-neko rounded-xl px-4 py-2`,onClick:()=>{Tj.createSession().catch(Dj)},children:`新建会话`})]}):(0,A.jsx)(vq,{view:e,busy:S,onSubagent:v,tray:(p?.length??0)>0?(0,A.jsxs)(`button`,{type:`button`,className:`focus-neko rounded-full border border-sakura-300 bg-surface px-3.5 py-1 text-xs font-medium text-sakura-800 hover:bg-sakura-50`,onClick:()=>_(u[a??``]?.selected??p[0].agentId),children:[`子智能体 · `,p.length,` 个`,p.some(e=>e.approvalCount)?` · 待审批 ${p.reduce((e,t)=>e+(t.approvalCount??0),0)}`:``,p.some(e=>e.historyThrough===void 0&&e.status===`running`)?` · ${p.filter(e=>e.historyThrough===void 0&&e.status===`running`).length} 运行中`:``]}):void 0}),!x&&(0,A.jsx)(FF,{}),(0,A.jsx)(CF,{disabled:t!==`ready`||r,busy:S,status:C})]})]}),Object.entries(u).map(([e,t])=>(0,A.jsx)(jq,{entries:e===a?p??t.entries:t.entries,approval:x&&e===a?(0,A.jsx)(FF,{}):void 0,selected:t.selected,open:e===a&&t.open,onSelect:_,target:t.target,onClose:()=>d(n=>({...n,[e]:{...t,open:!1}}))},e)),a&&e?.jobs!==void 0&&(0,A.jsx)(eI,{sessionId:a,jobs:e.jobs,open:g,onClose:()=>h(null)},a)]})}var Hq=function(e,t){let n=e,r=Wq[t],i=null,a=0,o=null,s=[],c={},l=function(e,t){a=n*4+17,i=function(e){let t=Array(e);for(let n=0;n<e;n+=1){t[n]=Array(e);for(let r=0;r<e;r+=1)t[n][r]=null}return t}(a),u(0,0),u(a-7,0),u(0,a-7),p(),f(),h(e,t),n>=7&&m(e),o??=v(n,r,s),g(o,t)},u=function(e,t){for(let n=-1;n<=7;n+=1)if(!(e+n<=-1||a<=e+n))for(let r=-1;r<=7;r+=1)t+r<=-1||a<=t+r||(0<=n&&n<=6&&(r==0||r==6)||0<=r&&r<=6&&(n==0||n==6)||2<=n&&n<=4&&2<=r&&r<=4?i[e+n][t+r]=!0:i[e+n][t+r]=!1)},d=function(){let e=0,t=0;for(let n=0;n<8;n+=1){l(!0,n);let r=Kq.getLostPoint(c);(n==0||e>r)&&(e=r,t=n)}return t},f=function(){for(let e=8;e<a-8;e+=1)i[e][6]??(i[e][6]=e%2==0);for(let e=8;e<a-8;e+=1)i[6][e]??(i[6][e]=e%2==0)},p=function(){let e=Kq.getPatternPosition(n);for(let t=0;t<e.length;t+=1)for(let n=0;n<e.length;n+=1){let r=e[t],a=e[n];if(i[r][a]==null)for(let e=-2;e<=2;e+=1)for(let t=-2;t<=2;t+=1)e==-2||e==2||t==-2||t==2||e==0&&t==0?i[r+e][a+t]=!0:i[r+e][a+t]=!1}},m=function(e){let t=Kq.getBCHTypeNumber(n);for(let n=0;n<18;n+=1){let r=!e&&(t>>n&1)==1;i[Math.floor(n/3)][n%3+a-8-3]=r}for(let n=0;n<18;n+=1){let r=!e&&(t>>n&1)==1;i[n%3+a-8-3][Math.floor(n/3)]=r}},h=function(e,t){let n=r<<3|t,o=Kq.getBCHTypeInfo(n);for(let t=0;t<15;t+=1){let n=!e&&(o>>t&1)==1;t<6?i[t][8]=n:t<8?i[t+1][8]=n:i[a-15+t][8]=n}for(let t=0;t<15;t+=1){let n=!e&&(o>>t&1)==1;t<8?i[8][a-t-1]=n:t<9?i[8][15-t-1+1]=n:i[8][15-t-1]=n}i[a-8][8]=!e},g=function(e,t){let n=-1,r=a-1,o=7,s=0,c=Kq.getMaskFunction(t);for(let t=a-1;t>0;t-=2)for(t==6&&--t;;){for(let n=0;n<2;n+=1)if(i[r][t-n]==null){let a=!1;s<e.length&&(a=(e[s]>>>o&1)==1),c(r,t-n)&&(a=!a),i[r][t-n]=a,--o,o==-1&&(s+=1,o=7)}if(r+=n,r<0||a<=r){r-=n,n=-n;break}}},_=function(e,t){let n=0,r=0,i=0,a=Array(t.length),o=Array(t.length);for(let s=0;s<t.length;s+=1){let c=t[s].dataCount,l=t[s].totalCount-c;r=Math.max(r,c),i=Math.max(i,l),a[s]=Array(c);for(let t=0;t<a[s].length;t+=1)a[s][t]=255&e.getBuffer()[t+n];n+=c;let u=Kq.getErrorCorrectPolynomial(l),d=Jq(a[s],u.getLength()-1).mod(u);o[s]=Array(u.getLength()-1);for(let e=0;e<o[s].length;e+=1){let t=e+d.getLength()-o[s].length;o[s][e]=t>=0?d.getAt(t):0}}let s=0;for(let e=0;e<t.length;e+=1)s+=t[e].totalCount;let c=Array(s),l=0;for(let e=0;e<r;e+=1)for(let n=0;n<t.length;n+=1)e<a[n].length&&(c[l]=a[n][e],l+=1);for(let e=0;e<i;e+=1)for(let n=0;n<t.length;n+=1)e<o[n].length&&(c[l]=o[n][e],l+=1);return c},v=function(e,t,n){let r=Yq.getRSBlocks(e,t),i=Xq();for(let t=0;t<n.length;t+=1){let r=n[t];i.put(r.getMode(),4),i.put(r.getLength(),Kq.getLengthInBits(r.getMode(),e)),r.write(i)}let a=0;for(let e=0;e<r.length;e+=1)a+=r[e].dataCount;if(i.getLengthInBits()>a*8)throw`code length overflow. (`+i.getLengthInBits()+`>`+a*8+`)`;for(i.getLengthInBits()+4<=a*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=a*8||(i.put(236,8),i.getLengthInBits()>=a*8));)i.put(17,8);return _(i,r)};c.addData=function(e,t){t||=`Byte`;let n=null;switch(t){case`Numeric`:n=Zq(e);break;case`Alphanumeric`:n=Qq(e);break;case`Byte`:n=$q(e);break;case`Kanji`:n=eJ(e);break;default:throw`mode:`+t}s.push(n),o=null},c.isDark=function(e,t){if(e<0||a<=e||t<0||a<=t)throw e+`,`+t;return i[e][t]},c.getModuleCount=function(){return a},c.make=function(){if(n<1){let e=1;for(;e<40;e++){let t=Yq.getRSBlocks(e,r),n=Xq();for(let t=0;t<s.length;t++){let r=s[t];n.put(r.getMode(),4),n.put(r.getLength(),Kq.getLengthInBits(r.getMode(),e)),r.write(n)}let i=0;for(let e=0;e<t.length;e++)i+=t[e].dataCount;if(n.getLengthInBits()<=i*8)break}n=e}l(!1,d())},c.createTableTag=function(e,t){e||=2,t=t===void 0?e*4:t;let n=``;n+=`<table style="`,n+=` border-width: 0px; border-style: none;`,n+=` border-collapse: collapse;`,n+=` padding: 0px; margin: `+t+`px;`,n+=`">`,n+=`<tbody>`;for(let t=0;t<c.getModuleCount();t+=1){n+=`<tr>`;for(let r=0;r<c.getModuleCount();r+=1)n+=`<td style="`,n+=` border-width: 0px; border-style: none;`,n+=` border-collapse: collapse;`,n+=` padding: 0px; margin: 0px;`,n+=` width: `+e+`px;`,n+=` height: `+e+`px;`,n+=` background-color: `,n+=c.isDark(t,r)?`#000000`:`#ffffff`,n+=`;`,n+=`"/>`;n+=`</tr>`}return n+=`</tbody>`,n+=`</table>`,n},c.createSvgTag=function(e,t,n,r){let i={};typeof arguments[0]==`object`&&(i=arguments[0],e=i.cellSize,t=i.margin,n=i.alt,r=i.title),e||=2,t=t===void 0?e*4:t,n=typeof n==`string`?{text:n}:n||{},n.text=n.text||null,n.id=n.text?n.id||`qrcode-description`:null,r=typeof r==`string`?{text:r}:r||{},r.text=r.text||null,r.id=r.text?r.id||`qrcode-title`:null;let a=c.getModuleCount()*e+t*2,o,s,l,u,d=``,f;for(f=`l`+e+`,0 0,`+e+` -`+e+`,0 0,-`+e+`z `,d+=`<svg version="1.1" xmlns="http://www.w3.org/2000/svg"`,d+=i.scalable?``:` width="`+a+`px" height="`+a+`px"`,d+=` viewBox="0 0 `+a+` `+a+`" `,d+=` preserveAspectRatio="xMinYMin meet"`,d+=r.text||n.text?` role="img" aria-labelledby="`+y([r.id,n.id].join(` `).trim())+`"`:``,d+=`>`,d+=r.text?`<title id="`+y(r.id)+`">`+y(r.text)+`</title>`:``,d+=n.text?`<description id="`+y(n.id)+`">`+y(n.text)+`</description>`:``,d+=`<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>`,d+=`<path d="`,l=0;l<c.getModuleCount();l+=1)for(u=l*e+t,o=0;o<c.getModuleCount();o+=1)c.isDark(l,o)&&(s=o*e+t,d+=`M`+s+`,`+u+f);return d+=`" stroke="transparent" fill="black"/>`,d+=`</svg>`,d},c.createDataURL=function(e,t){e||=2,t=t===void 0?e*4:t;let n=c.getModuleCount()*e+t*2,r=t,i=n-t;return aJ(n,n,function(t,n){if(r<=t&&t<i&&r<=n&&n<i){let i=Math.floor((t-r)/e),a=Math.floor((n-r)/e);return+!c.isDark(a,i)}return 1})},c.createImgTag=function(e,t,n){e||=2,t=t===void 0?e*4:t;let r=c.getModuleCount()*e+t*2,i=``;return i+=`<img`,i+=` src="`,i+=c.createDataURL(e,t),i+=`"`,i+=` width="`,i+=r,i+=`"`,i+=` height="`,i+=r,i+=`"`,n&&(i+=` alt="`,i+=y(n),i+=`"`),i+=`/>`,i};let y=function(e){let t=``;for(let n=0;n<e.length;n+=1){let r=e.charAt(n);switch(r){case`<`:t+=`&lt;`;break;case`>`:t+=`&gt;`;break;case`&`:t+=`&amp;`;break;case`"`:t+=`&quot;`;break;default:t+=r}}return t},b=function(e){e=e===void 0?2:e;let t=c.getModuleCount()*1+e*2,n=e,r=t-e,i,a,o,s,l,u={"██":`█`,"█ ":`▀`," █":`▄`," ":` `},d={"██":`▀`,"█ ":`▀`," █":` `," ":` `},f=``;for(i=0;i<t;i+=2){for(o=Math.floor((i-n)/1),s=Math.floor((i+1-n)/1),a=0;a<t;a+=1)l=`█`,n<=a&&a<r&&n<=i&&i<r&&c.isDark(o,Math.floor((a-n)/1))&&(l=` `),n<=a&&a<r&&n<=i+1&&i+1<r&&c.isDark(s,Math.floor((a-n)/1))?l+=` `:l+=`█`,f+=e<1&&i+1>=r?d[l]:u[l];f+=`
390
- `}return t%2&&e>0?f.substring(0,f.length-t-1)+Array(t+1).join(`▀`):f.substring(0,f.length-1)};return c.createASCII=function(e,t){if(e||=1,e<2)return b(t);--e,t=t===void 0?e*2:t;let n=c.getModuleCount()*e+t*2,r=t,i=n-t,a,o,s,l,u=Array(e+1).join(`██`),d=Array(e+1).join(` `),f=``,p=``;for(a=0;a<n;a+=1){for(s=Math.floor((a-r)/e),p=``,o=0;o<n;o+=1)l=1,r<=o&&o<i&&r<=a&&a<i&&c.isDark(s,Math.floor((o-r)/e))&&(l=0),p+=l?u:d;for(s=0;s<e;s+=1)f+=p+`
391
- `}return f.substring(0,f.length-1)},c.renderTo2dContext=function(e,t){t||=2;let n=c.getModuleCount();for(let r=0;r<n;r++)for(let i=0;i<n;i++)e.fillStyle=c.isDark(r,i)?`black`:`white`,e.fillRect(i*t,r*t,t,t)},c};Hq.stringToBytes=function(e){let t=[];for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);t.push(r&255)}return t},Hq.createStringToBytes=function(e,t){let n=function(){let n=rJ(e),r=function(){let e=n.read();if(e==-1)throw`eof`;return e},i=0,a={};for(;;){let e=n.read();if(e==-1)break;let t=r(),o=r(),s=r(),c=String.fromCharCode(e<<8|t);a[c]=o<<8|s,i+=1}if(i!=t)throw i+` != `+t;return a}();return function(e){let t=[];for(let r=0;r<e.length;r+=1){let i=e.charCodeAt(r);if(i<128)t.push(i);else{let i=n[e.charAt(r)];typeof i==`number`?(i&255)==i?t.push(i):(t.push(i>>>8),t.push(i&255)):t.push(63)}}return t}};var Uq={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Wq={L:1,M:0,Q:3,H:2},Gq={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Kq=function(){let e=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],t=1335,n=7973,r={},i=function(e){let t=0;for(;e!=0;)t+=1,e>>>=1;return t};return r.getBCHTypeInfo=function(e){let n=e<<10;for(;i(n)-i(t)>=0;)n^=t<<i(n)-i(t);return(e<<10|n)^21522},r.getBCHTypeNumber=function(e){let t=e<<12;for(;i(t)-i(n)>=0;)t^=n<<i(t)-i(n);return e<<12|t},r.getPatternPosition=function(t){return e[t-1]},r.getMaskFunction=function(e){switch(e){case Gq.PATTERN000:return function(e,t){return(e+t)%2==0};case Gq.PATTERN001:return function(e,t){return e%2==0};case Gq.PATTERN010:return function(e,t){return t%3==0};case Gq.PATTERN011:return function(e,t){return(e+t)%3==0};case Gq.PATTERN100:return function(e,t){return(Math.floor(e/2)+Math.floor(t/3))%2==0};case Gq.PATTERN101:return function(e,t){return e*t%2+e*t%3==0};case Gq.PATTERN110:return function(e,t){return(e*t%2+e*t%3)%2==0};case Gq.PATTERN111:return function(e,t){return(e*t%3+(e+t)%2)%2==0};default:throw`bad maskPattern:`+e}},r.getErrorCorrectPolynomial=function(e){let t=Jq([1],0);for(let n=0;n<e;n+=1)t=t.multiply(Jq([1,qq.gexp(n)],0));return t},r.getLengthInBits=function(e,t){if(1<=t&&t<10)switch(e){case Uq.MODE_NUMBER:return 10;case Uq.MODE_ALPHA_NUM:return 9;case Uq.MODE_8BIT_BYTE:return 8;case Uq.MODE_KANJI:return 8;default:throw`mode:`+e}else if(t<27)switch(e){case Uq.MODE_NUMBER:return 12;case Uq.MODE_ALPHA_NUM:return 11;case Uq.MODE_8BIT_BYTE:return 16;case Uq.MODE_KANJI:return 10;default:throw`mode:`+e}else if(t<41)switch(e){case Uq.MODE_NUMBER:return 14;case Uq.MODE_ALPHA_NUM:return 13;case Uq.MODE_8BIT_BYTE:return 16;case Uq.MODE_KANJI:return 12;default:throw`mode:`+e}else throw`type:`+t},r.getLostPoint=function(e){let t=e.getModuleCount(),n=0;for(let r=0;r<t;r+=1)for(let i=0;i<t;i+=1){let a=0,o=e.isDark(r,i);for(let n=-1;n<=1;n+=1)if(!(r+n<0||t<=r+n))for(let s=-1;s<=1;s+=1)i+s<0||t<=i+s||(n!=0||s!=0)&&o==e.isDark(r+n,i+s)&&(a+=1);a>5&&(n+=3+a-5)}for(let r=0;r<t-1;r+=1)for(let i=0;i<t-1;i+=1){let t=0;e.isDark(r,i)&&(t+=1),e.isDark(r+1,i)&&(t+=1),e.isDark(r,i+1)&&(t+=1),e.isDark(r+1,i+1)&&(t+=1),(t==0||t==4)&&(n+=3)}for(let r=0;r<t;r+=1)for(let i=0;i<t-6;i+=1)e.isDark(r,i)&&!e.isDark(r,i+1)&&e.isDark(r,i+2)&&e.isDark(r,i+3)&&e.isDark(r,i+4)&&!e.isDark(r,i+5)&&e.isDark(r,i+6)&&(n+=40);for(let r=0;r<t;r+=1)for(let i=0;i<t-6;i+=1)e.isDark(i,r)&&!e.isDark(i+1,r)&&e.isDark(i+2,r)&&e.isDark(i+3,r)&&e.isDark(i+4,r)&&!e.isDark(i+5,r)&&e.isDark(i+6,r)&&(n+=40);let r=0;for(let n=0;n<t;n+=1)for(let i=0;i<t;i+=1)e.isDark(i,n)&&(r+=1);let i=Math.abs(100*r/t/t-50)/5;return n+=i*10,n},r}(),qq=function(){let e=Array(256),t=Array(256);for(let t=0;t<8;t+=1)e[t]=1<<t;for(let t=8;t<256;t+=1)e[t]=e[t-4]^e[t-5]^e[t-6]^e[t-8];for(let n=0;n<255;n+=1)t[e[n]]=n;let n={};return n.glog=function(e){if(e<1)throw`glog(`+e+`)`;return t[e]},n.gexp=function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return e[t]},n}(),Jq=function(e,t){if(e.length===void 0)throw e.length+`/`+t;let n=function(){let n=0;for(;n<e.length&&e[n]==0;)n+=1;let r=Array(e.length-n+t);for(let t=0;t<e.length-n;t+=1)r[t]=e[t+n];return r}(),r={};return r.getAt=function(e){return n[e]},r.getLength=function(){return n.length},r.multiply=function(e){let t=Array(r.getLength()+e.getLength()-1);for(let n=0;n<r.getLength();n+=1)for(let i=0;i<e.getLength();i+=1)t[n+i]^=qq.gexp(qq.glog(r.getAt(n))+qq.glog(e.getAt(i)));return Jq(t,0)},r.mod=function(e){if(r.getLength()-e.getLength()<0)return r;let t=qq.glog(r.getAt(0))-qq.glog(e.getAt(0)),n=Array(r.getLength());for(let e=0;e<r.getLength();e+=1)n[e]=r.getAt(e);for(let r=0;r<e.getLength();r+=1)n[r]^=qq.gexp(qq.glog(e.getAt(r))+t);return Jq(n,0).mod(e)},r},Yq=function(){let e=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t=function(e,t){let n={};return n.totalCount=e,n.dataCount=t,n},n={},r=function(t,n){switch(n){case Wq.L:return e[(t-1)*4+0];case Wq.M:return e[(t-1)*4+1];case Wq.Q:return e[(t-1)*4+2];case Wq.H:return e[(t-1)*4+3];default:return}};return n.getRSBlocks=function(e,n){let i=r(e,n);if(i===void 0)throw`bad rs block @ typeNumber:`+e+`/errorCorrectionLevel:`+n;let a=i.length/3,o=[];for(let e=0;e<a;e+=1){let n=i[e*3+0],r=i[e*3+1],a=i[e*3+2];for(let e=0;e<n;e+=1)o.push(t(r,a))}return o},n}(),Xq=function(){let e=[],t=0,n={};return n.getBuffer=function(){return e},n.getAt=function(t){let n=Math.floor(t/8);return(e[n]>>>7-t%8&1)==1},n.put=function(e,t){for(let r=0;r<t;r+=1)n.putBit((e>>>t-r-1&1)==1)},n.getLengthInBits=function(){return t},n.putBit=function(n){let r=Math.floor(t/8);e.length<=r&&e.push(0),n&&(e[r]|=128>>>t%8),t+=1},n},Zq=function(e){let t=Uq.MODE_NUMBER,n=e,r={};r.getMode=function(){return t},r.getLength=function(e){return n.length},r.write=function(e){let t=n,r=0;for(;r+2<t.length;)e.put(i(t.substring(r,r+3)),10),r+=3;r<t.length&&(t.length-r==1?e.put(i(t.substring(r,r+1)),4):t.length-r==2&&e.put(i(t.substring(r,r+2)),7))};let i=function(e){let t=0;for(let n=0;n<e.length;n+=1)t=t*10+a(e.charAt(n));return t},a=function(e){if(`0`<=e&&e<=`9`)return e.charCodeAt(0)-48;throw`illegal char :`+e};return r},Qq=function(e){let t=Uq.MODE_ALPHA_NUM,n=e,r={};r.getMode=function(){return t},r.getLength=function(e){return n.length},r.write=function(e){let t=n,r=0;for(;r+1<t.length;)e.put(i(t.charAt(r))*45+i(t.charAt(r+1)),11),r+=2;r<t.length&&e.put(i(t.charAt(r)),6)};let i=function(e){if(`0`<=e&&e<=`9`)return e.charCodeAt(0)-48;if(`A`<=e&&e<=`Z`)return e.charCodeAt(0)-65+10;switch(e){case` `:return 36;case`$`:return 37;case`%`:return 38;case`*`:return 39;case`+`:return 40;case`-`:return 41;case`.`:return 42;case`/`:return 43;case`:`:return 44;default:throw`illegal char :`+e}};return r},$q=function(e){let t=Uq.MODE_8BIT_BYTE,n=Hq.stringToBytes(e),r={};return r.getMode=function(){return t},r.getLength=function(e){return n.length},r.write=function(e){for(let t=0;t<n.length;t+=1)e.put(n[t],8)},r},eJ=function(e){let t=Uq.MODE_KANJI,n=Hq.stringToBytes;(function(e,t){let r=n(e);if(r.length!=2||(r[0]<<8|r[1])!=t)throw`sjis not supported.`})(`友`,38726);let r=n(e),i={};return i.getMode=function(){return t},i.getLength=function(e){return~~(r.length/2)},i.write=function(e){let t=r,n=0;for(;n+1<t.length;){let r=(255&t[n])<<8|255&t[n+1];if(33088<=r&&r<=40956)r-=33088;else if(57408<=r&&r<=60351)r-=49472;else throw`illegal char at `+(n+1)+`/`+r;r=(r>>>8&255)*192+(r&255),e.put(r,13),n+=2}if(n<t.length)throw`illegal char at `+(n+1)},i},tJ=function(){let e=[],t={};return t.writeByte=function(t){e.push(t&255)},t.writeShort=function(e){t.writeByte(e),t.writeByte(e>>>8)},t.writeBytes=function(e,n,r){n||=0,r||=e.length;for(let i=0;i<r;i+=1)t.writeByte(e[i+n])},t.writeString=function(e){for(let n=0;n<e.length;n+=1)t.writeByte(e.charCodeAt(n))},t.toByteArray=function(){return e},t.toString=function(){let t=``;t+=`[`;for(let n=0;n<e.length;n+=1)n>0&&(t+=`,`),t+=e[n];return t+=`]`,t},t},nJ=function(){let e=0,t=0,n=0,r=``,i={},a=function(e){r+=String.fromCharCode(o(e&63))},o=function(e){if(e<0)throw`n:`+e;if(e<26)return 65+e;if(e<52)return 97+(e-26);if(e<62)return 48+(e-52);if(e==62)return 43;if(e==63)return 47;throw`n:`+e};return i.writeByte=function(r){for(e=e<<8|r&255,t+=8,n+=1;t>=6;)a(e>>>t-6),t-=6},i.flush=function(){if(t>0&&(a(e<<6-t),e=0,t=0),n%3!=0){let e=3-n%3;for(let t=0;t<e;t+=1)r+=`=`}},i.toString=function(){return r},i},rJ=function(e){let t=e,n=0,r=0,i=0,a={};a.read=function(){for(;i<8;){if(n>=t.length){if(i==0)return-1;throw`unexpected end of file./`+i}let e=t.charAt(n);if(n+=1,e==`=`)return i=0,-1;e.match(/^\s$/)||(r=r<<6|o(e.charCodeAt(0)),i+=6)}let e=r>>>i-8&255;return i-=8,e};let o=function(e){if(65<=e&&e<=90)return e-65;if(97<=e&&e<=122)return e-97+26;if(48<=e&&e<=57)return e-48+52;if(e==43)return 62;if(e==47)return 63;throw`c:`+e};return a},iJ=function(e,t){let n=e,r=t,i=Array(e*t),a={};a.setPixel=function(e,t,r){i[t*n+e]=r},a.write=function(e){e.writeString(`GIF87a`),e.writeShort(n),e.writeShort(r),e.writeByte(128),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(255),e.writeByte(255),e.writeByte(255),e.writeString(`,`),e.writeShort(0),e.writeShort(0),e.writeShort(n),e.writeShort(r),e.writeByte(0);let t=s(2);e.writeByte(2);let i=0;for(;t.length-i>255;)e.writeByte(255),e.writeBytes(t,i,255),i+=255;e.writeByte(t.length-i),e.writeBytes(t,i,t.length-i),e.writeByte(0),e.writeString(`;`)};let o=function(e){let t=e,n=0,r=0,i={};return i.write=function(e,i){if(e>>>i)throw`length over`;for(;n+i>=8;)t.writeByte(255&(e<<n|r)),i-=8-n,e>>>=8-n,r=0,n=0;r=e<<n|r,n+=i},i.flush=function(){n>0&&t.writeByte(r)},i},s=function(e){let t=1<<e,n=(1<<e)+1,r=e+1,a=c();for(let e=0;e<t;e+=1)a.add(String.fromCharCode(e));a.add(String.fromCharCode(t)),a.add(String.fromCharCode(n));let s=tJ(),l=o(s);l.write(t,r);let u=0,d=String.fromCharCode(i[u]);for(u+=1;u<i.length;){let e=String.fromCharCode(i[u]);u+=1,a.contains(d+e)?d+=e:(l.write(a.indexOf(d),r),a.size()<4095&&(a.size()==1<<r&&(r+=1),a.add(d+e)),d=e)}return l.write(a.indexOf(d),r),l.write(n,r),l.flush(),s.toByteArray()},c=function(){let e={},t=0,n={};return n.add=function(r){if(n.contains(r))throw`dup key:`+r;e[r]=t,t+=1},n.size=function(){return t},n.indexOf=function(t){return e[t]},n.contains=function(t){return e[t]!==void 0},n};return a},aJ=function(e,t,n){let r=iJ(e,t);for(let i=0;i<t;i+=1)for(let t=0;t<e;t+=1)r.setPixel(t,i,n(t,i));let i=tJ();r.write(i);let a=nJ(),o=i.toByteArray();for(let e=0;e<o.length;e+=1)a.writeByte(o[e]);return a.flush(),`data:image/gif;base64,`+a};Hq.stringToBytes;var oJ=class extends Error{constructor(){super(`gateway_unsupported`),this.name=`GatewayUnsupportedError`}},sJ;function cJ(){sJ=void 0}async function lJ(){return sJ??=fetch(`/api/mobile/session`,{cache:`no-store`}).then(async e=>{if(!e.ok)throw Error(`GET /api/mobile/session 失败(${e.status})`);return await e.json()}).catch(e=>{throw sJ=void 0,e}),sJ}async function uJ(e,t,n=!0){let{csrf:r}=await lJ(),i=await fetch(e,{method:`POST`,headers:{"content-type":`application/json`,"x-neko-csrf":r},body:JSON.stringify(t??null)});if(i.status===501)throw new oJ;if(i.status===403&&n)return cJ(),uJ(e,t,!1);if(!i.ok){let e=`请求失败(${i.status})`;try{let t=await i.json();typeof t.message==`string`&&t.message!==``&&(e=t.message)}catch{}throw Error(e)}return await i.json()}async function dJ(e){let t=await fetch(e,{cache:`no-store`});if(t.status===501)throw new oJ;if(!t.ok)throw Error(`GET ${e} 失败(${t.status})`);return await t.json()}var fJ={session:()=>lJ(),state:()=>dJ(`/api/mobile/state`),enable:e=>uJ(`/api/mobile/enable`,e),disable:()=>uJ(`/api/mobile/disable`,null),createPairing:()=>uJ(`/api/mobile/pairing`,null),cancelPairing:()=>uJ(`/api/mobile/pairing/cancel`,null),revoke:e=>uJ(`/api/mobile/revoke`,{deviceId:e}),regenerateCertificate:()=>uJ(`/api/mobile/certificate/regenerate`,null)},pJ=2592e6,mJ=5e3;function hJ(e){return e instanceof Error?e.message:String(e)}function gJ(e){let t=Hq(0,`M`);t.addData(e.text,`Byte`),t.make();let n=t.getModuleCount(),r=n+4,i=[];for(let e=0;e<n;e+=1)for(let r=0;r<n;r+=1)t.isDark(e,r)&&i.push(`M${r+2} ${e+2}h1v1h-1z`);return(0,A.jsxs)(`svg`,{role:`img`,viewBox:`0 0 ${r} ${r}`,shapeRendering:`crispEdges`,className:`h-44 w-44 rounded-xl bg-white p-2 text-ink-900`,children:[(0,A.jsx)(`title`,{children:`手机配对二维码`}),(0,A.jsx)(`path`,{d:i.join(` `),fill:`currentColor`})]})}function _J(){let{webInfo:e}=pj(),[t,n]=(0,f.useState)(null),[r,i]=(0,f.useState)(null),[a,o]=(0,f.useState)(``),[s,c]=(0,f.useState)(``),[l,u]=(0,f.useState)(``),[d,p]=(0,f.useState)(`8323`),[m,h]=(0,f.useState)(!1),[g,_]=(0,f.useState)(null),[v,y]=(0,f.useState)(0),[b,x]=(0,f.useState)(null),S=(0,f.useRef)(0),C=(0,f.useCallback)(async()=>{let e=++S.current;try{let t=await fJ.state();if(e!==S.current)return;i(t),o(``),u(e=>e===``?t.candidates[0]??``:e),p(String(t.port))}catch(t){e===S.current&&o(hJ(t))}},[]),w=(0,f.useCallback)(async()=>{if(document.hidden)return;let e=++S.current;try{let t=await fJ.state();if(e!==S.current)return;i(t),o(``)}catch{}},[]);(0,f.useEffect)(()=>{let e=!1;return fJ.session().then(t=>{e||(n(t.supported),t.supported&&C())}).catch(t=>{e||o(hJ(t))}),()=>{e=!0}},[C]),(0,f.useEffect)(()=>{if(t!==!0)return;let e,n=()=>{e!==void 0&&(clearInterval(e),e=void 0)},r=()=>{e===void 0&&(e=setInterval(()=>void w(),mJ))},i=()=>{document.hidden?n():(w(),r())};return document.addEventListener(`visibilitychange`,i),r(),()=>{n(),document.removeEventListener(`visibilitychange`,i)}},[t,w]),(0,f.useEffect)(()=>{if(g===null)return;let e=()=>y(Math.max(0,Math.ceil((g.expiresAt-Date.now())/1e3)));e();let t=setInterval(e,1e3);return()=>clearInterval(t)},[g]);let T=r?.state.status===`listening`,ee=T?`${r.state.address}:${r.state.port}`:``;async function te(){if(!(r===null||m)){h(!0),o(``),c(``);try{if(T)await fJ.disable(),_(null),c(`手机访问已关闭,已受理的任务继续运行。`);else{let e=Number(d);if(l.trim()===``)throw Error(`请选择要监听的局域网地址。`);if(!Number.isInteger(e)||e<1||e>65535)throw Error(`端口必须是 1-65535 的整数。`);await fJ.enable({address:l.trim(),port:e}),c(`手机访问已开启:${l.trim()}:${e}`)}await C()}catch(e){o(hJ(e))}finally{h(!1)}}}async function ne(){h(!0),o(``);try{let e=await fJ.createPairing();_(e),c(`二维码已生成,120 秒内有效。`)}catch(e){_(null),o(hJ(e))}finally{h(!1)}}async function re(){x(null),h(!0),o(``);try{let e=await fJ.regenerateCertificate();_(null),c(`证书已重新生成(${e.fingerprint.slice(0,12)}…),手机需重新扫码配对。`),await C()}catch(e){o(hJ(e))}finally{h(!1)}}async function E(e){x(null),h(!0),o(``);try{let t=await fJ.revoke(e);c(t.revoked?`已撤销设备授权,该设备已受理的任务继续运行。`:`设备不存在或已撤销。`),await C()}catch(e){o(hJ(e))}finally{h(!1)}}if(t===null)return(0,A.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,children:[(0,A.jsx)(`h2`,{className:`text-base font-bold text-ink-900`,children:`手机配对`}),(0,A.jsx)(`p`,{className:`mt-2 text-sm text-ink-500`,children:`读取中…`})]});if(!t)return(0,A.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,children:[(0,A.jsx)(`h2`,{className:`text-base font-bold text-ink-900`,children:`手机配对`}),(0,A.jsx)(`p`,{className:`mt-2 text-sm text-ink-600`,role:`alert`,children:`当前 gateway 版本不支持手机配对。请更新或重启电脑端后刷新本页;聊天功能不受影响。`})]});let ie=r?.certificate??null,ae=ie!==null&&ie.expiresAt-Date.now()<pJ,oe=r?.wsl??null,D=r?.state.status===`listening`&&r.state.mode===`wsl-relay`,se=r===null?`读取中…`:r.state.status===`listening`?`已开启 · https://${ee}${D?`(经 Windows 中继)`:``}`:r.state.status===`error`?`开启失败`:r.state.status===`disabled`?`已关闭`:`处理中…`;return(0,A.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,children:[(0,A.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-2`,children:[(0,A.jsx)(`h2`,{className:`text-base font-bold text-ink-900`,children:`手机配对`}),(0,A.jsx)(`span`,{className:`rounded-full bg-tianyi-50 px-3 py-1 text-xs text-tianyi-800`,children:se})]}),(0,A.jsx)(`p`,{className:`mb-3 text-xs text-ink-500`,children:`允许手机控制电脑上的 Agent。配对仅限本机管理,请只在可信网络中开启。`}),oe!==null&&(0,A.jsx)(`p`,{className:`mb-3 rounded-xl bg-tianyi-50 px-3 py-2 text-xs text-tianyi-800`,children:`当前在 WSL 中运行:这里列出的是 Windows 的局域网地址,开启后由 Windows 侧的转发进程接入手机连接(无需管理员权限,关闭手机访问或退出 neko 时自动停止)。`}),oe?.error!=null&&(0,A.jsx)(`p`,{className:`mb-3 rounded-xl bg-sakura-50 px-3 py-2 text-xs text-sakura-800`,role:`alert`,children:oe.error}),r?.state.status===`error`&&(0,A.jsxs)(`p`,{className:`mb-3 rounded-xl bg-sakura-50 px-3 py-2 text-xs text-sakura-800`,role:`alert`,children:[`开启失败:`,r.state.error,`。请检查所选地址与端口是否被占用。`]}),a!==``&&(0,A.jsx)(`p`,{className:`mb-3 rounded-xl bg-sakura-50 px-3 py-2 text-xs text-sakura-800`,role:`alert`,children:a}),(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-3`,children:[(0,A.jsxs)(`label`,{className:`inline-flex min-h-6 items-center gap-2 text-sm text-ink-700`,children:[(0,A.jsx)(`input`,{type:`checkbox`,checked:T===!0,disabled:m||r===null||!T&&(r?.candidates.length??0)===0&&l===``,onChange:()=>void te(),className:`focus-neko h-4 w-4 rounded border-sakura-300 accent-sakura-600`}),`允许手机控制电脑上的 Agent`]}),(0,A.jsxs)(`label`,{className:`inline-flex min-h-6 items-center gap-2 text-sm text-ink-700`,children:[`地址`,(0,A.jsxs)(`select`,{value:l,disabled:m||T===!0,onChange:e=>u(e.target.value),className:`focus-neko rounded-xl border border-sakura-200 bg-base px-2 py-1.5 text-sm`,children:[r?.candidates.length===0&&(0,A.jsx)(`option`,{value:``,children:oe===null?`未发现局域网地址`:`未发现 Windows 局域网地址`}),(r?.candidates??[]).map(e=>(0,A.jsx)(`option`,{value:e,children:e===r?.lastConnectedAddress?`${e}(上次连接成功)`:e},e))]})]}),(0,A.jsxs)(`label`,{className:`inline-flex min-h-6 items-center gap-2 text-sm text-ink-700`,htmlFor:`mobile-port`,children:[`端口`,(0,A.jsx)(`input`,{id:`mobile-port`,type:`number`,min:1,max:65535,value:d,disabled:m||T===!0,onChange:e=>p(e.target.value),className:`focus-neko w-24 rounded-xl border border-sakura-200 bg-base px-2 py-1.5 text-sm`})]})]}),T!==!0&&(r?.candidates.length??0)===0&&(0,A.jsx)(`p`,{className:`mt-2 text-xs text-ink-500`,children:oe===null?`未发现可用的局域网地址,请确认电脑已连接网络(本机回环地址不可用于手机访问)。`:`未发现可用的 Windows 局域网地址,请确认 Windows 已连接网络且 WSL 互操作可用。`}),T===!0&&(0,A.jsx)(`div`,{className:`mt-4 border-t border-sakura-100 pt-4`,children:(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-4`,children:[g!==null&&v>0?(0,A.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,A.jsx)(gJ,{text:g.pairingText}),(0,A.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[(0,A.jsxs)(`span`,{className:`text-xs text-ink-500`,children:[`二维码剩余 `,v,` 秒`]}),(0,A.jsx)(vR,{text:g.pairingText,label:`复制配对文本`}),(0,A.jsx)(`button`,{type:`button`,disabled:m,onClick:()=>void ne(),className:`focus-neko rounded-full bg-sakura-100 px-4 py-1.5 text-sm font-semibold text-sakura-800 disabled:opacity-50`,children:`刷新二维码`})]})]}):(0,A.jsxs)(`div`,{className:`flex flex-col items-start gap-2`,children:[g!==null&&v<=0&&(0,A.jsx)(`span`,{className:`text-xs text-ink-500`,children:`二维码已过期,请刷新后重新扫码。`}),(0,A.jsx)(`button`,{type:`button`,disabled:m,onClick:()=>void ne(),className:`focus-neko rounded-full bg-sakura-100 px-4 py-1.5 text-sm font-semibold text-sakura-800 disabled:opacity-50`,children:`生成二维码`})]}),(0,A.jsxs)(`p`,{className:`max-w-64 text-xs text-ink-500`,children:[`用手机 App 扫码,或点击「复制配对文本」后在 App 中粘贴。请确保手机与电脑在同一网络,防火墙放行所选端口`,D?`(WSL 下需在 Windows 防火墙放行 powershell.exe)`:``,`。`]})]})}),(0,A.jsxs)(`div`,{className:`mt-4 border-t border-sakura-100 pt-4`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-ink-800`,children:`证书`}),ie!==null&&(0,A.jsxs)(`span`,{className:`text-xs text-ink-500`,children:[ie.fingerprint.slice(0,16),`… · 到期 `,new Date(ie.expiresAt).toLocaleDateString()]}),(0,A.jsx)(`button`,{type:`button`,disabled:m,onClick:()=>x(`regenerate`),className:`focus-neko ml-auto rounded-full px-3 py-1.5 text-sm text-ink-500 disabled:opacity-50`,children:`重新生成证书`})]}),ae&&(0,A.jsx)(`p`,{className:`mt-2 text-xs text-sakura-800`,role:`alert`,children:`证书即将到期,建议尽快重新生成;重新生成后全部手机需重新扫码。`}),(0,A.jsx)(`p`,{className:`mt-2 text-xs text-ink-500`,children:`重新生成会断开全部手机并撤销全部设备授权,电脑上已受理的任务继续运行。`})]}),(0,A.jsxs)(`div`,{className:`mt-4 border-t border-sakura-100 pt-4`,children:[(0,A.jsx)(`h3`,{className:`text-sm font-semibold text-ink-800`,children:`已配对设备`}),r===null||r.devices.length===0?(0,A.jsx)(`p`,{className:`mt-2 text-xs text-ink-500`,children:`暂无已配对设备。`}):(0,A.jsx)(`ul`,{className:`mt-2 flex flex-col gap-2`,children:r.devices.map(e=>(0,A.jsxs)(`li`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,A.jsx)(`span`,{"aria-hidden":`true`,className:`inline-flex`,children:(0,A.jsx)(oF,{name:`phone`,size:15,className:`text-ink-400`})}),(0,A.jsx)(`span`,{className:`text-ink-800`,children:e.name}),(0,A.jsx)(`span`,{className:`rounded-full px-2 py-0.5 text-xs ${e.online?`bg-tianyi-50 text-tianyi-800`:`bg-ink-100 text-ink-500`}`,children:e.online?`在线`:`离线`}),(0,A.jsxs)(`span`,{className:`text-xs text-ink-500`,children:[`最后连接 `,new Date(e.lastSeenAt).toLocaleString()]}),(0,A.jsx)(`button`,{type:`button`,disabled:m,onClick:()=>x({deviceId:e.deviceId,name:e.name}),className:`focus-neko ml-auto rounded-full px-3 py-1.5 text-sm text-sakura-800 disabled:opacity-50`,children:`撤销`})]},e.deviceId))})]}),e?.gatewaySpawned===!0&&(0,A.jsxs)(`p`,{className:`mt-4 rounded-xl bg-tianyi-50 px-3 py-2 text-xs text-tianyi-800`,children:[`本页面通过 neko web 启动了 gateway;退出本页面会同时停止 gateway 与手机入口。需要手机长期连接时,请改用`,(0,A.jsx)(`code`,{className:`mx-1`,children:`neko serve`}),`或保持 TUI 运行。`]}),(0,A.jsx)(`output`,{className:`mt-3 block min-h-4 text-xs text-tianyi-800`,"aria-live":`polite`,children:s}),b===`regenerate`&&(0,A.jsxs)(uF,{title:`重新生成证书`,onClose:()=>x(null),children:[(0,A.jsx)(`p`,{className:`text-sm text-ink-700`,children:`将生成新的自签名证书:全部手机断开、全部设备授权失效,需要重新扫码配对。电脑上已受理的任务继续运行。`}),(0,A.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,A.jsx)(`button`,{type:`button`,className:`focus-neko rounded-full px-4 py-1.5 text-sm text-ink-500`,onClick:()=>x(null),children:`取消`}),(0,A.jsx)(`button`,{type:`button`,className:`focus-neko rounded-full bg-sakura-100 px-4 py-1.5 text-sm font-semibold text-sakura-800`,onClick:()=>void re(),children:`确认重新生成`})]})]}),typeof b==`object`&&!!b&&(0,A.jsxs)(uF,{title:`撤销设备「${b.name}」`,onClose:()=>x(null),children:[(0,A.jsx)(`p`,{className:`text-sm text-ink-700`,children:`撤销后该手机立即断开且无法重新连接;电脑上已受理的任务继续运行,停止任务需在电脑上单独操作。`}),(0,A.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,A.jsx)(`button`,{type:`button`,className:`focus-neko rounded-full px-4 py-1.5 text-sm text-ink-500`,onClick:()=>x(null),children:`取消`}),(0,A.jsx)(`button`,{type:`button`,className:`focus-neko rounded-full bg-sakura-100 px-4 py-1.5 text-sm font-semibold text-sakura-800`,onClick:()=>void E(b.deviceId),children:`确认撤销`})]})]})]})}function vJ(){return(0,A.jsxs)(DF,{active:`mobile`,children:[(0,A.jsxs)(`div`,{className:`mx-auto w-full max-w-4xl px-5 pt-6 pb-3`,children:[(0,A.jsx)(`h1`,{className:`text-xl font-bold text-ink-900`,children:`手机配对`}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-ink-500`,children:`在手机 App 上控制电脑上的 Agent;配对管理仅限电脑本机。`})]}),(0,A.jsx)(`main`,{className:`mx-auto w-full max-w-4xl px-5 pb-8`,children:(0,A.jsx)(_J,{})})]})}var yJ=[{id:`deepseek`,envVar:`DEEPSEEK_API_KEY`,signupUrl:`https://platform.deepseek.com/api_keys`,keyless:!1},{id:`tavily`,envVar:`TAVILY_API_KEY`,signupUrl:`https://app.tavily.com`,keyless:!0}],bJ={saved:`使用已保存密钥`,environment:`使用环境变量`,runtime:`使用运行时配置`,keyless:`keyless(限流)`,none:`尚未配置`},xJ={deepseek:`DeepSeek`,tavily:`Tavily`};function SJ(e){let{spec:t,status:n,ready:r}=e,i=xJ[t.id]??t.id,[a,o]=(0,f.useState)(``),[s,c]=(0,f.useState)(!1),l=(0,f.useRef)(!1),[u,d]=(0,f.useState)(``);async function p(e){if(!l.current){l.current=!0,c(!0),d(``);try{e?await Tj.removeCredential(t.id):await Tj.saveCredential(t.id,a),o(``),d(e?`已移除保存的密钥`:`已保存,下次请求生效`)}catch{d(`操作失败,请检查连接后重试。`)}finally{l.current=!1,c(!1)}}}let m=s||!r||!n;return(0,A.jsxs)(`section`,{className:`rounded-2xl border border-sakura-200 bg-surface p-5 shadow-soft`,children:[(0,A.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-2`,children:[(0,A.jsx)(`h2`,{className:`text-base font-bold text-ink-900`,children:i}),(0,A.jsx)(`span`,{className:`rounded-full bg-tianyi-50 px-3 py-1 text-xs text-tianyi-800`,children:n?bJ[n.source]:`读取中…`})]}),(0,A.jsxs)(`p`,{className:`mb-3 text-xs text-ink-500`,children:[`环境变量:`,n?n.environmentConfigured?`已配置`:`未配置`:`读取中…`,t.keyless?` · 未配置时以 keyless 限流模式运行`:``]}),(0,A.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),p(!1)},children:[(0,A.jsxs)(`label`,{className:`sr-only`,htmlFor:`${t.id}-key`,children:[i,` API Key`]}),(0,A.jsx)(`input`,{id:`${t.id}-key`,type:`password`,autoComplete:`off`,spellCheck:!1,value:a,maxLength:4096,disabled:m,onChange:e=>o(e.target.value),placeholder:n?.savedConfigured?`输入新密钥以替换`:`粘贴你的 API Key`,className:`focus-neko w-full min-w-0 rounded-xl border border-sakura-200 bg-base px-3 py-2.5 text-sm`}),(0,A.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-3`,children:[(0,A.jsx)(`button`,{type:`submit`,disabled:m||!a.trim(),className:`focus-neko rounded-full bg-sakura-100 px-4 py-1.5 text-sm font-semibold text-sakura-800 disabled:opacity-50`,children:s?`处理中…`:`保存密钥`}),n?.savedConfigured&&(0,A.jsx)(`button`,{type:`button`,disabled:m,onClick:()=>void p(!0),className:`focus-neko rounded-full px-3 py-1.5 text-sm text-ink-500 disabled:opacity-50`,children:`移除已保存密钥`}),(0,A.jsxs)(`a`,{href:t.signupUrl,target:`_blank`,rel:`noreferrer`,className:`focus-neko ml-auto inline-block rounded text-xs text-sakura-700`,children:[`获取 `,i,` API Key ↗`]})]})]}),(0,A.jsx)(`output`,{className:`mt-2 block min-h-4 text-xs text-tianyi-800`,children:u})]})}function CJ(){let{credentials:e,phase:t}=pj(),n=t===`ready`&&e!==null;return(0,A.jsxs)(DF,{active:`credentials`,children:[(0,A.jsxs)(`div`,{className:`mx-auto w-full max-w-4xl px-5 pt-6 pb-3`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,A.jsx)(`h1`,{className:`text-xl font-bold text-ink-900`,children:`密钥`}),(0,A.jsx)(`span`,{className:`ml-auto text-xs text-ink-500`,children:t===`ready`?`已连接`:`连接中…`})]}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-ink-500`,children:`管理 API Key,保存值优先于环境变量,所有工作区共用。`})]}),(0,A.jsx)(`main`,{className:`mx-auto w-full max-w-4xl px-5 pb-8`,children:(0,A.jsx)(`div`,{className:`flex flex-col gap-4`,children:yJ.map(t=>(0,A.jsx)(SJ,{spec:t,status:e?.statuses[t.id],ready:n},t.id))})})]})}var wJ={documents:`文档处理`,development:`开发工作流`,frontend:`前端 / UI`,research:`研究检索`,skills:`技能生态`,automation:`自动化`,database:`数据库`,writing:`写作`,uncategorized:`未分类`},TJ=e=>e>=1048576?`${(e/1024/1024).toFixed(1)}MB`:`${Math.max(1,Math.round(e/1024))}KB`,EJ=e=>e===``?``:e.slice(0,10),DJ=e=>e instanceof j?e.reason??null:null;function OJ(e,t){let n=new Map;for(let r of e){let e=t===`category`?wJ[r.category]??r.category:r.source,i=n.get(e)??[];i.push(r),n.set(e,i)}return[...n.entries()].sort((e,t)=>t[1].length-e[1].length||e[0].localeCompare(t[0]))}function kJ({skill:e}){return(0,A.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 text-xs`,children:[e.installed.project&&(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-sakura-100 px-2 py-0.5 text-sakura-800`,children:[(0,A.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full bg-sakura-500`}),`项目级`,e.activeLevel===`project`?`·生效`:``]}),e.installed.user&&(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-sakura-100 px-2 py-0.5 text-sakura-800`,children:[(0,A.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full bg-sakura-500`}),`用户级`,e.activeLevel===`user`?`·生效`:``]}),e.installed.builtin&&(0,A.jsx)(`span`,{className:`rounded-full bg-ink-100 px-2 py-0.5 text-ink-600`,children:`内置`})]})}function AJ({confirm:e,onClose:t}){let[n,r]=(0,f.useState)(!1);return(0,A.jsx)(jJ,{children:(0,A.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4`,children:[(0,A.jsx)(`button`,{type:`button`,"aria-label":`取消`,onClick:t,className:`absolute inset-0 bg-ink-900/20`}),(0,A.jsxs)(`div`,{role:`alertdialog`,"aria-modal":`true`,"aria-label":e.title,className:`relative w-full max-w-sm rounded-card border border-sakura-200 bg-surface p-5 shadow-lift`,children:[(0,A.jsx)(`h3`,{className:`text-base font-bold text-ink-900`,children:e.title}),(0,A.jsx)(`p`,{className:`mt-2 text-sm text-ink-600`,children:e.body}),(0,A.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,A.jsx)(`button`,{type:`button`,onClick:t,className:`focus-neko rounded-full px-4 py-1.5 text-sm text-ink-500`,children:`取消`}),(0,A.jsx)(`button`,{type:`button`,disabled:n,className:`focus-neko rounded-full px-4 py-1.5 text-sm font-semibold disabled:opacity-50 ${e.danger?`bg-sakura-100 text-sakura-800`:`bg-tianyi-100 text-tianyi-800`}`,onClick:()=>{r(!0),e.action().finally(()=>{r(!1),t()})},children:n?`处理中…`:e.confirmLabel})]})]})]})})}function jJ({children:e}){return(0,ON.createPortal)(e,document.body)}function MJ({name:e,onClose:t,onChanged:n}){let[r,i]=(0,f.useState)(null),[a,o]=(0,f.useState)(null),[s,c]=(0,f.useState)(`about`),[l,u]=(0,f.useState)(null),[d,p]=(0,f.useState)(null),[m,h]=(0,f.useState)(null),[g,_]=(0,f.useState)(``),[v,y]=(0,f.useState)(null);(0,f.useEffect)(()=>{let t=!1;return i(null),o(null),u(null),c(`about`),_(``),Tj.marketDetail(e).then(e=>{t||i(e)}).catch(e=>{t||o(e instanceof Error?e.message:String(e))}),()=>{t=!0}},[e]),(0,f.useEffect)(()=>{if(s!==`preview`||l!==null||d!==null)return;let t=!1;return Tj.marketPreview(e).then(e=>{t||u(e)}).catch(e=>{t||p(e instanceof Error?e.message:String(e))}),()=>{t=!0}},[s,e,l,d]);let b=async(t,r)=>{h(t),_(``);try{let a=await Tj.marketInstall(e,t,r);_(a.shadowedBy===`project`?`已安装到用户级,但项目级同名技能优先,此安装暂不生效。下次发送消息时生效。`:`安装完成,下次发送消息时生效。`),n();let o=await Tj.marketDetail(e);i(o)}catch(n){DJ(n)===`skill_exists`&&!r?y({title:`覆盖已安装技能`,body:`${t===`user`?`用户级`:`项目级`}已存在 ${e}。以市场版本覆盖?本地改动将丢失。`,confirmLabel:`覆盖安装`,action:()=>b(t,!0)}):_(`操作失败:${n instanceof Error?n.message:String(n)}`)}finally{h(null)}},x=t=>{if(r===null)return;let n=t===`user`?r.installed.user:r.installed.project,i=t===`user`&&r.installed.project;n?y({title:`覆盖已安装技能`,body:`${t===`user`?`用户级`:`项目级`}已存在 ${e}。以市场版本 ${r.version} 覆盖?本地改动将丢失。`,confirmLabel:`覆盖安装`,action:()=>b(t,!0)}):i?y({title:`安装后暂不生效`,body:`项目级已存在同名 ${e},项目级优先。仍要安装到用户级吗?`,confirmLabel:`仍安装`,action:()=>b(t,!1)}):b(t,!1)},S=t=>{y({title:`卸载技能`,body:`删除${t===`user`?`用户级`:`项目级`}的 ${e}?此操作不可撤销。`,confirmLabel:`卸载`,danger:!0,action:async()=>{h(t),_(``);try{await Tj.marketUninstall(e,t),_(`已卸载,下次发送消息时生效。`),n(),i(await Tj.marketDetail(e))}catch(e){_(`操作失败:${e instanceof Error?e.message:String(e)}`)}finally{h(null)}}})};return(0,A.jsxs)(jJ,{children:[(0,A.jsx)(`button`,{type:`button`,"aria-label":`关闭详情`,onClick:t,className:`fixed inset-0 z-40 bg-ink-900/10`}),(0,A.jsxs)(`aside`,{role:`dialog`,"aria-label":`技能详情 ${e}`,className:`fixed inset-0 z-50 flex flex-col bg-base sm:inset-y-0 sm:left-auto sm:right-0 sm:w-[26rem] sm:border-l sm:border-sakura-200 sm:shadow-lift`,children:[(0,A.jsxs)(`header`,{className:`flex items-center justify-between gap-2 border-b border-sakura-100 px-4 py-3`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,A.jsx)(`span`,{className:`text-sakura-500`,children:(0,A.jsx)(oF,{name:`sparkles`,size:16})}),(0,A.jsx)(`h2`,{className:`truncate text-lg font-bold text-ink-900`,children:e}),r&&(0,A.jsx)(`span`,{className:`shrink-0 text-xs text-ink-400`,children:r.version})]}),(0,A.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`关闭详情`,className:`focus-neko rounded-lg p-1 text-ink-500 hover:bg-ink-100`,children:(0,A.jsx)(oF,{name:`close`,size:16})})]}),(0,A.jsx)(`div`,{className:`flex gap-1 border-b border-sakura-100 px-4 py-2`,children:[`about`,`preview`].map(e=>(0,A.jsx)(`button`,{type:`button`,onClick:()=>c(e),className:`focus-neko rounded-full px-3 py-1 text-sm ${s===e?`bg-tianyi-100 font-semibold text-tianyi-800`:`text-ink-500`}`,children:e===`about`?`说明`:`预览`},e))}),(0,A.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-3`,children:[a!==null&&(0,A.jsxs)(`p`,{className:`text-sm text-sakura-800`,children:[`加载失败:`,a]}),r===null&&a===null&&(0,A.jsx)(`p`,{className:`text-sm text-ink-500`,children:`加载中…`}),r!==null&&s===`about`&&(0,A.jsxs)(`div`,{className:`space-y-3`,children:[(0,A.jsx)(`p`,{className:`text-sm text-ink-700`,children:r.description}),(0,A.jsx)(`dl`,{className:`space-y-1.5 text-xs text-ink-600`,children:[[`分类`,wJ[r.category]??r.category],[`来源`,r.source],[`大小`,TJ(r.sizeBytes)],[`SHA-256`,`${r.sha256.slice(0,12)}…`],[`上传于`,EJ(r.uploadedAt)],...r.license===``?[]:[[`许可证`,r.license]]].map(([e,t])=>(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsx)(`dt`,{className:`w-14 shrink-0 text-ink-400`,children:e}),(0,A.jsx)(`dd`,{className:`min-w-0 font-mono`,children:t})]},e))}),(0,A.jsxs)(`div`,{className:`rounded-xl bg-ink-50 px-3 py-2 text-xs text-ink-600`,children:[(0,A.jsx)(kJ,{skill:r}),!r.installed.project&&!r.installed.user&&!r.installed.builtin&&`尚未安装`]})]}),r!==null&&s===`preview`&&(0,A.jsxs)(`div`,{children:[l===null&&d===null&&(0,A.jsx)(`p`,{className:`text-sm text-ink-500`,children:`下载并解开预览…`}),d!==null&&(0,A.jsxs)(`p`,{className:`text-sm text-sakura-800`,children:[`预览失败:`,d]}),l!==null&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)($K,{text:l.body}),(0,A.jsx)(`h3`,{className:`mb-1 mt-4 text-xs font-medium text-ink-400`,children:`包内文件`}),(0,A.jsx)(`ul`,{className:`space-y-0.5 font-mono text-xs text-ink-600`,children:l.files.map(e=>(0,A.jsx)(`li`,{children:e},e))})]})]})]}),r!==null&&(0,A.jsxs)(`footer`,{className:`space-y-2 border-t border-sakura-100 px-4 py-3`,children:[g!==``&&(0,A.jsx)(`output`,{className:`block text-xs text-tianyi-800`,children:g}),r.installed.builtin&&!r.installed.user&&!r.installed.project?(0,A.jsx)(`p`,{className:`text-xs text-ink-500`,children:`内置技能随 neko 分发,无需安装,也不支持卸载。`}):(0,A.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:[`user`,`project`].map(e=>{let t=e===`user`?r.installed.user:r.installed.project,n=e===`user`?`用户级`:`项目级`;return t?(0,A.jsxs)(`button`,{type:`button`,disabled:m!==null,onClick:()=>S(e),className:`focus-neko inline-flex items-center gap-1.5 rounded-full border border-ink-200 px-3 py-1.5 text-sm text-ink-600 disabled:opacity-50`,children:[(0,A.jsx)(oF,{name:`trash`,size:14}),m===e?`处理中…`:`卸载${n}`]},e):(0,A.jsxs)(`button`,{type:`button`,disabled:m!==null,onClick:()=>x(e),className:`focus-neko inline-flex items-center gap-1.5 rounded-full bg-tianyi-100 px-3 py-1.5 text-sm font-semibold text-tianyi-800 disabled:opacity-50`,children:[(0,A.jsx)(oF,{name:`download`,size:14}),m===e?`安装中…`:`安装到${n}`]},e)})})]})]}),v&&(0,A.jsx)(AJ,{confirm:v,onClose:()=>y(null)})]})}function NJ(){let{phase:e}=pj(),[t,n]=(0,f.useState)([]),[r,i]=(0,f.useState)(!0),[a,o]=(0,f.useState)(null),[s,c]=(0,f.useState)(``),[l,u]=(0,f.useState)(`category`),[d,p]=(0,f.useState)(null),m=(0,f.useRef)(0),h=()=>{let e=++m.current;i(!0),o(null),Tj.marketList().then(t=>{e===m.current&&n(t)}).catch(t=>{e===m.current&&o(t instanceof Error?t.message:String(t))}).finally(()=>{e===m.current&&i(!1)})};(0,f.useEffect)(()=>{e===`ready`&&h()},[e]);let g=(0,f.useMemo)(()=>{let e=s.trim().toLowerCase();return e===``?t:t.filter(t=>t.name.toLowerCase().includes(e)||t.description.toLowerCase().includes(e))},[t,s]),_=(0,f.useMemo)(()=>OJ(g,l),[g,l]);return(0,A.jsxs)(`div`,{className:`flex min-h-dvh flex-col bg-base`,children:[(0,A.jsx)(`header`,{className:`sticky top-0 z-10 border-b border-sakura-100 bg-surface/90 px-4 py-3 backdrop-blur-md sm:px-6`,children:(0,A.jsxs)(`div`,{className:`mx-auto flex w-full max-w-7xl flex-wrap items-center gap-3`,children:[(0,A.jsx)(Hr,{to:`/`,className:`focus-neko inline-flex shrink-0 items-center gap-1 rounded-lg px-2 py-1 text-sm font-medium text-sakura-700 hover:bg-sakura-50`,children:`← 返回聊天`}),(0,A.jsx)(`span`,{className:`text-ink-300`,children:`/`}),(0,A.jsx)(`h1`,{className:`text-base font-bold text-ink-900 sm:text-lg`,children:`技能市场`}),(0,A.jsxs)(`div`,{className:`ml-auto flex flex-wrap items-center gap-2 sm:gap-3`,children:[(0,A.jsx)(`div`,{className:`flex rounded-full border border-sakura-200 p-0.5 text-xs`,children:[`category`,`source`].map(e=>(0,A.jsx)(`button`,{type:`button`,onClick:()=>u(e),className:`focus-neko rounded-full px-3 py-1 ${l===e?`bg-sakura-100 font-semibold text-sakura-800`:`text-ink-500 hover:text-ink-800`}`,children:e===`category`?`按分类`:`按来源`},e))}),(0,A.jsxs)(`label`,{className:`relative`,children:[(0,A.jsx)(`span`,{className:`sr-only`,children:`搜索技能`}),(0,A.jsx)(`span`,{className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-ink-400`,children:(0,A.jsx)(oF,{name:`search`,size:14})}),(0,A.jsx)(`input`,{value:s,onChange:e=>c(e.target.value),placeholder:`搜索技能…`,className:`focus-neko w-36 rounded-full border border-sakura-200 bg-surface py-1.5 pl-8 pr-3 text-sm sm:w-56`})]}),(0,A.jsx)(`span`,{className:`text-xs text-ink-400`,children:e===`ready`?`已连接`:`连接中…`})]})]})}),(0,A.jsxs)(`main`,{className:`mx-auto w-full max-w-7xl flex-1 px-4 py-6 sm:px-6`,children:[r&&(0,A.jsx)(`p`,{className:`py-16 text-center text-sm text-ink-500`,children:e===`ready`?`加载市场目录…`:`等待网关连接…`}),a!==null&&(0,A.jsxs)(`div`,{className:`mx-auto max-w-md rounded-card border border-sakura-200 bg-surface p-6 text-center shadow-soft`,children:[(0,A.jsx)(`p`,{className:`text-sm text-ink-700`,children:`市场目录加载失败,请检查网络后重试。`}),(0,A.jsx)(`p`,{className:`mt-1 break-all font-mono text-xs text-ink-400`,children:a}),(0,A.jsx)(`button`,{type:`button`,onClick:h,className:`focus-neko mt-4 rounded-full bg-sakura-100 px-4 py-1.5 text-sm font-semibold text-sakura-800`,children:`重试`})]}),!r&&a===null&&g.length===0&&(0,A.jsx)(`p`,{className:`py-16 text-center text-sm text-ink-500`,children:"没有匹配的技能。反复出现的需求可以用 `/skill:skill-creator` 自己造一个。"}),_.map(([e,t])=>(0,A.jsxs)(`section`,{className:`mb-7`,children:[(0,A.jsxs)(`h2`,{className:`mb-2.5 flex items-baseline gap-2 text-lg font-bold text-ink-900`,children:[e,(0,A.jsx)(`span`,{className:`text-xs font-normal text-ink-400`,children:t.length})]}),(0,A.jsx)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4`,children:t.map(e=>(0,A.jsxs)(`button`,{type:`button`,onClick:()=>p(e.name),className:`focus-neko rounded-2xl border border-sakura-200 bg-surface p-4 text-left shadow-soft transition-shadow hover:shadow-lift`,children:[(0,A.jsxs)(`div`,{className:`mb-1 flex items-center justify-between gap-2`,children:[(0,A.jsx)(`span`,{className:`truncate text-base font-bold text-ink-900`,children:e.name}),(0,A.jsx)(kJ,{skill:e})]}),(0,A.jsx)(`p`,{className:`mb-2.5 line-clamp-2 min-h-10 text-sm text-ink-500`,children:e.description}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-ink-400`,children:[(0,A.jsx)(`span`,{className:`rounded-full bg-tianyi-50 px-2 py-0.5 text-tianyi-800`,children:e.source}),(0,A.jsx)(`span`,{className:`font-mono`,children:e.version}),(0,A.jsx)(`span`,{children:TJ(e.sizeBytes)})]})]},e.name))})]},e))]}),d!==null&&(0,A.jsx)(MJ,{name:d,onClose:()=>p(null),onChanged:()=>h()})]})}var PJ=qr({component:()=>(0,A.jsx)(ri,{})}),FJ=Gr({getParentRoute:()=>PJ,path:`/`,component:Vq}),IJ=Gr({getParentRoute:()=>PJ,path:`/settings`,component:CJ}),LJ=Gr({getParentRoute:()=>PJ,path:`/settings/mobile`,component:vJ}),RJ=Gr({getParentRoute:()=>PJ,path:`/skills`,component:NJ}),zJ=Gr({getParentRoute:()=>PJ,path:`/about`,component:jF}),BJ=li({routeTree:PJ.addChildren([FJ,IJ,LJ,RJ,zJ])});Cj();var VJ=document.getElementById(`root`);VJ!==null&&(0,vi.createRoot)(VJ).render((0,A.jsx)(f.StrictMode,{children:(0,A.jsx)(fi,{router:BJ})}));