pi-forge 1.1.4 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/README.md +1 -1
  2. package/bin/fix-pty-perms.mjs +69 -0
  3. package/dist/client/assets/CodeMirrorEditor-EHkmefTD.js +50 -0
  4. package/dist/client/assets/CodeMirrorEditor-EHkmefTD.js.map +1 -0
  5. package/dist/client/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  6. package/dist/client/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  7. package/dist/client/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  8. package/dist/client/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  9. package/dist/client/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  10. package/dist/client/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  11. package/dist/client/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  12. package/dist/client/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  13. package/dist/client/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  14. package/dist/client/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  15. package/dist/client/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  16. package/dist/client/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  17. package/dist/client/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  18. package/dist/client/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  19. package/dist/client/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  20. package/dist/client/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  21. package/dist/client/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  22. package/dist/client/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  23. package/dist/client/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  24. package/dist/client/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  25. package/dist/client/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  26. package/dist/client/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  27. package/dist/client/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  28. package/dist/client/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  29. package/dist/client/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  30. package/dist/client/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  31. package/dist/client/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  32. package/dist/client/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  33. package/dist/client/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  34. package/dist/client/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  35. package/dist/client/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  36. package/dist/client/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  37. package/dist/client/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  38. package/dist/client/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  39. package/dist/client/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  40. package/dist/client/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  41. package/dist/client/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  42. package/dist/client/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  43. package/dist/client/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  44. package/dist/client/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  45. package/dist/client/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  46. package/dist/client/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  47. package/dist/client/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  48. package/dist/client/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  49. package/dist/client/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  50. package/dist/client/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  51. package/dist/client/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  52. package/dist/client/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  53. package/dist/client/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  54. package/dist/client/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  55. package/dist/client/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  56. package/dist/client/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  57. package/dist/client/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  58. package/dist/client/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  59. package/dist/client/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  60. package/dist/client/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  61. package/dist/client/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  62. package/dist/client/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  63. package/dist/client/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  64. package/dist/client/assets/index-5KN1PFqY.css +1 -0
  65. package/dist/client/assets/index-B0ffzJ0t.js +356 -0
  66. package/dist/client/assets/index-B0ffzJ0t.js.map +1 -0
  67. package/dist/client/assets/workbox-window.prod.es5-Cch4wiA5.js +3 -0
  68. package/dist/client/assets/workbox-window.prod.es5-Cch4wiA5.js.map +1 -0
  69. package/dist/client/index.html +2 -2
  70. package/dist/client/sw.js +1 -1
  71. package/dist/client/sw.js.map +1 -1
  72. package/dist/server/agent-resource-loader.js +1 -1
  73. package/dist/server/agent-resource-loader.js.map +1 -1
  74. package/dist/server/config-manager.js +8 -5
  75. package/dist/server/config-manager.js.map +1 -1
  76. package/dist/server/extensions-discovery.js +1 -1
  77. package/dist/server/extensions-discovery.js.map +1 -1
  78. package/dist/server/file-manager.js +19 -1
  79. package/dist/server/file-manager.js.map +1 -1
  80. package/dist/server/file-references.js +124 -29
  81. package/dist/server/file-references.js.map +1 -1
  82. package/dist/server/routes/config.js +37 -5
  83. package/dist/server/routes/config.js.map +1 -1
  84. package/dist/server/routes/health.js +38 -13
  85. package/dist/server/routes/health.js.map +1 -1
  86. package/dist/server/session-registry.js +2 -2
  87. package/dist/server/session-registry.js.map +1 -1
  88. package/dist/server/turn-diff-builder.js +1 -1
  89. package/dist/server/turn-diff-builder.js.map +1 -1
  90. package/package.json +7 -4
  91. package/dist/client/assets/CodeMirrorEditor-BqaaP1EE.js +0 -34
  92. package/dist/client/assets/CodeMirrorEditor-BqaaP1EE.js.map +0 -1
  93. package/dist/client/assets/index-B-529kgJ.css +0 -32
  94. package/dist/client/assets/index-BzKzxXFs.js +0 -392
  95. package/dist/client/assets/index-BzKzxXFs.js.map +0 -1
  96. package/dist/client/assets/workbox-window.prod.es5-BBnX5xw4.js +0 -3
  97. package/dist/client/assets/workbox-window.prod.es5-BBnX5xw4.js.map +0 -1
@@ -0,0 +1,356 @@
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,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`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.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ee(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var te=/\/+/g;function ne(e,t){return typeof e==`object`&&e&&e.key!=null?ee(``+e.key):t.toString(36)}function re(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function k(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,k(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ne(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(te,`$&/`)+`/`),k(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(te,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ne(a,u),c+=k(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ne(a,u++),c+=k(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return k(re(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function ie(e,t,n){if(e==null)return e;var r=[],i=0;return k(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ae(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var A=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)},oe={map:ie,forEach:function(e,t,n){ie(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ie(e,function(){t++}),t},toArray:function(e){return ie(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=oe,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.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 E(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)T.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 E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ae}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,A)}catch(e){A(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.6`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&ne(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ne(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var ee=new MessageChannel,te=ee.port2;ee.port1.onmessage=D,O=function(){te.postMessage(null)}}else O=function(){_(D,0)};function ne(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,ne(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(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=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(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=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.6`})),h=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function 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}var m=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),ee=Symbol.for(`react.activity`),te=Symbol.for(`react.memo_cache_sentinel`),ne=Symbol.iterator;function re(e){return typeof e!=`object`||!e?null:(e=ne&&e[ne]||e[`@@iterator`],typeof e==`function`?e:null)}var k=Symbol.for(`react.client.reference`);function ie(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===k?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case ee:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?ie(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return ie(e(t))}catch{}}return null}var ae=Array.isArray,A=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j={pending:!1,data:null,method:null,action:null},se=[],ce=-1;function le(e){return{current:e}}function ue(e){0>ce||(e.current=se[ce],se[ce]=null,ce--)}function de(e,t){ce++,se[ce]=e.current,e.current=t}var fe=le(null),pe=le(null),me=le(null),he=le(null);function ge(e,t){switch(de(me,t),de(pe,e),de(fe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?tf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=tf(t),e=nf(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ue(fe),de(fe,e)}function _e(){ue(fe),ue(pe),ue(me)}function ve(e){e.memoizedState!==null&&de(he,e);var t=fe.current,n=nf(t,e.type);t!==n&&(de(pe,e),de(fe,n))}function ye(e){pe.current===e&&(ue(fe),ue(pe)),he.current===e&&(ue(he),up._currentValue=j)}var be,xe;function Se(e){if(be===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);be=t&&t[1]||``,xe=-1<e.stack.indexOf(`
2
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
+ `+be+e+xe}var Ce=!1;function we(e,t){if(!e||Ce)return``;Ce=!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}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
4
+ `),l=s.split(`
5
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
6
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Ce=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Se(n):``}function Te(e,t){switch(e.tag){case 26:case 27:case 5:return Se(e.type);case 16:return Se(`Lazy`);case 13:return e.child!==t&&t!==null?Se(`Suspense Fallback`):Se(`Suspense`);case 19:return Se(`SuspenseList`);case 0:case 15:return we(e.type,!1);case 11:return we(e.type.render,!1);case 1:return we(e.type,!0);case 31:return Se(`Activity`);default:return``}}function Ee(e){try{var t=``,n=null;do t+=Te(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
+ Error generating stack: `+e.message+`
8
+ `+e.stack}}var De=Object.prototype.hasOwnProperty,Oe=t.unstable_scheduleCallback,ke=t.unstable_cancelCallback,Ae=t.unstable_shouldYield,je=t.unstable_requestPaint,Me=t.unstable_now,Ne=t.unstable_getCurrentPriorityLevel,Pe=t.unstable_ImmediatePriority,Fe=t.unstable_UserBlockingPriority,Ie=t.unstable_NormalPriority,Le=t.unstable_LowPriority,Re=t.unstable_IdlePriority,ze=t.log,Be=t.unstable_setDisableYieldValue,Ve=null,He=null;function Ue(e){if(typeof ze==`function`&&Be(e),He&&typeof He.setStrictMode==`function`)try{He.setStrictMode(Ve,e)}catch{}}var We=Math.clz32?Math.clz32:qe,Ge=Math.log,Ke=Math.LN2;function qe(e){return e>>>=0,e===0?32:31-(Ge(e)/Ke|0)|0}var Je=256,Ye=262144,Xe=4194304;function Ze(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Qe(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=Ze(n))):i=Ze(o):i=Ze(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ze(n))):i=Ze(o)):i=Ze(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 $e(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function et(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 tt(){var e=Xe;return Xe<<=1,!(Xe&62914560)&&(Xe=4194304),e}function nt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function rt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function it(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-We(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&&at(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function at(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-We(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ot(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-We(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function st(e,t){var n=t&-t;return n=n&42?1:ct(n),(n&(e.suspendedLanes|t))===0?n:0}function ct(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 lt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ut(){var e=oe.p;return e===0?(e=window.event,e===void 0?32:Ep(e.type)):e}function dt(e,t){var n=oe.p;try{return oe.p=e,t()}finally{oe.p=n}}var ft=Math.random().toString(36).slice(2),pt=`__reactFiber$`+ft,mt=`__reactProps$`+ft,ht=`__reactContainer$`+ft,gt=`__reactEvents$`+ft,_t=`__reactListeners$`+ft,vt=`__reactHandles$`+ft,yt=`__reactResources$`+ft,bt=`__reactMarker$`+ft;function xt(e){delete e[pt],delete e[mt],delete e[gt],delete e[_t],delete e[vt]}function St(e){var t=e[pt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ht]||n[pt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=wf(e);e!==null;){if(n=e[pt])return n;e=wf(e)}return t}e=n,n=e.parentNode}return null}function Ct(e){if(e=e[pt]||e[ht]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function wt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Tt(e){var t=e[yt];return t||=e[yt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Et(e){e[bt]=!0}var Dt=new Set,Ot={};function kt(e,t){M(e,t),M(e+`Capture`,t)}function M(e,t){for(Ot[e]=t,e=0;e<t.length;e++)Dt.add(t[e])}var At=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]*$`),N={},P={};function jt(e){return De.call(P,e)?!0:De.call(N,e)?!1:At.test(e)?P[e]=!0:(N[e]=!0,!1)}function Mt(e,t,n){if(jt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function Nt(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 Pt(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 Ft(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function It(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Lt(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 Rt(e){if(!e._valueTracker){var t=It(e)?`checked`:`value`;e._valueTracker=Lt(e,t,``+e[t])}}function zt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=It(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Bt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Vt=/[\n"\\]/g;function Ht(e){return e.replace(Vt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Ut(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=``+Ft(t)):e.value!==``+Ft(t)&&(e.value=``+Ft(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Gt(e,o,Ft(n)):Gt(e,o,Ft(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=``+Ft(s):e.removeAttribute(`name`)}function Wt(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)){Rt(e);return}n=n==null?``:``+Ft(n),t=t==null?n:``+Ft(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),Rt(e)}function Gt(e,t,n){t===`number`&&Bt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Kt(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=``+Ft(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 qt(e,t,n){if(t!=null&&(t=``+Ft(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Ft(n)}function Jt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ae(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Ft(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Rt(e)}function Yt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Xt=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 Zt(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||Xt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Qt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Zt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Zt(e,o,t[o])}function $t(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 en=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),tn=/^[\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 nn(e){return tn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function rn(){}var an=null;function on(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var sn=null,cn=null;function ln(e){var t=Ct(e);if(t&&(e=t.stateNode)){var n=e[mt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Ut(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="`+Ht(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[mt]||null;if(!a)throw Error(i(90));Ut(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&&zt(r)}break a;case`textarea`:qt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Kt(e,!!n.multiple,t,!1)}}}var un=!1;function dn(e,t,n){if(un)return e(t,n);un=!0;try{return e(t)}finally{if(un=!1,(sn!==null||cn!==null)&&(ju(),sn&&(t=sn,e=cn,cn=sn=null,ln(t),e)))for(t=0;t<e.length;t++)ln(e[t])}}function fn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[mt]||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 pn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),mn=!1;if(pn)try{var hn={};Object.defineProperty(hn,`passive`,{get:function(){mn=!0}}),window.addEventListener(`test`,hn,hn),window.removeEventListener(`test`,hn,hn)}catch{mn=!1}var gn=null,_n=null,vn=null;function yn(){if(vn)return vn;var e,t=_n,n=t.length,r,i=`value`in gn?gn.value:gn.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 vn=i.slice(e,1<r?1-r:void 0)}function bn(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 xn(){return!0}function Sn(){return!1}function F(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)?xn:Sn,this.isPropagationStopped=Sn,this}return m(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=xn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=xn)},persist:function(){},isPersistent:xn}),t}var I={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cn=F(I),wn=m({},I,{view:0,detail:0}),Tn=F(wn),En,Dn,On,kn=m({},wn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bn,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!==On&&(On&&e.type===`mousemove`?(En=e.screenX-On.screenX,Dn=e.screenY-On.screenY):Dn=En=0,On=e),En)},movementY:function(e){return`movementY`in e?e.movementY:Dn}}),An=F(kn),jn=F(m({},kn,{dataTransfer:0})),Mn=F(m({},wn,{relatedTarget:0})),Nn=F(m({},I,{animationName:0,elapsedTime:0,pseudoElement:0})),Pn=F(m({},I,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Fn=F(m({},I,{data:0})),In={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Ln={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`},Rn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function zn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Rn[e])?!!t[e]:!1}function Bn(){return zn}var Vn=F(m({},wn,{key:function(e){if(e.key){var t=In[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=bn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Ln[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bn,charCode:function(e){return e.type===`keypress`?bn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?bn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Hn=F(m({},kn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Un=F(m({},wn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bn})),Wn=F(m({},I,{propertyName:0,elapsedTime:0,pseudoElement:0})),Gn=F(m({},kn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Kn=F(m({},I,{newState:0,oldState:0})),qn=[9,13,27,32],Jn=pn&&`CompositionEvent`in window,Yn=null;pn&&`documentMode`in document&&(Yn=document.documentMode);var Xn=pn&&`TextEvent`in window&&!Yn,Zn=pn&&(!Jn||Yn&&8<Yn&&11>=Yn),Qn=` `,$n=!1;function er(e,t){switch(e){case`keyup`:return qn.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 nr=!1;function rr(e,t){switch(e){case`compositionend`:return tr(t);case`keypress`:return t.which===32?($n=!0,Qn):null;case`textInput`:return e=t.data,e===Qn&&$n?null:e;default:return null}}function ir(e,t){if(nr)return e===`compositionend`||!Jn&&er(e,t)?(e=yn(),vn=_n=gn=null,nr=!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 Zn&&t.locale!==`ko`?null:t.data;default:return null}}var ar={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 or(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!ar[e.type]:t===`textarea`}function sr(e,t,n,r){sn?cn?cn.push(r):cn=[r]:sn=r,t=zd(t,`onChange`),0<t.length&&(n=new Cn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var cr=null,lr=null;function ur(e){jd(e,0)}function dr(e){if(zt(wt(e)))return e}function fr(e,t){if(e===`change`)return t}var pr=!1;if(pn){var mr;if(pn){var hr=`oninput`in document;if(!hr){var L=document.createElement(`div`);L.setAttribute(`oninput`,`return;`),hr=typeof L.oninput==`function`}mr=hr}else mr=!1;pr=mr&&(!document.documentMode||9<document.documentMode)}function gr(){cr&&(cr.detachEvent(`onpropertychange`,_r),lr=cr=null)}function _r(e){if(e.propertyName===`value`&&dr(lr)){var t=[];sr(t,lr,e,on(e)),dn(ur,t)}}function vr(e,t,n){e===`focusin`?(gr(),cr=t,lr=n,cr.attachEvent(`onpropertychange`,_r)):e===`focusout`&&gr()}function yr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return dr(lr)}function br(e,t){if(e===`click`)return dr(t)}function xr(e,t){if(e===`input`||e===`change`)return dr(t)}function Sr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Cr=typeof Object.is==`function`?Object.is:Sr;function wr(e,t){if(Cr(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(!De.call(t,i)||!Cr(e[i],t[i]))return!1}return!0}function Tr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Er(e,t){var n=Tr(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=Tr(n)}}function Dr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Dr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Or(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Bt(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=Bt(e.document)}return t}function kr(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 Ar=pn&&`documentMode`in document&&11>=document.documentMode,jr=null,Mr=null,Nr=null,Pr=!1;function Fr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Pr||jr==null||jr!==Bt(r)||(r=jr,`selectionStart`in r&&kr(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}),Nr&&wr(Nr,r)||(Nr=r,r=zd(Mr,`onSelect`),0<r.length&&(t=new Cn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=jr)))}function Ir(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Lr={animationend:Ir(`Animation`,`AnimationEnd`),animationiteration:Ir(`Animation`,`AnimationIteration`),animationstart:Ir(`Animation`,`AnimationStart`),transitionrun:Ir(`Transition`,`TransitionRun`),transitionstart:Ir(`Transition`,`TransitionStart`),transitioncancel:Ir(`Transition`,`TransitionCancel`),transitionend:Ir(`Transition`,`TransitionEnd`)},Rr={},zr={};pn&&(zr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Lr.animationend.animation,delete Lr.animationiteration.animation,delete Lr.animationstart.animation),`TransitionEvent`in window||delete Lr.transitionend.transition);function Br(e){if(Rr[e])return Rr[e];if(!Lr[e])return e;var t=Lr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in zr)return Rr[e]=t[n];return e}var Vr=Br(`animationend`),Hr=Br(`animationiteration`),Ur=Br(`animationstart`),Wr=Br(`transitionrun`),Gr=Br(`transitionstart`),R=Br(`transitioncancel`),Kr=Br(`transitionend`),qr=new Map,Jr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Jr.push(`scrollEnd`);function Yr(e,t){qr.set(e,t),kt(t,[e])}var Xr=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)},Zr=[],Qr=0,$r=0;function ei(){for(var e=Qr,t=$r=Qr=0;t<e;){var n=Zr[t];Zr[t++]=null;var r=Zr[t];Zr[t++]=null;var i=Zr[t];Zr[t++]=null;var a=Zr[t];if(Zr[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 ti(e,t,n,r){Zr[Qr++]=e,Zr[Qr++]=t,Zr[Qr++]=n,Zr[Qr++]=r,$r|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ni(e,t,n,r){return ti(e,t,n,r),ai(e)}function ri(e,t){return ti(e,null,null,t),ai(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-We(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ai(e){if(50<Su)throw Su=0,Cu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var oi={};function si(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 ci(e,t,n,r){return new si(e,t,n,r)}function li(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ui(e,t){var n=e.alternate;return n===null?(n=ci(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function di(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function fi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)li(e)&&(s=1);else if(typeof e==`string`)s=np(e,n,fe.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case ee:return e=ci(31,n,t,a),e.elementType=ee,e.lanes=o,e;case y:return pi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ci(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ci(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ci(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ci(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function pi(e,t,n,r){return e=ci(7,e,r,t),e.lanes=n,e}function mi(e,t,n){return e=ci(6,e,null,t),e.lanes=n,e}function hi(e){var t=ci(18,null,null,0);return t.stateNode=e,t}function gi(e,t,n){return t=ci(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var _i=new WeakMap;function vi(e,t){if(typeof e==`object`&&e){var n=_i.get(e);return n===void 0?(t={value:e,source:t,stack:Ee(t)},_i.set(e,t),t):n}return{value:e,source:t,stack:Ee(t)}}var yi=[],bi=0,xi=null,Si=0,Ci=[],wi=0,Ti=null,Ei=1,Di=``;function Oi(e,t){yi[bi++]=Si,yi[bi++]=xi,xi=e,Si=t}function ki(e,t,n){Ci[wi++]=Ei,Ci[wi++]=Di,Ci[wi++]=Ti,Ti=e;var r=Ei;e=Di;var i=32-We(r)-1;r&=~(1<<i),n+=1;var a=32-We(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ei=1<<32-We(t)+i|n<<i|r,Di=a+e}else Ei=1<<a|n<<i|r,Di=e}function Ai(e){e.return!==null&&(Oi(e,1),ki(e,1,0))}function ji(e){for(;e===xi;)xi=yi[--bi],yi[bi]=null,Si=yi[--bi],yi[bi]=null;for(;e===Ti;)Ti=Ci[--wi],Ci[wi]=null,Di=Ci[--wi],Ci[wi]=null,Ei=Ci[--wi],Ci[wi]=null}function Mi(e,t){Ci[wi++]=Ei,Ci[wi++]=Di,Ci[wi++]=Ti,Ei=t.id,Di=t.overflow,Ti=e}var Ni=null,Pi=null,Fi=!1,Ii=null,Li=!1,Ri=Error(i(519));function zi(e){throw Wi(vi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ri}function Bi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[pt]=e,t[mt]=r,n){case`dialog`:Md(`cancel`,t),Md(`close`,t);break;case`iframe`:case`object`:case`embed`:Md(`load`,t);break;case`video`:case`audio`:for(n=0;n<kd.length;n++)Md(kd[n],t);break;case`source`:Md(`error`,t);break;case`img`:case`image`:case`link`:Md(`error`,t),Md(`load`,t);break;case`details`:Md(`toggle`,t);break;case`input`:Md(`invalid`,t),Wt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Md(`invalid`,t);break;case`textarea`:Md(`invalid`,t),Jt(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||Gd(t.textContent,n)?(r.popover!=null&&(Md(`beforetoggle`,t),Md(`toggle`,t)),r.onScroll!=null&&Md(`scroll`,t),r.onScrollEnd!=null&&Md(`scrollend`,t),r.onClick!=null&&(t.onclick=rn),t=!0):t=!1,t||zi(e,!0)}function Vi(e){for(Ni=e.return;Ni;)switch(Ni.tag){case 5:case 31:case 13:Li=!1;return;case 27:case 3:Li=!0;return;default:Ni=Ni.return}}function z(e){if(e!==Ni)return!1;if(!Fi)return Vi(e),Fi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||rf(e.type,e.memoizedProps)),n=!n),n&&Pi&&zi(e),Vi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Pi=Cf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Pi=Cf(e)}else t===27?(t=Pi,B(e.type)?(e=Sf,Sf=null,Pi=e):Pi=t):Pi=Ni?xf(e.stateNode.nextSibling):null;return!0}function Hi(){Pi=Ni=null,Fi=!1}function Ui(){var e=Ii;return e!==null&&(cu===null?cu=e:cu.push.apply(cu,e),Ii=null),e}function Wi(e){Ii===null?Ii=[e]:Ii.push(e)}var Gi=le(null),Ki=null,qi=null;function Ji(e,t,n){de(Gi,t._currentValue),t._currentValue=n}function Yi(e){e._currentValue=Gi.current,ue(Gi)}function Xi(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 Zi(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),Xi(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),Xi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Qi(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;Cr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===he.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[up]:e.push(up))}a=a.return}e!==null&&Zi(t,e,n,r),t.flags|=262144}function $i(e){for(e=e.firstContext;e!==null;){if(!Cr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ea(e){Ki=e,qi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ta(e){return ra(Ki,e)}function na(e,t){return Ki===null&&ea(e),ra(e,t)}function ra(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},qi===null){if(e===null)throw Error(i(308));qi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else qi=qi.next=t;return n}var ia=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()})}},aa=t.unstable_scheduleCallback,oa=t.unstable_NormalPriority,sa={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ca(){return{controller:new ia,data:new Map,refCount:0}}function la(e){e.refCount--,e.refCount===0&&aa(oa,function(){e.controller.abort()})}var ua=null,da=0,fa=0,pa=null;function ma(e,t){if(ua===null){var n=ua=[];da=0,fa=Cd(),pa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return da++,t.then(ha,ha),t}function ha(){if(--da===0&&ua!==null){pa!==null&&(pa.status=`fulfilled`);var e=ua;ua=null,fa=0,pa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ga(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 _a=A.S;A.S=function(e,t){du=Me(),typeof t==`object`&&t&&typeof t.then==`function`&&ma(e,t),_a!==null&&_a(e,t)};var va=le(null);function ya(){var e=va.current;return e===null?Kl.pooledCache:e}function ba(e,t){t===null?de(va,va.current):de(va,t.pool)}function xa(){var e=ya();return e===null?null:{parent:sa._currentValue,pool:e}}var Sa=Error(i(460)),Ca=Error(i(474)),wa=Error(i(542)),Ta={then:function(){}};function Ea(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Da(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(rn,rn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ja(e),e;default:if(typeof t.status==`string`)t.then(rn,rn);else{if(e=Kl,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,ja(e),e}throw ka=t,Sa}}function Oa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ka=e,Sa):e}}var ka=null;function Aa(){if(ka===null)throw Error(i(459));var e=ka;return ka=null,e}function ja(e){if(e===Sa||e===wa)throw Error(i(483))}var Ma=null,Na=0;function Pa(e){var t=Na;return Na+=1,Ma===null&&(Ma=[]),Da(Ma,e,t)}function Fa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ia(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function La(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=ui(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=mi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&Oa(i)===t.type)?(t=a(t,n.props),Fa(t,n),t.return=e,t):(t=fi(n.type,n.key,n.props,null,e.mode,r),Fa(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=gi(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=pi(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=mi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=fi(t.type,t.key,t.props,null,e.mode,n),Fa(n,t),n.return=e,n;case v:return t=gi(t,e.mode,n),t.return=e,t;case O:return t=Oa(t),f(e,t,n)}if(ae(t)||re(t))return t=pi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Pa(t),n);if(t.$$typeof===C)return f(e,na(e,t),n);Ia(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=Oa(n),p(e,t,n,r)}if(ae(n)||re(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Pa(n),r);if(n.$$typeof===C)return p(e,t,na(e,n),r);Ia(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=Oa(r),m(e,t,n,r,i)}if(ae(r)||re(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Pa(r),i);if(r.$$typeof===C)return m(e,t,n,na(t,r),i);Ia(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),Fi&&Oi(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 Fi&&Oi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Fi&&Oi(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),Fi&&Oi(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 Fi&&Oi(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Fi&&Oi(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&Oa(l)===r.type){n(e,r.sibling),c=a(r,o.props),Fa(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=pi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=fi(o.type,o.key,o.props,null,e.mode,c),Fa(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=gi(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Oa(o),b(e,r,o,c)}if(ae(o))return h(e,r,o,c);if(re(o)){if(l=re(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Pa(o),c);if(o.$$typeof===C)return b(e,r,na(e,o),c);Ia(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=mi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Na=0;var i=b(e,t,n,r);return Ma=null,i}catch(t){if(t===Sa||t===wa)throw t;var a=ci(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ra=La(!0),za=La(!1),Ba=!1;function Va(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ha(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 Ua(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Wa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Gl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ai(e),ii(e,null,n),t}return ti(e,r,t,n),ai(e)}function Ga(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ot(e,n)}}function Ka(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var qa=!1;function Ja(){if(qa){var e=pa;if(e!==null)throw e}}function Ya(e,t,n,r){qa=!1;var i=e.updateQueue;Ba=!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?(Jl&f)===f:(r&f)===f){f!==0&&f===fa&&(qa=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Ba=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),nu|=o,e.lanes=o,e.memoizedState=d}}function Xa(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Za(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Xa(n[e],t)}var Qa=le(null),$a=le(0);function eo(e,t){e=eu,de($a,e),de(Qa,t),eu=e|t.baseLanes}function to(){de($a,eu),de(Qa,Qa.current)}function no(){eu=$a.current,ue(Qa),ue($a)}var ro=le(null),io=null;function ao(e){var t=e.alternate;de(uo,uo.current&1),de(ro,e),io===null&&(t===null||Qa.current!==null||t.memoizedState!==null)&&(io=e)}function oo(e){de(uo,uo.current),de(ro,e),io===null&&(io=e)}function so(e){e.tag===22?(de(uo,uo.current),de(ro,e),io===null&&(io=e)):co(e)}function co(){de(uo,uo.current),de(ro,ro.current)}function lo(e){ue(ro),io===e&&(io=null),ue(uo)}var uo=le(0);function fo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||vf(n)||yf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var po=0,mo=null,ho=null,go=null,_o=!1,vo=!1,yo=!1,bo=0,xo=0,So=null,Co=0;function wo(){throw Error(i(321))}function To(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Cr(e[n],t[n]))return!1;return!0}function Eo(e,t,n,r,i,a){return po=a,mo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,A.H=e===null||e.memoizedState===null?Us:Ws,yo=!1,a=n(r,i),yo=!1,vo&&(a=Oo(t,n,r,i)),Do(e),a}function Do(e){A.H=Hs;var t=ho!==null&&ho.next!==null;if(po=0,go=ho=mo=null,_o=!1,xo=0,So=null,t)throw Error(i(300));e===null||sc||(e=e.dependencies,e!==null&&$i(e)&&(sc=!0))}function Oo(e,t,n,r){mo=e;var a=0;do{if(vo&&(So=null),xo=0,vo=!1,25<=a)throw Error(i(301));if(a+=1,go=ho=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}A.H=Gs,o=t(n,r)}while(vo);return o}function ko(){var e=A.H,t=e.useState()[0];return t=typeof t.then==`function`?Io(t):t,e=e.useState()[0],(ho===null?null:ho.memoizedState)!==e&&(mo.flags|=1024),t}function Ao(){var e=bo!==0;return bo=0,e}function jo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Mo(e){if(_o){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}_o=!1}po=0,go=ho=mo=null,vo=!1,xo=bo=0,So=null}function No(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return go===null?mo.memoizedState=go=e:go=go.next=e,go}function Po(){if(ho===null){var e=mo.alternate;e=e===null?null:e.memoizedState}else e=ho.next;var t=go===null?mo.memoizedState:go.next;if(t!==null)go=t,ho=e;else{if(e===null)throw mo.alternate===null?Error(i(467)):Error(i(310));ho=e,e={memoizedState:ho.memoizedState,baseState:ho.baseState,baseQueue:ho.baseQueue,queue:ho.queue,next:null},go===null?mo.memoizedState=go=e:go=go.next=e}return go}function Fo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Io(e){var t=xo;return xo+=1,So===null&&(So=[]),e=Da(So,e,t),t=mo,(go===null?t.memoizedState:go.next)===null&&(t=t.alternate,A.H=t===null||t.memoizedState===null?Us:Ws),e}function Lo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Io(e);if(e.$$typeof===C)return ta(e)}throw Error(i(438,String(e)))}function Ro(e){var t=null,n=mo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=mo.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=Fo(),mo.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]=te;return t.index++,n}function zo(e,t){return typeof t==`function`?t(e):t}function Bo(e){return Vo(Po(),ho,e)}function Vo(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?(po&f)===f:(Jl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===fa&&(d=!0);else if((po&p)===p){u=u.next,p===fa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,mo.lanes|=p,nu|=p;f=u.action,yo&&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,mo.lanes|=f,nu|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Cr(o,e.memoizedState)&&(sc=!0,d&&(n=pa,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 Ho(e){var t=Po(),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);Cr(o,t.memoizedState)||(sc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Uo(e,t,n){var r=mo,a=Po(),o=Fi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Cr((ho||a).memoizedState,n);if(s&&(a.memoizedState=n,sc=!0),a=a.queue,ms(Ko.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||go!==null&&go.memoizedState.tag&1){if(r.flags|=2048,ls(9,{destroy:void 0},Go.bind(null,r,a,n,t),null),Kl===null)throw Error(i(349));o||po&127||Wo(r,t,n)}return n}function Wo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=mo.updateQueue,t===null?(t=Fo(),mo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Go(e,t,n,r){t.value=n,t.getSnapshot=r,qo(t)&&Jo(e)}function Ko(e,t,n){return n(function(){qo(t)&&Jo(e)})}function qo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Cr(e,n)}catch{return!0}}function Jo(e){var t=ri(e,2);t!==null&&Eu(t,e,2)}function Yo(e){var t=No();if(typeof e==`function`){var n=e;if(e=n(),yo){Ue(!0);try{n()}finally{Ue(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:zo,lastRenderedState:e},t}function Xo(e,t,n,r){return e.baseState=n,Vo(e,ho,typeof r==`function`?r:zo)}function Zo(e,t,n,r,a){if(zs(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)}};A.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Qo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Qo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=A.T,o={};A.T=o;try{var s=n(i,r),c=A.S;c!==null&&c(o,s),$o(e,t,s)}catch(n){ts(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),A.T=a}}else try{a=n(i,r),$o(e,t,a)}catch(n){ts(e,t,n)}}function $o(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){es(e,t,n)},function(n){return ts(e,t,n)}):es(e,t,n)}function es(e,t,n){t.status=`fulfilled`,t.value=n,ns(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Qo(e,n)))}function ts(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,ns(t),t=t.next;while(t!==r)}e.action=null}function ns(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function rs(e,t){return t}function is(e,t){if(Fi){var n=Kl.formState;if(n!==null){a:{var r=mo;if(Fi){if(Pi){b:{for(var i=Pi,a=Li;i.nodeType!==8;){if(!a){i=null;break b}if(i=xf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Pi=xf(i.nextSibling),r=i.data===`F!`;break a}}zi(r)}r=!1}r&&(t=n[0])}}return n=No(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:rs,lastRenderedState:t},n.queue=r,n=Is.bind(null,mo,r),r.dispatch=n,r=Yo(!1),a=Rs.bind(null,mo,!1,r.queue),r=No(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Zo.bind(null,mo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function as(e){return os(Po(),ho,e)}function os(e,t,n){if(t=Vo(e,t,rs)[0],e=Bo(zo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Io(t)}catch(e){throw e===Sa?wa:e}else r=t;t=Po();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(mo.flags|=2048,ls(9,{destroy:void 0},ss.bind(null,i,n),null)),[r,a,e]}function ss(e,t){e.action=t}function cs(e){var t=Po(),n=ho;if(n!==null)return os(t,n,e);Po(),t=t.memoizedState,n=Po();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ls(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=mo.updateQueue,t===null&&(t=Fo(),mo.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 us(){return Po().memoizedState}function ds(e,t,n,r){var i=No();mo.flags|=e,i.memoizedState=ls(1|t,{destroy:void 0},n,r===void 0?null:r)}function fs(e,t,n,r){var i=Po();r=r===void 0?null:r;var a=i.memoizedState.inst;ho!==null&&r!==null&&To(r,ho.memoizedState.deps)?i.memoizedState=ls(t,a,n,r):(mo.flags|=e,i.memoizedState=ls(1|t,a,n,r))}function ps(e,t){ds(8390656,8,e,t)}function ms(e,t){fs(2048,8,e,t)}function hs(e){mo.flags|=4;var t=mo.updateQueue;if(t===null)t=Fo(),mo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function gs(e){var t=Po().memoizedState;return hs({ref:t,nextImpl:e}),function(){if(Gl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function _s(e,t){return fs(4,2,e,t)}function vs(e,t){return fs(4,4,e,t)}function ys(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function bs(e,t,n){n=n==null?null:n.concat([e]),fs(4,4,ys.bind(null,t,e),n)}function xs(){}function Ss(e,t){var n=Po();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&To(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Cs(e,t){var n=Po();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&To(t,r[1]))return r[0];if(r=e(),yo){Ue(!0);try{e()}finally{Ue(!1)}}return n.memoizedState=[r,t],r}function ws(e,t,n){return n===void 0||po&1073741824&&!(Jl&261930)?e.memoizedState=t:(e.memoizedState=n,e=Tu(),mo.lanes|=e,nu|=e,n)}function Ts(e,t,n,r){return Cr(n,t)?n:Qa.current===null?!(po&42)||po&1073741824&&!(Jl&261930)?(sc=!0,e.memoizedState=n):(e=Tu(),mo.lanes|=e,nu|=e,t):(e=ws(e,n,r),Cr(e,t)||(sc=!0),e)}function Es(e,t,n,r,i){var a=oe.p;oe.p=a!==0&&8>a?a:8;var o=A.T,s={};A.T=s,Rs(e,!1,t,n);try{var c=i(),l=A.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ls(e,t,ga(c,r),wu(e)):Ls(e,t,r,wu(e))}catch(n){Ls(e,t,{then:function(){},status:`rejected`,reason:n},wu())}finally{oe.p=a,o!==null&&s.types!==null&&(o.types=s.types),A.T=o}}function Ds(){}function Os(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=ks(e).queue;Es(e,a,t,j,n===null?Ds:function(){return As(e),n(r)})}function ks(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:j,baseState:j,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zo,lastRenderedState:j},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function As(e){var t=ks(e);t.next===null&&(t=e.alternate.memoizedState),Ls(e,t.next.queue,{},wu())}function js(){return ta(up)}function Ms(){return Po().memoizedState}function Ns(){return Po().memoizedState}function Ps(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=wu();e=Ua(n);var r=Wa(t,e,n);r!==null&&(Eu(r,t,n),Ga(r,t,n)),t={cache:ca()},e.payload=t;return}t=t.return}}function Fs(e,t,n){var r=wu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},zs(e)?Bs(t,n):(n=ni(e,t,n,r),n!==null&&(Eu(n,e,r),Vs(n,t,r)))}function Is(e,t,n){Ls(e,t,n,wu())}function Ls(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(zs(e))Bs(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,Cr(s,o))return ti(e,t,i,0),Kl===null&&ei(),!1}catch{}if(n=ni(e,t,i,r),n!==null)return Eu(n,e,r),Vs(n,t,r),!0}return!1}function Rs(e,t,n,r){if(r={lane:2,revertLane:Cd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},zs(e)){if(t)throw Error(i(479))}else t=ni(e,n,r,2),t!==null&&Eu(t,e,2)}function zs(e){var t=e.alternate;return e===mo||t!==null&&t===mo}function Bs(e,t){vo=_o=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Vs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ot(e,n)}}var Hs={readContext:ta,use:Lo,useCallback:wo,useContext:wo,useEffect:wo,useImperativeHandle:wo,useLayoutEffect:wo,useInsertionEffect:wo,useMemo:wo,useReducer:wo,useRef:wo,useState:wo,useDebugValue:wo,useDeferredValue:wo,useTransition:wo,useSyncExternalStore:wo,useId:wo,useHostTransitionStatus:wo,useFormState:wo,useActionState:wo,useOptimistic:wo,useMemoCache:wo,useCacheRefresh:wo};Hs.useEffectEvent=wo;var Us={readContext:ta,use:Lo,useCallback:function(e,t){return No().memoizedState=[e,t===void 0?null:t],e},useContext:ta,useEffect:ps,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ds(4194308,4,ys.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ds(4194308,4,e,t)},useInsertionEffect:function(e,t){ds(4,2,e,t)},useMemo:function(e,t){var n=No();t=t===void 0?null:t;var r=e();if(yo){Ue(!0);try{e()}finally{Ue(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=No();if(n!==void 0){var i=n(t);if(yo){Ue(!0);try{n(t)}finally{Ue(!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=Fs.bind(null,mo,e),[r.memoizedState,e]},useRef:function(e){var t=No();return e={current:e},t.memoizedState=e},useState:function(e){e=Yo(e);var t=e.queue,n=Is.bind(null,mo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:xs,useDeferredValue:function(e,t){return ws(No(),e,t)},useTransition:function(){var e=Yo(!1);return e=Es.bind(null,mo,e.queue,!0,!1),No().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=mo,a=No();if(Fi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Kl===null)throw Error(i(349));Jl&127||Wo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ps(Ko.bind(null,r,o,e),[e]),r.flags|=2048,ls(9,{destroy:void 0},Go.bind(null,r,o,n,t),null),n},useId:function(){var e=No(),t=Kl.identifierPrefix;if(Fi){var n=Di,r=Ei;n=(r&~(1<<32-We(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=bo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Co++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:js,useFormState:is,useActionState:is,useOptimistic:function(e){var t=No();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Rs.bind(null,mo,!0,n),n.dispatch=t,[e,t]},useMemoCache:Ro,useCacheRefresh:function(){return No().memoizedState=Ps.bind(null,mo)},useEffectEvent:function(e){var t=No(),n={impl:e};return t.memoizedState=n,function(){if(Gl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ws={readContext:ta,use:Lo,useCallback:Ss,useContext:ta,useEffect:ms,useImperativeHandle:bs,useInsertionEffect:_s,useLayoutEffect:vs,useMemo:Cs,useReducer:Bo,useRef:us,useState:function(){return Bo(zo)},useDebugValue:xs,useDeferredValue:function(e,t){return Ts(Po(),ho.memoizedState,e,t)},useTransition:function(){var e=Bo(zo)[0],t=Po().memoizedState;return[typeof e==`boolean`?e:Io(e),t]},useSyncExternalStore:Uo,useId:Ms,useHostTransitionStatus:js,useFormState:as,useActionState:as,useOptimistic:function(e,t){return Xo(Po(),ho,e,t)},useMemoCache:Ro,useCacheRefresh:Ns};Ws.useEffectEvent=gs;var Gs={readContext:ta,use:Lo,useCallback:Ss,useContext:ta,useEffect:ms,useImperativeHandle:bs,useInsertionEffect:_s,useLayoutEffect:vs,useMemo:Cs,useReducer:Ho,useRef:us,useState:function(){return Ho(zo)},useDebugValue:xs,useDeferredValue:function(e,t){var n=Po();return ho===null?ws(n,e,t):Ts(n,ho.memoizedState,e,t)},useTransition:function(){var e=Ho(zo)[0],t=Po().memoizedState;return[typeof e==`boolean`?e:Io(e),t]},useSyncExternalStore:Uo,useId:Ms,useHostTransitionStatus:js,useFormState:cs,useActionState:cs,useOptimistic:function(e,t){var n=Po();return ho===null?(n.baseState=e,[e,n.queue.dispatch]):Xo(n,ho,e,t)},useMemoCache:Ro,useCacheRefresh:Ns};Gs.useEffectEvent=gs;function Ks(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var qs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=wu(),i=Ua(r);i.payload=t,n!=null&&(i.callback=n),t=Wa(e,i,r),t!==null&&(Eu(t,e,r),Ga(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=wu(),i=Ua(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Wa(e,i,r),t!==null&&(Eu(t,e,r),Ga(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=wu(),r=Ua(n);r.tag=2,t!=null&&(r.callback=t),t=Wa(e,r,n),t!==null&&(Eu(t,e,n),Ga(t,e,n))}};function Js(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!wr(n,r)||!wr(i,a):!0}function Ys(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&&qs.enqueueReplaceState(t,t.state,null)}function Xs(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=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Zs(e){Xr(e)}function Qs(e){console.error(e)}function $s(e){Xr(e)}function ec(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function tc(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 nc(e,t,n){return n=Ua(n),n.tag=3,n.payload={element:null},n.callback=function(){ec(e,t)},n}function rc(e){return e=Ua(e),e.tag=3,e}function ic(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(){tc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){tc(t,n,r),typeof i!=`function`&&(mu===null?mu=new Set([this]):mu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function ac(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Qi(t,n,a,!0),n=ro.current,n!==null){switch(n.tag){case 31:case 13:return io===null?Ru():n.alternate===null&&tu===0&&(tu=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ta?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),rd(e,r,a)),!1;case 22:return n.flags|=65536,r===Ta?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)),rd(e,r,a)),!1}throw Error(i(435,n.tag))}return rd(e,r,a),Ru(),!1}if(Fi)return t=ro.current,t===null?(r!==Ri&&(t=Error(i(423),{cause:r}),Wi(vi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=vi(r,n),a=nc(e.stateNode,r,a),Ka(e,a),tu!==4&&(tu=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Ri&&(e=Error(i(422),{cause:r}),Wi(vi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=vi(o,n),su===null?su=[o]:su.push(o),tu!==4&&(tu=2),t===null)return!0;r=vi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=nc(n.stateNode,r,e),Ka(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`&&(mu===null||!mu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=rc(a),ic(a,e,n,r),Ka(n,a),!1}n=n.return}while(n!==null);return!1}var oc=Error(i(461)),sc=!1;function cc(e,t,n,r){t.child=e===null?za(t,null,n,r):Ra(t,e.child,n,r)}function lc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ea(t),r=Eo(e,t,n,o,a,i),s=Ao(),e!==null&&!sc?(jo(e,t,i),Nc(e,t,i)):(Fi&&s&&Ai(t),t.flags|=1,cc(e,t,r,i),t.child)}function uc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!li(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,dc(e,t,a,r,i)):(e=fi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Pc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?wr:n,n(o,r)&&e.ref===t.ref)return Nc(e,t,i)}return t.flags|=1,e=ui(a,r),e.ref=t.ref,e.return=t,t.child=e}function dc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(wr(a,r)&&e.ref===t.ref)if(sc=!1,t.pendingProps=r=a,Pc(e,i))e.flags&131072&&(sc=!0);else return t.lanes=e.lanes,Nc(e,t,i)}return yc(e,t,n,r,i)}function fc(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 mc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ba(t,a===null?null:a.cachePool),a===null?to():eo(t,a),so(t);else return r=t.lanes=536870912,mc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ba(t,null),to(),co(t)):(ba(t,a.cachePool),eo(t,a),co(t),t.memoizedState=null);return cc(e,t,i,n),t.child}function pc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function mc(e,t,n,r,i){var a=ya();return a=a===null?null:{parent:sa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ba(t,null),to(),so(t),e!==null&&Qi(e,t,r,!0),t.childLanes=i,null}function hc(e,t){return t=Oc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function gc(e,t,n){return Ra(t,e.child,null,n),e=hc(t,t.pendingProps),e.flags|=2,lo(t),t.memoizedState=null,e}function _c(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Fi){if(r.mode===`hidden`)return e=hc(t,r),t.lanes=536870912,pc(null,e);if(oo(t),(e=Pi)?(e=_f(e,Li),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ti===null?null:{id:Ei,overflow:Di},retryLane:536870912,hydrationErrors:null},n=hi(e),n.return=t,t.child=n,Ni=t,Pi=null)):e=null,e===null)throw zi(t);return t.lanes=536870912,null}return hc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(oo(t),a)if(t.flags&256)t.flags&=-257,t=gc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(sc||Qi(e,t,n,!1),a=(n&e.childLanes)!==0,sc||a){if(r=Kl,r!==null&&(s=st(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ri(e,s),Eu(r,e,s),oc;Ru(),t=gc(e,t,n)}else e=o.treeContext,Pi=xf(s.nextSibling),Ni=t,Fi=!0,Ii=null,Li=!1,e!==null&&Mi(t,e),t=hc(t,r),t.flags|=4096;return t}return e=ui(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function vc(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 yc(e,t,n,r,i){return ea(t),n=Eo(e,t,n,r,void 0,i),r=Ao(),e!==null&&!sc?(jo(e,t,i),Nc(e,t,i)):(Fi&&r&&Ai(t),t.flags|=1,cc(e,t,n,i),t.child)}function bc(e,t,n,r,i,a){return ea(t),t.updateQueue=null,n=Oo(t,r,n,i),Do(e),r=Ao(),e!==null&&!sc?(jo(e,t,a),Nc(e,t,a)):(Fi&&r&&Ai(t),t.flags|=1,cc(e,t,n,a),t.child)}function xc(e,t,n,r,i){if(ea(t),t.stateNode===null){var a=oi,o=n.contextType;typeof o==`object`&&o&&(a=ta(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=qs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Va(t),o=n.contextType,a.context=typeof o==`object`&&o?ta(o):oi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Ks(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&&qs.enqueueReplaceState(a,a.state,null),Ya(t,r,a,i),Ja(),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=Xs(n,s);a.props=c;var l=a.context,u=n.contextType;o=oi,typeof u==`object`&&u&&(o=ta(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Ys(t,a,r,o),Ba=!1;var f=t.memoizedState;a.state=f,Ya(t,r,a,i),Ja(),l=t.memoizedState,s||f!==l||Ba?(typeof d==`function`&&(Ks(t,n,d,r),l=t.memoizedState),(c=Ba||Js(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,Ha(e,t),o=t.memoizedProps,u=Xs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=oi,typeof l==`object`&&l&&(c=ta(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Ys(t,a,r,c),Ba=!1,f=t.memoizedState,a.state=f,Ya(t,r,a,i),Ja();var p=t.memoizedState;o!==d||f!==p||Ba||e!==null&&e.dependencies!==null&&$i(e.dependencies)?(typeof s==`function`&&(Ks(t,n,s,r),p=t.memoizedState),(u=Ba||Js(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&$i(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,vc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ra(t,e.child,null,i),t.child=Ra(t,null,n,i)):cc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Nc(e,t,i),e}function Sc(e,t,n,r){return Hi(),t.flags|=256,cc(e,t,n,r),t.child}var Cc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function wc(e){return{baseLanes:e,cachePool:xa()}}function Tc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=au),e}function Ec(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(uo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Fi){if(a?ao(t):co(t),(e=Pi)?(e=_f(e,Li),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ti===null?null:{id:Ei,overflow:Di},retryLane:536870912,hydrationErrors:null},n=hi(e),n.return=t,t.child=n,Ni=t,Pi=null)):e=null,e===null)throw zi(t);return yf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(co(t),a=t.mode,c=Oc({mode:`hidden`,children:c},a),r=pi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=wc(n),r.childLanes=Tc(e,s,n),t.memoizedState=Cc,pc(null,r)):(ao(t),Dc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(ao(t),t.flags&=-257,t=kc(e,t,n)):t.memoizedState===null?(co(t),c=r.fallback,a=t.mode,r=Oc({mode:`visible`,children:r.children},a),c=pi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ra(t,e.child,null,n),r=t.child,r.memoizedState=wc(n),r.childLanes=Tc(e,s,n),t.memoizedState=Cc,t=pc(null,r)):(co(t),t.child=e.child,t.flags|=128,t=null);else if(ao(t),yf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Wi({value:r,source:null,stack:null}),t=kc(e,t,n)}else if(sc||Qi(e,t,n,!1),s=(n&e.childLanes)!==0,sc||s){if(s=Kl,s!==null&&(r=st(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ri(e,r),Eu(s,e,r),oc;vf(c)||Ru(),t=kc(e,t,n)}else vf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Pi=xf(c.nextSibling),Ni=t,Fi=!0,Ii=null,Li=!1,e!==null&&Mi(t,e),t=Dc(t,r.children),t.flags|=4096);return t}return a?(co(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ui(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=pi(c,a,n,null),c.flags|=2):c=ui(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,pc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=wc(n):(a=c.cachePool,a===null?a=xa():(l=sa._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=Tc(e,s,n),t.memoizedState=Cc,pc(e.child,r)):(ao(t),n=e.child,e=n.sibling,n=ui(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Dc(e,t){return t=Oc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Oc(e,t){return e=ci(22,e,null,t),e.lanes=0,e}function kc(e,t,n){return Ra(t,e.child,null,n),e=Dc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ac(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Xi(e.return,t,n)}function jc(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 Mc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=uo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,de(uo,o),cc(e,t,r,n),r=Fi?Si:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ac(e,n,t);else if(e.tag===19)Ac(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&fo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),jc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&fo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}jc(t,!0,n,null,a,r);break;case`together`:jc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Nc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),nu|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Qi(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=ui(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ui(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Pc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&$i(e))):!0}function Fc(e,t,n){switch(t.tag){case 3:ge(t,t.stateNode.containerInfo),Ji(t,sa,e.memoizedState.cache),Hi();break;case 27:case 5:ve(t);break;case 4:ge(t,t.stateNode.containerInfo);break;case 10:Ji(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,oo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(ao(t),e=Nc(e,t,n),e===null?null:e.sibling):Ec(e,t,n):(ao(t),t.flags|=128,null);ao(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Qi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Mc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),de(uo,uo.current),r)break;return null;case 22:return t.lanes=0,fc(e,t,n,t.pendingProps);case 24:Ji(t,sa,e.memoizedState.cache)}return Nc(e,t,n)}function Ic(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)sc=!0;else{if(!Pc(e,n)&&!(t.flags&128))return sc=!1,Fc(e,t,n);sc=!!(e.flags&131072)}else sc=!1,Fi&&t.flags&1048576&&ki(t,Si,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Oa(t.elementType),t.type=e,typeof e==`function`)li(e)?(r=Xs(e,r),t.tag=1,t=xc(null,t,e,r,n)):(t.tag=0,t=yc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=lc(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=uc(null,t,e,r,n);break a}}throw t=ie(e)||e,Error(i(306,t,``))}}return t;case 0:return yc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Xs(r,t.pendingProps),xc(e,t,r,a,n);case 3:a:{if(ge(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ha(e,t),Ya(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ji(t,sa,r),r!==o.cache&&Zi(t,[sa],n,!0),Ja(),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=Sc(e,t,r,n);break a}else if(r!==a){a=vi(Error(i(424)),t),Wi(a),t=Sc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Pi=xf(e.firstChild),Ni=t,Fi=!0,Ii=null,Li=!0,n=za(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Hi(),r===a){t=Nc(e,t,n);break a}cc(e,t,r,n)}t=t.child}return t;case 26:return vc(e,t),e===null?(n=Hf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Fi||(n=t.type,e=t.pendingProps,r=ef(me.current).createElement(n),r[pt]=t,r[mt]=e,Jd(r,n,e),Et(r),t.stateNode=r):t.memoizedState=Hf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ve(t),e===null&&Fi&&(r=t.stateNode=Tf(t.type,t.pendingProps,me.current),Ni=t,Li=!0,a=Pi,B(t.type)?(Sf=a,Pi=xf(r.firstChild)):Pi=a),cc(e,t,t.pendingProps.children,n),vc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Fi&&((a=r=Pi)&&(r=hf(r,t.type,t.pendingProps,Li),r===null?a=!1:(t.stateNode=r,Ni=t,Pi=xf(r.firstChild),Li=!1,a=!0)),a||zi(t)),ve(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,rf(a,o)?r=null:s!==null&&rf(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Eo(e,t,ko,null,null,n),up._currentValue=a),vc(e,t),cc(e,t,r,n),t.child;case 6:return e===null&&Fi&&((e=n=Pi)&&(n=gf(n,t.pendingProps,Li),n===null?e=!1:(t.stateNode=n,Ni=t,Pi=null,e=!0)),e||zi(t)),null;case 13:return Ec(e,t,n);case 4:return ge(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ra(t,null,r,n):cc(e,t,r,n),t.child;case 11:return lc(e,t,t.type,t.pendingProps,n);case 7:return cc(e,t,t.pendingProps,n),t.child;case 8:return cc(e,t,t.pendingProps.children,n),t.child;case 12:return cc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ji(t,t.type,r.value),cc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,ea(t),a=ta(a),r=r(a),t.flags|=1,cc(e,t,r,n),t.child;case 14:return uc(e,t,t.type,t.pendingProps,n);case 15:return dc(e,t,t.type,t.pendingProps,n);case 19:return Mc(e,t,n);case 31:return _c(e,t,n);case 22:return fc(e,t,n,t.pendingProps);case 24:return ea(t),r=ta(sa),e===null?(a=ya(),a===null&&(a=Kl,o=ca(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Va(t),Ji(t,sa,a)):((e.lanes&n)!==0&&(Ha(e,t),Ya(t,null,null,n),Ja()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ji(t,sa,r),r!==a.cache&&Zi(t,[sa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ji(t,sa,r))),cc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Lc(e){e.flags|=4}function Rc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Fu())e.flags|=8192;else throw ka=Ta,Ca}else e.flags&=-16777217}function zc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!rp(t))if(Fu())e.flags|=8192;else throw ka=Ta,Ca}function Bc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:tt(),e.lanes|=t,ou|=t)}function Vc(e,t){if(!Fi)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Hc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Uc(e,t,n){var r=t.pendingProps;switch(ji(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Hc(t),null;case 1:return Hc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Yi(sa),_e(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(z(t)?Lc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ui())),Hc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Lc(t),o===null?(Hc(t),Rc(t,a,null,r,n)):(Hc(t),zc(t,o))):o?o===e.memoizedState?(Hc(t),t.flags&=-16777217):(Lc(t),Hc(t),zc(t,o)):(e=e.memoizedProps,e!==r&&Lc(t),Hc(t),Rc(t,a,e,r,n)),null;case 27:if(ye(t),n=me.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Lc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Hc(t),null}e=fe.current,z(t)?Bi(t,e):(e=Tf(a,r,n),t.stateNode=e,Lc(t))}return Hc(t),null;case 5:if(ye(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Lc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Hc(t),null}if(o=fe.current,z(t))Bi(t,o);else{var s=ef(me.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[pt]=t,o[mt]=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(Jd(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&&Lc(t)}}return Hc(t),Rc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Lc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=me.current,z(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ni,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[pt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Gd(e.nodeValue,n)),e||zi(t,!0)}else e=ef(e).createTextNode(r),e[pt]=t,t.stateNode=e}return Hc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=z(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[pt]=t}else Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Hc(t),e=!1}else n=Ui(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(lo(t),t):(lo(t),null);if(t.flags&128)throw Error(i(558))}return Hc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=z(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[pt]=t}else Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Hc(t),a=!1}else a=Ui(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(lo(t),t):(lo(t),null)}return lo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Bc(t,t.updateQueue),Hc(t),null);case 4:return _e(),e===null&&Fd(t.stateNode.containerInfo),Hc(t),null;case 10:return Yi(t.type),Hc(t),null;case 19:if(ue(uo),r=t.memoizedState,r===null)return Hc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Vc(r,!1);else{if(tu!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=fo(e),o!==null){for(t.flags|=128,Vc(r,!1),e=o.updateQueue,t.updateQueue=e,Bc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)di(n,e),n=n.sibling;return de(uo,uo.current&1|2),Fi&&Oi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Me()>fu&&(t.flags|=128,a=!0,Vc(r,!1),t.lanes=4194304)}else{if(!a)if(e=fo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Bc(t,e),Vc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Fi)return Hc(t),null}else 2*Me()-r.renderingStartTime>fu&&n!==536870912&&(t.flags|=128,a=!0,Vc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Hc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Me(),e.sibling=null,n=uo.current,de(uo,a?n&1|2:n&1),Fi&&Oi(t,r.treeForkCount),e);case 22:case 23:return lo(t),no(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Hc(t),t.subtreeFlags&6&&(t.flags|=8192)):Hc(t),n=t.updateQueue,n!==null&&Bc(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&&ue(va),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Yi(sa),Hc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Wc(e,t){switch(ji(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Yi(sa),_e(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ye(t),null;case 31:if(t.memoizedState!==null){if(lo(t),t.alternate===null)throw Error(i(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(lo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ue(uo),null;case 4:return _e(),null;case 10:return Yi(t.type),null;case 22:case 23:return lo(t),no(),e!==null&&ue(va),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Yi(sa),null;case 25:return null;default:return null}}function Gc(e,t){switch(ji(t),t.tag){case 3:Yi(sa),_e();break;case 26:case 27:case 5:ye(t);break;case 4:_e();break;case 31:t.memoizedState!==null&&lo(t);break;case 13:lo(t);break;case 19:ue(uo);break;case 10:Yi(t.type);break;case 22:case 23:lo(t),no(),e!==null&&ue(va);break;case 24:Yi(sa)}}function Kc(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){nd(t,t.return,e)}}function qc(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){nd(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){nd(t,t.return,e)}}function Jc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Za(t,n)}catch(t){nd(e,e.return,t)}}}function Yc(e,t,n){n.props=Xs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){nd(e,t,n)}}function Xc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){nd(e,t,n)}}function Zc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){nd(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){nd(e,t,n)}else n.current=null}function Qc(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){nd(e,e.return,t)}}function $c(e,t,n){try{var r=e.stateNode;Yd(r,e.type,n,t),r[mt]=t}catch(t){nd(e,e.return,t)}}function el(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&B(e.type)||e.tag===4}function tl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||el(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&&B(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 nl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=rn));else if(r!==4&&(r===27&&B(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(nl(e,t,n),e=e.sibling;e!==null;)nl(e,t,n),e=e.sibling}function rl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&B(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(rl(e,t,n),e=e.sibling;e!==null;)rl(e,t,n),e=e.sibling}function il(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Jd(t,r,n),t[pt]=e,t[mt]=n}catch(t){nd(e,e.return,t)}}var al=!1,ol=!1,sl=!1,cl=typeof WeakSet==`function`?WeakSet:Set,ll=null;function ul(e,t){if(e=e.containerInfo,Qd=yp,e=Or(e),kr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for($d={focusedElem:e,selectionRange:n},yp=!1,ll=t;ll!==null;)if(t=ll,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,ll=e;else for(;ll!==null;){switch(t=ll,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Xs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){nd(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)mf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:mf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,ll=e;break}ll=t.return}}function dl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:El(e,n),r&4&&Kc(5,n);break;case 1:if(El(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){nd(n,n.return,e)}else{var i=Xs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){nd(n,n.return,e)}}r&64&&Jc(n),r&512&&Xc(n,n.return);break;case 3:if(El(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{Za(e,t)}catch(e){nd(n,n.return,e)}}break;case 27:t===null&&r&4&&il(n);case 26:case 5:El(e,n),t===null&&r&4&&Qc(n),r&512&&Xc(n,n.return);break;case 12:El(e,n);break;case 31:El(e,n),r&4&&_l(e,n);break;case 13:El(e,n),r&4&&vl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=od.bind(null,n),bf(e,n))));break;case 22:if(r=n.memoizedState!==null||al,!r){t=t!==null&&t.memoizedState!==null||ol,i=al;var a=ol;al=r,(ol=t)&&!a?Ol(e,n,(n.subtreeFlags&8772)!=0):El(e,n),al=i,ol=a}break;case 30:break;default:El(e,n)}}function fl(e){var t=e.alternate;t!==null&&(e.alternate=null,fl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&xt(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 pl=null,ml=!1;function hl(e,t,n){for(n=n.child;n!==null;)gl(e,t,n),n=n.sibling}function gl(e,t,n){if(He&&typeof He.onCommitFiberUnmount==`function`)try{He.onCommitFiberUnmount(Ve,n)}catch{}switch(n.tag){case 26:ol||Zc(n,t),hl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ol||Zc(n,t);var r=pl,i=ml;B(n.type)&&(pl=n.stateNode,ml=!1),hl(e,t,n),Ef(n.stateNode),pl=r,ml=i;break;case 5:ol||Zc(n,t);case 6:if(r=pl,i=ml,pl=null,hl(e,t,n),pl=r,ml=i,pl!==null)if(ml)try{(pl.nodeType===9?pl.body:pl.nodeName===`HTML`?pl.ownerDocument.body:pl).removeChild(n.stateNode)}catch(e){nd(n,t,e)}else try{pl.removeChild(n.stateNode)}catch(e){nd(n,t,e)}break;case 18:pl!==null&&(ml?(e=pl,ff(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),zp(e)):ff(pl,n.stateNode));break;case 4:r=pl,i=ml,pl=n.stateNode.containerInfo,ml=!0,hl(e,t,n),pl=r,ml=i;break;case 0:case 11:case 14:case 15:qc(2,n,t),ol||qc(4,n,t),hl(e,t,n);break;case 1:ol||(Zc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Yc(n,t,r)),hl(e,t,n);break;case 21:hl(e,t,n);break;case 22:ol=(r=ol)||n.memoizedState!==null,hl(e,t,n),ol=r;break;default:hl(e,t,n)}}function _l(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{zp(e)}catch(e){nd(t,t.return,e)}}}function vl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{zp(e)}catch(e){nd(t,t.return,e)}}function yl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new cl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new cl),t;default:throw Error(i(435,e.tag))}}function bl(e,t){var n=yl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=sd.bind(null,e,t);t.then(r,r)}})}function xl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(B(c.type)){pl=c.stateNode,ml=!1;break a}break;case 5:pl=c.stateNode,ml=!1;break a;case 3:case 4:pl=c.stateNode.containerInfo,ml=!0;break a}c=c.return}if(pl===null)throw Error(i(160));gl(o,s,a),pl=null,ml=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Cl(t,e),t=t.sibling}var Sl=null;function Cl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:xl(t,e),wl(e),r&4&&(qc(3,e,e.return),Kc(3,e),qc(5,e,e.return));break;case 1:xl(t,e),wl(e),r&512&&(ol||n===null||Zc(n,n.return)),r&64&&al&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=Sl;if(xl(t,e),wl(e),r&512&&(ol||n===null||Zc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[bt]||o[pt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Jd(o,r,n),o[pt]=e,Et(o),r=o;break a;case`link`:var s=ep(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Jd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=ep(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Jd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[pt]=e,Et(o),r=o}e.stateNode=r}else tp(a,e.type,e.stateNode);else e.stateNode=Yf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&$c(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?tp(a,e.type,e.stateNode):Yf(a,r,e.memoizedProps))}break;case 27:xl(t,e),wl(e),r&512&&(ol||n===null||Zc(n,n.return)),n!==null&&r&4&&$c(e,e.memoizedProps,n.memoizedProps);break;case 5:if(xl(t,e),wl(e),r&512&&(ol||n===null||Zc(n,n.return)),e.flags&32){a=e.stateNode;try{Yt(a,``)}catch(t){nd(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,$c(e,a,n===null?a:n.memoizedProps)),r&1024&&(sl=!0);break;case 6:if(xl(t,e),wl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){nd(e,e.return,t)}}break;case 3:if($f=null,a=Sl,Sl=kf(t.containerInfo),xl(t,e),Sl=a,wl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{zp(t.containerInfo)}catch(t){nd(e,e.return,t)}sl&&(sl=!1,Tl(e));break;case 4:r=Sl,Sl=kf(e.stateNode.containerInfo),xl(t,e),wl(e),Sl=r;break;case 12:xl(t,e),wl(e);break;case 31:xl(t,e),wl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,bl(e,r)));break;case 13:xl(t,e),wl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(uu=Me()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,bl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=al,d=ol;if(al=u||a,ol=d||l,xl(t,e),ol=d,al=u,wl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||al||ol||Dl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){nd(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){nd(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?pf(m,!0):pf(l.stateNode,!1)}catch(e){nd(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,bl(e,n))));break;case 19:xl(t,e),wl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,bl(e,r)));break;case 30:break;case 21:break;default:xl(t,e),wl(e)}}function wl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(el(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;rl(e,tl(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Yt(o,``),n.flags&=-33),rl(e,tl(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;nl(e,tl(e),s);break;default:throw Error(i(161))}}catch(t){nd(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Tl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Tl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function El(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)dl(e,t.alternate,t),t=t.sibling}function Dl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:qc(4,t,t.return),Dl(t);break;case 1:Zc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Yc(t,t.return,n),Dl(t);break;case 27:Ef(t.stateNode);case 26:case 5:Zc(t,t.return),Dl(t);break;case 22:t.memoizedState===null&&Dl(t);break;case 30:Dl(t);break;default:Dl(t)}e=e.sibling}}function Ol(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Ol(i,a,n),Kc(4,a);break;case 1:if(Ol(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){nd(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Xa(c[i],s)}catch(e){nd(r,r.return,e)}}n&&o&64&&Jc(a),Xc(a,a.return);break;case 27:il(a);case 26:case 5:Ol(i,a,n),n&&r===null&&o&4&&Qc(a),Xc(a,a.return);break;case 12:Ol(i,a,n);break;case 31:Ol(i,a,n),n&&o&4&&_l(i,a);break;case 13:Ol(i,a,n),n&&o&4&&vl(i,a);break;case 22:a.memoizedState===null&&Ol(i,a,n),Xc(a,a.return);break;case 30:break;default:Ol(i,a,n)}t=t.sibling}}function kl(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&&la(n))}function Al(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&la(e))}function jl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Ml(e,t,n,r),t=t.sibling}function Ml(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:jl(e,t,n,r),i&2048&&Kc(9,t);break;case 1:jl(e,t,n,r);break;case 3:jl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&la(e)));break;case 12:if(i&2048){jl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){nd(t,t.return,e)}}else jl(e,t,n,r);break;case 31:jl(e,t,n,r);break;case 13:jl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?jl(e,t,n,r):(a._visibility|=2,Nl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?jl(e,t,n,r):Pl(e,t),i&2048&&kl(o,t);break;case 24:jl(e,t,n,r),i&2048&&Al(t.alternate,t);break;default:jl(e,t,n,r)}}function Nl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!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:Nl(a,o,s,c,i),Kc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Nl(a,o,s,c,i)):u._visibility&2?Nl(a,o,s,c,i):Pl(a,o),i&&l&2048&&kl(o.alternate,o);break;case 24:Nl(a,o,s,c,i),i&&l&2048&&Al(o.alternate,o);break;default:Nl(a,o,s,c,i)}t=t.sibling}}function Pl(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:Pl(n,r),i&2048&&kl(r.alternate,r);break;case 24:Pl(n,r),i&2048&&Al(r.alternate,r);break;default:Pl(n,r)}t=t.sibling}}var Fl=8192;function Il(e,t,n){if(e.subtreeFlags&Fl)for(e=e.child;e!==null;)Ll(e,t,n),e=e.sibling}function Ll(e,t,n){switch(e.tag){case 26:Il(e,t,n),e.flags&Fl&&e.memoizedState!==null&&ip(n,Sl,e.memoizedState,e.memoizedProps);break;case 5:Il(e,t,n);break;case 3:case 4:var r=Sl;Sl=kf(e.stateNode.containerInfo),Il(e,t,n),Sl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Fl,Fl=16777216,Il(e,t,n),Fl=r):Il(e,t,n));break;default:Il(e,t,n)}}function Rl(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 zl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ll=r,Hl(r,e)}Rl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Bl(e),e=e.sibling}function Bl(e){switch(e.tag){case 0:case 11:case 15:zl(e),e.flags&2048&&qc(9,e,e.return);break;case 3:zl(e);break;case 12:zl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Vl(e)):zl(e);break;default:zl(e)}}function Vl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ll=r,Hl(r,e)}Rl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:qc(8,t,t.return),Vl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Vl(t));break;default:Vl(t)}e=e.sibling}}function Hl(e,t){for(;ll!==null;){var n=ll;switch(n.tag){case 0:case 11:case 15:qc(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:la(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,ll=r;else a:for(n=e;ll!==null;){r=ll;var i=r.sibling,a=r.return;if(fl(r),r===n){ll=null;break a}if(i!==null){i.return=a,ll=i;break a}ll=a}}}var Ul={getCacheForType:function(e){var t=ta(sa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ta(sa).controller.signal}},Wl=typeof WeakMap==`function`?WeakMap:Map,Gl=0,Kl=null,ql=null,Jl=0,Yl=0,Xl=null,Zl=!1,Ql=!1,$l=!1,eu=0,tu=0,nu=0,ru=0,iu=0,au=0,ou=0,su=null,cu=null,lu=!1,uu=0,du=0,fu=1/0,pu=null,mu=null,hu=0,gu=null,_u=null,vu=0,yu=0,bu=null,xu=null,Su=0,Cu=null;function wu(){return Gl&2&&Jl!==0?Jl&-Jl:A.T===null?ut():Cd()}function Tu(){if(au===0)if(!(Jl&536870912)||Fi){var e=Ye;Ye<<=1,!(Ye&3932160)&&(Ye=262144),au=e}else au=536870912;return e=ro.current,e!==null&&(e.flags|=32),au}function Eu(e,t,n){(e===Kl&&(Yl===2||Yl===9)||e.cancelPendingCommit!==null)&&(Nu(e,0),Au(e,Jl,au,!1)),rt(e,n),(!(Gl&2)||e!==Kl)&&(e===Kl&&(!(Gl&2)&&(ru|=n),tu===4&&Au(e,Jl,au,!1)),hd(e))}function Du(e,t,n){if(Gl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||$e(e,t),a=r?Vu(e,t):zu(e,t,!0),o=r;do{if(a===0){Ql&&!r&&Au(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!ku(n)){a=zu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=su;var l=c.current.memoizedState.isDehydrated;if(l&&(Nu(c,s).flags|=256),s=zu(c,s,!1),s!==2){if($l&&!l){c.errorRecoveryDisabledLanes|=o,ru|=o,a=4;break a}o=cu,cu=a,o!==null&&(cu===null?cu=o:cu.push.apply(cu,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Nu(e,0),Au(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Au(r,t,au,!Zl);break a;case 2:cu=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=uu+300-Me(),10<a)){if(Au(r,t,au,!Zl),Qe(r,0,!0)!==0)break a;vu=t,r.timeoutHandle=sf(Ou.bind(null,r,n,cu,pu,lu,t,au,ru,ou,Zl,o,`Throttled`,-0,0),a);break a}Ou(r,n,cu,pu,lu,t,au,ru,ou,Zl,o,null,-0,0)}}break}while(1);hd(e)}function Ou(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:rn},Ll(t,a,d);var m=(a&62914560)===a?uu-Me():(a&4194048)===a?du-Me():0;if(m=op(d,m),m!==null){vu=a,e.cancelPendingCommit=m(Ju.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Au(e,a,o,!l);return}}Ju(e,t,a,n,r,i,o,s,c)}function ku(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(!Cr(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 Au(e,t,n,r){t&=~iu,t&=~ru,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-We(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&at(e,n,t)}function ju(){return Gl&6?!0:(gd(0,!1),!1)}function Mu(){if(ql!==null){if(Yl===0)var e=ql.return;else e=ql,qi=Ki=null,Mo(e),Ma=null,Na=0,e=ql;for(;e!==null;)Gc(e.alternate,e),e=e.return;ql=null}}function Nu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,cf(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),vu=0,Mu(),Kl=e,ql=n=ui(e.current,null),Jl=t,Yl=0,Xl=null,Zl=!1,Ql=$e(e,t),$l=!1,ou=au=iu=ru=nu=tu=0,cu=su=null,lu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-We(r),a=1<<i;t|=e[i],r&=~a}return eu=t,ei(),n}function Pu(e,t){mo=null,A.H=Hs,t===Sa||t===wa?(t=Aa(),Yl=3):t===Ca?(t=Aa(),Yl=4):Yl=t===oc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Xl=t,ql===null&&(tu=1,ec(e,vi(t,e.current)))}function Fu(){var e=ro.current;return e===null?!0:(Jl&4194048)===Jl?io===null:(Jl&62914560)===Jl||Jl&536870912?e===io:!1}function Iu(){var e=A.H;return A.H=Hs,e===null?Hs:e}function Lu(){var e=A.A;return A.A=Ul,e}function Ru(){tu=4,Zl||(Jl&4194048)!==Jl&&ro.current!==null||(Ql=!0),!(nu&134217727)&&!(ru&134217727)||Kl===null||Au(Kl,Jl,au,!1)}function zu(e,t,n){var r=Gl;Gl|=2;var i=Iu(),a=Lu();(Kl!==e||Jl!==t)&&(pu=null,Nu(e,t)),t=!1;var o=tu;a:do try{if(Yl!==0&&ql!==null){var s=ql,c=Xl;switch(Yl){case 8:Mu(),o=6;break a;case 3:case 2:case 9:case 6:ro.current===null&&(t=!0);var l=Yl;if(Yl=0,Xl=null,Gu(e,s,c,l),n&&Ql){o=0;break a}break;default:l=Yl,Yl=0,Xl=null,Gu(e,s,c,l)}}Bu(),o=tu;break}catch(t){Pu(e,t)}while(1);return t&&e.shellSuspendCounter++,qi=Ki=null,Gl=r,A.H=i,A.A=a,ql===null&&(Kl=null,Jl=0,ei()),o}function Bu(){for(;ql!==null;)Uu(ql)}function Vu(e,t){var n=Gl;Gl|=2;var r=Iu(),a=Lu();Kl!==e||Jl!==t?(pu=null,fu=Me()+500,Nu(e,t)):Ql=$e(e,t);a:do try{if(Yl!==0&&ql!==null){t=ql;var o=Xl;b:switch(Yl){case 1:Yl=0,Xl=null,Gu(e,t,o,1);break;case 2:case 9:if(Ea(o)){Yl=0,Xl=null,Wu(t);break}t=function(){Yl!==2&&Yl!==9||Kl!==e||(Yl=7),hd(e)},o.then(t,t);break a;case 3:Yl=7;break a;case 4:Yl=5;break a;case 7:Ea(o)?(Yl=0,Xl=null,Wu(t)):(Yl=0,Xl=null,Gu(e,t,o,7));break;case 5:var s=null;switch(ql.tag){case 26:s=ql.memoizedState;case 5:case 27:var c=ql;if(s?rp(s):c.stateNode.complete){Yl=0,Xl=null;var l=c.sibling;if(l!==null)ql=l;else{var u=c.return;u===null?ql=null:(ql=u,Ku(u))}break b}}Yl=0,Xl=null,Gu(e,t,o,5);break;case 6:Yl=0,Xl=null,Gu(e,t,o,6);break;case 8:Mu(),tu=6;break a;default:throw Error(i(462))}}Hu();break}catch(t){Pu(e,t)}while(1);return qi=Ki=null,A.H=r,A.A=a,Gl=n,ql===null?(Kl=null,Jl=0,ei(),tu):0}function Hu(){for(;ql!==null&&!Ae();)Uu(ql)}function Uu(e){var t=Ic(e.alternate,e,eu);e.memoizedProps=e.pendingProps,t===null?Ku(e):ql=t}function Wu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=bc(n,t,t.pendingProps,t.type,void 0,Jl);break;case 11:t=bc(n,t,t.pendingProps,t.type.render,t.ref,Jl);break;case 5:Mo(t);default:Gc(n,t),t=ql=di(t,eu),t=Ic(n,t,eu)}e.memoizedProps=e.pendingProps,t===null?Ku(e):ql=t}function Gu(e,t,n,r){qi=Ki=null,Mo(t),Ma=null,Na=0;var i=t.return;try{if(ac(e,i,t,n,Jl)){tu=1,ec(e,vi(n,e.current)),ql=null;return}}catch(t){if(i!==null)throw ql=i,t;tu=1,ec(e,vi(n,e.current)),ql=null;return}t.flags&32768?(Fi||r===1?e=!0:Ql||Jl&536870912?e=!1:(Zl=e=!0,(r===2||r===9||r===3||r===6)&&(r=ro.current,r!==null&&r.tag===13&&(r.flags|=16384))),qu(t,e)):Ku(t)}function Ku(e){var t=e;do{if(t.flags&32768){qu(t,Zl);return}e=t.return;var n=Uc(t.alternate,t,eu);if(n!==null){ql=n;return}if(t=t.sibling,t!==null){ql=t;return}ql=t=e}while(t!==null);tu===0&&(tu=5)}function qu(e,t){do{var n=Wc(e.alternate,e);if(n!==null){n.flags&=32767,ql=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ql=e;return}ql=e=n}while(e!==null);tu=6,ql=null}function Ju(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do $u();while(hu!==0);if(Gl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=$r,it(e,n,o,s,c,l),e===Kl&&(ql=Kl=null,Jl=0),_u=t,gu=e,vu=n,yu=o,bu=a,xu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,cd(Ie,function(){return ed(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=A.T,A.T=null,a=oe.p,oe.p=2,s=Gl,Gl|=4;try{ul(e,t,n)}finally{Gl=s,oe.p=a,A.T=r}}hu=1,Yu(),Xu(),Zu()}}function Yu(){if(hu===1){hu=0;var e=gu,t=_u,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=A.T,A.T=null;var r=oe.p;oe.p=2;var i=Gl;Gl|=4;try{Cl(t,e);var a=$d,o=Or(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Dr(s.ownerDocument.documentElement,s)){if(c!==null&&kr(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 _=Er(s,h),v=Er(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}yp=!!Qd,$d=Qd=null}finally{Gl=i,oe.p=r,A.T=n}}e.current=t,hu=2}}function Xu(){if(hu===2){hu=0;var e=gu,t=_u,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=A.T,A.T=null;var r=oe.p;oe.p=2;var i=Gl;Gl|=4;try{dl(e,t.alternate,t)}finally{Gl=i,oe.p=r,A.T=n}}hu=3}}function Zu(){if(hu===4||hu===3){hu=0,je();var e=gu,t=_u,n=vu,r=xu;t.subtreeFlags&10256||t.flags&10256?hu=5:(hu=0,_u=gu=null,Qu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(mu=null),lt(n),t=t.stateNode,He&&typeof He.onCommitFiberRoot==`function`)try{He.onCommitFiberRoot(Ve,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=A.T,i=oe.p,oe.p=2,A.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{A.T=t,oe.p=i}}vu&3&&$u(),hd(e),i=e.pendingLanes,n&261930&&i&42?e===Cu?Su++:(Su=0,Cu=e):Su=0,gd(0,!1)}}function Qu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,la(t)))}function $u(){return Yu(),Xu(),Zu(),ed()}function ed(){if(hu!==5)return!1;var e=gu,t=yu;yu=0;var n=lt(vu),r=A.T,a=oe.p;try{oe.p=32>n?32:n,A.T=null,n=bu,bu=null;var o=gu,s=vu;if(hu=0,_u=gu=null,vu=0,Gl&6)throw Error(i(331));var c=Gl;if(Gl|=4,Bl(o.current),Ml(o,o.current,s,n),Gl=c,gd(0,!1),He&&typeof He.onPostCommitFiberRoot==`function`)try{He.onPostCommitFiberRoot(Ve,o)}catch{}return!0}finally{oe.p=a,A.T=r,Qu(e,t)}}function td(e,t,n){t=vi(n,t),t=nc(e.stateNode,t,2),e=Wa(e,t,2),e!==null&&(rt(e,2),hd(e))}function nd(e,t,n){if(e.tag===3)td(e,e,n);else for(;t!==null;){if(t.tag===3){td(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(mu===null||!mu.has(r))){e=vi(n,e),n=rc(2),r=Wa(t,n,2),r!==null&&(ic(n,r,t,e),rt(r,2),hd(r));break}}t=t.return}}function rd(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Wl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||($l=!0,i.add(n),e=id.bind(null,e,t,n),t.then(e,e))}function id(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Kl===e&&(Jl&n)===n&&(tu===4||tu===3&&(Jl&62914560)===Jl&&300>Me()-uu?!(Gl&2)&&Nu(e,0):iu|=n,ou===Jl&&(ou=0)),hd(e)}function ad(e,t){t===0&&(t=tt()),e=ri(e,t),e!==null&&(rt(e,t),hd(e))}function od(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ad(e,n)}function sd(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),ad(e,n)}function cd(e,t){return Oe(e,t)}var ld=null,ud=null,dd=!1,fd=!1,pd=!1,md=0;function hd(e){e!==ud&&e.next===null&&(ud===null?ld=ud=e:ud=ud.next=e),fd=!0,dd||(dd=!0,Sd())}function gd(e,t){if(!pd&&fd){pd=!0;do for(var n=!1,r=ld;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-We(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,xd(r,a))}else a=Jl,a=Qe(r,r===Kl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||$e(r,a)||(n=!0,xd(r,a));r=r.next}while(n);pd=!1}}function _d(){vd()}function vd(){fd=dd=!1;var e=0;md!==0&&of()&&(e=md);for(var t=Me(),n=null,r=ld;r!==null;){var i=r.next,a=yd(r,t);a===0?(r.next=null,n===null?ld=i:n.next=i,i===null&&(ud=n)):(n=r,(e!==0||a&3)&&(fd=!0)),r=i}hu!==0&&hu!==5||gd(e,!1),md!==0&&(md=0)}function yd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-We(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=et(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Kl,n=Jl,n=Qe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Yl===2||Yl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ke(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||$e(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ke(r),lt(n)){case 2:case 8:n=Fe;break;case 32:n=Ie;break;case 268435456:n=Re;break;default:n=Ie}return r=bd.bind(null,e),n=Oe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ke(r),e.callbackPriority=2,e.callbackNode=null,2}function bd(e,t){if(hu!==0&&hu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if($u()&&e.callbackNode!==n)return null;var r=Jl;return r=Qe(e,e===Kl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Du(e,r,t),yd(e,Me()),e.callbackNode!=null&&e.callbackNode===n?bd.bind(null,e):null)}function xd(e,t){if($u())return null;Du(e,t,!0)}function Sd(){uf(function(){Gl&6?Oe(Pe,_d):vd()})}function Cd(){if(md===0){var e=fa;e===0&&(e=Je,Je<<=1,!(Je&261888)&&(Je=256)),md=e}return md}function wd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:nn(``+e)}function Td(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Ed(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=wd((i[mt]||null).action),o=r.submitter;o&&(t=(t=o[mt]||null)?wd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Cn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(md!==0){var e=o?Td(i,o):new FormData(i);Os(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?Td(i,o):new FormData(i),Os(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Dd=0;Dd<Jr.length;Dd++){var Od=Jr[Dd];Yr(Od.toLowerCase(),`on`+(Od[0].toUpperCase()+Od.slice(1)))}Yr(Vr,`onAnimationEnd`),Yr(Hr,`onAnimationIteration`),Yr(Ur,`onAnimationStart`),Yr(`dblclick`,`onDoubleClick`),Yr(`focusin`,`onFocus`),Yr(`focusout`,`onBlur`),Yr(Wr,`onTransitionRun`),Yr(Gr,`onTransitionStart`),Yr(R,`onTransitionCancel`),Yr(Kr,`onTransitionEnd`),M(`onMouseEnter`,[`mouseout`,`mouseover`]),M(`onMouseLeave`,[`mouseout`,`mouseover`]),M(`onPointerEnter`,[`pointerout`,`pointerover`]),M(`onPointerLeave`,[`pointerout`,`pointerover`]),kt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),kt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),kt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),kt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),kt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),kt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var kd=`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(` `),Ad=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(kd));function jd(e,t){t=(t&4)!=0;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){Xr(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){Xr(e)}i.currentTarget=null,a=c}}}}function Md(e,t){var n=t[gt];n===void 0&&(n=t[gt]=new Set);var r=e+`__bubble`;n.has(r)||(Id(t,e,2,!1),n.add(r))}function Nd(e,t,n){var r=0;t&&(r|=4),Id(n,e,r,t)}var Pd=`_reactListening`+Math.random().toString(36).slice(2);function Fd(e){if(!e[Pd]){e[Pd]=!0,Dt.forEach(function(t){t!==`selectionchange`&&(Ad.has(t)||Nd(t,!1,e),Nd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Pd]||(t[Pd]=!0,Nd(`selectionchange`,!1,t))}}function Id(e,t,n,r){switch(Ep(t)){case 2:var i=bp;break;case 8:i=xp;break;default:i=Sp}n=i.bind(null,t,n,e),i=void 0,!mn||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 Ld(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=St(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}dn(function(){var r=a,i=on(n),s=[];a:{var c=qr.get(e);if(c!==void 0){var l=Cn,u=e;switch(e){case`keypress`:if(bn(n)===0)break a;case`keydown`:case`keyup`:l=Vn;break;case`focusin`:u=`focus`,l=Mn;break;case`focusout`:u=`blur`,l=Mn;break;case`beforeblur`:case`afterblur`:l=Mn;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=An;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=jn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Un;break;case Vr:case Hr:case Ur:l=Nn;break;case Kr:l=Wn;break;case`scroll`:case`scrollend`:l=Tn;break;case`wheel`:l=Gn;break;case`copy`:case`cut`:case`paste`:l=Pn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Hn;break;case`toggle`:case`beforetoggle`:l=Kn}var d=(t&4)!=0,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=fn(m,p),g!=null&&d.push(Rd(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(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==an&&(u=n.relatedTarget||n.fromElement)&&(St(u)||u[ht]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?St(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=An,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Hn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:wt(l),h=u==null?c:wt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,St(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Bd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Vd(s,c,l,d,!1),u!==null&&f!==null&&Vd(s,f,u,d,!0)}}a:{if(c=r?wt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=fr;else if(or(c))if(pr)v=xr;else{v=yr;var y=vr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&$t(r.elementType)&&(v=fr):v=br;if(v&&=v(e,r)){sr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Gt(c,`number`,c.value)}switch(y=r?wt(r):window,e){case`focusin`:(or(y)||y.contentEditable===`true`)&&(jr=y,Mr=r,Nr=null);break;case`focusout`:Nr=Mr=jr=null;break;case`mousedown`:Pr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Pr=!1,Fr(s,n,i);break;case`selectionchange`:if(Ar)break;case`keydown`:case`keyup`:Fr(s,n,i)}var b;if(Jn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else nr?er(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Zn&&n.locale!==`ko`&&(nr||x!==`onCompositionStart`?x===`onCompositionEnd`&&nr&&(b=yn()):(gn=i,_n=`value`in gn?gn.value:gn.textContent,nr=!0)),y=zd(r,x),0<y.length&&(x=new Fn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=tr(n),b!==null&&(x.data=b)))),(b=Xn?rr(e,n):ir(e,n))&&(x=zd(r,`onBeforeInput`),0<x.length&&(y=new Fn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),Ed(s,e,r,n,i)}jd(s,t)})}function Rd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function zd(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=fn(e,n),i!=null&&r.unshift(Rd(e,i,a)),i=fn(e,t),i!=null&&r.push(Rd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Bd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Vd(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=fn(n,a),l!=null&&o.unshift(Rd(n,l,c))):i||(l=fn(n,a),l!=null&&o.push(Rd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Hd=/\r\n?/g,Ud=/\u0000|\uFFFD/g;function Wd(e){return(typeof e==`string`?e:``+e).replace(Hd,`
9
+ `).replace(Ud,``)}function Gd(e,t){return t=Wd(t),Wd(e)===t}function Kd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Yt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Yt(e,``+r);break;case`className`:Nt(e,`class`,r);break;case`tabIndex`:Nt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Nt(e,n,r);break;case`style`:Qt(e,r,o);break;case`data`:if(t!==`object`){Nt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=nn(``+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}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Kd(e,t,`name`,a.name,a,null),Kd(e,t,`formEncType`,a.formEncType,a,null),Kd(e,t,`formMethod`,a.formMethod,a,null),Kd(e,t,`formTarget`,a.formTarget,a,null)):(Kd(e,t,`encType`,a.encType,a,null),Kd(e,t,`method`,a.method,a,null),Kd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=nn(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=rn);break;case`onScroll`:r!=null&&Md(`scroll`,e);break;case`onScrollEnd`:r!=null&&Md(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=nn(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Md(`beforetoggle`,e),Md(`toggle`,e),Mt(e,`popover`,r);break;case`xlinkActuate`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Pt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Pt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Pt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Mt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=en.get(n)||n,Mt(e,n,r))}}function qd(e,t,n,r,a,o){switch(n){case`style`:Qt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Yt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Yt(e,``+r);break;case`onScroll`:r!=null&&Md(`scroll`,e);break;case`onScrollEnd`:r!=null&&Md(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=rn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Ot.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[mt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Mt(e,n,r)}}}function Jd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Md(`error`,e),Md(`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:Kd(e,t,o,s,n,null)}}a&&Kd(e,t,`srcSet`,n.srcSet,n,null),r&&Kd(e,t,`src`,n.src,n,null);return;case`input`:Md(`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:Kd(e,t,r,d,n,null)}}Wt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Md(`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:Kd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Kt(e,!!r,n,!0):Kt(e,!!r,t,!1);return;case`textarea`:for(s in Md(`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:Kd(e,t,s,c,n,null)}Jt(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:Kd(e,t,l,r,n,null)}return;case`dialog`:Md(`beforetoggle`,e),Md(`toggle`,e),Md(`cancel`,e),Md(`close`,e);break;case`iframe`:case`object`:Md(`load`,e);break;case`video`:case`audio`:for(r=0;r<kd.length;r++)Md(kd[r],e);break;case`image`:Md(`error`,e),Md(`load`,e);break;case`details`:Md(`toggle`,e);break;case`embed`:case`source`:case`link`:Md(`error`,e),Md(`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:Kd(e,t,u,r,n,null)}return;default:if($t(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&qd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Kd(e,t,c,r,n,null))}function Yd(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)||Kd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Kd(e,t,p,m,r,f)}}Ut(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)||Kd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Kd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Kt(e,!!n,n?[]:``,!1):Kt(e,!!n,t,!0)):Kt(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:Kd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Kd(e,t,s,a,r,o)}qt(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:Kd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Kd(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)&&Kd(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:Kd(e,t,u,p,r,m)}return;default:if($t(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&qd(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||qd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Kd(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||Kd(e,t,f,p,r,m)}function Xd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Zd(){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&&Xd(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&&Xd(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 Qd=null,$d=null;function ef(e){return e.nodeType===9?e:e.ownerDocument}function tf(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 nf(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 rf(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 af=null;function of(){var e=window.event;return e&&e.type===`popstate`?e===af?!1:(af=e,!0):(af=null,!1)}var sf=typeof setTimeout==`function`?setTimeout:void 0,cf=typeof clearTimeout==`function`?clearTimeout:void 0,lf=typeof Promise==`function`?Promise:void 0,uf=typeof queueMicrotask==`function`?queueMicrotask:lf===void 0?sf:function(e){return lf.resolve(null).then(e).catch(df)};function df(e){setTimeout(function(){throw e})}function B(e){return e===`head`}function ff(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),zp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Ef(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Ef(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[bt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Ef(e.ownerDocument.body);n=i}while(n);zp(t)}function pf(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 mf(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`:mf(n),xt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function hf(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[bt])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=xf(e.nextSibling),e===null)break}return null}function gf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=xf(e.nextSibling),e===null))return null;return e}function _f(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=xf(e.nextSibling),e===null))return null;return e}function vf(e){return e.data===`$?`||e.data===`$~`}function yf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function bf(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 xf(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 Sf=null;function Cf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return xf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function wf(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 Tf(e,t,n){switch(t=ef(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 Ef(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);xt(e)}var Df=new Map,Of=new Set;function kf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Af=oe.d;oe.d={f:jf,r:Mf,D:Ff,C:If,L:Lf,m:Rf,X:Bf,S:zf,M:Vf};function jf(){var e=Af.f(),t=ju();return e||t}function Mf(e){var t=Ct(e);t!==null&&t.tag===5&&t.type===`form`?As(t):Af.r(e)}var Nf=typeof document>`u`?null:document;function Pf(e,t,n){var r=Nf;if(r&&typeof t==`string`&&t){var i=Ht(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Of.has(i)||(Of.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Jd(t,`link`,e),Et(t),r.head.appendChild(t)))}}function Ff(e){Af.D(e),Pf(`dns-prefetch`,e,null)}function If(e,t){Af.C(e,t),Pf(`preconnect`,e,t)}function Lf(e,t,n){Af.L(e,t,n);var r=Nf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Ht(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Ht(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Ht(n.imageSizes)+`"]`)):i+=`[href="`+Ht(e)+`"]`;var a=i;switch(t){case`style`:a=Uf(e);break;case`script`:a=qf(e)}Df.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Df.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Wf(a))||t===`script`&&r.querySelector(Jf(a))||(t=r.createElement(`link`),Jd(t,`link`,e),Et(t),r.head.appendChild(t)))}}function Rf(e,t){Af.m(e,t);var n=Nf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Ht(r)+`"][href="`+Ht(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=qf(e)}if(!Df.has(a)&&(e=m({rel:`modulepreload`,href:e},t),Df.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Jf(a)))return}r=n.createElement(`link`),Jd(r,`link`,e),Et(r),n.head.appendChild(r)}}}function zf(e,t,n){Af.S(e,t,n);var r=Nf;if(r&&e){var i=Tt(r).hoistableStyles,a=Uf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Wf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Df.get(a))&&Zf(e,n);var c=o=r.createElement(`link`);Et(c),Jd(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,Xf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Bf(e,t){Af.X(e,t);var n=Nf;if(n&&e){var r=Tt(n).hoistableScripts,i=qf(e),a=r.get(i);a||(a=n.querySelector(Jf(i)),a||(e=m({src:e,async:!0},t),(t=Df.get(i))&&Qf(e,t),a=n.createElement(`script`),Et(a),Jd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Vf(e,t){Af.M(e,t);var n=Nf;if(n&&e){var r=Tt(n).hoistableScripts,i=qf(e),a=r.get(i);a||(a=n.querySelector(Jf(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=Df.get(i))&&Qf(e,t),a=n.createElement(`script`),Et(a),Jd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Hf(e,t,n,r){var a=(a=me.current)?kf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Uf(n.href),n=Tt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Uf(n.href);var o=Tt(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(Wf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Df.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Df.set(e,n),o||Kf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=qf(n),n=Tt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Uf(e){return`href="`+Ht(e)+`"`}function Wf(e){return`link[rel="stylesheet"][`+e+`]`}function Gf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Kf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Jd(t,`link`,n),Et(t),e.head.appendChild(t))}function qf(e){return`[src="`+Ht(e)+`"]`}function Jf(e){return`script[async]`+e}function Yf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Ht(n.href)+`"]`);if(r)return t.instance=r,Et(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Et(r),Jd(r,`style`,a),Xf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Uf(n.href);var o=e.querySelector(Wf(a));if(o)return t.state.loading|=4,t.instance=o,Et(o),o;r=Gf(n),(a=Df.get(a))&&Zf(r,a),o=(e.ownerDocument||e).createElement(`link`),Et(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Jd(o,`link`,r),t.state.loading|=4,Xf(o,n.precedence,e),t.instance=o;case`script`:return o=qf(n.src),(a=e.querySelector(Jf(o)))?(t.instance=a,Et(a),a):(r=n,(a=Df.get(o))&&(r=m({},n),Qf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Et(a),Jd(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,Xf(r,n.precedence,e));return t.instance}function Xf(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 Zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Qf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var $f=null;function ep(e,t,n){if($f===null){var r=new Map,i=$f=new Map;i.set(n,r)}else i=$f,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[bt]||a[pt]||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 tp(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function np(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 rp(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function ip(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=Uf(r.href),a=t.querySelector(Wf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=sp.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Et(a);return}a=t.ownerDocument||t,r=Gf(r),(i=Df.get(i))&&Zf(r,i),a=a.createElement(`link`),Et(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Jd(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=sp.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ap=0;function op(e,t){return e.stylesheets&&e.count===0&&V(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&V(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ap===0&&(ap=62500*Zd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&V(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ap?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function sp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)V(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var cp=null;function V(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,cp=new Map,t.forEach(lp,e),cp=null,sp.call(e))}function lp(e,t){if(!(t.state.loading&4)){var n=cp.get(e);if(n)var r=n.get(null);else{n=new Map,cp.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=sp.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var up={$$typeof:C,Provider:null,Consumer:null,_currentValue:j,_currentValue2:j,_threadCount:0};function dp(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=nt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=nt(0),this.hiddenUpdates=nt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function fp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new dp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ci(3,null,null,t),e.current=a,a.stateNode=e,t=ca(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Va(a),e}function pp(e){return e?(e=oi,e):oi}function mp(e,t,n,r,i,a){i=pp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ua(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Wa(e,r,t),n!==null&&(Eu(n,e,t),Ga(n,e,t))}function hp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function gp(e,t){hp(e,t),(e=e.alternate)&&hp(e,t)}function _p(e){if(e.tag===13||e.tag===31){var t=ri(e,67108864);t!==null&&Eu(t,e,67108864),gp(e,67108864)}}function vp(e){if(e.tag===13||e.tag===31){var t=wu();t=ct(t);var n=ri(e,t);n!==null&&Eu(n,e,t),gp(e,t)}}var yp=!0;function bp(e,t,n,r){var i=A.T;A.T=null;var a=oe.p;try{oe.p=2,Sp(e,t,n,r)}finally{oe.p=a,A.T=i}}function xp(e,t,n,r){var i=A.T;A.T=null;var a=oe.p;try{oe.p=8,Sp(e,t,n,r)}finally{oe.p=a,A.T=i}}function Sp(e,t,n,r){if(yp){var i=Cp(r);if(i===null)Ld(e,t,r,wp,n),H(e,r);else if(W(i,e,t,n,r))r.stopPropagation();else if(H(e,r),t&4&&-1<Pp.indexOf(e)){for(;i!==null;){var a=Ct(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ze(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-We(o);s.entanglements[1]|=c,o&=~c}hd(a),!(Gl&6)&&(fu=Me()+500,gd(0,!1))}}break;case 31:case 13:s=ri(a,2),s!==null&&Eu(s,a,2),ju(),gp(a,2)}if(a=Cp(r),a===null&&Ld(e,t,r,wp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Ld(e,t,r,null,n)}}function Cp(e){return e=on(e),Tp(e)}var wp=null;function Tp(e){if(wp=null,e=St(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 wp=e,null}function Ep(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ne()){case Pe:return 2;case Fe:return 8;case Ie:case Le:return 32;case Re:return 268435456;default:return 32}default:return 32}}var Dp=!1,Op=null,kp=null,Ap=null,jp=new Map,Mp=new Map,Np=[],Pp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function H(e,t){switch(e){case`focusin`:case`focusout`:Op=null;break;case`dragenter`:case`dragleave`:kp=null;break;case`mouseover`:case`mouseout`:Ap=null;break;case`pointerover`:case`pointerout`:jp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Mp.delete(t.pointerId)}}function U(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=Ct(t),t!==null&&_p(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function W(e,t,n,r,i){switch(t){case`focusin`:return Op=U(Op,e,t,n,r,i),!0;case`dragenter`:return kp=U(kp,e,t,n,r,i),!0;case`mouseover`:return Ap=U(Ap,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return jp.set(a,U(jp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Mp.set(a,U(Mp.get(a)||null,e,t,n,r,i)),!0}return!1}function G(e){var t=St(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(){vp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,dt(e.priority,function(){vp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function K(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Cp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);an=r,n.target.dispatchEvent(r),an=null}else return t=Ct(n),t!==null&&_p(t),e.blockedOn=n,!1;t.shift()}return!0}function Fp(e,t,n){K(e)&&n.delete(t)}function q(){Dp=!1,Op!==null&&K(Op)&&(Op=null),kp!==null&&K(kp)&&(kp=null),Ap!==null&&K(Ap)&&(Ap=null),jp.forEach(Fp),Mp.forEach(Fp)}function Ip(e,n){e.blockedOn===n&&(e.blockedOn=null,Dp||(Dp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,q)))}var Lp=null;function Rp(e){Lp!==e&&(Lp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Lp===e&&(Lp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Tp(r||n)===null)continue;break}var a=Ct(n);a!==null&&(e.splice(t,3),t-=3,Os(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function zp(e){function t(t){return Ip(t,e)}Op!==null&&Ip(Op,e),kp!==null&&Ip(kp,e),Ap!==null&&Ip(Ap,e),jp.forEach(t),Mp.forEach(t);for(var n=0;n<Np.length;n++){var r=Np[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Np.length&&(n=Np[0],n.blockedOn===null);)G(n),n.blockedOn===null&&Np.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[mt]||null;if(typeof a==`function`)o||Rp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[mt]||null)s=o.formAction;else if(Tp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Rp(n)}}}function Bp(){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 Vp(e){this._internalRoot=e}J.prototype.render=Vp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;mp(n,wu(),e,t,null,null)},J.prototype.unmount=Vp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;mp(e.current,2,null,e,null,null),ju(),t[ht]=null}};function J(e){this._internalRoot=e}J.prototype.unstable_scheduleHydration=function(e){if(e){var t=ut();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Np.length&&t!==0&&t<Np[n].priority;n++);Np.splice(n,0,e),n===0&&G(e)}};var Hp=n.version;if(Hp!==`19.2.6`)throw Error(i(527,Hp,`19.2.6`));oe.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 Y={bundleType:0,version:`19.2.6`,rendererPackageName:`react-dom`,currentDispatcherRef:A,reconcilerVersion:`19.2.6`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Up=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Up.isDisabled&&Up.supportsFiber)try{Ve=Up.inject(Y),He=Up}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Zs,s=Qs,c=$s;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=fp(e,1,!1,null,null,n,r,null,o,s,c,Bp),e[ht]=t.current,Fd(e),new Vp(t)}})),_=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=l(d(),1),y=_(),b=`modulepreload`,x=function(e){return`/`+e},S={},C=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=x(t,n),t in S)return;S[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:b,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},w=`true`,T=`false`,E=w===`true`,D=T===`true`;function O(e={}){let{immediate:t=!1,onNeedReload:n,onNeedRefresh:r,onOfflineReady:i,onRegistered:a,onRegisteredSW:o,onRegisterError:s}=e,c,l,u,d=async(e=!0)=>{await l,E||u?.()};async function f(){if(`serviceWorker`in navigator){if(c=await C(async()=>{let{Workbox:e}=await import(`./workbox-window.prod.es5-Cch4wiA5.js`);return{Workbox:e}},[]).then(({Workbox:e})=>new e(`/sw.js`,{scope:`/`,type:`classic`})).catch(e=>{s?.(e)}),!c)return;if(u=()=>{c?.messageSkipWaiting()},!D)if(E)c.addEventListener(`activated`,e=>{(e.isUpdate||e.isExternal)&&(n?n():window.location.reload())}),c.addEventListener(`installed`,e=>{e.isUpdate||i?.()});else{let e=!1,t=()=>{e=!0,c?.addEventListener(`controlling`,e=>{e.isUpdate&&(n?n():window.location.reload())}),r?.()};c.addEventListener(`installed`,n=>{n.isUpdate===void 0?n.isExternal===void 0?!e&&i?.():n.isExternal?t():!e&&i?.():n.isUpdate||i?.()}),c.addEventListener(`waiting`,t)}c.register({immediate:t}).then(e=>{o?o(`/sw.js`,e):a?.(e)}).catch(e=>{s?.(e)})}}return l=f(),d}var ee=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),te=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),ne=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),re=e=>{let t=ne(e);return t.charAt(0).toUpperCase()+t.slice(1)},k={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},ie=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},ae=(0,v.createContext)({}),A=()=>(0,v.useContext)(ae),oe=(0,v.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=A()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,v.createElement)(`svg`,{ref:c,...k,width:t??l??k.width,height:t??l??k.height,stroke:e??f,strokeWidth:m,className:ee(`lucide`,p,i),...!a&&!ie(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,v.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),j=(e,t)=>{let n=(0,v.forwardRef)(({className:n,...r},i)=>(0,v.createElement)(oe,{ref:i,iconNode:t,className:ee(`lucide-${te(re(e))}`,`lucide-${e}`,n),...r}));return n.displayName=re(e),n},se=j(`at-sign`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8`,key:`7n84p3`}]]),ce=j(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),le=j(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),ue=j(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),de=j(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),fe=j(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),pe=j(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),me=j(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),he=j(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),ge=j(`file-code`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),_e=j(`file-diff`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M9 10h6`,key:`9gxzsh`}],[`path`,{d:`M12 13V7`,key:`h0r20n`}],[`path`,{d:`M9 17h6`,key:`r8uit2`}]]),ve=j(`file-plus-corner`,[[`path`,{d:`M11.35 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v5.35`,key:`17jvcc`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M14 19h6`,key:`bvotb8`}],[`path`,{d:`M17 16v6`,key:`18yu1i`}]]),ye=j(`file-search`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`11.5`,cy:`14.5`,r:`2.5`,key:`1bq0ko`}],[`path`,{d:`M13.3 16.3 15 18`,key:`2quom7`}]]),be=j(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),xe=j(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),Se=j(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),Ce=j(`git-commit-horizontal`,[[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`line`,{x1:`3`,x2:`9`,y1:`12`,y2:`12`,key:`1dyftd`}],[`line`,{x1:`15`,x2:`21`,y1:`12`,y2:`12`,key:`oup4p8`}]]),we=j(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),Te=j(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),Ee=j(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),De=j(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),Oe=j(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),ke=j(`navigation`,[[`polygon`,{points:`3 11 22 2 13 21 11 13 3 11`,key:`1ltx0t`}]]),Ae=j(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),je=j(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Me=j(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Ne=j(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Pe=j(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),Fe=j(`rows-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}]]),Ie=j(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),Le=j(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Re=j(`square-x`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),ze=j(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),Be=j(`text-wrap`,[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]]),Ve=j(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),He=j(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Ue=j(`undo-2`,[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]),We=j(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),Ge=j(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),Ke=j(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),qe=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},Je=(e=>e?qe(e):qe),Ye=e=>e;function Xe(e,t=Ye){let n=v.useSyncExternalStore(e.subscribe,v.useCallback(()=>t(e.getState()),[e,t]),v.useCallback(()=>t(e.getInitialState()),[e,t]));return v.useDebugValue(n),n}var Ze=e=>{let t=Je(e),n=e=>Xe(t,e);return Object.assign(n,t),n},Qe=(e=>e?Ze(e):Ze);function $e(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}var et=class{constructor(){this.mutex=Promise.resolve()}lock(){let e=()=>{};return this.mutex=this.mutex.then(()=>new Promise(e)),new Promise(t=>{e=t})}dispatch(e){return $e(this,void 0,void 0,function*(){let t=yield this.lock();try{return yield Promise.resolve(e())}finally{t()}})}};function tt(){return typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:global}var nt=tt(),rt=nt.Buffer??null,it=nt.TextEncoder?new nt.TextEncoder:null;function at(e,t){return(e&15)+(e>>6|e>>3&8)<<4|(t&15)+(t>>6|t>>3&8)}function ot(e,t){let n=t.length>>1;for(let r=0;r<n;r++){let n=r<<1;e[r]=at(t.charCodeAt(n),t.charCodeAt(n+1))}}function st(e,t){if(e.length!==t.length*2)return!1;for(let n=0;n<t.length;n++){let r=n<<1;if(t[n]!==at(e.charCodeAt(r),e.charCodeAt(r+1)))return!1}return!0}var ct=87,lt=48;function ut(e,t,n){let r=0;for(let i=0;i<n;i++){let n=t[i]>>>4;e[r++]=n>9?n+ct:n+lt,n=t[i]&15,e[r++]=n>9?n+ct:n+lt}return String.fromCharCode.apply(null,e)}var dt=rt===null?e=>{if(typeof e==`string`)return it.encode(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error(`Invalid data type!`)}:e=>{if(typeof e==`string`){let t=rt.from(e,`utf8`);return new Uint8Array(t.buffer,t.byteOffset,t.length)}if(rt.isBuffer(e))return new Uint8Array(e.buffer,e.byteOffset,e.length);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error(`Invalid data type!`)},ft=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,pt=new Uint8Array(256);for(let e=0;e<64;e++)pt[ft.charCodeAt(e)]=e;function mt(e){let t=Math.floor(e.length*.75),n=e.length;return e[n-1]===`=`&&(--t,e[n-2]===`=`&&--t),t}function ht(e){let t=mt(e),n=e.length,r=new Uint8Array(t),i=0;for(let t=0;t<n;t+=4){let n=pt[e.charCodeAt(t)],a=pt[e.charCodeAt(t+1)],o=pt[e.charCodeAt(t+2)],s=pt[e.charCodeAt(t+3)];r[i]=n<<2|a>>4,i+=1,r[i]=(a&15)<<4|o>>2,i+=1,r[i]=(o&3)<<6|s&63,i+=1}return r}var gt=16*1024,_t=4,vt=new et,yt=new Map;function bt(e,t){return $e(this,void 0,void 0,function*(){let n=null,r=null,i=!1;if(typeof WebAssembly>`u`)throw Error(`WebAssembly is not supported in this environment!`);let a=(e,t=0)=>{r.set(e,t)},o=()=>r,s=()=>n.exports,c=e=>{n.exports.Hash_SetMemorySize(e);let t=n.exports.Hash_GetBuffer(),i=n.exports.memory.buffer;r=new Uint8Array(i,t,e)},l=()=>new DataView(n.exports.memory.buffer).getUint32(n.exports.STATE_SIZE,!0),u=vt.dispatch(()=>$e(this,void 0,void 0,function*(){if(!yt.has(e.name)){let t=ht(e.data),n=WebAssembly.compile(t);yt.set(e.name,n)}let t=yield yt.get(e.name);n=yield WebAssembly.instantiate(t,{})})),d=()=>$e(this,void 0,void 0,function*(){n||(yield u);let e=n.exports.Hash_GetBuffer(),t=n.exports.memory.buffer;r=new Uint8Array(t,e,gt)}),f=(e=null)=>{i=!0,n.exports.Hash_Init(e)},p=e=>{let t=0;for(;t<e.length;){let i=e.subarray(t,t+gt);t+=i.length,r.set(i),n.exports.Hash_Update(i.length)}},m=e=>{if(!i)throw Error(`update() called before init()`);p(dt(e))},h=new Uint8Array(t*2),g=(e,a=null)=>{if(!i)throw Error(`digest() called before init()`);return i=!1,n.exports.Hash_Final(a),e===`binary`?r.slice(0,t):ut(h,r,t)},_=()=>{if(!i)throw Error(`save() can only be called after init() and before digest()`);let t=n.exports.Hash_GetState(),r=l(),a=n.exports.memory.buffer,o=new Uint8Array(a,t,r),s=new Uint8Array(_t+r);return ot(s,e.hash),s.set(o,_t),s},v=t=>{if(!(t instanceof Uint8Array))throw Error(`load() expects an Uint8Array generated by save()`);let r=n.exports.Hash_GetState(),a=l(),o=_t+a,s=n.exports.memory.buffer;if(t.length!==o)throw Error(`Bad state length (expected ${o} bytes, got ${t.length})`);if(!st(e.hash,t.subarray(0,_t)))throw Error(`This state was written by an incompatible hash implementation`);let c=t.subarray(_t);new Uint8Array(s,r,a).set(c),i=!0},y=e=>typeof e==`string`?e.length<gt/4:e.byteLength<gt,b=y;switch(e.name){case`argon2`:case`scrypt`:b=()=>!0;break;case`blake2b`:case`blake2s`:b=(e,t)=>t<=512&&y(e);break;case`blake3`:b=(e,t)=>t===0&&y(e);break;case`xxhash64`:case`xxhash3`:case`xxhash128`:case`crc64`:b=()=>!1;break}return yield d(),{getMemory:o,writeMemory:a,getExports:s,setMemorySize:c,init:f,update:m,digest:g,save:_,load:v,calculate:(e,i=null,a=null)=>{if(!b(e,i))return f(i),m(e),g(`hex`,a);let o=dt(e);return r.set(o),n.exports.Hash_Calculate(o.length,i,a),ut(h,r,t)},hashLength:t}})}new et,new et,new et,new et,new et,new et,new et,new et,new et,new et,new et;var xt={name:`sha256`,data:`AGFzbQEAAAABEQRgAAF/YAF/AGAAAGACf38AAwgHAAEBAQIAAwUEAQECAgYOAn8BQfCJBQt/AEGACAsHcAgGbWVtb3J5AgAOSGFzaF9HZXRCdWZmZXIAAAlIYXNoX0luaXQAAQtIYXNoX1VwZGF0ZQACCkhhc2hfRmluYWwABA1IYXNoX0dldFN0YXRlAAUOSGFzaF9DYWxjdWxhdGUABgpTVEFURV9TSVpFAwEKnEoHBQBBgAkLnQEAQQBCADcDwIkBQQBBHEEgIABB4AFGIgAbNgLoiQFBAEKnn+anxvST/b5/Qquzj/yRo7Pw2wAgABs3A+CJAUEAQrGWgP6fooWs6ABC/6S5iMWR2oKbfyAAGzcD2IkBQQBCl7rDg5Onlod3QvLmu+Ojp/2npX8gABs3A9CJAUEAQti9loj8oLW+NkLnzKfQ1tDrs7t/IAAbNwPIiQEL7wICAX4Gf0EAQQApA8CJASIBIACtfDcDwIkBAkACQAJAIAGnQT9xIgINAEGACSEDDAELAkBBwAAgAmsiBCAAIAQgAEkbIgNFDQAgA0EDcSEFIAJBgIkBaiEGQQAhAgJAIANBBEkNACADQfwAcSEHQQAhAgNAIAYgAmoiAyACQYAJai0AADoAACADQQFqIAJBgQlqLQAAOgAAIANBAmogAkGCCWotAAA6AAAgA0EDaiACQYMJai0AADoAACAHIAJBBGoiAkcNAAsLIAVFDQADQCAGIAJqIAJBgAlqLQAAOgAAIAJBAWohAiAFQX9qIgUNAAsLIAAgBEkNAUGAiQEQAyAAIARrIQAgBEGACWohAwsCQCAAQcAASQ0AA0AgAxADIANBwABqIQMgAEFAaiIAQT9LDQALCyAARQ0AQQAhAkEAIQUDQCACQYCJAWogAyACai0AADoAACACQQFqIQIgACAFQQFqIgVB/wFxSw0ACwsLoz4BRX9BACAAKAI8IgFBGHQgAUGA/gNxQQh0ciABQQh2QYD+A3EgAUEYdnJyIgFBGXcgAUEOd3MgAUEDdnMgACgCOCICQRh0IAJBgP4DcUEIdHIgAkEIdkGA/gNxIAJBGHZyciICaiAAKAIgIgNBGHQgA0GA/gNxQQh0ciADQQh2QYD+A3EgA0EYdnJyIgRBGXcgBEEOd3MgBEEDdnMgACgCHCIDQRh0IANBgP4DcUEIdHIgA0EIdkGA/gNxIANBGHZyciIFaiAAKAIEIgNBGHQgA0GA/gNxQQh0ciADQQh2QYD+A3EgA0EYdnJyIgZBGXcgBkEOd3MgBkEDdnMgACgCACIDQRh0IANBgP4DcUEIdHIgA0EIdkGA/gNxIANBGHZyciIHaiAAKAIkIgNBGHQgA0GA/gNxQQh0ciADQQh2QYD+A3EgA0EYdnJyIghqIAJBD3cgAkENd3MgAkEKdnNqIgNqIAAoAhgiCUEYdCAJQYD+A3FBCHRyIAlBCHZBgP4DcSAJQRh2cnIiCkEZdyAKQQ53cyAKQQN2cyAAKAIUIglBGHQgCUGA/gNxQQh0ciAJQQh2QYD+A3EgCUEYdnJyIgtqIAJqIAAoAhAiCUEYdCAJQYD+A3FBCHRyIAlBCHZBgP4DcSAJQRh2cnIiDEEZdyAMQQ53cyAMQQN2cyAAKAIMIglBGHQgCUGA/gNxQQh0ciAJQQh2QYD+A3EgCUEYdnJyIg1qIAAoAjAiCUEYdCAJQYD+A3FBCHRyIAlBCHZBgP4DcSAJQRh2cnIiDmogACgCCCIJQRh0IAlBgP4DcUEIdHIgCUEIdkGA/gNxIAlBGHZyciIPQRl3IA9BDndzIA9BA3ZzIAZqIAAoAigiCUEYdCAJQYD+A3FBCHRyIAlBCHZBgP4DcSAJQRh2cnIiEGogAUEPdyABQQ13cyABQQp2c2oiCUEPdyAJQQ13cyAJQQp2c2oiEUEPdyARQQ13cyARQQp2c2oiEkEPdyASQQ13cyASQQp2c2oiE2ogACgCNCIUQRh0IBRBgP4DcUEIdHIgFEEIdkGA/gNxIBRBGHZyciIVQRl3IBVBDndzIBVBA3ZzIA5qIBJqIAAoAiwiAEEYdCAAQYD+A3FBCHRyIABBCHZBgP4DcSAAQRh2cnIiFkEZdyAWQQ53cyAWQQN2cyAQaiARaiAIQRl3IAhBDndzIAhBA3ZzIARqIAlqIAVBGXcgBUEOd3MgBUEDdnMgCmogAWogC0EZdyALQQ53cyALQQN2cyAMaiAVaiANQRl3IA1BDndzIA1BA3ZzIA9qIBZqIANBD3cgA0ENd3MgA0EKdnNqIhRBD3cgFEENd3MgFEEKdnNqIhdBD3cgF0ENd3MgF0EKdnNqIhhBD3cgGEENd3MgGEEKdnNqIhlBD3cgGUENd3MgGUEKdnNqIhpBD3cgGkENd3MgGkEKdnNqIhtBD3cgG0ENd3MgG0EKdnNqIhxBGXcgHEEOd3MgHEEDdnMgAkEZdyACQQ53cyACQQN2cyAVaiAYaiAOQRl3IA5BDndzIA5BA3ZzIBZqIBdqIBBBGXcgEEEOd3MgEEEDdnMgCGogFGogE0EPdyATQQ13cyATQQp2c2oiHUEPdyAdQQ13cyAdQQp2c2oiHkEPdyAeQQ13cyAeQQp2c2oiH2ogE0EZdyATQQ53cyATQQN2cyAYaiADQRl3IANBDndzIANBA3ZzIAFqIBlqIB9BD3cgH0ENd3MgH0EKdnNqIiBqIBJBGXcgEkEOd3MgEkEDdnMgF2ogH2ogEUEZdyARQQ53cyARQQN2cyAUaiAeaiAJQRl3IAlBDndzIAlBA3ZzIANqIB1qIBxBD3cgHEENd3MgHEEKdnNqIiFBD3cgIUENd3MgIUEKdnNqIiJBD3cgIkENd3MgIkEKdnNqIiNBD3cgI0ENd3MgI0EKdnNqIiRqIBtBGXcgG0EOd3MgG0EDdnMgHmogI2ogGkEZdyAaQQ53cyAaQQN2cyAdaiAiaiAZQRl3IBlBDndzIBlBA3ZzIBNqICFqIBhBGXcgGEEOd3MgGEEDdnMgEmogHGogF0EZdyAXQQ53cyAXQQN2cyARaiAbaiAUQRl3IBRBDndzIBRBA3ZzIAlqIBpqICBBD3cgIEENd3MgIEEKdnNqIiVBD3cgJUENd3MgJUEKdnNqIiZBD3cgJkENd3MgJkEKdnNqIidBD3cgJ0ENd3MgJ0EKdnNqIihBD3cgKEENd3MgKEEKdnNqIilBD3cgKUENd3MgKUEKdnNqIipBD3cgKkENd3MgKkEKdnNqIitBGXcgK0EOd3MgK0EDdnMgH0EZdyAfQQ53cyAfQQN2cyAbaiAnaiAeQRl3IB5BDndzIB5BA3ZzIBpqICZqIB1BGXcgHUEOd3MgHUEDdnMgGWogJWogJEEPdyAkQQ13cyAkQQp2c2oiLEEPdyAsQQ13cyAsQQp2c2oiLUEPdyAtQQ13cyAtQQp2c2oiLmogJEEZdyAkQQ53cyAkQQN2cyAnaiAgQRl3ICBBDndzICBBA3ZzIBxqIChqIC5BD3cgLkENd3MgLkEKdnNqIi9qICNBGXcgI0EOd3MgI0EDdnMgJmogLmogIkEZdyAiQQ53cyAiQQN2cyAlaiAtaiAhQRl3ICFBDndzICFBA3ZzICBqICxqICtBD3cgK0ENd3MgK0EKdnNqIjBBD3cgMEENd3MgMEEKdnNqIjFBD3cgMUENd3MgMUEKdnNqIjJBD3cgMkENd3MgMkEKdnNqIjNqICpBGXcgKkEOd3MgKkEDdnMgLWogMmogKUEZdyApQQ53cyApQQN2cyAsaiAxaiAoQRl3IChBDndzIChBA3ZzICRqIDBqICdBGXcgJ0EOd3MgJ0EDdnMgI2ogK2ogJkEZdyAmQQ53cyAmQQN2cyAiaiAqaiAlQRl3ICVBDndzICVBA3ZzICFqIClqIC9BD3cgL0ENd3MgL0EKdnNqIjRBD3cgNEENd3MgNEEKdnNqIjVBD3cgNUENd3MgNUEKdnNqIjZBD3cgNkENd3MgNkEKdnNqIjdBD3cgN0ENd3MgN0EKdnNqIjhBD3cgOEENd3MgOEEKdnNqIjlBD3cgOUENd3MgOUEKdnNqIjogOCA0IC4gLCAhIBsgGSADIA4gBEEAKALYiQEiO0EadyA7QRV3cyA7QQd3c0EAKALkiQEiPGpBACgC4IkBIj1BACgC3IkBIj5zIDtxID1zaiAHakGY36iUBGoiB0EAKALUiQEiP2oiACAMaiA7IA1qID4gD2ogPSAGaiAAID4gO3NxID5zaiAAQRp3IABBFXdzIABBB3dzakGRid2JB2oiQEEAKALQiQEiQWoiDCAAIDtzcSA7c2ogDEEadyAMQRV3cyAMQQd3c2pBz/eDrntqIkJBACgCzIkBIkNqIg0gDCAAc3EgAHNqIA1BGncgDUEVd3MgDUEHd3NqQaW3181+aiJEQQAoAsiJASIAaiIPIA0gDHNxIAxzaiAPQRp3IA9BFXdzIA9BB3dzakHbhNvKA2oiRSBBIEMgAHNxIEMgAHFzIABBHncgAEETd3MgAEEKd3NqIAdqIgZqIgdqIAUgD2ogCiANaiALIAxqIAcgDyANc3EgDXNqIAdBGncgB0EVd3MgB0EHd3NqQfGjxM8FaiIKIAYgAHMgQ3EgBiAAcXMgBkEedyAGQRN3cyAGQQp3c2ogQGoiDGoiBCAHIA9zcSAPc2ogBEEadyAEQRV3cyAEQQd3c2pBpIX+kXlqIgsgDCAGcyAAcSAMIAZxcyAMQR53IAxBE3dzIAxBCndzaiBCaiINaiIPIAQgB3NxIAdzaiAPQRp3IA9BFXdzIA9BB3dzakHVvfHYemoiQCANIAxzIAZxIA0gDHFzIA1BHncgDUETd3MgDUEKd3NqIERqIgZqIgcgDyAEc3EgBHNqIAdBGncgB0EVd3MgB0EHd3NqQZjVnsB9aiJCIAYgDXMgDHEgBiANcXMgBkEedyAGQRN3cyAGQQp3c2ogRWoiDGoiBWogFiAHaiAQIA9qIAggBGogBSAHIA9zcSAPc2ogBUEadyAFQRV3cyAFQQd3c2pBgbaNlAFqIgggDCAGcyANcSAMIAZxcyAMQR53IAxBE3dzIAxBCndzaiAKaiINaiIPIAUgB3NxIAdzaiAPQRp3IA9BFXdzIA9BB3dzakG+i8ahAmoiDiANIAxzIAZxIA0gDHFzIA1BHncgDUETd3MgDUEKd3NqIAtqIgZqIgcgDyAFc3EgBXNqIAdBGncgB0EVd3MgB0EHd3NqQcP7sagFaiIQIAYgDXMgDHEgBiANcXMgBkEedyAGQRN3cyAGQQp3c2ogQGoiDGoiBCAHIA9zcSAPc2ogBEEadyAEQRV3cyAEQQd3c2pB9Lr5lQdqIhYgDCAGcyANcSAMIAZxcyAMQR53IAxBE3dzIAxBCndzaiBCaiINaiIFaiABIARqIAIgB2ogFSAPaiAFIAQgB3NxIAdzaiAFQRp3IAVBFXdzIAVBB3dzakH+4/qGeGoiByANIAxzIAZxIA0gDHFzIA1BHncgDUETd3MgDUEKd3NqIAhqIgFqIgYgBSAEc3EgBHNqIAZBGncgBkEVd3MgBkEHd3NqQaeN8N55aiIEIAEgDXMgDHEgASANcXMgAUEedyABQRN3cyABQQp3c2ogDmoiAmoiDCAGIAVzcSAFc2ogDEEadyAMQRV3cyAMQQd3c2pB9OLvjHxqIgUgAiABcyANcSACIAFxcyACQR53IAJBE3dzIAJBCndzaiAQaiIDaiINIAwgBnNxIAZzaiANQRp3IA1BFXdzIA1BB3dzakHB0+2kfmoiCCADIAJzIAFxIAMgAnFzIANBHncgA0ETd3MgA0EKd3NqIBZqIgFqIg8gF2ogESANaiAUIAxqIAkgBmogDyANIAxzcSAMc2ogD0EadyAPQRV3cyAPQQd3c2pBho/5/X5qIgYgASADcyACcSABIANxcyABQR53IAFBE3dzIAFBCndzaiAHaiICaiIJIA8gDXNxIA1zaiAJQRp3IAlBFXdzIAlBB3dzakHGu4b+AGoiDCACIAFzIANxIAIgAXFzIAJBHncgAkETd3MgAkEKd3NqIARqIgNqIhEgCSAPc3EgD3NqIBFBGncgEUEVd3MgEUEHd3NqQczDsqACaiINIAMgAnMgAXEgAyACcXMgA0EedyADQRN3cyADQQp3c2ogBWoiAWoiFCARIAlzcSAJc2ogFEEadyAUQRV3cyAUQQd3c2pB79ik7wJqIg8gASADcyACcSABIANxcyABQR53IAFBE3dzIAFBCndzaiAIaiICaiIXaiATIBRqIBggEWogEiAJaiAXIBQgEXNxIBFzaiAXQRp3IBdBFXdzIBdBB3dzakGqidLTBGoiGCACIAFzIANxIAIgAXFzIAJBHncgAkETd3MgAkEKd3NqIAZqIgNqIgkgFyAUc3EgFHNqIAlBGncgCUEVd3MgCUEHd3NqQdzTwuUFaiIUIAMgAnMgAXEgAyACcXMgA0EedyADQRN3cyADQQp3c2ogDGoiAWoiESAJIBdzcSAXc2ogEUEadyARQRV3cyARQQd3c2pB2pHmtwdqIhcgASADcyACcSABIANxcyABQR53IAFBE3dzIAFBCndzaiANaiICaiISIBEgCXNxIAlzaiASQRp3IBJBFXdzIBJBB3dzakHSovnBeWoiGSACIAFzIANxIAIgAXFzIAJBHncgAkETd3MgAkEKd3NqIA9qIgNqIhNqIB4gEmogGiARaiAdIAlqIBMgEiARc3EgEXNqIBNBGncgE0EVd3MgE0EHd3NqQe2Mx8F6aiIaIAMgAnMgAXEgAyACcXMgA0EedyADQRN3cyADQQp3c2ogGGoiAWoiCSATIBJzcSASc2ogCUEadyAJQRV3cyAJQQd3c2pByM+MgHtqIhggASADcyACcSABIANxcyABQR53IAFBE3dzIAFBCndzaiAUaiICaiIRIAkgE3NxIBNzaiARQRp3IBFBFXdzIBFBB3dzakHH/+X6e2oiFCACIAFzIANxIAIgAXFzIAJBHncgAkETd3MgAkEKd3NqIBdqIgNqIhIgESAJc3EgCXNqIBJBGncgEkEVd3MgEkEHd3NqQfOXgLd8aiIXIAMgAnMgAXEgAyACcXMgA0EedyADQRN3cyADQQp3c2ogGWoiAWoiE2ogICASaiAcIBFqIB8gCWogEyASIBFzcSARc2ogE0EadyATQRV3cyATQQd3c2pBx6KerX1qIhkgASADcyACcSABIANxcyABQR53IAFBE3dzIAFBCndzaiAaaiICaiIJIBMgEnNxIBJzaiAJQRp3IAlBFXdzIAlBB3dzakHRxqk2aiIaIAIgAXMgA3EgAiABcXMgAkEedyACQRN3cyACQQp3c2ogGGoiA2oiESAJIBNzcSATc2ogEUEadyARQRV3cyARQQd3c2pB59KkoQFqIhggAyACcyABcSADIAJxcyADQR53IANBE3dzIANBCndzaiAUaiIBaiISIBEgCXNxIAlzaiASQRp3IBJBFXdzIBJBB3dzakGFldy9AmoiFCABIANzIAJxIAEgA3FzIAFBHncgAUETd3MgAUEKd3NqIBdqIgJqIhMgI2ogJiASaiAiIBFqICUgCWogEyASIBFzcSARc2ogE0EadyATQRV3cyATQQd3c2pBuMLs8AJqIhcgAiABcyADcSACIAFxcyACQR53IAJBE3dzIAJBCndzaiAZaiIDaiIJIBMgEnNxIBJzaiAJQRp3IAlBFXdzIAlBB3dzakH827HpBGoiGSADIAJzIAFxIAMgAnFzIANBHncgA0ETd3MgA0EKd3NqIBpqIgFqIhEgCSATc3EgE3NqIBFBGncgEUEVd3MgEUEHd3NqQZOa4JkFaiIaIAEgA3MgAnEgASADcXMgAUEedyABQRN3cyABQQp3c2ogGGoiAmoiEiARIAlzcSAJc2ogEkEadyASQRV3cyASQQd3c2pB1OapqAZqIhggAiABcyADcSACIAFxcyACQR53IAJBE3dzIAJBCndzaiAUaiIDaiITaiAoIBJqICQgEWogJyAJaiATIBIgEXNxIBFzaiATQRp3IBNBFXdzIBNBB3dzakG7laizB2oiFCADIAJzIAFxIAMgAnFzIANBHncgA0ETd3MgA0EKd3NqIBdqIgFqIgkgEyASc3EgEnNqIAlBGncgCUEVd3MgCUEHd3NqQa6Si454aiIXIAEgA3MgAnEgASADcXMgAUEedyABQRN3cyABQQp3c2ogGWoiAmoiESAJIBNzcSATc2ogEUEadyARQRV3cyARQQd3c2pBhdnIk3lqIhkgAiABcyADcSACIAFxcyACQR53IAJBE3dzIAJBCndzaiAaaiIDaiISIBEgCXNxIAlzaiASQRp3IBJBFXdzIBJBB3dzakGh0f+VemoiGiADIAJzIAFxIAMgAnFzIANBHncgA0ETd3MgA0EKd3NqIBhqIgFqIhNqICogEmogLSARaiApIAlqIBMgEiARc3EgEXNqIBNBGncgE0EVd3MgE0EHd3NqQcvM6cB6aiIYIAEgA3MgAnEgASADcXMgAUEedyABQRN3cyABQQp3c2ogFGoiAmoiCSATIBJzcSASc2ogCUEadyAJQRV3cyAJQQd3c2pB8JauknxqIhQgAiABcyADcSACIAFxcyACQR53IAJBE3dzIAJBCndzaiAXaiIDaiIRIAkgE3NxIBNzaiARQRp3IBFBFXdzIBFBB3dzakGjo7G7fGoiFyADIAJzIAFxIAMgAnFzIANBHncgA0ETd3MgA0EKd3NqIBlqIgFqIhIgESAJc3EgCXNqIBJBGncgEkEVd3MgEkEHd3NqQZnQy4x9aiIZIAEgA3MgAnEgASADcXMgAUEedyABQRN3cyABQQp3c2ogGmoiAmoiE2ogMCASaiAvIBFqICsgCWogEyASIBFzcSARc2ogE0EadyATQRV3cyATQQd3c2pBpIzktH1qIhogAiABcyADcSACIAFxcyACQR53IAJBE3dzIAJBCndzaiAYaiIDaiIJIBMgEnNxIBJzaiAJQRp3IAlBFXdzIAlBB3dzakGF67igf2oiGCADIAJzIAFxIAMgAnFzIANBHncgA0ETd3MgA0EKd3NqIBRqIgFqIhEgCSATc3EgE3NqIBFBGncgEUEVd3MgEUEHd3NqQfDAqoMBaiIUIAEgA3MgAnEgASADcXMgAUEedyABQRN3cyABQQp3c2ogF2oiAmoiEiARIAlzcSAJc2ogEkEadyASQRV3cyASQQd3c2pBloKTzQFqIhcgAiABcyADcSACIAFxcyACQR53IAJBE3dzIAJBCndzaiAZaiIDaiITIDZqIDIgEmogNSARaiAxIAlqIBMgEiARc3EgEXNqIBNBGncgE0EVd3MgE0EHd3NqQYjY3fEBaiIZIAMgAnMgAXEgAyACcXMgA0EedyADQRN3cyADQQp3c2ogGmoiAWoiCSATIBJzcSASc2ogCUEadyAJQRV3cyAJQQd3c2pBzO6hugJqIhogASADcyACcSABIANxcyABQR53IAFBE3dzIAFBCndzaiAYaiICaiIRIAkgE3NxIBNzaiARQRp3IBFBFXdzIBFBB3dzakG1+cKlA2oiGCACIAFzIANxIAIgAXFzIAJBHncgAkETd3MgAkEKd3NqIBRqIgNqIhIgESAJc3EgCXNqIBJBGncgEkEVd3MgEkEHd3NqQbOZ8MgDaiIUIAMgAnMgAXEgAyACcXMgA0EedyADQRN3cyADQQp3c2ogF2oiAWoiE2ogLEEZdyAsQQ53cyAsQQN2cyAoaiA0aiAzQQ93IDNBDXdzIDNBCnZzaiIXIBJqIDcgEWogMyAJaiATIBIgEXNxIBFzaiATQRp3IBNBFXdzIBNBB3dzakHK1OL2BGoiGyABIANzIAJxIAEgA3FzIAFBHncgAUETd3MgAUEKd3NqIBlqIgJqIgkgEyASc3EgEnNqIAlBGncgCUEVd3MgCUEHd3NqQc+U89wFaiIZIAIgAXMgA3EgAiABcXMgAkEedyACQRN3cyACQQp3c2ogGmoiA2oiESAJIBNzcSATc2ogEUEadyARQRV3cyARQQd3c2pB89+5wQZqIhogAyACcyABcSADIAJxcyADQR53IANBE3dzIANBCndzaiAYaiIBaiISIBEgCXNxIAlzaiASQRp3IBJBFXdzIBJBB3dzakHuhb6kB2oiHCABIANzIAJxIAEgA3FzIAFBHncgAUETd3MgAUEKd3NqIBRqIgJqIhNqIC5BGXcgLkEOd3MgLkEDdnMgKmogNmogLUEZdyAtQQ53cyAtQQN2cyApaiA1aiAXQQ93IBdBDXdzIBdBCnZzaiIUQQ93IBRBDXdzIBRBCnZzaiIYIBJqIDkgEWogFCAJaiATIBIgEXNxIBFzaiATQRp3IBNBFXdzIBNBB3dzakHvxpXFB2oiCSACIAFzIANxIAIgAXFzIAJBHncgAkETd3MgAkEKd3NqIBtqIgNqIhEgEyASc3EgEnNqIBFBGncgEUEVd3MgEUEHd3NqQZTwoaZ4aiIbIAMgAnMgAXEgAyACcXMgA0EedyADQRN3cyADQQp3c2ogGWoiAWoiEiARIBNzcSATc2ogEkEadyASQRV3cyASQQd3c2pBiISc5nhqIhkgASADcyACcSABIANxcyABQR53IAFBE3dzIAFBCndzaiAaaiICaiITIBIgEXNxIBFzaiATQRp3IBNBFXdzIBNBB3dzakH6//uFeWoiGiACIAFzIANxIAIgAXFzIAJBHncgAkETd3MgAkEKd3NqIBxqIgNqIhQgPGo2AuSJAUEAID8gAyACcyABcSADIAJxcyADQR53IANBE3dzIANBCndzaiAJaiIBIANzIAJxIAEgA3FzIAFBHncgAUETd3MgAUEKd3NqIBtqIgIgAXMgA3EgAiABcXMgAkEedyACQRN3cyACQQp3c2ogGWoiAyACcyABcSADIAJxcyADQR53IANBE3dzIANBCndzaiAaaiIJajYC1IkBQQAgPSAvQRl3IC9BDndzIC9BA3ZzICtqIDdqIBhBD3cgGEENd3MgGEEKdnNqIhggEWogFCATIBJzcSASc2ogFEEadyAUQRV3cyAUQQd3c2pB69nBonpqIhkgAWoiEWo2AuCJAUEAIEEgCSADcyACcSAJIANxcyAJQR53IAlBE3dzIAlBCndzaiAZaiIBajYC0IkBQQAgPiAwQRl3IDBBDndzIDBBA3ZzIC9qIBdqIDpBD3cgOkENd3MgOkEKdnNqIBJqIBEgFCATc3EgE3NqIBFBGncgEUEVd3MgEUEHd3NqQffH5vd7aiIXIAJqIhJqNgLciQFBACBDIAEgCXMgA3EgASAJcXMgAUEedyABQRN3cyABQQp3c2ogF2oiAmo2AsyJAUEAIDsgNEEZdyA0QQ53cyA0QQN2cyAwaiA4aiAYQQ93IBhBDXdzIBhBCnZzaiATaiASIBEgFHNxIBRzaiASQRp3IBJBFXdzIBJBB3dzakHy8cWzfGoiESADamo2AtiJAUEAIAAgAiABcyAJcSACIAFxcyACQR53IAJBE3dzIAJBCndzaiARamo2AsiJAQuyBgIEfwF+QQAoAsCJASIAQQJ2QQ9xIgFBAnRBgIkBaiICIAIoAgBBfyAAQQN0IgB0QX9zcUGAASAAdHM2AgACQAJAAkAgAUEOSQ0AAkAgAUEORw0AQQBBADYCvIkBC0GAiQEQA0EAIQIMAQsgAUENRg0BIAFBAWohAgsgAiEDAkBBBiACa0EHcSIARQ0AIAIgAGohAyACQQJ0QYCJAWohAQNAIAFBADYCACABQQRqIQEgAEF/aiIADQALCyACQXlqQQdJDQAgA0ECdCEBA0AgAUGYiQFqQgA3AgAgAUGQiQFqQgA3AgAgAUGIiQFqQgA3AgAgAUGAiQFqQgA3AgAgAUEgaiIBQThHDQALC0EAIQFBAEEAKQPAiQEiBKciAEEbdCAAQQt0QYCA/AdxciAAQQV2QYD+A3EgAEEDdEEYdnJyNgK8iQFBACAEQh2IpyIAQRh0IABBgP4DcUEIdHIgAEEIdkGA/gNxIABBGHZycjYCuIkBQYCJARADQQBBACgC5IkBIgBBGHQgAEGA/gNxQQh0ciAAQQh2QYD+A3EgAEEYdnJyNgLkiQFBAEEAKALgiQEiAEEYdCAAQYD+A3FBCHRyIABBCHZBgP4DcSAAQRh2cnI2AuCJAUEAQQAoAtyJASIAQRh0IABBgP4DcUEIdHIgAEEIdkGA/gNxIABBGHZycjYC3IkBQQBBACgC2IkBIgBBGHQgAEGA/gNxQQh0ciAAQQh2QYD+A3EgAEEYdnJyNgLYiQFBAEEAKALUiQEiAEEYdCAAQYD+A3FBCHRyIABBCHZBgP4DcSAAQRh2cnI2AtSJAUEAQQAoAtCJASIAQRh0IABBgP4DcUEIdHIgAEEIdkGA/gNxIABBGHZycjYC0IkBQQBBACgCzIkBIgBBGHQgAEGA/gNxQQh0ciAAQQh2QYD+A3EgAEEYdnJyNgLMiQFBAEEAKALIiQEiAEEYdCAAQYD+A3FBCHRyIABBCHZBgP4DcSAAQRh2cnI2AsiJAQJAQQAoAuiJASICRQ0AQQAhAANAIAFBgAlqIAFByIkBai0AADoAACABQQFqIQEgAiAAQQFqIgBB/wFxSw0ACwsLBgBBgIkBC6MBAEEAQgA3A8CJAUEAQRxBICABQeABRiIBGzYC6IkBQQBCp5/mp8b0k/2+f0Krs4/8kaOz8NsAIAEbNwPgiQFBAEKxloD+n6KFrOgAQv+kuYjFkdqCm38gARs3A9iJAUEAQpe6w4OTp5aHd0Ly5rvjo6f9p6V/IAEbNwPQiQFBAELYvZaI/KC1vjZC58yn0NbQ67O7fyABGzcDyIkBIAAQAhAECwsLAQBBgAgLBHAAAAA=`,hash:`8c18dd94`};new et,new et;function St(){return bt(xt,32).then(e=>{e.init(256);let t={init:()=>(e.init(256),t),update:n=>(e.update(n),t),digest:t=>e.digest(t),save:()=>e.save(),load:n=>(e.load(n),t),blockSize:64,digestSize:32};return t})}new et,new et,new et,new et,new et,new et,new et,new et,new et;var Ct=`pi-forge/auth-token`,wt=`pi-forge/auth-expires-at`,Tt=`pi-forge/auth-must-change-password`;function Et(){let e=localStorage.getItem(Ct),t=localStorage.getItem(wt);if(!(!e||!t)){if(new Date(t).getTime()<=Date.now()){Ot();return}return{token:e,expiresAt:t,mustChangePassword:localStorage.getItem(Tt)===`true`}}}function Dt(e){localStorage.setItem(Ct,e.token),localStorage.setItem(wt,e.expiresAt),localStorage.setItem(Tt,e.mustChangePassword?`true`:`false`)}function Ot(){localStorage.removeItem(Ct),localStorage.removeItem(wt),localStorage.removeItem(Tt)}var kt=`pi-forge:unauthorized`,M=class extends Error{status;code;constructor(e,t,n){super(n??`${e} ${t}`),this.status=e,this.code=t}};function At(e){let t=()=>e();return window.addEventListener(kt,t),()=>window.removeEventListener(kt,t)}function N(e,t){throw new M(e,`invalid_response_body`,t)}function P(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var jt=(e,t)=>{e!==void 0&&N(t,`expected empty body`)};function Mt(e,t){return(!P(e)||typeof e.authEnabled!=`boolean`)&&N(t,`expected { authEnabled: boolean }`),{authEnabled:e.authEnabled}}function Nt(e,t){return(!P(e)||typeof e.token!=`string`||typeof e.expiresAt!=`string`||typeof e.mustChangePassword!=`boolean`)&&N(t,`expected { token, expiresAt, mustChangePassword }`),{token:e.token,expiresAt:e.expiresAt,mustChangePassword:e.mustChangePassword}}function Pt(e,t){return Nt(e,t)}function Ft(e,t){(!P(e)||typeof e.minimal!=`boolean`||typeof e.workspaceRoot!=`string`)&&N(t,`expected { minimal: boolean, workspaceRoot: string }`);let n=typeof e.version==`string`?e.version:`unknown`,r=typeof e.passwordAuthEnabled==`boolean`?e.passwordAuthEnabled:!0;return{minimal:e.minimal,workspaceRoot:e.workspaceRoot,version:n,passwordAuthEnabled:r}}function It(e,t){return(!P(e)||e.status!==`ok`||typeof e.activeSessions!=`number`||typeof e.activePtys!=`number`)&&N(t,`expected { status: 'ok', activeSessions, activePtys }`),{status:`ok`,activeSessions:e.activeSessions,activePtys:e.activePtys}}function Lt(e,t){return(!P(e)||typeof e.id!=`string`||typeof e.name!=`string`||typeof e.path!=`string`||typeof e.createdAt!=`string`)&&N(t,`expected Project`),{id:e.id,name:e.name,path:e.path,createdAt:e.createdAt}}function Rt(e,t){return(!P(e)||!Array.isArray(e.projects))&&N(t,`expected { projects: Project[] }`),{projects:e.projects.map(e=>Lt(e,t))}}function zt(e,t){return(!P(e)||typeof e.name!=`string`||typeof e.path!=`string`||typeof e.isGitRepo!=`boolean`)&&N(t,`expected BrowseEntry`),{name:e.name,path:e.path,isGitRepo:e.isGitRepo}}function Bt(e,t){return(!P(e)||typeof e.path!=`string`||!(e.parentPath===null||e.parentPath===void 0||typeof e.parentPath==`string`)||!Array.isArray(e.entries))&&N(t,`expected BrowseResponse`),{path:e.path,parentPath:typeof e.parentPath==`string`?e.parentPath:null,entries:e.entries.map(e=>zt(e,t))}}function Vt(e,t){return(!P(e)||typeof e.path!=`string`)&&N(t,`expected { path }`),{path:e.path}}function Ht(e,t){(!P(e)||typeof e.sessionId!=`string`||typeof e.projectId!=`string`||typeof e.isLive!=`boolean`||typeof e.workspacePath!=`string`||typeof e.lastActivityAt!=`string`||typeof e.createdAt!=`string`||typeof e.messageCount!=`number`||typeof e.firstMessage!=`string`)&&N(t,`expected UnifiedSession`);let n={sessionId:e.sessionId,projectId:e.projectId,isLive:e.isLive,workspacePath:e.workspacePath,lastActivityAt:e.lastActivityAt,createdAt:e.createdAt,messageCount:e.messageCount,firstMessage:e.firstMessage};return typeof e.name==`string`&&(n.name=e.name),typeof e.parentSessionId==`string`&&(n.parentSessionId=e.parentSessionId),typeof e.runId==`string`&&(n.runId=e.runId),typeof e.path==`string`&&(n.path=e.path),n}function Ut(e,t){return(!P(e)||!Array.isArray(e.sessions))&&N(t,`expected { sessions: UnifiedSession[] }`),{sessions:e.sessions.map(e=>Ht(e,t))}}function Wt(e,t){(!P(e)||typeof e.sessionId!=`string`||typeof e.projectId!=`string`||typeof e.workspacePath!=`string`||typeof e.createdAt!=`string`||typeof e.lastActivityAt!=`string`||typeof e.isLive!=`boolean`||typeof e.messageCount!=`number`||typeof e.isStreaming!=`boolean`)&&N(t,`expected SessionSummary`);let n={sessionId:e.sessionId,projectId:e.projectId,workspacePath:e.workspacePath,createdAt:e.createdAt,lastActivityAt:e.lastActivityAt,isLive:e.isLive,messageCount:e.messageCount,isStreaming:e.isStreaming};return typeof e.name==`string`&&(n.name=e.name),n}function Gt(e,t){return(!P(e)||e.accepted!==!0)&&N(t,`expected { accepted: true }`),{accepted:!0}}function Kt(e,t){(!P(e)||typeof e.name!=`string`||typeof e.description!=`string`||e.source!==`global`&&e.source!==`project`&&e.source!==`extension`||typeof e.filePath!=`string`||typeof e.enabled!=`boolean`||typeof e.effective!=`boolean`||typeof e.disableModelInvocation!=`boolean`)&&N(t,`expected SkillSummary`);let n={name:e.name,description:e.description,source:e.source,filePath:e.filePath,enabled:e.enabled,effective:e.effective,disableModelInvocation:e.disableModelInvocation};return typeof e.extensionPath==`string`&&(n.extensionPath=e.extensionPath),(e.projectOverride===`enabled`||e.projectOverride===`disabled`)&&(n.projectOverride=e.projectOverride),n}function qt(e,t){return(!P(e)||!Array.isArray(e.skills))&&N(t,`expected { skills: SkillSummary[] }`),{skills:e.skills.map(e=>Kt(e,t))}}function Jt(e,t){(!P(e)||!Array.isArray(e.skills)||!Array.isArray(e.diagnostics))&&N(t,`expected { skills: SkillSummary[], diagnostics: SkillDiagnostic[] }`);let n=[];for(let t of e.diagnostics){if(!P(t)||t.type!==`warning`&&t.type!==`error`&&t.type!==`collision`||typeof t.message!=`string`)continue;let e={type:t.type,message:t.message};typeof t.path==`string`&&(e.path=t.path),P(t.collision)&&typeof t.collision.resourceType==`string`&&typeof t.collision.name==`string`&&typeof t.collision.winnerPath==`string`&&typeof t.collision.loserPath==`string`&&(e.collision={resourceType:t.collision.resourceType,name:t.collision.name,winnerPath:t.collision.winnerPath,loserPath:t.collision.loserPath}),n.push(e)}return{skills:e.skills.map(e=>Kt(e,t)),diagnostics:n}}function Yt(e,t){(!P(e)||!P(e.projects))&&N(t,`expected { projects: { ... } }`);let n={};for(let[t,r]of Object.entries(e.projects))P(r)&&(n[t]={enable:Array.isArray(r.enable)?r.enable.filter(e=>typeof e==`string`):[],disable:Array.isArray(r.disable)?r.disable.filter(e=>typeof e==`string`):[]});return{projects:n}}function Xt(e,t){return(!P(e)||!Array.isArray(e.providers))&&N(t,`expected { providers: [...] }`),{providers:e.providers}}function Zt(e,t){return(!P(e)||!P(e.servers)||!Array.isArray(e.status))&&N(t,`expected { servers, status[] }`),e}function Qt(e,t){return(!P(e)||typeof e.enabled!=`boolean`||typeof e.connected!=`number`||typeof e.total!=`number`)&&N(t,`expected { enabled, connected, total }`),{enabled:e.enabled,connected:e.connected,total:e.total}}function $t(e,t){return(!P(e)||!P(e.status))&&N(t,`expected { status: {...} }`),{status:e.status}}function en(e,t){return(!P(e)||!Array.isArray(e.tools))&&N(t,`expected { tools: [...] }`),{tools:e.tools}}function tn(e,t){return(!P(e)||e.ok!==!0)&&N(t,`expected { ok: true }`),{ok:!0}}function nn(e,t){return(!P(e)||typeof e.removed!=`boolean`)&&N(t,`expected { removed: boolean }`),{removed:e.removed}}function rn(e,t){return(!P(e)||!P(e.providers))&&N(t,`expected { providers: { ... } }`),e}function an(e,t){return P(e)||N(t,`expected settings object`),e}function on(e,t){return(!P(e)||!P(e.providers))&&N(t,`expected { providers: {...} }`),e}function sn(e,t){P(e)||N(t,`expected FileTreeNode`);let n=e.type;(typeof e.name!=`string`||typeof e.path!=`string`||n!==`file`&&n!==`directory`)&&N(t,`expected FileTreeNode`);let r={name:e.name,path:e.path,type:n};return Array.isArray(e.children)&&(r.children=e.children.map(e=>sn(e,t))),typeof e.truncated==`boolean`&&(r.truncated=e.truncated),r}function cn(e,t){return(!P(e)||typeof e.path!=`string`||typeof e.content!=`string`||typeof e.size!=`number`||typeof e.language!=`string`||typeof e.binary!=`boolean`)&&N(t,`expected FileReadResponse`),{path:e.path,content:e.content,size:e.size,language:e.language,binary:e.binary}}function ln(e,t){return(!P(e)||!Array.isArray(e.entries))&&N(t,`expected { entries: TurnDiffEntry[] }`),{entries:e.entries.map(e=>((!P(e)||typeof e.file!=`string`||e.tool!==`write`&&e.tool!==`edit`||typeof e.diff!=`string`||typeof e.additions!=`number`||typeof e.deletions!=`number`||typeof e.isPureAddition!=`boolean`)&&N(t,`expected TurnDiffEntry`),{file:e.file,tool:e.tool,diff:e.diff,additions:e.additions,deletions:e.deletions,isPureAddition:e.isPureAddition}))}}function un(e,t){(!P(e)||typeof e.isGitRepo!=`boolean`||!Array.isArray(e.files))&&N(t,`expected GitStatus`);let n={isGitRepo:e.isGitRepo,files:e.files.map(e=>{(!P(e)||typeof e.path!=`string`||typeof e.staged!=`boolean`||typeof e.unstaged!=`boolean`||typeof e.kind!=`string`||typeof e.code!=`string`)&&N(t,`expected GitFileStatus`);let n={path:e.path,staged:e.staged,unstaged:e.unstaged,kind:e.kind,code:e.code};return typeof e.originalPath==`string`&&(n.originalPath=e.originalPath),n})};return typeof e.branch==`string`&&(n.branch=e.branch),n}function dn(e,t){return(!P(e)||typeof e.isGitRepo!=`boolean`||typeof e.diff!=`string`)&&N(t,`expected GitDiffResponse`),{isGitRepo:e.isGitRepo,diff:e.diff}}function fn(e,t){return(!P(e)||typeof e.isGitRepo!=`boolean`||!Array.isArray(e.commits))&&N(t,`expected GitLogResponse`),{isGitRepo:e.isGitRepo,commits:e.commits.map(e=>((!P(e)||typeof e.hash!=`string`||typeof e.message!=`string`||typeof e.author!=`string`||typeof e.date!=`string`||!Array.isArray(e.parents)||!Array.isArray(e.refs))&&N(t,`expected GitLogEntry`),{hash:e.hash,message:e.message,author:e.author,date:e.date,parents:e.parents.filter(e=>typeof e==`string`),refs:e.refs.filter(e=>typeof e==`string`)}))}}function pn(e,t){(!P(e)||typeof e.isGitRepo!=`boolean`||!Array.isArray(e.branches))&&N(t,`expected GitBranchesResponse`);let n={isGitRepo:e.isGitRepo,branches:e.branches.map(e=>((!P(e)||typeof e.name!=`string`||typeof e.current!=`boolean`||typeof e.remote!=`boolean`)&&N(t,`expected GitBranch`),{name:e.name,current:e.current,remote:e.remote}))};return typeof e.current==`string`&&(n.current=e.current),n}function mn(e,t){(!P(e)||!Array.isArray(e.messages)||typeof e.totalInputTokens!=`number`||typeof e.totalOutputTokens!=`number`||typeof e.totalCacheReadTokens!=`number`||typeof e.totalCacheWriteTokens!=`number`||typeof e.totalTokens!=`number`||typeof e.totalCost!=`number`||!Array.isArray(e.turns)||!P(e.contextUsage))&&N(t,`expected SessionContextResponse`);let n=e.turns.map(e=>{(!P(e)||typeof e.index!=`number`||typeof e.inputTokens!=`number`||typeof e.outputTokens!=`number`||typeof e.cacheReadTokens!=`number`||typeof e.cacheWriteTokens!=`number`||typeof e.totalTokens!=`number`||typeof e.cost!=`number`||typeof e.model!=`string`||typeof e.provider!=`string`||typeof e.timestamp!=`number`)&&N(t,`expected ContextTurn`);let n={index:e.index,inputTokens:e.inputTokens,outputTokens:e.outputTokens,cacheReadTokens:e.cacheReadTokens,cacheWriteTokens:e.cacheWriteTokens,totalTokens:e.totalTokens,cost:e.cost,model:e.model,provider:e.provider,timestamp:e.timestamp};return typeof e.stopReason==`string`&&(n.stopReason=e.stopReason),n}),r=e.contextUsage,i={contextWindow:typeof r.contextWindow==`number`?r.contextWindow:0};return typeof r.tokens==`number`&&(i.tokens=r.tokens),typeof r.percent==`number`&&(i.percent=r.percent),{messages:e.messages.filter(e=>P(e)),totalInputTokens:e.totalInputTokens,totalOutputTokens:e.totalOutputTokens,totalCacheReadTokens:e.totalCacheReadTokens,totalCacheWriteTokens:e.totalCacheWriteTokens,totalTokens:e.totalTokens,totalCost:e.totalCost,turns:n,contextUsage:i}}function hn(e,t){(!P(e)||!(e.leafId===null||typeof e.leafId==`string`)||!Array.isArray(e.branchIds)||!Array.isArray(e.entries))&&N(t,`expected SessionTreeResponse`);let n=e.branchIds.filter(e=>typeof e==`string`),r=e.entries.map(e=>{(!P(e)||typeof e.id!=`string`||!(e.parentId===null||typeof e.parentId==`string`)||typeof e.type!=`string`||typeof e.timestamp!=`string`)&&N(t,`expected SessionTreeEntry`);let n={id:e.id,parentId:e.parentId,type:e.type,timestamp:e.timestamp};return typeof e.role==`string`&&(n.role=e.role),typeof e.preview==`string`&&(n.preview=e.preview),typeof e.label==`string`&&(n.label=e.label),n});return{leafId:e.leafId,branchIds:n,entries:r}}function gn(e,t){return(!P(e)||!Array.isArray(e.files))&&N(t,`expected { files: UploadedFile[] }`),{files:e.files.map(e=>((!P(e)||typeof e.path!=`string`||typeof e.size!=`number`||typeof e.sha256!=`string`)&&N(t,`expected UploadedFile`),{path:e.path,size:e.size,sha256:e.sha256}))}}function _n(e,t){return(!P(e)||e.engine!==`ripgrep`&&e.engine!==`node`||typeof e.truncated!=`boolean`||!Array.isArray(e.matches))&&N(t,`expected SearchResponse`),{engine:e.engine,truncated:e.truncated,matches:e.matches.map(e=>((!P(e)||typeof e.path!=`string`||typeof e.line!=`number`||typeof e.column!=`number`||typeof e.length!=`number`||typeof e.lineSnippet!=`string`)&&N(t,`expected SearchMatch`),{path:e.path,line:e.line,column:e.column,length:e.length,lineSnippet:e.lineSnippet}))}}function vn(e,t){return(!P(e)||typeof e.isGitRepo!=`boolean`||!Array.isArray(e.remotes))&&N(t,`expected GitRemotesResponse`),{isGitRepo:e.isGitRepo,remotes:e.remotes.map(e=>((!P(e)||typeof e.name!=`string`||typeof e.fetchUrl!=`string`||typeof e.pushUrl!=`string`)&&N(t,`expected GitRemote`),{name:e.name,fetchUrl:e.fetchUrl,pushUrl:e.pushUrl}))}}function yn(e,t){return(!P(e)||typeof e.path!=`string`)&&N(t,`expected { path: string }`),{path:e.path}}async function bn(e,t){let n=await St();n.init();let r=e.stream().getReader(),i=!1;try{for(;;){let{value:e,done:i}=await r.read();if(i)break;n.update(e),t?.(e.byteLength)}}catch(e){throw i=!0,await r.cancel().catch(()=>void 0),e}finally{i||r.releaseLock()}return n.digest(`hex`)}function xn(e){let t=/filename\*=UTF-8''([^;\r\n]+)/i.exec(e);if(t!==null)try{return decodeURIComponent(t[1])}catch{}let n=/filename="([^"]+)"/i.exec(e)??/filename=([^;\r\n]+)/i.exec(e);if(n!==null)return n[1]}function Sn(e){if(e===``)return{ok:!0,value:void 0};try{return{ok:!0,value:JSON.parse(e)}}catch{return{ok:!1}}}async function F(e,t,n={}){let r={Accept:`application/json`};if(!n.skipAuth){let e=Et();e&&(r.Authorization=`Bearer ${e.token}`)}let i=n.body instanceof FormData;n.body!==void 0&&!i&&(r[`Content-Type`]=`application/json`);let a={method:n.method??`GET`,headers:r};n.body!==void 0&&(a.body=i?n.body:JSON.stringify(n.body)),n.signal!==void 0&&(a.signal=n.signal);let o;try{o=await fetch(e,a)}catch(e){throw e instanceof Error&&e.name===`AbortError`?e:new M(0,`network_error`,e.message)}o.status===401&&!n.skipAuth&&(Ot(),window.dispatchEvent(new Event(kt)));let s=Sn(await o.text());if(!o.ok){let e;throw e=s.ok&&P(s.value)&&`error`in s.value?String(s.value.error):s.ok?`request_failed`:`invalid_error_body`,new M(o.status,e,s.ok?void 0:`non-JSON ${o.status} body`)}if(!s.ok)throw new M(o.status,`invalid_response_body`,`server returned non-JSON 2xx body`);return t(s.value,o.status)}var I={authStatus:()=>F(`/api/v1/auth/status`,Mt,{skipAuth:!0}),login:e=>F(`/api/v1/auth/login`,Nt,{method:`POST`,body:{password:e},skipAuth:!0}),changePassword:(e,t)=>F(`/api/v1/auth/change-password`,Pt,{method:`POST`,body:{currentPassword:e,newPassword:t}}),health:()=>F(`/api/v1/health`,It,{skipAuth:!0}),uiConfig:()=>F(`/api/v1/ui-config`,Ft,{skipAuth:!0}),listProjects:()=>F(`/api/v1/projects`,Rt),createProject:(e,t)=>F(`/api/v1/projects`,Lt,{method:`POST`,body:{name:e,path:t}}),renameProject:(e,t)=>F(`/api/v1/projects/${encodeURIComponent(e)}`,Lt,{method:`PATCH`,body:{name:t}}),deleteProject:(e,t)=>{let n=t?.cascade===!0?`?cascade=1`:``;return F(`/api/v1/projects/${encodeURIComponent(e)}${n}`,(e,t)=>((!P(e)||typeof e.cascaded!=`boolean`)&&N(t,`expected { cascaded }`),{cascaded:e.cascaded}),{method:`DELETE`})},browse:e=>F(`/api/v1/projects/browse${e===void 0?``:`?path=${encodeURIComponent(e)}`}`,Bt),mkdir:(e,t)=>F(`/api/v1/projects/browse/mkdir`,Vt,{method:`POST`,body:{parentPath:e,name:t}}),listSessions:e=>F(`/api/v1/sessions${e===void 0?``:`?projectId=${encodeURIComponent(e)}`}`,Ut),createSession:e=>F(`/api/v1/sessions`,Wt,{method:`POST`,body:{projectId:e}}),getSession:e=>F(`/api/v1/sessions/${encodeURIComponent(e)}`,Wt),getMessages:e=>F(`/api/v1/sessions/${encodeURIComponent(e)}/messages`,(e,t)=>((!P(e)||!Array.isArray(e.messages))&&N(t,`expected { messages: [...] }`),{messages:e.messages})),getCompactions:e=>F(`/api/v1/sessions/${encodeURIComponent(e)}/compactions`,(e,t)=>((!P(e)||!Array.isArray(e.compactions))&&N(t,`expected { compactions: [...] }`),{compactions:e.compactions})),disposeSession:(e,t)=>{let n=t?.hard===!0?`?hard=1`:``;return F(`/api/v1/sessions/${encodeURIComponent(e)}${n}`,jt,{method:`DELETE`})},renameSession:(e,t)=>F(`/api/v1/sessions/${encodeURIComponent(e)}/name`,Wt,{method:`POST`,body:{name:t}}),getSessionContext:(e,t)=>F(`/api/v1/sessions/${encodeURIComponent(e)}/context`,mn,t===void 0?{}:{signal:t}),getSessionTree:e=>F(`/api/v1/sessions/${encodeURIComponent(e)}/tree`,hn),navigateSession:(e,t,n)=>{let r={entryId:t};return n?.summarize!==void 0&&(r.summarize=n.summarize),n?.customInstructions!==void 0&&(r.customInstructions=n.customInstructions),n?.label!==void 0&&(r.label=n.label),F(`/api/v1/sessions/${encodeURIComponent(e)}/navigate`,(e,t)=>(P(e)||N(t,`expected navigate result`),e),{method:`POST`,body:r})},forkSession:(e,t)=>F(`/api/v1/sessions/${encodeURIComponent(e)}/fork`,Wt,{method:`POST`,body:{entryId:t}}),getTurnDiff:e=>F(`/api/v1/sessions/${encodeURIComponent(e)}/turn-diff`,ln),prompt:(e,t,n)=>{let r=`/api/v1/sessions/${encodeURIComponent(e)}/prompt`;if(n?.attachments!==void 0&&n.attachments.length>0){let e=new FormData;e.append(`text`,t),n.streamingBehavior!==void 0&&e.append(`streamingBehavior`,n.streamingBehavior);for(let t of n.attachments)e.append(`attachments`,t,t.name);return F(r,Gt,{method:`POST`,body:e})}let i={text:t};return n?.streamingBehavior!==void 0&&(i.streamingBehavior=n.streamingBehavior),F(r,Gt,{method:`POST`,body:i})},steer:(e,t,n)=>{let r={text:t};return n!==void 0&&(r.mode=n),F(`/api/v1/sessions/${encodeURIComponent(e)}/steer`,Gt,{method:`POST`,body:r})},abort:e=>F(`/api/v1/sessions/${encodeURIComponent(e)}/abort`,jt,{method:`POST`}),compact:e=>F(`/api/v1/sessions/${encodeURIComponent(e)}/compact`,(e,t)=>(P(e)||N(t,`expected compact result object`),{summary:typeof e.summary==`string`?e.summary:void 0,tokensBefore:typeof e.tokensBefore==`number`?e.tokensBefore:void 0,tokensAfter:typeof e.tokensAfter==`number`?e.tokensAfter:void 0}),{method:`POST`,body:{}}),exec:(e,t,n)=>F(`/api/v1/sessions/${encodeURIComponent(e)}/exec`,(e,t)=>((!P(e)||!(`exitCode`in e)||typeof e.output!=`string`||typeof e.durationMs!=`number`||typeof e.truncated!=`boolean`||typeof e.cancelled!=`boolean`)&&N(t,`expected { exitCode, output, durationMs, truncated, cancelled }`),{exitCode:typeof e.exitCode==`number`?e.exitCode:null,output:e.output,durationMs:e.durationMs,truncated:e.truncated,cancelled:e.cancelled}),{method:`POST`,body:{command:t,excludeFromContext:n?.excludeFromContext===!0}}),setModel:(e,t,n)=>F(`/api/v1/sessions/${encodeURIComponent(e)}/model`,(e,t)=>((!P(e)||typeof e.provider!=`string`||typeof e.modelId!=`string`)&&N(t,`expected { provider, modelId }`),{provider:e.provider,modelId:e.modelId}),{method:`POST`,body:{provider:t,modelId:n}}),getModelsJson:()=>F(`/api/v1/config/models`,on),setModelsJson:e=>F(`/api/v1/config/models`,on,{method:`PUT`,body:e}),getProviders:()=>F(`/api/v1/config/providers`,Xt),getSettings:()=>F(`/api/v1/config/settings`,an),updateSettings:e=>F(`/api/v1/config/settings`,an,{method:`PUT`,body:e}),getAuthSummary:()=>F(`/api/v1/config/auth`,rn),setApiKey:(e,t)=>F(`/api/v1/config/auth/${encodeURIComponent(e)}`,(e,t)=>((!P(e)||typeof e.provider!=`string`||e.configured!==!0)&&N(t,`expected { provider, configured: true }`),{provider:e.provider,configured:!0}),{method:`PUT`,body:{apiKey:t}}),removeApiKey:e=>F(`/api/v1/config/auth/${encodeURIComponent(e)}`,jt,{method:`DELETE`}),getMcpSettings:()=>F(`/api/v1/mcp/settings`,Qt),setMcpEnabled:e=>F(`/api/v1/mcp/settings`,Qt,{method:`PUT`,body:{enabled:e}}),listMcpServers:e=>F(`/api/v1/mcp/servers${e===void 0?``:`?projectId=${encodeURIComponent(e)}`}`,Zt),upsertMcpServer:(e,t)=>F(`/api/v1/mcp/servers/${encodeURIComponent(e)}`,tn,{method:`PUT`,body:t}),deleteMcpServer:e=>F(`/api/v1/mcp/servers/${encodeURIComponent(e)}`,nn,{method:`DELETE`}),probeMcpServer:(e,t)=>{let n=t===void 0?``:`?projectId=${encodeURIComponent(t)}`;return F(`/api/v1/mcp/servers/${encodeURIComponent(e)}/probe${n}`,$t,{method:`POST`,body:{}})},listMcpTools:e=>F(`/api/v1/mcp/tools?projectId=${encodeURIComponent(e)}`,en),listSkills:e=>F(`/api/v1/config/skills?projectId=${encodeURIComponent(e)}`,Jt),listSkillOverrides:()=>F(`/api/v1/config/skills/overrides`,Yt),setSkillEnabled:(e,t,n,r=`global`)=>F(`/api/v1/config/skills/${encodeURIComponent(t)}/enabled?projectId=${encodeURIComponent(e)}`,qt,{method:`PUT`,body:{enabled:n,scope:r}}),clearSkillProjectOverride:(e,t)=>F(`/api/v1/config/skills/${encodeURIComponent(t)}/enabled?projectId=${encodeURIComponent(e)}`,qt,{method:`DELETE`}),listTools:e=>F(`/api/v1/config/tools${e!==void 0&&e.length>0?`?projectId=${encodeURIComponent(e)}`:``}`,e=>{if(!P(e)||!Array.isArray(e.builtin)||!Array.isArray(e.mcp)||e.extension!==void 0&&!Array.isArray(e.extension))throw new M(0,`invalid_response_body`);let t=e;return t.extension===void 0&&(t.extension=[]),t}),setToolEnabled:(e,t,n,r=`global`,i)=>{let a=r===`project`&&i!==void 0?`?projectId=${encodeURIComponent(i)}`:``;return F(`/api/v1/config/tools/${e}/${encodeURIComponent(t)}/enabled${a}`,e=>{if(!P(e)||typeof e.family!=`string`||typeof e.name!=`string`||typeof e.enabled!=`boolean`||typeof e.scope!=`string`)throw new M(0,`invalid_response_body`);return{family:e.family,name:e.name,enabled:e.enabled,scope:e.scope}},{method:`PUT`,body:{enabled:n,scope:r}})},listToolOverrides:()=>F(`/api/v1/config/tools/overrides`,e=>{if(!P(e)||typeof e.projects!=`object`||e.projects===null)throw new M(0,`invalid_response_body`);let t=e.projects;for(let e of Object.values(t))(e.extension===void 0||e.extension===null)&&(e.extension={enable:[],disable:[]});return e}),clearToolProjectOverride:(e,t,n)=>F(`/api/v1/config/tools/${e}/${encodeURIComponent(t)}/enabled?projectId=${encodeURIComponent(n)}`,e=>{if(!P(e)||typeof e.family!=`string`||typeof e.name!=`string`||typeof e.projectId!=`string`)throw new M(0,`invalid_response_body`);return{family:e.family,name:e.name,projectId:e.projectId}},{method:`DELETE`}),exportConfig:async()=>{let e={},t=Et();t!==void 0&&(e.Authorization=`Bearer ${t.token}`);let n=await fetch(`/api/v1/config/export`,{headers:e});if(n.status===401)throw Ot(),window.dispatchEvent(new Event(kt)),new M(401,`unauthorized`);if(!n.ok){let e=`request_failed`;try{let t=await n.json();typeof t.error==`string`&&(e=t.error)}catch{}throw new M(n.status,e)}return{blob:await n.blob(),filename:xn(n.headers.get(`Content-Disposition`)??``)??`pi-forge-config.tar.gz`,files:(n.headers.get(`X-Pi-Forge-Files`)??``).split(`,`).filter(e=>e.length>0)}},importConfig:e=>{let t=new FormData;return t.append(`file`,e,e.name),F(`/api/v1/config/import`,e=>{if(!P(e)||!Array.isArray(e.imported)||!Array.isArray(e.skipped)||!Array.isArray(e.errors))throw new M(0,`invalid_response_body`);return e},{method:`POST`,body:t})},exportSkills:async()=>{let e={},t=Et();t!==void 0&&(e.Authorization=`Bearer ${t.token}`);let n=await fetch(`/api/v1/config/skills/export`,{headers:e});if(n.status===401)throw Ot(),window.dispatchEvent(new Event(kt)),new M(401,`unauthorized`);if(!n.ok){let e=`request_failed`;try{let t=await n.json();typeof t.error==`string`&&(e=t.error)}catch{}throw new M(n.status,e)}let r=await n.blob(),i=xn(n.headers.get(`Content-Disposition`)??``)??`pi-forge-skills.tar.gz`,a=n.headers.get(`X-Pi-Forge-File-Count`)??`0`;return{blob:r,filename:i,fileCount:Number.parseInt(a,10)||0}},importSkills:e=>{let t=new FormData;for(let n of e){let e=n.webkitRelativePath,r=e!==void 0&&e.length>0?e:n.name;t.append(`file`,n,r)}return F(`/api/v1/config/skills/import`,e=>{if(!P(e)||!Array.isArray(e.imported)||!Array.isArray(e.skipped))throw new M(0,`invalid_response_body`);return e},{method:`POST`,body:t})},filesTree:(e,t)=>{let n=new URLSearchParams({projectId:e});return t!==void 0&&n.set(`maxDepth`,String(t)),F(`/api/v1/files/tree?${n.toString()}`,sn)},filesRead:(e,t)=>F(`/api/v1/files/read?${new URLSearchParams({projectId:e,path:t}).toString()}`,cn),filesWrite:(e,t,n)=>F(`/api/v1/files/write`,yn,{method:`PUT`,body:{projectId:e,path:t,content:n}}),filesMkdir:(e,t,n)=>F(`/api/v1/files/mkdir`,yn,{method:`POST`,body:{projectId:e,parentPath:t,name:n}}),filesRename:(e,t,n)=>F(`/api/v1/files/rename`,yn,{method:`POST`,body:{projectId:e,path:t,name:n}}),filesMove:(e,t,n)=>F(`/api/v1/files/move`,yn,{method:`POST`,body:{projectId:e,src:t,dest:n}}),filesDelete:(e,t,n)=>{let r=new URLSearchParams({projectId:e,path:t});return n?.recursive===!0&&r.set(`recursive`,`true`),F(`/api/v1/files/delete?${r.toString()}`,jt,{method:`DELETE`})},filesDownload:async(e,t)=>{let n=new URLSearchParams({projectId:e});t!==void 0&&t.length>0&&n.set(`path`,t);let r={},i=Et();i!==void 0&&(r.Authorization=`Bearer ${i.token}`);let a=await fetch(`/api/v1/files/download?${n.toString()}`,{headers:r});if(a.status===401)throw Ot(),window.dispatchEvent(new Event(kt)),new M(401,`unauthorized`);if(!a.ok){let e=`request_failed`;try{let t=await a.json();typeof t.error==`string`&&(e=t.error)}catch{}throw new M(a.status,e)}return{blob:await a.blob(),filename:xn(a.headers.get(`Content-Disposition`)??``)??`download`}},uploadFiles:async(e,t,n,r)=>{let i=new FormData;i.append(`projectId`,e),i.append(`parentPath`,t),r?.overwrite===!0&&i.append(`overwrite`,`1`);let a=n.reduce((e,t)=>e+t.size,0),o=0;for(let e of n){let t=await bn(e,e=>{o+=e,r?.onHashProgress?.(o,a)});i.append(`sha256:${e.name}`,t)}for(let e of n)i.append(`files`,e,e.name);return F(`/api/v1/files/upload`,gn,{method:`POST`,body:i,...r?.signal===void 0?{}:{signal:r.signal}})},completeFiles:(e,t,n)=>{let r=new URLSearchParams({projectId:e,query:t});return n?.limit!==void 0&&r.set(`limit`,String(n.limit)),F(`/api/v1/files/complete?${r.toString()}`,(e,t)=>((!P(e)||!Array.isArray(e.paths))&&N(t,`expected { paths: string[] }`),{paths:e.paths.filter(e=>typeof e==`string`)}),n?.signal===void 0?{}:{signal:n.signal})},searchFiles:(e,t,n)=>{let r=new URLSearchParams({projectId:e,q:t.query});return t.regex===!0&&r.set(`regex`,`1`),t.caseSensitive===!0&&r.set(`caseSensitive`,`1`),t.includeGitignored===!0&&r.set(`includeGitignored`,`1`),t.include!==void 0&&t.include.length>0&&r.set(`include`,t.include),t.exclude!==void 0&&t.exclude.length>0&&r.set(`exclude`,t.exclude),t.limit!==void 0&&r.set(`limit`,String(t.limit)),F(`/api/v1/files/search?${r.toString()}`,_n,n===void 0?{}:{signal:n})},gitInit:e=>F(`/api/v1/git/init`,(e,t)=>((!P(e)||typeof e.alreadyInitialised!=`boolean`||typeof e.isGitRepo!=`boolean`)&&N(t,`expected { alreadyInitialised, isGitRepo }`),{alreadyInitialised:e.alreadyInitialised,isGitRepo:e.isGitRepo}),{method:`POST`,body:{projectId:e}}),gitStatus:e=>F(`/api/v1/git/status?projectId=${encodeURIComponent(e)}`,un),gitDiff:e=>F(`/api/v1/git/diff?projectId=${encodeURIComponent(e)}`,dn),gitDiffStaged:e=>F(`/api/v1/git/diff/staged?projectId=${encodeURIComponent(e)}`,dn),gitDiffFile:(e,t,n)=>{let r=new URLSearchParams({projectId:e,path:t});return n&&r.set(`staged`,`1`),F(`/api/v1/git/diff/file?${r.toString()}`,dn)},gitLog:(e,t)=>{let n=new URLSearchParams({projectId:e});return t!==void 0&&n.set(`limit`,String(t)),F(`/api/v1/git/log?${n.toString()}`,fn)},gitBranches:e=>F(`/api/v1/git/branches?projectId=${encodeURIComponent(e)}`,pn),gitRemotes:e=>F(`/api/v1/git/remotes?projectId=${encodeURIComponent(e)}`,vn),gitRemoteAdd:(e,t,n)=>F(`/api/v1/git/remote/add`,(e,t)=>((!P(e)||e.ok!==!0)&&N(t,`expected { ok: true }`),{ok:!0}),{method:`POST`,body:{projectId:e,name:t,url:n}}),gitRemoteRemove:(e,t)=>F(`/api/v1/git/remote/${encodeURIComponent(t)}?projectId=${encodeURIComponent(e)}`,(e,t)=>((!P(e)||e.ok!==!0)&&N(t,`expected { ok: true }`),{ok:!0}),{method:`DELETE`}),gitCheckout:(e,t)=>F(`/api/v1/git/checkout`,(e,t)=>((!P(e)||e.ok!==!0)&&N(t,`expected { ok: true }`),{ok:!0}),{method:`POST`,body:{projectId:e,branch:t}}),gitBranchCreate:(e,t,n)=>{let r={projectId:e,name:t};return n?.startPoint!==void 0&&(r.startPoint=n.startPoint),n?.checkout!==void 0&&(r.checkout=n.checkout),F(`/api/v1/git/branch/create`,(e,t)=>((!P(e)||e.ok!==!0)&&N(t,`expected { ok: true }`),{ok:!0}),{method:`POST`,body:r})},gitBranchDelete:(e,t,n)=>{let r=new URLSearchParams({projectId:e});return n===!0&&r.set(`force`,`1`),F(`/api/v1/git/branch/${encodeURIComponent(t)}?${r.toString()}`,(e,t)=>((!P(e)||e.ok!==!0)&&N(t,`expected { ok: true }`),{ok:!0}),{method:`DELETE`})},gitStage:(e,t)=>F(`/api/v1/git/stage`,(e,t)=>((!P(e)||e.ok!==!0)&&N(t,`expected { ok: true }`),{ok:!0}),{method:`POST`,body:{projectId:e,paths:t}}),gitUnstage:(e,t)=>F(`/api/v1/git/unstage`,(e,t)=>((!P(e)||e.ok!==!0)&&N(t,`expected { ok: true }`),{ok:!0}),{method:`POST`,body:{projectId:e,paths:t}}),gitRevert:(e,t)=>F(`/api/v1/git/revert`,(e,t)=>((!P(e)||e.ok!==!0)&&N(t,`expected { ok: true }`),{ok:!0}),{method:`POST`,body:{projectId:e,paths:t}}),gitCommit:(e,t)=>F(`/api/v1/git/commit`,(e,t)=>((!P(e)||typeof e.hash!=`string`)&&N(t,`expected { hash }`),{hash:e.hash}),{method:`POST`,body:{projectId:e,message:t}}),gitFetch:(e,t)=>{let n={projectId:e};return t?.remote!==void 0&&(n.remote=t.remote),t?.prune!==void 0&&(n.prune=t.prune),F(`/api/v1/git/fetch`,(e,t)=>((!P(e)||typeof e.output!=`string`)&&N(t,`expected { output }`),{output:e.output}),{method:`POST`,body:n})},gitPull:(e,t)=>{let n={projectId:e};return t?.remote!==void 0&&(n.remote=t.remote),t?.branch!==void 0&&(n.branch=t.branch),t?.rebase!==void 0&&(n.rebase=t.rebase),F(`/api/v1/git/pull`,(e,t)=>((!P(e)||typeof e.output!=`string`)&&N(t,`expected { output }`),{output:e.output}),{method:`POST`,body:n})},gitPush:(e,t)=>{let n={projectId:e};return t?.remote!==void 0&&(n.remote=t.remote),t?.branch!==void 0&&(n.branch=t.branch),t?.setUpstream!==void 0&&(n.setUpstream=t.setUpstream),F(`/api/v1/git/push`,(e,t)=>((!P(e)||typeof e.output!=`string`)&&N(t,`expected { output }`),{output:e.output}),{method:`POST`,body:n})}},Cn=Qe((e,t)=>({ready:!1,authRequired:!1,isAuthenticated:!1,mustChangePassword:!1,loginError:void 0,loginPending:!1,changePasswordError:void 0,changePasswordPending:!1,bootstrap:async()=>{try{let{authEnabled:t}=await I.authStatus();if(!t){e({ready:!0,authRequired:!1,isAuthenticated:!0,mustChangePassword:!1});return}let n=Et();e({ready:!0,authRequired:!0,isAuthenticated:n!==void 0,mustChangePassword:n?.mustChangePassword??!1})}catch(t){e({ready:!0,authRequired:!0,isAuthenticated:!1,mustChangePassword:!1,loginError:t instanceof Error?t.message:`bootstrap_failed`})}},login:async n=>{if(!t().loginPending){e({loginPending:!0,loginError:void 0});try{let t=await I.login(n);Dt({token:t.token,expiresAt:t.expiresAt,mustChangePassword:t.mustChangePassword}),e({isAuthenticated:!0,mustChangePassword:t.mustChangePassword,loginPending:!1})}catch(t){e({loginPending:!1,loginError:t instanceof M?t.code:`login_failed`})}}},changePassword:async(n,r)=>{if(!t().changePasswordPending){e({changePasswordPending:!0,changePasswordError:void 0});try{let t=await I.changePassword(n,r);Dt({token:t.token,expiresAt:t.expiresAt,mustChangePassword:t.mustChangePassword}),e({isAuthenticated:!0,mustChangePassword:t.mustChangePassword,changePasswordPending:!1})}catch(t){e({changePasswordPending:!1,changePasswordError:t instanceof M?t.code:`change_password_failed`})}}},logout:()=>{Ot(),e({isAuthenticated:!1,mustChangePassword:!1,loginError:void 0})}}));globalThis.__piForgeAuthListenerRegistered||(globalThis.__piForgeAuthListenerCleanup=At(()=>Cn.setState({isAuthenticated:!1})),globalThis.__piForgeAuthListenerRegistered=!0);var wn=`pi-forge/active-project-id`,Tn=`pi-forge/collapsed-projects`;function En(){try{let e=localStorage.getItem(Tn);if(!e)return{};let t=JSON.parse(e);if(typeof t!=`object`||!t)return{};let n={};for(let[e,r]of Object.entries(t))typeof r==`boolean`&&(n[e]=r);return n}catch{return{}}}function Dn(e){localStorage.setItem(Tn,JSON.stringify(e))}var On=Qe((e,t)=>({projects:[],activeProjectId:localStorage.getItem(wn)??void 0,collapsed:En(),loading:!1,error:void 0,load:async()=>{e({loading:!0,error:void 0});try{let{projects:n}=await I.listProjects(),r=t().activeProjectId,i=r!==void 0&&n.some(e=>e.id===r)?r:n[0]?.id;i!==r&&(i?localStorage.setItem(wn,i):localStorage.removeItem(wn)),e({projects:n,activeProjectId:i,loading:!1})}catch(t){e({loading:!1,error:t instanceof M?t.code:t.message})}},create:async(t,n)=>{e({error:void 0});try{let r=await I.createProject(t,n);return e(e=>({projects:[...e.projects,r],activeProjectId:r.id})),localStorage.setItem(wn,r.id),r}catch(t){throw e({error:t instanceof M?t.code:t.message}),t}},rename:async(t,n)=>{try{let r=await I.renameProject(t,n);e(e=>({projects:e.projects.map(e=>e.id===t?r:e)}))}catch(t){throw e({error:t instanceof M?t.code:t.message}),t}},remove:async(t,n)=>{try{await I.deleteProject(t,n),e(e=>{let n=e.projects.filter(e=>e.id!==t),r=e.activeProjectId===t?n[0]?.id:e.activeProjectId;return r?localStorage.setItem(wn,r):localStorage.removeItem(wn),{projects:n,activeProjectId:r}})}catch(t){throw e({error:t instanceof M?t.code:t.message}),t}},setActive:t=>{t?localStorage.setItem(wn,t):localStorage.removeItem(wn),e({activeProjectId:t})},toggleCollapsed:t=>{e(e=>{let n={...e.collapsed,[t]:!e.collapsed[t]};return Dn(n),{collapsed:n}})}}));function kn(){return On(e=>e.activeProjectId===void 0?void 0:e.projects.find(t=>t.id===e.activeProjectId))}var An=new Set([401,404]),jn=3e4;function Mn(e){return Math.min(2**e*1e3,jn)}function Nn(e,t){return new Promise((n,r)=>{if(t?.aborted===!0){r(new DOMException(`Aborted`,`AbortError`));return}let i=setTimeout(()=>{t?.removeEventListener(`abort`,a),n()},e),a=()=>{clearTimeout(i),r(new DOMException(`Aborted`,`AbortError`))};t?.addEventListener(`abort`,a,{once:!0})})}async function Pn(e,t){let n={Accept:`text/event-stream`},r=Et();r&&(n.Authorization=`Bearer ${r.token}`);let i={method:`GET`,headers:n};t.signal!==void 0&&(i.signal=t.signal);let a;try{a=await fetch(e,i)}catch(e){if(e instanceof Error&&e.name===`AbortError`)return`aborted`;throw new M(0,`network_error`,e.message)}if(a.status===401&&(Ot(),window.dispatchEvent(new Event(kt))),!a.ok||a.body===null)throw new M(a.status,`stream_open_failed`);let o=a.body.pipeThrough(new TextDecoderStream).getReader(),s=``;try{for(;;){let{value:e,done:n}=await o.read();if(n)return`eof`;s+=e.replace(/\r\n/g,`
10
+ `);let r=s.indexOf(`
11
+
12
+ `);for(;r!==-1;){let e=s.slice(0,r);s=s.slice(r+2);let n=[];for(let t of e.split(`
13
+ `))t.startsWith(`:`)||t.startsWith(`data:`)&&n.push(t.slice(5).trimStart());if(n.length>0){let e=n.join(`
14
+ `);try{let n=JSON.parse(e);await t.onEvent(n)}catch{}}r=s.indexOf(`
15
+
16
+ `)}}}catch(e){if(e instanceof Error&&e.name===`AbortError`)return`aborted`;throw e instanceof Error?e:Error(String(e))}finally{try{o.releaseLock()}catch{}}}async function Fn(e,t){let n=0;for(;;){let r;try{r=await Pn(e,t)}catch(e){if(e instanceof M&&An.has(e.status)||(n+=1,t.maxReconnects!==void 0&&t.maxReconnects>0&&n>t.maxReconnects))throw e;let r=Mn(n),i=e instanceof Error?e.message:String(e);t.onReconnect?.({attempt:n,delayMs:r,reason:i});try{await Nn(r,t.signal)}catch{return}continue}if(r===`aborted`)return;if(n+=1,t.maxReconnects!==void 0&&t.maxReconnects>0&&n>t.maxReconnects){t.onClose?.();return}let i=Mn(n);t.onReconnect?.({attempt:n,delayMs:i,reason:`server closed stream`});try{await Nn(i,t.signal)}catch{return}}}var In=`pi-forge`,Ln=`tab-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,Rn;function zn(){if(Rn!==void 0)return Rn;if(!(typeof BroadcastChannel>`u`))return Rn=new BroadcastChannel(In),Rn}function Bn(e){let t=zn();if(t===void 0)return;let n={from:Ln,msg:e};try{t.postMessage(n)}catch{}}function Vn(e){let t=zn();if(t===void 0)return()=>void 0;let n=t=>{let n=t.data;typeof n!=`object`||!n||n.from!==Ln&&(typeof n.msg!=`object`||n.msg===null||e(n.msg))};return t.addEventListener(`message`,n),()=>t.removeEventListener(`message`,n)}var Hn=`pi-forge/active-session-id`,Un=[],Wn=[],Gn=[],Kn=new Map,qn=new Map,Jn=new Map,Yn=new Map;function Xn(e){for(let t of e)if(t.role===`user`&&Array.isArray(t.content))for(let e of t.content){let t=e;if(t.type===`image`&&t.__blobUrl===!0&&typeof t.data==`string`)try{URL.revokeObjectURL(t.data)}catch{}}}function Zn(e,t){for(let[n,r]of Object.entries(e.byProject))if(r.some(e=>e.sessionId===t))return n}function Qn(e,t){let n=e.messagesBySession[t];n!==void 0&&Xn(n);let r={...e.messagesBySession};delete r[t];let i={...e.streamingBySession};delete i[t];let a={...e.bannerBySession};delete a[t];let o={...e.streamingTextBySession};delete o[t];let s={...e.activeToolBySession};delete s[t];let c={...e.agentEndCountBySession};delete c[t];let l={...e.queuedBySession};delete l[t];let u={};for(let[n,r]of Object.entries(e.byProject))u[n]=r.filter(e=>e.sessionId!==t);return{messagesBySession:r,streamingBySession:i,bannerBySession:a,streamingTextBySession:o,activeToolBySession:s,agentEndCountBySession:c,queuedBySession:l,byProject:u,activeSessionId:e.activeSessionId===t?void 0:e.activeSessionId}}var $n=Qe((e,t)=>({byProject:{},activeSessionId:localStorage.getItem(Hn)??void 0,messagesBySession:{},compactionsBySession:{},pendingDraftBySession:{},streamingBySession:{},bannerBySession:{},streamingTextBySession:{},activeToolBySession:{},agentEndCountBySession:{},compactionEndCountBySession:{},queuedBySession:{},error:void 0,loadingList:!1,loadSessionsForProject:async t=>{e({loadingList:!0,error:void 0});try{let{sessions:n}=await I.listSessions(t);e(e=>({byProject:{...e.byProject,[t]:n},loadingList:!1}))}catch(t){e({loadingList:!1,error:t instanceof M?t.code:t.message})}},createSession:async t=>{e({error:void 0});try{let n=await I.createSession(t),r={sessionId:n.sessionId,projectId:n.projectId,isLive:!0,workspacePath:n.workspacePath,lastActivityAt:n.lastActivityAt,createdAt:n.createdAt,messageCount:n.messageCount,firstMessage:``};return n.name!==void 0&&(r.name=n.name),e(e=>{let i=e.byProject[t]??[];return{byProject:{...e.byProject,[t]:[r,...i]},activeSessionId:n.sessionId}}),localStorage.setItem(Hn,n.sessionId),Bn({type:`session_created`,projectId:t,session:r}),n}catch(t){throw e({error:t instanceof M?t.code:t.message}),t}},renameSession:async(t,n)=>{e({error:void 0});try{let r=await I.renameSession(t,n);e(e=>{let n={};for(let[i,a]of Object.entries(e.byProject))n[i]=a.map(e=>{if(e.sessionId!==t)return e;let n={...e};return r.name===void 0?delete n.name:n.name=r.name,n});return{byProject:n}}),Bn({type:`session_renamed`,sessionId:t,name:r.name})}catch(t){throw e({error:t instanceof M?t.code:t.message}),t}},reloadMessages:t=>{tr(e,t)},loadCompactions:async t=>{try{let n=await I.getCompactions(t);e(e=>({compactionsBySession:{...e.compactionsBySession,[t]:n.compactions}}))}catch{}},setPendingDraft:(t,n)=>e(e=>({pendingDraftBySession:{...e.pendingDraftBySession,[t]:n}})),consumePendingDraft:t=>e(e=>{if(e.pendingDraftBySession[t]===void 0)return{};let n={...e.pendingDraftBySession};return delete n[t],{pendingDraftBySession:n}}),setActiveSession:t=>{t===void 0?localStorage.removeItem(Hn):localStorage.setItem(Hn,t),e({activeSessionId:t})},openStream:n=>{if(Yn.get(n)!==void 0)return;let r=new AbortController;Yn.set(n,r),t().loadCompactions(n);let i=()=>{Yn.get(n)===r&&Yn.delete(n)};Fn(`/api/v1/sessions/${encodeURIComponent(n)}/stream`,{signal:r.signal,onEvent:r=>er(e,t,n,r),onClose:i,onReconnect:({attempt:t,delayMs:r,reason:i})=>{e(e=>({bannerBySession:{...e.bannerBySession,[n]:`Reconnecting (attempt ${t}, ${Math.round(r/1e3)}s) — ${i}`}}))}}).catch(r=>{if(r instanceof M&&r.status===404){e(e=>Qn(e,n)),t().activeSessionId===void 0&&localStorage.removeItem(Hn),i();return}let a=r instanceof M?r.code:r.message;e(e=>({bannerBySession:{...e.bannerBySession,[n]:`stream error: ${a}`}})),i()})},closeStream:e=>{let t=Yn.get(e);t!==void 0&&(t.abort(),Yn.get(e)===t&&Yn.delete(e))},sendPrompt:async(t,n,r)=>{e({error:void 0});let i=[{type:`text`,text:n}];if(r!==void 0)for(let e of r)e.type.startsWith(`image/`)?i.push({type:`image`,mimeType:e.type,data:URL.createObjectURL(e),__blobUrl:!0}):i.push({type:`file`,filename:e.name,size:e.size});let a={role:`user`,content:i,timestamp:Date.now()};e(e=>({messagesBySession:{...e.messagesBySession,[t]:[...e.messagesBySession[t]??[],a]}}));try{let e={};r!==void 0&&r.length>0&&(e.attachments=r),await I.prompt(t,n,e)}catch(n){throw Xn([a]),e(e=>{let r=e.messagesBySession[t]??[];return{messagesBySession:{...e.messagesBySession,[t]:r.filter(e=>e!==a)},error:n instanceof M?n.code:n.message,bannerBySession:{...e.bannerBySession,[t]:n instanceof M?`prompt rejected: ${n.code}${n.message===`${n.status} ${n.code}`?``:` — ${n.message}`}`:`prompt rejected: ${n.message}`}}}),n}},sendSteer:async(t,n,r)=>{e({error:void 0});try{await I.steer(t,n,r)}catch(t){throw e({error:t instanceof M?t.code:t.message}),t}},abortSession:async t=>{e({error:void 0});try{await I.abort(t)}catch(t){e({error:t instanceof M?t.code:t.message})}},disposeSession:async(n,r)=>{e({error:void 0});try{t().closeStream(n);let i=Zn(t(),n);await I.disposeSession(n,r),e(e=>Qn(e,n)),t().activeSessionId===void 0&&localStorage.removeItem(Hn),i!==void 0&&(Bn({type:`session_deleted`,projectId:i,sessionId:n}),t().loadSessionsForProject(i))}catch(t){e({error:t instanceof M?t.code:t.message})}}}));function er(e,t,n,r){if(r.type===`snapshot`){e(e=>({messagesBySession:{...e.messagesBySession,[n]:r.messages??[]},streamingBySession:{...e.streamingBySession,[n]:r.isStreaming??!1},bannerBySession:{...e.bannerBySession,[n]:void 0},activeToolBySession:{...e.activeToolBySession,[n]:void 0}}));return}if(r.type===`agent_start`){let t=qn.get(n);t!==void 0&&cancelAnimationFrame(t),qn.delete(n),Kn.delete(n),e(e=>({streamingBySession:{...e.streamingBySession,[n]:!0},streamingTextBySession:{...e.streamingTextBySession,[n]:``},bannerBySession:{...e.bannerBySession,[n]:void 0}}));return}if(r.type===`agent_end`){let t=qn.get(n);t!==void 0&&cancelAnimationFrame(t),qn.delete(n),Kn.delete(n);let i=r.errorMessage,a=typeof i==`string`&&i.length>0?`Agent error: ${i}`:void 0;I.getMessages(n).then(({messages:t})=>{e(e=>{let r=e.messagesBySession[n];r!==void 0&&Xn(r);let i=e.bannerBySession[n],o=a??i;return{messagesBySession:{...e.messagesBySession,[n]:t},streamingBySession:{...e.streamingBySession,[n]:!1},streamingTextBySession:{...e.streamingTextBySession,[n]:``},activeToolBySession:{...e.activeToolBySession,[n]:void 0},bannerBySession:{...e.bannerBySession,[n]:o},agentEndCountBySession:{...e.agentEndCountBySession,[n]:(e.agentEndCountBySession[n]??0)+1}}})}).catch(()=>{e(e=>({streamingBySession:{...e.streamingBySession,[n]:!1},activeToolBySession:{...e.activeToolBySession,[n]:void 0},bannerBySession:{...e.bannerBySession,[n]:a??`Couldn't refresh messages after the agent finished — reload to sync`},agentEndCountBySession:{...e.agentEndCountBySession,[n]:(e.agentEndCountBySession[n]??0)+1}}))});return}if(r.type===`queue_update`){let t=r,i=Array.isArray(t.steering)?t.steering.filter(e=>typeof e==`string`):[],a=Array.isArray(t.followUp)?t.followUp.filter(e=>typeof e==`string`):[];e(e=>({queuedBySession:{...e.queuedBySession,[n]:i.length===0&&a.length===0?void 0:{steering:i,followUp:a}}}));return}if(r.type===`tool_execution_start`){let t=typeof r.toolName==`string`?r.toolName:`tool`,i=nr(t,r.input??{}),a=i===void 0?{name:t}:{name:t,summary:i};e(e=>({activeToolBySession:{...e.activeToolBySession,[n]:a}})),tr(e,n);return}if(r.type===`tool_execution_end`){if(e(e=>({activeToolBySession:{...e.activeToolBySession,[n]:void 0}})),tr(e,n),r.toolName===`subagent`){let e=Zn(t(),n);e!==void 0&&t().loadSessionsForProject(e)}return}if(r.type===`message_end`||r.type===`tool_result`){tr(e,n);return}if(r.type===`user_bash_result`){tr(e,n);return}if(r.type===`message_update`){let t=r.assistantMessageEvent;if(typeof t==`object`&&t&&t.type===`text_delta`&&typeof t.delta==`string`){let r=t.delta;if(Kn.set(n,(Kn.get(n)??``)+r),!qn.has(n)){let t=requestAnimationFrame(()=>{qn.delete(n);let t=Kn.get(n)??``;t.length!==0&&(Kn.delete(n),e(e=>({streamingTextBySession:{...e.streamingTextBySession,[n]:(e.streamingTextBySession[n]??``)+t}})))});qn.set(n,t)}}return}if(r.type===`compaction_start`){e(e=>({bannerBySession:{...e.bannerBySession,[n]:`Compacting context…`}}));return}if(r.type===`compaction_end`){let t=r.errorMessage,i=typeof t==`string`&&t.length>0?`Agent error: ${t}`:void 0;e(e=>({bannerBySession:{...e.bannerBySession,[n]:i},compactionEndCountBySession:{...e.compactionEndCountBySession,[n]:(e.compactionEndCountBySession[n]??0)+1}})),$n.getState().loadCompactions(n),tr(e,n);return}if(r.type===`auto_retry_start`){let t=typeof r.attempt==`number`?r.attempt:`?`,i=typeof r.maxAttempts==`number`?r.maxAttempts:`?`;e(e=>({bannerBySession:{...e.bannerBySession,[n]:`Retrying (${t}/${i})…`}}));return}if(r.type===`auto_retry_end`){let t=r.success!==!1,i=r.finalError,a=!t&&typeof i==`string`&&i.length>0?`Agent error: ${i}`:void 0;e(e=>({bannerBySession:{...e.bannerBySession,[n]:a}}));return}if(r.type===`message_end`){let t=r.message;if(t?.stopReason===`error`){let r=typeof t.errorMessage==`string`?t.errorMessage:``;r.length>0&&e(e=>({bannerBySession:{...e.bannerBySession,[n]:`Agent error: ${r}`}}))}return}}function tr(e,t){let n=Jn.get(t)??{inflight:!1,queued:!1};if(n.inflight){n.queued=!0,Jn.set(t,n);return}n.inflight=!0,Jn.set(t,n),I.getMessages(t).then(({messages:n})=>{e(e=>({messagesBySession:{...e.messagesBySession,[t]:n}}))}).catch(()=>{}).finally(()=>{let n=Jn.get(t);n!==void 0&&(n.queued?(n.queued=!1,n.inflight=!1,Jn.set(t,n),tr(e,t)):Jn.delete(t))})}function nr(e,t){let n=e=>{let n=t[e];return typeof n==`string`&&n.length>0?n:void 0};switch(e){case`bash`:return n(`command`);case`read`:case`write`:case`edit`:return n(`filePath`)??n(`path`)??n(`file`);case`grep`:return n(`pattern`);case`glob`:return n(`pattern`)??n(`path`);default:for(let e of[`path`,`file`,`filePath`,`command`,`pattern`,`query`,`url`]){let t=n(e);if(t!==void 0)return t}return}}globalThis.__piForgeSessionCrossTabRegistered||(globalThis.__piForgeSessionCrossTabCleanup=Vn(e=>{if(e.type===`session_created`){let t=e.session,n=typeof t.sessionId==`string`?t.sessionId:void 0;if(n===void 0)return;let r={sessionId:n,projectId:e.projectId,isLive:t.isLive===!0,workspacePath:typeof t.workspacePath==`string`?t.workspacePath:``,lastActivityAt:typeof t.lastActivityAt==`string`?t.lastActivityAt:new Date().toISOString(),createdAt:typeof t.createdAt==`string`?t.createdAt:new Date().toISOString(),messageCount:typeof t.messageCount==`number`?t.messageCount:0,firstMessage:typeof t.firstMessage==`string`?t.firstMessage:``};typeof t.name==`string`&&(r.name=t.name),$n.setState(t=>{let i=t.byProject[e.projectId]??[];return i.some(e=>e.sessionId===n)?{}:{byProject:{...t.byProject,[e.projectId]:[r,...i]}}});return}if(e.type===`session_deleted`){if($n.setState(t=>Qn(t,e.sessionId)),$n.getState().activeSessionId===void 0)try{localStorage.removeItem(Hn)}catch{}$n.getState().loadSessionsForProject(e.projectId);return}if(e.type===`session_renamed`){$n.setState(t=>{let n={};for(let[r,i]of Object.entries(t.byProject))n[r]=i.map(t=>{if(t.sessionId!==e.sessionId)return t;let n={...t};return e.name===void 0?delete n.name:n.name=e.name,n});return{byProject:n}});return}}),globalThis.__piForgeSessionCrossTabRegistered=!0);var rr=/^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@/;function ir(e){if(e.length===0)return[];let t=0,n=0,r=new Map,i=(e,t)=>{let n=r.get(e);n!==`modified`&&(n===`added`&&t===`deletedAbove`||r.set(e,t))},a=()=>{n!==0&&(i(t,`deletedAbove`),n=0)};for(let r of e.split(`
17
+ `)){if(r.startsWith(`@@`)){a();let e=rr.exec(r);if(e===null)continue;t=Number.parseInt(e[1]??`0`,10),n=0;continue}if(r.startsWith(`\\`)||t===0)continue;let e=r.charAt(0);e===` `?(a(),t+=1):e===`-`?n+=1:e===`+`&&(n>0?(i(t,`modified`),--n):i(t,`added`),t+=1)}return a(),Array.from(r.entries()).map(([e,t])=>({line:e,kind:t})).sort((e,t)=>e.line-t.line)}var ar=`forge.editor.tabs.v1:`;function or(e){try{let t=sessionStorage.getItem(ar+e);if(t===null)return{paths:[],activePath:null};let n=JSON.parse(t);if(typeof n!=`object`||!n)return{paths:[],activePath:null};let r=n,i=Array.isArray(r.paths)?r.paths.filter(e=>typeof e==`string`):[],a=typeof r.activePath==`string`?r.activePath:null;return{paths:i,activePath:i.includes(a??``)?a:i[0]??null}}catch{return{paths:[],activePath:null}}}function sr(e,t,n){try{sessionStorage.setItem(ar+e,JSON.stringify({paths:t,activePath:n??null}))}catch{}}var cr;function lr(e,t){e!==void 0&&sr(e,t.openFiles.map(e=>e.path),t.activePath)}var ur=Qe((e,t)=>({treeByProject:{},treeLoading:{},openFiles:[],activePath:void 0,error:void 0,externallyChanged:{},gitDiffByPath:{},loadGitDiff:async(t,n)=>{try{let r=ir((await I.gitDiffFile(t,n,!1)).diff);e(e=>({gitDiffByPath:{...e.gitDiffByPath,[n]:r}}))}catch{e(e=>{if(!(n in e.gitDiffByPath))return{};let t={...e.gitDiffByPath};return delete t[n],{gitDiffByPath:t}})}},loadTree:async t=>{e(e=>({treeLoading:{...e.treeLoading,[t]:!0},error:void 0}));try{let n=await I.filesTree(t);e(e=>({treeByProject:{...e.treeByProject,[t]:n},treeLoading:{...e.treeLoading,[t]:!1}}))}catch(n){e(e=>({treeLoading:{...e.treeLoading,[t]:!1},error:n instanceof M?n.code:n.message}))}},restoreTabs:async n=>{if(cr===n&&t().openFiles.length>0)return;cr!==n&&e({openFiles:[],activePath:void 0,externallyChanged:{},gitDiffByPath:{}}),cr=n;let r=or(n);if(r.paths.length!==0){for(let e of r.paths)try{await t().openFile(n,e)}catch{}r.activePath!==null&&t().setActiveFile(r.activePath)}},openFile:async(n,r,i)=>{if(cr=n,t().openFiles.find(e=>e.path===r)!==void 0){e(i===void 0?e=>(lr(cr,{openFiles:e.openFiles,activePath:r}),{activePath:r}):e=>{let t={openFiles:e.openFiles.map(e=>e.path===r?{...e,pendingNav:i}:e),activePath:r};return lr(cr,t),t});return}e({error:void 0});try{let a=await I.filesRead(n,r),o={tabId:dr(),path:r,saved:a.content,draft:a.content,dirty:!1,language:a.language,binary:a.binary,saving:!1,savedAt:void 0,saveError:void 0,loadingError:a.binary?`Binary file — open externally to edit.`:void 0};i!==void 0&&(o.pendingNav=i),e(e=>{let t={openFiles:[...e.openFiles,o],activePath:r};return lr(cr,t),t}),t().loadGitDiff(n,r)}catch(t){e({error:t instanceof M?t.code:t.message})}},closeFile:t=>{e(e=>{let n=e.openFiles.findIndex(e=>e.path===t);if(n===-1)return{};let r=e.openFiles.slice(0,n).concat(e.openFiles.slice(n+1)),i=e.activePath===t?(r[n]??r[n-1]??r[0])?.path:e.activePath,a={...e.externallyChanged};delete a[t];let o={...e.gitDiffByPath};delete o[t];let s={openFiles:r,activePath:i,externallyChanged:a,gitDiffByPath:o};return lr(cr,s),s})},closeAllFiles:()=>{e(()=>{let e={openFiles:[],activePath:void 0,externallyChanged:{},gitDiffByPath:{}};return lr(cr,e),e})},setActiveFile:t=>e(e=>(lr(cr,{openFiles:e.openFiles,activePath:t}),{activePath:t})),consumePendingNav:t=>{e(e=>({openFiles:e.openFiles.map(e=>{if(e.path!==t||e.pendingNav===void 0)return e;let n={...e};return delete n.pendingNav,n})}))},updateDraft:(t,n)=>{e(e=>({openFiles:e.openFiles.map(e=>e.path===t?{...e,draft:n,dirty:n!==e.saved}:e)}))},saveFile:async(n,r)=>{let i=t().openFiles.find(e=>e.path===r);if(!(i===void 0||i.binary)){e(e=>({openFiles:e.openFiles.map(e=>e.path===r?{...e,saving:!0,saveError:void 0}:e),error:void 0}));try{await I.filesWrite(n,r,i.draft),e(e=>({openFiles:e.openFiles.map(e=>e.path===r?{...e,saving:!1,saved:e.draft,dirty:!1,savedAt:Date.now(),saveError:void 0}:e),externallyChanged:fr(e.externallyChanged,r)})),t().loadGitDiff(n,r)}catch(t){let n=t instanceof M?t.code:t.message;throw e(e=>({openFiles:e.openFiles.map(e=>e.path===r?{...e,saving:!1,saveError:n}:e),error:n})),t}}},reloadFile:async(n,r)=>{e({error:void 0});try{let i=await I.filesRead(n,r);e(e=>({openFiles:e.openFiles.map(e=>e.path===r?{...e,saved:i.content,draft:i.content,dirty:!1,language:i.language,binary:i.binary,loadingError:i.binary?`Binary file — open externally to edit.`:void 0}:e),externallyChanged:fr(e.externallyChanged,r)})),t().loadGitDiff(n,r)}catch(t){e({error:t instanceof M?t.code:t.message})}},refreshOpenFiles:async n=>{let r=t().openFiles.map(e=>({path:e.path,saved:e.saved,dirty:e.dirty}));if(r.length===0)return;let i=await Promise.allSettled(r.map(e=>I.filesRead(n,e.path)));e(e=>{let t=e.openFiles,n=e.externallyChanged;for(let e=0;e<r.length;e++){let a=i[e],o=r[e];if(a===void 0||o===void 0||a.status!==`fulfilled`)continue;let s=a.value;s.content===o.saved&&!o.dirty||s.content!==o.saved&&(o.dirty?n={...n,[o.path]:!0}:(t=t.map(e=>e.path===o.path?{...e,saved:s.content,draft:s.content,dirty:!1,language:s.language,binary:s.binary,loadingError:s.binary?`Binary file — open externally to edit.`:void 0}:e),n=fr(n,o.path)))}return{openFiles:t,externallyChanged:n}}),await Promise.allSettled(r.map(e=>t().loadGitDiff(n,e.path)))},markExternallyChanged:t=>{e(e=>({externallyChanged:{...e.externallyChanged,[t]:!0}}))},dismissExternallyChanged:t=>{e(e=>({externallyChanged:fr(e.externallyChanged,t)}))},createFile:async(n,r,i)=>{e({error:void 0});try{let e=`${r}/${i}`;return await I.filesWrite(n,e,``),await t().loadTree(n),e}catch(t){throw e({error:t instanceof M?t.code:t.message}),t}},createFolder:async(n,r,i)=>{e({error:void 0});try{await I.filesMkdir(n,r,i),await t().loadTree(n)}catch(t){throw e({error:t instanceof M?t.code:t.message}),t}},renameEntry:async(n,r,i)=>{e({error:void 0});try{let{path:a}=await I.filesRename(n,r,i);return e(e=>({openFiles:e.openFiles.map(e=>e.path===r?{...e,path:a}:e),activePath:e.activePath===r?a:e.activePath})),await t().loadTree(n),a}catch(t){throw e({error:t instanceof M?t.code:t.message}),t}},moveEntry:async(n,r,i)=>{e({error:void 0});try{let{path:a}=await I.filesMove(n,r,i);return e(e=>({openFiles:e.openFiles.map(e=>{if(e.path===r)return{...e,path:a};let t=`${r}/`;return e.path.startsWith(t)?{...e,path:`${a}/${e.path.slice(t.length)}`}:e}),activePath:e.activePath===r?a:e.activePath!==void 0&&e.activePath.startsWith(`${r}/`)?`${a}/${e.activePath.slice(r.length+1)}`:e.activePath})),await t().loadTree(n),a}catch(t){throw e({error:t instanceof M?t.code:t.message}),t}},deleteEntry:async(n,r,i)=>{e({error:void 0});try{await I.filesDelete(n,r,i?.recursive===!0?{recursive:!0}:void 0),t().openFiles.find(e=>e.path===r)!==void 0&&t().closeFile(r),await t().loadTree(n)}catch(t){throw e({error:t instanceof M?t.code:t.message}),t}},uploadFiles:async(n,r,i,a)=>{e({error:void 0});try{let e=await I.uploadFiles(n,r,i,{...a?.overwrite===void 0?{}:{overwrite:a.overwrite},...a?.onHashProgress===void 0?{}:{onHashProgress:a.onHashProgress}});return await t().loadTree(n),e.files}catch(t){throw e({error:t instanceof M?t.code:t.message}),t}}}));function dr(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`tab-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function fr(e,t){if(e[t]===void 0)return e;let n={...e};return delete n[t],n}var pr=Qe(e=>({loaded:!1,minimal:!1,workspaceRoot:``,version:``,passwordAuthEnabled:!0,error:void 0,load:async()=>{try{let t=await I.uiConfig();e({loaded:!0,minimal:t.minimal,workspaceRoot:t.workspaceRoot,version:t.version,passwordAuthEnabled:t.passwordAuthEnabled,error:void 0})}catch(t){let n=t instanceof M?t.code:t.message;typeof console<`u`&&console.warn(`[ui-config] load failed:`,n),e({loaded:!0,error:n})}}})),mr=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})),hr=o(((e,t)=>{t.exports=mr()})),L=hr();function gr(){let[e,t]=(0,v.useState)(``),n=Cn(e=>e.login),r=Cn(e=>e.loginPending),i=Cn(e=>e.loginError);return(0,L.jsx)(`main`,{className:`flex min-h-screen items-center justify-center px-4`,children:(0,L.jsxs)(`form`,{onSubmit:t=>{t.preventDefault(),e.length!==0&&n(e)},className:`w-full max-w-sm space-y-4 rounded-lg border border-neutral-800 bg-neutral-900 p-6 shadow-lg`,children:[(0,L.jsxs)(`header`,{className:`space-y-1`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`img`,{src:`/icons/icon.svg`,alt:``,className:`h-6 w-6`,"aria-hidden":`true`}),(0,L.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight`,children:`pi-forge`})]}),(0,L.jsx)(`p`,{className:`text-sm text-neutral-400`,children:`Enter the pi-forge password to continue.`})]}),(0,L.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,L.jsx)(`span`,{className:`text-sm font-medium text-neutral-300`,children:`Password`}),(0,L.jsx)(`input`,{type:`password`,value:e,onChange:e=>t(e.target.value),autoFocus:!0,autoComplete:`current-password`,className:`w-full rounded-md border border-neutral-700 bg-neutral-950 px-3 py-2 text-sm outline-none focus:border-neutral-500`})]}),i!==void 0&&(0,L.jsx)(`p`,{role:`alert`,className:`text-sm text-red-400`,children:i===`invalid_password`?`Incorrect password.`:`Login failed: ${i}`}),(0,L.jsx)(`button`,{type:`submit`,disabled:r||e.length===0,className:`w-full rounded-md bg-neutral-100 px-3 py-2 text-sm font-medium text-neutral-900 transition hover:bg-white disabled:cursor-not-allowed disabled:opacity-50`,children:r?`Signing in…`:`Sign in`})]})})}var _r=8;function vr(){let[e,t]=(0,v.useState)(``),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(void 0),c=Cn(e=>e.changePassword),l=Cn(e=>e.changePasswordPending),u=Cn(e=>e.changePasswordError),d=Cn(e=>e.logout),f=t=>{if(t.preventDefault(),s(void 0),n.length<_r){s(`new password must be at least ${_r} characters`);return}if(n!==i){s(`new password and confirmation do not match`);return}if(n===e){s(`new password must differ from the current one`);return}c(e,n)},p=o??yr(u);return(0,L.jsx)(`main`,{className:`flex min-h-screen items-center justify-center px-4`,children:(0,L.jsxs)(`form`,{onSubmit:f,className:`w-full max-w-sm space-y-4 rounded-lg border border-neutral-800 bg-neutral-900 p-6 shadow-lg`,children:[(0,L.jsxs)(`header`,{className:`space-y-1`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`img`,{src:`/icons/icon.svg`,alt:``,className:`h-6 w-6`,"aria-hidden":`true`}),(0,L.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight`,children:`Set a new password`})]}),(0,L.jsx)(`p`,{className:`text-sm text-neutral-400`,children:`You signed in with the deployment-supplied initial password. Pick a new one before continuing — it will be stored as a hash on the pi-forge data volume.`})]}),(0,L.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,L.jsx)(`span`,{className:`text-sm font-medium text-neutral-300`,children:`Current password`}),(0,L.jsx)(`input`,{type:`password`,value:e,onChange:e=>t(e.target.value),autoFocus:!0,autoComplete:`current-password`,className:`w-full rounded-md border border-neutral-700 bg-neutral-950 px-3 py-2 text-sm outline-none focus:border-neutral-500`})]}),(0,L.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,L.jsx)(`span`,{className:`text-sm font-medium text-neutral-300`,children:`New password`}),(0,L.jsx)(`input`,{type:`password`,value:n,onChange:e=>r(e.target.value),autoComplete:`new-password`,minLength:_r,className:`w-full rounded-md border border-neutral-700 bg-neutral-950 px-3 py-2 text-sm outline-none focus:border-neutral-500`})]}),(0,L.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,L.jsx)(`span`,{className:`text-sm font-medium text-neutral-300`,children:`Confirm new password`}),(0,L.jsx)(`input`,{type:`password`,value:i,onChange:e=>a(e.target.value),autoComplete:`new-password`,minLength:_r,className:`w-full rounded-md border border-neutral-700 bg-neutral-950 px-3 py-2 text-sm outline-none focus:border-neutral-500`})]}),p!==void 0&&(0,L.jsx)(`p`,{role:`alert`,className:`text-sm text-red-400`,children:p}),(0,L.jsx)(`button`,{type:`submit`,disabled:l||e.length===0||n.length===0,className:`w-full rounded-md bg-neutral-100 px-3 py-2 text-sm font-medium text-neutral-900 transition hover:bg-white disabled:cursor-not-allowed disabled:opacity-50`,children:l?`Saving…`:`Set new password`}),(0,L.jsx)(`button`,{type:`button`,onClick:d,className:`w-full rounded-md border border-neutral-700 px-3 py-2 text-xs text-neutral-400 hover:border-neutral-500 hover:text-neutral-200`,children:`Sign out`})]})})}function yr(e){if(e!==void 0)switch(e){case`invalid_password`:return`Current password is incorrect.`;case`password_unchanged`:return`New password must differ from the current one.`;case`ui_password_not_configured`:return`Password auth is not configured on this server.`;case`auth_required`:return`Session expired — sign in again.`;default:return`Could not change password: ${e}`}}function br({onClose:e,required:t=!1}){let n=On(e=>e.create),r=pr(e=>e.minimal),i=pr(e=>e.workspaceRoot),[a,o]=(0,v.useState)(`name`),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(),[p,m]=(0,v.useState)(),[h,g]=(0,v.useState)(null),[_,y]=(0,v.useState)([]),[b,x]=(0,v.useState)(!1),[S,C]=(0,v.useState)(``),[w,T]=(0,v.useState)(!1);(0,v.useEffect)(()=>{if(a!==`browse`)return;let e=!1;return x(!0),f(void 0),I.browse(p).then(t=>{e||(m(t.path),g(t.parentPath),y(t.entries))}).catch(t=>{e||f(t instanceof M?t.code:t.message)}).finally(()=>{e||x(!1)}),()=>{e=!0}},[a,p]);let E=async()=>{let t=s.trim();if(t.length!==0){if(!r){o(`browse`);return}if(i.length===0){f(`workspace_not_loaded`);return}u(!0),f(void 0);try{let{path:r}=await I.mkdir(i,t);await n(t,r),e()}catch(e){f(e instanceof M?e.code:e.message),u(!1)}}},D=async t=>{if(!l){if(i.length>0&&t===i){f(`workspace_root_not_allowed`);return}u(!0),f(void 0);try{await n(s.trim(),t),e()}catch(e){f(e instanceof M?e.code:e.message),u(!1)}}},O=()=>{h!==null&&m(h)},ee=async()=>{if(!(!p||S.trim().length===0)){f(void 0);try{let{path:e}=await I.mkdir(p,S.trim());C(``),T(!1),await D(e)}catch(e){f(e instanceof M?e.code:e.message)}}};return(0,L.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 px-4`,children:(0,L.jsxs)(`div`,{className:`w-full max-w-lg rounded-lg border border-neutral-800 bg-neutral-900 p-6 shadow-xl`,children:[(0,L.jsxs)(`header`,{className:`mb-4 flex items-center justify-between`,children:[(0,L.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight`,children:a===`name`?`New project`:`Pick a folder for "${s.trim()}"`}),!t&&(0,L.jsx)(`button`,{onClick:e,className:`rounded-md px-2 py-1 text-sm text-neutral-400 hover:bg-neutral-800`,children:`Cancel`})]}),a===`name`&&(0,L.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),E()},className:`space-y-4`,children:[(0,L.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,L.jsx)(`span`,{className:`text-sm font-medium text-neutral-300`,children:`Project name`}),(0,L.jsx)(`input`,{value:s,onChange:e=>c(e.target.value),autoFocus:!0,className:`w-full rounded-md border border-neutral-700 bg-neutral-950 px-3 py-2 text-sm outline-none focus:border-neutral-500`}),r&&i.length>0&&(0,L.jsxs)(`span`,{className:`block font-mono text-[11px] text-neutral-500`,children:[`Will create `,i,`/`,s.trim().length>0?s.trim():`<name>`]})]}),d!==void 0&&(0,L.jsxs)(`p`,{className:`text-xs text-red-400`,children:[`Error: `,d]}),(0,L.jsx)(`button`,{type:`submit`,disabled:s.trim().length===0||l,className:`w-full rounded-md bg-neutral-100 px-3 py-2 text-sm font-medium text-neutral-900 disabled:opacity-50`,children:r?l?`Creating…`:`Create project`:`Next: pick folder`})]}),a===`browse`&&(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-neutral-400`,children:[(0,L.jsx)(`button`,{onClick:O,disabled:h===null,className:`rounded-md border border-neutral-700 px-2 py-1 hover:bg-neutral-800 disabled:cursor-not-allowed disabled:opacity-40`,title:h===null?`At workspace root`:`Up one folder`,children:`↑ up`}),(0,L.jsx)(`code`,{className:`truncate font-mono text-neutral-300`,children:p??`(loading)`})]}),(0,L.jsxs)(`div`,{className:`max-h-64 overflow-y-auto rounded-md border border-neutral-800 bg-neutral-950`,children:[b&&(0,L.jsx)(`div`,{className:`px-3 py-2 text-sm text-neutral-400`,children:`Loading…`}),!b&&_.length===0&&(0,L.jsx)(`div`,{className:`px-3 py-2 text-sm text-neutral-400`,children:`(empty)`}),!b&&_.map(e=>(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-neutral-800 px-3 py-2 text-sm last:border-b-0`,children:[(0,L.jsxs)(`button`,{onClick:()=>m(e.path),className:`flex flex-1 items-center gap-2 text-left text-neutral-200 hover:text-white`,children:[(0,L.jsx)(`span`,{children:`📁`}),(0,L.jsx)(`span`,{className:`truncate`,children:e.name}),e.isGitRepo&&(0,L.jsx)(`span`,{className:`rounded-sm bg-neutral-800 px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-neutral-300`,children:`git`})]}),(0,L.jsx)(`button`,{onClick:()=>void D(e.path),disabled:l,className:`rounded-md border border-neutral-700 px-2 py-1 text-xs text-neutral-200 hover:bg-neutral-800 disabled:opacity-50`,children:`Select`})]},e.path))]}),w?(0,L.jsxs)(`div`,{className:`flex gap-2`,children:[(0,L.jsx)(`input`,{value:S,onChange:e=>C(e.target.value),placeholder:`folder name`,className:`flex-1 rounded-md border border-neutral-700 bg-neutral-950 px-3 py-2 text-sm`,autoFocus:!0}),(0,L.jsx)(`button`,{onClick:()=>void ee(),className:`rounded-md bg-neutral-100 px-3 py-2 text-sm font-medium text-neutral-900`,children:`Create + select`}),(0,L.jsx)(`button`,{onClick:()=>{T(!1),C(``)},className:`rounded-md border border-neutral-700 px-3 py-2 text-sm text-neutral-300`,children:`Cancel`})]}):(0,L.jsxs)(`div`,{className:`flex justify-between gap-2`,children:[(0,L.jsx)(`button`,{onClick:()=>o(`name`),className:`rounded-md border border-neutral-700 px-3 py-2 text-sm text-neutral-300`,children:`← Back`}),(0,L.jsxs)(`div`,{className:`flex gap-2`,children:[(0,L.jsx)(`button`,{onClick:()=>T(!0),className:`rounded-md border border-neutral-700 px-3 py-2 text-sm text-neutral-300`,children:`+ New folder`}),(0,L.jsx)(`button`,{onClick:()=>p&&void D(p),disabled:!p||l||i.length>0&&p===i,className:`rounded-md bg-neutral-100 px-3 py-2 text-sm font-medium text-neutral-900 disabled:opacity-50`,title:i.length>0&&p===i?`Pick a sub-folder — the workspace root itself can't be a project.`:`Use this folder as the project root`,children:`Select this folder`})]})]})]}),d!==void 0&&(0,L.jsx)(`p`,{className:`mt-3 text-sm text-red-400`,children:d===`path_not_allowed`?`That folder is outside the workspace root.`:d===`workspace_root_not_allowed`?`Pick a sub-folder — the workspace root itself can't be a project.`:d===`not_a_directory`?`That path is not a directory.`:d===`already_exists`?`A folder with that name already exists.`:d===`duplicate_path`?`Another project already points at that folder.`:d===`network_error`?`Couldn't reach the server.`:`Error: ${d}`})]})})}function xr({open:e,onClose:t,title:n,children:r,width:i=`max-w-sm`,initialFocusRef:a}){let o=(0,v.useRef)(null),s=(0,v.useId)(),c=(0,v.useRef)(t),l=(0,v.useRef)(a);return(0,v.useEffect)(()=>{c.current=t}),(0,v.useEffect)(()=>{l.current=a}),(0,v.useEffect)(()=>{if(!e)return;let t=document.activeElement,n=o.current,r=e=>{if(e.key===`Escape`){e.preventDefault(),c.current();return}if(e.key===`Tab`&&o.current!==null){let t=o.current.querySelectorAll(`a[href], button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])`);if(t.length===0)return;let n=t[0],r=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),r.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n.focus())}};document.addEventListener(`keydown`,r);let i=window.setTimeout(()=>{let e=l.current?.current;if(e!=null){e.focus();return}(o.current?.querySelector(`a[href], button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])`))?.focus()},0);return()=>{document.removeEventListener(`keydown`,r),window.clearTimeout(i),t!==null&&document.contains(t)&&n!==null&&n.contains(document.activeElement)&&t.focus()}},[e]),e?(0,L.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4`,onClick:t,role:`dialog`,"aria-modal":`true`,"aria-labelledby":s,children:(0,L.jsxs)(`div`,{ref:o,className:`w-full ${i} rounded-lg border border-neutral-800 bg-neutral-900 shadow-xl`,onClick:e=>e.stopPropagation(),children:[(0,L.jsxs)(`header`,{className:`flex items-center justify-between border-b border-neutral-800 px-4 py-2`,children:[(0,L.jsx)(`h2`,{id:s,className:`text-sm font-medium text-neutral-100`,children:n}),(0,L.jsx)(`button`,{onClick:t,className:`rounded p-2 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200`,title:`Close (Esc)`,"aria-label":`Close`,children:(0,L.jsx)(Ke,{size:20})})]}),r]})}):null}function Sr({open:e,onClose:t,onSubmit:n,title:r,label:i,initialValue:a=``,placeholder:o,primaryLabel:s=`OK`}){let[c,l]=(0,v.useState)(a),u=(0,v.useRef)(null);(0,v.useEffect)(()=>{e&&l(a)},[e,a]);let d=c.trim(),f=()=>{d.length!==0&&n(d)};return(0,L.jsx)(xr,{open:e,onClose:t,title:r,initialFocusRef:u,children:(0,L.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),f()},className:`flex flex-col gap-3 px-4 py-3`,children:[(0,L.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,L.jsx)(`span`,{className:`text-xs text-neutral-300`,children:i}),(0,L.jsx)(`input`,{ref:u,type:`text`,value:c,onChange:e=>l(e.target.value),placeholder:o,className:`w-full rounded-md border border-neutral-700 bg-neutral-950 px-3 py-1.5 text-sm text-neutral-100 outline-none focus:border-neutral-500`})]}),(0,L.jsxs)(`footer`,{className:`flex justify-end gap-2 pt-1`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:t,className:`rounded-md border border-neutral-700 px-3 py-1 text-xs text-neutral-200 hover:bg-neutral-800`,children:`Cancel`}),(0,L.jsx)(`button`,{type:`submit`,disabled:d.length===0,className:`rounded-md bg-neutral-100 px-3 py-1 text-xs font-medium text-neutral-900 hover:bg-white disabled:cursor-not-allowed disabled:opacity-40`,children:s})]})]})})}function Cr({open:e,onClose:t,onConfirm:n,title:r,message:i,primaryLabel:a=`Confirm`,tone:o=`default`}){return(0,L.jsx)(xr,{open:e,onClose:t,title:r,children:(0,L.jsxs)(`div`,{className:`flex flex-col gap-3 px-4 py-3`,children:[(0,L.jsx)(`p`,{className:`text-xs text-neutral-300`,children:i}),(0,L.jsxs)(`footer`,{className:`flex justify-end gap-2 pt-1`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:t,className:`rounded-md border border-neutral-700 px-3 py-1 text-xs text-neutral-200 hover:bg-neutral-800`,children:`Cancel`}),(0,L.jsx)(`button`,{type:`button`,onClick:n,className:o===`danger`?`rounded-md bg-red-700 px-3 py-1 text-xs font-medium text-red-50 hover:bg-red-600`:`rounded-md bg-neutral-100 px-3 py-1 text-xs font-medium text-neutral-900 hover:bg-white`,children:a})]})]})})}function wr({projectId:e}){let t=$n(t=>t.byProject[e]??Un),n=$n(e=>e.activeSessionId),r=$n(e=>e.loadSessionsForProject),i=$n(e=>e.setActiveSession),a=$n(e=>e.disposeSession),o=$n(e=>e.renameSession),s=On(e=>e.setActive),c=On(e=>e.activeProjectId),l=t=>{c!==e&&s(e),i(t)},[u,d]=(0,v.useState)(void 0),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(void 0),[g,_]=(0,v.useState)(new Set),y=()=>_(new Set),b=e=>{_(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[x,S]=(0,v.useState)(new Map),C=(e,t)=>{S(n=>{let r=new Map(n);return r.set(e,!t),r})},{topLevel:w,childrenByParent:T}=(0,v.useMemo)(()=>{let n=new Map,r=new Set(t.filter(e=>e.parentSessionId===void 0).map(e=>e.sessionId));for(let e of t){if(e.parentSessionId===void 0||!r.has(e.parentSessionId))continue;let t=n.get(e.parentSessionId);t===void 0?n.set(e.parentSessionId,[e]):t.push(e)}let i=t.filter(e=>e.parentSessionId===void 0||!r.has(e.parentSessionId));return t.some(e=>e.parentSessionId!==void 0)&&console.info(`[subagent] SessionList grouping`,{projectId:e,sessionCount:t.length,topLevelCount:i.length,childCount:Array.from(n.values()).reduce((e,t)=>e+t.length,0),topLevelIds:Array.from(r),parentIdsOnChildren:t.filter(e=>e.parentSessionId!==void 0).map(e=>e.parentSessionId),bucketed:Array.from(n.keys())}),{topLevel:i,childrenByParent:n}},[t,e]),E=async()=>{if(m!==void 0){if(h(void 0),m.kind===`single`){a(m.sessionId,{hard:!0});return}for(let e of m.sessionIds)try{await a(e,{hard:!0})}catch{}y()}};(0,v.useEffect)(()=>{r(e)},[e,r]);let D=(e,t)=>{d(e),p(t)},O=()=>{d(void 0),p(``)},ee=async e=>{let t=f.trim();O();try{await o(e,t)}catch{}},te=(e,t)=>{e.key===`Enter`?(e.preventDefault(),ee(t)):e.key===`Escape`&&(e.preventDefault(),O())};return(0,L.jsxs)(`div`,{className:`ml-6 mt-1 space-y-0.5`,children:[t.length===0&&(0,L.jsx)(`p`,{className:`px-2 py-1 text-xs italic text-neutral-600`,children:`No sessions yet.`}),g.size>0&&(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded bg-neutral-900/60 px-2 py-1 text-[11px] text-neutral-300`,children:[(0,L.jsxs)(`span`,{children:[g.size,` selected`]}),(0,L.jsxs)(`div`,{className:`flex gap-1`,children:[(0,L.jsx)(`button`,{onClick:()=>h({kind:`many`,sessionIds:Array.from(g)}),className:`rounded border border-red-700/50 px-1.5 py-0.5 text-red-300 hover:bg-red-900/20`,children:`Delete`}),(0,L.jsx)(`button`,{onClick:y,className:`rounded border border-neutral-700 px-1.5 py-0.5 text-neutral-300 hover:border-neutral-500`,children:`Clear`})]})]}),w.flatMap(e=>{let t=T.get(e.sessionId)??[],r=x.get(e.sessionId)===!0,i=[(0,L.jsx)(Tr,{session:e,isActive:e.sessionId===n,isSelected:g.has(e.sessionId),isRenaming:u===e.sessionId,renameDraft:f,childCount:t.length,isExpanded:r,isChild:!1,onSelect:l,onToggleSelect:b,onStartRename:D,onChangeRename:p,onRenameKeyDown:te,onCommitRename:e=>void ee(e),onToggleExpanded:C,onAskDelete:e=>h(e)},e.sessionId)];if(r)for(let e of t)i.push((0,L.jsx)(Tr,{session:e,isActive:e.sessionId===n,isSelected:g.has(e.sessionId),isRenaming:u===e.sessionId,renameDraft:f,childCount:0,isExpanded:!1,isChild:!0,onSelect:l,onToggleSelect:b,onStartRename:D,onChangeRename:p,onRenameKeyDown:te,onCommitRename:e=>void ee(e),onToggleExpanded:C,onAskDelete:e=>h(e)},e.sessionId));return i}),(0,L.jsx)(Cr,{open:m!==void 0,onClose:()=>h(void 0),onConfirm:()=>void E(),title:m?.kind===`many`?`Delete ${m.sessionIds.length} session${m.sessionIds.length===1?``:`s`}`:`Delete session "${m?.label??``}"`,message:m?.kind===`many`?`Delete the ${m.sessionIds.length} selected session${m.sessionIds.length===1?``:`s`}? Live sessions are killed and on-disk JSONLs are removed. Cannot be undone.`:m?.kind===`single`&&m.isLive?`Delete "${m.label}"? This kills the live shell AND removes the on-disk JSONL. Cannot be undone.`:m?.kind===`single`?`Delete the on-disk JSONL for "${m.label}"? Cannot be undone — the file is the only copy.`:``,primaryLabel:m?.kind===`many`?`Delete all`:`Delete`,tone:`danger`})]})}function Tr(e){let{session:t,isActive:n,isSelected:r,isRenaming:i,renameDraft:a,childCount:o,isExpanded:s,isChild:c,onSelect:l,onToggleSelect:u,onStartRename:d,onChangeRename:f,onRenameKeyDown:p,onCommitRename:m,onToggleExpanded:h,onAskDelete:g}=e,_=t.name??(t.firstMessage.length>0?t.firstMessage.slice(0,40):`session ${t.sessionId.slice(0,6)}`);return(0,L.jsxs)(`div`,{className:`group flex items-center gap-1 rounded border-l-2 ${c?`ml-4`:``} px-2 py-0.5 text-xs ${r?`border-blue-400 bg-blue-500/15 text-neutral-100 hover:bg-blue-500/25`:n?`border-transparent bg-neutral-800 text-neutral-100`:`border-transparent text-neutral-400 hover:bg-neutral-900 hover:text-neutral-200`}`,children:[o>0?(0,L.jsx)(`button`,{onClick:()=>h(t.sessionId,s),className:`inline-flex h-4 w-4 shrink-0 items-center justify-center text-neutral-500 hover:text-neutral-200`,title:`${o} sub-agent session${o===1?``:`s`}`,"aria-label":s?`Collapse sub-agents`:`Expand sub-agents`,children:s?(0,L.jsx)(le,{size:12}):(0,L.jsx)(ue,{size:12})}):(0,L.jsx)(`span`,{className:`inline-block h-4 w-4 shrink-0`,"aria-hidden":`true`}),i?(0,L.jsx)(`input`,{autoFocus:!0,value:a,onChange:e=>f(e.target.value),onKeyDown:e=>p(e,t.sessionId),onBlur:()=>m(t.sessionId),placeholder:_,maxLength:200,className:`flex-1 rounded border border-neutral-700 bg-neutral-950 px-1.5 py-0.5 text-xs text-neutral-100 outline-none focus:border-neutral-500`}):(0,L.jsxs)(`button`,{onClick:e=>{if(e.metaKey||e.ctrlKey){u(t.sessionId);return}l(t.sessionId)},onDoubleClick:()=>d(t.sessionId,t.name??``),className:`flex-1 truncate text-left`,title:`${t.sessionId} — double-click to rename, Cmd/Ctrl+click to select for bulk delete`,children:[t.isLive&&(0,L.jsx)(`span`,{className:`mr-1 text-emerald-500`,children:`●`}),c&&(0,L.jsx)(`span`,{className:`mr-1 text-purple-400`,title:`sub-agent`,children:`↳`}),_]}),!i&&(0,L.jsx)(`button`,{onClick:()=>g({kind:`single`,sessionId:t.sessionId,label:_,isLive:t.isLive}),className:`inline-flex items-center p-1 text-neutral-500 hover:text-red-400`,title:t.isLive?`Delete session — also kills the live shell`:`Delete session JSONL from disk`,children:(0,L.jsx)(Ke,{size:16})})]})}function Er(){let e=On(e=>e.projects),t=On(e=>e.activeProjectId),n=On(e=>e.collapsed),r=On(e=>e.setActive),i=On(e=>e.toggleCollapsed),a=On(e=>e.remove),o=On(e=>e.rename),s=$n(e=>e.byProject),c=$n(e=>e.createSession),l=async e=>{t!==e&&r(e);try{await c(e)}catch{}},[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(),[m,h]=(0,v.useState)(``),[g,_]=(0,v.useState)(void 0),y=(e,t)=>{let n=s[e]??[],r=n.filter(e=>e.isLive).length;if(r>0){alert(`Cannot delete "${t}" — it has ${r} live session${r===1?``:`s`}. Dispose ${r===1?`it`:`them`} first (× next to each session in the sidebar), then try again.`);return}let i=n.filter(e=>!e.isLive).length;_({id:e,name:t,onDiskCount:i,cascade:!1})},b=async()=>{if(g===void 0)return;let{id:e,cascade:t}=g;_(void 0),a(e,{cascade:t})},x=async e=>{let t=m.trim();if(t.length===0){p(void 0);return}try{await o(e,t)}finally{p(void 0),h(``)}};return(0,L.jsxs)(`aside`,{className:`flex h-full w-64 flex-col border-r border-neutral-800 bg-neutral-950`,children:[(0,L.jsxs)(`header`,{className:`flex items-center justify-between border-b border-neutral-800 px-3 py-2`,children:[(0,L.jsx)(`span`,{className:`text-xs font-semibold uppercase tracking-wider text-neutral-400`,children:`Projects`}),(0,L.jsx)(`button`,{onClick:()=>d(!0),className:`rounded-md border border-neutral-700 px-2 py-0.5 text-xs text-neutral-200 hover:bg-neutral-800`,children:`+ New`})]}),(0,L.jsxs)(`div`,{className:`flex-1 overflow-y-auto py-1`,children:[e.length===0&&(0,L.jsx)(`p`,{className:`px-3 py-4 text-sm text-neutral-500`,children:`No projects yet.`}),e.map(e=>{let a=e.id===t,o=n[e.id]??!1;return(0,L.jsxs)(`div`,{className:`mt-1 px-1`,children:[(0,L.jsxs)(`div`,{className:`group flex items-center gap-1 rounded-md px-2 py-1 text-sm ${a?`bg-neutral-800 text-neutral-100`:`text-neutral-300 hover:bg-neutral-900`}`,children:[(0,L.jsx)(`button`,{onClick:()=>i(e.id),className:`flex items-center text-neutral-500 hover:text-neutral-300`,title:o?`Expand`:`Collapse`,children:o?(0,L.jsx)(ue,{size:16}):(0,L.jsx)(le,{size:16})}),f===e.id?(0,L.jsx)(`input`,{value:m,onChange:e=>h(e.target.value),onBlur:()=>void x(e.id),onKeyDown:t=>{t.key===`Enter`&&x(e.id),t.key===`Escape`&&p(void 0)},autoFocus:!0,className:`flex-1 rounded border border-neutral-700 bg-neutral-950 px-1 py-0.5 text-sm`}):(0,L.jsx)(`button`,{onClick:()=>r(e.id),onDoubleClick:()=>{p(e.id),h(e.name)},className:`flex-1 truncate text-left`,title:e.path,children:e.name}),(0,L.jsx)(`button`,{onClick:()=>void l(e.id),className:`inline-flex p-1 text-neutral-500 hover:text-neutral-200`,title:`New session in this project`,children:(0,L.jsx)(Me,{size:16})}),(0,L.jsx)(`button`,{onClick:()=>y(e.id,e.name),className:`inline-flex items-center p-1 text-neutral-500 hover:text-red-400`,title:`Delete project (blocked while live sessions exist)`,children:(0,L.jsx)(Ke,{size:16})})]}),!o&&(0,L.jsx)(wr,{projectId:e.id})]},e.id)})]}),u&&(0,L.jsx)(br,{onClose:()=>d(!1)}),(0,L.jsx)(xr,{open:g!==void 0,onClose:()=>_(void 0),title:g===void 0?`Delete project`:`Delete project "${g.name}"`,children:g!==void 0&&(0,L.jsxs)(`div`,{className:`flex flex-col gap-3 px-4 py-3`,children:[(0,L.jsxs)(`p`,{className:`text-xs text-neutral-300`,children:[`Remove "`,g.name,`" from the pi-forge. The project folder on disk is`,` `,(0,L.jsx)(`strong`,{children:`not`}),` deleted; only the pi-forge's record of it goes away.`]}),g.onDiskCount>0&&(0,L.jsxs)(`label`,{className:`flex items-start gap-2 rounded border border-neutral-800 bg-neutral-950 px-2 py-1.5 text-xs text-neutral-300`,children:[(0,L.jsx)(`input`,{type:`checkbox`,checked:g.cascade,onChange:e=>_(t=>t===void 0?t:{...t,cascade:e.target.checked}),className:`mt-0.5 h-3 w-3`}),(0,L.jsxs)(`span`,{children:[`Also delete `,g.onDiskCount,` on-disk session file`,g.onDiskCount===1?``:`s`,` (under`,` `,(0,L.jsxs)(`code`,{className:`font-mono text-[10px] text-neutral-400`,children:[`.pi/sessions/`,g.id,`/`]}),`). Without this, the JSONLs stay on disk and become orphaned — recoverable but not reachable through the pi-forge.`]})]}),g.onDiskCount===0&&(0,L.jsx)(`p`,{className:`text-[11px] italic text-neutral-500`,children:`No on-disk sessions for this project; nothing to clean up beyond the project record.`}),(0,L.jsxs)(`footer`,{className:`flex justify-end gap-2 pt-1`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:()=>_(void 0),className:`rounded-md border border-neutral-700 px-3 py-1 text-xs text-neutral-200 hover:bg-neutral-800`,children:`Cancel`}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>void b(),className:`rounded-md bg-red-700 px-3 py-1 text-xs font-medium text-red-50 hover:bg-red-600`,children:`Delete`})]})]})})]})}function Dr(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Dr(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Or(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Dr(e))&&(r&&(r+=` `),r+=t);return r}var kr=Object.create,Ar=Object.defineProperty,jr=Object.defineProperties,Mr=Object.getOwnPropertyDescriptor,Nr=Object.getOwnPropertyDescriptors,Pr=Object.getOwnPropertyNames,Fr=Object.getOwnPropertySymbols,Ir=Object.getPrototypeOf,Lr=Object.prototype.hasOwnProperty,Rr=Object.prototype.propertyIsEnumerable,zr=(e,t,n)=>t in e?Ar(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Br=(e,t)=>{for(var n in t||={})Lr.call(t,n)&&zr(e,n,t[n]);if(Fr)for(var n of Fr(t))Rr.call(t,n)&&zr(e,n,t[n]);return e},Vr=(e,t)=>jr(e,Nr(t)),Hr=(e,t)=>{var n={};for(var r in e)Lr.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Fr)for(var r of Fr(e))t.indexOf(r)<0&&Rr.call(e,r)&&(n[r]=e[r]);return n},Ur=(e,t)=>function(){return t||(0,e[Pr(e)[0]])((t={exports:{}}).exports,t),t.exports},Wr=(e,t)=>{for(var n in t)Ar(e,n,{get:t[n],enumerable:!0})},Gr=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of Pr(t))!Lr.call(e,i)&&i!==n&&Ar(e,i,{get:()=>t[i],enumerable:!(r=Mr(t,i))||r.enumerable});return e},R=((e,t,n)=>(n=e==null?{}:kr(Ir(e)),Gr(t||!e||!e.__esModule?Ar(n,`default`,{value:e,enumerable:!0}):n,e)))(Ur({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(e,t){var n=function(){var e=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,t=0,n={},r={util:{encode:function e(t){return t instanceof i?new i(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/\u00a0/g,` `)},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,`__id`,{value:++t}),e.__id},clone:function e(t,n){n||={};var i,a;switch(r.util.type(t)){case`Object`:if(a=r.util.objId(t),n[a])return n[a];for(var o in i={},n[a]=i,t)t.hasOwnProperty(o)&&(i[o]=e(t[o],n));return i;case`Array`:return a=r.util.objId(t),n[a]?n[a]:(i=[],n[a]=i,t.forEach(function(t,r){i[r]=e(t,n)}),i);default:return t}},getLanguage:function(t){for(;t;){var n=e.exec(t.className);if(n)return n[1].toLowerCase();t=t.parentElement}return`none`},setLanguage:function(t,n){t.className=t.className.replace(RegExp(e,`gi`),``),t.classList.add(`language-`+n)},isActive:function(e,t,n){for(var r=`no-`+t;e;){var i=e.classList;if(i.contains(t))return!0;if(i.contains(r))return!1;e=e.parentElement}return!!n}},languages:{plain:n,plaintext:n,text:n,txt:n,extend:function(e,t){var n=r.util.clone(r.languages[e]);for(var i in t)n[i]=t[i];return n},insertBefore:function(e,t,n,i){i||=r.languages;var a=i[e],o={};for(var s in a)if(a.hasOwnProperty(s)){if(s==t)for(var c in n)n.hasOwnProperty(c)&&(o[c]=n[c]);n.hasOwnProperty(s)||(o[s]=a[s])}var l=i[e];return i[e]=o,r.languages.DFS(r.languages,function(t,n){n===l&&t!=e&&(this[t]=o)}),o},DFS:function e(t,n,i,a){a||={};var o=r.util.objId;for(var s in t)if(t.hasOwnProperty(s)){n.call(t,s,t[s],i||s);var c=t[s],l=r.util.type(c);l===`Object`&&!a[o(c)]?(a[o(c)]=!0,e(c,n,null,a)):l===`Array`&&!a[o(c)]&&(a[o(c)]=!0,e(c,n,s,a))}}},plugins:{},highlight:function(e,t,n){var a={code:e,grammar:t,language:n};if(r.hooks.run(`before-tokenize`,a),!a.grammar)throw Error(`The language "`+a.language+`" has no grammar.`);return a.tokens=r.tokenize(a.code,a.grammar),r.hooks.run(`after-tokenize`,a),i.stringify(r.util.encode(a.tokens),a.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new s;return c(i,i.head,e),o(e,i,t,i.head,0),u(i)},hooks:{all:{},add:function(e,t){var n=r.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=r.hooks.all[e];if(!(!n||!n.length))for(var i=0,a;a=n[i++];)a(t)}},Token:i};function i(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||``).length|0}i.stringify=function e(t,n){if(typeof t==`string`)return t;if(Array.isArray(t)){var i=``;return t.forEach(function(t){i+=e(t,n)}),i}var a={type:t.type,content:e(t.content,n),tag:`span`,classes:[`token`,t.type],attributes:{},language:n},o=t.alias;o&&(Array.isArray(o)?Array.prototype.push.apply(a.classes,o):a.classes.push(o)),r.hooks.run(`wrap`,a);var s=``;for(var c in a.attributes)s+=` `+c+`="`+(a.attributes[c]||``).replace(/"/g,`&quot;`)+`"`;return`<`+a.tag+` class="`+a.classes.join(` `)+`"`+s+`>`+a.content+`</`+a.tag+`>`};function a(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var a=i[1].length;i.index+=a,i[0]=i[0].slice(a)}return i}function o(e,t,n,s,u,d){for(var f in n)if(!(!n.hasOwnProperty(f)||!n[f])){var p=n[f];p=Array.isArray(p)?p:[p];for(var m=0;m<p.length;++m){if(d&&d.cause==f+`,`+m)return;var h=p[m],g=h.inside,_=!!h.lookbehind,v=!!h.greedy,y=h.alias;if(v&&!h.pattern.global){var b=h.pattern.toString().match(/[imsuy]*$/)[0];h.pattern=RegExp(h.pattern.source,b+`g`)}for(var x=h.pattern||h,S=s.next,C=u;S!==t.tail&&!(d&&C>=d.reach);C+=S.value.length,S=S.next){var w=S.value;if(t.length>e.length)return;if(!(w instanceof i)){var T=1,E;if(v){if(E=a(x,C,e,_),!E||E.index>=e.length)break;var D=E.index,O=E.index+E[0].length,ee=C;for(ee+=S.value.length;D>=ee;)S=S.next,ee+=S.value.length;if(ee-=S.value.length,C=ee,S.value instanceof i)continue;for(var te=S;te!==t.tail&&(ee<O||typeof te.value==`string`);te=te.next)T++,ee+=te.value.length;T--,w=e.slice(C,ee),E.index-=C}else if(E=a(x,0,w,_),!E)continue;var D=E.index,ne=E[0],re=w.slice(0,D),k=w.slice(D+ne.length),ie=C+w.length;d&&ie>d.reach&&(d.reach=ie);var ae=S.prev;re&&(ae=c(t,ae,re),C+=re.length),l(t,ae,T);var A=new i(f,g?r.tokenize(ne,g):ne,y,ne);if(S=c(t,ae,A),k&&c(t,S,k),T>1){var oe={cause:f+`,`+m,reach:ie};o(e,t,n,S.prev,C,oe),d&&oe.reach>d.reach&&(d.reach=oe.reach)}}}}}}function s(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function c(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function l(e,t,n){for(var r=t.next,i=0;i<n&&r!==e.tail;i++)r=r.next;t.next=r,r.prev=t,e.length-=i}function u(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}return r}();t.exports=n,n.default=n}})());R.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:`attr-equals`},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:`named-entity`},/&#x?[\da-f]{1,8};/i]},R.languages.markup.tag.inside[`attr-value`].inside.entity=R.languages.markup.entity,R.languages.markup.doctype.inside[`internal-subset`].inside=R.languages.markup,R.hooks.add(`wrap`,function(e){e.type===`entity`&&(e.attributes.title=e.content.replace(/&amp;/,`&`))}),Object.defineProperty(R.languages.markup.tag,`addInlined`,{value:function(e,t){var n={},n=(n[`language-`+t]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:R.languages[t]},n.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}}),t=(n[`language-`+t]={pattern:/[\s\S]+/,inside:R.languages[t]},{});t[e]={pattern:RegExp(`(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)`.replace(/__/g,function(){return e}),`i`),lookbehind:!0,greedy:!0,inside:n},R.languages.insertBefore(`markup`,`cdata`,t)}}),Object.defineProperty(R.languages.markup.tag,`addAttribute`,{value:function(e,t){R.languages.markup.tag.inside[`special-attr`].push({pattern:RegExp(`(^|["'\\s])(?:`+e+`)\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s'">=]+(?=[\\s>]))`,`i`),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,`language-`+t],inside:R.languages[t]},punctuation:[{pattern:/^=/,alias:`attr-equals`},/"|'/]}}}})}}),R.languages.html=R.languages.markup,R.languages.mathml=R.languages.markup,R.languages.svg=R.languages.markup,R.languages.xml=R.languages.extend(`markup`,{}),R.languages.ssml=R.languages.xml,R.languages.atom=R.languages.xml,R.languages.rss=R.languages.xml,function(e){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:`escape`},n=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,r=`(?:[^\\\\-]|`+n.source+`)`,r=RegExp(r+`-`+r),i={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:`variable`};e.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:`operator`},"char-class-punctuation":{pattern:/^\[|\]$/,alias:`punctuation`},range:{pattern:r,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:`operator`}}},"special-escape":t,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:`class-name`},escape:n}},"special-escape":t,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:`class-name`},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:`keyword`},{pattern:/\\k<[^<>']+>/,alias:`keyword`,inside:{"group-name":i}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:`function`},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:`punctuation`,inside:{"group-name":i}},{pattern:/\)/,alias:`punctuation`}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:`number`},alternation:{pattern:/\|/,alias:`keyword`}}}(R),R.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},R.languages.javascript=R.languages.extend(`clike`,{"class-name":[R.languages.clike[`class-name`],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(`(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])`),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),R.languages.javascript[`class-name`][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,R.languages.insertBefore(`javascript`,`keyword`,{regex:{pattern:RegExp(`((?:^|[^$\\w\\xA0-\\uFFFF."'\\])\\s]|\\b(?:return|yield))\\s*)\\/(?:(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))`),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:`language-regex`,inside:R.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:`function`},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:R.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:R.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:R.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:R.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),R.languages.insertBefore(`javascript`,`string`,{hashbang:{pattern:/^#!.*/,greedy:!0,alias:`comment`},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:`string`},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:`punctuation`},rest:R.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:`property`}}),R.languages.insertBefore(`javascript`,`operator`,{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:`property`}}),R.languages.markup&&(R.languages.markup.tag.addInlined(`script`,`javascript`),R.languages.markup.tag.addAttribute(`on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)`,`javascript`)),R.languages.js=R.languages.javascript,R.languages.actionscript=R.languages.extend(`javascript`,{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),R.languages.actionscript[`class-name`].alias=`function`,delete R.languages.actionscript.parameter,delete R.languages.actionscript[`literal-property`],R.languages.markup&&R.languages.insertBefore(`actionscript`,`string`,{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:R.languages.markup}}),function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:`variable`};e.languages.coffeescript=e.languages.extend(`javascript`,{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:`variable`}}),e.languages.insertBefore(`coffeescript`,`comment`,{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:`comment`},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:`regex`,inside:{comment:t,interpolation:n}}}),e.languages.insertBefore(`coffeescript`,`string`,{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:`punctuation`},script:{pattern:/[\s\S]+/,alias:`language-javascript`,inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:`string`},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:`string`,inside:{interpolation:n}}]}),e.languages.insertBefore(`coffeescript`,`keyword`,{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript[`template-string`],e.languages.coffee=e.languages.coffeescript}(R),function(e){var t=e.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(t,`addSupport`,{value:function(t,n){(t=typeof t==`string`?[t]:t).forEach(function(t){var r=function(e){e.inside||={},e.inside.rest=n},i=`doc-comment`;if(a=e.languages[t]){var a,o=a[i];if((o||=(a=e.languages.insertBefore(t,`comment`,{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:`comment`}}))[i])instanceof RegExp&&(o=a[i]={pattern:o}),Array.isArray(o))for(var s=0,c=o.length;s<c;s++)o[s]instanceof RegExp&&(o[s]={pattern:o[s]}),r(o[s]);else r(o)}})}}),t.addSupport([`java`,`javascript`,`php`],t)}(R),function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,t=(e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp(`@[\\w-](?:[^;{\\s"']|\\s+(?!\\s)|`+t.source+`)*?(?:;|(?=\\s*\\{))`),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:`selector`},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp(`\\burl\\((?:`+t.source+`|(?:[^\\\\\\r\\n()"']|\\\\[\\s\\S])*)\\)`,`i`),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp(`^`+t.source+`$`),alias:`url`}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+`)*(?=\\s*\\{)`),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css,e.languages.markup);t&&(t.tag.addInlined(`style`,`css`),t.tag.addAttribute(`style`,`css`))}(R),function(e){var t=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,t=(e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:t={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+t.source+`)*\\]`),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:`keyword`},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[t,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside[`selector-function-argument`].inside=t,e.languages.insertBefore(`css`,`property`,{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore(`css`,`function`,{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:`color`},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:t,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:t,number:n})}(R),function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r=`(?:`+n.source+`(?:[ ]+`+t.source+`)?|`+t.source+`(?:[ ]+`+n.source+`)?)`,i=`(?:[^\\s\\x00-\\x08\\x0e-\\x1f!"#%&'*,\\-:>?@[\\]\`{|}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]|[?:-]<PLAIN>)(?:[ \\t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*`.replace(/<PLAIN>/g,function(){return`[^\\s\\x00-\\x08\\x0e-\\x1f,[\\]{}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]`}),a=`"(?:[^"\\\\\\r\\n]|\\\\.)*"|'(?:[^'\\\\\\r\\n]|\\\\.)*'`;function o(e,t){t=(t||``).replace(/m/g,``)+`m`;var n=`([:\\-,[{]\\s*(?:\\s<<prop>>[ \\t]+)?)(?:<<value>>)(?=[ \\t]*(?:$|,|\\]|\\}|(?:[\\r\\n]\\s*)?#))`.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return e});return RegExp(n,t)}e.languages.yaml={scalar:{pattern:RegExp(`([\\-:]\\s*(?:\\s<<prop>>[ \\t]+)?[|>])[ \\t]*(?:((?:\\r?\\n|\\r)[ \\t]+)\\S[^\\r\\n]*(?:\\2[^\\r\\n]+)*)`.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:`string`},comment:/#.*/,key:{pattern:RegExp(`((?:^|[:\\-,[{\\r\\n?])[ \\t]*(?:<<prop>>[ \\t]+)?)<<key>>(?=\\s*:\\s)`.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return`(?:`+i+`|`+a+`)`})),lookbehind:!0,greedy:!0,alias:`atrule`},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:`important`},datetime:{pattern:o(`\\d{4}-\\d\\d?-\\d\\d?(?:[tT]|[ \\t]+)\\d\\d?:\\d{2}:\\d{2}(?:\\.\\d*)?(?:[ \\t]*(?:Z|[-+]\\d\\d?(?::\\d{2})?))?|\\d{4}-\\d{2}-\\d{2}|\\d\\d?:\\d{2}(?::\\d{2}(?:\\.\\d*)?)?`),lookbehind:!0,alias:`number`},boolean:{pattern:o(`false|true`,`i`),lookbehind:!0,alias:`important`},null:{pattern:o(`null|~`,`i`),lookbehind:!0,alias:`important`},string:{pattern:o(a),lookbehind:!0,greedy:!0},number:{pattern:o(`[+-]?(?:0x[\\da-f]+|0o[0-7]+|(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?|\\.inf|\\.nan)`,`i`),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(R),function(e){var t=`(?:\\\\.|[^\\\\\\n\\r]|(?:\\n|\\r\\n?)(?![\\r\\n]))`;function n(e){return e=e.replace(/<inner>/g,function(){return t}),RegExp(`((?:^|[^\\\\])(?:\\\\{2})*)(?:`+e+`)`)}var r="(?:\\\\.|``(?:[^`\\r\\n]|`(?!`))+``|`[^`\\r\\n]+`|[^\\\\|\\r\\n`])+",i=`\\|?__(?:\\|__)+\\|?(?:(?:\\n|\\r\\n?)|(?![\\s\\S]))`.replace(/__/g,function(){return r}),a=`\\|?[ \\t]*:?-{3,}:?[ \\t]*(?:\\|[ \\t]*:?-{3,}:?[ \\t]*)+\\|?(?:\\n|\\r\\n?)`,o=(e.languages.markdown=e.languages.extend(`markup`,{}),e.languages.insertBefore(`markdown`,`prolog`,{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:[`yaml`,`language-yaml`],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:`punctuation`},table:{pattern:RegExp(`^`+i+a+`(?:`+i+`)*`,`m`),inside:{"table-data-rows":{pattern:RegExp(`^(`+i+a+`)(?:`+i+`)*$`),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp(`^(`+i+`)`+a+`$`),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp(`^`+i+`$`),inside:{"table-header":{pattern:RegExp(r),alias:`important`,inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:`keyword`},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:`important`,inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:`important`,inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:`punctuation`},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:`punctuation`},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:`url`},bold:{pattern:n(`\\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\\b|\\*\\*(?:(?!\\*)<inner>|\\*(?:(?!\\*)<inner>)+\\*)+\\*\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(`\\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\\b|\\*(?:(?!\\*)<inner>|\\*\\*(?:(?!\\*)<inner>)+\\*\\*)+\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(`(~~?)(?:(?!~)<inner>)+\\2`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:[`code`,`keyword`]},url:{pattern:n(`!?\\[(?:(?!\\])<inner>)+\\](?:\\([^\\s)]+(?:[\\t ]+"(?:\\\\.|[^"\\\\])*")?\\)|[ \\t]?\\[(?:(?!\\])<inner>)+\\])`),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),[`url`,`bold`,`italic`,`strike`].forEach(function(t){[`url`,`bold`,`italic`,`strike`,`code-snippet`].forEach(function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])})}),e.hooks.add(`after-tokenize`,function(e){e.language!==`markdown`&&e.language!==`md`||function e(t){if(t&&typeof t!=`string`)for(var n=0,r=t.length;n<r;n++){var i,a=t[n];a.type===`code`?(i=a.content[1],a=a.content[3],i&&a&&i.type===`code-language`&&a.type===`code-block`&&typeof i.content==`string`&&(i=i.content.replace(/\b#/g,`sharp`).replace(/\b\+\+/g,`pp`),i=`language-`+(i=(/[a-z][\w-]*/i.exec(i)||[``])[0].toLowerCase()),a.alias?typeof a.alias==`string`?a.alias=[a.alias,i]:a.alias.push(i):a.alias=[i])):e(a.content)}}(e.tokens)}),e.hooks.add(`wrap`,function(t){if(t.type===`code-block`){for(var n=``,r=0,i=t.classes.length;r<i;r++){var a=t.classes[r],a=/language-(.+)/.exec(a);if(a){n=a[1];break}}var l,u=e.languages[n];u?t.content=e.highlight(function(e){return e=e.replace(o,``),e=e.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(e,t){var n;return(t=t.toLowerCase())[0]===`#`?(n=t[1]===`x`?parseInt(t.slice(2),16):Number(t.slice(1)),c(n)):s[t]||e})}(t.content),u,n):n&&n!==`none`&&e.plugins.autoloader&&(l=`md-`+new Date().valueOf()+`-`+Math.floor(0x2386f26fc10000*Math.random()),t.attributes.id=l,e.plugins.autoloader.loadLanguages(n,function(){var t=document.getElementById(l);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))}))}}),RegExp(e.languages.markup.tag.pattern.source,`gi`)),s={amp:`&`,lt:`<`,gt:`>`,quot:`"`},c=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(R),R.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:`string`,inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:R.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:`function`},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:`class-name`},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:`function`},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:`function`},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:`function`},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},R.hooks.add(`after-tokenize`,function(e){if(e.language===`graphql`)for(var t=e.tokens.filter(function(e){return typeof e!=`string`&&e.type!==`comment`&&e.type!==`scalar`}),n=0;n<t.length;){var r=t[n++];if(r.type===`keyword`&&r.content===`mutation`){var i=[];if(d([`definition-mutation`,`punctuation`])&&u(1).content===`(`){n+=2;var a=f(/^\($/,/^\)$/);if(a===-1)continue;for(;n<a;n++){var o=u(0);o.type===`variable`&&(p(o,`variable-input`),i.push(o.content))}n=a+1}if(d([`punctuation`,`property-query`])&&u(0).content===`{`&&(n++,p(u(0),`property-mutation`),0<i.length)){var s=f(/^\{$/,/^\}$/);if(s!==-1)for(var c=n;c<s;c++){var l=t[c];l.type===`variable`&&0<=i.indexOf(l.content)&&p(l,`variable-input`)}}}}function u(e){return t[n+e]}function d(e,t){t||=0;for(var n=0;n<e.length;n++){var r=u(n+t);if(!r||r.type!==e[n])return}return 1}function f(e,r){for(var i=1,a=n;a<t.length;a++){var o=t[a],s=o.content;if(o.type===`punctuation`&&typeof s==`string`){if(e.test(s))i++;else if(r.test(s)&&--i===0)return a}}return-1}function p(e,t){var n=e.alias;n?Array.isArray(n)||(e.alias=n=[n]):e.alias=n=[],n.push(t)}}),R.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.javascript[`template-string`],n=t.pattern.source,r=t.inside.interpolation,i=r.inside[`interpolation-punctuation`],a=r.pattern.source;function o(t,r){if(e.languages[t])return{pattern:RegExp(`((?:`+r+`)\\s*)`+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:`string`},"embedded-code":{pattern:/[\s\S]+/,alias:t}}}}function s(t,n,r){return t={code:t,grammar:n,language:r},e.hooks.run(`before-tokenize`,t),t.tokens=e.tokenize(t.code,t.grammar),e.hooks.run(`after-tokenize`,t),t.tokens}function c(t,n,o){var c=e.tokenize(t,{interpolation:{pattern:RegExp(a),lookbehind:!0}}),l=0,u={},c=s(c.map(function(e){if(typeof e==`string`)return e;for(var n,r,e=e.content;t.indexOf((r=l++,n=`___`+o.toUpperCase()+`_`+r+`___`))!==-1;);return u[n]=e,n}).join(``),n,o),d=Object.keys(u);return l=0,function t(n){for(var a=0;a<n.length;a++){if(l>=d.length)return;var o,c,f,p,m,h,g,_=n[a];typeof _==`string`||typeof _.content==`string`?(o=d[l],(g=(h=typeof _==`string`?_:_.content).indexOf(o))!==-1&&(++l,c=h.substring(0,g),m=u[o],f=void 0,(p={})[`interpolation-punctuation`]=i,(p=e.tokenize(m,p)).length===3&&((f=[1,1]).push.apply(f,s(p[1],e.languages.javascript,`javascript`)),p.splice.apply(p,f)),f=new e.Token(`interpolation`,p,r.alias,m),p=h.substring(g+o.length),m=[],c&&m.push(c),m.push(f),p&&(t(h=[p]),m.push.apply(m,h)),typeof _==`string`?(n.splice.apply(n,[a,1].concat(m)),a+=m.length-1):_.content=m)):(g=_.content,t(Array.isArray(g)?g:[g]))}}(c),new e.Token(o,c,`language-`+o,t)}e.languages.javascript[`template-string`]=[o(`css`,`\\b(?:styled(?:\\([^)]*\\))?(?:\\s*\\.\\s*\\w+(?:\\([^)]*\\))*)*|css(?:\\s*\\.\\s*(?:global|resolve))?|createGlobalStyle|keyframes)`),o(`html`,`\\bhtml|\\.\\s*(?:inner|outer)HTML\\s*\\+?=`),o(`svg`,`\\bsvg`),o(`markdown`,`\\b(?:markdown|md)`),o(`graphql`,`\\b(?:gql|graphql(?:\\s*\\.\\s*experimental)?)`),o(`sql`,`\\bsql`),t].filter(Boolean);var l={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function u(e){return typeof e==`string`?e:Array.isArray(e)?e.map(u).join(``):u(e.content)}e.hooks.add(`after-tokenize`,function(t){t.language in l&&function t(n){for(var r=0,i=n.length;r<i;r++){var a,o,s,l=n[r];typeof l!=`string`&&(a=l.content,Array.isArray(a)?l.type===`template-string`?(l=a[1],a.length===3&&typeof l!=`string`&&l.type===`embedded-code`&&(o=u(l),l=l.alias,l=Array.isArray(l)?l[0]:l,s=e.languages[l])&&(a[1]=c(o,s,l))):t(a):typeof a!=`string`&&t([a]))}}(t.tokens)})}(R),function(e){e.languages.typescript=e.languages.extend(`javascript`,{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript[`literal-property`];var t=e.languages.extend(`typescript`,{});delete t[`class-name`],e.languages.typescript[`class-name`].inside=t,e.languages.insertBefore(`typescript`,`function`,{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:`operator`},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:t}}}}),e.languages.ts=e.languages.typescript}(R),function(e){var t=e.languages.javascript,n=`\\{(?:[^{}]|\\{(?:[^{}]|\\{[^{}]*\\})*\\})+\\}`,r=`(@(?:arg|argument|param|property)\\s+(?:`+n+`\\s+)?)`;e.languages.jsdoc=e.languages.extend(`javadoclike`,{parameter:{pattern:RegExp(r+`(?:(?!\\s)[$\\w\\xA0-\\uFFFF.])+(?=\\s|$)`),lookbehind:!0,inside:{punctuation:/\./}}}),e.languages.insertBefore(`jsdoc`,`keyword`,{"optional-parameter":{pattern:RegExp(r+`\\[(?:(?!\\s)[$\\w\\xA0-\\uFFFF.])+(?:=[^[\\]]+)?\\](?=\\s|$)`),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:t,alias:`language-javascript`},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(`(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\\s+(?:<TYPE>\\s+)?)[A-Z]\\w*(?:\\.[A-Z]\\w*)*`.replace(/<TYPE>/g,function(){return n})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp(`(@[a-z]+\\s+)`+n),lookbehind:!0,inside:{string:t.string,number:t.number,boolean:t.boolean,keyword:e.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:t,alias:`language-javascript`}}}}),e.languages.javadoclike.addSupport(`javascript`,e.languages.jsdoc)}(R),function(e){e.languages.flow=e.languages.extend(`javascript`,{}),e.languages.insertBefore(`flow`,`keyword`,{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:`class-name`}]}),e.languages.flow[`function-variable`].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete e.languages.flow.parameter,e.languages.insertBefore(`flow`,`operator`,{"flow-punctuation":{pattern:/\{\||\|\}/,alias:`punctuation`}}),Array.isArray(e.languages.flow.keyword)||(e.languages.flow.keyword=[e.languages.flow.keyword]),e.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})}(R),R.languages.n4js=R.languages.extend(`javascript`,{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),R.languages.insertBefore(`n4js`,`constant`,{annotation:{pattern:/@+\w+/,alias:`operator`}}),R.languages.n4jsd=R.languages.n4js,function(e){function t(e,t){return RegExp(e.replace(/<ID>/g,function(){return`(?!\\s)[_$a-zA-Z\\xA0-\\uFFFF](?:(?!\\s)[$\\w\\xA0-\\uFFFF])*`}),t)}e.languages.insertBefore(`javascript`,`function-variable`,{"method-variable":{pattern:RegExp(`(\\.\\s*)`+e.languages.javascript[`function-variable`].pattern.source),lookbehind:!0,alias:[`function-variable`,`method`,`function`,`property-access`]}}),e.languages.insertBefore(`javascript`,`function`,{method:{pattern:RegExp(`(\\.\\s*)`+e.languages.javascript.function.source),lookbehind:!0,alias:[`function`,`property-access`]}}),e.languages.insertBefore(`javascript`,`constant`,{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:`class-name`},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:`class-name`}]}),e.languages.insertBefore(`javascript`,`keyword`,{imports:{pattern:t(`(\\bimport\\b\\s*)(?:<ID>(?:\\s*,\\s*(?:\\*\\s*as\\s+<ID>|\\{[^{}]*\\}))?|\\*\\s*as\\s+<ID>|\\{[^{}]*\\})(?=\\s*\\bfrom\\b)`),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:t(`(\\bexport\\b\\s*)(?:\\*(?:\\s*as\\s+<ID>)?(?=\\s*\\bfrom\\b)|\\{[^{}]*\\})`),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:`module`},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:`control-flow`},{pattern:/\bnull\b/,alias:[`null`,`nil`]},{pattern:/\bundefined\b/,alias:`nil`}),e.languages.insertBefore(`javascript`,`operator`,{spread:{pattern:/\.{3}/,alias:`operator`},arrow:{pattern:/=>/,alias:`operator`}}),e.languages.insertBefore(`javascript`,`punctuation`,{"property-access":{pattern:t(`(\\.\\s*)#?<ID>`),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:`variable`},console:{pattern:/\bconsole(?=\s*\.)/,alias:`class-name`}});for(var n=[`function`,`function-variable`,`method`,`method-variable`,`property-access`],r=0;r<n.length;r++){var i=n[r],a=e.languages.javascript[i],i=(a=e.util.type(a)===`RegExp`?e.languages.javascript[i]={pattern:a}:a).inside||{};(a.inside=i)[`maybe-class-name`]=/^[A-Z][\s\S]*/}}(R),function(e){var t=e.util.clone(e.languages.javascript),n=`(?:\\s|\\/\\/.*(?!.)|\\/\\*(?:[^*]|\\*(?!\\/))\\*\\/)`,r=`(?:\\{(?:\\{(?:\\{[^{}]*\\}|[^{}])*\\}|[^{}])*\\})`,i=`(?:\\{<S>*\\.{3}(?:[^{}]|<BRACES>)*\\})`;function a(e,t){return e=e.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return i}),RegExp(e,t)}i=a(i).source,e.languages.jsx=e.languages.extend(`markup`,t),e.languages.jsx.tag.pattern=a(`<\\/?(?:[\\w.:-]+(?:<S>+(?:[\\w.:$-]+(?:=(?:"(?:\\\\[\\s\\S]|[^\\\\"])*"|'(?:\\\\[\\s\\S]|[^\\\\'])*'|[^\\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\\/?)?>`),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside[`attr-value`].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside[`class-name`]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore(`inside`,`attr-name`,{spread:{pattern:a(`<SPREAD>`),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore(`inside`,`special-attr`,{script:{pattern:a(`=<BRACES>`),alias:`language-javascript`,inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:`punctuation`},rest:e.languages.jsx}}},e.languages.jsx.tag);function o(t){for(var n=[],r=0;r<t.length;r++){var i=t[r],a=!1;typeof i!=`string`&&(i.type===`tag`&&i.content[0]&&i.content[0].type===`tag`?i.content[0].content[0].content===`</`?0<n.length&&n[n.length-1].tagName===s(i.content[0].content[1])&&n.pop():i.content[i.content.length-1].content!==`/>`&&n.push({tagName:s(i.content[0].content[1]),openedBraces:0}):0<n.length&&i.type===`punctuation`&&i.content===`{`?n[n.length-1].openedBraces++:0<n.length&&0<n[n.length-1].openedBraces&&i.type===`punctuation`&&i.content===`}`?n[n.length-1].openedBraces--:a=!0),(a||typeof i==`string`)&&0<n.length&&n[n.length-1].openedBraces===0&&(a=s(i),r<t.length-1&&(typeof t[r+1]==`string`||t[r+1].type===`plain-text`)&&(a+=s(t[r+1]),t.splice(r+1,1)),0<r&&(typeof t[r-1]==`string`||t[r-1].type===`plain-text`)&&(a=s(t[r-1])+a,t.splice(r-1,1),r--),t[r]=new e.Token(`plain-text`,a,null,a)),i.content&&typeof i.content!=`string`&&o(i.content)}}var s=function(e){return e?typeof e==`string`?e:typeof e.content==`string`?e.content:e.content.map(s).join(``):``};e.hooks.add(`after-tokenize`,function(e){e.language!==`jsx`&&e.language!==`tsx`||o(e.tokens)})}(R),function(e){var t=e.util.clone(e.languages.typescript),t=(e.languages.tsx=e.languages.extend(`jsx`,t),delete e.languages.tsx.parameter,delete e.languages.tsx[`literal-property`],e.languages.tsx.tag);t.pattern=RegExp(`(^|[^\\w$]|(?=<\\/))(?:`+t.pattern.source+`)`,t.pattern.flags),t.lookbehind=!0}(R),R.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(`(^|[^"#])(?:"(?:\\\\(?:\\((?:[^()]|\\([^()]*\\))*\\)|\\r\\n|[^(])|[^\\\\\\r\\n"])*"|"""(?:\\\\(?:\\((?:[^()]|\\([^()]*\\))*\\)|[^(])|[^\\\\"]|"(?!""))*""")(?!["#])`),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:`punctuation`},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(`(^|[^"#])(#+)(?:"(?:\\\\(?:#+\\((?:[^()]|\\([^()]*\\))*\\)|\\r\\n|[^#])|[^\\\\\\r\\n])*?"|"""(?:\\\\(?:#+\\((?:[^()]|\\([^()]*\\))*\\)|[^#])|[^\\\\])*?""")\\2`),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:`punctuation`},string:/[\s\S]+/}}],directive:{pattern:RegExp(`#(?:(?:elseif|if)\\b(?:[ ]*(?:![ \\t]*)?(?:\\b\\w+\\b(?:[ \\t]*\\((?:[^()]|\\([^()]*\\))*\\))?|\\((?:[^()]|\\([^()]*\\))*\\))(?:[ \\t]*(?:&&|\\|\\|))?)+|(?:else|endif)\\b)`),alias:`property`,inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:`constant`},"other-directive":{pattern:/#\w+\b/,alias:`property`},attribute:{pattern:/@\w+/,alias:`atrule`},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:`function`},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:`important`},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:`constant`},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:`keyword`},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},R.languages.swift[`string-literal`].forEach(function(e){e.inside.interpolation.inside=R.languages.swift}),function(e){e.languages.kotlin=e.languages.extend(`clike`,{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete e.languages.kotlin[`class-name`];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:`punctuation`},expression:{pattern:/[\s\S]+/,inside:e.languages.kotlin}};e.languages.insertBefore(`kotlin`,`string`,{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:`multiline`,inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:`singleline`,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete e.languages.kotlin.string,e.languages.insertBefore(`kotlin`,`keyword`,{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:`builtin`}}),e.languages.insertBefore(`kotlin`,`function`,{label:{pattern:/\b\w+@|@\w+\b/,alias:`symbol`}}),e.languages.kt=e.languages.kotlin,e.languages.kts=e.languages.kotlin}(R),R.languages.c=R.languages.extend(`clike`,{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),R.languages.insertBefore(`c`,`string`,{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),R.languages.insertBefore(`c`,`string`,{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:`property`,inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},R.languages.c.string],char:R.languages.c.char,comment:R.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:`function`}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:`keyword`},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:R.languages.c}}}}),R.languages.insertBefore(`c`,`function`,{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete R.languages.c.boolean,R.languages.objectivec=R.languages.extend(`c`,{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete R.languages.objectivec[`class-name`],R.languages.objc=R.languages.objectivec,R.languages.reason=R.languages.extend(`clike`,{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),R.languages.insertBefore(`reason`,`class-name`,{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:`symbol`}}),delete R.languages.reason.function,function(e){for(var t=`\\/\\*(?:[^*/]|\\*(?!\\/)|\\/(?!\\*)|<self>)*\\*\\/`,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return`[^\\s\\S]`}),e.languages.rust={comment:[{pattern:RegExp(`(^|[^\\\\])`+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:`attr-name`,inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:`punctuation`},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:`symbol`},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:`punctuation`},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:`function`},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:`class-name`},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:`namespace`},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:`namespace`,inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:`property`},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust[`closure-params`].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(R),R.languages.go=R.languages.extend(`clike`,{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),R.languages.insertBefore(`go`,`string`,{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete R.languages.go[`class-name`],function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=`\\b(?!<keyword>)\\w+(?:\\s*\\.\\s*\\w+)*\\b`.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend(`c`,{"class-name":[{pattern:RegExp(`(\\b(?:class|concept|enum|struct|typename)\\s+)(?!<keyword>)\\w+`.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore(`cpp`,`string`,{module:{pattern:RegExp(`(\\b(?:import|module)\\s+)(?:"(?:\\\\(?:\\r\\n|[\\s\\S])|[^"\\\\\\r\\n])*"|<[^<>\\r\\n]*>|`+`<mod-name>(?:\\s*:\\s*<mod-name>)?|:\\s*<mod-name>`.replace(/<mod-name>/g,function(){return n})+`)`),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:`string`,greedy:!0}}),e.languages.insertBefore(`cpp`,`keyword`,{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:e.languages.cpp}}}}),e.languages.insertBefore(`cpp`,`operator`,{"double-colon":{pattern:/::/,alias:`punctuation`}}),e.languages.insertBefore(`cpp`,`class-name`,{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend(`cpp`,{})}}),e.languages.insertBefore(`inside`,`double-colon`,{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp[`base-clause`])}(R),R.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:`punctuation`},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:`string`},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:[`annotation`,`punctuation`],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},R.languages.python[`string-interpolation`].inside.interpolation.inside.rest=R.languages.python,R.languages.py=R.languages.python,R.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:`keyword`}},R.languages.webmanifest=R.languages.json;var Kr={};Wr(Kr,{dracula:()=>qr,duotoneDark:()=>Jr,duotoneLight:()=>Yr,github:()=>Xr,gruvboxMaterialDark:()=>fi,gruvboxMaterialLight:()=>pi,jettwaveDark:()=>ci,jettwaveLight:()=>li,nightOwl:()=>Zr,nightOwlLight:()=>Qr,oceanicNext:()=>ei,okaidia:()=>ti,oneDark:()=>ui,oneLight:()=>di,palenight:()=>ni,shadesOfPurple:()=>ri,synthwave84:()=>ii,ultramin:()=>ai,vsDark:()=>oi,vsLight:()=>si});var qr={plain:{color:`#F8F8F2`,backgroundColor:`#282A36`},styles:[{types:[`prolog`,`constant`,`builtin`],style:{color:`rgb(189, 147, 249)`}},{types:[`inserted`,`function`],style:{color:`rgb(80, 250, 123)`}},{types:[`deleted`],style:{color:`rgb(255, 85, 85)`}},{types:[`changed`],style:{color:`rgb(255, 184, 108)`}},{types:[`punctuation`,`symbol`],style:{color:`rgb(248, 248, 242)`}},{types:[`string`,`char`,`tag`,`selector`],style:{color:`rgb(255, 121, 198)`}},{types:[`keyword`,`variable`],style:{color:`rgb(189, 147, 249)`,fontStyle:`italic`}},{types:[`comment`],style:{color:`rgb(98, 114, 164)`}},{types:[`attr-name`],style:{color:`rgb(241, 250, 140)`}}]},Jr={plain:{backgroundColor:`#2a2734`,color:`#9a86fd`},styles:[{types:[`comment`,`prolog`,`doctype`,`cdata`,`punctuation`],style:{color:`#6c6783`}},{types:[`namespace`],style:{opacity:.7}},{types:[`tag`,`operator`,`number`],style:{color:`#e09142`}},{types:[`property`,`function`],style:{color:`#9a86fd`}},{types:[`tag-id`,`selector`,`atrule-id`],style:{color:`#eeebff`}},{types:[`attr-name`],style:{color:`#c4b9fe`}},{types:[`boolean`,`string`,`entity`,`url`,`attr-value`,`keyword`,`control`,`directive`,`unit`,`statement`,`regex`,`atrule`,`placeholder`,`variable`],style:{color:`#ffcc99`}},{types:[`deleted`],style:{textDecorationLine:`line-through`}},{types:[`inserted`],style:{textDecorationLine:`underline`}},{types:[`italic`],style:{fontStyle:`italic`}},{types:[`important`,`bold`],style:{fontWeight:`bold`}},{types:[`important`],style:{color:`#c4b9fe`}}]},Yr={plain:{backgroundColor:`#faf8f5`,color:`#728fcb`},styles:[{types:[`comment`,`prolog`,`doctype`,`cdata`,`punctuation`],style:{color:`#b6ad9a`}},{types:[`namespace`],style:{opacity:.7}},{types:[`tag`,`operator`,`number`],style:{color:`#063289`}},{types:[`property`,`function`],style:{color:`#b29762`}},{types:[`tag-id`,`selector`,`atrule-id`],style:{color:`#2d2006`}},{types:[`attr-name`],style:{color:`#896724`}},{types:[`boolean`,`string`,`entity`,`url`,`attr-value`,`keyword`,`control`,`directive`,`unit`,`statement`,`regex`,`atrule`],style:{color:`#728fcb`}},{types:[`placeholder`,`variable`],style:{color:`#93abdc`}},{types:[`deleted`],style:{textDecorationLine:`line-through`}},{types:[`inserted`],style:{textDecorationLine:`underline`}},{types:[`italic`],style:{fontStyle:`italic`}},{types:[`important`,`bold`],style:{fontWeight:`bold`}},{types:[`important`],style:{color:`#896724`}}]},Xr={plain:{color:`#393A34`,backgroundColor:`#f6f8fa`},styles:[{types:[`comment`,`prolog`,`doctype`,`cdata`],style:{color:`#999988`,fontStyle:`italic`}},{types:[`namespace`],style:{opacity:.7}},{types:[`string`,`attr-value`],style:{color:`#e3116c`}},{types:[`punctuation`,`operator`],style:{color:`#393A34`}},{types:[`entity`,`url`,`symbol`,`number`,`boolean`,`variable`,`constant`,`property`,`regex`,`inserted`],style:{color:`#36acaa`}},{types:[`atrule`,`keyword`,`attr-name`,`selector`],style:{color:`#00a4db`}},{types:[`function`,`deleted`,`tag`],style:{color:`#d73a49`}},{types:[`function-variable`],style:{color:`#6f42c1`}},{types:[`tag`,`selector`,`keyword`],style:{color:`#00009f`}}]},Zr={plain:{color:`#d6deeb`,backgroundColor:`#011627`},styles:[{types:[`changed`],style:{color:`rgb(162, 191, 252)`,fontStyle:`italic`}},{types:[`deleted`],style:{color:`rgba(239, 83, 80, 0.56)`,fontStyle:`italic`}},{types:[`inserted`,`attr-name`],style:{color:`rgb(173, 219, 103)`,fontStyle:`italic`}},{types:[`comment`],style:{color:`rgb(99, 119, 119)`,fontStyle:`italic`}},{types:[`string`,`url`],style:{color:`rgb(173, 219, 103)`}},{types:[`variable`],style:{color:`rgb(214, 222, 235)`}},{types:[`number`],style:{color:`rgb(247, 140, 108)`}},{types:[`builtin`,`char`,`constant`,`function`],style:{color:`rgb(130, 170, 255)`}},{types:[`punctuation`],style:{color:`rgb(199, 146, 234)`}},{types:[`selector`,`doctype`],style:{color:`rgb(199, 146, 234)`,fontStyle:`italic`}},{types:[`class-name`],style:{color:`rgb(255, 203, 139)`}},{types:[`tag`,`operator`,`keyword`],style:{color:`rgb(127, 219, 202)`}},{types:[`boolean`],style:{color:`rgb(255, 88, 116)`}},{types:[`property`],style:{color:`rgb(128, 203, 196)`}},{types:[`namespace`],style:{color:`rgb(178, 204, 214)`}}]},Qr={plain:{color:`#403f53`,backgroundColor:`#FBFBFB`},styles:[{types:[`changed`],style:{color:`rgb(162, 191, 252)`,fontStyle:`italic`}},{types:[`deleted`],style:{color:`rgba(239, 83, 80, 0.56)`,fontStyle:`italic`}},{types:[`inserted`,`attr-name`],style:{color:`rgb(72, 118, 214)`,fontStyle:`italic`}},{types:[`comment`],style:{color:`rgb(152, 159, 177)`,fontStyle:`italic`}},{types:[`string`,`builtin`,`char`,`constant`,`url`],style:{color:`rgb(72, 118, 214)`}},{types:[`variable`],style:{color:`rgb(201, 103, 101)`}},{types:[`number`],style:{color:`rgb(170, 9, 130)`}},{types:[`punctuation`],style:{color:`rgb(153, 76, 195)`}},{types:[`function`,`selector`,`doctype`],style:{color:`rgb(153, 76, 195)`,fontStyle:`italic`}},{types:[`class-name`],style:{color:`rgb(17, 17, 17)`}},{types:[`tag`],style:{color:`rgb(153, 76, 195)`}},{types:[`operator`,`property`,`keyword`,`namespace`],style:{color:`rgb(12, 150, 155)`}},{types:[`boolean`],style:{color:`rgb(188, 84, 84)`}}]},$r={char:`#D8DEE9`,comment:`#999999`,keyword:`#c5a5c5`,primitive:`#5a9bcf`,string:`#8dc891`,variable:`#d7deea`,boolean:`#ff8b50`,punctuation:`#5FB3B3`,tag:`#fc929e`,function:`#79b6f2`,className:`#FAC863`,method:`#6699CC`,operator:`#fc929e`},ei={plain:{backgroundColor:`#282c34`,color:`#ffffff`},styles:[{types:[`attr-name`],style:{color:$r.keyword}},{types:[`attr-value`],style:{color:$r.string}},{types:[`comment`,`block-comment`,`prolog`,`doctype`,`cdata`,`shebang`],style:{color:$r.comment}},{types:[`property`,`number`,`function-name`,`constant`,`symbol`,`deleted`],style:{color:$r.primitive}},{types:[`boolean`],style:{color:$r.boolean}},{types:[`tag`],style:{color:$r.tag}},{types:[`string`],style:{color:$r.string}},{types:[`punctuation`],style:{color:$r.string}},{types:[`selector`,`char`,`builtin`,`inserted`],style:{color:$r.char}},{types:[`function`],style:{color:$r.function}},{types:[`operator`,`entity`,`url`,`variable`],style:{color:$r.variable}},{types:[`keyword`],style:{color:$r.keyword}},{types:[`atrule`,`class-name`],style:{color:$r.className}},{types:[`important`],style:{fontWeight:`400`}},{types:[`bold`],style:{fontWeight:`bold`}},{types:[`italic`],style:{fontStyle:`italic`}},{types:[`namespace`],style:{opacity:.7}}]},ti={plain:{color:`#f8f8f2`,backgroundColor:`#272822`},styles:[{types:[`changed`],style:{color:`rgb(162, 191, 252)`,fontStyle:`italic`}},{types:[`deleted`],style:{color:`#f92672`,fontStyle:`italic`}},{types:[`inserted`],style:{color:`rgb(173, 219, 103)`,fontStyle:`italic`}},{types:[`comment`],style:{color:`#8292a2`,fontStyle:`italic`}},{types:[`string`,`url`],style:{color:`#a6e22e`}},{types:[`variable`],style:{color:`#f8f8f2`}},{types:[`number`],style:{color:`#ae81ff`}},{types:[`builtin`,`char`,`constant`,`function`,`class-name`],style:{color:`#e6db74`}},{types:[`punctuation`],style:{color:`#f8f8f2`}},{types:[`selector`,`doctype`],style:{color:`#a6e22e`,fontStyle:`italic`}},{types:[`tag`,`operator`,`keyword`],style:{color:`#66d9ef`}},{types:[`boolean`],style:{color:`#ae81ff`}},{types:[`namespace`],style:{color:`rgb(178, 204, 214)`,opacity:.7}},{types:[`tag`,`property`],style:{color:`#f92672`}},{types:[`attr-name`],style:{color:`#a6e22e !important`}},{types:[`doctype`],style:{color:`#8292a2`}},{types:[`rule`],style:{color:`#e6db74`}}]},ni={plain:{color:`#bfc7d5`,backgroundColor:`#292d3e`},styles:[{types:[`comment`],style:{color:`rgb(105, 112, 152)`,fontStyle:`italic`}},{types:[`string`,`inserted`],style:{color:`rgb(195, 232, 141)`}},{types:[`number`],style:{color:`rgb(247, 140, 108)`}},{types:[`builtin`,`char`,`constant`,`function`],style:{color:`rgb(130, 170, 255)`}},{types:[`punctuation`,`selector`],style:{color:`rgb(199, 146, 234)`}},{types:[`variable`],style:{color:`rgb(191, 199, 213)`}},{types:[`class-name`,`attr-name`],style:{color:`rgb(255, 203, 107)`}},{types:[`tag`,`deleted`],style:{color:`rgb(255, 85, 114)`}},{types:[`operator`],style:{color:`rgb(137, 221, 255)`}},{types:[`boolean`],style:{color:`rgb(255, 88, 116)`}},{types:[`keyword`],style:{fontStyle:`italic`}},{types:[`doctype`],style:{color:`rgb(199, 146, 234)`,fontStyle:`italic`}},{types:[`namespace`],style:{color:`rgb(178, 204, 214)`}},{types:[`url`],style:{color:`rgb(221, 221, 221)`}}]},ri={plain:{color:`#9EFEFF`,backgroundColor:`#2D2A55`},styles:[{types:[`changed`],style:{color:`rgb(255, 238, 128)`}},{types:[`deleted`],style:{color:`rgba(239, 83, 80, 0.56)`}},{types:[`inserted`],style:{color:`rgb(173, 219, 103)`}},{types:[`comment`],style:{color:`rgb(179, 98, 255)`,fontStyle:`italic`}},{types:[`punctuation`],style:{color:`rgb(255, 255, 255)`}},{types:[`constant`],style:{color:`rgb(255, 98, 140)`}},{types:[`string`,`url`],style:{color:`rgb(165, 255, 144)`}},{types:[`variable`],style:{color:`rgb(255, 238, 128)`}},{types:[`number`,`boolean`],style:{color:`rgb(255, 98, 140)`}},{types:[`attr-name`],style:{color:`rgb(255, 180, 84)`}},{types:[`keyword`,`operator`,`property`,`namespace`,`tag`,`selector`,`doctype`],style:{color:`rgb(255, 157, 0)`}},{types:[`builtin`,`char`,`constant`,`function`,`class-name`],style:{color:`rgb(250, 208, 0)`}}]},ii={plain:{backgroundColor:`linear-gradient(to bottom, #2a2139 75%, #34294f)`,backgroundImage:`#34294f`,color:`#f92aad`,textShadow:`0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3`},styles:[{types:[`comment`,`block-comment`,`prolog`,`doctype`,`cdata`],style:{color:`#495495`,fontStyle:`italic`}},{types:[`punctuation`],style:{color:`#ccc`}},{types:[`tag`,`attr-name`,`namespace`,`number`,`unit`,`hexcode`,`deleted`],style:{color:`#e2777a`}},{types:[`property`,`selector`],style:{color:`#72f1b8`,textShadow:`0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475`}},{types:[`function-name`],style:{color:`#6196cc`}},{types:[`boolean`,`selector-id`,`function`],style:{color:`#fdfdfd`,textShadow:`0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975`}},{types:[`class-name`,`maybe-class-name`,`builtin`],style:{color:`#fff5f6`,textShadow:`0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75`}},{types:[`constant`,`symbol`],style:{color:`#f92aad`,textShadow:`0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3`}},{types:[`important`,`atrule`,`keyword`,`selector-class`],style:{color:`#f4eee4`,textShadow:`0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575`}},{types:[`string`,`char`,`attr-value`,`regex`,`variable`],style:{color:`#f87c32`}},{types:[`parameter`],style:{fontStyle:`italic`}},{types:[`entity`,`url`],style:{color:`#67cdcc`}},{types:[`operator`],style:{color:`ffffffee`}},{types:[`important`,`bold`],style:{fontWeight:`bold`}},{types:[`italic`],style:{fontStyle:`italic`}},{types:[`entity`],style:{cursor:`help`}},{types:[`inserted`],style:{color:`green`}}]},ai={plain:{color:`#282a2e`,backgroundColor:`#ffffff`},styles:[{types:[`comment`],style:{color:`rgb(197, 200, 198)`}},{types:[`string`,`number`,`builtin`,`variable`],style:{color:`rgb(150, 152, 150)`}},{types:[`class-name`,`function`,`tag`,`attr-name`],style:{color:`rgb(40, 42, 46)`}}]},oi={plain:{color:`#9CDCFE`,backgroundColor:`#1E1E1E`},styles:[{types:[`prolog`],style:{color:`rgb(0, 0, 128)`}},{types:[`comment`],style:{color:`rgb(106, 153, 85)`}},{types:[`builtin`,`changed`,`keyword`,`interpolation-punctuation`],style:{color:`rgb(86, 156, 214)`}},{types:[`number`,`inserted`],style:{color:`rgb(181, 206, 168)`}},{types:[`constant`],style:{color:`rgb(100, 102, 149)`}},{types:[`attr-name`,`variable`],style:{color:`rgb(156, 220, 254)`}},{types:[`deleted`,`string`,`attr-value`,`template-punctuation`],style:{color:`rgb(206, 145, 120)`}},{types:[`selector`],style:{color:`rgb(215, 186, 125)`}},{types:[`tag`],style:{color:`rgb(78, 201, 176)`}},{types:[`tag`],languages:[`markup`],style:{color:`rgb(86, 156, 214)`}},{types:[`punctuation`,`operator`],style:{color:`rgb(212, 212, 212)`}},{types:[`punctuation`],languages:[`markup`],style:{color:`#808080`}},{types:[`function`],style:{color:`rgb(220, 220, 170)`}},{types:[`class-name`],style:{color:`rgb(78, 201, 176)`}},{types:[`char`],style:{color:`rgb(209, 105, 105)`}}]},si={plain:{color:`#000000`,backgroundColor:`#ffffff`},styles:[{types:[`comment`],style:{color:`rgb(0, 128, 0)`}},{types:[`builtin`],style:{color:`rgb(0, 112, 193)`}},{types:[`number`,`variable`,`inserted`],style:{color:`rgb(9, 134, 88)`}},{types:[`operator`],style:{color:`rgb(0, 0, 0)`}},{types:[`constant`,`char`],style:{color:`rgb(129, 31, 63)`}},{types:[`tag`],style:{color:`rgb(128, 0, 0)`}},{types:[`attr-name`],style:{color:`rgb(255, 0, 0)`}},{types:[`deleted`,`string`],style:{color:`rgb(163, 21, 21)`}},{types:[`changed`,`punctuation`],style:{color:`rgb(4, 81, 165)`}},{types:[`function`,`keyword`],style:{color:`rgb(0, 0, 255)`}},{types:[`class-name`],style:{color:`rgb(38, 127, 153)`}}]},ci={plain:{color:`#f8fafc`,backgroundColor:`#011627`},styles:[{types:[`prolog`],style:{color:`#000080`}},{types:[`comment`],style:{color:`#6A9955`}},{types:[`builtin`,`changed`,`keyword`,`interpolation-punctuation`],style:{color:`#569CD6`}},{types:[`number`,`inserted`],style:{color:`#B5CEA8`}},{types:[`constant`],style:{color:`#f8fafc`}},{types:[`attr-name`,`variable`],style:{color:`#9CDCFE`}},{types:[`deleted`,`string`,`attr-value`,`template-punctuation`],style:{color:`#cbd5e1`}},{types:[`selector`],style:{color:`#D7BA7D`}},{types:[`tag`],style:{color:`#0ea5e9`}},{types:[`tag`],languages:[`markup`],style:{color:`#0ea5e9`}},{types:[`punctuation`,`operator`],style:{color:`#D4D4D4`}},{types:[`punctuation`],languages:[`markup`],style:{color:`#808080`}},{types:[`function`],style:{color:`#7dd3fc`}},{types:[`class-name`],style:{color:`#0ea5e9`}},{types:[`char`],style:{color:`#D16969`}}]},li={plain:{color:`#0f172a`,backgroundColor:`#f1f5f9`},styles:[{types:[`prolog`],style:{color:`#000080`}},{types:[`comment`],style:{color:`#6A9955`}},{types:[`builtin`,`changed`,`keyword`,`interpolation-punctuation`],style:{color:`#0c4a6e`}},{types:[`number`,`inserted`],style:{color:`#B5CEA8`}},{types:[`constant`],style:{color:`#0f172a`}},{types:[`attr-name`,`variable`],style:{color:`#0c4a6e`}},{types:[`deleted`,`string`,`attr-value`,`template-punctuation`],style:{color:`#64748b`}},{types:[`selector`],style:{color:`#D7BA7D`}},{types:[`tag`],style:{color:`#0ea5e9`}},{types:[`tag`],languages:[`markup`],style:{color:`#0ea5e9`}},{types:[`punctuation`,`operator`],style:{color:`#475569`}},{types:[`punctuation`],languages:[`markup`],style:{color:`#808080`}},{types:[`function`],style:{color:`#0e7490`}},{types:[`class-name`],style:{color:`#0ea5e9`}},{types:[`char`],style:{color:`#D16969`}}]},ui={plain:{backgroundColor:`hsl(220, 13%, 18%)`,color:`hsl(220, 14%, 71%)`,textShadow:`0 1px rgba(0, 0, 0, 0.3)`},styles:[{types:[`comment`,`prolog`,`cdata`],style:{color:`hsl(220, 10%, 40%)`}},{types:[`doctype`,`punctuation`,`entity`],style:{color:`hsl(220, 14%, 71%)`}},{types:[`attr-name`,`class-name`,`maybe-class-name`,`boolean`,`constant`,`number`,`atrule`],style:{color:`hsl(29, 54%, 61%)`}},{types:[`keyword`],style:{color:`hsl(286, 60%, 67%)`}},{types:[`property`,`tag`,`symbol`,`deleted`,`important`],style:{color:`hsl(355, 65%, 65%)`}},{types:[`selector`,`string`,`char`,`builtin`,`inserted`,`regex`,`attr-value`],style:{color:`hsl(95, 38%, 62%)`}},{types:[`variable`,`operator`,`function`],style:{color:`hsl(207, 82%, 66%)`}},{types:[`url`],style:{color:`hsl(187, 47%, 55%)`}},{types:[`deleted`],style:{textDecorationLine:`line-through`}},{types:[`inserted`],style:{textDecorationLine:`underline`}},{types:[`italic`],style:{fontStyle:`italic`}},{types:[`important`,`bold`],style:{fontWeight:`bold`}},{types:[`important`],style:{color:`hsl(220, 14%, 71%)`}}]},di={plain:{backgroundColor:`hsl(230, 1%, 98%)`,color:`hsl(230, 8%, 24%)`},styles:[{types:[`comment`,`prolog`,`cdata`],style:{color:`hsl(230, 4%, 64%)`}},{types:[`doctype`,`punctuation`,`entity`],style:{color:`hsl(230, 8%, 24%)`}},{types:[`attr-name`,`class-name`,`boolean`,`constant`,`number`,`atrule`],style:{color:`hsl(35, 99%, 36%)`}},{types:[`keyword`],style:{color:`hsl(301, 63%, 40%)`}},{types:[`property`,`tag`,`symbol`,`deleted`,`important`],style:{color:`hsl(5, 74%, 59%)`}},{types:[`selector`,`string`,`char`,`builtin`,`inserted`,`regex`,`attr-value`,`punctuation`],style:{color:`hsl(119, 34%, 47%)`}},{types:[`variable`,`operator`,`function`],style:{color:`hsl(221, 87%, 60%)`}},{types:[`url`],style:{color:`hsl(198, 99%, 37%)`}},{types:[`deleted`],style:{textDecorationLine:`line-through`}},{types:[`inserted`],style:{textDecorationLine:`underline`}},{types:[`italic`],style:{fontStyle:`italic`}},{types:[`important`,`bold`],style:{fontWeight:`bold`}},{types:[`important`],style:{color:`hsl(230, 8%, 24%)`}}]},fi={plain:{color:`#ebdbb2`,backgroundColor:`#292828`},styles:[{types:[`imports`,`class-name`,`maybe-class-name`,`constant`,`doctype`,`builtin`,`function`],style:{color:`#d8a657`}},{types:[`property-access`],style:{color:`#7daea3`}},{types:[`tag`],style:{color:`#e78a4e`}},{types:[`attr-name`,`char`,`url`,`regex`],style:{color:`#a9b665`}},{types:[`attr-value`,`string`],style:{color:`#89b482`}},{types:[`comment`,`prolog`,`cdata`,`operator`,`inserted`],style:{color:`#a89984`}},{types:[`delimiter`,`boolean`,`keyword`,`selector`,`important`,`atrule`,`property`,`variable`,`deleted`],style:{color:`#ea6962`}},{types:[`entity`,`number`,`symbol`],style:{color:`#d3869b`}}]},pi={plain:{color:`#654735`,backgroundColor:`#f9f5d7`},styles:[{types:[`delimiter`,`boolean`,`keyword`,`selector`,`important`,`atrule`,`property`,`variable`,`deleted`],style:{color:`#af2528`}},{types:[`imports`,`class-name`,`maybe-class-name`,`constant`,`doctype`,`builtin`],style:{color:`#b4730e`}},{types:[`string`,`attr-value`],style:{color:`#477a5b`}},{types:[`property-access`],style:{color:`#266b79`}},{types:[`function`,`attr-name`,`char`,`url`],style:{color:`#72761e`}},{types:[`tag`],style:{color:`#b94c07`}},{types:[`comment`,`prolog`,`cdata`,`operator`,`inserted`],style:{color:`#a89984`}},{types:[`entity`,`number`,`symbol`],style:{color:`#924f79`}}]},mi=e=>(0,v.useCallback)(t=>{var n=t,{className:r,style:i,line:a}=n;let o=Vr(Br({},Hr(n,[`className`,`style`,`line`])),{className:Or(`token-line`,r)});return typeof e==`object`&&`plain`in e&&(o.style=e.plain),typeof i==`object`&&(o.style=Br(Br({},o.style||{}),i)),o},[e]),hi=e=>{let t=(0,v.useCallback)(({types:t,empty:n})=>{if(e!=null)return t.length===1&&t[0]===`plain`?n==null?void 0:{display:`inline-block`}:t.length===1&&n!=null?e[t[0]]:Object.assign(n==null?{}:{display:`inline-block`},...t.map(t=>e[t]))},[e]);return(0,v.useCallback)(e=>{var n=e,{token:r,className:i,style:a}=n;let o=Vr(Br({},Hr(n,[`token`,`className`,`style`])),{className:Or(`token`,...r.types,i),children:r.content,style:t(r)});return a!=null&&(o.style=Br(Br({},o.style||{}),a)),o},[t])},gi=/\r\n|\r|\n/,_i=e=>{e.length===0?e.push({types:[`plain`],content:`
18
+ `,empty:!0}):e.length===1&&e[0].content===``&&(e[0].content=`
19
+ `,e[0].empty=!0)},vi=(e,t)=>{let n=e.length;return n>0&&e[n-1]===t?e:e.concat(t)},yi=e=>{let t=[[]],n=[e],r=[0],i=[e.length],a=0,o=0,s=[],c=[s];for(;o>-1;){for(;(a=r[o]++)<i[o];){let e,l=t[o],u=n[o][a];if(typeof u==`string`?(l=o>0?l:[`plain`],e=u):(l=vi(l,u.type),u.alias&&(l=vi(l,u.alias)),e=u.content),typeof e!=`string`){o++,t.push(l),n.push(e),r.push(0),i.push(e.length);continue}let d=e.split(gi),f=d.length;s.push({types:l,content:d[0]});for(let e=1;e<f;e++)_i(s),c.push(s=[]),s.push({types:l,content:d[e]})}o--,t.pop(),n.pop(),r.pop(),i.pop()}return _i(s),c},bi=({prism:e,code:t,grammar:n,language:r})=>(0,v.useMemo)(()=>{if(n==null)return yi([t]);let i={code:t,grammar:n,language:r,tokens:[]};return e.hooks.run(`before-tokenize`,i),i.tokens=e.tokenize(t,n),e.hooks.run(`after-tokenize`,i),yi(i.tokens)},[t,n,r,e]),xi=(e,t)=>{let{plain:n}=e,r=e.styles.reduce((e,n)=>{let{languages:r,style:i}=n;return r&&!r.includes(t)||n.types.forEach(t=>{e[t]=Br(Br({},e[t]),i)}),e},{});return r.root=n,r.plain=Vr(Br({},n),{backgroundColor:void 0}),r},Si=({children:e,language:t,code:n,theme:r,prism:i})=>{let a=t.toLowerCase(),o=xi(r,a),s=mi(o),c=hi(o),l=i.languages[a];return e({tokens:bi({prism:i,language:a,code:n,grammar:l}),className:`prism-code language-${a}`,style:o==null?{}:o.root,getLineProps:s,getTokenProps:c})},Ci=e=>(0,v.createElement)(Si,Vr(Br({},e),{prism:e.prism||R,theme:e.theme||oi,code:e.code,language:e.language}));function wi(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function Ti(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Ei=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Di=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Oi={};function ki(e,t){return((t||Oi).jsx?Di:Ei).test(e)}var Ai=/[ \t\n\f\r]/g;function ji(e){return typeof e==`object`?e.type===`text`?Mi(e.value):!1:Mi(e)}function Mi(e){return e.replace(Ai,``)===``}var Ni=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Ni.prototype.normal={},Ni.prototype.property={},Ni.prototype.space=void 0;function Pi(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Ni(n,r,t)}function Fi(e){return e.toLowerCase()}var Ii=class{constructor(e,t){this.attribute=t,this.property=e}};Ii.prototype.attribute=``,Ii.prototype.booleanish=!1,Ii.prototype.boolean=!1,Ii.prototype.commaOrSpaceSeparated=!1,Ii.prototype.commaSeparated=!1,Ii.prototype.defined=!1,Ii.prototype.mustUseProperty=!1,Ii.prototype.number=!1,Ii.prototype.overloadedBoolean=!1,Ii.prototype.property=``,Ii.prototype.spaceSeparated=!1,Ii.prototype.space=void 0;var Li=s({boolean:()=>zi,booleanish:()=>Bi,commaOrSpaceSeparated:()=>Wi,commaSeparated:()=>Ui,number:()=>z,overloadedBoolean:()=>Vi,spaceSeparated:()=>Hi}),Ri=0,zi=Gi(),Bi=Gi(),Vi=Gi(),z=Gi(),Hi=Gi(),Ui=Gi(),Wi=Gi();function Gi(){return 2**++Ri}var Ki=Object.keys(Li),qi=class extends Ii{constructor(e,t,n,r){let i=-1;if(super(e,t),Ji(this,`space`,r),typeof n==`number`)for(;++i<Ki.length;){let e=Ki[i];Ji(this,Ki[i],(n&Li[e])===Li[e])}}};qi.prototype.defined=!0;function Ji(e,t,n){n&&(e[t]=n)}function Yi(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new qi(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Fi(r)]=r,n[Fi(a.attribute)]=r}return new Ni(t,n,e.space)}var Xi=Yi({properties:{ariaActiveDescendant:null,ariaAtomic:Bi,ariaAutoComplete:null,ariaBusy:Bi,ariaChecked:Bi,ariaColCount:z,ariaColIndex:z,ariaColSpan:z,ariaControls:Hi,ariaCurrent:null,ariaDescribedBy:Hi,ariaDetails:null,ariaDisabled:Bi,ariaDropEffect:Hi,ariaErrorMessage:null,ariaExpanded:Bi,ariaFlowTo:Hi,ariaGrabbed:Bi,ariaHasPopup:null,ariaHidden:Bi,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Hi,ariaLevel:z,ariaLive:null,ariaModal:Bi,ariaMultiLine:Bi,ariaMultiSelectable:Bi,ariaOrientation:null,ariaOwns:Hi,ariaPlaceholder:null,ariaPosInSet:z,ariaPressed:Bi,ariaReadOnly:Bi,ariaRelevant:null,ariaRequired:Bi,ariaRoleDescription:Hi,ariaRowCount:z,ariaRowIndex:z,ariaRowSpan:z,ariaSelected:Bi,ariaSetSize:z,ariaSort:null,ariaValueMax:z,ariaValueMin:z,ariaValueNow:z,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Zi(e,t){return t in e?e[t]:t}function Qi(e,t){return Zi(e,t.toLowerCase())}var $i=Yi({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Ui,acceptCharset:Hi,accessKey:Hi,action:null,allow:null,allowFullScreen:zi,allowPaymentRequest:zi,allowUserMedia:zi,alt:null,as:null,async:zi,autoCapitalize:null,autoComplete:Hi,autoFocus:zi,autoPlay:zi,blocking:Hi,capture:null,charSet:null,checked:zi,cite:null,className:Hi,cols:z,colSpan:null,content:null,contentEditable:Bi,controls:zi,controlsList:Hi,coords:z|Ui,crossOrigin:null,data:null,dateTime:null,decoding:null,default:zi,defer:zi,dir:null,dirName:null,disabled:zi,download:Vi,draggable:Bi,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:zi,formTarget:null,headers:Hi,height:z,hidden:Vi,high:z,href:null,hrefLang:null,htmlFor:Hi,httpEquiv:Hi,id:null,imageSizes:null,imageSrcSet:null,inert:zi,inputMode:null,integrity:null,is:null,isMap:zi,itemId:null,itemProp:Hi,itemRef:Hi,itemScope:zi,itemType:Hi,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:zi,low:z,manifest:null,max:null,maxLength:z,media:null,method:null,min:null,minLength:z,multiple:zi,muted:zi,name:null,nonce:null,noModule:zi,noValidate:zi,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:zi,optimum:z,pattern:null,ping:Hi,placeholder:null,playsInline:zi,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:zi,referrerPolicy:null,rel:Hi,required:zi,reversed:zi,rows:z,rowSpan:z,sandbox:Hi,scope:null,scoped:zi,seamless:zi,selected:zi,shadowRootClonable:zi,shadowRootDelegatesFocus:zi,shadowRootMode:null,shape:null,size:z,sizes:null,slot:null,span:z,spellCheck:Bi,src:null,srcDoc:null,srcLang:null,srcSet:null,start:z,step:null,style:null,tabIndex:z,target:null,title:null,translate:null,type:null,typeMustMatch:zi,useMap:null,value:Bi,width:z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Hi,axis:null,background:null,bgColor:null,border:z,borderColor:null,bottomMargin:z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:zi,declare:zi,event:null,face:null,frame:null,frameBorder:null,hSpace:z,leftMargin:z,link:null,longDesc:null,lowSrc:null,marginHeight:z,marginWidth:z,noResize:zi,noHref:zi,noShade:zi,noWrap:zi,object:null,profile:null,prompt:null,rev:null,rightMargin:z,rules:null,scheme:null,scrolling:Bi,standby:null,summary:null,text:null,topMargin:z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:z,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:zi,disableRemotePlayback:zi,prefix:null,property:null,results:z,security:null,unselectable:null},space:`html`,transform:Qi}),ea=Yi({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,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`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,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`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,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`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:Wi,accentHeight:z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:z,amplitude:z,arabicForm:null,ascent:z,attributeName:null,attributeType:null,azimuth:z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:z,by:null,calcMode:null,capHeight:z,className:Hi,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:z,diffuseConstant:z,direction:null,display:null,dur:null,divisor:z,dominantBaseline:null,download:zi,dx:null,dy:null,edgeMode:null,editable:null,elevation:z,enableBackground:null,end:null,event:null,exponent:z,externalResourcesRequired:null,fill:null,fillOpacity:z,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ui,g2:Ui,glyphName:Ui,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:z,horizOriginX:z,horizOriginY:z,id:null,ideographic:z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:z,k:z,k1:z,k2:z,k3:z,k4:z,kernelMatrix:Wi,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:z,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:z,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:z,overlineThickness:z,paintOrder:null,panose1:null,path:null,pathLength:z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Hi,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:z,pointsAtY:z,pointsAtZ:z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Wi,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Wi,rev:Wi,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Wi,requiredFeatures:Wi,requiredFonts:Wi,requiredFormats:Wi,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:z,specularExponent:z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:z,strikethroughThickness:z,string:null,stroke:null,strokeDashArray:Wi,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:z,strokeOpacity:z,strokeWidth:null,style:null,surfaceScale:z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Wi,tabIndex:z,tableValues:null,target:null,targetX:z,targetY:z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Wi,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:z,underlineThickness:z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:z,values:null,vAlphabetic:z,vMathematical:z,vectorEffect:null,vHanging:z,vIdeographic:z,version:null,vertAdvY:z,vertOriginX:z,vertOriginY:z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Zi}),ta=Yi({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),na=Yi({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:Qi}),ra=Yi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),ia={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},aa=/[A-Z]/g,oa=/-[a-z]/g,sa=/^data[-\w.:]+$/i;function ca(e,t){let n=Fi(t),r=t,i=Ii;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&sa.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(oa,ua);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!oa.test(e)){let n=e.replace(aa,la);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=qi}return new i(r,t)}function la(e){return`-`+e.toLowerCase()}function ua(e){return e.charAt(1).toUpperCase()}var da=Pi([Xi,$i,ta,na,ra],`html`),fa=Pi([Xi,ea,ta,na,ra],`svg`);function pa(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function ma(e){return e.join(` `).trim()}var ha=o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
20
+ `,d=`/`,f=`*`,p=``,m=`comment`,h=`declaration`;function g(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,g=1;function v(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(u);g=~n?e.length-n:g+e.length}function y(){var e={line:l,column:g};return function(t){return t.position=new b(e),C(),t}}function b(e){this.start=e,this.end={line:l,column:g},this.source=t.source}b.prototype.content=e;function x(n){var r=Error(t.source+`:`+l+`:`+g+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=g,r.source=e,!t.silent)throw r}function S(t){var n=t.exec(e);if(n){var r=n[0];return v(r),e=e.slice(r.length),n}}function C(){S(i)}function w(e){var t;for(e||=[];t=T();)t!==!1&&e.push(t);return e}function T(){var t=y();if(!(d!=e.charAt(0)||f!=e.charAt(1))){for(var n=2;p!=e.charAt(n)&&(f!=e.charAt(n)||d!=e.charAt(n+1));)++n;if(n+=2,p===e.charAt(n-1))return x(`End of comment missing`);var r=e.slice(2,n-2);return g+=2,v(r),e=e.slice(n),g+=2,t({type:m,comment:r})}}function E(){var e=y(),t=S(a);if(t){if(T(),!S(o))return x(`property missing ':'`);var r=S(s),i=e({type:h,property:_(t[0].replace(n,p)),value:r?_(r[0].replace(n,p)):p});return S(c),i}}function D(){var e=[];w(e);for(var t;t=E();)t!==!1&&(e.push(t),w(e));return e}return C(),D()}function _(e){return e?e.replace(l,p):p}t.exports=g})),ga=o((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.default=r;var n=t(ha());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),_a=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),va=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(ga()),r=_a();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),ya=xa(`end`),ba=xa(`start`);function xa(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Sa(e){let t=ba(e),n=ya(e);if(t&&n)return{start:t,end:n}}function Ca(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Ta(e.position):`start`in e||`end`in e?Ta(e):`line`in e||`column`in e?wa(e):``}function wa(e){return Ea(e&&e.line)+`:`+Ea(e&&e.column)}function Ta(e){return wa(e&&e.start)+`-`+wa(e&&e.end)}function Ea(e){return e&&typeof e==`number`?e:1}var Da=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Ca(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Da.prototype.file=``,Da.prototype.name=``,Da.prototype.reason=``,Da.prototype.message=``,Da.prototype.stack=``,Da.prototype.column=void 0,Da.prototype.line=void 0,Da.prototype.ancestors=void 0,Da.prototype.cause=void 0,Da.prototype.fatal=void 0,Da.prototype.place=void 0,Da.prototype.ruleId=void 0,Da.prototype.source=void 0;var Oa=l(va(),1),ka={}.hasOwnProperty,Aa=new Map,ja=/[A-Z]/g,Ma=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Na=new Set([`td`,`th`]),Pa=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Fa(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=Ka(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=Ga(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?fa:da,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Ia(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Ia(e,t,n){if(t.type===`element`)return La(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Ra(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Ba(e,t,n);if(t.type===`mdxjsEsm`)return za(e,t);if(t.type===`root`)return Va(e,t,n);if(t.type===`text`)return Ha(e,t)}function La(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=fa,e.schema=i),e.ancestors.push(t);let a=Qa(e,t.tagName,!1),o=qa(e,t),s=Ya(e,t);return Ma.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!ji(e):!0})),Ua(e,o,a,t),Wa(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Ra(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}$a(e,t.position)}function za(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);$a(e,t.position)}function Ba(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=fa,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Qa(e,t.name,!0),o=Ja(e,t),s=Ya(e,t);return Ua(e,o,a,t),Wa(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Va(e,t,n){let r={};return Wa(r,Ya(e,t)),e.create(t,e.Fragment,r,n)}function Ha(e,t){return t.value}function Ua(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Wa(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Ga(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function Ka(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=ba(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function qa(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&ka.call(t.properties,i)){let a=Xa(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Na.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Ja(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else $a(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else $a(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function Ya(e,t){let n=[],r=-1,i=e.passKeys?new Map:Aa;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=Ia(e,a,o);s!==void 0&&n.push(s)}return n}function Xa(e,t,n){let r=ca(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Ti(n):ma(n)),r.property===`style`){let t=typeof n==`object`?n:Za(e,String(n));return e.stylePropertyNameCase===`css`&&(t=eo(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?ia[r.property]||r.property:r.attribute,n]}}function Za(e,t){try{return(0,Oa.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new Da("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=Pa+`#cannot-parse-style-attribute`,r}}function Qa(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=ki(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=ki(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return ka.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);$a(e)}function $a(e,t){let n=new Da("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=Pa+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function eo(e){let t={},n;for(n in e)ka.call(e,n)&&(t[to(n)]=e[n]);return t}function to(e){let t=e.replace(ja,no);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function no(e){return`-`+e.toLowerCase()}var ro={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},io={};function ao(e,t){let n=t||io;return oo(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function oo(e,t,n){if(co(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return so(e.children,t,n)}return Array.isArray(e)?so(e,t,n):``}function so(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=oo(e[i],t,n);return r.join(``)}function co(e){return!!(e&&typeof e==`object`)}var lo=document.createElement(`i`);function uo(e){let t=`&`+e+`;`;lo.innerHTML=t;let n=lo.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function fo(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function po(e,t){return e.length>0?(fo(e,e.length,0,t),e):t}var mo={}.hasOwnProperty;function ho(e){let t={},n=-1;for(;++n<e.length;)go(t,e[n]);return t}function go(e,t){let n;for(n in t){let r=(mo.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){mo.call(r,a)||(r[a]=[]);let e=i[a];_o(r[a],Array.isArray(e)?e:e?[e]:[])}}}function _o(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);fo(e,0,0,r)}function vo(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function yo(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var bo=Mo(/[A-Za-z]/),xo=Mo(/[\dA-Za-z]/),So=Mo(/[#-'*+\--9=?A-Z^-~]/);function Co(e){return e!==null&&(e<32||e===127)}var wo=Mo(/\d/),To=Mo(/[\dA-Fa-f]/),Eo=Mo(/[!-/:-@[-`{-~]/);function Do(e){return e!==null&&e<-2}function Oo(e){return e!==null&&(e<0||e===32)}function ko(e){return e===-2||e===-1||e===32}var Ao=Mo(/\p{P}|\p{S}/u),jo=Mo(/\s/);function Mo(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function No(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&xo(e.charCodeAt(n+1))&&xo(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Po(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return ko(r)?(e.enter(n),s(r)):t(r)}function s(r){return ko(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var Fo={tokenize:Io};function Io(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Po(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return Do(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Lo={tokenize:zo},Ro={tokenize:Bo};function zo(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return fo(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Ro,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Ro,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return Do(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;fo(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Bo(e,t,n){return Po(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Vo(e){if(e===null||Oo(e)||jo(e))return 1;if(Ao(e))return 2}function Ho(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var Uo={name:`attention`,resolveAll:Wo,tokenize:Go};function Wo(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};Ko(d,-c),Ko(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=po(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=po(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=po(l,Ho(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=po(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=po(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,fo(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Go(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Vo(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Vo(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function Ko(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var qo={name:`autolink`,tokenize:Jo};function Jo(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return bo(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||xo(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||xo(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||Co(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):So(t)?(e.consume(t),l):n(t)}function u(e){return xo(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||xo(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var Yo={partial:!0,tokenize:Xo};function Xo(e,t,n){return r;function r(t){return ko(t)?Po(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Do(e)?t(e):n(e)}}var Zo={continuation:{tokenize:$o},exit:es,name:`blockQuote`,tokenize:Qo};function Qo(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return ko(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function $o(e,t,n){let r=this;return i;function i(t){return ko(t)?Po(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Zo,t,n)(r)}}function es(e){e.exit(`blockQuote`)}var ts={name:`characterEscape`,tokenize:ns};function ns(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Eo(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var rs={name:`characterReference`,tokenize:is};function is(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=xo,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=To,u):(e.enter(`characterReferenceValue`),a=7,o=wo,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===xo&&!uo(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var as={partial:!0,tokenize:cs},os={concrete:!0,name:`codeFenced`,tokenize:ss};function ss(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),ko(t)?Po(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Do(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(as,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Do(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):ko(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Po(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Do(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Do(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&ko(t)?Po(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Do(t)?e.check(as,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Do(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),ko(t)?Po(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),ko(t)?Po(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Do(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function cs(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var ls={name:`codeIndented`,tokenize:ds},us={partial:!0,tokenize:fs};function ds(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Po(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):Do(t)?e.attempt(us,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||Do(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function fs(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):Do(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Po(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):Do(e)?i(e):n(e)}}var ps={name:`codeText`,previous:hs,resolve:ms,tokenize:gs};function ms(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function hs(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function gs(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):Do(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||Do(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var _s=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&vs(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),vs(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),vs(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);vs(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);vs(this.left,t.reverse())}}};function vs(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function ys(e){let t={},n=-1,r,i,a,o,s,c,l,u=new _s(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,bs(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return fo(e,0,1/0,u.slice(0)),!l}function bs(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var xs={resolve:Cs,tokenize:ws},Ss={partial:!0,tokenize:Ts};function Cs(e){return ys(e),e}function ws(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):Do(t)?e.check(Ss,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Ts(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Po(e,a,`linePrefix`)}function a(i){if(i===null||Do(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Es(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Co(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||Do(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||Oo(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||Co(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Ds(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):Do(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||Do(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!ko(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Os(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):Do(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Po(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Do(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function ks(e,t){let n;return r;function r(i){return Do(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):ko(i)?Po(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var As={name:`definition`,tokenize:Ms},js={partial:!0,tokenize:Ns};function Ms(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Ds.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=yo(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return Oo(t)?ks(e,l)(t):l(t)}function l(t){return Es(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(js,d,d)(t)}function d(t){return ko(t)?Po(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Do(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Ns(e,t,n){return r;function r(t){return Oo(t)?ks(e,i)(t):n(t)}function i(t){return Os(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return ko(t)?Po(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Do(e)?t(e):n(e)}}var Ps={name:`hardBreakEscape`,tokenize:Fs};function Fs(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Do(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Is={name:`headingAtx`,resolve:Ls,tokenize:Rs};function Ls(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},fo(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function Rs(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||Oo(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Do(n)?(e.exit(`atxHeading`),t(n)):ko(n)?Po(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||Oo(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var zs=`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.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Bs=[`pre`,`script`,`style`,`textarea`],Vs={concrete:!0,name:`htmlFlow`,resolveTo:Ws,tokenize:Gs},Hs={partial:!0,tokenize:qs},Us={partial:!0,tokenize:Ks};function Ws(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Gs(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:A):bo(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):bo(a)?(e.consume(a),i=4,r.interrupt?t:A):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:A):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return bo(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||Oo(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Bs.includes(l)?(i=1,r.interrupt?t(s):O(s)):zs.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||xo(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return ko(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||bo(t)?(e.consume(t),b):ko(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||xo(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):ko(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):ko(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Do(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||Oo(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||ko(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||Do(t)?O(t):ko(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),re):t===60&&i===1?(e.consume(t),k):t===62&&i===4?(e.consume(t),oe):t===63&&i===3?(e.consume(t),A):t===93&&i===5?(e.consume(t),ae):Do(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Hs,j,ee)(t)):t===null||Do(t)?(e.exit(`htmlFlowData`),ee(t)):(e.consume(t),O)}function ee(t){return e.check(Us,te,j)(t)}function te(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ne}function ne(t){return t===null||Do(t)?ee(t):(e.enter(`htmlFlowData`),O(t))}function re(t){return t===45?(e.consume(t),A):O(t)}function k(t){return t===47?(e.consume(t),o=``,ie):O(t)}function ie(t){if(t===62){let n=o.toLowerCase();return Bs.includes(n)?(e.consume(t),oe):O(t)}return bo(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ie):O(t)}function ae(t){return t===93?(e.consume(t),A):O(t)}function A(t){return t===62?(e.consume(t),oe):t===45&&i===2?(e.consume(t),A):O(t)}function oe(t){return t===null||Do(t)?(e.exit(`htmlFlowData`),j(t)):(e.consume(t),oe)}function j(n){return e.exit(`htmlFlow`),t(n)}}function Ks(e,t,n){let r=this;return i;function i(t){return Do(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function qs(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Yo,t,n)}}var Js={name:`htmlText`,tokenize:Ys};function Ys(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):bo(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):bo(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):Do(t)?(o=d,k(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?re(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):Do(t)?(o=h,k(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?re(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?re(t):Do(t)?(o=v,k(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Do(t)?(o=y,k(t)):(e.consume(t),y)}function b(e){return e===62?re(e):y(e)}function x(t){return bo(t)?(e.consume(t),S):n(t)}function S(t){return t===45||xo(t)?(e.consume(t),S):C(t)}function C(t){return Do(t)?(o=C,k(t)):ko(t)?(e.consume(t),C):re(t)}function w(t){return t===45||xo(t)?(e.consume(t),w):t===47||t===62||Oo(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),re):t===58||t===95||bo(t)?(e.consume(t),E):Do(t)?(o=T,k(t)):ko(t)?(e.consume(t),T):re(t)}function E(t){return t===45||t===46||t===58||t===95||xo(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):Do(t)?(o=D,k(t)):ko(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,ee):Do(t)?(o=O,k(t)):ko(t)?(e.consume(t),O):(e.consume(t),te)}function ee(t){return t===i?(e.consume(t),i=void 0,ne):t===null?n(t):Do(t)?(o=ee,k(t)):(e.consume(t),ee)}function te(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||Oo(t)?T(t):(e.consume(t),te)}function ne(e){return e===47||e===62||Oo(e)?T(e):n(e)}function re(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function k(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ie}function ie(t){return ko(t)?Po(e,ae,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ae(t)}function ae(t){return e.enter(`htmlTextData`),o(t)}}var Xs={name:`labelEnd`,resolveAll:ec,resolveTo:tc,tokenize:nc},Zs={tokenize:rc},Qs={tokenize:ic},$s={tokenize:ac};function ec(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&fo(e,0,e.length,n),e}function tc(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=po(s,e.slice(a+1,a+r+3)),s=po(s,[[`enter`,u,t]]),s=po(s,Ho(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=po(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=po(s,e.slice(o+1)),s=po(s,[[`exit`,c,t]]),fo(e,a,e.length,s),e}function nc(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(yo(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Zs,u,o?u:d)(t):t===91?e.attempt(Qs,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt($s,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function rc(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return Oo(t)?ks(e,a)(t):a(t)}function a(t){return t===41?u(t):Es(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return Oo(t)?ks(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Os(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return Oo(t)?ks(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function ic(e,t,n){let r=this;return i;function i(t){return Ds.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(yo(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function ac(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var oc={name:`labelStartImage`,resolveAll:Xs.resolveAll,tokenize:sc};function sc(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var cc={name:`labelStartLink`,resolveAll:Xs.resolveAll,tokenize:lc};function lc(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var uc={name:`lineEnding`,tokenize:dc};function dc(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Po(e,t,`linePrefix`)}}var fc={name:`thematicBreak`,tokenize:pc};function pc(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||Do(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),ko(t)?Po(e,s,`whitespace`)(t):s(t))}}var mc={continuation:{tokenize:vc},exit:bc,name:`list`,tokenize:_c},hc={partial:!0,tokenize:xc},gc={partial:!0,tokenize:yc};function _c(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:wo(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(fc,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return wo(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(Yo,r.interrupt?n:u,e.attempt(hc,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return ko(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function vc(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Yo,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Po(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!ko(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(gc,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Po(e,e.attempt(mc,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function yc(e,t,n){let r=this;return Po(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function bc(e){e.exit(this.containerState.type)}function xc(e,t,n){let r=this;return Po(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!ko(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var Sc={name:`setextUnderline`,resolveTo:Cc,tokenize:wc};function Cc(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function wc(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),ko(t)?Po(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Do(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var Tc={tokenize:Ec};function Ec(e){let t=this,n=e.attempt(Yo,r,e.attempt(this.parser.constructs.flowInitial,i,Po(e,e.attempt(this.parser.constructs.flow,i,e.attempt(xs,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var Dc={resolveAll:jc()},Oc=Ac(`string`),kc=Ac(`text`);function Ac(e){return{resolveAll:jc(e===`text`?Mc:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function jc(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Mc(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var Nc=s({attentionMarkers:()=>Vc,contentInitial:()=>Fc,disable:()=>Hc,document:()=>Pc,flow:()=>Lc,flowInitial:()=>Ic,insideSpan:()=>Bc,string:()=>Rc,text:()=>zc}),Pc={42:mc,43:mc,45:mc,48:mc,49:mc,50:mc,51:mc,52:mc,53:mc,54:mc,55:mc,56:mc,57:mc,62:Zo},Fc={91:As},Ic={[-2]:ls,[-1]:ls,32:ls},Lc={35:Is,42:fc,45:[Sc,fc],60:Vs,61:Sc,95:fc,96:os,126:os},Rc={38:rs,92:ts},zc={[-5]:uc,[-4]:uc,[-3]:uc,33:oc,38:rs,42:Uo,60:[qo,Js],91:cc,92:[Ps,ts],93:Xs,95:Uo,96:ps},Bc={null:[Uo,Dc]},Vc={null:[42,95]},Hc={null:[]};function Uc(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=po(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Ho(a,l.events,l),l.events):[]}function f(e,t){return Gc(p(e),t)}function p(e){return Wc(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){Do(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&fo(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Wc(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Gc(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
21
+ `;break;case-3:o=`\r
22
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Kc(e){let t={constructs:ho([Nc,...(e||{}).extensions||[]]),content:n(Fo),defined:[],document:n(Lo),flow:n(Tc),lazy:{},string:n(Oc),text:n(kc)};return t;function n(e){return n;function n(n){return Uc(t,e,n)}}}function qc(e){for(;!ys(e););return e}var Jc=/[\0\t\n\r]/g;function Yc(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(Jc.lastIndex=u,c=Jc.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var Xc=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Zc(e){return e.replace(Xc,Qc)}function Qc(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return vo(n.slice(t?2:1),t?16:10)}return uo(n)||e}var $c={}.hasOwnProperty;function el(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),tl(n)(qc(Kc(n).document().write(Yc()(e,t,!0))))}function tl(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(Ce),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ye),blockQuote:a(me),characterEscape:T,characterReference:T,codeFenced:a(he),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(he,o),codeText:a(ge,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(_e),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(ve),hardBreakEscape:a(be),hardBreakTrailing:a(be),htmlFlow:a(xe,o),htmlFlowData:T,htmlText:a(xe,o),htmlTextData:T,image:a(Se),label:o,link:a(Ce),listItem:a(Te),listItemValue:f,listOrdered:a(we,d),listUnordered:a(we),paragraph:a(Ee),reference:se,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ye),strong:a(De),thematicBreak:a(ke)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:pe,autolinkProtocol:fe,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:le,characterReferenceMarkerNumeric:le,characterReferenceValue:ue,characterReference:de,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(ne),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(ee),htmlFlowData:E,htmlText:c(te),htmlTextData:E,image:c(k),label:ae,labelText:ie,lineEnding:D,link:c(re),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ce,resourceDestinationString:A,resourceTitleString:oe,resource:j,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};rl(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];$c.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||al).call(a,void 0,e[0])}for(r.position={start:nl(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:nl(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:nl(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||al).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Ca({start:e.start,end:e.end})+`): it’s not open`);n.position.end=nl(e.end)}function u(){return ao(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=yo(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Oe(),n.position={start:nl(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=nl(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=nl(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function re(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function k(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ie(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Zc(t),n.identifier=yo(t).toLowerCase()}function ae(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function oe(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function j(){this.data.inReference=void 0}function se(){this.data.referenceType=`collapsed`}function ce(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=yo(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function le(e){this.data.characterReferenceType=e.type}function ue(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=vo(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=uo(t);let i=this.stack[this.stack.length-1];i.value+=r}function de(e){let t=this.stack.pop();t.position.end=nl(e.end)}function fe(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function pe(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function me(){return{type:`blockquote`,children:[]}}function he(){return{type:`code`,lang:null,meta:null,value:``}}function ge(){return{type:`inlineCode`,value:``}}function _e(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function ve(){return{type:`emphasis`,children:[]}}function ye(){return{type:`heading`,depth:0,children:[]}}function be(){return{type:`break`}}function xe(){return{type:`html`,value:``}}function Se(){return{type:`image`,title:null,url:``,alt:null}}function Ce(){return{type:`link`,title:null,url:``,children:[]}}function we(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Te(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Ee(){return{type:`paragraph`,children:[]}}function De(){return{type:`strong`,children:[]}}function Oe(){return{type:`text`,value:``}}function ke(){return{type:`thematicBreak`}}}function nl(e){return{line:e.line,column:e.column,offset:e.offset}}function rl(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?rl(e,r):il(e,r)}}function il(e,t){let n;for(n in t)if($c.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function al(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Ca({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ca({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Ca({start:t.start,end:t.end})+`) is still open`)}function ol(e){let t=this;t.parser=n;function n(n){return el(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function sl(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function cl(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
23
+ `}]}function ll(e,t){let n=t.value?t.value+`
24
+ `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function ul(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dl(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fl(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=No(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function pl(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ml(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function hl(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function gl(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return hl(e,t);let i={src:No(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function _l(e,t){let n={src:No(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function vl(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function yl(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return hl(e,t);let i={href:No(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function bl(e,t){let n={href:No(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function xl(e,t,n){let r=e.all(t),i=n?Sl(n):Cl(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
25
+ `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
26
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function Sl(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=Cl(n[r])}return t}function Cl(e){return e.spread??e.children.length>1}function wl(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Tl(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function El(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Dl(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ol(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=ba(t.children[1]),o=ya(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function kl(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function Al(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var jl=9,Ml=32;function Nl(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(Pl(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Pl(t.slice(i),i>0,!1)),a.join(``)}function Pl(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===jl||t===Ml;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===jl||t===Ml;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function Fl(e,t){let n={type:`text`,value:Nl(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Il(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var Ll={blockquote:sl,break:cl,code:ll,delete:ul,emphasis:dl,footnoteReference:fl,heading:pl,html:ml,imageReference:gl,image:_l,inlineCode:vl,linkReference:yl,link:bl,listItem:xl,list:wl,paragraph:Tl,root:El,strong:Dl,table:Ol,tableCell:Al,tableRow:kl,text:Fl,thematicBreak:Il,toml:Rl,yaml:Rl,definition:Rl,footnoteDefinition:Rl};function Rl(){}var zl=typeof self==`object`?self:globalThis,Bl=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new zl[e](t)},Vl=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(Bl(e,t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(Bl(a,o),i)};return r},Hl=e=>Vl(new Map,e)(0),Ul=``,{toString:Wl}={},{keys:Gl}=Object,Kl=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Wl.call(e).slice(8,-1);switch(n){case`Array`:return[1,Ul];case`Object`:return[2,Ul];case`Date`:return[3,Ul];case`RegExp`:return[4,Ul];case`Map`:return[5,Ul];case`Set`:return[6,Ul];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},ql=([e,t])=>e===0&&(t===`function`||t===`symbol`),Jl=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=Kl(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of Gl(r))(e||!ql(Kl(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(ql(Kl(n))||ql(Kl(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!ql(Kl(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},Yl=(e,{json:t,lossy:n}={})=>{let r=[];return Jl(!(t||n),!!t,new Map,r)(e),r},Xl=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?Hl(Yl(e,t)):structuredClone(e):(e,t)=>Hl(Yl(e,t));function Zl(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function Ql(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function $l(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||Zl,r=e.options.footnoteBackLabel||Ql,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=No(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...Xl(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
27
+ `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
28
+ `}]}}var eu=(function(e){if(e==null)return au;if(typeof e==`function`)return iu(e);if(typeof e==`object`)return Array.isArray(e)?tu(e):nu(e);if(typeof e==`string`)return ru(e);throw Error(`Expected function, string, or object as test`)});function tu(e){let t=[],n=-1;for(;++n<e.length;)t[n]=eu(e[n]);return iu(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function nu(e){let t=e;return iu(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function ru(e){return iu(t);function t(t){return t&&t.type===e}}function iu(e){return t;function t(t,n,r){return!!(ou(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function au(){return!0}function ou(e){return typeof e==`object`&&!!e&&`type`in e}function su(e){return e}var cu=[],lu=`skip`;function uu(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=eu(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,`name`,{value:`node (`+su(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=cu,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=du(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function du(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?cu:[e]}function fu(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),uu(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var pu={}.hasOwnProperty,mu={};function hu(e,t){let n=t||mu,r=new Map,i=new Map,a={all:s,applyData:_u,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...Ll,...n.handlers},one:o,options:n,patch:gu,wrap:yu};return fu(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(pu.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=Xl(n);return r.children=a.all(e),r}return Xl(e)}return(a.options.unknownHandler||vu)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=bu(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=bu(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function gu(e,t){e.position&&(t.position=Sa(e))}function _u(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,Xl(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function vu(e,t){let n=t.data||{},r=`value`in t&&!(pu.call(n,`hProperties`)||pu.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function yu(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
29
+ `});++r<e.length;)r&&n.push({type:`text`,value:`
30
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
31
+ `}),n}function bu(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function xu(e,t){let n=hu(e,t),r=n.one(e,void 0),i=$l(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
32
+ `},i)),a}function Su(e,t){return e&&`run`in e?async function(n,r){let i=xu(n,{file:r,...t});await e.run(i,r)}:function(n,r){return xu(n,{file:r,...e||t})}}function Cu(e){if(e)throw e}var wu=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function Tu(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Eu(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Du(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Du(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var Ou={basename:ku,dirname:Au,extname:ju,join:Mu,sep:`/`};function ku(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Fu(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Au(e){if(Fu(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function ju(e){Fu(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function Mu(...e){let t=-1,n;for(;++t<e.length;)Fu(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:Nu(n)}function Nu(e){Fu(e);let t=e.codePointAt(0)===47,n=Pu(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Pu(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Fu(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Iu={cwd:Lu};function Lu(){return`/`}function Ru(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function zu(e){if(typeof e==`string`)e=new URL(e);else if(!Ru(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return Bu(e)}function Bu(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var Vu=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],Hu=class{constructor(e){let t;t=e?Ru(e)?{path:e}:typeof e==`string`||Ku(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Iu.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Vu.length;){let e=Vu[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)Vu.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?Ou.basename(this.path):void 0}set basename(e){Wu(e,`basename`),Uu(e,`basename`),this.path=Ou.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?Ou.dirname(this.path):void 0}set dirname(e){Gu(this.basename,`dirname`),this.path=Ou.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?Ou.extname(this.path):void 0}set extname(e){if(Uu(e,`extname`),Gu(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=Ou.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Ru(e)&&(e=zu(e)),Wu(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?Ou.basename(this.path,this.extname):void 0}set stem(e){Wu(e,`stem`),Uu(e,`stem`),this.path=Ou.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new Da(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function Uu(e,t){if(e&&e.includes(Ou.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+Ou.sep+"`")}function Wu(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Gu(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Ku(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var qu=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),Ju=l(wu(),1),Yu={}.hasOwnProperty,Xu=new class e extends qu{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Eu()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,Ju.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?($u(`data`,this.frozen),this.namespace[e]=t,this):Yu.call(this.namespace,e)&&this.namespace[e]||void 0:e?($u(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=nd(e),n=this.parser||this.Parser;return Zu(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),Zu(`process`,this.parser||this.Parser),Qu(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=nd(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);id(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),Zu(`processSync`,this.parser||this.Parser),Qu(`processSync`,this.compiler||this.Compiler),this.process(e,r),td(`processSync`,`process`,t),n;function r(e,r){t=!0,Cu(e),n=r}}run(e,t,n){ed(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=nd(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),td(`runSync`,`run`,n),r;function i(e,t){Cu(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=nd(t),r=this.compiler||this.Compiler;return Qu(`stringify`,r),ed(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if($u(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,Ju.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];Tu(o)&&Tu(r)&&(r=(0,Ju.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function Zu(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function Qu(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function $u(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ed(e){if(!Tu(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function td(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function nd(e){return rd(e)?e:new Hu(e)}function rd(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function id(e){return typeof e==`string`||ad(e)}function ad(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var od=[],sd={allowDangerousHtml:!0},cd=/^(https?|ircs?|mailto|xmpp)$/i,ld=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function ud(e){let t=dd(e),n=fd(e);return pd(t.runSync(t.parse(n),n),e)}function dd(e){let t=e.rehypePlugins||od,n=e.remarkPlugins||od,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...sd}:sd;return Xu().use(ol).use(n).use(Su,r).use(t)}function fd(e){let t=e.children||``,n=new Hu;return typeof t==`string`?n.value=t:``+t,n}function pd(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||md;for(let e of ld)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return fu(e,l),Fa(e,{Fragment:L.Fragment,components:i,ignoreInvalidStyle:!0,jsx:L.jsx,jsxs:L.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in ro)if(Object.hasOwn(ro,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=ro[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function md(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||cd.test(e.slice(0,t))?e:``}var hd=/[#.]/g;function gd(e,t){let n=e||``,r={},i=0,a,o;for(;i<n.length;){hd.lastIndex=i;let e=hd.exec(n),t=n.slice(i,e?e.index:n.length);t&&(a?a===`#`?r.id=t:Array.isArray(r.className)?r.className.push(t):r.className=[t]:o=t,i+=t.length),e&&(a=e[0],i++)}return{type:`element`,tagName:o||t||`div`,properties:r,children:[]}}function _d(e,t,n){let r=n?Cd(n):void 0;function i(n,i,...a){let o;if(n==null){o={type:`root`,children:[]};let e=i;a.unshift(e)}else{o=gd(n,t);let s=o.tagName.toLowerCase(),c=r?r.get(s):void 0;if(o.tagName=c||s,vd(i))a.unshift(i);else for(let[t,n]of Object.entries(i))yd(e,o.properties,t,n)}for(let e of a)bd(o.children,e);return o.type===`element`&&o.tagName===`template`&&(o.content={type:`root`,children:o.children},o.children=[]),o}return i}function vd(e){if(typeof e!=`object`||!e||Array.isArray(e))return!0;if(typeof e.type!=`string`)return!1;let t=e,n=Object.keys(e);for(let e of n){let n=t[e];if(n&&typeof n==`object`){if(!Array.isArray(n))return!0;let e=n;for(let t of e)if(typeof t!=`number`&&typeof t!=`string`)return!0}}return!!(`children`in e&&Array.isArray(e.children))}function yd(e,t,n,r){let i=ca(e,n),a;if(r!=null){if(typeof r==`number`){if(Number.isNaN(r))return;a=r}else a=typeof r==`boolean`?r:typeof r==`string`?i.spaceSeparated?pa(r):i.commaSeparated?wi(r):i.commaOrSpaceSeparated?pa(wi(r).join(` `)):xd(i,i.property,r):Array.isArray(r)?[...r]:i.property===`style`?Sd(r):String(r);if(Array.isArray(a)){let e=[];for(let t of a)e.push(xd(i,i.property,t));a=e}i.property===`className`&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function bd(e,t){if(t!=null)if(typeof t==`number`||typeof t==`string`)e.push({type:`text`,value:String(t)});else if(Array.isArray(t))for(let n of t)bd(e,n);else if(typeof t==`object`&&`type`in t)t.type===`root`?bd(e,t.children):e.push(t);else throw Error("Expected node, nodes, or string, got `"+t+"`")}function xd(e,t,n){if(typeof n==`string`){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===``||Fi(n)===Fi(t)))return!0}return n}function Sd(e){let t=[];for(let[n,r]of Object.entries(e))t.push([n,r].join(`: `));return t.join(`; `)}function Cd(e){let t=new Map;for(let n of e)t.set(n.toLowerCase(),n);return t}var wd=`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.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.foreignObject.glyphRef.linearGradient.radialGradient.solidColor.textArea.textPath`.split(`.`),Td=_d(da,`div`),Ed=_d(fa,`g`,wd),Dd={html:`http://www.w3.org/1999/xhtml`,mathml:`http://www.w3.org/1998/Math/MathML`,svg:`http://www.w3.org/2000/svg`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function Od(e,t){return kd(e,t||{})||{type:`root`,children:[]}}function kd(e,t){let n=Ad(e,t);return n&&t.afterTransform&&t.afterTransform(e,n),n}function Ad(e,t){switch(e.nodeType){case 1:return Fd(e,t);case 3:return Nd(e);case 8:return Pd(e);case 9:return jd(e,t);case 10:return Md();case 11:return jd(e,t);default:return}}function jd(e,t){return{type:`root`,children:Id(e,t)}}function Md(){return{type:`doctype`}}function Nd(e){return{type:`text`,value:e.nodeValue||``}}function Pd(e){return{type:`comment`,value:e.nodeValue||``}}function Fd(e,t){let n=e.namespaceURI,r=n===Dd.svg?Ed:Td,i=n===Dd.html?e.tagName.toLowerCase():e.tagName,a=n===Dd.html&&i===`template`?e.content:e,o=e.getAttributeNames(),s={},c=-1;for(;++c<o.length;)s[o[c]]=e.getAttribute(o[c])||``;return r(i,s,Id(a,t))}function Id(e,t){let n=e.childNodes,r=[],i=-1;for(;++i<n.length;){let e=kd(n[i],t);e!==void 0&&r.push(e)}return r}var Ld=new DOMParser;function Rd(e,t){return Od(t?.fragment?zd(e):Ld.parseFromString(e,`text/html`))}function zd(e){let t=document.createElement(`template`);return t.innerHTML=e,t.content}var Bd=(function(e,t,n){let r=eu(n);if(!e||!e.type||!e.children)throw Error(`Expected parent node`);if(typeof t==`number`){if(t<0||t===1/0)throw Error(`Expected positive finite number as index`)}else if(t=e.children.indexOf(t),t<0)throw Error(`Expected child node or index`);for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]}),Vd=(function(e){if(e==null)return Gd;if(typeof e==`string`)return Ud(e);if(typeof e==`object`)return Hd(e);if(typeof e==`function`)return Wd(e);throw Error("Expected function, string, or array as `test`")});function Hd(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Vd(e[n]);return Wd(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Ud(e){return Wd(t);function t(t){return t.tagName===e}}function Wd(e){return t;function t(t,n,r){return!!(Kd(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Gd(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`element`&&`tagName`in e&&typeof e.tagName==`string`)}function Kd(e){return typeof e==`object`&&!!e&&`type`in e&&`tagName`in e}var qd=/\n/g,Jd=/[\t ]+/g,Yd=Vd(`br`),Xd=Vd(uf),Zd=Vd(`p`),Qd=Vd(`tr`),$d=Vd([`datalist`,`head`,`noembed`,`noframes`,`noscript`,`rp`,`script`,`style`,`template`,`title`,lf,df]),ef=Vd(`address.article.aside.blockquote.body.caption.center.dd.dialog.dir.dl.dt.div.figure.figcaption.footer.form,.h1.h2.h3.h4.h5.h6.header.hgroup.hr.html.legend.li.listing.main.menu.nav.ol.p.plaintext.pre.section.ul.xmp`.split(`.`));function tf(e,t){let n=t||{},r=`children`in e?e.children:[],i=ef(e),a=cf(e,{whitespace:n.whitespace||`normal`,breakBefore:!1,breakAfter:!1}),o=[];(e.type===`text`||e.type===`comment`)&&o.push(...af(e,{whitespace:a,breakBefore:!0,breakAfter:!0}));let s=-1;for(;++s<r.length;)o.push(...nf(r[s],e,{whitespace:a,breakBefore:s?void 0:i,breakAfter:s<r.length-1?Yd(r[s+1]):i}));let c=[],l;for(s=-1;++s<o.length;){let e=o[s];typeof e==`number`?l!==void 0&&e>l&&(l=e):e&&(l!==void 0&&l>-1&&c.push(`
33
+ `.repeat(l)||` `),l=-1,c.push(e))}return c.join(``)}function nf(e,t,n){return e.type===`element`?rf(e,t,n):e.type===`text`?n.whitespace===`normal`?af(e,n):of(e):[]}function rf(e,t,n){let r=cf(e,n),i=e.children||[],a=-1,o=[];if($d(e))return o;let s,c;for(Yd(e)||Qd(e)&&Bd(t,e,Qd)?c=`
34
+ `:Zd(e)?(s=2,c=2):ef(e)&&(s=1,c=1);++a<i.length;)o=o.concat(nf(i[a],e,{whitespace:r,breakBefore:a?void 0:s,breakAfter:a<i.length-1?Yd(i[a+1]):c}));return Xd(e)&&Bd(t,e,Xd)&&o.push(` `),s&&o.unshift(s),c&&o.push(c),o}function af(e,t){let n=String(e.value),r=[],i=[],a=0;for(;a<=n.length;){qd.lastIndex=a;let e=qd.exec(n),i=e&&`index`in e?e.index:n.length;r.push(sf(n.slice(a,i).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,``),a===0?t.breakBefore:!0,i===n.length?t.breakAfter:!0)),a=i+1}let o=-1,s;for(;++o<r.length;)r[o].charCodeAt(r[o].length-1)===8203||o<r.length-1&&r[o+1].charCodeAt(0)===8203?(i.push(r[o]),s=void 0):r[o]?(typeof s==`number`&&i.push(s),i.push(r[o]),s=0):(o===0||o===r.length-1)&&i.push(0);return i}function of(e){return[String(e.value)]}function sf(e,t,n){let r=[],i=0,a;for(;i<e.length;){Jd.lastIndex=i;let n=Jd.exec(e);a=n?n.index:e.length,!i&&!a&&n&&!t&&r.push(``),i!==a&&r.push(e.slice(i,a)),i=n?a+n[0].length:a}return i!==a&&!n&&r.push(``),r.join(` `)}function cf(e,t){if(e.type===`element`){let n=e.properties||{};switch(e.tagName){case`listing`:case`plaintext`:case`xmp`:return`pre`;case`nobr`:return`nowrap`;case`pre`:return n.wrap?`pre-wrap`:`pre`;case`td`:case`th`:return n.noWrap?`nowrap`:t.whitespace;case`textarea`:return`pre-wrap`;default:}}return t.whitespace}function lf(e){return!!(e.properties||{}).hidden}function uf(e){return e.tagName===`td`||e.tagName===`th`}function df(e){return e.tagName===`dialog`&&!(e.properties||{}).open}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`,Object.setPrototypeOf(this,e.prototype),this.position=i,i!=null&&a!=null&&(this.length=a-i),this.rawMessage=t}},ff=/([A-Z])/g,pf=e=>e.replace(ff,`-$1`).toLowerCase(),mf={"&":`&amp;`,">":`&gt;`,"<":`&lt;`,'"':`&quot;`,"'":`&#x27;`},hf=/[&><"']/g,gf=e=>String(e).replace(hf,e=>mf[e]),_f=e=>e.type===`ordgroup`||e.type===`color`?e.body.length===1?_f(e.body[0]):e:e.type===`font`?_f(e.body):e,vf=new Set([`mathord`,`textord`,`atom`]),yf=e=>vf.has(_f(e).type),bf=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`},xf={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 Sf(e){if(`default`in e)return e.default;var t=e.type,n=Array.isArray(t)?t[0]:t;if(typeof n!=`string`)return n.enum[0];switch(n){case`boolean`:return!1;case`string`:return``;case`number`:return 0;case`object`:return{}}}var Cf=class{constructor(e){e===void 0&&(e={}),e||={};for(var t of Object.keys(xf)){var n=xf[t],r=e[t];this[t]=r===void 0?Sf(n):n.processor?n.processor(r):r}}reportNonstrict(e,t,n){var r=this.strict;if(typeof r==`function`&&(r=r(e,t,n)),!(!r||r===`ignore`)){if(r===!0||r===`error`)throw new B(`LaTeX-incompatible input and strict mode is set to 'error': `+(t+` [`+e+`]`),n);r===`warn`?typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)):typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`))}}useStrictBehavior(e,t,n){var r=this.strict;if(typeof r==`function`)try{r=r(e,t,n)}catch{r=`error`}return!r||r===`ignore`?!1:r===!0||r===`error`?!0:r===`warn`?(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)),!1):(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`)),!1)}isTrusted(e){if(`url`in e&&e.url&&!e.protocol){var t=bf(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},wf=class{constructor(e,t,n){this.id=e,this.size=t,this.cramped=n}sup(){return Nf[Pf[this.id]]}sub(){return Nf[Ff[this.id]]}fracNum(){return Nf[If[this.id]]}fracDen(){return Nf[Lf[this.id]]}cramp(){return Nf[Rf[this.id]]}text(){return Nf[zf[this.id]]}isTight(){return this.size>=2}},Tf=0,Ef=1,Df=2,Of=3,kf=4,Af=5,jf=6,Mf=7,Nf=[new wf(Tf,0,!1),new wf(Ef,0,!0),new wf(Df,1,!1),new wf(Of,1,!0),new wf(kf,2,!1),new wf(Af,2,!0),new wf(jf,3,!1),new wf(Mf,3,!0)],Pf=[kf,Af,kf,Af,jf,Mf,jf,Mf],Ff=[Af,Af,Af,Af,Mf,Mf,Mf,Mf],If=[Df,Of,kf,Af,jf,Mf,jf,Mf],Lf=[Of,Of,Af,Af,Mf,Mf,Mf,Mf],Rf=[Ef,Ef,Of,Of,Af,Af,Mf,Mf],zf=[Tf,Ef,Df,Of,Df,Of,Df,Of],Bf={DISPLAY:Nf[Tf],TEXT:Nf[Df],SCRIPT:Nf[kf],SCRIPTSCRIPT:Nf[jf]},Vf=[{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 Hf(e){for(var t=0;t<Vf.length;t++)for(var n=Vf[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 Uf=[];Vf.forEach(e=>e.blocks.forEach(e=>Uf.push(...e)));function Wf(e){for(var t=0;t<Uf.length;t+=2)if(e>=Uf[t]&&e<=Uf[t+1])return!0;return!1}var Gf=e=>e+` `+e,Kf=80,qf=function(e,t){return`M95,`+(622+e+t)+`
35
+ c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
36
+ c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
37
+ 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
38
+ s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
39
+ c69,-144,104.5,-217.7,106.5,-221
40
+ l`+e/2.075+` -`+e+`
41
+ c5.3,-9.3,12,-14,20,-14
42
+ H400000v`+(40+e)+`H845.2724
43
+ s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
44
+ c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
45
+ M`+(834+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},Jf=function(e,t){return`M263,`+(601+e+t)+`c0.7,0,18,39.7,52,119
46
+ c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
47
+ c340,-704.7,510.7,-1060.3,512,-1067
48
+ l`+e/2.084+` -`+e+`
49
+ c4.7,-7.3,11,-11,19,-11
50
+ H40000v`+(40+e)+`H1012.3
51
+ s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
52
+ 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
53
+ s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
54
+ c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
55
+ M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},Yf=function(e,t){return`M983 `+(10+e+t)+`
56
+ l`+e/3.13+` -`+e+`
57
+ c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
58
+ 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
59
+ 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
60
+ c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
61
+ c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
62
+ c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
63
+ c53.7,-170.3,84.5,-266.8,92.5,-289.5z
64
+ M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},Xf=function(e,t){return`M424,`+(2398+e+t)+`
65
+ c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
66
+ 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
67
+ s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
68
+ s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
69
+ l`+e/4.223+` -`+e+`c4,-6.7,10,-10,18,-10 H400000
70
+ v`+(40+e)+`H1014.6
71
+ s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
72
+ c-2,6,-10,9,-24,9
73
+ c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+` `+t+`
74
+ h400000v`+(40+e)+`h-400000z`},Zf=function(e,t){return`M473,`+(2713+e+t)+`
75
+ c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+` -`+e+`
76
+ c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
77
+ s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
78
+ 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
79
+ 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
80
+ s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
81
+ 606zM`+(1001+e)+` `+t+`h400000v`+(40+e)+`H1017.7z`},Qf=function(e){var t=e/2;return`M400000 `+e+` H0 L`+t+` 0 l65 45 L145 `+(e-80)+` H400000z`},$f=function(e,t,n){var r=n-54-t-e;return`M702 `+(e+t)+`H400000`+(40+e)+`
82
+ 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
83
+ h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
84
+ c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
85
+ 219 661 l218 661zM702 `+t+`H400000v`+(40+e)+`H742z`},ep=function(e,t,n){t=1e3*t;var r=``;switch(e){case`sqrtMain`:r=qf(t,Kf);break;case`sqrtSize1`:r=Jf(t,Kf);break;case`sqrtSize2`:r=Yf(t,Kf);break;case`sqrtSize3`:r=Xf(t,Kf);break;case`sqrtSize4`:r=Zf(t,Kf);break;case`sqrtTall`:r=$f(t,Kf,n)}return r},tp=function(e,t){switch(e){case`⎜`:return Gf(`M291 0 H417 V`+t+` H291z`);case`∣`:return Gf(`M145 0 H188 V`+t+` H145z`);case`∥`:return Gf(`M145 0 H188 V`+t+` H145z`)+Gf(`M367 0 H410 V`+t+` H367z`);case`⎟`:return Gf(`M457 0 H583 V`+t+` H457z`);case`⎢`:return Gf(`M319 0 H403 V`+t+` H319z`);case`⎥`:return Gf(`M263 0 H347 V`+t+` H263z`);case`⎪`:return Gf(`M384 0 H504 V`+t+` H384z`);case`⏐`:return Gf(`M312 0 H355 V`+t+` H312z`);case`‖`:return Gf(`M257 0 H300 V`+t+` H257z`)+Gf(`M478 0 H521 V`+t+` H478z`);default:return``}},np={doubleleftarrow:`M262 157
86
+ 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
87
+ 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
88
+ 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
89
+ 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
90
+ 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
91
+ -86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
92
+ -2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
93
+ m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
94
+ -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
95
+ 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
96
+ -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
97
+ -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
98
+ -13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
99
+ 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
100
+ -107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
101
+ 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
102
+ -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
103
+ 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
104
+ 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
105
+ 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
106
+ l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
107
+ -45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
108
+ 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
109
+ 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
110
+ 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
111
+ -331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
112
+ 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
113
+ 435 0h399565z`,leftgroupunder:`M400000 262
114
+ 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
115
+ 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
116
+ -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
117
+ -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
118
+ -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
119
+ 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
120
+ -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
121
+ -10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
122
+ m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
123
+ 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
124
+ 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
125
+ -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
126
+ 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
127
+ -2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
128
+ 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
129
+ -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
130
+ -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
131
+ 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:Gf(`M40 281 V428 H0 V94 H40 V241 H400000 v40z`),leftbracketunder:Gf(`M0 0 h120 V290 H399995 v120 H0z`),leftbracketover:Gf(`M0 440 h120 V150 H399995 v-120 H0z`),leftmapsto:Gf(`M40 281 V448H0V74H40V241H400000v40z`),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
132
+ -.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
133
+ 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
134
+ 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:Gf(`M0 50 h400000 v40H0z m0 194h40000v40H0z`),midbrace:`M200428 334
135
+ 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
136
+ -53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
137
+ 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
138
+ 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
139
+ 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
140
+ 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
141
+ 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
142
+ -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
143
+ -320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
144
+ 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
145
+ 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
146
+ -451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
147
+ m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
148
+ 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
149
+ -480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
150
+ 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
151
+ 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
152
+ -707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
153
+ m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
154
+ 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
155
+ -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
156
+ 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
157
+ 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
158
+ -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
159
+ -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
160
+ 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
161
+ -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
162
+ 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
163
+ 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
164
+ 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
165
+ -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
166
+ 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
167
+ 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
168
+ -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
169
+ -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
170
+ 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
171
+ -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
172
+ 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
173
+ 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
174
+ 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
175
+ -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
176
+ -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
177
+ 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
178
+ 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
179
+ -64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
180
+ 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
181
+ 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
182
+ -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
183
+ 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:Gf(`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`),rightbracketunder:Gf(`M399995 0 h-120 V290 H0 v120 H400000z`),rightbracketover:Gf(`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
184
+ 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
185
+ -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
186
+ -167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
187
+ 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
188
+ -70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
189
+ -40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
190
+ -37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
191
+ 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
192
+ 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
193
+ 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
194
+ 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
195
+ -19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
196
+ 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
197
+ -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
198
+ 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
199
+ 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
200
+ -68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
201
+ -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
202
+ 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
203
+ 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
204
+ 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
205
+ -11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
206
+ 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
207
+ 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
208
+ -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
209
+ -11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
210
+ 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
211
+ 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
212
+ -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
213
+ 3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
214
+ 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
215
+ -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
216
+ -7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
217
+ H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
218
+ 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
219
+ 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
220
+ -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
221
+ -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
222
+ -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,
223
+ -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,
224
+ -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,
225
+ -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,
226
+ -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
227
+ c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
228
+ 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
229
+ 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
230
+ 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
231
+ 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
232
+ c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
233
+ M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
234
+ -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
235
+ 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
236
+ -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
237
+ -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
238
+ -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
239
+ 151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
240
+ c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
241
+ 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
242
+ c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
243
+ c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
244
+ M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
245
+ 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,
246
+ -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
247
+ 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
248
+ 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
249
+ 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,
250
+ 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,
251
+ -152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
252
+ 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
253
+ 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,
254
+ -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
255
+ 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
256
+ M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},rp=function(e,t){switch(e){case`lbrack`:return`M403 1759 V84 H666 V0 H319 V1759 v`+t+` v1759 h347 v-84
257
+ H403z M403 1759 V0 H319 V1759 v`+t+` v1759 h84z`;case`rbrack`:return`M347 1759 V0 H0 V84 H263 V1759 v`+t+` v1759 H0 v84 H347z
258
+ 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
259
+ c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
260
+ 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
261
+ c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
262
+ c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z
263
+ M367 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
264
+ c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
265
+ 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
266
+ MM319 602 V0 H403 V602 v`+t+` v1715 H319z`;case`rfloor`:return`M319 602 V0 H403 V602 v`+t+` v1799 H0 v-84 H319z
267
+ MM319 602 V0 H403 V602 v`+t+` v1715 H319z`;case`lceil`:return`M403 1759 V84 H666 V0 H319 V1759 v`+t+` v602 h84z
268
+ M403 1759 V0 H319 V1759 v`+t+` v602 h84z`;case`rceil`:return`M347 1759 V0 H0 V84 H263 V1759 v`+t+` v602 h84z
269
+ 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
270
+ 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,
271
+ -36,557 l0,`+(t+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
272
+ 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
273
+ 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,
274
+ -544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
275
+ l0,-`+(t+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
276
+ -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,
277
+ 63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
278
+ c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(t+9)+`
279
+ 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
280
+ 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
281
+ 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
282
+ c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
283
+ l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
284
+ -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.`)}},ip=class{constructor(e){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=>e.toText()).join(``)}},ap={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},op={ex:!0,em:!0,mu:!0},sp=function(e){return typeof e!=`string`&&(e=e.unit),e in ap||e in op||e===`ex`},cp=function(e,t){var n;if(e.unit in ap)n=ap[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`},lp=function(e){return e.filter(e=>e).join(` `)},up=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)}},dp=function(e){var t=document.createElement(e);t.className=lp(this.classes);for(var n of Object.keys(this.style))t.style[n]=this.style[n];for(var r of Object.keys(this.attributes))t.setAttribute(r,this.attributes[r]);for(var i=0;i<this.children.length;i++)t.appendChild(this.children[i].toNode());return t},fp=/[\s"'>/=\x00-\x1f]/,pp=function(e){var t=`<`+e;this.classes.length&&(t+=` class="`+gf(lp(this.classes))+`"`);var n=``;for(var r of Object.keys(this.style))n+=pf(r)+`:`+this.style[r]+`;`;n&&(t+=` style="`+gf(n)+`"`);for(var i of Object.keys(this.attributes)){if(fp.test(i))throw new B(`Invalid attribute name '`+i+`'`);t+=` `+i+`="`+gf(this.attributes[i])+`"`}t+=`>`;for(var a=0;a<this.children.length;a++)t+=this.children[a].toMarkup();return t+=`</`+e+`>`,t},mp=class{constructor(e,t,n,r){up.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return dp.call(this,`span`)}toMarkup(){return pp.call(this,`span`)}},hp=class{constructor(e,t,n,r){up.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 dp.call(this,`a`)}toMarkup(){return pp.call(this,`a`)}},gp=class{constructor(e,t,n){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`);e.src=this.src,e.alt=this.alt,e.className=`mord`;for(var t of Object.keys(this.style))e.style[t]=this.style[t];return e}toMarkup(){var e=`<img src="`+gf(this.src)+`"`+(` alt="`+gf(this.alt)+`"`),t=``;for(var n of Object.keys(this.style))t+=pf(n)+`:`+this.style[n]+`;`;return t&&(e+=` style="`+gf(t)+`"`),e+=`'/>`,e}},_p={î:`ı̂`,ï:`ı̈`,í:`ı́`,ì:`ı̀`},vp=class{constructor(e,t,n,r,i,a,o,s){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=Hf(this.text.charCodeAt(0));c&&this.classes.push(c+`_fallback`),/[îïíì]/.test(this.text)&&(this.text=_p[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;this.italic>0&&(t=document.createElement(`span`),t.style.marginRight=V(this.italic)),this.classes.length>0&&(t||=document.createElement(`span`),t.className=lp(this.classes));for(var n of Object.keys(this.style))t||=document.createElement(`span`),t.style[n]=this.style[n];return t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t=`<span`;this.classes.length&&(e=!0,t+=` class="`,t+=gf(lp(this.classes)),t+=`"`);var n=``;this.italic>0&&(n+=`margin-right:`+V(this.italic)+`;`);for(var r of Object.keys(this.style))n+=pf(r)+`:`+this.style[r]+`;`;n&&(e=!0,t+=` style="`+gf(n)+`"`);var i=gf(this.text);return e?(t+=`>`,t+=i,t+=`</span>`,t):i}},yp=class{constructor(e,t){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+`="`+gf(this.attributes[t])+`"`;e+=`>`;for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+=`</svg>`,e}},bp=class{constructor(e,t){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`,np[this.pathName]),e}toMarkup(){return this.alternate?`<path d="`+gf(this.alternate)+`"/>`:`<path d="`+gf(np[this.pathName])+`"/>`}},xp=class{constructor(e){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+`="`+gf(this.attributes[t])+`"`;return e+=`/>`,e}};function Sp(e){if(e instanceof vp)return e;throw Error(`Expected symbolNode but got `+String(e)+`.`)}function Cp(e){if(e instanceof mp)return e;throw Error(`Expected span<HtmlDomNode> but got `+String(e)+`.`)}var wp=e=>e instanceof mp||e instanceof hp||e instanceof ip,Tp={"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]}},Ep={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]},Dp={Å:`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 Op(e,t){Tp[e]=t}function kp(e,t,n){if(!Tp[t])throw Error(`Font metrics not found for font: `+t+`.`);var r=e.charCodeAt(0),i=Tp[t][r];if(!i&&e[0]in Dp&&(r=Dp[e[0]].charCodeAt(0),i=Tp[t][r]),!i&&n===`text`&&Wf(r)&&(i=Tp[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var Ap={};function jp(e){var t=e>=5?0:e>=3?1:2;if(!Ap[t]){var n=Ap[t]={cssEmPerMu:Ep.quad[t]/18};for(var r in Ep)Ep.hasOwnProperty(r)&&(n[r]=Ep[r][t])}return Ap[t]}var Mp={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Np={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Pp={math:{},text:{}};function H(e,t,n,r,i,a){Pp[e][i]={font:t,group:n,replace:r},a&&r&&(Pp[e][r]=Pp[e][i])}var U=`math`,W=`text`,G=`main`,K=`ams`,Fp=`accent-token`,q=`bin`,Ip=`close`,Lp=`inner`,Rp=`mathord`,zp=`op-token`,Bp=`open`,Vp=`punct`,J=`rel`,Hp=`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,Vp,`.`,`\\ldotp`),H(U,G,Vp,`⋅`,`\\cdotp`),H(U,G,Vp,`⋅`,`·`),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,Ip,`⎱`,`\\rmoustache`,!0),H(U,G,Bp,`⎰`,`\\lmoustache`,!0),H(U,G,Ip,`⟯`,`\\rgroup`,!0),H(U,G,Bp,`⟮`,`\\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,Bp,`┌`,`\\@ulcorner`,!0),H(U,K,Ip,`┐`,`\\@urcorner`,!0),H(U,K,Bp,`└`,`\\@llcorner`,!0),H(U,K,Ip,`┘`,`\\@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,Rp,`α`,`\\alpha`,!0),H(U,G,Rp,`β`,`\\beta`,!0),H(U,G,Rp,`γ`,`\\gamma`,!0),H(U,G,Rp,`δ`,`\\delta`,!0),H(U,G,Rp,`ϵ`,`\\epsilon`,!0),H(U,G,Rp,`ζ`,`\\zeta`,!0),H(U,G,Rp,`η`,`\\eta`,!0),H(U,G,Rp,`θ`,`\\theta`,!0),H(U,G,Rp,`ι`,`\\iota`,!0),H(U,G,Rp,`κ`,`\\kappa`,!0),H(U,G,Rp,`λ`,`\\lambda`,!0),H(U,G,Rp,`μ`,`\\mu`,!0),H(U,G,Rp,`ν`,`\\nu`,!0),H(U,G,Rp,`ξ`,`\\xi`,!0),H(U,G,Rp,`ο`,`\\omicron`,!0),H(U,G,Rp,`π`,`\\pi`,!0),H(U,G,Rp,`ρ`,`\\rho`,!0),H(U,G,Rp,`σ`,`\\sigma`,!0),H(U,G,Rp,`τ`,`\\tau`,!0),H(U,G,Rp,`υ`,`\\upsilon`,!0),H(U,G,Rp,`ϕ`,`\\phi`,!0),H(U,G,Rp,`χ`,`\\chi`,!0),H(U,G,Rp,`ψ`,`\\psi`,!0),H(U,G,Rp,`ω`,`\\omega`,!0),H(U,G,Rp,`ε`,`\\varepsilon`,!0),H(U,G,Rp,`ϑ`,`\\vartheta`,!0),H(U,G,Rp,`ϖ`,`\\varpi`,!0),H(U,G,Rp,`ϱ`,`\\varrho`,!0),H(U,G,Rp,`ς`,`\\varsigma`,!0),H(U,G,Rp,`φ`,`\\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,Bp,`⟨`,`\\langle`,!0),H(U,G,Bp,`∣`,`\\lvert`),H(U,G,Bp,`∥`,`\\lVert`),H(U,G,Ip,`?`,`?`),H(U,G,Ip,`!`,`!`),H(U,G,Ip,`⟩`,`\\rangle`,!0),H(U,G,Ip,`∣`,`\\rvert`),H(U,G,Ip,`∥`,`\\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,Hp,`\xA0`,`\\ `),H(U,G,Hp,`\xA0`,`\\space`),H(U,G,Hp,`\xA0`,`\\nobreakspace`),H(W,G,Hp,`\xA0`,`\\ `),H(W,G,Hp,`\xA0`,` `),H(W,G,Hp,`\xA0`,`\\space`),H(W,G,Hp,`\xA0`,`\\nobreakspace`),H(U,G,Hp,null,`\\nobreak`),H(U,G,Hp,null,`\\allowbreak`),H(U,G,Vp,`,`,`,`),H(U,G,Vp,`;`,`;`),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,Bp,`{`,`\\{`),H(W,G,Y,`{`,`\\{`),H(W,G,Y,`{`,`\\textbraceleft`),H(U,G,Ip,`}`,`\\}`),H(W,G,Y,`}`,`\\}`),H(W,G,Y,`}`,`\\textbraceright`),H(U,G,Bp,`{`,`\\lbrace`),H(U,G,Ip,`}`,`\\rbrace`),H(U,G,Bp,`[`,`\\lbrack`,!0),H(W,G,Y,`[`,`\\lbrack`,!0),H(U,G,Ip,`]`,`\\rbrack`,!0),H(W,G,Y,`]`,`\\rbrack`,!0),H(U,G,Bp,`(`,`\\lparen`,!0),H(U,G,Ip,`)`,`\\rparen`,!0),H(W,G,Y,`<`,`\\textless`,!0),H(W,G,Y,`>`,`\\textgreater`,!0),H(U,G,Bp,`⌊`,`\\lfloor`,!0),H(U,G,Ip,`⌋`,`\\rfloor`,!0),H(U,G,Bp,`⌈`,`\\lceil`,!0),H(U,G,Ip,`⌉`,`\\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,zp,`∐`,`\\coprod`),H(U,G,zp,`⋁`,`\\bigvee`),H(U,G,zp,`⋀`,`\\bigwedge`),H(U,G,zp,`⨄`,`\\biguplus`),H(U,G,zp,`⋂`,`\\bigcap`),H(U,G,zp,`⋃`,`\\bigcup`),H(U,G,zp,`∫`,`\\int`),H(U,G,zp,`∫`,`\\intop`),H(U,G,zp,`∬`,`\\iint`),H(U,G,zp,`∭`,`\\iiint`),H(U,G,zp,`∏`,`\\prod`),H(U,G,zp,`∑`,`\\sum`),H(U,G,zp,`⨂`,`\\bigotimes`),H(U,G,zp,`⨁`,`\\bigoplus`),H(U,G,zp,`⨀`,`\\bigodot`),H(U,G,zp,`∮`,`\\oint`),H(U,G,zp,`∯`,`\\oiint`),H(U,G,zp,`∰`,`\\oiiint`),H(U,G,zp,`⨆`,`\\bigsqcup`),H(U,G,zp,`∫`,`\\smallint`),H(W,G,Lp,`…`,`\\textellipsis`),H(U,G,Lp,`…`,`\\mathellipsis`),H(W,G,Lp,`…`,`\\ldots`,!0),H(U,G,Lp,`…`,`\\ldots`,!0),H(U,G,Lp,`⋯`,`\\@cdots`,!0),H(U,G,Lp,`⋱`,`\\ddots`,!0),H(U,G,Y,`⋮`,`\\varvdots`),H(W,G,Y,`⋮`,`\\varvdots`),H(U,G,Fp,`ˊ`,`\\acute`),H(U,G,Fp,`ˋ`,`\\grave`),H(U,G,Fp,`¨`,`\\ddot`),H(U,G,Fp,`~`,`\\tilde`),H(U,G,Fp,`ˉ`,`\\bar`),H(U,G,Fp,`˘`,`\\breve`),H(U,G,Fp,`ˇ`,`\\check`),H(U,G,Fp,`^`,`\\hat`),H(U,G,Fp,`⃗`,`\\vec`),H(U,G,Fp,`˙`,`\\dot`),H(U,G,Fp,`˚`,`\\mathring`),H(U,G,Rp,``,`\\@imath`),H(U,G,Rp,``,`\\@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,Fp,`ˊ`,`\\'`),H(W,G,Fp,`ˋ`,"\\`"),H(W,G,Fp,`ˆ`,`\\^`),H(W,G,Fp,`˜`,`\\~`),H(W,G,Fp,`ˉ`,`\\=`),H(W,G,Fp,`˘`,`\\u`),H(W,G,Fp,`˙`,`\\.`),H(W,G,Fp,`¸`,`\\c`),H(W,G,Fp,`˚`,`\\r`),H(W,G,Fp,`ˇ`,`\\v`),H(W,G,Fp,`¨`,`\\"`),H(W,G,Fp,`˝`,`\\H`),H(W,G,Fp,`◯`,`\\textcircled`);var Up={"--":!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 Wp=`0123456789/@."`,Gp=0;Gp<Wp.length;Gp++){var Kp=Wp.charAt(Gp);H(U,G,Y,Kp,Kp)}for(var qp=`0123456789!@*()-=+";:?/.,`,Jp=0;Jp<qp.length;Jp++){var Yp=qp.charAt(Jp);H(W,G,Y,Yp,Yp)}for(var Xp=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,Zp=0;Zp<Xp.length;Zp++){var Qp=Xp.charAt(Zp);H(U,G,Rp,Qp,Qp),H(W,G,Y,Qp,Qp)}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,Rp,`h`,`ℎ`),H(W,G,Rp,`h`,`ℎ`);for(var $p=``,em=0;em<Xp.length;em++){var tm=Xp.charAt(em);$p=String.fromCharCode(55349,56320+em),H(U,G,Rp,tm,$p),H(W,G,Y,tm,$p),$p=String.fromCharCode(55349,56372+em),H(U,G,Rp,tm,$p),H(W,G,Y,tm,$p),$p=String.fromCharCode(55349,56424+em),H(U,G,Rp,tm,$p),H(W,G,Y,tm,$p),$p=String.fromCharCode(55349,56580+em),H(U,G,Rp,tm,$p),H(W,G,Y,tm,$p),$p=String.fromCharCode(55349,56684+em),H(U,G,Rp,tm,$p),H(W,G,Y,tm,$p),$p=String.fromCharCode(55349,56736+em),H(U,G,Rp,tm,$p),H(W,G,Y,tm,$p),$p=String.fromCharCode(55349,56788+em),H(U,G,Rp,tm,$p),H(W,G,Y,tm,$p),$p=String.fromCharCode(55349,56840+em),H(U,G,Rp,tm,$p),H(W,G,Y,tm,$p),$p=String.fromCharCode(55349,56944+em),H(U,G,Rp,tm,$p),H(W,G,Y,tm,$p),em<26&&($p=String.fromCharCode(55349,56632+em),H(U,G,Rp,tm,$p),H(W,G,Y,tm,$p),$p=String.fromCharCode(55349,56476+em),H(U,G,Rp,tm,$p),H(W,G,Y,tm,$p))}$p=String.fromCharCode(55349,56668),H(U,G,Rp,`k`,$p),H(W,G,Y,`k`,$p);for(var nm=0;nm<10;nm++){var rm=nm.toString();$p=String.fromCharCode(55349,57294+nm),H(U,G,Rp,rm,$p),H(W,G,Y,rm,$p),$p=String.fromCharCode(55349,57314+nm),H(U,G,Rp,rm,$p),H(W,G,Y,rm,$p),$p=String.fromCharCode(55349,57324+nm),H(U,G,Rp,rm,$p),H(W,G,Y,rm,$p),$p=String.fromCharCode(55349,57334+nm),H(U,G,Rp,rm,$p),H(W,G,Y,rm,$p)}for(var im=`ÐÞþ`,am=0;am<im.length;am++){var om=im.charAt(am);H(U,G,Rp,om,om),H(W,G,Y,om,om)}var sm=[[`mathbf`,`textbf`,`Main-Bold`],[`mathbf`,`textbf`,`Main-Bold`],[`mathnormal`,`textit`,`Math-Italic`],[`mathnormal`,`textit`,`Math-Italic`],[`boldsymbol`,`boldsymbol`,`Main-BoldItalic`],[`boldsymbol`,`boldsymbol`,`Main-BoldItalic`],[`mathscr`,`textscr`,`Script-Regular`],[``,``,``],[``,``,``],[``,``,``],[`mathfrak`,`textfrak`,`Fraktur-Regular`],[`mathfrak`,`textfrak`,`Fraktur-Regular`],[`mathbb`,`textbb`,`AMS-Regular`],[`mathbb`,`textbb`,`AMS-Regular`],[`mathboldfrak`,`textboldfrak`,`Fraktur-Regular`],[`mathboldfrak`,`textboldfrak`,`Fraktur-Regular`],[`mathsf`,`textsf`,`SansSerif-Regular`],[`mathsf`,`textsf`,`SansSerif-Regular`],[`mathboldsf`,`textboldsf`,`SansSerif-Bold`],[`mathboldsf`,`textboldsf`,`SansSerif-Bold`],[`mathitsf`,`textitsf`,`SansSerif-Italic`],[`mathitsf`,`textitsf`,`SansSerif-Italic`],[``,``,``],[``,``,``],[`mathtt`,`texttt`,`Typewriter-Regular`],[`mathtt`,`texttt`,`Typewriter-Regular`]],cm=[[`mathbf`,`textbf`,`Main-Bold`],[``,``,``],[`mathsf`,`textsf`,`SansSerif-Regular`],[`mathboldsf`,`textboldsf`,`SansSerif-Bold`],[`mathtt`,`texttt`,`Typewriter-Regular`]],lm=(e,t)=>{var n=e.charCodeAt(0),r=e.charCodeAt(1),i=(n-55296)*1024+(r-56320)+65536,a=t===`math`?0:1;if(119808<=i&&i<120484){var o=Math.floor((i-119808)/26);return[sm[o][2],sm[o][a]]}else if(120782<=i&&i<=120831){var s=Math.floor((i-120782)/10);return[cm[s][2],cm[s][a]]}else if(i===120485||i===120486)return[sm[0][2],sm[0][a]];else if(120486<i&&i<120782)return[``,``];else throw new B(`Unsupported character: `+e)},um=function(e,t,n){if(Pp[n][e]){var r=Pp[n][e].replace;r&&(e=r)}return{value:e,metrics:kp(e,t,n)}},dm=function(e,t,n,r,i){var a=um(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 vp(e,o.height,o.depth,c,o.skew,o.width,i)}else typeof console<`u`&&console.warn(`No character metrics `+(`for '`+e+`' in style '`+t+`' and mode '`+n+`'`)),s=new vp(e,0,0,0,0,0,i);if(r){s.maxFontSize=r.sizeMultiplier,r.style.isTight()&&s.classes.push(`mtight`);var l=r.getColor();l&&(s.style.color=l)}return s},fm=function(e,t,n,r){return r===void 0&&(r=[]),n.font===`boldsymbol`&&um(e,`Main-Bold`,t).metrics?dm(e,`Main-Bold`,t,n,r.concat([`mathbf`])):e===`\\`||Pp[t][e].font===`main`?dm(e,`Main-Regular`,t,n,r):dm(e,`AMS-Regular`,t,n,r.concat([`amsrm`]))},pm=function(e,t,n,r,i){return i!==`textord`&&um(e,`Math-BoldItalic`,t).metrics?{fontName:`Math-BoldItalic`,fontClass:`boldsymbol`}:{fontName:`Main-Bold`,fontClass:`mathbf`}},mm=function(e,t,n){var r=e.mode,i=e.text,a=[`mord`],o=r===`math`||r===`text`&&t.font,s=o?t.font:t.fontFamily,c=``,l=``;if(i.charCodeAt(0)===55349&&([c,l]=lm(i,r)),c.length>0)return dm(i,c,r,t,a.concat(l));if(s){var u,d;if(s===`boldsymbol`){var f=pm(i,r,t,a,n);u=f.fontName,d=[f.fontClass]}else o?(u=Dm[s].fontName,d=[s]):(u=Em(s,t.fontWeight,t.fontShape),d=[s,t.fontWeight,t.fontShape]);if(um(i,u,r).metrics)return dm(i,u,r,t,a.concat(d));if(Up.hasOwnProperty(i)&&u.slice(0,10)===`Typewriter`){for(var p=[],m=0;m<i.length;m++)p.push(dm(i[m],u,r,t,a.concat(d)));return xm(p)}}if(n===`mathord`)return dm(i,`Math-Italic`,r,t,a.concat([`mathnormal`]));if(n===`textord`){var h=Pp[r][i]&&Pp[r][i].font;if(h===`ams`)return dm(i,Em(`amsrm`,t.fontWeight,t.fontShape),r,t,a.concat(`amsrm`,t.fontWeight,t.fontShape));if(h===`main`||!h)return dm(i,Em(`textrm`,t.fontWeight,t.fontShape),r,t,a.concat(t.fontWeight,t.fontShape));var g=Em(h,t.fontWeight,t.fontShape);return dm(i,g,r,t,a.concat(g,t.fontWeight,t.fontShape))}else throw Error(`unexpected type: `+n+` in makeOrd`)},hm=(e,t)=>{if(lp(e.classes)!==lp(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},gm=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof vp&&r instanceof vp&&hm(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},_m=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 mp(e,t,n,r);return _m(i),i},vm=(e,t,n,r)=>new mp(e,t,n,r),ym=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},bm=function(e,t,n,r){var i=new hp(e,t,n,r);return _m(i),i},xm=function(e){var t=new ip(e);return _m(t),t},Sm=function(e,t){return e instanceof ip?X([],[e],t):e},Cm=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}},wm=function(e,t){for(var{children:n,depth:r}=Cm(e),i=0,a=0;a<n.length;a++){var o=n[a];if(o.type===`elem`){var s=o.elem;i=Math.max(i,s.maxFontSize,s.height)}}i+=2;var c=X([`pstrut`],[]);c.style.height=V(i);for(var l=[],u=r,d=r,f=r,p=0;p<n.length;p++){var m=n[p];if(m.type===`kern`)f+=m.size;else{var h=m.elem,g=m.wrapperClasses||[],_=m.wrapperStyle||{},v=X(g,[c,h],void 0,_);v.style.top=V(-i-f-h.depth),m.marginLeft&&(v.style.marginLeft=m.marginLeft),m.marginRight&&(v.style.marginRight=m.marginRight),l.push(v),f+=h.height+h.depth}u=Math.min(u,f),d=Math.max(d,f)}var y=X([`vlist`],l);y.style.height=V(d);var b;if(u<0){var x=X([`vlist`],[X([],[])]);x.style.height=V(-u),b=[X([`vlist-r`],[y,X([`vlist-s`],[new vp(`​`)])]),X([`vlist-r`],[x])]}else b=[X([`vlist-r`],[y])];var S=X([`vlist-t`],b);return b.length===2&&S.classes.push(`vlist-t2`),S.height=d,S.depth=-u,S},Tm=(e,t)=>{var n=X([`mspace`],[],t),r=cp(e,t);return n.style.marginRight=V(r),n},Em=function(e,t,n){var r=``;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}var i=t===`textbf`&&n===`textit`?`BoldItalic`:t===`textbf`?`Bold`:t===`textit`?`Italic`:`Regular`;return r+`-`+i},Dm={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`}},Om={vec:[`vec`,.471,.714],oiintSize1:[`oiintSize1`,.957,.499],oiintSize2:[`oiintSize2`,1.472,.659],oiiintSize1:[`oiiintSize1`,1.304,.499],oiiintSize2:[`oiiintSize2`,1.98,.659]},km=function(e,t){var[n,r,i]=Om[e],a=vm([`overlay`],[new yp([new bp(n)],{width:V(r),height:V(i),style:`width:`+V(r),viewBox:`0 0 `+1e3*r+` `+1e3*i,preserveAspectRatio:`xMinYMin`})],t);return a.height=i,a.style.height=V(i),a.style.width=V(r),a},Am={number:3,unit:`mu`},jm={number:4,unit:`mu`},Mm={number:5,unit:`mu`},Nm={mord:{mop:Am,mbin:jm,mrel:Mm,minner:Am},mop:{mord:Am,mop:Am,mrel:Mm,minner:Am},mbin:{mord:jm,mop:jm,mopen:jm,minner:jm},mrel:{mord:Mm,mop:Mm,mopen:Mm,minner:Mm},mopen:{},mclose:{mop:Am,mbin:jm,mrel:Mm,minner:Am},mpunct:{mord:Am,mop:Am,mrel:Mm,mopen:Am,mclose:Am,mpunct:Am,minner:Am},minner:{mord:Am,mop:Am,mbin:jm,mrel:Mm,mopen:Am,mpunct:Am,minner:Am}},Pm={mord:{mop:Am},mop:{mord:Am,mop:Am},mbin:{},mrel:{},mopen:{},mclose:{mop:Am},mpunct:{},minner:{mop:Am}},Fm={},Im={},Lm={};function Z(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:o}=e,s={type:t,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath===void 0?!0:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:i},c=0;c<n.length;++c)Fm[n[c]]=s;t&&(a&&(Im[t]=a),o&&(Lm[t]=o))}function Rm(e){var{type:t,htmlBuilder:n,mathmlBuilder:r}=e;Z({type:t,names:[],props:{numArgs:0},handler(){throw Error(`Should never be called.`)},htmlBuilder:n,mathmlBuilder:r})}var zm=function(e){return e.type===`ordgroup`&&e.body.length===1?e.body[0]:e},Bm=function(e){return e.type===`ordgroup`?e.body:[e]},Vm=new Set([`leftmost`,`mbin`,`mopen`,`mrel`,`mop`,`mpunct`]),Hm=new Set([`rightmost`,`mrel`,`mclose`,`mpunct`]),Um={display:Bf.DISPLAY,text:Bf.TEXT,script:Bf.SCRIPT,scriptscript:Bf.SCRIPTSCRIPT},Wm={mord:`mord`,mop:`mop`,mbin:`mbin`,mrel:`mrel`,mopen:`mopen`,mclose:`mclose`,mpunct:`mpunct`,minner:`minner`},Gm=function(e,t,n,r){r===void 0&&(r=[null,null]);for(var i=[],a=0;a<e.length;a++){var o=Zm(e[a],t);if(o instanceof ip){var s=o.children;i.push(...s)}else i.push(o)}if(gm(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(Um[l.style]))}var u=X([r[0]||`leftmost`],[],t),d=X([r[1]||`rightmost`],[],t),f=n===`root`;return Km(i,(e,t)=>{var n=t.classes[0],r=e.classes[0];n===`mbin`&&Hm.has(r)?t.classes[0]=`mord`:r===`mbin`&&Vm.has(n)&&(e.classes[0]=`mord`)},{node:u},d,f),Km(i,(e,t)=>{var n=Ym(t),r=Ym(e),i=n&&r?e.hasClass(`mtight`)?Pm[n]?.[r]:Nm[n]?.[r]:null;if(i)return Tm(i,c)},{node:u},d,f),i},Km=function(e,t,n,r,i){r&&e.push(r);for(var a=0;a<e.length;a++){var o=e[a],s=qm(o);if(s){Km(s.children,t,n,null,i);continue}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(`newline`)&&(n.node=X([`leftmost`])),n.insertAfter=(t=>n=>{e.splice(t+1,0,n),a++})(a)}r&&e.pop()},qm=function(e){return e instanceof ip||e instanceof hp||e instanceof mp&&e.hasClass(`enclosing`)?e:null},Jm=function(e,t){var n=qm(e);if(n){var r=n.children;if(r.length){if(t===`right`)return Jm(r[r.length-1],`right`);if(t===`left`)return Jm(r[0],`left`)}}return e},Ym=function(e,t){return e?(t&&(e=Jm(e,t)),Wm[e.classes[0]]||null):null},Xm=function(e,t){var n=[`nulldelimiter`].concat(e.baseSizingClasses());return X(t.concat(n))},Zm=function(e,t,n){if(!e)return X();if(Im[e.type]){var r=Im[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}else throw new B(`Got group of unknown type: '`+e.type+`'`)};function Qm(e,t){var n=X([`base`],e,t),r=X([`strut`]);return r.style.height=V(n.height+n.depth),n.depth&&(r.style.verticalAlign=V(-n.depth)),n.children.unshift(r),n}function $m(e,t){var n=null;e.length===1&&e[0].type===`tag`&&(n=e[0].tag,e=e[0].body);var r=Gm(e,t,`root`),i;r.length===2&&r[1].hasClass(`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(`newline`);)s++,o.push(r[s]),r[s].hasClass(`nobreak`)&&(c=!0);c||(a.push(Qm(o,t)),o=[])}else r[s].hasClass(`newline`)&&(o.pop(),o.length>0&&(a.push(Qm(o,t)),o=[]),a.push(r[s]));o.length>0&&a.push(Qm(o,t));var l;n?(l=Qm(Gm(n,t,!0),t),l.classes=[`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 eh(e){return new ip(e)}var Q=class{constructor(e,t,n){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 in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=lp(this.classes));for(var n=0;n<this.children.length;n++)if(this.children[n]instanceof th&&this.children[n+1]instanceof th){for(var r=this.children[n].toText()+this.children[++n].toText();this.children[n+1]instanceof th;)r+=this.children[++n].toText();e.appendChild(new th(r).toNode())}else e.appendChild(this.children[n].toNode());return e}toMarkup(){var e=`<`+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=` `+t+`="`,e+=gf(this.attributes[t]),e+=`"`);this.classes.length>0&&(e+=` class ="`+gf(lp(this.classes))+`"`),e+=`>`;for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+=`</`+this.type+`>`,e}toText(){return this.children.map(e=>e.toText()).join(``)}},th=class{constructor(e){this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return gf(this.toText())}toText(){return this.text}},nh=class{constructor(e){this.width=e,e>=.05555&&e<=.05556?this.character=` `:e>=.1666&&e<=.1667?this.character=` `:e>=.2222&&e<=.2223?this.character=` `:e>=.2777&&e<=.2778?this.character=`  `:e>=-.05556&&e<=-.05555?this.character=` ⁣`:e>=-.1667&&e<=-.1666?this.character=` ⁣`:e>=-.2223&&e<=-.2222?this.character=` ⁣`:e>=-.2778&&e<=-.2777?this.character=` ⁣`:this.character=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:` `}},rh=new Set([`\\imath`,`\\jmath`]),ih=new Set([`mrow`,`mtable`]),ah=function(e,t,n){return Pp[t][e]&&Pp[t][e].replace&&e.charCodeAt(0)!==55349&&!(Up.hasOwnProperty(e)&&n&&(n.fontFamily&&n.fontFamily.slice(4,6)===`tt`||n.font&&n.font.slice(4,6)===`tt`))&&(e=Pp[t][e].replace),new th(e)},oh=function(e){return e.length===1?e[0]:new Q(`mrow`,e)},sh=function(e,t){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;if(n===`mathit`)return`italic`;if(n===`boldsymbol`)return e.type===`textord`?`bold`:`bold-italic`;if(n===`mathbf`)return`bold`;if(n===`mathbb`)return`double-struck`;if(n===`mathsfit`)return`sans-serif-italic`;if(n===`mathfrak`)return`fraktur`;if(n===`mathscr`||n===`mathcal`)return`script`;if(n===`mathsf`)return`sans-serif`;if(n===`mathtt`)return`monospace`;var i=e.text;if(rh.has(i))return null;if(Pp[r][i]){var a=Pp[r][i].replace;a&&(i=a)}var o=Dm[n].fontName;return kp(i,o,r)?Dm[n].variant:null};function ch(e){if(!e)return!1;if(e.type===`mi`&&e.children.length===1){var t=e.children[0];return t instanceof th&&t.text===`.`}else 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 th&&n.text===`,`}else return!1}var lh=function(e,t,n){if(e.length===1){var r=dh(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=dh(e[o],t);if(s instanceof Q&&a instanceof Q){if(s.type===`mtext`&&a.type===`mtext`&&s.getAttribute(`mathvariant`)===a.getAttribute(`mathvariant`)){a.children.push(...s.children);continue}else if(s.type===`mn`&&a.type===`mn`){a.children.push(...s.children);continue}else if(ch(s)&&a.type===`mn`){a.children.push(...s.children);continue}else if(s.type===`mn`&&ch(a))s.children=[...a.children,...s.children],i.pop();else if((s.type===`msup`||s.type===`msub`)&&s.children.length>=1&&(a.type===`mn`||ch(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 th&&l.text===`̸`&&(s.type===`mo`||s.type===`mi`||s.type===`mn`)){var u=s.children[0];u instanceof th&&u.text.length>0&&(u.text=u.text.slice(0,1)+`̸`+u.text.slice(1),i.pop())}}}i.push(s),a=s}return i},uh=function(e,t,n){return oh(lh(e,t,n))},dh=function(e,t){if(!e)return new Q(`mrow`);if(Lm[e.type])return Lm[e.type](e,t);throw new B(`Got group of unknown type: '`+e.type+`'`)};function fh(e,t,n,r,i){var a=lh(e,n),o=a.length===1&&a[0]instanceof Q&&ih.has(a[0].type)?a[0]:new Q(`mrow`,a),s=new Q(`annotation`,[new th(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 ph=[[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]],mh=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],hh=function(e,t){return t.size<2?e:ph[e-1][t.size-1]},gh=class e{constructor(t){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=mh[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,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};return Object.assign(n,t),new e(n)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:hh(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:mh[e-1]})}havingBaseStyle(t){t||=this.style.text();var n=hh(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?[]:[`sizing`,`reset-size`+e.size,`size`+this.size]}baseSizingClasses(){return this.size===e.BASESIZE?[]:[`sizing`,`reset-size`+this.size,`size`+e.BASESIZE]}fontMetrics(){return this._fontMetrics||=jp(this.size),this._fontMetrics}getColor(){return this.phantom?`transparent`:this.color}};gh.BASESIZE=6;var _h=function(e){return new gh({style:e.displayMode?Bf.DISPLAY:Bf.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},vh=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},yh=function(e,t,n){var r=_h(n),i;return n.output===`mathml`?fh(e,t,r,n.displayMode,!0):(i=n.output===`html`?X([`katex`],[$m(e,r)]):X([`katex`],[fh(e,t,r,n.displayMode,!1),$m(e,r)]),vh(i,n))},bh=function(e,t,n){return vh(X([`katex`],[$m(e,_h(n))]),n)},xh={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":`=`},Sh=function(e){var t=new Q(`mo`,[new th(xh[e.replace(/^\\/,``)])]);return t.setAttribute(`stretchy`,`true`),t},Ch={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]},wh=new Set([`widehat`,`widecheck`,`widetilde`,`utilde`]),Th=function(e,t){function n(){var n=4e5,r=e.label.slice(1);if(wh.has(r)){var i=e,a=i.base.type===`ordgroup`?i.base.body.length:1,o,s,c;if(a>5)r===`widehat`||r===`widecheck`?(o=420,n=2364,c=.42,s=r+`4`):(o=312,n=2340,c=.34,s=`tilde4`);else{var l=[1,1,2,2,3,3][a];r===`widehat`||r===`widecheck`?(n=[0,1062,2364,2364,2364][l],o=[0,239,300,360,420][l],c=[0,.24,.3,.3,.36,.42][l],s=r+l):(n=[0,600,1033,2339,2340][l],o=[0,260,286,306,312][l],c=[0,.26,.286,.3,.306,.34][l],s=`tilde`+l)}return{span:vm([],[new yp([new bp(s)],{width:`100%`,height:V(c),viewBox:`0 0 `+n+` `+o,preserveAspectRatio:`none`})],t),minWidth:0,height:c}}else{var u=[],d=Ch[r],[f,p,m]=d,h=m/1e3,g=f.length,_,v;if(g===1){var y=d[3];_=[`hide-tail`],v=[y]}else if(g===2)_=[`halfarrow-left`,`halfarrow-right`],v=[`xMinYMin`,`xMaxYMin`];else if(g===3)_=[`brace-left`,`brace-center`,`brace-right`],v=[`xMinYMin`,`xMidYMin`,`xMaxYMin`];else throw Error(`Correct katexImagesData or update code here to support
285
+ `+g+` children.`);for(var b=0;b<g;b++){var x=new yp([new bp(f[b])],{width:`400em`,height:V(h),viewBox:`0 0 `+n+` `+m,preserveAspectRatio:v[b]+` slice`}),S=vm([_[b]],[x],t);if(g===1)return{span:S,minWidth:p,height:h};S.style.height=V(h),u.push(S)}return{span:X([`stretchy`],u,t),minWidth:p,height:h}}}var{span:r,minWidth:i,height:a}=n();return r.height=a,r.style.height=V(a),i>0&&(r.style.minWidth=V(i)),r},Eh=function(e,t,n,r,i){var a,o=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(a=X([`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 xp({x1:`0`,y1:`0`,x2:`100%`,y2:`100%`,"stroke-width":`0.046em`})),/^x?cancel$/.test(t)&&c.push(new xp({x1:`0`,y1:`100%`,x2:`100%`,y2:`0`,"stroke-width":`0.046em`})),a=vm([],[new yp(c,{width:`100%`,height:V(o)})],i)}return a.height=o,a.style.height=V(o),a};function Dh(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 Oh(e){var t=kh(e);if(!t)throw Error(`Expected node of symbol group type, but got `+(e?`node of type `+e.type:String(e)));return t}function kh(e){return e&&(e.type===`atom`||Np.hasOwnProperty(e.type))?e:null}var Ah=e=>{if(e instanceof vp)return e;if(wp(e)&&e.children.length===1)return Ah(e.children[0])},jh=(e,t)=>{var n,r,i;e&&e.type===`supsub`?(r=Dh(e.base,`accent`),n=r.base,e.base=n,i=Cp(Zm(e,t)),e.base=r):(r=Dh(e,`accent`),n=r.base);var a=Zm(n,t.havingCrampedStyle()),o=r.isShifty&&yf(n),s=0;o&&(s=Ah(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=Th(r,t),u=wm({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=km(`vec`,t),f=Om.vec[1]):(d=mm({type:`textord`,mode:r.mode,text:r.label},t,`textord`),d=Sp(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=wm({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:-l},{type:`elem`,elem:u}]})}var h=X([`mord`,`accent`],[u],t);return i?(i.children[0]=h,i.height=Math.max(h.height,i.height),i.classes[0]=`mord`,i):h},Mh=(e,t)=>{var n=e.isStretchy?Sh(e.label):new Q(`mo`,[ah(e.label,e.mode)]),r=new Q(`mover`,[dh(e.base,t),n]);return r.setAttribute(`accent`,`true`),r},Nh=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`],props:{numArgs:1},handler:(e,t)=>{var n=zm(t[0]),r=!Nh.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:jh,mathmlBuilder:Mh}),Z({type:`accent`,names:[`\\'`,"\\`",`\\^`,`\\~`,`\\=`,`\\u`,`\\.`,`\\"`,`\\c`,`\\r`,`\\H`,`\\v`,`\\textcircled`],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`primitive`]},handler:(e,t)=>{var n=t[0],r=e.parser.mode;return r===`math`&&(e.parser.settings.reportNonstrict(`mathVsTextAccents`,`LaTeX's accent `+e.funcName+` works only in text mode`),r=`text`),{type:`accent`,mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:jh,mathmlBuilder:Mh}),Z({type:`accentUnder`,names:[`\\underleftarrow`,`\\underrightarrow`,`\\underleftrightarrow`,`\\undergroup`,`\\underlinesegment`,`\\utilde`],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:`accentUnder`,mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=Zm(e.base,t),r=Th(e,t),i=e.label===`\\utilde`?.12:0;return X([`mord`,`accentunder`],[wm({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=Sh(e.label),r=new Q(`munder`,[dh(e.base,t),n]);return r.setAttribute(`accentunder`,`true`),r}});var Ph=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`],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r,funcName:i}=e;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=Sm(Zm(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=Sm(Zm(e.below,r,t),t),o.classes.push(a+`-arrow-pad`));var s=Th(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=wm({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c},{type:`elem`,elem:o,shift:d}]})}else u=wm({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c}]});return u.children[0].children[0].children[1].classes.push(`svg-align`),X([`mrel`,`x-arrow`],[u],t)},mathmlBuilder(e,t){var n=Sh(e.label);n.setAttribute(`minsize`,e.label.charAt(0)===`x`?`1.75em`:`3.0em`);var r;if(e.body){var i=Ph(dh(e.body,t));r=e.below?new Q(`munderover`,[n,Ph(dh(e.below,t)),i]):new Q(`mover`,[n,i])}else e.below?r=new Q(`munder`,[n,Ph(dh(e.below,t))]):(r=Ph(),r=new Q(`mover`,[n,r]));return r}});function Fh(e,t){var n=Gm(e.body,t,!0);return X([e.mclass],n,t)}function Ih(e,t){var n,r=lh(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`):e.mclass===`minner`&&(n.attributes.lspace=`0.0556em`,n.attributes.width=`+0.1111em`)),n}Z({type:`mclass`,names:[`\\mathord`,`\\mathbin`,`\\mathrel`,`\\mathopen`,`\\mathclose`,`\\mathpunct`,`\\mathinner`],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:`mclass`,mode:n.mode,mclass:`m`+r.slice(5),body:Bm(i),isCharacterBox:yf(i)}},htmlBuilder:Fh,mathmlBuilder:Ih});var Lh=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`],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:`mclass`,mode:n.mode,mclass:Lh(t[0]),body:Bm(t[1]),isCharacterBox:yf(t[1])}}}),Z({type:`mclass`,names:[`\\stackrel`,`\\overset`,`\\underset`],props:{numArgs:2},handler(e,t){var{parser:n,funcName:r}=e,i=t[1],a=t[0],o=r===`\\stackrel`?`mrel`:Lh(i),s={type:`op`,mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!==`\\stackrel`,body:Bm(i)},c={type:`supsub`,mode:a.mode,base:s,sup:r===`\\underset`?null:a,sub:r===`\\underset`?a:null};return{type:`mclass`,mode:n.mode,mclass:o,body:[c],isCharacterBox:yf(c)}},htmlBuilder:Fh,mathmlBuilder:Ih}),Z({type:`pmb`,names:[`\\pmb`],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:`pmb`,mode:n.mode,mclass:Lh(t[0]),body:Bm(t[0])}},htmlBuilder(e,t){var n=Gm(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`,lh(e.body,t));return n.setAttribute(`style`,`text-shadow: 0.02em 0.01em 0.04px`),n}});var Rh={">":`\\\\cdrightarrow`,"<":`\\\\cdleftarrow`,"=":`\\\\cdlongequal`,A:`\\uparrow`,V:`\\downarrow`,"|":`\\Vert`,".":`no arrow`},zh=()=>({type:`styling`,body:[],mode:`math`,style:`display`}),Bh=e=>e.type===`textord`&&e.text===`@`,Vh=(e,t)=>(e.type===`mathord`||e.type===`atom`)&&e.text===t;function Hh(e,t,n){var r=Rh[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 Uh(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=zh(),c=0;c<o.length;c++)if(!Bh(o[c]))s.body.push(o[c]);else{r.push(s),c+=1;var l=Oh(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(Vh(o[p],l)){f=!1,c=p;break}if(Bh(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:[Hh(l,u,e)],mode:`math`,style:`display`};r.push(m),s=zh()}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`],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:`cdlabel`,mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=Sm(Zm(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`,[dh(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`],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:`cdlabelparent`,mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=Sm(Zm(e.fragment,t),t);return n.classes.push(`cd-vert-arrow`),n},mathmlBuilder(e,t){return new Q(`mrow`,[dh(e.fragment,t)])}}),Z({type:`textord`,names:[`\\@char`],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=Dh(t[0],`ordgroup`).body,i=``,a=0;a<r.length;a++){var o=Dh(r[a],`textord`);i+=o.text}var s=parseInt(i),c;if(isNaN(s))throw new B(`\\@char has non-numeric argument `+i);if(s<0||s>=1114111)throw new B(`\\@char with invalid code point `+i);return s<=65535?c=String.fromCharCode(s):(s-=65536,c=String.fromCharCode((s>>10)+55296,(s&1023)+56320)),{type:`textord`,mode:n.mode,text:c}}});var Wh=(e,t)=>xm(Gm(e.body,t.withColor(e.color),!1)),Gh=(e,t)=>{var n=new Q(`mstyle`,lh(e.body,t.withColor(e.color)));return n.setAttribute(`mathcolor`,e.color),n};Z({type:`color`,names:[`\\textcolor`],props:{numArgs:2,allowedInText:!0,argTypes:[`color`,`original`]},handler(e,t){var{parser:n}=e,r=Dh(t[0],`color-token`).color,i=t[1];return{type:`color`,mode:n.mode,color:r,body:Bm(i)}},htmlBuilder:Wh,mathmlBuilder:Gh}),Z({type:`color`,names:[`\\color`],props:{numArgs:1,allowedInText:!0,argTypes:[`color`]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,i=Dh(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}},htmlBuilder:Wh,mathmlBuilder:Gh}),Z({type:`cr`,names:[`\\\\`],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:r}=e,i=r.gullet.future().text===`[`?r.parseSizeGroup(!0):null,a=!r.settings.displayMode||!r.settings.useStrictBehavior(`newLineInDisplayMode`,`In LaTeX, \\\\ or \\newline does nothing in display mode`);return{type:`cr`,mode:r.mode,newLine:a,size:i&&Dh(i,`size`).value}},htmlBuilder(e,t){var n=X([`mspace`],[],t);return e.newLine&&(n.classes.push(`newline`),e.size&&(n.style.marginTop=V(cp(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(cp(e.size,t)))),n}});var Kh={"\\global":`\\global`,"\\long":`\\\\globallong`,"\\\\globallong":`\\\\globallong`,"\\def":`\\gdef`,"\\gdef":`\\gdef`,"\\edef":`\\xdef`,"\\xdef":`\\xdef`,"\\let":`\\\\globallet`,"\\futurelet":`\\\\globalfuture`},qh=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new B(`Expected a control sequence`,e);return t},Jh=e=>{var t=e.gullet.popToken();return t.text===`=`&&(t=e.gullet.popToken(),t.text===` `&&(t=e.gullet.popToken())),t},Yh=(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`],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(Kh[r.text])return(n===`\\global`||n===`\\\\globallong`)&&(r.text=Kh[r.text]),Dh(t.parseFunction(),`internal`);throw new B(`Invalid token after macro prefix`,r)}}),Z({type:`internal`,names:[`\\def`,`\\gdef`,`\\edef`,`\\xdef`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,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{tokens:c}=t.gullet.consumeArg();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===Kh[n]),{type:`internal`,mode:t.mode}}}),Z({type:`internal`,names:[`\\let`,`\\\\globallet`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=qh(t.gullet.popToken());return t.gullet.consumeSpaces(),Yh(t,r,Jh(t),n===`\\\\globallet`),{type:`internal`,mode:t.mode}}}),Z({type:`internal`,names:[`\\futurelet`,`\\\\globalfuture`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=qh(t.gullet.popToken()),i=t.gullet.popToken(),a=t.gullet.popToken();return Yh(t,r,a,n===`\\\\globalfuture`),t.gullet.pushToken(a),t.gullet.pushToken(i),{type:`internal`,mode:t.mode}}});var Xh=function(e,t,n){var r=kp(Pp.math[e]&&Pp.math[e].replace||e,t,n);if(!r)throw Error(`Unsupported symbol `+e+` and font size `+t+`.`);return r},Zh=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},Qh=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},$h=function(e,t,n,r,i,a){var o=Zh(dm(e,`Main-Regular`,i,r),t,r,a);return n&&Qh(o,r,t),o},eg=function(e,t,n,r){return dm(e,`Size`+t+`-Regular`,n,r)},tg=function(e,t,n,r,i,a){var o=eg(e,t,i,r),s=Zh(X([`delimsizing`,`size`+t],[o],r),Bf.TEXT,r,a);return n&&Qh(s,r,Bf.TEXT),s},ng=function(e,t,n){return{type:`elem`,elem:X([`delimsizinginner`,t===`Size1-Regular`?`delim-size1`:`delim-size4`],[X([],[dm(e,t,n)])])}},rg=function(e,t,n){var r=Tp[`Size4-Regular`][e.charCodeAt(0)]?Tp[`Size4-Regular`][e.charCodeAt(0)][4]:Tp[`Size1-Regular`][e.charCodeAt(0)][4],i=vm([],[new yp([new bp(`inner`,tp(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}},ig=.008,ag={type:`kern`,size:-1*ig},og=new Set([`|`,`\\lvert`,`\\rvert`,`\\vert`]),sg=new Set([`\\|`,`\\lVert`,`\\rVert`,`\\Vert`]),cg=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`):og.has(e)?(c=`∣`,u=`vert`,d=333):sg.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=Xh(o,f,i),m=p.height+p.depth,h=Xh(c,f,i),g=h.height+h.depth,_=Xh(l,f,i),v=_.height+_.depth,y=0,b=1;if(s!==null){var x=Xh(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,E=[];if(u.length>0){var D=C-m-v,O=Math.round(C*1e3),ee=rp(u,Math.round(D*1e3)),te=new bp(u,ee),ne=V(d/1e3),re=V(O/1e3),k=vm([],[new yp([te],{width:ne,height:re,viewBox:`0 0 `+d+` `+O})],r);k.height=O/1e3,k.style.width=ne,k.style.height=re,E.push({type:`elem`,elem:k})}else{if(E.push(ng(l,f,i)),E.push(ag),s===null){var ie=C-m-v+2*ig;E.push(rg(c,ie,r))}else{var ae=(C-m-v-y)/2+2*ig;E.push(rg(c,ae,r)),E.push(ag),E.push(ng(s,f,i)),E.push(ag),E.push(rg(c,ae,r))}E.push(ag),E.push(ng(o,f,i))}var A=r.havingBaseStyle(Bf.TEXT);return Zh(X([`delimsizing`,`mult`],[wm({positionType:`bottom`,positionData:T,children:E})],A),Bf.TEXT,r,a)},lg=80,ug=.08,dg=function(e,t,n,r,i){return vm([`hide-tail`],[new yp([new bp(e,ep(e,r,n))],{width:`400em`,height:V(t),viewBox:`0 0 400000 `+n,preserveAspectRatio:`xMinYMin slice`})],i)},fg=function(e,t){var n=t.havingBaseSizing(),r=Sg(`\\surd`,e*n.sizeMultiplier,bg,n),i=n.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,s=0,c=0,l=0,u;return r.type===`small`?(l=1e3+1e3*a+lg,e<1?i=1:e<1.4&&(i=.7),s=(1+a+ug)/i,c=(1+a)/i,o=dg(`sqrtMain`,s,l,a,t),o.style.minWidth=`0.853em`,u=.833/i):r.type===`large`?(l=(1e3+lg)*gg[r.size],c=(gg[r.size]+a)/i,s=(gg[r.size]+a+ug)/i,o=dg(`sqrtSize`+r.size,s,l,a,t),o.style.minWidth=`1.02em`,u=1/i):(s=e+a+ug,c=e+a,l=Math.floor(1e3*e+a)+lg,o=dg(`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}},pg=new Set([`(`,`\\lparen`,`)`,`\\rparen`,`[`,`\\lbrack`,`]`,`\\rbrack`,`\\{`,`\\lbrace`,`\\}`,`\\rbrace`,`\\lfloor`,`\\rfloor`,`⌊`,`⌋`,`\\lceil`,`\\rceil`,`⌈`,`⌉`,`\\surd`]),mg=new Set([`\\uparrow`,`\\downarrow`,`\\updownarrow`,`\\Uparrow`,`\\Downarrow`,`\\Updownarrow`,`|`,`\\|`,`\\vert`,`\\Vert`,`\\lvert`,`\\rvert`,`\\lVert`,`\\rVert`,`\\lgroup`,`\\rgroup`,`⟮`,`⟯`,`\\lmoustache`,`\\rmoustache`,`⎰`,`⎱`]),hg=new Set([`<`,`>`,`\\langle`,`\\rangle`,`/`,`\\backslash`,`\\lt`,`\\gt`]),gg=[0,1.2,1.8,2.4,3],_g=function(e,t,n,r,i){if(e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`),pg.has(e)||hg.has(e))return tg(e,t,!1,n,r,i);if(mg.has(e))return cg(e,gg[t],!1,n,r,i);throw new B(`Illegal delimiter: '`+e+`'`)},vg=[{type:`small`,style:Bf.SCRIPTSCRIPT},{type:`small`,style:Bf.SCRIPT},{type:`small`,style:Bf.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4}],yg=[{type:`small`,style:Bf.SCRIPTSCRIPT},{type:`small`,style:Bf.SCRIPT},{type:`small`,style:Bf.TEXT},{type:`stack`}],bg=[{type:`small`,style:Bf.SCRIPTSCRIPT},{type:`small`,style:Bf.SCRIPT},{type:`small`,style:Bf.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4},{type:`stack`}],xg=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.`)},Sg=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=Xh(e,xg(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]},Cg=function(e,t,n,r,i,a){e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`);var o=hg.has(e)?vg:pg.has(e)?bg:yg,s=Sg(e,t,o,r);return s.type===`small`?$h(e,s.style,n,r,i,a):s.type===`large`?tg(e,s.size,n,r,i,a):cg(e,t,n,r,i,a)},wg=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 Cg(e,Math.max(l/500*s,2*l-c),!0,r,i,a)},Tg={"\\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}},Eg=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 Dg(e,t){var n=kh(e);if(n&&Eg.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`],props:{numArgs:1,argTypes:[`primitive`]},handler:(e,t)=>{var n=Dg(t[0],e);return{type:`delimsizing`,mode:e.parser.mode,size:Tg[e.funcName].size,mclass:Tg[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim===`.`?X([e.mclass]):_g(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!==`.`&&t.push(ah(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(gg[e.size]);return n.setAttribute(`minsize`,r),n.setAttribute(`maxsize`,r),n}});function Og(e){if(!e.body)throw Error(`Bug: The leftright ParseNode wasn't fully parsed.`)}Z({type:`leftright-right`,names:[`\\right`],props:{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`],props:{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=Dh(r.parseFunction(),`leftright-right`);return{type:`leftright`,mode:r.mode,body:i,left:n.text,right:a.delim,rightColor:a.color}},htmlBuilder:(e,t)=>{Og(e);for(var n=Gm(e.body,t,!0,[`mopen`,`mclose`]),r=0,i=0,a=!1,o=0;o<n.length;o++)n[o].isMiddle?a=!0:(r=Math.max(n[o].height,r),i=Math.max(n[o].depth,i));r*=t.sizeMultiplier,i*=t.sizeMultiplier;var s=e.left===`.`?Xm(t,[`mopen`]):wg(e.left,r,i,t,e.mode,[`mopen`]);if(n.unshift(s),a)for(var c=1;c<n.length;c++){var l=n[c].isMiddle;l&&(n[c]=wg(l.delim,r,i,l.options,e.mode,[]))}var u;if(e.right===`.`)u=Xm(t,[`mclose`]);else{var d=e.rightColor?t.withColor(e.rightColor):t;u=wg(e.right,r,i,d,e.mode,[`mclose`])}return n.push(u),X([`minner`],n,t)},mathmlBuilder:(e,t)=>{Og(e);var n=lh(e.body,t);if(e.left!==`.`){var r=new Q(`mo`,[ah(e.left,e.mode)]);r.setAttribute(`fence`,`true`),n.unshift(r)}if(e.right!==`.`){var i=new Q(`mo`,[ah(e.right,e.mode)]);i.setAttribute(`fence`,`true`),e.rightColor&&i.setAttribute(`mathcolor`,e.rightColor),n.push(i)}return oh(n)}}),Z({type:`middle`,names:[`\\middle`],props:{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;if(e.delim===`.`)n=Xm(t,[]);else{n=_g(e.delim,1,t,e.mode,[]);var r={delim:e.delim,options:t};n.isMiddle=r}return n},mathmlBuilder:(e,t)=>{var n=new Q(`mo`,[e.delim===`\\vert`||e.delim===`|`?ah(`|`,`text`):ah(e.delim,e.mode)]);return n.setAttribute(`fence`,`true`),n.setAttribute(`lspace`,`0.05em`),n.setAttribute(`rspace`,`0.05em`),n}});var kg=(e,t)=>{var n=Sm(Zm(e.body,t),t),r=e.label.slice(1),i=t.sizeMultiplier,a,o=0,s=yf(e.body);if(r===`sout`)a=X([`stretchy`,`sout`]),a.height=t.fontMetrics().defaultRuleThickness/i,o=-.5*t.fontMetrics().xHeight;else if(r===`phase`){var c=cp({number:.6,unit:`pt`},t),l=cp({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=vm([`hide-tail`],[new yp([new bp(`phase`,Qf(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=0,m=0,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=Eh(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=wm({positionType:`individualShift`,children:[{type:`elem`,elem:a,shift:o},{type:`elem`,elem:n,shift:0}]});else{var _=/cancel|phase/.test(r)?[`svg-align`]:[];g=wm({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)},Ag=(e,t)=>{var n=0,r=new Q(e.label.includes(`colorbox`)?`mpadded`:`menclose`,[dh(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`);break}return e.backgroundColor&&r.setAttribute(`mathbackground`,e.backgroundColor),r};Z({type:`enclose`,names:[`\\colorbox`],props:{numArgs:2,allowedInText:!0,argTypes:[`color`,`text`]},handler(e,t,n){var{parser:r,funcName:i}=e,a=Dh(t[0],`color-token`).color,o=t[1];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:a,body:o}},htmlBuilder:kg,mathmlBuilder:Ag}),Z({type:`enclose`,names:[`\\fcolorbox`],props:{numArgs:3,allowedInText:!0,argTypes:[`color`,`color`,`text`]},handler(e,t,n){var{parser:r,funcName:i}=e,a=Dh(t[0],`color-token`).color,o=Dh(t[1],`color-token`).color,s=t[2];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:o,borderColor:a,body:s}},htmlBuilder:kg,mathmlBuilder:Ag}),Z({type:`enclose`,names:[`\\fbox`],props:{numArgs:1,argTypes:[`hbox`],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:`enclose`,mode:n.mode,label:`\\fbox`,body:t[0]}}}),Z({type:`enclose`,names:[`\\cancel`,`\\bcancel`,`\\xcancel`,`\\phase`],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}},htmlBuilder:kg,mathmlBuilder:Ag}),Z({type:`enclose`,names:[`\\sout`],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e;n.mode===`math`&&n.settings.reportNonstrict(`mathVsSout`,`LaTeX's \\sout works only in text mode`);var i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}},htmlBuilder:kg,mathmlBuilder:Ag}),Z({type:`enclose`,names:[`\\angl`],props:{numArgs:1,argTypes:[`hbox`],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:`enclose`,mode:n.mode,label:`\\angl`,body:t[0]}}});var jg={};function Mg(e){for(var{type:t,names:n,props:r,handler:i,htmlBuilder:a,mathmlBuilder:o}=e,s={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},c=0;c<n.length;++c)jg[n[c]]=s;a&&(Im[t]=a),o&&(Lm[t]=o)}var Ng={};function $(e,t){Ng[e]=t}var Pg=class e{constructor(e,t,n){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}},Fg=class e{constructor(e,t){this.text=e,this.loc=t}range(t,n){return new e(n,Pg.range(this,t))}};function Ig(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 Lg=e=>{if(!e.parser.settings.displayMode)throw new B(`{`+e.envName+`} can be used only in display mode.`)},Rg=new Set([`gather`,`gather*`]);function zg(e){if(!e.includes(`ed`))return!e.includes(`*`)}function Bg(e,t,n){var{hskipBeforeAndAfter:r,addJot:i,cols:a,arraystretch:o,colSeparationType:s,autoTag:c,singleRow:l,emptySingleRow:u,maxNumCols:d,leqno:f}=t;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 Fg(`\\df@tag`)])),e.gullet.macros.set(`\\df@tag`,void 0,!0)):v.push(!!c&&e.gullet.macros.get(`\\@eqnsw`)===`1`))}for(y(),_.push(Ig(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,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);e.settings.reportNonstrict(`textEnv`,`Too few columns specified in the {array} column argument.`)}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)&&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(Ig(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 Vg(e){return e.slice(0,1)===`d`?`display`:`text`}var Hg=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(Bf.SCRIPT).sizeMultiplier/t.sizeMultiplier));var f=e.colSeparationType===`CD`?cp({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=Array(y.length);for(r=0;r<y.length;++r){var C=Zm(y[r],t);x<C.depth&&(x=C.depth),b<C.height&&(b=C.height),S[r]=C}var w=e.rowGaps[n],T=0;w&&(T=cp(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 E=_/2+t.fontMetrics().axisHeight,D=e.cols||[],O=[],ee,te,ne=[];if(e.tags&&e.tags.some(e=>e))for(n=0;n<i;++n){var re=s[n],k=re.pos-E,ie=e.tags[n],ae=void 0;ae=ie===!0?X([`eqn-num`],[],t):ie===!1?X([],[],t):X([],Gm(ie,t,!0),t),ae.depth=re.depth,ae.height=re.height,ne.push({type:`elem`,elem:ae,shift:k})}for(r=0,te=0;r<o||te<D.length;++r,++te){for(var A=D[te],oe=!0;(j=A)?.type===`separator`;){var j;if(oe||(ee=X([`arraycolsep`],[]),ee.style.width=V(t.fontMetrics().doubleRuleSep),O.push(ee)),A.separator===`|`||A.separator===`:`){var se=A.separator===`|`?`solid`:`dashed`,ce=X([`vertical-separator`],[],t);ce.style.height=V(_),ce.style.borderRightWidth=V(l),ce.style.borderRightStyle=se,ce.style.margin=`0 `+V(-l/2);var le=_-E;le&&(ce.style.verticalAlign=V(-le)),O.push(ce)}else throw new B(`Invalid separator type: `+A.separator);te++,A=D[te],oe=!1}if(!(r>=o)){var ue=void 0;(r>0||e.hskipBeforeAndAfter)&&(ue=A?.pregap??d,ue!==0&&(ee=X([`arraycolsep`],[]),ee.style.width=V(ue),O.push(ee)));var de=[];for(n=0;n<i;++n){var fe=s[n],pe=fe[r];if(pe){var me=fe.pos-E;pe.depth=fe.depth,pe.height=fe.height,de.push({type:`elem`,elem:pe,shift:me})}}var he=wm({positionType:`individualShift`,children:de}),ge=X([`col-align-`+(A?.align||`c`)],[he]);O.push(ge),(r<o-1||e.hskipBeforeAndAfter)&&(ue=A?.postgap??d,ue!==0&&(ee=X([`arraycolsep`],[]),ee.style.width=V(ue),O.push(ee)))}}var _e=X([`mtable`],O);if(c.length>0){for(var ve=ym(`hline`,t,l),ye=ym(`hdashline`,t,l),be=[{type:`elem`,elem:_e,shift:0}];c.length>0;){var xe=c.pop(),Se=xe.pos-E;xe.isDashed?be.push({type:`elem`,elem:ye,shift:Se}):be.push({type:`elem`,elem:ve,shift:Se})}_e=wm({positionType:`individualShift`,children:be})}if(ne.length===0)return X([`mord`],[_e],t);var Ce=X([`tag`],[wm({positionType:`individualShift`,children:ne})],t);return xm([_e,Ce])},Ug={c:`center `,l:`left `,r:`right `},Wg=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`,[dh(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+=Ug[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},Gg=function(e,t){e.envName.includes(`ed`)||Lg(e);var n=[],r=e.envName.includes(`at`)?`alignat`:`align`,i=e.envName===`split`,a=Bg(e.parser,{cols:n,addJot:!0,autoTag:i?void 0:zg(e.envName),emptySingleRow:!0,colSeparationType:r,maxNumCols:i?2:void 0,leqno:e.parser.settings.leqno},`display`),o=0,s=0,c={type:`ordgroup`,mode:e.mode,body:[]};if(t[0]&&t[0].type===`ordgroup`){for(var l=``,u=0;u<t[0].body.length;u++){var d=Dh(t[0].body[u],`textord`);l+=d.text}o=Number(l),s=o*2}var f=!s;a.body.forEach(function(e){for(var t=1;t<e.length;t+=2)Dh(Dh(e[t],`styling`).body[0],`ordgroup`).body.unshift(c);if(f)s<e.length&&(s=e.length);else{var n=e.length/2;if(o<n)throw new B(`Too many math in a row: `+(`expected `+o+`, but got `+n),e[0])}});for(var p=0;p<s;++p){var m=`r`,h=0;p%2==1?m=`l`:p>0&&f&&(h=1),n[p]={type:`align`,align:m,pregap:h,postgap:0}}return a.colSeparationType=f?`align`:`alignat`,a};Mg({type:`array`,names:[`array`,`darray`],props:{numArgs:1},handler(e,t){var n=(kh(t[0])?[t[0]]:Dh(t[0],`ordgroup`).body).map(function(e){var t=Oh(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 Bg(e.parser,r,Vg(e.envName))},htmlBuilder:Hg,mathmlBuilder:Wg}),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=Bg(e.parser,r,Vg(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:Hg,mathmlBuilder:Wg}),Mg({type:`array`,names:[`smallmatrix`],props:{numArgs:0},handler(e){var t=Bg(e.parser,{arraystretch:.5},`script`);return t.colSeparationType=`small`,t},htmlBuilder:Hg,mathmlBuilder:Wg}),Mg({type:`array`,names:[`subarray`],props:{numArgs:1},handler(e,t){var n=(kh(t[0])?[t[0]]:Dh(t[0],`ordgroup`).body).map(function(e){var t=Oh(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=Bg(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:Hg,mathmlBuilder:Wg}),Mg({type:`array`,names:[`cases`,`dcases`,`rcases`,`drcases`],props:{numArgs:0},handler(e){var t=Bg(e.parser,{arraystretch:1.2,cols:[{type:`align`,align:`l`,pregap:0,postgap:1},{type:`align`,align:`l`,pregap:0,postgap:0}]},Vg(e.envName));return{type:`leftright`,mode:e.mode,body:[t],left:e.envName.includes(`r`)?`.`:`\\{`,right:e.envName.includes(`r`)?`\\}`:`.`,rightColor:void 0}},htmlBuilder:Hg,mathmlBuilder:Wg}),Mg({type:`array`,names:[`align`,`align*`,`aligned`,`split`],props:{numArgs:0},handler:Gg,htmlBuilder:Hg,mathmlBuilder:Wg}),Mg({type:`array`,names:[`gathered`,`gather`,`gather*`],props:{numArgs:0},handler(e){Rg.has(e.envName)&&Lg(e);var t={cols:[{type:`align`,align:`c`}],addJot:!0,colSeparationType:`gather`,autoTag:zg(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Bg(e.parser,t,`display`)},htmlBuilder:Hg,mathmlBuilder:Wg}),Mg({type:`array`,names:[`alignat`,`alignat*`,`alignedat`],props:{numArgs:1},handler:Gg,htmlBuilder:Hg,mathmlBuilder:Wg}),Mg({type:`array`,names:[`equation`,`equation*`],props:{numArgs:0},handler(e){Lg(e);var t={autoTag:zg(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Bg(e.parser,t,`display`)},htmlBuilder:Hg,mathmlBuilder:Wg}),Mg({type:`array`,names:[`CD`],props:{numArgs:0},handler(e){return Lg(e),Uh(e.parser)},htmlBuilder:Hg,mathmlBuilder:Wg}),$(`\\nonumber`,`\\gdef\\@eqnsw{0}`),$(`\\notag`,`\\nonumber`),Z({type:`text`,names:[`\\hline`,`\\hdashline`],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new B(e.funcName+` valid only within array environment`)}});var Kg=jg;Z({type:`environment`,names:[`\\begin`,`\\end`],props:{numArgs:1,argTypes:[`text`]},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];if(i.type!==`ordgroup`)throw new B(`Invalid environment name`,i);for(var a=``,o=0;o<i.body.length;++o)a+=Dh(i.body[o],`textord`).text;if(r===`\\begin`){if(!Kg.hasOwnProperty(a))throw new B(`No such environment: `+a,i);var s=Kg[a],{args:c,optArgs:l}=n.parseArguments(`\\begin{`+a+`}`,s),u={mode:n.mode,envName:a,parser:n},d=s.handler(u,c,l);n.expect(`\\end`,!1);var f=n.nextToken,p=Dh(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 qg=(e,t)=>{var n=e.font,r=t.withFont(n);return Zm(e.body,r)},Jg=(e,t)=>{var n=e.font,r=t.withFont(n);return dh(e.body,r)},Yg={"\\Bbb":`\\mathbb`,"\\bold":`\\mathbf`,"\\frak":`\\mathfrak`,"\\bm":`\\boldsymbol`};Z({type:`font`,names:[`\\mathrm`,`\\mathit`,`\\mathbf`,`\\mathnormal`,`\\mathsfit`,`\\mathbb`,`\\mathcal`,`\\mathfrak`,`\\mathscr`,`\\mathsf`,`\\mathtt`,`\\Bbb`,`\\bold`,`\\frak`],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=zm(t[0]),a=r;return a in Yg&&(a=Yg[a]),{type:`font`,mode:n.mode,font:a.slice(1),body:i}},htmlBuilder:qg,mathmlBuilder:Jg}),Z({type:`mclass`,names:[`\\boldsymbol`,`\\bm`],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`mclass`,mode:n.mode,mclass:Lh(r),body:[{type:`font`,mode:n.mode,font:`boldsymbol`,body:r}],isCharacterBox:yf(r)}}}),Z({type:`font`,names:[`\\rm`,`\\sf`,`\\tt`,`\\bf`,`\\it`,`\\cal`],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:i}=e,{mode:a}=n,o=n.parseExpression(!0,i);return{type:`font`,mode:a,font:`math`+r.slice(1),body:{type:`ordgroup`,mode:n.mode,body:o}}},htmlBuilder:qg,mathmlBuilder:Jg});var Xg=(e,t)=>{var n=t.style,r=n.fracNum(),i=n.fracDen(),a=t.havingStyle(r),o=Zm(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=Zm(e.denom,a,t),u,d,f;e.hasBarLine?(e.barSize?(d=cp(e.barSize,t),u=ym(`frac-line`,t,d)):u=ym(`frac-line`,t),d=u.height,f=u.height):(u=null,d=0,f=t.fontMetrics().defaultRuleThickness);var p,m,h;n.size===Bf.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=wm({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=wm({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===Bf.DISPLAY.size?t.fontMetrics().delim1:n.size===Bf.SCRIPTSCRIPT.size?t.havingStyle(Bf.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,x=e.leftDelim==null?Xm(t,[`mopen`]):Cg(e.leftDelim,b,!0,t.havingStyle(n),e.mode,[`mopen`]),S=e.continued?X([]):e.rightDelim==null?Xm(t,[`mclose`]):Cg(e.rightDelim,b,!0,t.havingStyle(n),e.mode,[`mclose`]);return X([`mord`].concat(a.sizingClasses(t)),[x,X([`mfrac`],[g]),S],t)},Zg=(e,t)=>{var n=new Q(`mfrac`,[dh(e.numer,t),dh(e.denom,t)]);if(!e.hasBarLine)n.setAttribute(`linethickness`,`0px`);else if(e.barSize){var r=cp(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 th(e.leftDelim.replace(`\\`,``))]);a.setAttribute(`fence`,`true`),i.push(a)}if(i.push(n),e.rightDelim!=null){var o=new Q(`mo`,[new th(e.rightDelim.replace(`\\`,``))]);o.setAttribute(`fence`,`true`),i.push(o)}return oh(i)}return n},Qg=(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`],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,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`),Qg({type:`genfrac`,mode:n.mode,numer:i,denom:a,continued:l,hasBarLine:o,leftDelim:s,rightDelim:c,barSize:null},u)},htmlBuilder:Xg,mathmlBuilder:Zg}),Z({type:`infix`,names:[`\\over`,`\\choose`,`\\atop`,`\\brace`,`\\brack`],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:n,token:r}=e,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 $g=[`display`,`text`,`script`,`scriptscript`],e_=function(e){var t=null;return e.length>0&&(t=e,t=t===`.`?null:t),t};Z({type:`genfrac`,names:[`\\genfrac`],props:{numArgs:6,allowedInArgument:!0,argTypes:[`math`,`math`,`size`,`text`,`math`,`math`]},handler(e,t){var{parser:n}=e,r=t[4],i=t[5],a=zm(t[0]),o=a.type===`atom`&&a.family===`open`?e_(a.text):null,s=zm(t[1]),c=s.type===`atom`&&s.family===`close`?e_(s.text):null,l=Dh(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=Dh(p.body[0],`textord`);f=$g[Number(m.text)]}}else p=Dh(p,`textord`),f=$g[Number(p.text)];return Qg({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`],props:{numArgs:1,argTypes:[`size`],infix:!0},handler(e,t){var{parser:n,funcName:r,token:i}=e;return{type:`infix`,mode:n.mode,replaceWith:`\\\\abovefrac`,size:Dh(t[0],`size`).value,token:i}}}),Z({type:`genfrac`,names:[`\\\\abovefrac`],props:{numArgs:3,argTypes:[`math`,`size`,`math`]},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0],a=Dh(t[1],`infix`).size;if(!a)throw Error(`\\\\abovefrac expected size, but got `+String(a));var o=t[2],s=a.number>0;return{type:`genfrac`,mode:n.mode,numer:i,denom:o,continued:!1,hasBarLine:s,barSize:a,leftDelim:null,rightDelim:null}}});var t_=(e,t)=>{var n=t.style,r,i;e.type===`supsub`?(r=e.sup?Zm(e.sup,t.havingStyle(n.sup()),t):Zm(e.sub,t.havingStyle(n.sub()),t),i=Dh(e.base,`horizBrace`)):i=Dh(e,`horizBrace`);var a=Zm(i.base,t.havingBaseStyle(Bf.DISPLAY)),o=Th(i,t),s;if(i.isOver?(s=wm({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:.1},{type:`elem`,elem:o}]}),s.children[0].children[0].children[1].classes.push(`svg-align`)):(s=wm({positionType:`bottom`,positionData:a.depth+.1+o.height,children:[{type:`elem`,elem:o},{type:`kern`,size:.1},{type:`elem`,elem:a}]}),s.children[0].children[0].children[0].classes.push(`svg-align`)),r){var c=X([`minner`,i.isOver?`mover`:`munder`],[s],t);s=i.isOver?wm({positionType:`firstBaseline`,children:[{type:`elem`,elem:c},{type:`kern`,size:.2},{type:`elem`,elem:r}]}):wm({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`],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:`horizBrace`,mode:n.mode,label:r,isOver:r.includes(`\\over`),base:t[0]}},htmlBuilder:t_,mathmlBuilder:(e,t)=>{var n=Sh(e.label);return new Q(e.isOver?`mover`:`munder`,[dh(e.base,t),n])}}),Z({type:`href`,names:[`\\href`],props:{numArgs:2,argTypes:[`url`,`original`],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],i=Dh(t[0],`url`).url;return n.settings.isTrusted({command:`\\href`,url:i})?{type:`href`,mode:n.mode,href:i,body:Bm(r)}:n.formatUnsupportedCmd(`\\href`)},htmlBuilder:(e,t)=>{var n=Gm(e.body,t,!1);return bm(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=uh(e.body,t);return n instanceof Q||(n=new Q(`mrow`,[n])),n.setAttribute(`href`,e.href),n}}),Z({type:`href`,names:[`\\url`],props:{numArgs:1,argTypes:[`url`],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=Dh(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:Bm(s)}}}),Z({type:`hbox`,names:[`\\hbox`],props:{numArgs:1,argTypes:[`text`],allowedInText:!0,primitive:!0},handler(e,t){var{parser:n}=e;return{type:`hbox`,mode:n.mode,body:Bm(t[0])}},htmlBuilder(e,t){return xm(Gm(e.body,t,!1))},mathmlBuilder(e,t){return new Q(`mrow`,lh(e.body,t))}}),Z({type:`html`,names:[`\\htmlClass`,`\\htmlId`,`\\htmlStyle`,`\\htmlData`],props:{numArgs:2,argTypes:[`raw`,`original`],allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,token:i}=e,a=Dh(t[0],`raw`).string,o=t[1];n.settings.strict&&n.settings.reportNonstrict(`htmlExtension`,`HTML extension is disabled on strict mode`);var s,c={};switch(r){case`\\htmlClass`:c.class=a,s={command:`\\htmlClass`,class:a};break;case`\\htmlId`:c.id=a,s={command:`\\htmlId`,id:a};break;case`\\htmlStyle`:c.style=a,s={command:`\\htmlStyle`,style:a};break;case`\\htmlData`:for(var l=a.split(`,`),u=0;u<l.length;u++){var d=l[u],f=d.indexOf(`=`);if(f<0)throw new B(`\\htmlData key/value '`+d+`' missing equals sign`);var p=d.slice(0,f),m=d.slice(f+1);c[`data-`+p.trim()]=m}s={command:`\\htmlData`,attributes:c};break;default:throw Error(`Unrecognized html command`)}return n.settings.isTrusted(s)?{type:`html`,mode:n.mode,attributes:c,body:Bm(o)}:n.formatUnsupportedCmd(r)},htmlBuilder:(e,t)=>{var n=Gm(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 in e.attributes)a!==`class`&&e.attributes.hasOwnProperty(a)&&i.setAttribute(a,e.attributes[a]);return i},mathmlBuilder:(e,t)=>uh(e.body,t)}),Z({type:`htmlmathml`,names:[`\\html@mathml`],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:`htmlmathml`,mode:n.mode,html:Bm(t[0]),mathml:Bm(t[1])}},htmlBuilder:(e,t)=>xm(Gm(e.html,t,!1)),mathmlBuilder:(e,t)=>uh(e.mathml,t)});var n_=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(!sp(n))throw new B(`Invalid unit: '`+n.unit+`' in \\includegraphics.`);return n};Z({type:`includegraphics`,names:[`\\includegraphics`],props:{numArgs:1,numOptionalArgs:1,argTypes:[`raw`,`url`],allowedInText:!1},handler:(e,t,n)=>{var{parser:r}=e,i={number:0,unit:`em`},a={number:.9,unit:`em`},o={number:0,unit:`em`},s=``;if(n[0])for(var c=Dh(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=n_(d);break;case`height`:a=n_(d);break;case`totalheight`:o=n_(d);break;default:throw new B(`Invalid key: '`+u[0]+`' in \\includegraphics.`)}}}var f=Dh(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=cp(e.height,t),r=0;e.totalheight.number>0&&(r=cp(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=cp(e.width,t));var a={height:V(n+r)};i>0&&(a.width=V(i)),r>0&&(a.verticalAlign=V(-r));var o=new gp(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=cp(e.height,t),i=0;if(e.totalheight.number>0&&(i=cp(e.totalheight,t)-r,n.setAttribute(`valign`,V(-i))),n.setAttribute(`height`,V(r+i)),e.width.number>0){var a=cp(e.width,t);n.setAttribute(`width`,V(a))}return n.setAttribute(`src`,e.src),n}}),Z({type:`kern`,names:[`\\kern`,`\\mkern`,`\\hskip`,`\\mskip`],props:{numArgs:1,argTypes:[`size`],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=Dh(t[0],`size`);if(n.settings.strict){var a=r[1]===`m`,o=i.value.unit===`mu`;a?(o||n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` supports only mu units, `+(`not `+i.value.unit+` units`)),n.mode!==`math`&&n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` works only in math mode`)):o&&n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` doesn't support mu units`)}return{type:`kern`,mode:n.mode,dimension:i.value}},htmlBuilder(e,t){return Tm(e.dimension,t)},mathmlBuilder(e,t){return new nh(cp(e.dimension,t))}}),Z({type:`lap`,names:[`\\mathllap`,`\\mathrlap`,`\\mathclap`],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,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([],[Zm(e.body,t)]),n=X([`inner`],[n],t)):n=X([`inner`],[Zm(e.body,t)]);var r=X([`fix`],[]),i=X([e.alignment],[n,r],t),a=X([`strut`]);return a.style.height=V(i.height+i.depth),i.depth&&(a.style.verticalAlign=V(-i.depth)),i.children.unshift(a),i=X([`thinbox`],[i],t),X([`mord`,`vbox`],[i],t)},mathmlBuilder:(e,t)=>{var n=new Q(`mpadded`,[dh(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:[`\\(`,`$`],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,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`,body:o}}}),Z({type:`text`,names:[`\\)`,`\\]`],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new B(`Mismatched `+e.funcName)}});var r_=(e,t)=>{switch(t.style.size){case Bf.DISPLAY.size:return e.display;case Bf.TEXT.size:return e.text;case Bf.SCRIPT.size:return e.script;case Bf.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Z({type:`mathchoice`,names:[`\\mathchoice`],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:`mathchoice`,mode:n.mode,display:Bm(t[0]),text:Bm(t[1]),script:Bm(t[2]),scriptscript:Bm(t[3])}},htmlBuilder:(e,t)=>xm(Gm(r_(e,t),t,!1)),mathmlBuilder:(e,t)=>uh(r_(e,t),t)});var i_=(e,t,n,r,i,a,o)=>{e=X([],[e]);var s=n&&yf(n),c,l;if(t){var u=Zm(t,r.havingStyle(i.sup()),r);l={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var d=Zm(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=wm({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=wm({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=wm({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)},a_=new Set([`\\smallint`]),o_=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=Dh(e.base,`op`),i=!0):a=Dh(e,`op`);var o=t.style,s=!1;o.size===Bf.DISPLAY.size&&a.symbol&&!a_.has(a.name)&&(s=!0);var c;if(a.symbol){var l=s?`Size2-Regular`:`Size1-Regular`,u=``;if((a.name===`\\oiint`||a.name===`\\oiiint`)&&(u=a.name.slice(1),a.name=u===`oiint`?`\\iint`:`\\iiint`),c=dm(a.name,l,`math`,t,[`mop`,`op-symbol`,s?`large-op`:`small-op`]),u.length>0){var d=c.italic,f=km(u+`Size`+(s?`2`:`1`),t);c=wm({positionType:`individualShift`,children:[{type:`elem`,elem:c,shift:0},{type:`elem`,elem:f,shift:s?.08:0}]}),a.name=`\\`+u,c.classes.unshift(`mop`),c.italic=d}}else if(a.body){var p=Gm(a.body,t,!0);p.length===1&&p[0]instanceof vp?(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(fm(a.name[h],a.mode,t));c=X([`mop`],m,t)}var g=0,_=0;return(c instanceof vp||a.name===`\\oiint`||a.name===`\\oiiint`)&&!a.suppressBaseShift&&(g=(c.height-c.depth)/2-t.fontMetrics().axisHeight,_=c.italic||0),i?i_(c,n,r,t,o,_,g):(g&&(c.style.position=`relative`,c.style.top=V(g)),c)},s_=(e,t)=>{var n;if(e.symbol)n=new Q(`mo`,[ah(e.name,e.mode)]),a_.has(e.name)&&n.setAttribute(`largeop`,`false`);else if(e.body)n=new Q(`mo`,lh(e.body,t));else{n=new Q(`mi`,[new th(e.name.slice(1))]);var r=new Q(`mo`,[ah(`⁡`,`text`)]);n=e.parentIsSupSub?new Q(`mrow`,[n,r]):eh([n,r])}return n},c_={"∏":`\\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(`.`),props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=r;return i.length===1&&(i=c_[i]),{type:`op`,mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:i}},htmlBuilder:o_,mathmlBuilder:s_}),Z({type:`op`,names:[`\\mathop`],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`op`,mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Bm(r)}},htmlBuilder:o_,mathmlBuilder:s_});var l_={"∫":`\\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(`.`),props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:o_,mathmlBuilder:s_}),Z({type:`op`,names:[`\\det`,`\\gcd`,`\\inf`,`\\lim`,`\\max`,`\\min`,`\\Pr`,`\\sup`],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:`op`,mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:o_,mathmlBuilder:s_}),Z({type:`op`,names:[`\\int`,`\\iint`,`\\iiint`,`\\oint`,`\\oiint`,`\\oiiint`,`∫`,`∬`,`∭`,`∮`,`∯`,`∰`],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:t,funcName:n}=e,r=n;return r.length===1&&(r=l_[r]),{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:o_,mathmlBuilder:s_});var u_=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=Dh(e.base,`operatorname`),i=!0):a=Dh(e,`operatorname`);var o;if(a.body.length>0){for(var s=Gm(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 vp&&(l.text=l.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`))}o=X([`mop`],s,t)}else o=X([`mop`],[],t);return i?i_(o,n,r,t,t.style,0,0):o};Z({type:`operatorname`,names:[`\\operatorname@`,`\\operatornamewithlimits`],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,i=t[0];return{type:`operatorname`,mode:n.mode,body:Bm(i),alwaysHandleSupSub:r===`\\operatornamewithlimits`,limits:!1,parentIsSupSub:!1}},htmlBuilder:u_,mathmlBuilder:(e,t)=>{for(var n=lh(e.body,t.withFont(`mathrm`)),r=!0,i=0;i<n.length;i++){var a=n[i];if(!(a instanceof nh))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 th?o.text=o.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`):r=!1;break;default:r=!1}else r=!1}r&&(n=[new th(n.map(e=>e.toText()).join(``))]);var s=new Q(`mi`,n);s.setAttribute(`mathvariant`,`normal`);var c=new Q(`mo`,[ah(`⁡`,`text`)]);return e.parentIsSupSub?new Q(`mrow`,[s,c]):eh([s,c])}}),$(`\\operatorname`,`\\@ifstar\\operatornamewithlimits\\operatorname@`),Rm({type:`ordgroup`,htmlBuilder(e,t){return e.semisimple?xm(Gm(e.body,t,!1)):X([`mord`],Gm(e.body,t,!0),t)},mathmlBuilder(e,t){return uh(e.body,t,!0)}}),Z({type:`overline`,names:[`\\overline`],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:`overline`,mode:n.mode,body:r}},htmlBuilder(e,t){var n=Zm(e.body,t.havingCrampedStyle()),r=ym(`overline-line`,t),i=t.fontMetrics().defaultRuleThickness;return X([`mord`,`overline`],[wm({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 th(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new Q(`mover`,[dh(e.body,t),n]);return r.setAttribute(`accent`,`true`),r}}),Z({type:`phantom`,names:[`\\phantom`],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`phantom`,mode:n.mode,body:Bm(r)}},htmlBuilder:(e,t)=>xm(Gm(e.body,t.withPhantom(),!1)),mathmlBuilder:(e,t)=>new Q(`mphantom`,lh(e.body,t))}),$(`\\hphantom`,`\\smash{\\phantom{#1}}`),Z({type:`vphantom`,names:[`\\vphantom`],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:`vphantom`,mode:n.mode,body:r}},htmlBuilder:(e,t)=>X([`mord`,`rlap`],[X([`inner`],[Zm(e.body,t.withPhantom())]),X([`fix`],[])],t),mathmlBuilder:(e,t)=>{var n=new Q(`mpadded`,[new Q(`mphantom`,lh(Bm(e.body),t))]);return n.setAttribute(`width`,`0px`),n}}),Z({type:`raisebox`,names:[`\\raisebox`],props:{numArgs:2,argTypes:[`size`,`hbox`],allowedInText:!0},handler(e,t){var{parser:n}=e,r=Dh(t[0],`size`).value,i=t[1];return{type:`raisebox`,mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=Zm(e.body,t);return wm({positionType:`shift`,positionData:-cp(e.dy,t),children:[{type:`elem`,elem:n}]})},mathmlBuilder(e,t){var n=new Q(`mpadded`,[dh(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute(`voffset`,r),n}}),Z({type:`internal`,names:[`\\relax`],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:`internal`,mode:t.mode}}}),Z({type:`rule`,names:[`\\rule`],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`size`,`size`,`size`]},handler(e,t,n){var{parser:r}=e,i=n[0],a=Dh(t[0],`size`),o=Dh(t[1],`size`);return{type:`rule`,mode:r.mode,shift:i&&Dh(i,`size`).value,width:a.value,height:o.value}},htmlBuilder(e,t){var n=X([`mord`,`rule`],[],t),r=cp(e.width,t),i=cp(e.height,t),a=e.shift?cp(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=cp(e.width,t),r=cp(e.height,t),i=e.shift?cp(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 d_(e,t,n){for(var r=Gm(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,a=0;a<r.length;a++){var o=r[a].classes.indexOf(`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 xm(r)}var f_=[`\\tiny`,`\\sixptsize`,`\\scriptsize`,`\\footnotesize`,`\\small`,`\\normalsize`,`\\large`,`\\Large`,`\\LARGE`,`\\huge`,`\\Huge`];Z({type:`sizing`,names:f_,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!1,n);return{type:`sizing`,mode:i.mode,size:f_.indexOf(r)+1,body:a}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return d_(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=new Q(`mstyle`,lh(e.body,n));return r.setAttribute(`mathsize`,V(n.sizeMultiplier)),r}}),Z({type:`smash`,names:[`\\smash`],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,i=!1,a=!1,o=n[0]&&Dh(n[0],`ordgroup`);if(o)for(var s=``,c=0;c<o.body.length;++c){var l=o.body[c];if(s=Oh(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([],[Zm(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`,`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`],[wm({positionType:`firstBaseline`,children:[{type:`elem`,elem:n}]})],t)},mathmlBuilder:(e,t)=>{var n=new Q(`mpadded`,[dh(e.body,t)]);return e.smashHeight&&n.setAttribute(`height`,`0px`),e.smashDepth&&n.setAttribute(`depth`,`0px`),n}}),Z({type:`sqrt`,names:[`\\sqrt`],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r}=e,i=n[0],a=t[0];return{type:`sqrt`,mode:r.mode,body:a,index:i}},htmlBuilder(e,t){var n=Zm(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=Sm(n,t);var r=t.fontMetrics().defaultRuleThickness,i=r;t.style.id<Bf.TEXT.id&&(i=t.fontMetrics().xHeight);var a=r+i/4,{span:o,ruleWidth:s,advanceWidth:c}=fg(n.height+n.depth+a+r,t),l=o.height-s;l>n.height+n.depth+a&&(a=(a+l-n.height-n.depth)/2);var u=o.height-n.height-a-s;n.style.paddingLeft=V(c);var d=wm({positionType:`firstBaseline`,children:[{type:`elem`,elem:n,wrapperClasses:[`svg-align`]},{type:`kern`,size:-(n.height+u)},{type:`elem`,elem:o},{type:`kern`,size:s}]});if(e.index){var f=t.havingStyle(Bf.SCRIPTSCRIPT),p=Zm(e.index,f,t);return X([`mord`,`sqrt`],[X([`root`],[wm({positionType:`shift`,positionData:-(.6*(d.height-d.depth)),children:[{type:`elem`,elem:p}]})]),d],t)}else return X([`mord`,`sqrt`],[d],t)},mathmlBuilder(e,t){var{body:n,index:r}=e;return r?new Q(`mroot`,[dh(n,t),dh(r,t)]):new Q(`msqrt`,[dh(n,t)])}});var p_={display:Bf.DISPLAY,text:Bf.TEXT,script:Bf.SCRIPT,scriptscript:Bf.SCRIPTSCRIPT};Z({type:`styling`,names:[`\\displaystyle`,`\\textstyle`,`\\scriptstyle`,`\\scriptscriptstyle`],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:r,parser:i}=e,a=i.parseExpression(!0,n),o=r.slice(1,r.length-5);return{type:`styling`,mode:i.mode,style:o,body:a}},htmlBuilder(e,t){var n=p_[e.style],r=t.havingStyle(n).withFont(``);return d_(e.body,r,t)},mathmlBuilder(e,t){var n=p_[e.style],r=t.havingStyle(n),i=new Q(`mstyle`,lh(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 m_=function(e,t){var n=e.base;return n?n.type===`op`?n.limits&&(t.style.size===Bf.DISPLAY.size||n.alwaysHandleSupSub)?o_:null:n.type===`operatorname`?n.alwaysHandleSupSub&&(t.style.size===Bf.DISPLAY.size||n.limits)?u_:null:n.type===`accent`?yf(n.base)?jh:null:n.type===`horizBrace`&&!e.sub===n.isOver?t_:null:null};Rm({type:`supsub`,htmlBuilder(e,t){var n=m_(e,t);if(n)return n(e,t);var{base:r,sup:i,sub:a}=e,o=Zm(r,t),s,c,l=t.fontMetrics(),u=0,d=0,f=r&&yf(r);if(i){var p=t.havingStyle(t.style.sup());s=Zm(i,p,t),f||(u=o.height-p.fontMetrics().supDrop*p.sizeMultiplier/t.sizeMultiplier)}if(a){var m=t.havingStyle(t.style.sub());c=Zm(a,m,t),f||(d=o.depth+m.fontMetrics().subDrop*m.sizeMultiplier/t.sizeMultiplier)}var h=t.style===Bf.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 vp||y)&&(v=V(-o.italic))}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=wm({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=wm({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=wm({positionType:`shift`,positionData:-u,children:[{type:`elem`,elem:s,marginRight:_}]});else throw Error(`supsub must have either sup or sub.`);return X([Ym(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=[dh(e.base,t)];e.sub&&a.push(dh(e.sub,t)),e.sup&&a.push(dh(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===Bf.DISPLAY||s.alwaysHandleSupSub)||s&&s.type===`operatorname`&&s.alwaysHandleSupSub&&(s.limits||t.style===Bf.DISPLAY)?`mover`:`msup`}else if(e.sup){var c=e.base;o=c&&c.type===`op`&&c.limits&&t.style===Bf.DISPLAY||c&&c.type===`operatorname`&&c.alwaysHandleSupSub&&(t.style===Bf.DISPLAY||c.limits)?`munderover`:`msubsup`}else{var l=e.base;o=l&&l.type===`op`&&l.limits&&(t.style===Bf.DISPLAY||l.alwaysHandleSupSub)||l&&l.type===`operatorname`&&l.alwaysHandleSupSub&&(l.limits||t.style===Bf.DISPLAY)?`munder`:`msub`}return new Q(o,a)}}),Rm({type:`atom`,htmlBuilder(e,t){return fm(e.text,e.mode,t,[`m`+e.family])},mathmlBuilder(e,t){var n=new Q(`mo`,[ah(e.text,e.mode)]);if(e.family===`bin`){var r=sh(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 h_={mi:`italic`,mn:`normal`,mtext:`normal`};Rm({type:`mathord`,htmlBuilder(e,t){return mm(e,t,`mathord`)},mathmlBuilder(e,t){var n=new Q(`mi`,[ah(e.text,e.mode,t)]),r=sh(e,t)||`italic`;return r!==h_[n.type]&&n.setAttribute(`mathvariant`,r),n}}),Rm({type:`textord`,htmlBuilder(e,t){return mm(e,t,`textord`)},mathmlBuilder(e,t){var n=ah(e.text,e.mode,t),r=sh(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!==h_[i.type]&&i.setAttribute(`mathvariant`,r),i}});var g_={"\\nobreak":`nobreak`,"\\allowbreak":`allowbreak`},__={" ":{},"\\ ":{},"~":{className:`nobreak`},"\\space":{},"\\nobreakspace":{className:`nobreak`}};Rm({type:`spacing`,htmlBuilder(e,t){if(__.hasOwnProperty(e.text)){var n=__[e.text].className||``;if(e.mode===`text`){var r=mm(e,t,`textord`);return r.classes.push(n),r}else return X([`mspace`,n],[fm(e.text,e.mode,t)],t)}else if(g_.hasOwnProperty(e.text))return X([`mspace`,g_[e.text]],[],t);else throw new B(`Unknown type of space "`+e.text+`"`)},mathmlBuilder(e,t){var n;if(__.hasOwnProperty(e.text))n=new Q(`mtext`,[new th(`\xA0`)]);else if(g_.hasOwnProperty(e.text))return new Q(`mspace`);else throw new B(`Unknown type of space "`+e.text+`"`);return n}});var v_=()=>{var e=new Q(`mtd`,[]);return e.setAttribute(`width`,`50%`),e};Rm({type:`tag`,mathmlBuilder(e,t){var n=new Q(`mtable`,[new Q(`mtr`,[v_(),new Q(`mtd`,[uh(e.body,t)]),v_(),new Q(`mtd`,[uh(e.tag,t)])])]);return n.setAttribute(`width`,`100%`),n}});var y_={"\\text":void 0,"\\textrm":`textrm`,"\\textsf":`textsf`,"\\texttt":`texttt`,"\\textnormal":`textrm`},b_={"\\textbf":`textbf`,"\\textmd":`textmd`},x_={"\\textit":`textit`,"\\textup":`textup`},S_=(e,t)=>{var n=e.font;return n?y_[n]?t.withTextFontFamily(y_[n]):b_[n]?t.withTextFontWeight(b_[n]):n===`\\emph`?t.fontShape===`textit`?t.withTextFontShape(`textup`):t.withTextFontShape(`textit`):t.withTextFontShape(x_[n]):t};Z({type:`text`,names:[`\\text`,`\\textrm`,`\\textsf`,`\\texttt`,`\\textnormal`,`\\textbf`,`\\textmd`,`\\textit`,`\\textup`,`\\emph`],props:{numArgs:1,argTypes:[`text`],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,i=t[0];return{type:`text`,mode:n.mode,body:Bm(i),font:r}},htmlBuilder(e,t){var n=S_(e,t);return X([`mord`,`text`],Gm(e.body,n,!0),n)},mathmlBuilder(e,t){var n=S_(e,t);return uh(e.body,n)}}),Z({type:`underline`,names:[`\\underline`],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:`underline`,mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Zm(e.body,t),r=ym(`underline-line`,t),i=t.fontMetrics().defaultRuleThickness;return X([`mord`,`underline`],[wm({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 th(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new Q(`munder`,[dh(e.body,t),n]);return r.setAttribute(`accentunder`,`true`),r}}),Z({type:`vcenter`,names:[`\\vcenter`],props:{numArgs:1,argTypes:[`original`],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:`vcenter`,mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=Zm(e.body,t),r=t.fontMetrics().axisHeight;return wm({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`,[dh(e.body,t)],[`vcenter`])])}}),Z({type:`verb`,names:[`\\verb`],props:{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=C_(e),r=[],i=t.havingStyle(t.style.text()),a=0;a<n.length;a++){var o=n[a];o===`~`&&(o=`\\textasciitilde`),r.push(dm(o,`Typewriter-Regular`,e.mode,i,[`mord`,`texttt`]))}return X([`mord`,`text`].concat(i.sizingClasses(t)),gm(r),i)},mathmlBuilder(e,t){var n=new Q(`mtext`,[new th(C_(e))]);return n.setAttribute(`mathvariant`,`monospace`),n}});var C_=e=>e.body.replace(/ /g,e.star?`␣`:`\xA0`),w_=Fm,T_=`[ \r
286
+ ]`,E_=`\\\\[a-zA-Z@]+`,D_=`\\\\[^\ud800-\udfff]`,O_=`(`+E_+`)`+T_+`*`,k_=`\\\\(
287
+ |[ \r ]+
288
+ ?)[ \r ]*`,A_=`[̀-ͯ]`,j_=RegExp(A_+`+$`),M_=`(`+T_+`+)|`+(k_+`|`)+`([!-\\[\\]-‧‪-퟿豈-￿]`+(A_+`*`)+`|[\ud800-\udbff][\udc00-\udfff]`+(A_+`*`)+`|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5`+(`|`+O_)+(`|`+D_+`)`),N_=class{constructor(e,t){this.input=e,this.settings=t,this.tokenRegex=new RegExp(M_,`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 Fg(`EOF`,new Pg(this,t,t));var n=this.tokenRegex.exec(e);if(n===null||n.index!==t)throw new B(`Unexpected character: '`+e[t]+`'`,new Fg(e[t],new Pg(this,t,t+1)));var r=n[6]||n[3]||(n[2]?`\\ `:` `);if(this.catcodes[r]===14){var i=e.indexOf(`
289
+ `,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict(`commentAtEnd`,`% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)`)):this.tokenRegex.lastIndex=i+1,this.lex()}return new Fg(r,new Pg(this,t,this.tokenRegex.lastIndex))}},P_=class{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),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 in e)e.hasOwnProperty(t)&&(e[t]==null?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]: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&&!i.hasOwnProperty(e)&&(i[e]=this.current[e])}t==null?delete this.current[e]:this.current[e]=t}},F_=Ng;$(`\\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 I_={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=I_[t.text],r==null||r>=n)throw new B(`Invalid base-`+n+` digit `+t.text);for(var i;(i=I_[e.future().text])!=null&&i<n;)r*=n,r+=i,e.popToken()}return`\\@char{`+r+`}`});var L_=(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=>L_(e,!1,!0,!1)),$(`\\renewcommand`,e=>L_(e,!0,!1,!1)),$(`\\providecommand`,e=>L_(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),w_[n],Pp.math[n],Pp.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 R_={",":`\\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`},z_=new Set([`bin`,`rel`]);$(`\\dots`,function(e){var t=`\\dotso`,n=e.expandAfterFuture().text;return n in R_?t=R_[n]:(n.slice(0,4)===`\\not`||n in Pp.math&&z_.has(Pp.math[n].group))&&(t=`\\dotsb`),t});var B_={")":!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 B_?`\\ldots\\,`:`\\ldots`}),$(`\\dotsc`,function(e){var t=e.future().text;return t in B_&&t!==`,`?`\\ldots\\,`:`\\ldots`}),$(`\\cdots`,function(e){return e.future().text in B_?`\\@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 V_=V(Tp[`Main-Regular`][84][1]-.7*Tp[`Main-Regular`][65][1]);$(`\\LaTeX`,`\\textrm{\\html@mathml{`+(`L\\kern-.36em\\raisebox{`+V_+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{LaTeX}}`),$(`\\KaTeX`,`\\textrm{\\html@mathml{`+(`K\\kern-.17em\\raisebox{`+V_+`}{\\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`⦄}}"),$(`⦃`,`\\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 H_=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`,H_(!1)),$(`\\bra@set`,H_(!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 U_={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},W_=class{constructor(e,t,n){this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new P_(F_,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new N_(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(),{tokens:r,end:n}=this.consumeArg([`]`])}else ({tokens:r,start:t,end:n}=this.consumeArg());return this.pushToken(new Fg(`EOF`,n.loc)),this.pushTokens(r),new Fg(``,Pg.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 Fg(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 N_(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)||w_.hasOwnProperty(e)||Pp.math.hasOwnProperty(e)||Pp.text.hasOwnProperty(e)||U_.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return t==null?w_.hasOwnProperty(e)&&!w_[e].primitive:typeof t==`string`||typeof t==`function`||!t.unexpandable}},G_=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,K_=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`,ᵝ:`β`,ᵞ:`γ`,ᵟ:`δ`,ᵠ:`ϕ`,ᵡ:`χ`,ᶿ:`θ`}),q_={"́":{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`}},J_={á:`á`,à:`à`,ä:`ä`,ǟ:`ǟ`,ã:`ã`,ā:`ā`,ă:`ă`,ắ:`ắ`,ằ:`ằ`,ẵ:`ẵ`,ǎ:`ǎ`,â:`â`,ấ:`ấ`,ầ:`ầ`,ẫ:`ẫ`,ȧ:`ȧ`,ǡ:`ǡ`,å:`å`,ǻ:`ǻ`,ḃ:`ḃ`,ć:`ć`,ḉ:`ḉ`,č:`č`,ĉ:`ĉ`,ċ:`ċ`,ç:`ç`,ď:`ď`,ḋ:`ḋ`,ḑ:`ḑ`,é:`é`,è:`è`,ë:`ë`,ẽ:`ẽ`,ē:`ē`,ḗ:`ḗ`,ḕ:`ḕ`,ĕ:`ĕ`,ḝ:`ḝ`,ě:`ě`,ê:`ê`,ế:`ế`,ề:`ề`,ễ:`ễ`,ė:`ė`,ȩ:`ȩ`,ḟ:`ḟ`,ǵ:`ǵ`,ḡ:`ḡ`,ğ:`ğ`,ǧ:`ǧ`,ĝ:`ĝ`,ġ:`ġ`,ģ:`ģ`,ḧ:`ḧ`,ȟ:`ȟ`,ĥ:`ĥ`,ḣ:`ḣ`,ḩ:`ḩ`,í:`í`,ì:`ì`,ï:`ï`,ḯ:`ḯ`,ĩ:`ĩ`,ī:`ī`,ĭ:`ĭ`,ǐ:`ǐ`,î:`î`,ǰ:`ǰ`,ĵ:`ĵ`,ḱ:`ḱ`,ǩ:`ǩ`,ķ:`ķ`,ĺ:`ĺ`,ľ:`ľ`,ļ:`ļ`,ḿ:`ḿ`,ṁ:`ṁ`,ń:`ń`,ǹ:`ǹ`,ñ:`ñ`,ň:`ň`,ṅ:`ṅ`,ņ:`ņ`,ó:`ó`,ò:`ò`,ö:`ö`,ȫ:`ȫ`,õ:`õ`,ṍ:`ṍ`,ṏ:`ṏ`,ȭ:`ȭ`,ō:`ō`,ṓ:`ṓ`,ṑ:`ṑ`,ŏ:`ŏ`,ǒ:`ǒ`,ô:`ô`,ố:`ố`,ồ:`ồ`,ỗ:`ỗ`,ȯ:`ȯ`,ȱ:`ȱ`,ő:`ő`,ṕ:`ṕ`,ṗ:`ṗ`,ŕ:`ŕ`,ř:`ř`,ṙ:`ṙ`,ŗ:`ŗ`,ś:`ś`,ṥ:`ṥ`,š:`š`,ṧ:`ṧ`,ŝ:`ŝ`,ṡ:`ṡ`,ş:`ş`,ẗ:`ẗ`,ť:`ť`,ṫ:`ṫ`,ţ:`ţ`,ú:`ú`,ù:`ù`,ü:`ü`,ǘ:`ǘ`,ǜ:`ǜ`,ǖ:`ǖ`,ǚ:`ǚ`,ũ:`ũ`,ṹ:`ṹ`,ū:`ū`,ṻ:`ṻ`,ŭ:`ŭ`,ǔ:`ǔ`,û:`û`,ů:`ů`,ű:`ű`,ṽ:`ṽ`,ẃ:`ẃ`,ẁ:`ẁ`,ẅ:`ẅ`,ŵ:`ŵ`,ẇ:`ẇ`,ẘ:`ẘ`,ẍ:`ẍ`,ẋ:`ẋ`,ý:`ý`,ỳ:`ỳ`,ÿ:`ÿ`,ỹ:`ỹ`,ȳ:`ȳ`,ŷ:`ŷ`,ẏ:`ẏ`,ẙ:`ẙ`,ź:`ź`,ž:`ž`,ẑ:`ẑ`,ż:`ż`,Á:`Á`,À:`À`,Ä:`Ä`,Ǟ:`Ǟ`,Ã:`Ã`,Ā:`Ā`,Ă:`Ă`,Ắ:`Ắ`,Ằ:`Ằ`,Ẵ:`Ẵ`,Ǎ:`Ǎ`,Â:`Â`,Ấ:`Ấ`,Ầ:`Ầ`,Ẫ:`Ẫ`,Ȧ:`Ȧ`,Ǡ:`Ǡ`,Å:`Å`,Ǻ:`Ǻ`,Ḃ:`Ḃ`,Ć:`Ć`,Ḉ:`Ḉ`,Č:`Č`,Ĉ:`Ĉ`,Ċ:`Ċ`,Ç:`Ç`,Ď:`Ď`,Ḋ:`Ḋ`,Ḑ:`Ḑ`,É:`É`,È:`È`,Ë:`Ë`,Ẽ:`Ẽ`,Ē:`Ē`,Ḗ:`Ḗ`,Ḕ:`Ḕ`,Ĕ:`Ĕ`,Ḝ:`Ḝ`,Ě:`Ě`,Ê:`Ê`,Ế:`Ế`,Ề:`Ề`,Ễ:`Ễ`,Ė:`Ė`,Ȩ:`Ȩ`,Ḟ:`Ḟ`,Ǵ:`Ǵ`,Ḡ:`Ḡ`,Ğ:`Ğ`,Ǧ:`Ǧ`,Ĝ:`Ĝ`,Ġ:`Ġ`,Ģ:`Ģ`,Ḧ:`Ḧ`,Ȟ:`Ȟ`,Ĥ:`Ĥ`,Ḣ:`Ḣ`,Ḩ:`Ḩ`,Í:`Í`,Ì:`Ì`,Ï:`Ï`,Ḯ:`Ḯ`,Ĩ:`Ĩ`,Ī:`Ī`,Ĭ:`Ĭ`,Ǐ:`Ǐ`,Î:`Î`,İ:`İ`,Ĵ:`Ĵ`,Ḱ:`Ḱ`,Ǩ:`Ǩ`,Ķ:`Ķ`,Ĺ:`Ĺ`,Ľ:`Ľ`,Ļ:`Ļ`,Ḿ:`Ḿ`,Ṁ:`Ṁ`,Ń:`Ń`,Ǹ:`Ǹ`,Ñ:`Ñ`,Ň:`Ň`,Ṅ:`Ṅ`,Ņ:`Ņ`,Ó:`Ó`,Ò:`Ò`,Ö:`Ö`,Ȫ:`Ȫ`,Õ:`Õ`,Ṍ:`Ṍ`,Ṏ:`Ṏ`,Ȭ:`Ȭ`,Ō:`Ō`,Ṓ:`Ṓ`,Ṑ:`Ṑ`,Ŏ:`Ŏ`,Ǒ:`Ǒ`,Ô:`Ô`,Ố:`Ố`,Ồ:`Ồ`,Ỗ:`Ỗ`,Ȯ:`Ȯ`,Ȱ:`Ȱ`,Ő:`Ő`,Ṕ:`Ṕ`,Ṗ:`Ṗ`,Ŕ:`Ŕ`,Ř:`Ř`,Ṙ:`Ṙ`,Ŗ:`Ŗ`,Ś:`Ś`,Ṥ:`Ṥ`,Š:`Š`,Ṧ:`Ṧ`,Ŝ:`Ŝ`,Ṡ:`Ṡ`,Ş:`Ş`,Ť:`Ť`,Ṫ:`Ṫ`,Ţ:`Ţ`,Ú:`Ú`,Ù:`Ù`,Ü:`Ü`,Ǘ:`Ǘ`,Ǜ:`Ǜ`,Ǖ:`Ǖ`,Ǚ:`Ǚ`,Ũ:`Ũ`,Ṹ:`Ṹ`,Ū:`Ū`,Ṻ:`Ṻ`,Ŭ:`Ŭ`,Ǔ:`Ǔ`,Û:`Û`,Ů:`Ů`,Ű:`Ű`,Ṽ:`Ṽ`,Ẃ:`Ẃ`,Ẁ:`Ẁ`,Ẅ:`Ẅ`,Ŵ:`Ŵ`,Ẇ:`Ẇ`,Ẍ:`Ẍ`,Ẋ:`Ẋ`,Ý:`Ý`,Ỳ:`Ỳ`,Ÿ:`Ÿ`,Ỹ:`Ỹ`,Ȳ:`Ȳ`,Ŷ:`Ŷ`,Ẏ:`Ẏ`,Ź:`Ź`,Ž:`Ž`,Ẑ:`Ẑ`,Ż:`Ż`,ά:`ά`,ὰ:`ὰ`,ᾱ:`ᾱ`,ᾰ:`ᾰ`,έ:`έ`,ὲ:`ὲ`,ή:`ή`,ὴ:`ὴ`,ί:`ί`,ὶ:`ὶ`,ϊ:`ϊ`,ΐ:`ΐ`,ῒ:`ῒ`,ῑ:`ῑ`,ῐ:`ῐ`,ό:`ό`,ὸ:`ὸ`,ύ:`ύ`,ὺ:`ὺ`,ϋ:`ϋ`,ΰ:`ΰ`,ῢ:`ῢ`,ῡ:`ῡ`,ῠ:`ῠ`,ώ:`ώ`,ὼ:`ὼ`,Ύ:`Ύ`,Ὺ:`Ὺ`,Ϋ:`Ϋ`,Ῡ:`Ῡ`,Ῠ:`Ῠ`,Ώ:`Ώ`,Ὼ:`Ὼ`},Y_=class e{constructor(e,t){this.mode=`math`,this.gullet=new W_(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 Fg(`}`)),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&&w_[i.text]&&w_[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],[])]}else 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(K_[i.text]){var s=G_.test(i.text),c=[];for(c.push(new Fg(K_[i.text])),this.consume();;){var l=this.fetch().text;if(!K_[l]||G_.test(l)!==s)break;c.unshift(new Fg(K_[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}:t}parseFunction(e,t){var n=this.fetch(),r=n.text,i=w_[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{args:a,optArgs:o}=this.parseArguments(r,i);return this.callFunction(r,a,o,n,e)}callFunction(e,t,n,r,i){var a={funcName:e,parser:this,token:r,breakOnTokenText:i},o=w_[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.numArgs+t.numOptionalArgs;if(n===0)return{args:[],optArgs:[]};for(var r=[],i=[],a=0;a<n;a++){var o=t.argTypes&&t.argTypes[a],s=a<t.numOptionalArgs;(`primitive`in t&&t.primitive&&o==null||t.type===`sqrt`&&a===1&&i[0]==null)&&(o=`primitive`);var c=this.parseGroupOfType(`argument to '`+e+`'`,o,s);if(s)i.push(c);else if(c!=null)r.push(c);else throw new B(`Null argument, please report this as a bug`)}return{args:r,optArgs:i}}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`};case`raw`:var i=this.parseStringGroup(`raw`,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 null: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,t){var n=this.gullet.scanArgument(t);if(n==null)return null;for(var r=``,i;(i=this.fetch()).text!==`EOF`;)r+=i.text,this.consume();return this.consume(),n.text=r,n}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(`color`,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(`size`,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(!sp(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(`url`,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:Pg.range(n,s),body:o,semisimple:r===`\\begingroup`||void 0}}else if(i=this.parseFunction(t,e)||this.parseSymbol(),i==null&&r[0]===`\\`&&!U_.hasOwnProperty(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:Pg.range(r,o),text:`---`}),t-=2):(e.splice(n,2,{type:`textord`,mode:`text`,loc:Pg.range(r,a),text:`--`}),--t)}(i===`'`||i==="`")&&a.text===i&&(e.splice(n,2,{type:`textord`,mode:`text`,loc:Pg.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 --
290
+ please report what input caused this bug`);return n=n.slice(1,-1),{type:`verb`,mode:`text`,body:n,star:r}}J_.hasOwnProperty(t[0])&&!Pp[this.mode][t[0]]&&(this.settings.strict&&this.mode===`math`&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Accented Unicode text character "`+t[0]+`" used in math mode`,e),t=J_[t[0]]+t.slice(1));var i=j_.exec(t);i&&(t=t.substring(0,i.index),t===`i`?t=`ı`:t===`j`&&(t=`ȷ`));var a;if(Pp[this.mode][t]){this.settings.strict&&this.mode===`math`&&im.includes(t)&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Latin-1/Unicode text character "`+t[0]+`" used in math mode`,e);var o=Pp[this.mode][t].group,s=Pg.range(e),c;if(Mp.hasOwnProperty(o)){var l=o;c={type:`atom`,mode:this.mode,family:l,loc:s,text:t}}else c={type:o,mode:this.mode,loc:s,text:t};a=c}else if(t.charCodeAt(0)>=128)this.settings.strict&&(Wf(t.charCodeAt(0))?this.mode===`math`&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Unicode text character "`+t[0]+`" used in math mode`,e):this.settings.reportNonstrict(`unknownSymbol`,`Unrecognized Unicode character "`+t[0]+`"`+(` (`+t.charCodeAt(0)+`)`),e)),a={type:`textord`,mode:`text`,loc:Pg.range(e),text:t};else return null;if(this.consume(),i)for(var u=0;u<i[0].length;u++){var d=i[0][u];if(!q_[d])throw new B(`Unknown accent ' `+d+`'`,e);var f=q_[d][this.mode]||q_[d].text;if(!f)throw new B(`Accent `+d+` unsupported in `+this.mode+` mode`,e);a={type:`accent`,mode:this.mode,loc:Pg.range(e),label:f,isStretchy:!1,isShifty:!0,base:a}}return a}};Y_.endOfExpression=new Set([`}`,`\\endgroup`,`\\end`,`\\right`,`&`]);var X_=function(e,t){if(!(typeof e==`string`||e instanceof String))throw TypeError(`KaTeX can only parse string typed expression`);var n=new Y_(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 Fg(`\\df@tag`)])}]}return r},Z_=function(e,t,n){t.textContent=``;var r=tv(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.`),Z_=function(){throw new B(`KaTeX doesn't work in quirks mode.`)});var Q_=function(e,t){return tv(e,t).toMarkup()},$_=function(e,t){return X_(e,new Cf(t))},ev=function(e,t,n){if(n.throwOnError||!(e instanceof B))throw e;var r=X([`katex-error`],[new vp(t)]);return r.setAttribute(`title`,e.toString()),r.setAttribute(`style`,`color:`+n.errorColor),r},tv=function(e,t){var n=new Cf(t);try{return yh(X_(e,n),e,n)}catch(t){return ev(t,e,n)}},nv={version:`0.16.45`,render:Z_,renderToString:Q_,ParseError:B,SETTINGS_SCHEMA:xf,__parse:$_,__renderToDomTree:tv,__renderToHTMLTree:function(e,t){var n=new Cf(t);try{return bh(X_(e,n),e,n)}catch(t){return ev(t,e,n)}},__setFontMetrics:Op,__defineSymbol:H,__defineFunction:Z,__defineMacro:$,__domTree:{Span:mp,Anchor:hp,SymbolNode:vp,SvgNode:yp,PathNode:bp,LineNode:xp}},rv={},iv=[];function av(e){let t=e||rv;return function(e,n){uu(e,`element`,function(e,r){let i=Array.isArray(e.properties.className)?e.properties.className:iv,a=i.includes(`language-math`),o=i.includes(`math-display`),s=i.includes(`math-inline`),c=o;if(!a&&!o&&!s)return;let l=r[r.length-1],u=e;if(e.tagName===`code`&&a&&l&&l.type===`element`&&l.tagName===`pre`&&(u=l,l=r[r.length-2],c=!0),!l)return;let d=tf(u,{whitespace:`pre`}),f;try{f=nv.renderToString(d,{...t,displayMode:c,throwOnError:!0})}catch(i){let a=i,o=a.name.toLowerCase();n.message(`Could not render math with KaTeX`,{ancestors:[...r,e],cause:a,place:e.position,ruleId:o,source:`rehype-katex`});try{f=nv.renderToString(d,{...t,displayMode:c,strict:`ignore`,throwOnError:!1})}catch{f=[{type:`element`,tagName:`span`,properties:{className:[`katex-error`],style:`color:`+(t.errorColor||`#cc0000`),title:String(i)},children:[{type:`text`,value:d}]}]}}typeof f==`string`&&(f=Rd(f,{fragment:!0}).children);let p=l.children.indexOf(u);return l.children.splice(p,1,...f),lu})}}function ov(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function sv(e,t,n){let r=eu((n||{}).ignore||[]),i=cv(t),a=-1;for(;++a<i.length;)uu(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function cv(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([lv(e[0]),uv(e[1])])}return t}function lv(e){return typeof e==`string`?new RegExp(ov(e),`g`):e}function uv(e){return typeof e==`function`?e:function(){return e}}function dv(e){sv(e,[/\r?\n|\r/g,fv])}function fv(){return{type:`break`}}function pv(){return function(e){dv(e)}}function mv(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}var hv=`phrasing`,gv=[`autolink`,`link`,`image`,`label`];function _v(){return{transforms:[Tv],enter:{literalAutolink:yv,literalAutolinkEmail:bv,literalAutolinkHttp:bv,literalAutolinkWww:bv},exit:{literalAutolink:wv,literalAutolinkEmail:Cv,literalAutolinkHttp:xv,literalAutolinkWww:Sv}}}function vv(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:hv,notInConstruct:gv},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:hv,notInConstruct:gv},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:hv,notInConstruct:gv}]}}function yv(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function bv(e){this.config.enter.autolinkProtocol.call(this,e)}function xv(e){this.config.exit.autolinkProtocol.call(this,e)}function Sv(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function Cv(e){this.config.exit.autolinkEmail.call(this,e)}function wv(e){this.exit(e)}function Tv(e){sv(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Ev],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Dv]],{ignore:[`link`,`linkReference`]})}function Ev(e,t,n,r,i){let a=``;if(!Av(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!Ov(n)))return!1;let o=kv(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function Dv(e,t,n,r){return!Av(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function Ov(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function kv(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=mv(e,`(`),a=mv(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function Av(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||jo(n)||Ao(n))&&(!t||n!==47)}Bv.peek=zv;function jv(){this.buffer()}function Mv(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function Nv(){this.buffer()}function Pv(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Fv(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=yo(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Iv(e){this.exit(e)}function Lv(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=yo(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Rv(e){this.exit(e)}function zv(){return`[`}function Bv(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function Vv(){return{enter:{gfmFootnoteCallString:jv,gfmFootnoteCall:Mv,gfmFootnoteDefinitionLabelString:Nv,gfmFootnoteDefinition:Pv},exit:{gfmFootnoteCallString:Fv,gfmFootnoteCall:Iv,gfmFootnoteDefinitionLabelString:Lv,gfmFootnoteDefinition:Rv}}}function Hv(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Bv},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
291
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?Wv:Uv))),s(),o}}function Uv(e,t,n){return t===0?e:Wv(e,t,n)}function Wv(e,t,n){return(n?``:` `)+e}var Gv=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];Xv.peek=Zv;function Kv(){return{canContainEols:[`delete`],enter:{strikethrough:Jv},exit:{strikethrough:Yv}}}function qv(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:Gv}],handlers:{delete:Xv}}}function Jv(e){this.enter({type:`delete`,children:[]},e)}function Yv(e){this.exit(e)}function Xv(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function Zv(){return`~`}function Qv(e){return e.length}function $v(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Qv,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=ey(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=ty(r[d]);else{let e=ty(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
292
+ `)}function ey(e){return e==null?``:String(e)}function ty(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function ny(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),ry);return i(),o}function ry(e,t,n){return`>`+(n?``:` `)+e}function iy(e,t){return ay(e,t.inConstruct,!0)&&!ay(e,t.notInConstruct,!1)}function ay(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function oy(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
293
+ `&&iy(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
294
+ `}function sy(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function cy(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function ly(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function uy(e,t,n,r){let i=ly(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(cy(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,dy);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(sy(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
295
+ `,encode:["`"],...s.current()})),t()}return u+=s.move(`
296
+ `),a&&(u+=s.move(a+`
297
+ `)),u+=s.move(c),l(),u}function dy(e,t,n){return(n?``:` `)+e}function fy(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function py(e,t,n,r){let i=fy(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
298
+ `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function my(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function hy(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function gy(e,t,n){let r=Vo(e),i=Vo(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}_y.peek=vy;function _y(e,t,n,r){let i=my(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=gy(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=hy(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=gy(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+hy(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function vy(e,t,n){return n.options.emphasis||`*`}function yy(e,t){let n=!1;return fu(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&ao(e)&&(t.options.setext||n))}function by(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(yy(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
299
+ `,after:`
300
+ `});return r(),t(),o+`
301
+ `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
302
+ `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
303
+ `,...a.current()});return/^[\t ]/.test(l)&&(l=hy(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}xy.peek=Sy;function xy(e){return e.value||``}function Sy(){return`<`}Cy.peek=wy;function Cy(e,t,n,r){let i=fy(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function wy(){return`!`}Ty.peek=Ey;function Ty(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Ey(){return`!`}Dy.peek=Oy;function Dy(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function Oy(){return"`"}function ky(e,t){let n=ao(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Ay.peek=jy;function Ay(e,t,n,r){let i=fy(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(ky(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function jy(e,t,n){return ky(e,n)?`<`:`[`}My.peek=Ny;function My(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Ny(){return`[`}function Py(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Fy(e){let t=Py(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Iy(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Ly(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Ry(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Iy(n):Py(n),s=e.ordered?o===`.`?`)`:`.`:Fy(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),Ly(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function zy(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function By(e,t,n,r){let i=zy(n),a=n.bulletCurrent||Py(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function Vy(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var Hy=eu([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function Uy(e,t,n,r){return(e.children.some(function(e){return Hy(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Wy(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Gy.peek=Ky;function Gy(e,t,n,r){let i=Wy(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=gy(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=hy(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=gy(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+hy(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Ky(e,t,n){return n.options.strong||`*`}function qy(e,t,n,r){return n.safe(e.value,r)}function Jy(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Yy(e,t,n){let r=(Ly(n)+(n.options.ruleSpaces?` `:``)).repeat(Jy(n));return n.options.ruleSpaces?r.slice(0,-1):r}var Xy={blockquote:ny,break:oy,code:uy,definition:py,emphasis:_y,hardBreak:oy,heading:by,html:xy,image:Cy,imageReference:Ty,inlineCode:Dy,link:Ay,linkReference:My,list:Ry,listItem:By,paragraph:Vy,root:Uy,strong:Gy,text:qy,thematicBreak:Yy};function Zy(){return{enter:{table:Qy,tableData:nb,tableHeader:nb,tableRow:eb},exit:{codeText:rb,table:$y,tableData:tb,tableHeader:tb,tableRow:tb}}}function Qy(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function $y(e){this.exit(e),this.data.inTable=void 0}function eb(e){this.enter({type:`tableRow`,children:[]},e)}function tb(e){this.exit(e)}function nb(e){this.enter({type:`tableCell`,children:[]},e)}function rb(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,ib));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function ib(e,t){return t===`|`?t:e}function ab(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
304
+ `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
305
+ `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return $v(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=Xy.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function ob(){return{exit:{taskListCheckValueChecked:cb,taskListCheckValueUnchecked:cb,paragraph:lb}}}function sb(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:ub}}}function cb(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function lb(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function ub(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=Xy.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function db(){return[_v(),Vv(),Kv(),Zy(),ob()]}function fb(e){return{extensions:[vv(),Hv(e),qv(),ab(e),sb()]}}var pb={tokenize:Db,partial:!0},mb={tokenize:Ob,partial:!0},hb={tokenize:kb,partial:!0},gb={tokenize:Ab,partial:!0},_b={tokenize:jb,partial:!0},vb={name:`wwwAutolink`,tokenize:Tb,previous:Mb},yb={name:`protocolAutolink`,tokenize:Eb,previous:Nb},bb={name:`emailAutolink`,tokenize:wb,previous:Pb},xb={};function Sb(){return{text:xb}}for(var Cb=48;Cb<123;)xb[Cb]=bb,Cb++,Cb===58?Cb=65:Cb===91&&(Cb=97);xb[43]=bb,xb[45]=bb,xb[46]=bb,xb[95]=bb,xb[72]=[bb,yb],xb[104]=[bb,yb],xb[87]=[bb,vb],xb[119]=[bb,vb];function wb(e,t,n){let r=this,i,a;return o;function o(t){return!Fb(t)||!Pb.call(r,r.previous)||Ib(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return Fb(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(_b,u,l)(t):t===45||t===95||xo(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&bo(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Tb(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Mb.call(r,r.previous)||Ib(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(pb,e.attempt(mb,e.attempt(hb,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Eb(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&Nb.call(r,r.previous)&&!Ib(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(bo(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||Co(t)||Oo(t)||jo(t)||Ao(t)?n(t):e.attempt(mb,e.attempt(hb,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Db(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function Ob(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(gb,c,s)(t):t===null||Oo(t)||jo(t)||t!==45&&Ao(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function kb(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(gb,t,a)(o):o===null||Oo(o)||jo(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Ab(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||Oo(o)||jo(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||Oo(e)||jo(e)?t(e):r(e)}function a(e){return bo(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):bo(t)?(e.consume(t),o):n(t)}}function jb(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return xo(e)?n(e):t(e)}}function Mb(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Oo(e)}function Nb(e){return!bo(e)}function Pb(e){return!(e===47||Fb(e))}function Fb(e){return e===43||e===45||e===46||e===95||xo(e)}function Ib(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var Lb={tokenize:Gb,partial:!0};function Rb(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:Hb,continuation:{tokenize:Ub},exit:Wb}},text:{91:{name:`gfmFootnoteCall`,tokenize:Vb},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:zb,resolveTo:Bb}}}}function zb(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=yo(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function Bb(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function Vb(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||Oo(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(yo(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return Oo(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function Hb(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||Oo(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=yo(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return Oo(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Po(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function Ub(e,t,n){return e.check(Yo,t,e.attempt(Lb,t,n))}function Wb(e){e.exit(`gfmFootnoteDefinition`)}function Gb(e,t,n){let r=this;return Po(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function Kb(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&fo(o,o.length,0,Ho(s,e.slice(r+1,n),t)),fo(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),fo(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=Vo(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=Vo(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var qb=class{constructor(){this.map=[]}add(e,t,n){Jb(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function Jb(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function Yb(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function Xb(){return{flow:{null:{name:`table`,tokenize:Zb,resolveAll:Qb}}}}function Zb(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):Do(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):ko(t)?Po(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||Oo(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,ko(t)?Po(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return ko(t)?Po(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Do(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return ko(t)?Po(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Do(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Do(n)?(e.exit(`tableRow`),t(n)):ko(n)?Po(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||Oo(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function Qb(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new qb;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(ex(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=$b(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=$b(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=$b(f,t,o,i,n,d)):(o[0]=o[1],d=$b(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&ex(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=Yb(t.events,n))}return e}function $b(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},tx(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=tx(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=tx(t.events,n[2]),a=tx(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},tx(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function ex(e,t,n,r,i){let a=[],o=tx(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function tx(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var nx={name:`tasklistCheck`,tokenize:ix};function rx(){return{text:{91:nx}}}function ix(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return Oo(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Do(r)?t(r):ko(r)?e.check({tokenize:ax},t,n)(r):n(r)}}function ax(e,t,n){return Po(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function ox(e){return ho([Sb(),Rb(),Kb(e),Xb(),rx()])}var sx={};function cx(e){let t=this,n=e||sx,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(ox(n)),a.push(db()),o.push(fb(n))}function lx(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:a},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:s,mathText:o,mathTextData:s}};function e(e){this.enter({type:`math`,meta:null,value:``,data:{hName:`pre`,hChildren:[{type:`element`,tagName:`code`,properties:{className:[`language-math`,`math-display`]},children:[]}]}},e)}function t(){this.buffer()}function n(){let e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.meta=e}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(e){let t=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t;let r=n.data.hChildren[0];r.type,r.tagName,r.children.push({type:`text`,value:t}),this.data.mathFlowInside=void 0}function a(e){this.enter({type:`inlineMath`,value:``,data:{hName:`code`,hProperties:{className:[`language-math`,`math-inline`]},hChildren:[]}},e),this.buffer()}function o(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t,n.data.hChildren.push({type:`text`,value:t})}function s(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}}function ux(e){let t=(e||{}).singleDollarTextMath;return t??=!0,r.peek=i,{unsafe:[{character:`\r`,inConstruct:`mathFlowMeta`},{character:`
306
+ `,inConstruct:`mathFlowMeta`},{character:`$`,after:t?void 0:`\\$`,inConstruct:`phrasing`},{character:`$`,inConstruct:`mathFlowMeta`},{atBreak:!0,character:`$`,after:`\\$`}],handlers:{math:n,inlineMath:r}};function n(e,t,n,r){let i=e.value||``,a=n.createTracker(r),o=`$`.repeat(Math.max(sy(i,`$`)+1,2)),s=n.enter(`mathFlow`),c=a.move(o);if(e.meta){let t=n.enter(`mathFlowMeta`);c+=a.move(n.safe(e.meta,{after:`
307
+ `,before:c,encode:[`$`],...a.current()})),t()}return c+=a.move(`
308
+ `),i&&(c+=a.move(i+`
309
+ `)),c+=a.move(o),s(),c}function r(e,n,r){let i=e.value||``,a=1;for(t||a++;RegExp(`(^|[^$])`+`\\$`.repeat(a)+`([^$]|$)`).test(i);)a++;let o=`$`.repeat(a);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` `+i+` `);let s=-1;for(;++s<r.unsafe.length;){let e=r.unsafe[s];if(!e.atBreak)continue;let t=r.compilePattern(e),n;for(;n=t.exec(i);){let e=n.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=i.slice(0,e)+` `+i.slice(n.index+1)}}return o+i+o}function i(){return`$`}}var dx={tokenize:px,concrete:!0,name:`mathFlow`},fx={tokenize:mx,partial:!0};function px(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){return e.enter(`mathFlow`),e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),c(t)}function c(t){return t===36?(e.consume(t),o++,c):o<2?n(t):(e.exit(`mathFlowFenceSequence`),Po(e,l,`whitespace`)(t))}function l(t){return t===null||Do(t)?d(t):(e.enter(`mathFlowFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===null||Do(t)?(e.exit(`chunkString`),e.exit(`mathFlowFenceMeta`),d(t)):t===36?n(t):(e.consume(t),u)}function d(n){return e.exit(`mathFlowFence`),r.interrupt?t(n):e.attempt(fx,f,g)(n)}function f(t){return e.attempt({tokenize:_,partial:!0},g,p)(t)}function p(t){return(a?Po(e,m,`linePrefix`,a+1):m)(t)}function m(t){return t===null?g(t):Do(t)?e.attempt(fx,f,g)(t):(e.enter(`mathFlowValue`),h(t))}function h(t){return t===null||Do(t)?(e.exit(`mathFlowValue`),m(t)):(e.consume(t),h)}function g(n){return e.exit(`mathFlow`),t(n)}function _(e,t,n){let i=0;return Po(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),s(t)}function s(t){return t===36?(i++,e.consume(t),s):i<o?n(t):(e.exit(`mathFlowFenceSequence`),Po(e,c,`whitespace`)(t))}function c(r){return r===null||Do(r)?(e.exit(`mathFlowFence`),t(r)):n(r)}}}function mx(e,t,n){let r=this;return i;function i(n){return n===null?t(n):(e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function hx(e){let t=(e||{}).singleDollarTextMath;return t??=!0,{tokenize:n,resolve:gx,previous:_x,name:`mathText`};function n(e,n,r){let i=0,a,o;return s;function s(t){return e.enter(`mathText`),e.enter(`mathTextSequence`),c(t)}function c(n){return n===36?(e.consume(n),i++,c):i<2&&!t?r(n):(e.exit(`mathTextSequence`),l(n))}function l(t){return t===null?r(t):t===36?(o=e.enter(`mathTextSequence`),a=0,d(t)):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),l):Do(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),l):(e.enter(`mathTextData`),u(t))}function u(t){return t===null||t===32||t===36||Do(t)?(e.exit(`mathTextData`),l(t)):(e.consume(t),u)}function d(t){return t===36?(e.consume(t),a++,d):a===i?(e.exit(`mathTextSequence`),e.exit(`mathText`),n(t)):(o.type=`mathTextData`,u(t))}}}function gx(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`mathTextData`){e[t][1].type=`mathTextPadding`,e[n][1].type=`mathTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`mathTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function _x(e){return e!==36||this.events[this.events.length-1][1].type===`characterEscape`}function vx(e){return{flow:{36:dx},text:{36:hx(e)}}}var yx={};function bx(e){let t=this,n=e||yx,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(vx(n)),a.push(lx()),o.push(ux(n))}function xx({code:e}){let[t,n]=(0,v.useState)(!1);return(0,L.jsx)(`button`,{type:`button`,onClick:()=>{if(e.length===0)return;let t=()=>{n(!0),window.setTimeout(()=>n(!1),1200)},r=navigator.clipboard?.writeText?.bind(navigator.clipboard);if(r!==void 0){r(e).then(t).catch(i);return}i();function i(){try{let n=document.createElement(`textarea`);n.value=e,n.style.position=`fixed`,n.style.opacity=`0`,document.body.appendChild(n),n.select(),document.execCommand(`copy`),document.body.removeChild(n),t()}catch{}}},className:`absolute right-1 top-1 rounded bg-neutral-800/80 p-1 text-neutral-400 opacity-0 transition-opacity hover:text-neutral-100 group-hover:opacity-100 focus:opacity-100`,title:`Copy code block`,children:t?(0,L.jsx)(ce,{size:12}):(0,L.jsx)(pe,{size:12})})}var Sx={h1:({children:e})=>(0,L.jsx)(`h1`,{className:`mb-1 mt-3 text-base font-semibold first:mt-0`,children:e}),h2:({children:e})=>(0,L.jsx)(`h2`,{className:`mb-1 mt-3 text-sm font-semibold first:mt-0`,children:e}),h3:({children:e})=>(0,L.jsx)(`h3`,{className:`mb-1 mt-2 text-sm font-semibold first:mt-0`,children:e}),h4:({children:e})=>(0,L.jsx)(`h4`,{className:`mb-1 mt-2 text-xs font-semibold first:mt-0`,children:e}),h5:({children:e})=>(0,L.jsx)(`h5`,{className:`mb-1 mt-2 text-xs font-semibold first:mt-0`,children:e}),h6:({children:e})=>(0,L.jsx)(`h6`,{className:`mb-1 mt-2 text-xs font-semibold first:mt-0`,children:e}),p:({children:e})=>(0,L.jsx)(`p`,{className:`my-2 first:mt-0 last:mb-0`,children:e}),ul:({children:e})=>(0,L.jsx)(`ul`,{className:`my-2 ml-5 list-disc space-y-1 first:mt-0`,children:e}),ol:({children:e})=>(0,L.jsx)(`ol`,{className:`my-2 ml-5 list-decimal space-y-1 first:mt-0`,children:e}),li:({children:e})=>(0,L.jsx)(`li`,{className:`leading-snug`,children:e}),blockquote:({children:e})=>(0,L.jsx)(`blockquote`,{className:`my-2 border-l-2 border-neutral-700 pl-3 text-neutral-400`,children:e}),table:({children:e})=>(0,L.jsx)(`div`,{className:`my-2 overflow-x-auto`,children:(0,L.jsx)(`table`,{className:`min-w-full border-collapse text-xs`,children:e})}),th:({children:e})=>(0,L.jsx)(`th`,{className:`border border-neutral-800 px-2 py-1 text-left font-semibold`,children:e}),td:({children:e})=>(0,L.jsx)(`td`,{className:`border border-neutral-800 px-2 py-1 align-top`,children:e}),a:({children:e,href:t})=>(0,L.jsx)(`a`,{href:t,target:`_blank`,rel:`noopener noreferrer`,className:`text-blue-400 underline hover:text-blue-300`,children:e}),hr:()=>(0,L.jsx)(`hr`,{className:`my-3 border-neutral-800`}),strong:({children:e})=>(0,L.jsx)(`strong`,{className:`font-semibold`,children:e}),em:({children:e})=>(0,L.jsx)(`em`,{className:`italic`,children:e}),code:({className:e,children:t,...n})=>{let r=/language-([\w-]+)/.exec(e??``),i=String(t??``).replace(/\n$/,``);if(!(r!==null||i.includes(`
310
+ `)))return(0,L.jsx)(`code`,{className:`rounded bg-neutral-800 px-1 py-0.5 font-mono text-[0.9em] text-neutral-100`,...n,children:t});let a=r?.[1]??`text`;return(0,L.jsxs)(`div`,{className:`group relative`,children:[(0,L.jsx)(xx,{code:i}),(0,L.jsx)(Ci,{code:i,language:a,theme:Kr.vsDark,children:({style:e,tokens:t,getLineProps:n,getTokenProps:r})=>(0,L.jsx)(`pre`,{className:`overflow-x-auto rounded border border-neutral-800 p-2 font-mono text-[12px]`,style:{...e,background:`#0d0d0d`},children:t.map((e,t)=>(0,L.jsx)(`div`,{...n({line:e}),children:e.map((e,t)=>(0,L.jsx)(`span`,{...r({token:e})},t))},t))})})]})},pre:({children:e})=>(0,L.jsx)(L.Fragment,{children:e})};function Cx({text:e,size:t=`sm`,chatStyleBreaks:n=!1}){let r=t===`xs`?`text-xs`:`text-sm`,i=n?[cx,bx,pv]:[cx,bx];return(0,L.jsx)(`div`,{className:`${r} break-words [overflow-wrap:anywhere]`,children:(0,L.jsx)(ud,{remarkPlugins:i,rehypePlugins:[av],components:Sx,children:e})})}function wx({event:e,renderArchived:t}){let[n,r]=(0,v.useState)(!1),i=e.summary.split(`
311
+ `)[0]?.trim()??``,a=i.length>160?i.slice(0,157)+`…`:i,o=new Date(e.timestamp),s=`${o.toLocaleDateString()} ${o.toLocaleTimeString()}`,c=e.archivedMessages.length;return(0,L.jsxs)(`div`,{className:`my-2 rounded-md border border-dashed border-amber-700/50 bg-amber-900/10`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>r(e=>!e),className:`flex w-full items-center gap-2 px-3 py-2 text-left text-xs text-amber-200/90 hover:bg-amber-900/20`,title:n?`Hide archived messages`:`Expand ${c} archived message${c===1?``:`s`}`,children:[n?(0,L.jsx)(le,{size:12}):(0,L.jsx)(ue,{size:12}),(0,L.jsx)(Te,{size:12,className:`text-amber-400`}),(0,L.jsx)(`span`,{className:`flex-1 truncate`,children:a.length>0?a:`Compaction`}),(0,L.jsxs)(`span`,{className:`shrink-0 font-mono text-[10px] text-amber-300/70`,children:[c,` msg · `,e.tokensBefore.toLocaleString(),` tok · `,s]})]}),n&&(0,L.jsxs)(`div`,{className:`border-t border-dashed border-amber-700/50 px-3 py-3`,children:[e.summary.length>0&&(0,L.jsx)(`div`,{className:`mb-3 whitespace-pre-wrap rounded bg-amber-900/15 px-2 py-1 text-[11px] italic text-amber-100/80`,children:e.summary}),(0,L.jsx)(`div`,{className:`space-y-3 opacity-80`,children:t()})]})]})}function Tx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ex(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Tx(Object(n),!0).forEach((function(t){Dx(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tx(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Dx(e,t,n){return(t=function(e){var t=function(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}(e,`string`);return typeof t==`symbol`?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ox(e,t){if(e==null)return{};var n,r,i=function(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function kx(e,t){return Mx(e)||function(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}}(e,t)||Px(e,t)||Ix()}function Ax(e){return Mx(e)||Nx(e)||Px(e)||Ix()}function jx(e){return function(e){if(Array.isArray(e))return Fx(e)}(e)||Nx(e)||Px(e)||function(){throw TypeError(`Invalid attempt to spread non-iterable instance.
312
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Mx(e){if(Array.isArray(e))return e}function Nx(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Px(e,t){if(e){if(typeof e==`string`)return Fx(e,t);var n=Object.prototype.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)?Fx(e,t):void 0}}function Fx(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 Ix(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
313
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Lx(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=Px(e))||t&&e&&typeof e.length==`number`){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
314
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}var Rx=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function zx(e,t){return e(t={exports:{}},t.exports),t.exports}var Bx=zx((function(e){(function(){var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r<arguments.length;r++){var i=arguments[r];if(i){var a=typeof i;if(a===`string`||a===`number`)e.push(i);else if(Array.isArray(i)){if(i.length){var o=n.apply(null,i);o&&e.push(o)}}else if(a===`object`){if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes(`[native code]`)){e.push(i.toString());continue}for(var s in i)t.call(i,s)&&i[s]&&e.push(s)}}}return e.join(` `)}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})),Vx={hunkClassName:``,lineClassName:``,gutterClassName:``,codeClassName:``,monotonous:!1,gutterType:`default`,viewType:`split`,widgets:{},hideGutter:!1,selectedChanges:[],generateAnchorID:function(){},generateLineClassName:function(){},renderGutter:function(e){var t=e.renderDefault;return(0,e.wrapInAnchor)(t())},codeEvents:{},gutterEvents:{}},Hx=(0,v.createContext)(Vx),Ux=Hx.Provider,Wx=function(){return(0,v.useContext)(Hx)},Gx=zx((function(e,t){(function(t){function n(e){var t=e.slice(11),n=null,r=null;switch(t.indexOf(`"`)){case-1:n=(o=t.split(` `))[0].slice(2),r=o[1].slice(2);break;case 0:var i=t.indexOf(`"`,2);n=t.slice(3,i);var a=t.indexOf(`"`,i+1);r=a<0?t.slice(i+4):t.slice(a+3,-1);break;default:var o;n=(o=t.split(` `))[0].slice(2),r=o[1].slice(3,-1)}return{oldPath:n,newPath:r}}e.exports={parse:function(e){for(var t,r,i,a,o,s=[],c=2,l=e.split(`
315
+ `),u=l.length,d=0;d<u;){var f=l[d];if(f.indexOf(`diff --git`)===0){t={hunks:[],oldEndingNewLine:!0,newEndingNewLine:!0,oldPath:(o=n(f)).oldPath,newPath:o.newPath},s.push(t);var p,m=null;simiLoop:for(;p=l[++d];){var h=p.indexOf(` `),g=h>-1?p.slice(0,h):g;switch(g){case`diff`:d--;break simiLoop;case`deleted`:case`new`:var _=p.slice(h+1);_.indexOf(`file mode`)===0&&(t[g===`new`?`newMode`:`oldMode`]=_.slice(10));break;case`similarity`:t.similarity=parseInt(p.split(` `)[2],10);break;case`index`:var v=p.slice(h+1).split(` `),y=v[0].split(`..`);t.oldRevision=y[0],t.newRevision=y[1],v[1]&&(t.oldMode=t.newMode=v[1]);break;case`copy`:case`rename`:var b=p.slice(h+1);b.indexOf(`from`)===0?t.oldPath=b.slice(5):t.newPath=b.slice(3),m=g;break;case`---`:var x=p.slice(h+1),S=l[++d].slice(4);x===`/dev/null`?(S=S.slice(2),m=`add`):S===`/dev/null`?(x=x.slice(2),m=`delete`):(m=`modify`,x=x.slice(2),S=S.slice(2)),x&&(t.oldPath=x),S&&(t.newPath=S),c=5;break simiLoop}}t.type=m||`modify`}else if(f.indexOf(`Binary`)===0)t.isBinary=!0,t.type=f.indexOf(`/dev/null and`)>=0?`add`:f.indexOf(`and /dev/null`)>=0?`delete`:`modify`,c=2,t=null;else if(c===5)if(f.indexOf(`@@`)===0){var C=/^@@\s+-([0-9]+)(,([0-9]+))?\s+\+([0-9]+)(,([0-9]+))?/.exec(f);r={content:f,oldStart:C[1]-0,newStart:C[4]-0,oldLines:C[3]-0||1,newLines:C[6]-0||1,changes:[]},t.hunks.push(r),i=r.oldStart,a=r.newStart}else{var w=f.slice(0,1),T={content:f.slice(1)};switch(w){case`+`:T.type=`insert`,T.isInsert=!0,T.lineNumber=a,a++;break;case`-`:T.type=`delete`,T.isDelete=!0,T.lineNumber=i,i++;break;case` `:T.type=`normal`,T.isNormal=!0,T.oldLineNumber=i,T.newLineNumber=a,i++,a++;break;case`\\`:var E=r.changes[r.changes.length-1];E.isDelete||(t.newEndingNewLine=!1),E.isInsert||(t.oldEndingNewLine=!1)}T.type&&r.changes.push(T)}d++}return s}}})()}));function Kx(e){return e.type===`insert`}function qx(e){return e.type===`delete`}function Jx(e){return e.type===`normal`}function Yx(e,t){var n=t.nearbySequences===`zip`?function(e){return kx(e.reduce((function(e,t,n){var r=kx(e,3),i=r[0],a=r[1],o=r[2];return a?Kx(t)&&o>=0?(i.splice(o+1,0,t),[i,t,o+2]):(i.push(t),[i,t,qx(t)&&qx(a)?o:n]):(i.push(t),[i,t,qx(t)?n:-1])}),[[],null,-1]),1)[0]}(e.changes):e.changes;return Ex(Ex({},e),{},{isPlain:!1,changes:n})}function Xx(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=function(e){if(e.startsWith(`diff --git`))return e;var t=e.indexOf(`
316
+ `),n=e.indexOf(`
317
+ `,t+1),r=e.slice(0,t),i=e.slice(t+1,n),a=r.split(` `).slice(1,-3).join(` `),o=i.split(` `).slice(1,-3).join(` `);return[`diff --git a/${a} b/${o}`,`index 1111111..2222222 100644`,`--- a/${a}`,`+++ b/${o}`,e.slice(n+1)].join(`
318
+ `)}(e.trimStart());return Gx.parse(n).map((function(e){return function(e,t){var n=e.hunks.map((function(e){return Yx(e,t)}));return Ex(Ex({},e),{},{hunks:n})}(e,t)}))}function Zx(e){return e[0]}function Qx(e){return e[e.length-1]}function $x(e){return[`${e}Start`,`${e}Lines`]}function eS(e){return e===`old`?function(e){return Kx(e)?-1:Jx(e)?e.oldLineNumber:e.lineNumber}:function(e){return qx(e)?-1:Jx(e)?e.newLineNumber:e.lineNumber}}function tS(e,t){return function(n,r){var i=n[e],a=i+n[t];return r>=i&&r<a}}function nS(e,t){return function(n,r,i){var a=n[e]+n[t],o=r[e];return i>=a&&i<o}}function rS(e){var t=eS(e),n=function(e){var t=kx($x(e),2),n=tS(t[0],t[1]);return function(e,t){return e.find((function(e){return n(e,t)}))}}(e);return function(e,r){var i=n(e,r);if(i)return i.changes.find((function(e){return t(e)===r}))}}function iS(e){var t=e===`old`?`new`:`old`,n=kx($x(e),2),r=n[0],i=n[1],a=kx($x(t),2),o=a[0],s=a[1],c=eS(e),l=eS(t),u=tS(r,i),d=nS(r,i);return function(e,t){var n=Zx(e);if(t<n[r]){var a=n[r]-t;return n[o]-a}var f=Qx(e);if(f[r]+f[i]<=t){var p=t-f[r]-f[i];return f[o]+f[s]+p}for(var m=0;m<e.length;m++){var h=e[m],g=e[m+1];if(u(h,t)){var _=h.changes.findIndex((function(e){return c(e)===t})),v=h.changes[_];if(Jx(v))return l(v);var y=qx(v)?_+1:_-1,b=h.changes[y];if(!b)return-1;var x=Kx(v)?`delete`:`insert`;return b.type===x?l(b):-1}if(d(h,g,t)){var S=t-h[r]-h[i];return h[o]+h[s]+S}}throw Error(`Unexpected line position ${t}`)}}var aS=function(){this.__data__=[],this.size=0},oS=function(e,t){return e===t||e!=e&&t!=t},sS=function(e,t){for(var n=e.length;n--;)if(oS(e[n][0],t))return n;return-1},cS=Array.prototype.splice,lS=function(e){var t=this.__data__,n=sS(t,e);return!(n<0)&&(n==t.length-1?t.pop():cS.call(t,n,1),--this.size,!0)},uS=function(e){var t=this.__data__,n=sS(t,e);return n<0?void 0:t[n][1]},dS=function(e){return sS(this.__data__,e)>-1},fS=function(e,t){var n=this.__data__,r=sS(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function pS(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}pS.prototype.clear=aS,pS.prototype.delete=lS,pS.prototype.get=uS,pS.prototype.has=dS,pS.prototype.set=fS;var mS=pS,hS=function(){this.__data__=new mS,this.size=0},gS=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},_S=function(e){return this.__data__.get(e)},vS=function(e){return this.__data__.has(e)},yS=typeof Rx==`object`&&Rx&&Rx.Object===Object&&Rx,bS=typeof self==`object`&&self&&self.Object===Object&&self,xS=yS||bS||Function(`return this`)(),SS=xS.Symbol,CS=Object.prototype,wS=CS.hasOwnProperty,TS=CS.toString,ES=SS?SS.toStringTag:void 0,DS=function(e){var t=wS.call(e,ES),n=e[ES];try{e[ES]=void 0;var r=!0}catch{}var i=TS.call(e);return r&&(t?e[ES]=n:delete e[ES]),i},OS=Object.prototype.toString,kS=function(e){return OS.call(e)},AS=SS?SS.toStringTag:void 0,jS=function(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:AS&&AS in Object(e)?DS(e):kS(e)},MS=function(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)},NS=function(e){if(!MS(e))return!1;var t=jS(e);return t==`[object Function]`||t==`[object GeneratorFunction]`||t==`[object AsyncFunction]`||t==`[object Proxy]`},PS=xS[`__core-js_shared__`],FS=function(){var e=/[^.]+$/.exec(PS&&PS.keys&&PS.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}(),IS=function(e){return!!FS&&FS in e},LS=Function.prototype.toString,RS=function(e){if(e!=null){try{return LS.call(e)}catch{}try{return e+``}catch{}}return``},zS=/^\[object .+?Constructor\]$/,BS=Function.prototype,VS=Object.prototype,HS=BS.toString,US=VS.hasOwnProperty,WS=RegExp(`^`+HS.call(US).replace(/[\\^$.*+?()[\]{}|]/g,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`),GS=function(e){return!(!MS(e)||IS(e))&&(NS(e)?WS:zS).test(RS(e))},KS=function(e,t){return e?.[t]},qS=function(e,t){var n=KS(e,t);return GS(n)?n:void 0},JS=qS(xS,`Map`),YS=qS(Object,`create`),XS=function(){this.__data__=YS?YS(null):{},this.size=0},ZS=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t},QS=Object.prototype.hasOwnProperty,$S=function(e){var t=this.__data__;if(YS){var n=t[e];return n===`__lodash_hash_undefined__`?void 0:n}return QS.call(t,e)?t[e]:void 0},eC=Object.prototype.hasOwnProperty,tC=function(e){var t=this.__data__;return YS?t[e]!==void 0:eC.call(t,e)},nC=function(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=YS&&t===void 0?`__lodash_hash_undefined__`:t,this};function rC(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}rC.prototype.clear=XS,rC.prototype.delete=ZS,rC.prototype.get=$S,rC.prototype.has=tC,rC.prototype.set=nC;var iC=rC,aC=function(){this.size=0,this.__data__={hash:new iC,map:new(JS||mS),string:new iC}},oC=function(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null},sC=function(e,t){var n=e.__data__;return oC(t)?n[typeof t==`string`?`string`:`hash`]:n.map},cC=function(e){var t=sC(this,e).delete(e);return this.size-=+!!t,t},lC=function(e){return sC(this,e).get(e)},uC=function(e){return sC(this,e).has(e)},dC=function(e,t){var n=sC(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function fC(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}fC.prototype.clear=aC,fC.prototype.delete=cC,fC.prototype.get=lC,fC.prototype.has=uC,fC.prototype.set=dC;var pC=fC,mC=function(e,t){var n=this.__data__;if(n instanceof mS){var r=n.__data__;if(!JS||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new pC(r)}return n.set(e,t),this.size=n.size,this};function hC(e){var t=this.__data__=new mS(e);this.size=t.size}hC.prototype.clear=hS,hC.prototype.delete=gS,hC.prototype.get=_S,hC.prototype.has=vS,hC.prototype.set=mC;var gC=hC,_C=function(e){return this.__data__.set(e,`__lodash_hash_undefined__`),this},vC=function(e){return this.__data__.has(e)};function yC(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new pC;++t<n;)this.add(e[t])}yC.prototype.add=yC.prototype.push=_C,yC.prototype.has=vC;var bC=yC,xC=function(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},SC=function(e,t){return e.has(t)},CC=function(e,t,n,r,i,a){var o=1&n,s=e.length,c=t.length;if(s!=c&&!(o&&c>s))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var d=-1,f=!0,p=2&n?new bC:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var m=e[d],h=t[d];if(r)var g=o?r(h,m,d,t,e,a):r(m,h,d,e,t,a);if(g!==void 0){if(g)continue;f=!1;break}if(p){if(!xC(t,(function(e,t){if(!SC(p,t)&&(m===e||i(m,e,n,r,a)))return p.push(t)}))){f=!1;break}}else if(m!==h&&!i(m,h,n,r,a)){f=!1;break}}return a.delete(e),a.delete(t),f},wC=xS.Uint8Array,TC=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n},EC=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n},DC=SS?SS.prototype:void 0,OC=DC?DC.valueOf:void 0,kC=function(e,t,n,r,i,a,o){switch(n){case`[object DataView]`:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case`[object ArrayBuffer]`:return!(e.byteLength!=t.byteLength||!a(new wC(e),new wC(t)));case`[object Boolean]`:case`[object Date]`:case`[object Number]`:return oS(+e,+t);case`[object Error]`:return e.name==t.name&&e.message==t.message;case`[object RegExp]`:case`[object String]`:return e==t+``;case`[object Map]`:var s=TC;case`[object Set]`:var c=1&r;if(s||=EC,e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=2,o.set(e,t);var u=CC(s(e),s(t),r,i,a,o);return o.delete(e),u;case`[object Symbol]`:if(OC)return OC.call(e)==OC.call(t)}return!1},AC=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e},jC=Array.isArray,MC=function(e,t,n){var r=t(e);return jC(e)?r:AC(r,n(e))},NC=function(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a},PC=function(){return[]},FC=Object.prototype.propertyIsEnumerable,IC=Object.getOwnPropertySymbols,LC=IC?function(e){return e==null?[]:(e=Object(e),NC(IC(e),(function(t){return FC.call(e,t)})))}:PC,RC=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r},zC=function(e){return typeof e==`object`&&!!e},BC=function(e){return zC(e)&&jS(e)==`[object Arguments]`},VC=Object.prototype,HC=VC.hasOwnProperty,UC=VC.propertyIsEnumerable,WC=BC(function(){return arguments}())?BC:function(e){return zC(e)&&HC.call(e,`callee`)&&!UC.call(e,`callee`)},GC=function(){return!1},KC=zx((function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,i=r&&r.exports===n?xS.Buffer:void 0;e.exports=(i?i.isBuffer:void 0)||GC})),qC=/^(?:0|[1-9]\d*)$/,JC=function(e,t){var n=typeof e;return!!(t??=9007199254740991)&&(n==`number`||n!=`symbol`&&qC.test(e))&&e>-1&&e%1==0&&e<t},YC=function(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=9007199254740991},XC={};XC[`[object Float32Array]`]=XC[`[object Float64Array]`]=XC[`[object Int8Array]`]=XC[`[object Int16Array]`]=XC[`[object Int32Array]`]=XC[`[object Uint8Array]`]=XC[`[object Uint8ClampedArray]`]=XC[`[object Uint16Array]`]=XC[`[object Uint32Array]`]=!0,XC[`[object Arguments]`]=XC[`[object Array]`]=XC[`[object ArrayBuffer]`]=XC[`[object Boolean]`]=XC[`[object DataView]`]=XC[`[object Date]`]=XC[`[object Error]`]=XC[`[object Function]`]=XC[`[object Map]`]=XC[`[object Number]`]=XC[`[object Object]`]=XC[`[object RegExp]`]=XC[`[object Set]`]=XC[`[object String]`]=XC[`[object WeakMap]`]=!1;var ZC=function(e){return zC(e)&&YC(e.length)&&!!XC[jS(e)]},QC=function(e){return function(t){return e(t)}},$C=zx((function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,i=r&&r.exports===n&&yS.process;e.exports=function(){try{return r&&r.require&&r.require(`util`).types||i&&i.binding&&i.binding(`util`)}catch{}}()})),ew=$C&&$C.isTypedArray,tw=ew?QC(ew):ZC,nw=Object.prototype.hasOwnProperty,rw=function(e,t){var n=jC(e),r=!n&&WC(e),i=!n&&!r&&KC(e),a=!n&&!r&&!i&&tw(e),o=n||r||i||a,s=o?RC(e.length,String):[],c=s.length;for(var l in e)!t&&!nw.call(e,l)||o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||JC(l,c))||s.push(l);return s},iw=Object.prototype,aw=function(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||iw)},ow=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),sw=Object.prototype.hasOwnProperty,cw=function(e){if(!aw(e))return ow(e);var t=[];for(var n in Object(e))sw.call(e,n)&&n!=`constructor`&&t.push(n);return t},lw=function(e){return e!=null&&YC(e.length)&&!NS(e)},uw=function(e){return lw(e)?rw(e):cw(e)},dw=function(e){return MC(e,uw,LC)},fw=Object.prototype.hasOwnProperty,pw=function(e,t,n,r,i,a){var o=1&n,s=dw(e),c=s.length;if(c!=dw(t).length&&!o)return!1;for(var l=c;l--;){var u=s[l];if(!(o?u in t:fw.call(t,u)))return!1}var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var m=o;++l<c;){var h=e[u=s[l]],g=t[u];if(r)var _=o?r(g,h,u,t,e,a):r(h,g,u,e,t,a);if(!(_===void 0?h===g||i(h,g,n,r,a):_)){p=!1;break}m||=u==`constructor`}if(p&&!m){var v=e.constructor,y=t.constructor;v==y||!(`constructor`in e)||!(`constructor`in t)||typeof v==`function`&&v instanceof v&&typeof y==`function`&&y instanceof y||(p=!1)}return a.delete(e),a.delete(t),p},mw=qS(xS,`DataView`),hw=qS(xS,`Promise`),gw=qS(xS,`Set`),_w=qS(xS,`WeakMap`),vw=RS(mw),yw=RS(JS),bw=RS(hw),xw=RS(gw),Sw=RS(_w),Cw=jS;(mw&&Cw(new mw(new ArrayBuffer(1)))!=`[object DataView]`||JS&&Cw(new JS)!=`[object Map]`||hw&&Cw(hw.resolve())!=`[object Promise]`||gw&&Cw(new gw)!=`[object Set]`||_w&&Cw(new _w)!=`[object WeakMap]`)&&(Cw=function(e){var t=jS(e),n=t==`[object Object]`?e.constructor:void 0,r=n?RS(n):``;if(r)switch(r){case vw:return`[object DataView]`;case yw:return`[object Map]`;case bw:return`[object Promise]`;case xw:return`[object Set]`;case Sw:return`[object WeakMap]`}return t});var ww=Cw,Tw=`[object Object]`,Ew=Object.prototype.hasOwnProperty,Dw=function(e,t,n,r,i,a){var o=jC(e),s=jC(t),c=o?`[object Array]`:ww(e),l=s?`[object Array]`:ww(t),u=(c=c==`[object Arguments]`?Tw:c)==Tw,d=(l=l==`[object Arguments]`?Tw:l)==Tw,f=c==l;if(f&&KC(e)){if(!KC(t))return!1;o=!0,u=!1}if(f&&!u)return a||=new gC,o||tw(e)?CC(e,t,n,r,i,a):kC(e,t,c,n,r,i,a);if(!(1&n)){var p=u&&Ew.call(e,`__wrapped__`),m=d&&Ew.call(t,`__wrapped__`);if(p||m){var h=p?e.value():e,g=m?t.value():t;return a||=new gC,i(h,g,n,r,a)}}return!!f&&(a||=new gC,pw(e,t,n,r,i,a))},Ow=function e(t,n,r,i,a){return t===n||(t==null||n==null||!zC(t)&&!zC(n)?t!=t&&n!=n:Dw(t,n,r,i,e,a))},kw=function(e,t,n,r){var i=n.length,a=i,o=!r;if(e==null)return!a;for(e=Object(e);i--;){var s=n[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){var c=(s=n[i])[0],l=e[c],u=s[1];if(o&&s[2]){if(l===void 0&&!(c in e))return!1}else{var d=new gC;if(r)var f=r(l,u,c,e,t,d);if(!(f===void 0?Ow(u,l,3,r,d):f))return!1}}return!0},Aw=function(e){return e==e&&!MS(e)},jw=function(e){for(var t=uw(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,Aw(i)]}return t},Mw=function(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}},Nw=function(e){var t=jw(e);return t.length==1&&t[0][2]?Mw(t[0][0],t[0][1]):function(n){return n===e||kw(n,e,t)}},Pw=function(e){return typeof e==`symbol`||zC(e)&&jS(e)==`[object Symbol]`},Fw=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Iw=/^\w*$/,Lw=function(e,t){if(jC(e))return!1;var n=typeof e;return!(n!=`number`&&n!=`symbol`&&n!=`boolean`&&e!=null&&!Pw(e))||Iw.test(e)||!Fw.test(e)||t!=null&&e in Object(t)};function Rw(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(`Expected a function`);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(Rw.Cache||pC),n}Rw.Cache=pC;var zw=Rw,Bw=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Vw=/\\(\\)?/g,Hw=function(e){var t=zw(e,(function(e){return n.size===500&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(Bw,(function(e,n,r,i){t.push(r?i.replace(Vw,`$1`):n||e)})),t})),Uw=function(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i},Ww=SS?SS.prototype:void 0,Gw=Ww?Ww.toString:void 0,Kw=function e(t){if(typeof t==`string`)return t;if(jC(t))return Uw(t,e)+``;if(Pw(t))return Gw?Gw.call(t):``;var n=t+``;return n==`0`&&1/t==-1/0?`-0`:n},qw=function(e){return e==null?``:Kw(e)},Jw=function(e,t){return jC(e)?e:Lw(e,t)?[e]:Hw(qw(e))},Yw=function(e){if(typeof e==`string`||Pw(e))return e;var t=e+``;return t==`0`&&1/e==-1/0?`-0`:t},Xw=function(e,t){for(var n=0,r=(t=Jw(t,e)).length;e!=null&&n<r;)e=e[Yw(t[n++])];return n&&n==r?e:void 0},Zw=function(e,t,n){var r=e==null?void 0:Xw(e,t);return r===void 0?n:r},Qw=function(e,t){return e!=null&&t in Object(e)},$w=function(e,t,n){for(var r=-1,i=(t=Jw(t,e)).length,a=!1;++r<i;){var o=Yw(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:!!(i=e==null?0:e.length)&&YC(i)&&JC(o,i)&&(jC(e)||WC(e))},eT=function(e,t){return e!=null&&$w(e,t,Qw)},tT=function(e,t){return Lw(e)&&Aw(t)?Mw(Yw(e),t):function(n){var r=Zw(n,e);return r===void 0&&r===t?eT(n,e):Ow(t,r,3)}},nT=function(e){return e},rT=function(e){return function(t){return t?.[e]}},iT=function(e){return function(t){return Xw(t,e)}},aT=function(e){return Lw(e)?rT(Yw(e)):iT(e)},oT=function(e){return typeof e==`function`?e:e==null?nT:typeof e==`object`?jC(e)?tT(e[0],e[1]):Nw(e):aT(e)};function sT(e){if(!e)throw Error(`change is not provided`);return Jx(e)?`N${e.oldLineNumber}`:`${Kx(e)?`I`:`D`}${e.lineNumber}`}iS(`old`);var cT=eS(`old`),lT=eS(`new`);rS(`old`),rS(`new`),iS(`new`),iS(`old`);var uT=function(){try{var e=qS(Object,`defineProperty`);return e({},``,{}),e}catch{}}(),dT=function(e,t,n){t==`__proto__`&&uT?uT(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},fT=function(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(!1===n(a[c],c,a))break}return t}}(),pT=function(e,t){return e&&fT(e,t,uw)},mT=function(e,t){var n={};return t=oT(t),pT(e,(function(e,r,i){dT(n,r,t(e,r,i))})),n},hT=[`changeKey`,`text`,`tokens`,`renderToken`],gT=function e(t,n){var r=t.type,i=t.value,a=t.markType,o=t.properties,s=t.className,c=t.children,l=function(t){return(0,L.jsx)(`span`,{className:t,children:i||c&&c.map(e)},n)};switch(r){case`text`:return i;case`mark`:return l(`diff-code-mark diff-code-mark-${a}`);case`edit`:return l(`diff-code-edit`);default:var u=o&&o.className;return l(Bx(s||u))}};function _T(e){if(!Array.isArray(e))return!0;if(e.length>1)return!1;if(e.length===1){var t=kx(e,1)[0];return t.type===`text`&&!t.value}return!0}function vT(e){var t=e.changeKey,n=e.text,r=e.tokens,i=e.renderToken,a=Ox(e,hT),o=i?function(e,t){return i(e,gT,t)}:gT;return(0,L.jsx)(`td`,Ex(Ex({},a),{},{"data-change-key":t,children:r?_T(r)?` `:r.map(o):n||` `}))}var yT=(0,v.memo)(vT);function bT(e,t){return function(){var n=t===`old`?cT(e):lT(e);return n===-1?void 0:n}}function xT(e,t){return function(n){return e&&n?(0,L.jsx)(`a`,{href:t?`#`+t:void 0,children:n}):n}}function ST(e,t){return t?function(n){e(),t(n)}:e}function CT(e,t,n,r){return(0,v.useMemo)((function(){var i=mT(e,(function(e){return function(n){return e&&e(t,n)}}));return i.onMouseEnter=ST(n,i.onMouseEnter),i.onMouseLeave=ST(r,i.onMouseLeave),i}),[e,n,r,t])}function wT(e,t,n,r,i,a,o,s,c){var l={change:t,side:r,inHoverState:s,renderDefault:bT(t,r),wrapInAnchor:xT(i,a)};return(0,L.jsx)(`td`,Ex(Ex({className:e},o),{},{"data-change-key":n,children:c(l)}))}function TT(e){var t,n,r,i=e.change,a=e.selected,o=e.tokens,s=e.className,c=e.generateLineClassName,l=e.gutterClassName,u=e.codeClassName,d=e.gutterEvents,f=e.codeEvents,p=e.hideGutter,m=e.gutterAnchor,h=e.generateAnchorID,g=e.renderToken,_=e.renderGutter,y=i.type,b=i.content,x=sT(i),S=kx((t=kx((0,v.useState)(!1),2),n=t[0],r=t[1],[n,(0,v.useCallback)((function(){return r(!0)}),[]),(0,v.useCallback)((function(){return r(!1)}),[])]),3),C=S[0],w=S[1],T=S[2],E=(0,v.useMemo)((function(){return{change:i}}),[i]),D=CT(d,E,w,T),O=CT(f,E,w,T),ee=h(i),te=c({changes:[i],defaultGenerate:function(){return s}}),ne=Bx(`diff-gutter`,`diff-gutter-${y}`,l,{"diff-gutter-selected":a}),re=Bx(`diff-code`,`diff-code-${y}`,u,{"diff-code-selected":a});return(0,L.jsxs)(`tr`,{id:ee,className:Bx(`diff-line`,te),children:[!p&&wT(ne,i,x,`old`,m,ee,D,C,_),!p&&wT(ne,i,x,`new`,m,ee,D,C,_),(0,L.jsx)(yT,Ex({className:re,changeKey:x,text:b,tokens:o,renderToken:g},O))]})}var ET=(0,v.memo)(TT);function DT(e){var t=e.hideGutter,n=e.element;return(0,L.jsx)(`tr`,{className:`diff-widget`,children:(0,L.jsx)(`td`,{colSpan:t?1:3,className:`diff-widget-content`,children:n})})}var OT=[`hideGutter`,`selectedChanges`,`tokens`,`lineClassName`],kT=[`hunk`,`widgets`,`className`];function AT(e){var t=e.hunk,n=e.widgets,r=e.className,i=Ox(e,kT),a=function(e,t){return e.reduce((function(e,n){var r=sT(n);e.push([`change`,r,n]);var i=t[r];return i&&e.push([`widget`,r,i]),e}),[])}(t.changes,n);return(0,L.jsx)(`tbody`,{className:Bx(`diff-hunk`,r),children:a.map((function(e){return function(e,t){var n=kx(e,3),r=n[0],i=n[1],a=n[2],o=t.hideGutter,s=t.selectedChanges,c=t.tokens,l=t.lineClassName,u=Ox(t,OT);if(r===`change`){var d=qx(a)?`old`:`new`,f=qx(a)?cT(a):lT(a),p=c?c[d][f-1]:null;return(0,L.jsx)(ET,Ex({className:l,change:a,hideGutter:o,selected:s.includes(i),tokens:p},u),`change${i}`)}return r===`widget`?(0,L.jsx)(DT,{hideGutter:o,element:a},`widget${i}`):null}(e,i)}))})}var jT=0;function MT(e,t,n,r){var i=(0,v.useCallback)((function(){return t(e)}),[e,t]),a=(0,v.useCallback)((function(){return t(``)}),[t]);return(0,v.useMemo)((function(){var t=mT(r,(function(t){return function(r){return t&&t({side:e,change:n},r)}}));return t.onMouseEnter=ST(i,t.onMouseEnter),t.onMouseLeave=ST(a,t.onMouseLeave),t}),[n,r,i,e,a])}function NT(e){var t=e.change,n=e.side,r=e.selected,i=e.tokens,a=e.gutterClassName,o=e.codeClassName,s=e.gutterEvents,c=e.codeEvents,l=e.anchorID,u=e.gutterAnchor,d=e.gutterAnchorTarget,f=e.hideGutter,p=e.hover,m=e.renderToken,h=e.renderGutter;if(!t){var g=Bx(`diff-gutter`,`diff-gutter-omit`,a),_=Bx(`diff-code`,`diff-code-omit`,o);return[!f&&(0,L.jsx)(`td`,{className:g},`gutter`),(0,L.jsx)(`td`,{className:_},`code`)]}var v=t.type,y=t.content,b=sT(t),x=n===jT?`old`:`new`,S=Ex({id:l||void 0,className:Bx(`diff-gutter`,`diff-gutter-${v}`,Dx({"diff-gutter-selected":r},`diff-line-hover-`+x,p),a),children:h({change:t,side:x,inHoverState:p,renderDefault:bT(t,x),wrapInAnchor:xT(u,d)})},s),C=Bx(`diff-code`,`diff-code-${v}`,Dx({"diff-code-selected":r},`diff-line-hover-`+x,p),o);return[!f&&(0,L.jsx)(`td`,Ex(Ex({},S),{},{"data-change-key":b}),`gutter`),(0,L.jsx)(yT,Ex({className:C,changeKey:b,text:y,tokens:i,renderToken:m},c),`code`)]}function PT(e){var t=e.className,n=e.oldChange,r=e.newChange,i=e.oldSelected,a=e.newSelected,o=e.oldTokens,s=e.newTokens,c=e.monotonous,l=e.gutterClassName,u=e.codeClassName,d=e.gutterEvents,f=e.codeEvents,p=e.hideGutter,m=e.generateAnchorID,h=e.generateLineClassName,g=e.gutterAnchor,_=e.renderToken,y=e.renderGutter,b=kx((0,v.useState)(``),2),x=b[0],S=b[1],C=MT(`old`,S,n,d),w=MT(`new`,S,r,d),T=MT(`old`,S,n,f),E=MT(`new`,S,r,f),D=n&&m(n),O=r&&m(r),ee=h({changes:[n,r],defaultGenerate:function(){return t}}),te={monotonous:c,hideGutter:p,gutterClassName:l,codeClassName:u,gutterEvents:d,codeEvents:f,renderToken:_,renderGutter:y},ne=Ex(Ex({},te),{},{change:n,side:jT,selected:i,tokens:o,gutterEvents:C,codeEvents:T,anchorID:D,gutterAnchor:g,gutterAnchorTarget:D,hover:x===`old`}),re=Ex(Ex({},te),{},{change:r,side:1,selected:a,tokens:s,gutterEvents:w,codeEvents:E,anchorID:n===r?null:O,gutterAnchor:g,gutterAnchorTarget:n===r?D:O,hover:x===`new`});return c?(0,L.jsx)(`tr`,{className:Bx(`diff-line`,ee),children:NT(n?ne:re)}):(0,L.jsxs)(`tr`,{className:Bx(`diff-line`,function(e,t){return e&&!t?`diff-line-old-only`:!e&&t?`diff-line-new-only`:e===t?`diff-line-normal`:`diff-line-compare`}(n,r),ee),children:[NT(ne),NT(re)]})}var FT=(0,v.memo)(PT);function IT(e){var t=e.hideGutter,n=e.oldElement,r=e.newElement;return e.monotonous?(0,L.jsx)(`tr`,{className:`diff-widget`,children:(0,L.jsx)(`td`,{colSpan:t?1:2,className:`diff-widget-content`,children:n||r})}):n===r?(0,L.jsx)(`tr`,{className:`diff-widget`,children:(0,L.jsx)(`td`,{colSpan:t?2:4,className:`diff-widget-content`,children:n})}):(0,L.jsxs)(`tr`,{className:`diff-widget`,children:[(0,L.jsx)(`td`,{colSpan:t?1:2,className:`diff-widget-content`,children:n}),(0,L.jsx)(`td`,{colSpan:t?1:2,className:`diff-widget-content`,children:r})]})}var LT=[`selectedChanges`,`monotonous`,`hideGutter`,`tokens`,`lineClassName`],RT=[`hunk`,`widgets`,`className`];function zT(e,t){return(e?sT(e):`00`)+(t?sT(t):`00`)}function BT(e){var t=e.hunk,n=e.widgets,r=e.className,i=Ox(e,RT),a=function(e,t){for(var n=function(e){return e&&t[sT(e)]||null},r=[],i=0;i<e.length;i++){var a=e[i];if(Jx(a))r.push([`change`,zT(a,a),a,a]);else if(qx(a)){var o=e[i+1];o&&Kx(o)?(i+=1,r.push([`change`,zT(a,o),a,o])):r.push([`change`,zT(a,null),a,null])}else r.push([`change`,zT(null,a),null,a]);var s=r[r.length-1],c=n(s[2]),l=n(s[3]);if(c||l){var u=s[1];r.push([`widget`,u,c,l])}}return r}(t.changes,n);return(0,L.jsx)(`tbody`,{className:Bx(`diff-hunk`,r),children:a.map((function(e){return function(e,t){var n=kx(e,4),r=n[0],i=n[1],a=n[2],o=n[3],s=t.selectedChanges,c=t.monotonous,l=t.hideGutter,u=t.tokens,d=t.lineClassName,f=Ox(t,LT);return r===`change`?(0,L.jsx)(FT,Ex({className:d,oldChange:a,newChange:o,monotonous:c,hideGutter:l,oldSelected:!!a&&s.includes(sT(a)),newSelected:!!o&&s.includes(sT(o)),oldTokens:a&&u?u.old[cT(a)-1]:null,newTokens:o&&u?u.new[lT(o)-1]:null},f),`change${i}`):r===`widget`?(0,L.jsx)(IT,{monotonous:c,hideGutter:l,oldElement:a,newElement:o},`widget${i}`):null}(e,i)}))})}var VT=[`gutterType`,`hunkClassName`];function HT(e){var t=e.hunk,n=Wx(),r=n.gutterType,i=n.hunkClassName,a=Ox(n,VT),o=r===`none`,s=r===`anchor`;return(0,L.jsx)(a.viewType===`unified`?AT:BT,Ex(Ex({},a),{},{hunk:t,hideGutter:o,gutterAnchor:s,className:i}))}function UT(){}function WT(e,t){var n=t?`auto`:`none`;e instanceof HTMLElement&&e.style.userSelect!==n&&(e.style.userSelect=n)}function GT(e){return e.map((function(e){return(0,L.jsx)(HT,{hunk:e},function(e){return`-${e.oldStart},${e.oldLines} +${e.newStart},${e.newLines}`}(e))}))}function KT(e){var t=e.diffType,n=e.hunks,r=e.optimizeSelection,i=e.className,a=e.hunkClassName,o=a===void 0?Vx.hunkClassName:a,s=e.lineClassName,c=s===void 0?Vx.lineClassName:s,l=e.generateLineClassName,u=l===void 0?Vx.generateLineClassName:l,d=e.gutterClassName,f=d===void 0?Vx.gutterClassName:d,p=e.codeClassName,m=p===void 0?Vx.codeClassName:p,h=e.gutterType,g=h===void 0?Vx.gutterType:h,_=e.viewType,y=_===void 0?Vx.viewType:_,b=e.gutterEvents,x=b===void 0?Vx.gutterEvents:b,S=e.codeEvents,C=S===void 0?Vx.codeEvents:S,w=e.generateAnchorID,T=w===void 0?Vx.generateAnchorID:w,E=e.selectedChanges,D=E===void 0?Vx.selectedChanges:E,O=e.widgets,ee=O===void 0?Vx.widgets:O,te=e.renderGutter,ne=te===void 0?Vx.renderGutter:te,re=e.tokens,k=e.renderToken,ie=e.children,ae=ie===void 0?GT:ie,A=(0,v.useRef)(null),oe=(0,v.useCallback)((function(e){var t=e.target;if(e.button===0){var n=function(e,t){for(var n=e;n&&n!==document.documentElement&&!n.classList.contains(t);)n=n.parentElement;return n===document.documentElement?null:n}(t,`diff-code`);if(n&&n.parentElement){var r=window.getSelection();r&&r.removeAllRanges();var i=jx(n.parentElement.children).indexOf(n);if(i===1||i===3){var a,o=Lx(A.current?A.current.querySelectorAll(`.diff-line`):[]);try{for(o.s();!(a=o.n()).done;){var s=a.value.children;WT(s[1],i===1),WT(s[3],i===3)}}catch(e){o.e(e)}finally{o.f()}}}}}),[]),j=g===`none`,se=t===`add`||t===`delete`,ce=y===`split`&&!se&&r?oe:UT,le=(0,v.useMemo)((function(){return(0,L.jsxs)(`colgroup`,y===`unified`?{children:[!j&&(0,L.jsx)(`col`,{className:`diff-gutter-col`}),!j&&(0,L.jsx)(`col`,{className:`diff-gutter-col`}),(0,L.jsx)(`col`,{})]}:se?{children:[!j&&(0,L.jsx)(`col`,{className:`diff-gutter-col`}),(0,L.jsx)(`col`,{})]}:{children:[!j&&(0,L.jsx)(`col`,{className:`diff-gutter-col`}),(0,L.jsx)(`col`,{}),!j&&(0,L.jsx)(`col`,{className:`diff-gutter-col`}),(0,L.jsx)(`col`,{})]})}),[y,se,j]);return(0,L.jsx)(Ux,{value:(0,v.useMemo)((function(){return{hunkClassName:o,lineClassName:c,generateLineClassName:u,gutterClassName:f,codeClassName:m,monotonous:se,hideGutter:j,viewType:y,gutterType:g,codeEvents:C,gutterEvents:x,generateAnchorID:T,selectedChanges:D,widgets:ee,renderGutter:ne,tokens:re,renderToken:k}}),[m,C,T,f,x,g,j,o,c,u,se,ne,k,D,re,y,ee]),children:(0,L.jsxs)(`table`,{ref:A,className:Bx(`diff`,`diff-${y}`,i),onMouseDown:ce,children:[le,ae(n)]})})}var qT=(0,v.memo)(KT),JT=function(e,t,n,r){for(var i=-1,a=e==null?0:e.length;++i<a;){var o=e[i];t(r,o,n(o),e)}return r},YT=function(e,t){return function(n,r){if(n==null)return n;if(!lw(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&!1!==r(o[a],a,o););return n}}(pT),XT=function(e,t,n,r){return YT(e,(function(e,i,a){t(r,e,n(e),a)})),r},ZT=function(e,t){return function(n,r){var i=jC(n)?JT:XT,a=t?t():{};return i(n,e,oT(r),a)}}((function(e,t,n){dT(e,n,t)})),QT=SS?SS.isConcatSpreadable:void 0,$T=function(e){return jC(e)||WC(e)||!!(QT&&e&&e[QT])},eE=function e(t,n,r,i,a){var o=-1,s=t.length;for(r||=$T,a||=[];++o<s;){var c=t[o];n>0&&r(c)?n>1?e(c,n-1,r,i,a):AC(a,c):i||(a[a.length]=c)}return a},tE=function(e,t){var n=-1,r=lw(e)?Array(e.length):[];return YT(e,(function(e,i,a){r[++n]=t(e,i,a)})),r},nE=function(e,t){return(jC(e)?Uw:tE)(e,oT(t))},rE=function(e,t){return eE(nE(e,t),1)};function iE(e,t){var n=t.newStart;return kx(t.changes.reduce((function(e,t){var n=kx(e,2),r=n[0],i=n[1];return qx(t)?(r.splice(i,1),[r,i]):(Kx(t)&&r.splice(i,0,t.content),[r,i+1])}),[e,n-1]),1)[0]}function aE(e,t,n){if(!e.length)return[];var r=t===`old`?cT:lT,i=ZT(e,r),a=r(e[e.length-1]);return Array.from({length:a}).map((function(e,t){return n(i[t+1])}))}function oE(e){var t=kx(function(e){return rE(e,(function(e){return e.changes})).reduce((function(e,t){var n=kx(e,2),r=n[0],i=n[1];return Jx(t)?(r.push(t),i.push(t)):qx(t)?r.push(t):i.push(t),[r,i]}),[[],[]])}(e),2),n=t[0],r=t[1],i=function(e){return e?e.content:``};return[aE(n,`old`,i).join(`
319
+ `),aE(r,`new`,i).join(`
320
+ `)]}function sE(e){return{type:`root`,children:e}}function cE(e,t){if(t.oldSource){var n=function(e,t){return t.reduce(iE,e.split(`
321
+ `)).join(`
322
+ `)}(t.oldSource,e),r=t.highlight?function(e){return t.refractor.highlight(e,t.language)}:function(e){return[{type:`text`,value:e}]};return[sE(r(t.oldSource)),sE(r(n))]}var i=kx(oE(e),2),a=i[0],o=i[1],s=t.highlight?function(e){return sE(t.refractor.highlight(e,t.language))}:function(e){return sE([{type:`text`,value:e}])};return[s(a),s(o)]}function lE(e){return e.map((function(e){return Ex({},e)}))}function uE(e,t){return[].concat(jx(lE(e.slice(0,-1))),[t])}function dE(e){return e.type===`text`}function fE(e){var t=e[e.length-1];if(dE(t))return t;throw Error(`Invalid token path with leaf of type ${t.type}`)}var pE=[`children`];function mE(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(e.children){var r=e.children,i=Ox(e,pE);n.push(i);var a,o=Lx(r);try{for(o.s();!(a=o.n()).done;)mE(a.value,t,n)}catch(e){o.e(e)}finally{o.f()}n.pop()}else t.push(lE([].concat(jx(n.slice(1)),[e])));return t}function hE(e){return e.reduce((function(e,t){var n=e[e.length-1],r=Ax(function(e){var t=fE(e);return t.value.includes(`
323
+ `)?t.value.split(`
324
+ `).map((function(n){return uE(e,Ex(Ex({},t),{},{value:n}))})):[e]}(t)),i=r[0],a=r.slice(1);return[].concat(jx(e.slice(0,-1)),[[].concat(jx(n),[i])],jx(a.map((function(e){return[e]}))))}),[[]])}function gE(e){return hE(mE(e))}var _E=function(e,t,n){var r=(n=typeof n==`function`?n:void 0)?n(e,t):void 0;return r===void 0?Ow(e,t,void 0,n):!!r},vE=function(e,t){return Ow(e,t)},yE=function(e){var t=e==null?0:e.length;return t?e[t-1]:void 0};function bE(e,t){if(!e.children)throw Error(`parent node missing children property`);var n,r,i=yE(e.children);return i&&(r=t,(n=i).type===r.type&&(n.type===`text`||n.children&&r.children&&_E(n,r,(function(e,t,n){return n===`chlidren`||vE(e,t)}))))?e.children[e.children.length-1]=function(e,t){return`value`in e&&`value`in t?Ex(Ex({},e),{},{value:`${e.value}${t.value}`}):e}(i,t):e.children.push(t),e.children[e.children.length-1]}function xE(e){var t,n={type:`root`,children:[]},r=Lx(e);try{var i=function(){var e=t.value;e.reduce((function(t,n,r){return bE(t,r===e.length-1?Ex({},n):Ex(Ex({},n),{},{children:[]}))}),n)};for(r.s();!(t=r.n()).done;)i()}catch(e){r.e(e)}finally{r.f()}return n}var SE=zx((function(e){var t=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32};t.Diff=function(e,t){return[e,t]},t.prototype.diff_main=function(e,n,r,i){i===void 0&&(i=this.Diff_Timeout<=0?Number.MAX_VALUE:new Date().getTime()+1e3*this.Diff_Timeout);var a=i;if(e==null||n==null)throw Error(`Null input. (diff_main)`);if(e==n)return e?[new t.Diff(0,e)]:[];r===void 0&&(r=!0);var o=r,s=this.diff_commonPrefix(e,n),c=e.substring(0,s);e=e.substring(s),n=n.substring(s),s=this.diff_commonSuffix(e,n);var l=e.substring(e.length-s);e=e.substring(0,e.length-s),n=n.substring(0,n.length-s);var u=this.diff_compute_(e,n,o,a);return c&&u.unshift(new t.Diff(0,c)),l&&u.push(new t.Diff(0,l)),this.diff_cleanupMerge(u),u},t.prototype.diff_compute_=function(e,n,r,i){var a;if(!e)return[new t.Diff(1,n)];if(!n)return[new t.Diff(-1,e)];var o=e.length>n.length?e:n,s=e.length>n.length?n:e,c=o.indexOf(s);if(c!=-1)return a=[new t.Diff(1,o.substring(0,c)),new t.Diff(0,s),new t.Diff(1,o.substring(c+s.length))],e.length>n.length&&(a[0][0]=a[2][0]=-1),a;if(s.length==1)return[new t.Diff(-1,e),new t.Diff(1,n)];var l=this.diff_halfMatch_(e,n);if(l){var u=l[0],d=l[1],f=l[2],p=l[3],m=l[4],h=this.diff_main(u,f,r,i),g=this.diff_main(d,p,r,i);return h.concat([new t.Diff(0,m)],g)}return r&&e.length>100&&n.length>100?this.diff_lineMode_(e,n,i):this.diff_bisect_(e,n,i)},t.prototype.diff_lineMode_=function(e,n,r){var i=this.diff_linesToChars_(e,n);e=i.chars1,n=i.chars2;var a=i.lineArray,o=this.diff_main(e,n,!1,r);this.diff_charsToLines_(o,a),this.diff_cleanupSemantic(o),o.push(new t.Diff(0,``));for(var s=0,c=0,l=0,u=``,d=``;s<o.length;){switch(o[s][0]){case 1:l++,d+=o[s][1];break;case-1:c++,u+=o[s][1];break;case 0:if(c>=1&&l>=1){o.splice(s-c-l,c+l),s=s-c-l;for(var f=this.diff_main(u,d,!1,r),p=f.length-1;p>=0;p--)o.splice(s,0,f[p]);s+=f.length}l=0,c=0,u=``,d=``}s++}return o.pop(),o},t.prototype.diff_bisect_=function(e,n,r){for(var i=e.length,a=n.length,o=Math.ceil((i+a)/2),s=o,c=2*o,l=Array(c),u=Array(c),d=0;d<c;d++)l[d]=-1,u[d]=-1;l[s+1]=0,u[s+1]=0;for(var f=i-a,p=f%2!=0,m=0,h=0,g=0,_=0,v=0;v<o&&!(new Date().getTime()>r);v++){for(var y=-v+m;y<=v-h;y+=2){for(var b=s+y,x=(E=y==-v||y!=v&&l[b-1]<l[b+1]?l[b+1]:l[b-1]+1)-y;E<i&&x<a&&e.charAt(E)==n.charAt(x);)E++,x++;if(l[b]=E,E>i)h+=2;else if(x>a)m+=2;else if(p&&(w=s+f-y)>=0&&w<c&&u[w]!=-1&&E>=(C=i-u[w]))return this.diff_bisectSplit_(e,n,E,x,r)}for(var S=-v+g;S<=v-_;S+=2){for(var C,w=s+S,T=(C=S==-v||S!=v&&u[w-1]<u[w+1]?u[w+1]:u[w-1]+1)-S;C<i&&T<a&&e.charAt(i-C-1)==n.charAt(a-T-1);)C++,T++;if(u[w]=C,C>i)_+=2;else if(T>a)g+=2;else if(!p&&(b=s+f-S)>=0&&b<c&&l[b]!=-1){var E;if(x=s+(E=l[b])-b,E>=(C=i-C))return this.diff_bisectSplit_(e,n,E,x,r)}}}return[new t.Diff(-1,e),new t.Diff(1,n)]},t.prototype.diff_bisectSplit_=function(e,t,n,r,i){var a=e.substring(0,n),o=t.substring(0,r),s=e.substring(n),c=t.substring(r),l=this.diff_main(a,o,!1,i),u=this.diff_main(s,c,!1,i);return l.concat(u)},t.prototype.diff_linesToChars_=function(e,t){var n=[],r={};function i(e){for(var t=``,i=0,o=-1,s=n.length;o<e.length-1;){(o=e.indexOf(`
325
+ `,i))==-1&&(o=e.length-1);var c=e.substring(i,o+1);(r.hasOwnProperty?r.hasOwnProperty(c):r[c]!==void 0)?t+=String.fromCharCode(r[c]):(s==a&&(c=e.substring(i),o=e.length),t+=String.fromCharCode(s),r[c]=s,n[s++]=c),i=o+1}return t}n[0]=``;var a=4e4,o=i(e);return a=65535,{chars1:o,chars2:i(t),lineArray:n}},t.prototype.diff_charsToLines_=function(e,t){for(var n=0;n<e.length;n++){for(var r=e[n][1],i=[],a=0;a<r.length;a++)i[a]=t[r.charCodeAt(a)];e[n][1]=i.join(``)}},t.prototype.diff_commonPrefix=function(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(a,i)==t.substring(a,i)?a=n=i:r=i,i=Math.floor((r-n)/2+n);return i},t.prototype.diff_commonSuffix=function(e,t){if(!e||!t||e.charAt(e.length-1)!=t.charAt(t.length-1))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(e.length-i,e.length-a)==t.substring(t.length-i,t.length-a)?a=n=i:r=i,i=Math.floor((r-n)/2+n);return i},t.prototype.diff_commonOverlap_=function(e,t){var n=e.length,r=t.length;if(n==0||r==0)return 0;n>r?e=e.substring(n-r):n<r&&(t=t.substring(0,n));var i=Math.min(n,r);if(e==t)return i;for(var a=0,o=1;;){var s=e.substring(i-o),c=t.indexOf(s);if(c==-1)return a;o+=c,c!=0&&e.substring(i-o)!=t.substring(0,o)||(a=o,o++)}},t.prototype.diff_halfMatch_=function(e,t){if(this.Diff_Timeout<=0)return null;var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||2*r.length<n.length)return null;var i=this;function a(e,t,n){for(var r,a,o,s,c=e.substring(n,n+Math.floor(e.length/4)),l=-1,u=``;(l=t.indexOf(c,l+1))!=-1;){var d=i.diff_commonPrefix(e.substring(n),t.substring(l)),f=i.diff_commonSuffix(e.substring(0,n),t.substring(0,l));u.length<f+d&&(u=t.substring(l-f,l)+t.substring(l,l+d),r=e.substring(0,n-f),a=e.substring(n+d),o=t.substring(0,l-f),s=t.substring(l+d))}return 2*u.length>=e.length?[r,a,o,s,u]:null}var o,s,c,l,u,d=a(n,r,Math.ceil(n.length/4)),f=a(n,r,Math.ceil(n.length/2));return d||f?(o=f?d&&d[4].length>f[4].length?d:f:d,e.length>t.length?(s=o[0],c=o[1],l=o[2],u=o[3]):(l=o[0],u=o[1],s=o[2],c=o[3]),[s,c,l,u,o[4]]):null},t.prototype.diff_cleanupSemantic=function(e){for(var n=!1,r=[],i=0,a=null,o=0,s=0,c=0,l=0,u=0;o<e.length;)e[o][0]==0?(r[i++]=o,s=l,c=u,l=0,u=0,a=e[o][1]):(e[o][0]==1?l+=e[o][1].length:u+=e[o][1].length,a&&a.length<=Math.max(s,c)&&a.length<=Math.max(l,u)&&(e.splice(r[i-1],0,new t.Diff(-1,a)),e[r[i-1]+1][0]=1,i--,o=--i>0?r[i-1]:-1,s=0,c=0,l=0,u=0,a=null,n=!0)),o++;for(n&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),o=1;o<e.length;){if(e[o-1][0]==-1&&e[o][0]==1){var d=e[o-1][1],f=e[o][1],p=this.diff_commonOverlap_(d,f),m=this.diff_commonOverlap_(f,d);p>=m?(p>=d.length/2||p>=f.length/2)&&(e.splice(o,0,new t.Diff(0,f.substring(0,p))),e[o-1][1]=d.substring(0,d.length-p),e[o+1][1]=f.substring(p),o++):(m>=d.length/2||m>=f.length/2)&&(e.splice(o,0,new t.Diff(0,d.substring(0,m))),e[o-1][0]=1,e[o-1][1]=f.substring(0,f.length-m),e[o+1][0]=-1,e[o+1][1]=d.substring(m),o++),o++}o++}},t.prototype.diff_cleanupSemanticLossless=function(e){function n(e,n){if(!e||!n)return 6;var r=e.charAt(e.length-1),i=n.charAt(0),a=r.match(t.nonAlphaNumericRegex_),o=i.match(t.nonAlphaNumericRegex_),s=a&&r.match(t.whitespaceRegex_),c=o&&i.match(t.whitespaceRegex_),l=s&&r.match(t.linebreakRegex_),u=c&&i.match(t.linebreakRegex_),d=l&&e.match(t.blanklineEndRegex_),f=u&&n.match(t.blanklineStartRegex_);return d||f?5:l||u?4:a&&!s&&c?3:s||c?2:a||o?1:0}for(var r=1;r<e.length-1;){if(e[r-1][0]==0&&e[r+1][0]==0){var i=e[r-1][1],a=e[r][1],o=e[r+1][1],s=this.diff_commonSuffix(i,a);if(s){var c=a.substring(a.length-s);i=i.substring(0,i.length-s),a=c+a.substring(0,a.length-s),o=c+o}for(var l=i,u=a,d=o,f=n(i,a)+n(a,o);a.charAt(0)===o.charAt(0);){i+=a.charAt(0),a=a.substring(1)+o.charAt(0),o=o.substring(1);var p=n(i,a)+n(a,o);p>=f&&(f=p,l=i,u=a,d=o)}e[r-1][1]!=l&&(l?e[r-1][1]=l:(e.splice(r-1,1),r--),e[r][1]=u,d?e[r+1][1]=d:(e.splice(r+1,1),r--))}r++}},t.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,t.whitespaceRegex_=/\s/,t.linebreakRegex_=/[\r\n]/,t.blanklineEndRegex_=/\n\r?\n$/,t.blanklineStartRegex_=/^\r?\n\r?\n/,t.prototype.diff_cleanupEfficiency=function(e){for(var n=!1,r=[],i=0,a=null,o=0,s=!1,c=!1,l=!1,u=!1;o<e.length;)e[o][0]==0?(e[o][1].length<this.Diff_EditCost&&(l||u)?(r[i++]=o,s=l,c=u,a=e[o][1]):(i=0,a=null),l=u=!1):(e[o][0]==-1?u=!0:l=!0,a&&(s&&c&&l&&u||a.length<this.Diff_EditCost/2&&s+c+l+u==3)&&(e.splice(r[i-1],0,new t.Diff(-1,a)),e[r[i-1]+1][0]=1,i--,a=null,s&&c?(l=u=!0,i=0):(o=--i>0?r[i-1]:-1,l=u=!1),n=!0)),o++;n&&this.diff_cleanupMerge(e)},t.prototype.diff_cleanupMerge=function(e){e.push(new t.Diff(0,``));for(var n,r=0,i=0,a=0,o=``,s=``;r<e.length;)switch(e[r][0]){case 1:a++,s+=e[r][1],r++;break;case-1:i++,o+=e[r][1],r++;break;case 0:i+a>1?(i!==0&&a!==0&&((n=this.diff_commonPrefix(s,o))!==0&&(r-i-a>0&&e[r-i-a-1][0]==0?e[r-i-a-1][1]+=s.substring(0,n):(e.splice(0,0,new t.Diff(0,s.substring(0,n))),r++),s=s.substring(n),o=o.substring(n)),(n=this.diff_commonSuffix(s,o))!==0&&(e[r][1]=s.substring(s.length-n)+e[r][1],s=s.substring(0,s.length-n),o=o.substring(0,o.length-n))),r-=i+a,e.splice(r,i+a),o.length&&(e.splice(r,0,new t.Diff(-1,o)),r++),s.length&&(e.splice(r,0,new t.Diff(1,s)),r++),r++):r!==0&&e[r-1][0]==0?(e[r-1][1]+=e[r][1],e.splice(r,1)):r++,a=0,i=0,o=``,s=``}e[e.length-1][1]===``&&e.pop();var c=!1;for(r=1;r<e.length-1;)e[r-1][0]==0&&e[r+1][0]==0&&(e[r][1].substring(e[r][1].length-e[r-1][1].length)==e[r-1][1]?(e[r][1]=e[r-1][1]+e[r][1].substring(0,e[r][1].length-e[r-1][1].length),e[r+1][1]=e[r-1][1]+e[r+1][1],e.splice(r-1,1),c=!0):e[r][1].substring(0,e[r+1][1].length)==e[r+1][1]&&(e[r-1][1]+=e[r+1][1],e[r][1]=e[r][1].substring(e[r+1][1].length)+e[r+1][1],e.splice(r+1,1),c=!0)),r++;c&&this.diff_cleanupMerge(e)},t.prototype.diff_xIndex=function(e,t){var n,r=0,i=0,a=0,o=0;for(n=0;n<e.length&&(e[n][0]!==1&&(r+=e[n][1].length),e[n][0]!==-1&&(i+=e[n][1].length),!(r>t));n++)a=r,o=i;return e.length!=n&&e[n][0]===-1?o:o+(t-a)},t.prototype.diff_prettyHtml=function(e){for(var t=[],n=/&/g,r=/</g,i=/>/g,a=/\n/g,o=0;o<e.length;o++){var s=e[o][0],c=e[o][1].replace(n,`&amp;`).replace(r,`&lt;`).replace(i,`&gt;`).replace(a,`&para;<br>`);switch(s){case 1:t[o]=`<ins style="background:#e6ffe6;">`+c+`</ins>`;break;case-1:t[o]=`<del style="background:#ffe6e6;">`+c+`</del>`;break;case 0:t[o]=`<span>`+c+`</span>`}}return t.join(``)},t.prototype.diff_text1=function(e){for(var t=[],n=0;n<e.length;n++)e[n][0]!==1&&(t[n]=e[n][1]);return t.join(``)},t.prototype.diff_text2=function(e){for(var t=[],n=0;n<e.length;n++)e[n][0]!==-1&&(t[n]=e[n][1]);return t.join(``)},t.prototype.diff_levenshtein=function(e){for(var t=0,n=0,r=0,i=0;i<e.length;i++){var a=e[i][0],o=e[i][1];switch(a){case 1:n+=o.length;break;case-1:r+=o.length;break;case 0:t+=Math.max(n,r),n=0,r=0}}return t+=Math.max(n,r)},t.prototype.diff_toDelta=function(e){for(var t=[],n=0;n<e.length;n++)switch(e[n][0]){case 1:t[n]=`+`+encodeURI(e[n][1]);break;case-1:t[n]=`-`+e[n][1].length;break;case 0:t[n]=`=`+e[n][1].length}return t.join(` `).replace(/%20/g,` `)},t.prototype.diff_fromDelta=function(e,n){for(var r=[],i=0,a=0,o=n.split(/\t/g),s=0;s<o.length;s++){var c=o[s].substring(1);switch(o[s].charAt(0)){case`+`:try{r[i++]=new t.Diff(1,decodeURI(c))}catch{throw Error(`Illegal escape in diff_fromDelta: `+c)}break;case`-`:case`=`:var l=parseInt(c,10);if(isNaN(l)||l<0)throw Error(`Invalid number in diff_fromDelta: `+c);var u=e.substring(a,a+=l);o[s].charAt(0)==`=`?r[i++]=new t.Diff(0,u):r[i++]=new t.Diff(-1,u);break;default:if(o[s])throw Error(`Invalid diff operation in diff_fromDelta: `+o[s])}}if(a!=e.length)throw Error(`Delta length (`+a+`) does not equal source text length (`+e.length+`).`);return r},t.prototype.match_main=function(e,t,n){if(e==null||t==null||n==null)throw Error(`Null input. (match_main)`);return n=Math.max(0,Math.min(n,e.length)),e==t?0:e.length?e.substring(n,n+t.length)==t?n:this.match_bitap_(e,t,n):-1},t.prototype.match_bitap_=function(e,t,n){if(t.length>this.Match_MaxBits)throw Error(`Pattern too long for this browser.`);var r=this.match_alphabet_(t),i=this;function a(e,r){var a=e/t.length,o=Math.abs(n-r);return i.Match_Distance?a+o/i.Match_Distance:o?1:a}var o=this.Match_Threshold,s=e.indexOf(t,n);s!=-1&&(o=Math.min(a(0,s),o),(s=e.lastIndexOf(t,n+t.length))!=-1&&(o=Math.min(a(0,s),o)));var c,l,u=1<<t.length-1;s=-1;for(var d,f=t.length+e.length,p=0;p<t.length;p++){for(c=0,l=f;c<l;)a(p,n+l)<=o?c=l:f=l,l=Math.floor((f-c)/2+c);f=l;var m=Math.max(1,n-l+1),h=Math.min(n+l,e.length)+t.length,g=Array(h+2);g[h+1]=(1<<p)-1;for(var _=h;_>=m;_--){var v=r[e.charAt(_-1)];if(g[_]=p===0?(g[_+1]<<1|1)&v:(g[_+1]<<1|1)&v|(d[_+1]|d[_])<<1|1|d[_+1],g[_]&u){var y=a(p,_-1);if(y<=o){if(o=y,!((s=_-1)>n))break;m=Math.max(1,2*n-s)}}}if(a(p+1,n)>o)break;d=g}return s},t.prototype.match_alphabet_=function(e){for(var t={},n=0;n<e.length;n++)t[e.charAt(n)]=0;for(n=0;n<e.length;n++)t[e.charAt(n)]|=1<<e.length-n-1;return t},t.prototype.patch_addContext_=function(e,n){if(n.length!=0){if(e.start2===null)throw Error(`patch not initialized`);for(var r=n.substring(e.start2,e.start2+e.length1),i=0;n.indexOf(r)!=n.lastIndexOf(r)&&r.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)i+=this.Patch_Margin,r=n.substring(e.start2-i,e.start2+e.length1+i);i+=this.Patch_Margin;var a=n.substring(e.start2-i,e.start2);a&&e.diffs.unshift(new t.Diff(0,a));var o=n.substring(e.start2+e.length1,e.start2+e.length1+i);o&&e.diffs.push(new t.Diff(0,o)),e.start1-=a.length,e.start2-=a.length,e.length1+=a.length+o.length,e.length2+=a.length+o.length}},t.prototype.patch_make=function(e,n,r){var i,a;if(typeof e==`string`&&typeof n==`string`&&r===void 0)i=e,(a=this.diff_main(i,n,!0)).length>2&&(this.diff_cleanupSemantic(a),this.diff_cleanupEfficiency(a));else if(e&&typeof e==`object`&&n===void 0&&r===void 0)a=e,i=this.diff_text1(a);else if(typeof e==`string`&&n&&typeof n==`object`&&r===void 0)i=e,a=n;else{if(typeof e!=`string`||typeof n!=`string`||!r||typeof r!=`object`)throw Error(`Unknown call format to patch_make.`);i=e,a=r}if(a.length===0)return[];for(var o=[],s=new t.patch_obj,c=0,l=0,u=0,d=i,f=i,p=0;p<a.length;p++){var m=a[p][0],h=a[p][1];switch(c||m===0||(s.start1=l,s.start2=u),m){case 1:s.diffs[c++]=a[p],s.length2+=h.length,f=f.substring(0,u)+h+f.substring(u);break;case-1:s.length1+=h.length,s.diffs[c++]=a[p],f=f.substring(0,u)+f.substring(u+h.length);break;case 0:h.length<=2*this.Patch_Margin&&c&&a.length!=p+1?(s.diffs[c++]=a[p],s.length1+=h.length,s.length2+=h.length):h.length>=2*this.Patch_Margin&&c&&(this.patch_addContext_(s,d),o.push(s),s=new t.patch_obj,c=0,d=f,l=u)}m!==1&&(l+=h.length),m!==-1&&(u+=h.length)}return c&&(this.patch_addContext_(s,d),o.push(s)),o},t.prototype.patch_deepCopy=function(e){for(var n=[],r=0;r<e.length;r++){var i=e[r],a=new t.patch_obj;a.diffs=[];for(var o=0;o<i.diffs.length;o++)a.diffs[o]=new t.Diff(i.diffs[o][0],i.diffs[o][1]);a.start1=i.start1,a.start2=i.start2,a.length1=i.length1,a.length2=i.length2,n[r]=a}return n},t.prototype.patch_apply=function(e,t){if(e.length==0)return[t,[]];e=this.patch_deepCopy(e);var n=this.patch_addPadding(e);t=n+t+n,this.patch_splitMax(e);for(var r=0,i=[],a=0;a<e.length;a++){var o,s,c=e[a].start2+r,l=this.diff_text1(e[a].diffs),u=-1;if(l.length>this.Match_MaxBits?(o=this.match_main(t,l.substring(0,this.Match_MaxBits),c))!=-1&&((u=this.match_main(t,l.substring(l.length-this.Match_MaxBits),c+l.length-this.Match_MaxBits))==-1||o>=u)&&(o=-1):o=this.match_main(t,l,c),o==-1)i[a]=!1,r-=e[a].length2-e[a].length1;else if(i[a]=!0,r=o-c,l==(s=u==-1?t.substring(o,o+l.length):t.substring(o,u+this.Match_MaxBits)))t=t.substring(0,o)+this.diff_text2(e[a].diffs)+t.substring(o+l.length);else{var d=this.diff_main(l,s,!1);if(l.length>this.Match_MaxBits&&this.diff_levenshtein(d)/l.length>this.Patch_DeleteThreshold)i[a]=!1;else{this.diff_cleanupSemanticLossless(d);for(var f,p=0,m=0;m<e[a].diffs.length;m++){var h=e[a].diffs[m];h[0]!==0&&(f=this.diff_xIndex(d,p)),h[0]===1?t=t.substring(0,o+f)+h[1]+t.substring(o+f):h[0]===-1&&(t=t.substring(0,o+f)+t.substring(o+this.diff_xIndex(d,p+h[1].length))),h[0]!==-1&&(p+=h[1].length)}}}}return[t=t.substring(n.length,t.length-n.length),i]},t.prototype.patch_addPadding=function(e){for(var n=this.Patch_Margin,r=``,i=1;i<=n;i++)r+=String.fromCharCode(i);for(i=0;i<e.length;i++)e[i].start1+=n,e[i].start2+=n;var a=e[0],o=a.diffs;if(o.length==0||o[0][0]!=0)o.unshift(new t.Diff(0,r)),a.start1-=n,a.start2-=n,a.length1+=n,a.length2+=n;else if(n>o[0][1].length){var s=n-o[0][1].length;o[0][1]=r.substring(o[0][1].length)+o[0][1],a.start1-=s,a.start2-=s,a.length1+=s,a.length2+=s}return(o=(a=e[e.length-1]).diffs).length==0||o[o.length-1][0]!=0?(o.push(new t.Diff(0,r)),a.length1+=n,a.length2+=n):n>o[o.length-1][1].length&&(s=n-o[o.length-1][1].length,o[o.length-1][1]+=r.substring(0,s),a.length1+=s,a.length2+=s),r},t.prototype.patch_splitMax=function(e){for(var n=this.Match_MaxBits,r=0;r<e.length;r++)if(!(e[r].length1<=n)){var i=e[r];e.splice(r--,1);for(var a=i.start1,o=i.start2,s=``;i.diffs.length!==0;){var c=new t.patch_obj,l=!0;for(c.start1=a-s.length,c.start2=o-s.length,s!==``&&(c.length1=c.length2=s.length,c.diffs.push(new t.Diff(0,s)));i.diffs.length!==0&&c.length1<n-this.Patch_Margin;){var u=i.diffs[0][0],d=i.diffs[0][1];u===1?(c.length2+=d.length,o+=d.length,c.diffs.push(i.diffs.shift()),l=!1):u===-1&&c.diffs.length==1&&c.diffs[0][0]==0&&d.length>2*n?(c.length1+=d.length,a+=d.length,l=!1,c.diffs.push(new t.Diff(u,d)),i.diffs.shift()):(d=d.substring(0,n-c.length1-this.Patch_Margin),c.length1+=d.length,a+=d.length,u===0?(c.length2+=d.length,o+=d.length):l=!1,c.diffs.push(new t.Diff(u,d)),d==i.diffs[0][1]?i.diffs.shift():i.diffs[0][1]=i.diffs[0][1].substring(d.length))}s=(s=this.diff_text2(c.diffs)).substring(s.length-this.Patch_Margin);var f=this.diff_text1(i.diffs).substring(0,this.Patch_Margin);f!==``&&(c.length1+=f.length,c.length2+=f.length,c.diffs.length!==0&&c.diffs[c.diffs.length-1][0]===0?c.diffs[c.diffs.length-1][1]+=f:c.diffs.push(new t.Diff(0,f))),l||e.splice(++r,0,c)}}},t.prototype.patch_toText=function(e){for(var t=[],n=0;n<e.length;n++)t[n]=e[n];return t.join(``)},t.prototype.patch_fromText=function(e){var n=[];if(!e)return n;for(var r=e.split(`
326
+ `),i=0,a=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;i<r.length;){var o=r[i].match(a);if(!o)throw Error(`Invalid patch string: `+r[i]);var s=new t.patch_obj;for(n.push(s),s.start1=parseInt(o[1],10),o[2]===``?(s.start1--,s.length1=1):o[2]==`0`?s.length1=0:(s.start1--,s.length1=parseInt(o[2],10)),s.start2=parseInt(o[3],10),o[4]===``?(s.start2--,s.length2=1):o[4]==`0`?s.length2=0:(s.start2--,s.length2=parseInt(o[4],10)),i++;i<r.length;){var c=r[i].charAt(0);try{var l=decodeURI(r[i].substring(1))}catch{throw Error(`Illegal escape in patch_fromText: `+l)}if(c==`-`)s.diffs.push(new t.Diff(-1,l));else if(c==`+`)s.diffs.push(new t.Diff(1,l));else if(c==` `)s.diffs.push(new t.Diff(0,l));else{if(c==`@`)break;if(c!==``)throw Error(`Invalid patch mode "`+c+`" in: `+l)}i++}}return n},(t.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0}).prototype.toString=function(){for(var e,t=[`@@ -`+(this.length1===0?this.start1+`,0`:this.length1==1?this.start1+1:this.start1+1+`,`+this.length1)+` +`+(this.length2===0?this.start2+`,0`:this.length2==1?this.start2+1:this.start2+1+`,`+this.length2)+` @@
327
+ `],n=0;n<this.diffs.length;n++){switch(this.diffs[n][0]){case 1:e=`+`;break;case-1:e=`-`;break;case 0:e=` `}t[n+1]=e+encodeURI(this.diffs[n][1])+`
328
+ `}return t.join(``).replace(/%20/g,` `)},e.exports=t,e.exports.diff_match_patch=t,e.exports.DIFF_DELETE=-1,e.exports.DIFF_INSERT=1,e.exports.DIFF_EQUAL=0}));SE.DIFF_EQUAL,SE.DIFF_DELETE,SE.DIFF_INSERT;var CE=[`enhancers`],wE=function(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.enhancers,i=r===void 0?[]:r,a=kx(cE(e,Ox(n,CE)),2),o=a[0],s=a[1],c=[gE(o),gE(s)],l=kx((t=[c[0],c[1]],i.reduce((function(e,t){return t(e)}),t)),2),u=l[0],d=l[1],f=[u.map(xE),d.map(xE)],p=f[1];return{old:f[0].map((function(e){return e.children??[]})),new:p.map((function(e){return e.children??[]}))}},TE=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),EE={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function DE(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function OE(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function kE(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function AE(e){return kE(e)||DE(e)}var jE=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function ME(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,f=m(),p;for(a--;++a<=e.length;)if(p===10&&(d=(l?l[o]:0)||1),p=e.charCodeAt(a),p===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(p),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let _=``,v=``,y=``,b=u===`named`?AE:u===`decimal`?DE:OE;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!b(t))break;y+=String.fromCharCode(t),u===`named`&&TE.includes(y)&&(_=y,v=uo(y))}let x=e.charCodeAt(l)===59;if(x){l++;let e=u===`named`?uo(y):!1;e&&(_=y,v=e)}let S=1+l-o,C=``;if(!(!x&&n.nonTerminated===!1))if(!y)u!==`named`&&h(4,S);else if(u===`named`){if(x&&!v)h(5,1);else if(_!==y&&(l=c+_.length,S=1+l-c,x=!1),!x){let t=_?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(h(t,S),v=``):AE(n)?v=``:h(t,S)}else h(t,S)}C=v}else{x||h(2,S);let e=Number.parseInt(y,u===`hexadecimal`?16:10);if(NE(e))h(7,S),C=`�`;else if(e in EE)h(6,S),C=EE[e];else{let t=``;PE(e)&&h(6,S),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),C=t+String.fromCharCode(e)}}if(C){g(),f=m(),a=l-1,d+=l-o+1,i.push(C);let t=m();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,C,{start:f,end:t},e.slice(o-1,l)),f=t}else y=e.slice(o-1,l),s+=y,d+=y.length,a=l-1}else p===10&&(u++,o++,d=0),Number.isNaN(p)?g():(s+=String.fromCharCode(p),d++);return i.join(``);function m(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function h(e,t){let r;n.warning&&(r=m(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,jE[e],r,e))}function g(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:f,end:m()}),``)}}function NE(e){return e>=55296&&e<=57343||e>1114111}function PE(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}var FE=0,IE={},LE={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,`__id`,{value:++FE}),e.__id},clone:function e(t,n){n||={};var r,i;switch(LE.util.type(t)){case`Object`:if(i=LE.util.objId(t),n[i])return n[i];for(var a in r={},n[i]=r,t)t.hasOwnProperty(a)&&(r[a]=e(t[a],n));return r;case`Array`:return i=LE.util.objId(t),n[i]?n[i]:(r=[],n[i]=r,t.forEach(function(t,i){r[i]=e(t,n)}),r);default:return t}}},languages:{plain:IE,plaintext:IE,text:IE,txt:IE,extend:function(e,t){var n=LE.util.clone(LE.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){r||=LE.languages;var i=r[e],a={};for(var o in i)if(i.hasOwnProperty(o)){if(o==t)for(var s in n)n.hasOwnProperty(s)&&(a[s]=n[s]);n.hasOwnProperty(o)||(a[o]=i[o])}var c=r[e];return r[e]=a,LE.languages.DFS(LE.languages,function(t,n){n===c&&t!=e&&(this[t]=a)}),a},DFS:function e(t,n,r,i){i||={};var a=LE.util.objId;for(var o in t)if(t.hasOwnProperty(o)){n.call(t,o,t[o],r||o);var s=t[o],c=LE.util.type(s);c===`Object`&&!i[a(s)]?(i[a(s)]=!0,e(s,n,null,i)):c===`Array`&&!i[a(s)]&&(i[a(s)]=!0,e(s,n,o,i))}}},plugins:{},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(LE.hooks.run(`before-tokenize`,r),!r.grammar)throw Error(`The language "`+r.language+`" has no grammar.`);return r.tokens=LE.tokenize(r.code,r.grammar),LE.hooks.run(`after-tokenize`,r),RE.stringify(LE.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var i=new VE;return HE(i,i.head,e),BE(e,i,t,i.head,0),WE(i)},hooks:{all:{},add:function(e,t){var n=LE.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=LE.hooks.all[e];if(!(!n||!n.length))for(var r=0,i;i=n[r++];)i(t)}},Token:RE};function RE(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||``).length|0}function zE(e,t,n,r){e.lastIndex=t;var i=e.exec(n);if(i&&r&&i[1]){var a=i[1].length;i.index+=a,i[0]=i[0].slice(a)}return i}function BE(e,t,n,r,i,a){for(var o in n)if(!(!n.hasOwnProperty(o)||!n[o])){var s=n[o];s=Array.isArray(s)?s:[s];for(var c=0;c<s.length;++c){if(a&&a.cause==o+`,`+c)return;var l=s[c],u=l.inside,d=!!l.lookbehind,f=!!l.greedy,p=l.alias;if(f&&!l.pattern.global){var m=l.pattern.toString().match(/[imsuy]*$/)[0];l.pattern=RegExp(l.pattern.source,m+`g`)}for(var h=l.pattern||l,g=r.next,_=i;g!==t.tail&&!(a&&_>=a.reach);_+=g.value.length,g=g.next){var v=g.value;if(t.length>e.length)return;if(!(v instanceof RE)){var y=1,b;if(f){if(b=zE(h,_,e,d),!b||b.index>=e.length)break;var x=b.index,S=b.index+b[0].length,C=_;for(C+=g.value.length;x>=C;)g=g.next,C+=g.value.length;if(C-=g.value.length,_=C,g.value instanceof RE)continue;for(var w=g;w!==t.tail&&(C<S||typeof w.value==`string`);w=w.next)y++,C+=w.value.length;y--,v=e.slice(_,C),b.index-=_}else if(b=zE(h,0,v,d),!b)continue;var x=b.index,T=b[0],E=v.slice(0,x),D=v.slice(x+T.length),O=_+v.length;a&&O>a.reach&&(a.reach=O);var ee=g.prev;E&&(ee=HE(t,ee,E),_+=E.length),UE(t,ee,y);var te=new RE(o,u?LE.tokenize(T,u):T,p,T);if(g=HE(t,ee,te),D&&HE(t,g,D),y>1){var ne={cause:o+`,`+c,reach:O};BE(e,t,n,g.prev,_,ne),a&&ne.reach>a.reach&&(a.reach=ne.reach)}}}}}}function VE(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function HE(e,t,n){var r=t.next,i={value:n,prev:t,next:r};return t.next=i,r.prev=i,e.length++,i}function UE(e,t,n){for(var r=t.next,i=0;i<n&&r!==e.tail;i++)r=r.next;t.next=r,r.prev=t,e.length-=i}function WE(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}var GE=LE;function KE(){}KE.prototype=GE;var qE=new KE;qE.highlight=JE,qE.register=YE,qE.alias=XE,qE.registered=ZE,qE.listLanguages=QE,qE.util.encode=eD,qE.Token.stringify=$E;function JE(e,t){if(typeof e!=`string`)throw TypeError("Expected `string` for `value`, got `"+e+"`");let n,r;if(t&&typeof t==`object`)n=t;else{if(r=t,typeof r!=`string`)throw TypeError("Expected `string` for `name`, got `"+r+"`");if(Object.hasOwn(qE.languages,r))n=qE.languages[r];else throw Error("Unknown language: `"+r+"` is not registered")}return{type:`root`,children:GE.highlight.call(qE,e,n,r)}}function YE(e){if(typeof e!=`function`||!e.displayName)throw Error("Expected `function` for `syntax`, got `"+e+"`");Object.hasOwn(qE.languages,e.displayName)||e(qE)}function XE(e,t){let n=qE.languages,r={};typeof e==`string`?t&&(r[e]=t):r=e;let i;for(i in r)if(Object.hasOwn(r,i)){let e=r[i],t=typeof e==`string`?[e]:e,a=-1;for(;++a<t.length;)n[t[a]]=n[i]}}function ZE(e){if(typeof e!=`string`)throw TypeError("Expected `string` for `aliasOrLanguage`, got `"+e+"`");return Object.hasOwn(qE.languages,e)}function QE(){let e=qE.languages,t=[],n;for(n in e)Object.hasOwn(e,n)&&typeof e[n]==`object`&&t.push(n);return t}function $E(e,t){if(typeof e==`string`)return{type:`text`,value:e};if(Array.isArray(e)){let n=[],r=-1;for(;++r<e.length;)e[r]!==null&&e[r]!==void 0&&e[r]!==``&&n.push($E(e[r],t));return n}let n={attributes:{},classes:[`token`,e.type],content:$E(e.content,t),language:t,tag:`span`,type:e.type};return e.alias&&n.classes.push(...typeof e.alias==`string`?[e.alias]:e.alias),qE.hooks.run(`wrap`,n),Td(n.tag+`.`+n.classes.join(`.`),tD(n.attributes),n.content)}function eD(e){return e}function tD(e){let t;for(t in e)Object.hasOwn(e,t)&&(e[t]=ME(e[t]));return e}nD.displayName=`bash`,nD.aliases=[`sh`,`shell`];function nD(e){(function(e){var t=`\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b`,n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:`punctuation`,inside:null},r={bash:n,environment:{pattern:RegExp(`\\$`+t),alias:`constant`},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp(`(\\{)`+t),lookbehind:!0,alias:`constant`}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:`important`},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:`function`},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:`function`}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:`variable`,lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp(`(^|[\\s;|&]|[<>]\\()`+t),lookbehind:!0,alias:`constant`}},alias:`variable`,lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:`variable`,lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp(`\\$?`+t),alias:`constant`},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:`class-name`},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:`important`},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:`important`}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var i=[`comment`,`function-name`,`for-or-select`,`assign-left`,`parameter`,`string`,`environment`,`function`,`keyword`,`builtin`,`boolean`,`file-descriptor`,`operator`,`punctuation`,`number`],a=r.variable[1].inside,o=0;o<i.length;o++)a[i[o]]=e.languages.bash[i[o]];e.languages.sh=e.languages.bash,e.languages.shell=e.languages.bash})(e)}rD.displayName=`clike`,rD.aliases=[];function rD(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}iD.displayName=`c`,iD.aliases=[];function iD(e){e.register(rD),e.languages.c=e.languages.extend(`clike`,{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),e.languages.insertBefore(`c`,`string`,{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),e.languages.insertBefore(`c`,`string`,{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:`property`,inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},e.languages.c.string],char:e.languages.c.char,comment:e.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:`function`}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:`keyword`},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:e.languages.c}}}}),e.languages.insertBefore(`c`,`function`,{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete e.languages.c.boolean}aD.displayName=`cpp`,aD.aliases=[];function aD(e){e.register(iD),(function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=`\\b(?!<keyword>)\\w+(?:\\s*\\.\\s*\\w+)*\\b`.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend(`c`,{"class-name":[{pattern:RegExp(`(\\b(?:class|concept|enum|struct|typename)\\s+)(?!<keyword>)\\w+`.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore(`cpp`,`string`,{module:{pattern:RegExp(`(\\b(?:import|module)\\s+)(?:"(?:\\\\(?:\\r\\n|[\\s\\S])|[^"\\\\\\r\\n])*"|<[^<>\\r\\n]*>|`+`<mod-name>(?:\\s*:\\s*<mod-name>)?|:\\s*<mod-name>`.replace(/<mod-name>/g,function(){return n})+`)`),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:`string`,greedy:!0}}),e.languages.insertBefore(`cpp`,`keyword`,{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:e.languages.cpp}}}}),e.languages.insertBefore(`cpp`,`operator`,{"double-colon":{pattern:/::/,alias:`punctuation`}}),e.languages.insertBefore(`cpp`,`class-name`,{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend(`cpp`,{})}}),e.languages.insertBefore(`inside`,`double-colon`,{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp[`base-clause`])})(e)}oD.displayName=`css`,oD.aliases=[];function oD(e){(function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp(`@[\\w-](?:[^;{\\s"']|\\s+(?!\\s)|`+t.source+`)*?(?:;|(?=\\s*\\{))`),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:`selector`},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp(`\\burl\\((?:`+t.source+`|(?:[^\\\\\\r\\n()"']|\\\\[\\s\\S])*)\\)`,`i`),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp(`^`+t.source+`$`),alias:`url`}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+`)*(?=\\s*\\{)`),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined(`style`,`css`),n.tag.addAttribute(`style`,`css`))})(e)}sD.displayName=`go`,sD.aliases=[];function sD(e){e.register(rD),e.languages.go=e.languages.extend(`clike`,{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),e.languages.insertBefore(`go`,`string`,{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete e.languages.go[`class-name`]}cD.displayName=`java`,cD.aliases=[];function cD(e){e.register(rD),(function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=`(?:[a-z]\\w*\\s*\\.\\s*)*(?:[A-Z]\\w*\\s*\\.\\s*)*`,r={pattern:RegExp(`(^|[^\\w.])`+n+`[A-Z](?:[\\d_A-Z]*[a-z]\\w*)?\\b`),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend(`clike`,{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(`(^|[^\\w.])`+n+`[A-Z]\\w*(?=\\s+\\w+\\s*[;,=()]|\\s*(?:\\[[\\s,]*\\]\\s*)?::\\s*new\\b)`),lookbehind:!0,inside:r.inside},{pattern:RegExp(`(\\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\\s+)`+n+`[A-Z]\\w*\\b`),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore(`java`,`string`,{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:`string`},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore(`java`,`class-name`,{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:`punctuation`},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(`(\\bimport\\s+)`+n+`(?:[A-Z]\\w*|\\*)(?=\\s*;)`),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(`(\\bimport\\s+static\\s+)`+n+`(?:\\w+|\\*)(?=\\s*;)`),lookbehind:!0,alias:`static`,inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(`(\\b(?:exports|import(?:\\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\\s+)(?!<keyword>)[a-z]\\w*(?:\\.[a-z]\\w*)*\\.?`.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}lD.displayName=`javascript`,lD.aliases=[`js`];function lD(e){e.register(rD),e.languages.javascript=e.languages.extend(`clike`,{"class-name":[e.languages.clike[`class-name`],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(`(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])`),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript[`class-name`][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore(`javascript`,`keyword`,{regex:{pattern:RegExp(`((?:^|[^$\\w\\xA0-\\uFFFF."'\\])\\s]|\\b(?:return|yield))\\s*)\\/(?:(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))`),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:`language-regex`,inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:`function`},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore(`javascript`,`string`,{hashbang:{pattern:/^#!.*/,greedy:!0,alias:`comment`},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:`string`},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:`punctuation`},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:`property`}}),e.languages.insertBefore(`javascript`,`operator`,{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:`property`}}),e.languages.markup&&(e.languages.markup.tag.addInlined(`script`,`javascript`),e.languages.markup.tag.addAttribute(`on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)`,`javascript`)),e.languages.js=e.languages.javascript}uD.displayName=`json`,uD.aliases=[`webmanifest`];function uD(e){e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:`keyword`}},e.languages.webmanifest=e.languages.json}dD.displayName=`markup`,dD.aliases=[`atom`,`html`,`mathml`,`rss`,`ssml`,`svg`,`xml`];function dD(e){e.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:`attr-equals`},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:`named-entity`},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside[`attr-value`].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside[`internal-subset`].inside=e.languages.markup,e.hooks.add(`wrap`,function(e){e.type===`entity`&&(e.attributes.title=e.content.value.replace(/&amp;/,`&`))}),Object.defineProperty(e.languages.markup.tag,`addInlined`,{value:function(t,n){var r={};r[`language-`+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:e.languages[n]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};i[`language-`+n]={pattern:/[\s\S]+/,inside:e.languages[n]};var a={};a[t]={pattern:RegExp(`(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)`.replace(/__/g,function(){return t}),`i`),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore(`markup`,`cdata`,a)}}),Object.defineProperty(e.languages.markup.tag,`addAttribute`,{value:function(t,n){e.languages.markup.tag.inside[`special-attr`].push({pattern:RegExp(`(^|["'\\s])(?:`+t+`)\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s'">=]+(?=[\\s>]))`,`i`),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,`language-`+n],inside:e.languages[n]},punctuation:[{pattern:/^=/,alias:`attr-equals`},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend(`markup`,{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}fD.displayName=`markdown`,fD.aliases=[`md`];function fD(e){e.register(dD),(function(e){var t=`(?:\\\\.|[^\\\\\\n\\r]|(?:\\n|\\r\\n?)(?![\\r\\n]))`;function n(e){return e=e.replace(/<inner>/g,function(){return t}),RegExp(`((?:^|[^\\\\])(?:\\\\{2})*)(?:`+e+`)`)}var r="(?:\\\\.|``(?:[^`\\r\\n]|`(?!`))+``|`[^`\\r\\n]+`|[^\\\\|\\r\\n`])+",i=`\\|?__(?:\\|__)+\\|?(?:(?:\\n|\\r\\n?)|(?![\\s\\S]))`.replace(/__/g,function(){return r}),a=`\\|?[ \\t]*:?-{3,}:?[ \\t]*(?:\\|[ \\t]*:?-{3,}:?[ \\t]*)+\\|?(?:\\n|\\r\\n?)`;e.languages.markdown=e.languages.extend(`markup`,{}),e.languages.insertBefore(`markdown`,`prolog`,{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:[`yaml`,`language-yaml`],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:`punctuation`},table:{pattern:RegExp(`^`+i+a+`(?:`+i+`)*`,`m`),inside:{"table-data-rows":{pattern:RegExp(`^(`+i+a+`)(?:`+i+`)*$`),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp(`^(`+i+`)`+a+`$`),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp(`^`+i+`$`),inside:{"table-header":{pattern:RegExp(r),alias:`important`,inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:`keyword`},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:`important`,inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:`important`,inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:`punctuation`},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:`punctuation`},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:`url`},bold:{pattern:n(`\\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\\b|\\*\\*(?:(?!\\*)<inner>|\\*(?:(?!\\*)<inner>)+\\*)+\\*\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(`\\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\\b|\\*(?:(?!\\*)<inner>|\\*\\*(?:(?!\\*)<inner>)+\\*\\*)+\\*`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(`(~~?)(?:(?!~)<inner>)+\\2`),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:[`code`,`keyword`]},url:{pattern:n(`!?\\[(?:(?!\\])<inner>)+\\](?:\\([^\\s)]+(?:[\\t ]+"(?:\\\\.|[^"\\\\])*")?\\)|[ \\t]?\\[(?:(?!\\])<inner>)+\\])`),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),[`url`,`bold`,`italic`,`strike`].forEach(function(t){[`url`,`bold`,`italic`,`strike`,`code-snippet`].forEach(function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])})}),e.hooks.add(`after-tokenize`,function(e){if(e.language!==`markdown`&&e.language!==`md`)return;function t(e){if(!(!e||typeof e==`string`))for(var n=0,r=e.length;n<r;n++){var i=e[n];if(i.type!==`code`){t(i.content);continue}var a=i.content[1],o=i.content[3];if(a&&o&&a.type===`code-language`&&o.type===`code-block`&&typeof a.content==`string`){var s=a.content.replace(/\b#/g,`sharp`).replace(/\b\+\+/g,`pp`);s=(/[a-z][\w-]*/i.exec(s)||[``])[0].toLowerCase();var c=`language-`+s;o.alias?typeof o.alias==`string`?o.alias=[o.alias,c]:o.alias.push(c):o.alias=[c]}}}t(e.tokens)}),e.hooks.add(`wrap`,function(t){if(t.type===`code-block`){for(var n=``,r=0,i=t.classes.length;r<i;r++){var a=t.classes[r],o=/language-(.+)/.exec(a);if(o){n=o[1];break}}var s=e.languages[n];if(s)t.content=e.highlight(t.content.value,s,n);else if(n&&n!==`none`&&e.plugins.autoloader){var c=`md-`+new Date().valueOf()+`-`+Math.floor(Math.random()*0x2386f26fc10000);t.attributes.id=c,e.plugins.autoloader.loadLanguages(n,function(){var t=document.getElementById(c);t&&(t.innerHTML=e.highlight(t.textContent,e.languages[n],n))})}}}),RegExp(e.languages.markup.tag.pattern.source,`gi`),String.fromCodePoint||String.fromCharCode,e.languages.md=e.languages.markdown})(e)}pD.displayName=`python`,pD.aliases=[`py`];function pD(e){e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:`punctuation`},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:`string`},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:[`annotation`,`punctuation`],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python[`string-interpolation`].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}mD.displayName=`ruby`,mD.aliases=[`rb`];function mD(e){e.register(rD),(function(e){e.languages.ruby=e.languages.extend(`clike`,{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),e.languages.insertBefore(`ruby`,`operator`,{"double-colon":{pattern:/::/,alias:`punctuation`}});var t={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:e.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:`punctuation`}}};delete e.languages.ruby.function;var n=`(?:`+[`([^a-zA-Z0-9\\s{(\\[<=])(?:(?!\\1)[^\\\\]|\\\\[\\s\\S])*\\1`,`\\((?:[^()\\\\]|\\\\[\\s\\S]|\\((?:[^()\\\\]|\\\\[\\s\\S])*\\))*\\)`,`\\{(?:[^{}\\\\]|\\\\[\\s\\S]|\\{(?:[^{}\\\\]|\\\\[\\s\\S])*\\})*\\}`,`\\[(?:[^\\[\\]\\\\]|\\\\[\\s\\S]|\\[(?:[^\\[\\]\\\\]|\\\\[\\s\\S])*\\])*\\]`,`<(?:[^<>\\\\]|\\\\[\\s\\S]|<(?:[^<>\\\\]|\\\\[\\s\\S])*>)*>`].join(`|`)+`)`,r=`(?:"(?:\\\\.|[^"\\\\\\r\\n])*"|(?:\\b[a-zA-Z_]\\w*|[^\\s\\0-\\x7F]+)[?!]?|\\$.)`;e.languages.insertBefore(`ruby`,`keyword`,{"regex-literal":[{pattern:RegExp(`%r`+n+`[egimnosux]{0,6}`),greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:t,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(`(^|[^:]):`+r),lookbehind:!0,greedy:!0},{pattern:RegExp(`([\\r\\n{(,][ \\t]*)`+r+`(?=:(?!:))`),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),e.languages.insertBefore(`ruby`,`string`,{"string-literal":[{pattern:RegExp(`%[qQiIwWs]?`+n),greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:`heredoc-string`,greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:t,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:`heredoc-string`,greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(`%x`+n),greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:`string`}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:t,command:{pattern:/[\s\S]+/,alias:`string`}}}]}),delete e.languages.ruby.string,e.languages.insertBefore(`ruby`,`number`,{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),e.languages.rb=e.languages.ruby})(e)}hD.displayName=`rust`,hD.aliases=[];function hD(e){(function(e){for(var t=`\\/\\*(?:[^*/]|\\*(?!\\/)|\\/(?!\\*)|<self>)*\\*\\/`,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return`[^\\s\\S]`}),e.languages.rust={comment:[{pattern:RegExp(`(^|[^\\\\])`+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:`attr-name`,inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:`punctuation`},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:`symbol`},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:`punctuation`},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:`function`},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:`class-name`},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:`namespace`},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:`namespace`,inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:`property`},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust[`closure-params`].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string})(e)}gD.displayName=`sql`,gD.aliases=[];function gD(e){e.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}}_D.displayName=`jsx`,_D.aliases=[];function _D(e){e.register(lD),e.register(dD),(function(e){var t=e.util.clone(e.languages.javascript),n=`(?:\\s|\\/\\/.*(?!.)|\\/\\*(?:[^*]|\\*(?!\\/))\\*\\/)`,r=`(?:\\{(?:\\{(?:\\{[^{}]*\\}|[^{}])*\\}|[^{}])*\\})`,i=`(?:\\{<S>*\\.{3}(?:[^{}]|<BRACES>)*\\})`;function a(e,t){return e=e.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return i}),RegExp(e,t)}i=a(i).source,e.languages.jsx=e.languages.extend(`markup`,t),e.languages.jsx.tag.pattern=a(`<\\/?(?:[\\w.:-]+(?:<S>+(?:[\\w.:$-]+(?:=(?:"(?:\\\\[\\s\\S]|[^\\\\"])*"|'(?:\\\\[\\s\\S]|[^\\\\'])*'|[^\\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\\/?)?>`),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside[`attr-value`].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside[`class-name`]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore(`inside`,`attr-name`,{spread:{pattern:a(`<SPREAD>`),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore(`inside`,`special-attr`,{script:{pattern:a(`=<BRACES>`),alias:`language-javascript`,inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:`punctuation`},rest:e.languages.jsx}}},e.languages.jsx.tag);var o=function(e){return e?typeof e==`string`?e:typeof e.content==`string`?e.content:e.content.map(o).join(``):``},s=function(t){for(var n=[],r=0;r<t.length;r++){var i=t[r],a=!1;if(typeof i!=`string`&&(i.type===`tag`&&i.content[0]&&i.content[0].type===`tag`?i.content[0].content[0].content===`</`?n.length>0&&n[n.length-1].tagName===o(i.content[0].content[1])&&n.pop():i.content[i.content.length-1].content===`/>`||n.push({tagName:o(i.content[0].content[1]),openedBraces:0}):n.length>0&&i.type===`punctuation`&&i.content===`{`?n[n.length-1].openedBraces++:n.length>0&&n[n.length-1].openedBraces>0&&i.type===`punctuation`&&i.content===`}`?n[n.length-1].openedBraces--:a=!0),(a||typeof i==`string`)&&n.length>0&&n[n.length-1].openedBraces===0){var c=o(i);r<t.length-1&&(typeof t[r+1]==`string`||t[r+1].type===`plain-text`)&&(c+=o(t[r+1]),t.splice(r+1,1)),r>0&&(typeof t[r-1]==`string`||t[r-1].type===`plain-text`)&&(c=o(t[r-1])+c,t.splice(r-1,1),r--),t[r]=new e.Token(`plain-text`,c,null,c)}i.content&&typeof i.content!=`string`&&s(i.content)}};e.hooks.add(`after-tokenize`,function(e){e.language!==`jsx`&&e.language!==`tsx`||s(e.tokens)})})(e)}vD.displayName=`typescript`,vD.aliases=[`ts`];function vD(e){e.register(lD),(function(e){e.languages.typescript=e.languages.extend(`javascript`,{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript[`literal-property`];var t=e.languages.extend(`typescript`,{});delete t[`class-name`],e.languages.typescript[`class-name`].inside=t,e.languages.insertBefore(`typescript`,`function`,{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:`operator`},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:`class-name`,inside:t}}}}),e.languages.ts=e.languages.typescript})(e)}yD.displayName=`tsx`,yD.aliases=[];function yD(e){e.register(_D),e.register(vD),(function(e){var t=e.util.clone(e.languages.typescript);e.languages.tsx=e.languages.extend(`jsx`,t),delete e.languages.tsx.parameter,delete e.languages.tsx[`literal-property`];var n=e.languages.tsx.tag;n.pattern=RegExp(`(^|[^\\w$]|(?=<\\/))(?:`+n.pattern.source+`)`,n.pattern.flags),n.lookbehind=!0})(e)}bD.displayName=`yaml`,bD.aliases=[`yml`];function bD(e){(function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r=`(?:`+n.source+`(?:[ ]+`+t.source+`)?|`+t.source+`(?:[ ]+`+n.source+`)?)`,i=`(?:[^\\s\\x00-\\x08\\x0e-\\x1f!"#%&'*,\\-:>?@[\\]\`{|}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]|[?:-]<PLAIN>)(?:[ \\t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*`.replace(/<PLAIN>/g,function(){return`[^\\s\\x00-\\x08\\x0e-\\x1f,[\\]{}\\x7f-\\x84\\x86-\\x9f\\ud800-\\udfff\\ufffe\\uffff]`}),a=`"(?:[^"\\\\\\r\\n]|\\\\.)*"|'(?:[^'\\\\\\r\\n]|\\\\.)*'`;function o(e,t){t=(t||``).replace(/m/g,``)+`m`;var n=`([:\\-,[{]\\s*(?:\\s<<prop>>[ \\t]+)?)(?:<<value>>)(?=[ \\t]*(?:$|,|\\]|\\}|(?:[\\r\\n]\\s*)?#))`.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return e});return RegExp(n,t)}e.languages.yaml={scalar:{pattern:RegExp(`([\\-:]\\s*(?:\\s<<prop>>[ \\t]+)?[|>])[ \\t]*(?:((?:\\r?\\n|\\r)[ \\t]+)\\S[^\\r\\n]*(?:\\2[^\\r\\n]+)*)`.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:`string`},comment:/#.*/,key:{pattern:RegExp(`((?:^|[:\\-,[{\\r\\n?])[ \\t]*(?:<<prop>>[ \\t]+)?)<<key>>(?=\\s*:\\s)`.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return`(?:`+i+`|`+a+`)`})),lookbehind:!0,greedy:!0,alias:`atrule`},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:`important`},datetime:{pattern:o(`\\d{4}-\\d\\d?-\\d\\d?(?:[tT]|[ \\t]+)\\d\\d?:\\d{2}:\\d{2}(?:\\.\\d*)?(?:[ \\t]*(?:Z|[-+]\\d\\d?(?::\\d{2})?))?|\\d{4}-\\d{2}-\\d{2}|\\d\\d?:\\d{2}(?::\\d{2}(?:\\.\\d*)?)?`),lookbehind:!0,alias:`number`},boolean:{pattern:o(`false|true`,`i`),lookbehind:!0,alias:`important`},null:{pattern:o(`null|~`,`i`),lookbehind:!0,alias:`important`},string:{pattern:o(a),lookbehind:!0,greedy:!0},number:{pattern:o(`[+-]?(?:0x[\\da-f]+|0o[0-7]+|(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:e[+-]?\\d+)?|\\.inf|\\.nan)`,`i`),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml})(e)}qE.register(nD),qE.register(aD),qE.register(oD),qE.register(sD),qE.register(cD),qE.register(lD),qE.register(uD),qE.register(fD),qE.register(dD),qE.register(pD),qE.register(mD),qE.register(hD),qE.register(gD),qE.register(yD),qE.register(vD),qE.register(bD);var xD=new Set([`bash`,`cpp`,`css`,`go`,`java`,`javascript`,`json`,`markdown`,`markup`,`python`,`ruby`,`rust`,`sql`,`tsx`,`typescript`,`yaml`]),SD={ts:`typescript`,tsx:`tsx`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jsx:`tsx`,rs:`rust`,go:`go`,c:`cpp`,h:`cpp`,cpp:`cpp`,cc:`cpp`,hpp:`cpp`,java:`java`,py:`python`,rb:`ruby`,sh:`bash`,bash:`bash`,zsh:`bash`,json:`json`,yaml:`yaml`,yml:`yaml`,md:`markdown`,markdown:`markdown`,html:`markup`,htm:`markup`,xml:`markup`,svg:`markup`,css:`css`,scss:`css`,sql:`sql`};function CD(e){if(e===void 0)return;let t=e.lastIndexOf(`.`);if(t===-1)return;let n=SD[e.slice(t+1).toLowerCase()];if(!(n===void 0||!xD.has(n)))return n}function wD(e,t){if(t!==void 0)try{return wE(e,{highlight:!0,refractor:qE,language:t})}catch{return}}var TD=800,ED=({change:e,side:t})=>{if(t===`old`)return null;let n=e.type===`normal`?e.newLineNumber:e.lineNumber;return n===void 0?null:(0,L.jsx)(`span`,{children:n})},DD=({change:e,side:t})=>e.type===`normal`?(0,L.jsx)(`span`,{children:t===`old`?e.oldLineNumber:e.newLineNumber}):e.type===`insert`&&t===`new`||e.type===`delete`&&t===`old`?(0,L.jsx)(`span`,{children:e.lineNumber}):null;function OD({diff:e,viewType:t=`unified`}){let n=[],r=`fallback`,i=MD(e);if(i!==void 0){let e=ND(i);PD(e)&&(n=e,r=`pi`)}if(r===`fallback`){let t=ND(e);PD(t)&&(n=t,r=`raw`)}if(r===`fallback`&&FD(e)){let t=ND(jD+e.replace(/^\n+/,``));PD(t)&&(n=t,r=`synthetic`)}if(r===`fallback`)return typeof console<`u`&&console.warn(`[DiffBlock] parseDiff produced no hunks; rendering colored fallback. Diff prefix:`,e.slice(0,200)),(0,L.jsx)(ID,{diff:e});let a=t===`split`?DD:ED;return(0,L.jsx)(`div`,{className:`pi-diff-block ${t===`split`?`pi-diff-split`:`pi-diff-unified`} overflow-auto px-2 pb-2 text-[11px]`,children:n.map(e=>(0,L.jsx)(kD,{file:e,viewType:t,renderGutter:a},`${e.oldPath??``}:${e.newPath??``}`))})}function kD({file:e,viewType:t,renderGutter:n}){let[r,i]=(0,v.useState)(!1),a=CD((e.newPath??e.oldPath??``).replace(/^[ab]\//,``)),o=e.hunks.reduce((e,t)=>e+t.changes.length,0),s=o>TD&&!r,c=s?AD(e.hunks,TD):e.hunks,l=wD(c,a);return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(qT,{viewType:t,diffType:e.type,hunks:c,renderGutter:n,tokens:l??null,children:e=>e.map(e=>(0,L.jsx)(HT,{hunk:e},e.content))}),s&&(0,L.jsxs)(`button`,{onClick:()=>i(!0),className:`my-1 w-full rounded border border-neutral-700 bg-neutral-900/60 px-3 py-1 text-[11px] text-neutral-300 hover:border-neutral-500 hover:bg-neutral-900`,title:`Showing ~${TD} of ${o} lines — large diffs slow the renderer; click to render the rest.`,children:[`Show all (`,o,` lines, `,e.hunks.length,` hunks)`]})]})}function AD(e,t){let n=[],r=0;for(let i of e)if(n.length>0&&r+i.changes.length>t||(n.push(i),r+=i.changes.length,r>=t))break;return n}var jD=`--- a/file
329
+ +++ b/file
330
+ `;function MD(e){let t=e.split(`
331
+ `),n=/^([+\- ]) *(\d+)(?: (.*))?$/,r=/^ +\.\.\.$/,i=[],a,o=0,s=()=>{a!==void 0&&a.body.length>0&&i.push(a),a=void 0};for(let e of t){if(e.length===0)continue;if(r.test(e)){s();continue}let t=n.exec(e);if(t===null)return;o+=1;let i=t[1],c=Number.parseInt(t[2]??``,10),l=t[3]??``;a===void 0&&(a={oldStart:c,newStart:c,oldCount:0,newCount:0,body:[]}),i===` `?(a.body.push(` `+l),a.oldCount+=1,a.newCount+=1):i===`-`?(a.body.push(`-`+l),a.oldCount+=1):(a.body.push(`+`+l),a.newCount+=1)}if(s(),!(o===0||i.length===0))return jD+i.map(e=>`@@ -${e.oldStart},${e.oldCount} +${e.newStart},${e.newCount} @@\n`+e.body.join(`
332
+ `)).join(`
333
+ `)+`
334
+ `}function ND(e){try{return Xx(e)}catch{return[]}}function PD(e){return e.length>0&&e.some(e=>e.hunks.length>0)}function FD(e){let t=/^@@ /m.test(e),n=/^--- /m.test(e)&&/^\+\+\+ /m.test(e);return t&&!n}function ID({diff:e}){return(0,L.jsx)(`pre`,{className:`overflow-auto px-3 pb-2 font-mono text-[11px] leading-tight`,children:e.split(`
335
+ `).map((e,t)=>(0,L.jsx)(`div`,{className:LD(e),children:e.length===0?`\xA0`:e},t))})}function LD(e){return e.startsWith(`+++`)||e.startsWith(`---`)?`text-neutral-500`:e.startsWith(`@@`)?`bg-neutral-900 text-cyan-400`:e.startsWith(`+`)?`bg-emerald-950/60 text-emerald-200`:e.startsWith(`-`)?`bg-red-950/60 text-red-200`:`text-neutral-400`}var RD=`pi-forge/model/`,zD=`pi-forge/sessionTree.view`;function BD({sessionId:e,projectId:t,onClose:n}){let r=$n(t=>t.streamingBySession[e]??!1),i=$n(e=>e.setActiveSession),a=$n(e=>e.loadSessionsForProject),o=$n(e=>e.reloadMessages),s=$n(e=>e.setPendingDraft),c=$n(t=>t.agentEndCountBySession[e]??0),[l,u]=(0,v.useState)(void 0),[d,f]=(0,v.useState)(!0),[p,m]=(0,v.useState)(void 0),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)(void 0),b=async()=>{f(!0),m(void 0);try{u(await I.getSessionTree(e))}catch(e){m(e instanceof M?e.code:e.message)}finally{f(!1)}};(0,v.useEffect)(()=>{b()},[e]),(0,v.useEffect)(()=>{c!==0&&b()},[c]);let x=(0,v.useMemo)(()=>l===void 0?[]:YD(l),[l]),[S,C]=(0,v.useState)(()=>{try{return localStorage.getItem(zD)===`list`?`list`:`graph`}catch{return`graph`}}),w=e=>{C(e);try{localStorage.setItem(zD,e)}catch{}},T=e=>{if(h||l?.leafId===e)return;let t=qD(l,e);if(r||t){y({entryId:e,abandonsBranch:t,isStreaming:r});return}E(e,{})},E=async(t,n)=>{g(!0),m(void 0);try{await I.navigateSession(e,t,n),await b(),o(e)}catch(e){m(e instanceof M?e.code:e.message)}finally{g(!1)}},D=async(r,o={})=>{if(!h){g(!0),m(void 0);try{let c=o.parentId!==void 0&&o.parentId!==null?o.parentId:r,l=await I.forkSession(e,c);try{let t=localStorage.getItem(RD+e);t!==null&&t.length>0&&localStorage.setItem(RD+l.sessionId,t)}catch{}o.editDraft!==void 0&&o.editDraft.length>0&&s(l.sessionId,o.editDraft),await a(t),i(l.sessionId),n()}catch(e){m(e instanceof M?e.code:e.message),g(!1)}}};return(0,L.jsxs)(`div`,{className:`fixed inset-0 z-40 flex items-center justify-center bg-black/60 px-4 py-8`,onClick:n,children:[(0,L.jsxs)(`div`,{onClick:e=>e.stopPropagation(),className:`flex h-[min(90vh,900px)] w-[min(95vw,1400px)] flex-col overflow-hidden rounded-lg border border-neutral-800 bg-neutral-950 shadow-2xl`,children:[(0,L.jsxs)(`header`,{className:`flex items-center justify-between border-b border-neutral-800 px-4 py-2.5`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(Se,{size:14,className:`text-neutral-400`}),(0,L.jsx)(`h2`,{className:`text-sm font-semibold text-neutral-100`,children:`Session tree`}),h&&(0,L.jsx)(Ee,{size:11,className:`animate-spin text-neutral-500`})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,L.jsxs)(`div`,{className:`mr-1 flex overflow-hidden rounded border border-neutral-700`,children:[(0,L.jsx)(`button`,{onClick:()=>w(`list`),className:`px-2 py-0.5 text-[10px] uppercase tracking-wider ${S===`list`?`bg-neutral-700 text-neutral-100`:`text-neutral-400 hover:bg-neutral-800`}`,title:`Vertical list view`,children:`List`}),(0,L.jsx)(`button`,{onClick:()=>w(`graph`),className:`px-2 py-0.5 text-[10px] uppercase tracking-wider ${S===`graph`?`bg-neutral-700 text-neutral-100`:`text-neutral-400 hover:bg-neutral-800`}`,title:`Branching graph view (turn-grouped)`,children:`Graph`})]}),(0,L.jsx)(`button`,{onClick:()=>void b(),disabled:d||h,className:`rounded p-1 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200 disabled:opacity-40`,title:`Refresh tree`,children:(0,L.jsx)(Ne,{size:13,className:d?`animate-spin`:``})}),(0,L.jsx)(`button`,{onClick:n,className:`rounded p-2 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200`,title:`Close (Esc)`,children:(0,L.jsx)(Ke,{size:20})})]})]}),p!==void 0&&(0,L.jsx)(`div`,{className:`border-b border-red-700/40 bg-red-900/20 px-4 py-1.5 text-xs text-red-300`,children:p}),(0,L.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-2 py-2`,children:[d&&l===void 0&&(0,L.jsx)(`div`,{className:`px-4 py-6 text-center text-xs italic text-neutral-500`,children:`Loading tree…`}),!d&&x.length===0&&(0,L.jsx)(`div`,{className:`px-4 py-6 text-center text-xs italic text-neutral-500`,children:`No entries yet.`}),S===`list`?(0,L.jsx)(`ul`,{className:`space-y-0.5`,children:x.map(e=>(0,L.jsx)(KD,{node:e,disabled:h,onNavigate:()=>void T(e.id),onFork:()=>void D(e.id,{...e.type===`message`&&e.role===`user`?{editDraft:e.preview??``,parentId:e.parentId}:{}})},e.id))}):l===void 0?null:(0,L.jsx)(aO,{tree:l,disabled:h,onNavigate:e=>T(e),onForkAfterTurn:e=>void D(e)})]}),(0,L.jsxs)(`footer`,{className:`flex items-center justify-between border-t border-neutral-800 bg-neutral-900/40 px-4 py-2 text-[10px] text-neutral-500`,children:[(0,L.jsx)(`span`,{children:`Click a row to navigate · fork icon on user messages to branch from that point`}),l!==void 0&&(0,L.jsxs)(`span`,{children:[l.entries.length,` `,l.entries.length===1?`entry`:`entries`]})]})]}),(0,L.jsx)(VD,{state:_,onCancel:()=>y(void 0),onConfirm:e=>{if(_===void 0)return;let{entryId:t}=_;y(void 0),E(t,e)}})]})}function VD({state:e,onCancel:t,onConfirm:n}){let[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(``),l=(0,v.useRef)(null);(0,v.useEffect)(()=>{e!==void 0&&(i(``),o(!1),c(``))},[e]);let u=e!==void 0,d=e?.abandonsBranch===!0,f=()=>{let e={},t=r.trim();if(t.length>0&&(e.label=t),a){e.summarize=!0;let t=s.trim();t.length>0&&(e.customInstructions=t)}n(e)};return(0,L.jsx)(xr,{open:u,onClose:t,title:`Navigate session leaf`,width:d?`max-w-md`:`max-w-sm`,...d?{initialFocusRef:l}:{},children:(0,L.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),f()},className:`flex flex-col gap-3 px-4 py-3 text-xs text-neutral-200`,children:[e?.isStreaming===!0&&(0,L.jsx)(`p`,{className:`rounded border border-amber-700/50 bg-amber-900/20 px-2 py-1.5 text-amber-200`,children:`The agent is currently running. Navigating will abort the in-progress turn.`}),d?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`p`,{className:`text-neutral-400`,children:`You’re leaving the current branch behind. The tip stays on the tree (you can navigate back to it any time), but you can also bookmark + summarize it before moving on.`}),(0,L.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,L.jsxs)(`span`,{className:`text-neutral-500`,children:[`Label for the abandoned branch tip`,` `,(0,L.jsx)(`span`,{className:`text-neutral-600`,children:`(optional)`})]}),(0,L.jsx)(`input`,{ref:l,type:`text`,value:r,onChange:e=>i(e.target.value),placeholder:`e.g. wrong-approach`,maxLength:200,className:`rounded border border-neutral-700 bg-neutral-950 px-2 py-1 text-neutral-100 outline-none focus:border-neutral-500`})]}),(0,L.jsxs)(`label`,{className:`flex items-start gap-2 rounded border border-neutral-800 bg-neutral-950 px-2 py-1.5`,children:[(0,L.jsx)(`input`,{type:`checkbox`,checked:a,onChange:e=>o(e.target.checked),className:`mt-0.5 h-3 w-3`}),(0,L.jsxs)(`span`,{className:`flex-1 text-neutral-300`,children:[`Have pi write a `,(0,L.jsx)(`code`,{className:`font-mono text-[11px]`,children:`branch_summary`}),` entry capturing what this branch did. Costs one extra LLM call.`]})]}),a&&(0,L.jsxs)(`label`,{className:`flex flex-col gap-1`,children:[(0,L.jsxs)(`span`,{className:`text-neutral-500`,children:[`Custom summarizer instructions`,` `,(0,L.jsx)(`span`,{className:`text-neutral-600`,children:`(optional)`})]}),(0,L.jsx)(`textarea`,{value:s,onChange:e=>c(e.target.value),rows:3,placeholder:`e.g. Focus on what files were changed and why`,className:`rounded border border-neutral-700 bg-neutral-950 px-2 py-1 font-mono text-[11px] text-neutral-100 outline-none focus:border-neutral-500`})]})]}):(0,L.jsx)(`p`,{className:`text-neutral-400`,children:`Confirm navigation?`}),(0,L.jsxs)(`footer`,{className:`flex justify-end gap-2 pt-1`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:t,className:`rounded-md border border-neutral-700 px-3 py-1 text-xs text-neutral-200 hover:bg-neutral-800`,children:`Cancel`}),(0,L.jsx)(`button`,{type:`submit`,className:`rounded-md px-3 py-1 text-xs font-medium ${e?.isStreaming===!0?`bg-amber-600 text-amber-50 hover:bg-amber-500`:`bg-neutral-100 text-neutral-900 hover:bg-white`}`,children:e?.isStreaming===!0?`Abort & navigate`:`Navigate`})]})]})})}var HD=4,UD=18,WD=10,GD=8;function KD({node:e,disabled:t,onNavigate:n,onFork:r}){let i=Math.min(e.depth,HD)*UD+Math.min(e.branchLevel,GD)*WD,a=e.type===`message`&&e.role===`user`,o=!e.onActivePath,s=QD(e);return(0,L.jsx)(`li`,{className:`group min-w-0`,style:{paddingLeft:`${i}px`},children:(0,L.jsxs)(`div`,{className:`flex min-w-0 items-start gap-1.5 rounded border px-2 py-1.5 ${e.isLeaf?`border-emerald-700/60 bg-emerald-900/10`:e.onActivePath?`border-neutral-700 bg-neutral-900/40`:`border-neutral-800/50 bg-transparent`} ${o?`opacity-60`:``}`,style:e.branchLevel>0?{boxShadow:`inset 3px 0 0 ${ZD(e.branchLevel)}`}:void 0,children:[(0,L.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5 pt-0.5`,children:[e.isLeaf?(0,L.jsx)(`span`,{className:`inline-block w-[22px]`,"aria-hidden":`true`}):(0,L.jsx)(`button`,{onClick:n,disabled:t,className:`rounded p-1 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-100 disabled:opacity-40`,title:`Navigate the session leaf to this entry`,children:(0,L.jsx)(ke,{size:11})}),a?(0,L.jsx)(`button`,{onClick:r,disabled:t,className:`rounded p-1 text-neutral-500 hover:bg-neutral-800 hover:text-emerald-300 disabled:opacity-40`,title:`Fork BEFORE this message — opens a new session with the message text loaded into the input for editing.`,children:(0,L.jsx)(Se,{size:11})}):(0,L.jsx)(`span`,{className:`inline-block w-[22px]`,"aria-hidden":`true`})]}),(0,L.jsxs)(`button`,{onClick:n,disabled:t||e.isLeaf,className:`flex min-w-0 flex-1 flex-col items-start gap-0.5 text-left disabled:cursor-default`,title:e.isLeaf?`Current leaf`:`Navigate the session leaf to this entry`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,L.jsx)(`span`,{className:`rounded px-1.5 py-0.5 text-[9px] uppercase tracking-wider ${e.role===`user`?`bg-sky-900/40 text-sky-300`:e.role===`assistant`?`bg-violet-900/40 text-violet-300`:e.type===`branch_summary`?`bg-amber-900/40 text-amber-300`:e.type===`compaction`?`bg-fuchsia-900/40 text-fuchsia-300`:`bg-neutral-800 text-neutral-400`}`,children:s}),e.isBranchHead&&(0,L.jsxs)(`span`,{className:`rounded px-1.5 py-0.5 text-[9px] uppercase tracking-wider`,style:{background:`${ZD(e.branchLevel)}33`,color:ZD(e.branchLevel)},title:`First entry of a divergent branch`,children:[`branch `,e.branchLevel]}),e.label!==void 0&&e.label.length>0&&(0,L.jsxs)(`span`,{className:`rounded bg-neutral-800 px-1.5 py-0.5 text-[9px] text-neutral-300`,children:[`★ `,e.label]}),e.isLeaf&&(0,L.jsx)(`span`,{className:`rounded bg-emerald-900/40 px-1.5 py-0.5 text-[9px] text-emerald-300`,children:`leaf`}),e.siblings>1&&(0,L.jsxs)(`span`,{className:`text-[9px] text-amber-400`,title:`${e.siblings} branches diverge from this point`,children:[`⑂ `,e.siblings]}),(0,L.jsx)(`span`,{className:`text-[9px] text-neutral-600`,children:new Date(e.timestamp).toLocaleString()})]}),e.preview!==void 0&&(0,L.jsx)(`p`,{className:`w-full truncate text-[11px] text-neutral-300`,children:e.preview})]})]})})}function qD(e,t){if(e===void 0||e.leafId===null||e.leafId===t)return!1;let n=new Map(e.entries.map(e=>[e.id,e])),r=e.leafId;for(;r!==null;){if(r===t)return!1;r=n.get(r)?.parentId??null}return!0}function JD(e){return e.type!==`message`||e.role===`user`?0:e.role===`tool`?2:1}function YD(e){let t=new Map;for(let n of e.entries){let e=t.get(n.parentId);e===void 0?t.set(n.parentId,[n]):e.push(n)}for(let e of t.values())e.sort((e,t)=>e.timestamp.localeCompare(t.timestamp));let n=new Set(e.branchIds),r=[],i=(a,o)=>{let s=t.get(a);if(s===void 0)return;let c=s.length;s.forEach((t,a)=>{let s=a===0?o:o+1,l=a>0&&s>0;r.push({...t,depth:JD(t),branchLevel:s,onActivePath:n.has(t.id),isLeaf:e.leafId===t.id,siblings:c,isBranchHead:l}),i(t.id,s)})};return i(null,0),r}var XD=[`#f59e0b`,`#0ea5e9`,`#ec4899`,`#10b981`,`#8b5cf6`,`#f97316`];function ZD(e){return e<=0?`transparent`:XD[(e-1)%XD.length]}function QD(e){return e.type===`message`?e.role??`message`:e.type===`thinking_level_change`?`thinking`:e.type===`model_change`?`model`:e.type===`compaction`?`compact`:e.type===`branch_summary`?`branch`:e.type===`label`?`label`:e.type===`session_info`?`info`:e.type===`custom`?`custom`:e.type===`custom_message`?`extension`:e.type}var $D=220,eO=78,tO=64,nO=28,rO=24;function iO(e){let t=new Map(e.entries.map(e=>[e.id,e])),n=new Map;for(let t of e.entries){let e=n.get(t.parentId);e===void 0?n.set(t.parentId,[t]):e.push(t)}for(let e of n.values())e.sort((e,t)=>e.timestamp.localeCompare(t.timestamp));let r=new Map,i=e=>{let n=r.get(e.id);if(n!==void 0)return n;if(e.type===`message`&&e.role===`user`||e.parentId===null)return r.set(e.id,e.id),e.id;let a=t.get(e.parentId);if(a===void 0)return r.set(e.id,e.id),e.id;let o=i(a);return r.set(e.id,o),o};for(let t of e.entries)i(t);let a=new Map;for(let t of e.entries){if(r.get(t.id)!==t.id)continue;let e=t.type===`message`&&t.role===`user`;a.set(t.id,{id:t.id,parentId:null,col:0,row:0,isOnActivePath:!1,isLeafTurn:!1,hasMultipleChildren:!1,childCount:0,roleLabel:e?`user`:QD(t),preview:t.preview??``,insideCounts:{assistant:0,tool:0,thinking:0,meta:0},isUserAnchor:e,anchorParentId:t.parentId,lastEntryId:t.id,timestamp:t.timestamp})}for(let n of e.entries){let e=r.get(n.id),i=a.get(e);if(i===void 0)continue;let o=t.get(i.lastEntryId);(o===void 0||n.timestamp.localeCompare(o.timestamp)>0)&&(i.lastEntryId=n.id),e!==n.id&&(n.type===`message`&&n.role===`assistant`?i.insideCounts.assistant+=1:n.type===`message`&&(n.role===`tool`||n.role===`toolResult`)?i.insideCounts.tool+=1:(n.type===`message`&&n.role,i.insideCounts.meta+=1))}for(let e of a.values()){if(e.anchorParentId===null)continue;let t=r.get(e.anchorParentId);t!==void 0&&t!==e.id&&(e.parentId=t)}let o=new Map;for(let e of a.values()){let t=o.get(e.parentId);t===void 0?o.set(e.parentId,[e]):t.push(e)}for(let e of o.values())e.sort((e,t)=>e.timestamp.localeCompare(t.timestamp));for(let e of a.values()){let t=o.get(e.id)??[];e.childCount=t.length,e.hasMultipleChildren=t.length>1}let s=new Set(e.branchIds),c=e.leafId===null?void 0:r.get(e.leafId);for(let e of a.values())e.isOnActivePath=s.has(e.id),e.isLeafTurn=c===e.id;let l=0,u=new Map,d=(e,t)=>{(o.get(e)??[]).forEach((e,n)=>{let r;n===0?r=t:(r=l,l+=1),e.col=r,u.set(e.id,r),d(e.id,r)})};(o.get(null)??[]).forEach((e,t)=>{t===0?(e.col=0,l=Math.max(l,1)):(e.col=l,l+=1),u.set(e.id,e.col),d(e.id,e.col)});let f=(e,t)=>{let n=t.get(e.id);if(n!==void 0)return n;if(e.parentId===null)return t.set(e.id,0),0;let r=a.get(e.parentId);if(r===void 0)return t.set(e.id,0),0;let i=f(r,t)+1;return t.set(e.id,i),i},p=new Map;for(let e of a.values())e.row=f(e,p);return[...a.values()].sort((e,t)=>e.row===t.row?e.col-t.col:e.row-t.row)}function aO({tree:e,disabled:t,onNavigate:n,onForkAfterTurn:r}){let i=(0,v.useMemo)(()=>iO(e),[e]),a=(0,v.useMemo)(()=>{if(i.length===0)return{width:0,height:0};let e=i.reduce((e,t)=>Math.max(e,t.col),0),t=i.reduce((e,t)=>Math.max(e,t.row),0);return{width:rO*2+(e+1)*$D+e*tO,height:rO*2+(t+1)*eO+t*nO}},[i]);if(i.length===0)return(0,L.jsx)(`div`,{className:`px-4 py-6 text-center text-xs italic text-neutral-500`,children:`No turns to render.`});let o=e=>rO+e*($D+tO),s=e=>rO+e*(eO+nO),c=new Map(i.map(e=>[e.id,e]));return(0,L.jsxs)(`div`,{className:`relative`,style:{width:`${a.width}px`,height:`${a.height}px`},children:[(0,L.jsx)(`svg`,{"aria-hidden":`true`,className:`pointer-events-none absolute left-0 top-0`,width:a.width,height:a.height,children:i.map(e=>{if(e.parentId===null)return null;let t=c.get(e.parentId);if(t===void 0)return null;let n=o(t.col)+$D/2,r=s(t.row)+eO,i=o(e.col)+$D/2,a=s(e.row),l=e.isOnActivePath&&t.isOnActivePath;return(0,L.jsx)(`path`,{d:n===i?`M ${n} ${r} L ${i} ${a}`:(()=>{let e=r+(a-r)/2,t=i>n,o=t?n+8:n-8,s=t?i-8:i+8;return[`M ${n} ${r}`,`L ${n} ${e-8}`,`Q ${n} ${e} ${o} ${e}`,`L ${s} ${e}`,`Q ${i} ${e} ${i} ${e+8}`,`L ${i} ${a}`].join(` `)})(),fill:`none`,stroke:l?`#a3a3a3`:`#404040`,strokeWidth:l?1.5:1,strokeOpacity:l?.85:.5},e.id)})}),i.map(e=>(0,L.jsx)(oO,{turn:e,x:o(e.col),y:s(e.row),disabled:t,onNavigate:()=>n(e.lastEntryId),onForkAfterTurn:()=>r(e.lastEntryId)},e.id))]})}function oO({turn:e,x:t,y:n,disabled:r,onNavigate:i,onForkAfterTurn:a}){let o=!e.isOnActivePath;return(0,L.jsx)(`div`,{className:`absolute overflow-hidden rounded-lg border ${e.isLeafTurn?`border-emerald-700/70 bg-emerald-900/15`:e.isOnActivePath?`border-neutral-600 bg-neutral-900`:`border-neutral-800 bg-neutral-950`} ${o?`opacity-60`:``}`,style:{left:`${t}px`,top:`${n}px`,width:`${$D}px`,height:`${eO}px`},children:(0,L.jsxs)(`button`,{onClick:i,disabled:r||e.isLeafTurn,className:`flex h-full w-full flex-col items-stretch gap-1 px-2 py-1.5 text-left disabled:cursor-default`,title:e.isLeafTurn?`Current leaf turn`:`Navigate to this turn`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,L.jsx)(`span`,{className:`rounded px-1.5 py-0.5 text-[9px] uppercase tracking-wider ${e.roleLabel===`user`?`bg-sky-900/40 text-sky-300`:e.roleLabel===`compact`?`bg-fuchsia-900/40 text-fuchsia-300`:e.roleLabel===`branch`?`bg-amber-900/40 text-amber-300`:`bg-neutral-800 text-neutral-400`}`,children:e.roleLabel}),e.isLeafTurn&&(0,L.jsx)(`span`,{className:`rounded bg-emerald-900/40 px-1.5 py-0.5 text-[9px] text-emerald-300`,children:`leaf`}),e.hasMultipleChildren&&(0,L.jsxs)(`span`,{className:`text-[9px] text-amber-400`,title:`${e.childCount} branches diverge from here`,children:[`⑂ `,e.childCount]}),(0,L.jsx)(`button`,{onClick:e=>{e.stopPropagation(),a()},disabled:r,className:`ml-auto rounded p-0.5 text-neutral-500 hover:bg-neutral-800 hover:text-emerald-300 disabled:opacity-40`,title:`Fork AFTER this turn — opens a new session that includes this turn's full output, ready for the next prompt.`,children:(0,L.jsx)(Se,{size:11})})]}),(0,L.jsx)(`p`,{className:`line-clamp-2 flex-1 text-[11px] text-neutral-200`,children:e.preview.length>0?e.preview:(0,L.jsx)(`em`,{className:`text-neutral-500`,children:`(no text)`})}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-[9px] text-neutral-500`,children:[e.insideCounts.assistant>0&&(0,L.jsxs)(`span`,{title:`Assistant messages within this turn`,children:[e.insideCounts.assistant,`a`]}),e.insideCounts.tool>0&&(0,L.jsxs)(`span`,{title:`Tool results within this turn`,children:[e.insideCounts.tool,`t`]}),e.insideCounts.thinking>0&&(0,L.jsxs)(`span`,{title:`Thinking blocks`,children:[e.insideCounts.thinking,`th`]}),e.insideCounts.meta>0&&(0,L.jsxs)(`span`,{title:`Meta entries (model_change, branch_summary, etc.)`,children:[e.insideCounts.meta,`m`]}),(0,L.jsx)(`span`,{className:`ml-auto`,children:new Date(e.timestamp).toLocaleTimeString()})]})]})})}var sO=new Set([`single`,`parallel`,`chain`,`management`]);function cO(e){if(!e.endsWith(`.jsonl`))return;let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`)),n=(t>=0?e.slice(t+1):e).slice(0,-6);if(n.length!==0)return n}function lO(e){if(typeof e!=`object`||!e)return{mode:`unknown`,results:[]};let t=e,n=sO.has(t.mode)?t.mode:`unknown`,r=typeof t.runId==`string`&&t.runId.length>0?t.runId:void 0,i=t.context===`fresh`||t.context===`fork`?t.context:void 0,a=[];if(Array.isArray(t.results))for(let e of t.results){if(typeof e!=`object`||!e)continue;let t=e,n={agent:typeof t.agent==`string`?t.agent:`agent`,task:typeof t.task==`string`?t.task:``,exitCode:typeof t.exitCode==`number`?t.exitCode:0};if(typeof t.sessionFile==`string`&&t.sessionFile.length>0){n.sessionFile=t.sessionFile;let e=cO(t.sessionFile);e!==void 0&&(n.sessionId=e)}typeof t.finalOutput==`string`&&t.finalOutput.length>0&&(n.finalOutput=t.finalOutput),a.push(n)}return{mode:n,...r===void 0?{}:{runId:r},...i===void 0?{}:{context:i},results:a}}var uO=(0,v.createContext)({viewType:`unified`,setViewType:()=>void 0}),dO=`forge.chat.viewType`;function fO(){try{return localStorage.getItem(dO)===`split`?`split`:`unified`}catch{return`unified`}}function pO({sessionId:e}){let t=$n(t=>t.messagesBySession[e]??Wn),n=$n(t=>t.compactionsBySession[e]??Gn),r=$n(t=>t.streamingTextBySession[e]??``),i=$n(t=>t.streamingBySession[e]??!1),a=$n(t=>t.activeToolBySession[e]),o=$n(t=>t.bannerBySession[e]),s=$n(t=>t.queuedBySession[e]),c=$n(e=>e.openStream),l=$n(e=>e.closeStream),[u,d]=(0,v.useState)(fO),f=e=>{d(e);try{localStorage.setItem(dO,e)}catch{}},p=kn(),[m,h]=(0,v.useState)(!1);(0,v.useEffect)(()=>(c(e),()=>{l(e)}),[e,c,l]);let g=(0,v.useRef)(null),_=(0,v.useRef)(!0),y=()=>{let e=g.current;e!==null&&(_.current=e.scrollHeight-e.scrollTop-e.clientHeight<=96)};(0,v.useEffect)(()=>{let e=g.current;e!==null&&_.current&&(e.scrollTop=e.scrollHeight)},[t,r,i]);let b=(0,v.useRef)(0);return(0,v.useEffect)(()=>{let e=t.reduce((e,t)=>t.role===`user`?e+1:e,0);if(e>b.current){let e=g.current;e!==null&&(e.scrollTop=e.scrollHeight),_.current=!0}b.current=e},[t]),(0,L.jsxs)(uO.Provider,{value:{viewType:u,setViewType:f},children:[(0,L.jsxs)(`div`,{className:`flex flex-1 flex-col overflow-hidden`,children:[(0,L.jsx)(`div`,{className:`flex items-center justify-end gap-1 border-b border-neutral-800 bg-neutral-900/30 px-3 py-1`,children:(0,L.jsxs)(`button`,{onClick:()=>h(!0),className:`flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200`,title:`Open session tree (navigate / fork from any prior point)`,children:[(0,L.jsx)(Se,{size:11}),`Tree`]})}),o!==void 0&&(0,L.jsx)(`div`,{className:`border-b border-amber-700/40 bg-amber-900/20 px-6 py-2 text-xs text-amber-200`,children:o}),(0,L.jsxs)(`div`,{ref:g,onScroll:y,className:`flex-1 overflow-y-auto px-6 py-4`,children:[t.length===0&&r.length===0&&!i&&(0,L.jsx)(`p`,{className:`mt-12 text-center text-sm text-neutral-500`,children:`No messages yet. Send a prompt to get started.`}),(0,L.jsxs)(`div`,{className:`chat-message-list mx-auto max-w-3xl space-y-4`,children:[(()=>{let e=new Map,r=new Set;for(let n of t)n.role===`toolResult`&&typeof n.toolCallId==`string`&&e.set(n.toolCallId,n);for(let e of t)if(!(e.role!==`assistant`||!Array.isArray(e.content)))for(let t of e.content)t.type===`toolCall`&&typeof t.id==`string`&&r.add(t.id);let i=new Map;for(let e of n){let t=i.get(e.insertBeforeIndex)??[];t.push(e),i.set(e.insertBeforeIndex,t)}let a=t=>t.archivedMessages.map((t,n)=>(0,L.jsx)(yO,{message:t,toolResultsById:e},n)),o=[],s=e=>{let t=i.get(e);if(t!==void 0)for(let e of t)o.push((0,L.jsx)(wx,{event:e,renderArchived:()=>a(e)},`compaction-${e.id}`))};return t.forEach((t,n)=>{s(n),!(t.role===`toolResult`&&typeof t.toolCallId==`string`&&r.has(t.toolCallId))&&t.role!==`compactionSummary`&&o.push((0,L.jsx)(yO,{message:t,toolResultsById:e},n))}),s(t.length),o})(),r.length>0&&(0,L.jsxs)(`div`,{className:`message-bubble rounded-lg border border-neutral-800 bg-neutral-900 px-4 py-3`,children:[(0,L.jsx)(`div`,{className:`mb-1 text-[10px] uppercase tracking-wider text-neutral-500`,children:`assistant (streaming)`}),(0,L.jsxs)(`div`,{className:`text-neutral-100`,children:[(0,L.jsx)(Cx,{text:r}),(0,L.jsx)(`span`,{className:`ml-1 inline-block h-3 w-1.5 animate-pulse bg-neutral-300 align-text-bottom`})]})]}),i&&r.length===0&&(0,L.jsx)(hO,{tool:a}),s!==void 0&&(0,L.jsx)(mO,{queued:s})]})]})]}),m&&p!==void 0&&(0,L.jsx)(BD,{sessionId:e,projectId:p.id,onClose:()=>h(!1)})]})}function mO({queued:e}){let t=[];for(let n of e.steering)t.push({kind:`steer`,text:n});for(let n of e.followUp)t.push({kind:`followUp`,text:n});return t.length===0?null:(0,L.jsxs)(`div`,{className:`rounded-md border border-neutral-800 bg-neutral-900/40 px-3 py-2`,children:[(0,L.jsxs)(`div`,{className:`mb-1 text-[10px] uppercase tracking-wider text-neutral-500`,children:[`queued (`,t.length,`)`]}),(0,L.jsx)(`ul`,{className:`space-y-1`,children:t.map(e=>(0,L.jsxs)(`li`,{className:`flex items-baseline gap-2 text-xs text-neutral-300`,children:[(0,L.jsx)(`span`,{className:e.kind===`steer`?`shrink-0 rounded bg-amber-900/30 px-1.5 py-0.5 text-[9px] uppercase tracking-wider text-amber-300`:`shrink-0 rounded bg-neutral-800 px-1.5 py-0.5 text-[9px] uppercase tracking-wider text-neutral-400`,title:e.kind===`steer`?`Delivered at the agent's next decision point (often mid-tool)`:`Delivered after the agent goes fully idle`,children:e.kind===`steer`?`steer`:`follow-up`}),(0,L.jsx)(`span`,{className:`truncate`,children:e.text})]},`${e.kind}:${e.text}`))})]})}function hO({tool:e}){return e===void 0?(0,L.jsx)(`div`,{className:`text-xs italic text-neutral-500`,children:`Thinking…`}):(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-neutral-400`,children:[(0,L.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-neutral-400`}),(0,L.jsx)(`span`,{className:`text-neutral-500`,children:`running`}),(0,L.jsx)(`code`,{className:`rounded bg-neutral-800 px-1.5 py-0.5 font-mono text-[11px] text-neutral-200`,children:e.name}),e.summary!==void 0&&(0,L.jsx)(`code`,{className:`truncate rounded bg-neutral-900 px-1.5 py-0.5 font-mono text-[11px] text-neutral-300`,title:e.summary,children:e.summary})]})}function gO({diff:e,filename:t,adds:n,dels:r}){let{viewType:i,setViewType:a}=(0,v.useContext)(uO);return(0,L.jsxs)(`details`,{className:`group rounded border border-neutral-800 bg-neutral-950 text-xs`,children:[(0,L.jsxs)(`summary`,{className:`flex cursor-pointer items-center justify-between gap-2 px-3 py-2 text-neutral-300`,children:[(0,L.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,L.jsxs)(`span`,{className:`text-neutral-500`,children:[`edit`,t===void 0?``:` `]}),t!==void 0&&(0,L.jsx)(`span`,{className:`truncate font-mono`,children:t}),(0,L.jsxs)(`span`,{className:`ml-2 text-emerald-400`,children:[`+`,n]}),(0,L.jsxs)(`span`,{className:`ml-1 text-red-400`,children:[`−`,r]})]}),(0,L.jsx)(`button`,{onClick:e=>{e.preventDefault(),e.stopPropagation(),a(i===`split`?`unified`:`split`)},className:`rounded p-0.5 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200`,title:i===`split`?`Switch chat diffs to unified view`:`Switch chat diffs to side-by-side view`,children:i===`split`?(0,L.jsx)(Fe,{size:11}):(0,L.jsx)(fe,{size:11})})]}),(0,L.jsx)(OD,{diff:e,viewType:i})]})}function _O(e){let t=[],n=e.replace(/\n?(`{3,})(\w*)\s+file:\s+([^\n]+)\n([\s\S]*?)\n\1\n?/g,(e,n,r,i,a)=>(t.push({kind:`inline`,path:i.trim(),lang:r,content:a}),``)),r=/(^|\s)@(?:"([^"\n]+)"|([^\s]+?))(?=[?,;:!)\]]?(?:\s|$))/g,i;for(;(i=r.exec(n))!==null;){let e=(i[2]??i[3]??``).trim();e.length!==0&&(t.some(t=>t.kind===`inline`&&t.path===e)||t.push({kind:`defer`,path:e}))}return n=n.replace(/\n{3,}/g,`
336
+
337
+ `).trim(),{stripped:n,refs:t}}function vO({ref:e}){let[t,n]=(0,v.useState)(!1),r=e.kind===`inline`;return(0,L.jsxs)(`div`,{className:`overflow-hidden rounded border bg-neutral-900 ${r?`border-neutral-700`:`border-emerald-700/60 bg-emerald-900/15`}`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>r&&n(e=>!e),disabled:!r,className:`flex w-full items-center gap-1.5 px-2 py-1 text-left text-[11px] ${r?`text-neutral-200 hover:bg-neutral-800`:`cursor-default text-emerald-200`}`,title:r?`${e.path} — click to ${t?`collapse`:`expand`}`:`${e.path} — model will load this on demand using its read tool (file is larger than the inline threshold)`,children:[r?t?(0,L.jsx)(le,{size:12}):(0,L.jsx)(ue,{size:12}):(0,L.jsx)(se,{size:12,className:`text-emerald-300/80`}),(0,L.jsx)(ge,{size:12,className:r?`text-neutral-400`:`text-emerald-300/80`}),(0,L.jsx)(`span`,{className:`font-mono`,children:e.path}),r&&(0,L.jsx)(`span`,{className:`text-[10px] text-neutral-500`,children:e.content.length<1024?`${e.content.length} B`:`${(e.content.length/1024).toFixed(1)} KB`}),!r&&(0,L.jsx)(`span`,{className:`text-[10px] text-emerald-300/70`,children:`on demand`})]}),r&&t&&(0,L.jsx)(`pre`,{className:`max-h-72 overflow-auto border-t border-neutral-800 bg-neutral-950 px-3 py-2 font-mono text-[11px] leading-relaxed text-neutral-300`,children:e.content})]})}function yO({message:e,toolResultsById:t}){let[n,r]=(0,v.useState)(!1);if(e.role===`user`){let{stripped:t,refs:i}=_O(MO(e)),a=Array.isArray(e.content)?e.content:[],o=[],s=[];for(let e=0;e<a.length;e++){let t=a[e];if(t.type===`image`){let n=typeof t.data==`string`?t.data:``,r=typeof t.mimeType==`string`?t.mimeType:`image/png`,i=t.__blobUrl===!0?n:`data:${r};base64,${n}`;n.length>0&&o.push({src:i,key:`img-${e}`})}else if(t.type===`file`){let n={name:typeof t.filename==`string`?t.filename:`attachment`,key:`file-${e}`};typeof t.size==`number`&&(n.size=t.size),s.push(n)}}return(0,L.jsxs)(`div`,{className:`message-bubble rounded-lg bg-neutral-800 px-4 py-3`,"data-message-role":`user`,children:[(0,L.jsxs)(`div`,{className:`mb-1 flex items-center justify-between`,children:[(0,L.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-neutral-400`,children:`you`}),t.length>0&&(0,L.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,L.jsx)(DO,{getText:()=>t,title:`Copy message text`}),(0,L.jsx)(kO,{showRaw:n,onToggle:r})]})]}),t.length>0&&(0,L.jsx)(`div`,{className:`text-neutral-100`,children:n?(0,L.jsx)(AO,{text:t}):(0,L.jsx)(Cx,{text:t,chatStyleBreaks:!0})}),i.length>0&&(0,L.jsx)(`div`,{className:`mt-2 flex flex-col gap-1`,children:i.map((e,t)=>(0,L.jsx)(vO,{ref:e},`fileref-${t}-${e.path}`))}),o.length>0&&(0,L.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:o.map(e=>(0,L.jsx)(`img`,{src:e.src,alt:``,className:`max-h-48 max-w-full rounded border border-neutral-700`},e.key))}),s.length>0&&(0,L.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:s.map(e=>(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded border border-neutral-700 bg-neutral-900 px-2 py-1 text-[11px] text-neutral-300`,title:e.name,children:[(0,L.jsx)(`span`,{className:`font-mono`,children:e.name}),e.size!==void 0&&(0,L.jsx)(`span`,{className:`text-[10px] text-neutral-500`,children:e.size<1024?`${e.size} B`:e.size<1024*1024?`${(e.size/1024).toFixed(1)} KB`:`${(e.size/(1024*1024)).toFixed(1)} MB`})]},e.key))})]})}if(e.role===`assistant`){let i=Array.isArray(e.content)?e.content:[],a=i.some(e=>e.type===`text`);return(0,L.jsxs)(`div`,{className:`message-bubble rounded-lg border border-neutral-800 bg-neutral-900 px-4 py-3`,"data-message-role":`assistant`,children:[(0,L.jsxs)(`div`,{className:`mb-1 flex items-center justify-between`,children:[(0,L.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-neutral-500`,children:`assistant`}),a&&(0,L.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,L.jsx)(DO,{getText:()=>OO(i),title:`Copy all text from this assistant message`}),(0,L.jsx)(kO,{showRaw:n,onToggle:r})]})]}),(0,L.jsx)(`div`,{className:`space-y-2 text-sm text-neutral-100`,children:i.map((e,r)=>{let i={block:e,showRaw:n};return t!==void 0&&(i.toolResultsById=t),(0,L.jsx)(bO,{...i},r)})})]})}return e.role===`toolResult`?(0,L.jsx)(SO,{message:e}):e.role===`bashExecution`||e.type===`bashExecution`||e.customType===`bashExecution`?(0,L.jsx)(EO,{message:e}):(0,L.jsxs)(`details`,{className:`rounded-lg border border-neutral-800 bg-neutral-900/40 px-3 py-2 text-xs text-neutral-400`,children:[(0,L.jsxs)(`summary`,{className:`cursor-pointer`,children:[`unknown message (`,String(e.role??e.type??`?`),`)`]}),(0,L.jsx)(`pre`,{className:`mt-2 overflow-auto whitespace-pre-wrap text-[10px] text-neutral-500`,children:JSON.stringify(e,null,2)})]})}function bO({block:e,toolResultsById:t,showRaw:n=!1}){let r=e.type;if(r===`text`&&typeof e.text==`string`)return n?(0,L.jsx)(AO,{text:e.text}):(0,L.jsx)(Cx,{text:e.text});if(r===`thinking`&&typeof e.thinking==`string`)return(0,L.jsxs)(`details`,{className:`rounded border border-neutral-800 px-2 py-1 text-xs text-neutral-400`,children:[(0,L.jsx)(`summary`,{className:`cursor-pointer`,children:`Thinking…`}),(0,L.jsx)(`pre`,{className:`mt-1 whitespace-pre-wrap break-words font-sans text-[12px]`,children:e.thinking})]});if(r===`toolCall`){let n=typeof e.id==`string`?e.id:void 0;return(0,L.jsx)(xO,{block:e,result:n===void 0?void 0:t?.get(n)})}return(0,L.jsxs)(`details`,{className:`text-xs text-neutral-500`,children:[(0,L.jsxs)(`summary`,{className:`cursor-pointer`,children:[`block (`,String(r??`?`),`)`]}),(0,L.jsx)(`pre`,{className:`mt-1 overflow-auto whitespace-pre-wrap text-[10px]`,children:JSON.stringify(e,null,2)})]})}function xO({block:e,result:t}){let n=String(e.name??`tool`),r=e.input??e.arguments??{},i=typeof r==`string`?r:JSON.stringify(r,null,2),a=t?.isError===!0,o=Array.isArray(t?.content)?t?.content:[],s=jO(r)?r:void 0,c=n===`bash`&&typeof s?.command==`string`?s.command:(n===`read`||n===`write`||n===`edit`)&&typeof s?.path==`string`?s.path:void 0,l=o.filter(e=>{let t=e;return t.type===`text`&&typeof t.text==`string`}).map(e=>e.text).join(`
338
+ `),u=n===`edit`&&t!==void 0?(()=>{let e=t.details?.diff;return typeof e==`string`?e:l})():void 0,d=n===`edit`&&t!==void 0?NO(t):void 0,f=u===void 0?void 0:PO(u);return n===`subagent`?(0,L.jsx)(CO,{argsText:i,input:s,result:t,isError:a,outputText:l}):(0,L.jsxs)(`div`,{className:`rounded border ${t===void 0?`border-neutral-700`:a?`border-red-700/50`:`border-neutral-800`} bg-neutral-950 text-xs`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 text-neutral-300`,children:[(0,L.jsxs)(`div`,{className:`min-w-0 flex-1 truncate`,children:[(0,L.jsx)(`span`,{className:`text-neutral-500`,children:`→ `}),(0,L.jsx)(`span`,{className:`font-mono`,children:n}),c!==void 0&&(0,L.jsx)(`span`,{className:`ml-2 truncate font-mono text-neutral-400`,title:c,children:c})]}),(0,L.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[t===void 0&&(0,L.jsx)(`span`,{className:`rounded bg-neutral-800 px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-neutral-400`,children:`running…`}),a&&(0,L.jsx)(`span`,{className:`rounded bg-red-900/30 px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-red-300`,children:`error`})]})]}),i.length>0&&(0,L.jsxs)(`details`,{className:`border-t border-neutral-800/60`,children:[(0,L.jsx)(`summary`,{className:`cursor-pointer px-3 py-1.5 text-[11px] text-neutral-500 hover:text-neutral-300`,children:`Input`}),(0,L.jsx)(`pre`,{className:`overflow-auto px-3 pb-2 font-mono text-[11px] text-neutral-400`,children:i})]}),t!==void 0&&(0,L.jsxs)(`details`,{className:`border-t border-neutral-800/60`,children:[(0,L.jsxs)(`summary`,{className:`cursor-pointer px-3 py-1.5 text-[11px] text-neutral-500 hover:text-neutral-300`,children:[`Output`,f!==void 0&&(0,L.jsxs)(`span`,{className:`ml-2 font-mono text-[10px]`,children:[(0,L.jsxs)(`span`,{className:`text-emerald-400`,children:[`+`,f.adds]}),` `,(0,L.jsxs)(`span`,{className:`text-red-400`,children:[`-`,f.dels]})]}),d!==void 0&&(0,L.jsx)(`span`,{className:`ml-2 font-mono text-[10px] text-neutral-500`,children:d})]}),u!==void 0&&f!==void 0?(0,L.jsx)(`div`,{className:`px-3 pb-2`,children:(0,L.jsx)(gO,{diff:u,filename:d,adds:f.adds,dels:f.dels})}):(0,L.jsx)(`pre`,{className:`max-h-96 overflow-auto px-3 pb-2 font-mono text-[11px] text-neutral-300`,children:l.length>0?l:`(empty)`})]})]})}function SO({message:e}){let t=String(e.toolName??`tool`),n=e.isError===!0,r=(Array.isArray(e.content)?e.content:[]).filter(e=>{let t=e;return t.type===`text`&&typeof t.text==`string`}).map(e=>e.text).join(`
339
+ `);if(t===`edit`){let t=e.details,n=typeof t?.diff==`string`?t.diff:r,i=NO(e),{adds:a,dels:o}=PO(n);return(0,L.jsx)(gO,{diff:n,filename:i,adds:a,dels:o})}if(t===`read`){let t=NO(e);return(0,L.jsxs)(`details`,{className:`rounded border border-neutral-800 bg-neutral-950 text-xs`,children:[(0,L.jsxs)(`summary`,{className:`cursor-pointer px-3 py-2 text-neutral-300`,children:[(0,L.jsxs)(`span`,{className:`text-neutral-500`,children:[`read`,t===void 0?``:` `]}),t!==void 0&&(0,L.jsx)(`span`,{className:`font-mono`,children:t})]}),(0,L.jsx)(`pre`,{className:`overflow-auto px-3 pb-2 font-mono text-[11px] text-neutral-400`,children:r})]})}if(t===`bash`){let t=FO(e);return(0,L.jsxs)(`div`,{className:`rounded border ${n?`border-red-700/40`:`border-neutral-800`} bg-neutral-950 text-xs`,children:[(0,L.jsxs)(`div`,{className:`px-3 py-2 text-neutral-400`,children:[(0,L.jsxs)(`span`,{className:`text-neutral-500`,children:[`bash`,t===void 0?` output`:` → `]}),t!==void 0&&(0,L.jsx)(`span`,{className:`font-mono`,children:t})]}),(0,L.jsx)(`pre`,{className:`max-h-64 overflow-auto px-3 pb-2 font-mono text-[11px] text-neutral-300`,children:r})]})}if(t===`write`){let t=NO(e);return(0,L.jsxs)(`details`,{className:`rounded border border-neutral-800 bg-neutral-950 text-xs`,children:[(0,L.jsxs)(`summary`,{className:`cursor-pointer px-3 py-2 text-neutral-300`,children:[(0,L.jsxs)(`span`,{className:`text-neutral-500`,children:[`write`,t===void 0?``:` `]}),t!==void 0&&(0,L.jsx)(`span`,{className:`font-mono`,children:t}),(0,L.jsxs)(`span`,{className:`ml-2 text-neutral-500`,children:[`(`,r.split(`
340
+ `).length,` lines)`]})]}),(0,L.jsx)(`pre`,{className:`overflow-auto px-3 pb-2 font-mono text-[11px] text-neutral-400`,children:r})]})}return t===`subagent`?(0,L.jsx)(wO,{message:e,argsText:``,outputText:r,isError:n}):(0,L.jsxs)(`details`,{className:`rounded border ${n?`border-red-700/40`:`border-neutral-800`} bg-neutral-950 text-xs`,children:[(0,L.jsxs)(`summary`,{className:`cursor-pointer px-3 py-2 text-neutral-300`,children:[(0,L.jsx)(`span`,{className:`text-neutral-500`,children:t}),n&&(0,L.jsx)(`span`,{className:`ml-2 text-red-400`,children:`error`})]}),(0,L.jsx)(`pre`,{className:`overflow-auto px-3 pb-2 font-mono text-[11px] text-neutral-400`,children:r})]})}function CO({argsText:e,input:t,result:n,isError:r,outputText:i}){if(n!==void 0)return(0,L.jsx)(wO,{message:n,argsText:e,outputText:i,isError:r});let a;if(t!==void 0){let e=typeof t.agent==`string`?t.agent:void 0,n=typeof t.task==`string`?t.task:void 0,r=typeof t.action==`string`?t.action:void 0,i=Array.isArray(t.tasks)?t.tasks.length:void 0,o=Array.isArray(t.chain)?t.chain.length:void 0;r===void 0?i===void 0?o===void 0?e!==void 0&&n!==void 0?a=`${e} — ${n}`:e!==void 0&&(a=e):a=`${o}-step chain`:a=`${i} parallel task${i===1?``:`s`}`:a=`action: ${r}`}return(0,L.jsx)(`div`,{className:`overflow-hidden rounded border border-l-2 border-sky-700/50 border-l-sky-400 bg-sky-950/15 text-xs`,children:(0,L.jsx)(`div`,{className:`flex items-center justify-between gap-2 px-2.5 py-1.5`,children:(0,L.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,L.jsx)(Ge,{size:11,className:`shrink-0 text-sky-300`}),(0,L.jsx)(`span`,{className:`truncate font-medium text-sky-100`,children:`Sub-agent running…`}),a!==void 0&&(0,L.jsx)(`span`,{className:`ml-1 truncate font-mono text-[11px] text-sky-200/70`,title:a,children:a})]})})})}function wO({message:e,argsText:t,outputText:n,isError:r}){let i=$n(e=>e.setActiveSession),a=On(e=>e.setActive),o=$n(e=>e.byProject),s=(0,v.useMemo)(()=>{let e=new Map;for(let t of Object.values(o))for(let n of t)typeof n.path==`string`&&n.path.length>0&&e.set(n.path,{sessionId:n.sessionId,projectId:n.projectId});return e},[o]),c=e=>{if(e===void 0){console.warn(`[subagent] Open clicked but result has no sessionFile`);return}let t=s.get(e);if(console.info(`[subagent] Open clicked`,{sessionFile:e,match:t}),t===void 0){console.warn(`[subagent] Open: sessionFile not found in any project's session list`,e);return}a(t.projectId),i(t.sessionId)},l=lO(e.details),u=l.mode===`management`,d=l.results.length,f=d===1?`Sub-agent: ${l.results[0].agent}`:d>1?`${d} sub-agents (${l.mode})`:u?`Sub-agent management`:`Sub-agent`;return(0,L.jsxs)(`div`,{className:`overflow-hidden rounded border border-l-2 ${r?`border-red-700/50 border-l-red-400 bg-red-950/15`:`border-sky-700/50 border-l-sky-400 bg-sky-950/15`} text-xs`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-2.5 py-1.5`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,L.jsx)(Ge,{size:11,className:`shrink-0 text-sky-300`}),(0,L.jsx)(`span`,{className:`truncate font-medium text-sky-100`,children:f}),l.context!==void 0&&(0,L.jsx)(`span`,{className:`shrink-0 rounded bg-sky-900/40 px-1 py-0.5 text-[9px] font-medium uppercase tracking-wider text-sky-200`,title:l.context===`fork`?`Forked from parent context`:`Fresh context`,children:l.context}),r&&(0,L.jsx)(`span`,{className:`shrink-0 rounded bg-red-900/40 px-1 py-0.5 text-[9px] font-medium uppercase tracking-wider text-red-200`,children:`error`})]}),l.results.length===1&&l.results[0].sessionFile!==void 0&&(0,L.jsxs)(`button`,{onClick:()=>c(l.results[0].sessionFile),className:`inline-flex shrink-0 items-center gap-1 rounded border border-sky-700/60 px-1.5 py-0.5 text-[10px] font-medium text-sky-200 hover:border-sky-500 hover:bg-sky-900/30 hover:text-sky-100`,title:`Open sub-agent session — ${l.results[0].sessionFile}`,children:[(0,L.jsx)(he,{size:10}),`Open`]})]}),d>1&&(0,L.jsx)(`div`,{className:`space-y-1.5 border-t border-sky-900/30 px-2.5 py-2`,children:l.results.map((e,t)=>(0,L.jsx)(TO,{result:e,onOpenFile:c},e.sessionFile??`${t}-${e.agent}`))}),t.length>0&&(0,L.jsxs)(`details`,{className:`border-t border-sky-900/30`,children:[(0,L.jsx)(`summary`,{className:`cursor-pointer px-2.5 py-1 text-[11px] text-neutral-500 hover:text-neutral-300`,children:`Input`}),(0,L.jsx)(`pre`,{className:`overflow-auto px-2.5 pb-2 font-mono text-[11px] text-neutral-400`,children:t})]}),n.length>0&&(0,L.jsxs)(`details`,{open:r,className:`border-t border-sky-900/30`,children:[(0,L.jsx)(`summary`,{className:`cursor-pointer px-2.5 py-1 text-[11px] text-neutral-500 hover:text-neutral-300`,children:`Output`}),(0,L.jsx)(`pre`,{className:`overflow-auto px-2.5 pb-2 font-mono text-[11px] text-neutral-300 whitespace-pre-wrap`,children:n})]})]})}function TO({result:e,onOpenFile:t}){let n=e.exitCode!==0;return(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded border ${n?`border-red-700/40`:`border-sky-900/40`} bg-neutral-950/60 px-2 py-1.5`,children:[(0,L.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,L.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,L.jsx)(`span`,{className:`font-mono text-[11px] font-medium text-sky-200`,children:e.agent}),n&&(0,L.jsxs)(`span`,{className:`text-[10px] font-medium text-red-400`,children:[`exit `,e.exitCode]})]}),e.task.length>0&&(0,L.jsx)(`div`,{className:`mt-0.5 truncate text-[11px] text-neutral-400`,title:e.task,children:e.task})]}),e.sessionFile!==void 0&&(0,L.jsxs)(`button`,{onClick:()=>t(e.sessionFile),className:`inline-flex shrink-0 items-center gap-1 rounded border border-sky-700/60 px-1.5 py-0.5 text-[10px] font-medium text-sky-200 hover:border-sky-500 hover:bg-sky-900/30 hover:text-sky-100`,title:e.sessionFile,children:[(0,L.jsx)(he,{size:10}),`Open`]})]})}function EO({message:e}){let t=String(e.command??``),n=String(e.output??``),r=typeof e.exitCode==`number`?e.exitCode:void 0,i=e.truncated===!0,a=e.cancelled===!0,o=e.excludeFromContext===!0;return(0,L.jsxs)(`div`,{className:`rounded border border-neutral-800 bg-neutral-950 text-xs`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-3 py-2 text-neutral-400`,children:[(0,L.jsxs)(`div`,{className:`min-w-0 flex-1 truncate`,children:[(0,L.jsx)(`span`,{className:`text-neutral-500`,children:`$ `}),(0,L.jsx)(`span`,{className:`font-mono text-neutral-200`,children:t})]}),(0,L.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[o&&(0,L.jsx)(`span`,{className:`rounded bg-neutral-800 px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-neutral-400`,title:`!! prefix — kept out of LLM context on the next turn`,children:`local-only`}),a&&(0,L.jsx)(`span`,{className:`rounded bg-amber-900/40 px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-amber-300`,children:`timed out`}),i&&!a&&(0,L.jsx)(`span`,{className:`rounded bg-amber-900/40 px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-amber-300`,children:`truncated`}),r!==void 0&&(0,L.jsxs)(`span`,{className:`rounded px-1.5 py-0.5 text-[10px] font-mono ${r===0?`bg-emerald-900/30 text-emerald-300`:`bg-red-900/30 text-red-300`}`,title:r===0?`exit 0`:`exit ${String(r)}`,children:[`exit `,r]})]})]}),n.length>0&&(0,L.jsx)(`pre`,{className:`max-h-64 overflow-auto px-3 pb-2 font-mono text-[11px] text-neutral-300`,children:n})]})}function DO({getText:e,title:t}){let[n,r]=(0,v.useState)(!1),i=()=>{let t=e();if(t.length===0)return;let n=navigator.clipboard?.writeText?.bind(navigator.clipboard);n===void 0?a(t):n(t).then(()=>{r(!0),window.setTimeout(()=>r(!1),1200)}).catch(()=>a(t))},a=e=>{try{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select(),document.execCommand(`copy`),document.body.removeChild(t),r(!0),window.setTimeout(()=>r(!1),1200)}catch{}};return(0,L.jsx)(`button`,{type:`button`,onClick:i,className:`rounded px-1.5 py-0.5 text-neutral-500 hover:bg-neutral-700/40 hover:text-neutral-300`,title:t,children:n?(0,L.jsx)(ce,{size:12}):(0,L.jsx)(pe,{size:12})})}function OO(e){let t=[];for(let n of e)n.type===`text`&&typeof n.text==`string`&&t.push(n.text);return t.join(`
341
+
342
+ `)}function kO({showRaw:e,onToggle:t}){return(0,L.jsx)(`button`,{type:`button`,onClick:()=>t(!e),className:`rounded px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-neutral-500 hover:bg-neutral-700/40 hover:text-neutral-300`,title:e?`Show rendered markdown`:`Show raw text`,children:e?`rendered`:`raw`})}function AO({text:e}){return(0,L.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-sans text-sm text-neutral-100 [overflow-wrap:anywhere]`,children:e})}function jO(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function MO(e){return typeof e.content==`string`?e.content:Array.isArray(e.content)?e.content.filter(e=>{let t=e;return t.type===`text`&&typeof t.text==`string`}).map(e=>e.text).join(`
343
+ `):``}function NO(e){let t=e.details,n=e.input;for(let e of[t,n])if(e!==void 0){if(typeof e.path==`string`)return e.path;if(typeof e.filename==`string`)return e.filename;if(typeof e.file==`string`)return e.file;if(typeof e.file_path==`string`)return e.file_path}}function PO(e){let t=0,n=0;for(let r of e.split(`
344
+ `))r.startsWith(`+++`)||r.startsWith(`---`)||(r.startsWith(`+`)?t+=1:r.startsWith(`-`)&&(n+=1));return{adds:t,dels:n}}function FO(e){let t=e.details,n=e.input;if(typeof t?.command==`string`)return t.command;if(typeof n?.command==`string`)return n.command}var IO=Qe((e,t)=>({settingsRequest:void 0,_settingsSeq:0,openSettings:n=>{let r=t()._settingsSeq+1,i={seq:r};n!==void 0&&(i.tab=n),e({_settingsSeq:r,settingsRequest:i})},clearSettingsRequest:()=>{e({settingsRequest:void 0})},chatInsertRequest:void 0,_chatInsertSeq:0,requestChatInsert:n=>{let r=t()._chatInsertSeq+1;e({_chatInsertSeq:r,chatInsertRequest:{text:n,seq:r}})},clearChatInsertRequest:()=>{e({chatInsertRequest:void 0})}}));function LO(e){let t=/(?:^|\s)@(?:"([^"\n]+)"|([^\s]+?))(?=[?,;:!)\]]?(?:\s|$))/g,n=[],r;for(;(r=t.exec(e))!==null;){let e=r[1]??r[2];e!==void 0&&n.push(e)}return n}function RO(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function zO(e){let t=RO(e);return RegExp(`(^|\\s)@(?:"${t}"|${t})\\s?`,`g`)}var BO=100,VO=`forge.input.history.v1:`;function HO(e){try{let t=localStorage.getItem(VO+e);if(t===null)return[];let n=JSON.parse(t);return Array.isArray(n)?n.filter(e=>typeof e==`string`).slice(0,BO):[]}catch{return[]}}function UO(e,t){let n=t.trim();if(n.length!==0)try{let t=HO(e);if(t[0]===n)return;let r=[n,...t].slice(0,BO);localStorage.setItem(VO+e,JSON.stringify(r))}catch{}}function WO(e){let t=[],n;for(let r=e.length-1;r>=0;r--){let i=e[r];if(i?.role!==`user`)continue;let a=``;if(typeof i.content==`string`)a=i.content;else if(Array.isArray(i.content)){let e=[];for(let t of i.content){let n=t;n.type===`text`&&typeof n.text==`string`&&e.push(n.text)}a=e.join(`
345
+ `)}a=a.trim(),a.length!==0&&a!==n&&(t.push(a),n=a)}return t}var GO=`pi-forge/model/`;function KO(e){if(e===void 0)return[];let t=[];for(let n of e.providers)for(let e of n.models)e.hasAuth&&t.push({value:`${n.provider}:${e.id}`,provider:n.provider,modelId:e.id,name:e.name,haystack:`${n.provider} ${e.name} ${e.id}`.toLowerCase()});return t}function qO(e,t){if(t.length===0)return 0;let n=t.toLowerCase(),r=n.split(/\s+/).filter(e=>e.length>0),i=0;for(let t of r){let n=e.haystack.indexOf(t);if(n===-1)return;i+=n}return e.modelId.toLowerCase().startsWith(n)&&(i-=50),e.name.toLowerCase().startsWith(n)&&(i-=30),e.provider.toLowerCase()===n&&(i-=20),i}var JO=600;function YO({sessionId:e}){let t=$n(t=>t.streamingBySession[e]??!1),n=pr(e=>e.minimal),r=$n(t=>t.bannerBySession[e]),i=r!==void 0&&r.startsWith(`Retrying (`),a=$n(e=>e.sendPrompt),o=$n(e=>e.sendSteer),s=$n(e=>e.reloadMessages),c=$n(e=>e.abortSession),l=$n(e=>e.error),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(!1),m=kn(),h=(0,v.useRef)(null),g=`pi-forge:chat-input-height`,_=()=>({min:60,max:Math.floor(window.innerHeight*.6)}),[y,b]=(0,v.useState)(()=>{if(typeof window>`u`)return;let e=window.localStorage.getItem(g);if(e===null)return;let t=Number.parseInt(e,10);if(!Number.isFinite(t))return;let{min:n,max:r}=_();return Math.max(n,Math.min(r,t))}),x=e=>{e.preventDefault();let t=e.currentTarget;t.setPointerCapture(e.pointerId);let n=e.clientY,r=h.current?.getBoundingClientRect().height??60,{min:i,max:a}=_(),o=e=>{let t=n-e.clientY;b(Math.max(i,Math.min(a,r+t)))},s=e=>{t.removeEventListener(`pointermove`,o),t.removeEventListener(`pointerup`,s),t.removeEventListener(`pointercancel`,s);try{t.releasePointerCapture(e.pointerId)}catch{}let n=h.current?.getBoundingClientRect().height;n!==void 0&&Number.isFinite(n)&&window.localStorage.setItem(g,String(Math.round(n)))};t.addEventListener(`pointermove`,o),t.addEventListener(`pointerup`,s),t.addEventListener(`pointercancel`,s)},S=()=>{b(void 0),window.localStorage.removeItem(g)},[C,w]=(0,v.useState)(void 0),[T,E]=(0,v.useState)([]),[D,O]=(0,v.useState)(0),ee=(0,v.useRef)(0),te=IO(e=>e.openSettings),ne=IO(e=>e.chatInsertRequest),re=IO(e=>e.clearChatInsertRequest),k=(0,v.useRef)(0),[ie,ae]=(0,v.useState)(0),A=u.startsWith(`/`)&&!u.includes(`
346
+ `),oe=A?u.slice(1).split(/\s/)[0]??``:``,j=(()=>{if(!t&&!n){if(u.startsWith(`!!`))return`local`;if(u.startsWith(`!`))return`context`}})(),ce=(0,v.useMemo)(()=>[{name:`/compact`,description:`Manually compact the session context`,available:!t,run:async()=>{try{await I.compact(e),s(e)}catch(e){ve(`Compact failed: ${e instanceof M?e.code:e.message}`)}}},{name:`/clear`,description:`Compact context (alias for /compact)`,available:!t,run:async()=>{try{await I.compact(e),s(e)}catch(e){ve(`Clear failed: ${e instanceof M?e.code:e.message}`)}}},{name:`/abort`,description:`Stop the agent (alias for the Abort button)`,available:t,run:()=>c(e)},{name:`/settings`,description:`Open the Settings panel`,available:!0,run:()=>te()},{name:`/skills`,description:`Open Settings → Skills`,available:!0,run:()=>te(`skills`)},{name:`/mcp`,description:`Open Settings → MCP`,available:!0,run:()=>te(`mcp`)},{name:`/providers`,description:`Open Settings → Providers`,available:!0,run:()=>te(`providers`)},{name:`/help`,description:n?"Show what `/` and `@` do in the input":"Show what `/`, `!`, `@` do in the input",available:!0,run:()=>{ve(n?`/<cmd> runs a pi-forge command (compact, abort, settings, …). @<path> references a project file (autocomplete from the popover).`:`/<cmd> runs a pi-forge command (compact, abort, settings, …). !cmd runs bash (output → next LLM context); !!cmd runs bash local-only. @<path> references a project file (autocomplete from the popover).`)}}],[t,e,c,s,te,n]),le=(0,v.useMemo)(()=>{let e=oe.toLowerCase();return e.length===0?ce:ce.filter(t=>t.name.slice(1).toLowerCase().startsWith(e))},[ce,oe]),ue=()=>{let e=le[ie];e===void 0||!e.available||(d(``),ae(0),e.run())},de=(0,v.useRef)(0),[fe,pe]=(0,v.useState)([]),me=(0,v.useRef)(new Map),he=(0,v.useRef)(null),ge=new Set(`doc.xls.ppt.pptx.vsd.vsdx.odt.ods.odp.rtf.zip.tar.gz.bz2.xz.7z.rar.exe.dll.so.dylib.bin.o.a.class.jar.wasm.mp3.mp4.m4a.wav.flac.ogg.avi.mov.wmv.mkv.heic.heif.tiff.tif.bmp.ico.psd.ttf.otf.woff.woff2.eot.sqlite.db.iso.dmg`.split(`.`)),[_e,ve]=(0,v.useState)(void 0),ye=e=>{ve(void 0);let t=fe,n=[...t],r=t.filter(e=>e.type.startsWith(`image/`)).length;for(let t of e){if(n.length>=8){ve(`Up to 8 attachments per message; "${t.name}" dropped.`);continue}if(t.size>20971520){ve(`"${t.name}" exceeds the 20 MB per-file limit.`);continue}if(t.type.startsWith(`image/`)&&r>=4){ve(`Up to 4 images per message; "${t.name}" dropped.`);continue}let e=t.name.includes(`.`)?t.name.split(`.`).pop()?.toLowerCase():void 0;if(e!==void 0&&ge.has(e)){ve(`"${t.name}" is a binary format that the agent can't read directly. Convert to text/markdown (or to a PNG/JPEG screenshot for diagrams) and try again.`);continue}n.push(t),t.type.startsWith(`image/`)&&(r+=1,me.current.set(t,URL.createObjectURL(t)))}pe(n)},be=e=>{let t=me.current.get(e);t!==void 0&&(URL.revokeObjectURL(t),me.current.delete(e)),pe(t=>t.filter(t=>t!==e))},xe=()=>{for(let e of me.current.values())URL.revokeObjectURL(e);me.current.clear(),pe([]),ve(void 0)};(0,v.useEffect)(()=>{let e=me.current;return()=>{for(let t of e.values())URL.revokeObjectURL(t);e.clear()}},[]);let Se=$n(t=>t.messagesBySession[e]??Wn),[Ce,we]=(0,v.useState)(0),Te=(0,v.useMemo)(()=>{let t=HO(e),n=WO(Se),r=new Set,i=[];for(let e of[...t,...n])r.has(e)||(r.add(e),i.push(e));return i},[Se,e,Ce]),[Ee,De]=(0,v.useState)(void 0),Oe=(0,v.useRef)(``);(0,v.useEffect)(()=>{De(void 0),Oe.current=``},[e]),(0,v.useEffect)(()=>{de.current=0},[e]);let ke=GO+e,[je,Me]=(0,v.useState)(void 0),[Ne,Fe]=(0,v.useState)(void 0),[Ie,Le]=(0,v.useState)(()=>localStorage.getItem(GO+e)??``),[Re,ze]=(0,v.useState)(void 0);(0,v.useEffect)(()=>{I.getProviders().then(Me).catch(e=>{ze(`models unavailable (${e instanceof M?e.code:e.message})`)}),I.getSettings().then(e=>{Fe({provider:typeof e.defaultProvider==`string`?e.defaultProvider:``,modelId:typeof e.defaultModel==`string`?e.defaultModel:``})}).catch(()=>{})},[]),(0,v.useEffect)(()=>{let t=localStorage.getItem(GO+e)??``;if(Le(t),ze(void 0),t===``)return;let[n,...r]=t.split(`:`),i=r.join(`:`);if(n===void 0||i.length===0)return;let a=e;I.setModel(a,n,i).catch(t=>{a===e&&ze(`set model failed: ${t instanceof M?t.code:t.message}`)})},[e]);let Be=$n(t=>t.pendingDraftBySession[e]),Ve=$n(e=>e.consumePendingDraft);(0,v.useEffect)(()=>{Be!==void 0&&(d(Be),Ve(e))},[Be,e,Ve]),(0,v.useEffect)(()=>{if(ne===void 0||ne.seq<=k.current)return;k.current=ne.seq;let e=ne.text;d(t=>t.length===0?e:`${t}${/\s$/.test(t)?``:` `}${e}`),requestAnimationFrame(()=>{let e=h.current;if(e===null)return;e.focus();let t=e.value.length;e.setSelectionRange(t,t)}),re()},[ne,re]);let He=async t=>{if(Le(t),t===``){localStorage.removeItem(ke);return}let[n,...r]=t.split(`:`),i=r.join(`:`);if(!(n===void 0||i.length===0))try{await I.setModel(e,n,i),localStorage.setItem(ke,t),ze(void 0)}catch(e){ze(`set model failed: ${e instanceof M?e.code:e.message}`)}},Ue=async()=>{let r=u.trim();if(!(r.length===0&&fe.length===0||f)){if(r.length>0&&(UO(e,r),we(e=>e+1)),A){le.length>0?ue():ve(`Unknown command "${u.split(/\s/)[0]??u}". Type /help to see commands.`);return}p(!0);try{if(!t&&/^!!?[^!]/.test(r)){if(n){ve(`Bash exec is disabled in this deployment.`);return}let t=r.startsWith(`!!`),i=r.slice(t?2:1).trim();if(i.length===0){ve("Empty bash command. Type something after the `!`.");return}fe.length>0&&(xe(),ve("Attachments aren't sent with `!` exec. Cleared.")),await I.exec(e,i,{excludeFromContext:t}),s(e),d(``),De(void 0),Oe.current=``;return}t?(fe.length>0&&(xe(),ve(`Attachments aren't sent on steer (mid-turn). Cleared.`)),await o(e,r)):await a(e,r,fe.length>0?fe:void 0),d(``),xe(),De(void 0),Oe.current=``}catch(e){ve(`Command failed: ${e instanceof M?e.code:e.message}`)}finally{p(!1)}}},We=n=>{if(A){if(n.key===`Escape`){n.preventDefault(),d(``);return}if(le.length>0){if(n.key===`ArrowDown`){n.preventDefault(),ae(e=>Math.min(e+1,le.length-1));return}if(n.key===`ArrowUp`){n.preventDefault(),ae(e=>Math.max(e-1,0));return}if(n.key===`Enter`||n.key===`Tab`){n.preventDefault(),ue();return}}else if(n.key===`Enter`&&!n.shiftKey){n.preventDefault(),ve(`Unknown command "${u.split(/\s/)[0]??u}". Type /help to see commands, or backspace the leading / to send as a prompt.`);return}}if(C!==void 0&&T.length>0){if(n.key===`ArrowDown`){n.preventDefault(),O(e=>Math.min(e+1,T.length-1));return}if(n.key===`ArrowUp`){n.preventDefault(),O(e=>Math.max(e-1,0));return}if(n.key===`Enter`||n.key===`Tab`){let e=T[D];if(e!==void 0){n.preventDefault(),Je(e);return}}if(n.key===`Escape`){n.preventDefault(),Ye();return}}if(n.key===`Enter`&&!n.shiftKey){n.preventDefault(),Ue();return}if(n.key===`ArrowUp`){let e=Ee!==void 0;if(e||u.length===0){if(Te.length===0)return;n.preventDefault();let t=e?Math.min((Ee??0)+1,Te.length-1):0;e||(Oe.current=u),De(t);let r=Te[t];r!==void 0&&d(r)}return}if(n.key===`ArrowDown`){if(Ee===void 0)return;if(n.preventDefault(),Ee>0){let e=Ee-1;De(e);let t=Te[e];t!==void 0&&d(t)}else De(void 0),d(Oe.current),Oe.current=``;return}if(n.key===`Escape`){if(!t)return;n.preventDefault();let r=Date.now(),i=r-de.current;de.current=r,i<JO&&(de.current=0,c(e))}},Ge=e=>{d(e),Ee!==void 0&&(De(void 0),Oe.current=``);let t=qe(e,h.current?.selectionStart??e.length);w(t),t===void 0&&E([]),O(0)};function qe(e,t){let n=t-1;for(;n>=0;){let r=e[n];if(r===void 0)break;if(/\s/.test(r))return;if(r===`@`){let r=n===0?` `:e[n-1];return r===void 0||/\s/.test(r)?{start:n,end:t,query:e.slice(n+1,t)}:void 0}--n}}(0,v.useEffect)(()=>{if(C===void 0||m===void 0)return;let e=ee.current+1;ee.current=e;let t=window.setTimeout(()=>{I.completeFiles(m.id,C.query,{limit:20}).then(t=>{ee.current===e&&(E(t.paths),O(0))}).catch(()=>{ee.current===e&&E([])})},100);return()=>window.clearTimeout(t)},[C,m]);let Je=e=>{if(C===void 0)return;let t=u.slice(0,C.start),n=u.slice(C.end),r=`@"${e}"`;d(`${t}${r}${n}`),w(void 0),E([]);let i=t.length+r.length;requestAnimationFrame(()=>{let e=h.current;e!==null&&(e.focus(),e.setSelectionRange(i,i))})},Ye=()=>{w(void 0),E([])},Xe=LO(u),Ze=e=>{let t=zO(e);d(e=>e.replace(t,(e,t)=>t).trimEnd())};return(0,L.jsxs)(`div`,{className:`bg-neutral-950`,children:[(0,L.jsx)(`div`,{role:`separator`,"aria-orientation":`horizontal`,"aria-label":`Resize chat input`,onPointerDown:x,className:`group relative h-px cursor-row-resize bg-neutral-800 hover:bg-neutral-600 active:bg-neutral-500`,children:(0,L.jsx)(`div`,{className:`absolute inset-x-0 -top-1 h-2`})}),(0,L.jsxs)(`div`,{className:`mx-auto max-w-3xl space-y-2 px-6 py-3`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,L.jsx)(XO,{providers:je,defaultModel:Ne,value:Ie,onChange:e=>void He(e)}),Xe.length>0&&(0,L.jsx)(`div`,{className:`flex flex-wrap items-center gap-1`,children:Xe.map((e,t)=>(0,L.jsxs)(`span`,{className:`inline-flex max-w-[220px] items-center gap-1 truncate rounded border border-emerald-700/60 bg-emerald-900/20 px-1.5 py-0.5 text-[11px] text-emerald-200`,title:`@${e} — model will use its read tool to load this file when it needs to`,children:[(0,L.jsx)(se,{size:11,className:`shrink-0`}),(0,L.jsx)(`span`,{className:`truncate font-mono`,children:e}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>Ze(e),className:`-mr-0.5 ml-0.5 rounded p-0.5 text-emerald-300/70 hover:bg-emerald-900/40 hover:text-emerald-100`,title:`Remove @${e}`,children:(0,L.jsx)(Ke,{size:10})})]},`ref-${t}-${e}`))}),(Re!==void 0||y!==void 0)&&(0,L.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[Re!==void 0&&(0,L.jsx)(`span`,{className:`text-[11px] text-red-400`,children:Re}),y!==void 0&&(0,L.jsx)(`button`,{type:`button`,onClick:S,className:`rounded p-1 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200`,title:`Reset chat input height to default`,"aria-label":`Reset chat input height to default`,children:(0,L.jsx)(Pe,{size:12})})]})]}),l!==void 0&&(0,L.jsxs)(`p`,{className:`text-xs text-red-400`,children:[`Error: `,l]}),_e!==void 0&&(0,L.jsx)(`p`,{className:`text-xs text-amber-400`,children:_e}),fe.length>0&&(0,L.jsx)(ZO,{attachments:fe,previewUrls:me.current,onRemove:be}),(0,L.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,L.jsx)(`input`,{ref:he,type:`file`,multiple:!0,className:`hidden`,onChange:e=>{e.target.files!==null&&ye(e.target.files),e.target.value=``}}),(0,L.jsx)(`button`,{onClick:()=>he.current?.click(),disabled:f||t,className:`self-stretch rounded-md border border-neutral-700 bg-neutral-900 px-2 text-neutral-300 hover:border-neutral-500 hover:text-neutral-100 disabled:cursor-not-allowed disabled:opacity-50`,title:t?`Attachments aren't sent on steer (mid-turn). Wait for the current run to finish.`:`Attach files (images go into model context; text files are prepended to the prompt)`,children:(0,L.jsx)(Ae,{size:14})}),(0,L.jsxs)(`div`,{className:`relative flex-1`,children:[A&&le.length>0&&(0,L.jsxs)(`div`,{className:`absolute bottom-full left-0 right-0 z-10 mb-1 overflow-hidden rounded-md border border-neutral-700 bg-neutral-900 shadow-lg`,children:[(0,L.jsx)(`div`,{className:`max-h-64 overflow-y-auto py-1`,children:le.map((e,t)=>(0,L.jsxs)(`button`,{onMouseDown:n=>{n.preventDefault(),e.available&&(ae(t),ue())},onMouseEnter:()=>ae(t),disabled:!e.available,className:`block w-full px-3 py-1 text-left text-[12px] ${t===ie&&e.available?`bg-neutral-800 text-neutral-100`:`text-neutral-300 hover:bg-neutral-900/80`} ${e.available?``:`opacity-40`}`,title:e.available?e.description:`${e.description} — unavailable right now`,children:[(0,L.jsx)(`span`,{className:`font-mono text-neutral-200`,children:e.name}),(0,L.jsx)(`span`,{className:`ml-2 text-[10px] text-neutral-500`,children:e.description})]},e.name))}),(0,L.jsx)(`div`,{className:`border-t border-neutral-800 px-3 py-1 text-[10px] text-neutral-500`,children:`↑↓ navigate · Enter/Tab run · Esc cancel`})]}),C!==void 0&&T.length>0&&(0,L.jsxs)(`div`,{className:`absolute bottom-full left-0 right-0 z-10 mb-1 overflow-hidden rounded-md border border-neutral-700 bg-neutral-900 shadow-lg`,children:[(0,L.jsx)(`div`,{className:`max-h-64 overflow-y-auto py-1`,children:T.map((e,t)=>(0,L.jsx)(`button`,{onMouseDown:t=>{t.preventDefault(),Je(e)},onMouseEnter:()=>O(t),className:`block w-full truncate px-3 py-1 text-left font-mono text-[12px] ${t===D?`bg-neutral-800 text-neutral-100`:`text-neutral-300 hover:bg-neutral-900/80`}`,title:e,children:e},e))}),(0,L.jsx)(`div`,{className:`border-t border-neutral-800 px-3 py-1 text-[10px] text-neutral-500`,children:`↑↓ navigate · Enter/Tab insert · Esc close`})]}),(0,L.jsx)(`textarea`,{ref:h,value:u,onChange:e=>Ge(e.target.value),onKeyDown:We,onBlur:()=>{setTimeout(()=>{h.current!==document.activeElement&&Ye()},0)},placeholder:i?`Auto-retry in progress — your message will be queued and sent after the retry completes…`:t?`Steer the agent (Enter to send, Shift+Enter for newline)…`:n?"Ask pi (Enter to send, Shift+Enter for newline) — `/` runs commands, `@path` references files…":"Ask pi (Enter to send, Shift+Enter for newline) — `/` runs commands, `!` runs bash, `@path` references files…",title:i?`The agent is auto-retrying after a provider error. New messages are queued and delivered when the retry succeeds.`:void 0,rows:3,style:y===void 0?void 0:{height:`${y}px`},className:`w-full resize-none rounded-md border bg-neutral-900 px-3 py-2 text-sm text-neutral-100 outline-none ${j===`local`?`border-amber-500 focus:border-amber-400`:j===`context`?`border-emerald-500 focus:border-emerald-400`:`border-neutral-700 focus:border-neutral-500`}`}),j!==void 0&&(0,L.jsx)(`span`,{className:`pointer-events-none absolute right-2 top-2 select-none rounded px-1.5 py-0.5 font-mono text-[10px] uppercase tracking-wide ${j===`local`?`bg-amber-500/15 text-amber-300`:`bg-emerald-500/15 text-emerald-300`}`,title:j===`local`?`!! — runs bash; output stays local (excluded from LLM context)`:`! — runs bash; output is added to the next turn's LLM context`,children:j===`local`?`bash · local`:`bash · context`})]}),(0,L.jsxs)(`div`,{className:`flex flex-row gap-1`,children:[(0,L.jsx)(`button`,{onClick:()=>void Ue(),disabled:u.trim().length===0&&fe.length===0||f,className:`rounded-md bg-neutral-100 px-4 py-2 text-sm font-medium text-neutral-900 disabled:cursor-not-allowed disabled:opacity-50`,title:t?`Send (Pi queues at the next agent break — steer or follow-up depending on agent state)`:`Send (Enter)`,children:`Send`}),t&&(0,L.jsx)(`button`,{onClick:()=>void c(e),className:`rounded-md border border-red-700/50 px-3 py-2 text-sm text-red-300 hover:bg-red-900/20`,title:`Stop the agent (or press Esc twice in the textbox)`,children:`Abort`})]})]}),t&&(0,L.jsx)(`p`,{className:`text-[10px] text-neutral-600`,children:`Send queues at the next agent break — Pi picks steer or follow-up. Abort: stop the agent (or press Esc twice in the textbox).`})]})]})}function XO({providers:e,defaultModel:t,value:n,onChange:r}){let i=(0,v.useMemo)(()=>KO(e),[e]),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(0),d=(0,v.useRef)(null),f=(0,v.useRef)(null),p=(0,v.useRef)(null),m=(0,v.useMemo)(()=>{if(s.trim().length===0)return i;let e=[];for(let t of i){let n=qO(t,s);n!==void 0&&e.push({opt:t,score:n})}return e.sort((e,t)=>e.score-t.score),e.map(e=>e.opt)},[i,s]),h=i.find(e=>e.value===n),g=t!==void 0&&t.provider.length>0&&t.modelId.length>0?`${t.provider} / ${t.modelId}`:``,_=h===void 0?g.length>0?`${g} (default)`:`default model`:`${h.provider} / ${h.name}`;(0,v.useEffect)(()=>{if(!a)return;let e=e=>{d.current!==null&&(d.current.contains(e.target)||o(!1))};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[a]),(0,v.useEffect)(()=>{a&&(c(``),u(0),requestAnimationFrame(()=>f.current?.focus()))},[a]),(0,v.useEffect)(()=>{!a||p.current===null||p.current.querySelector(`[data-idx="${l}"]`)?.scrollIntoView({block:`nearest`})},[a,l]);let y=e=>{if(e===-1)r(``);else{let t=m[e];if(t===void 0)return;r(t.value)}o(!1)};return(0,L.jsxs)(`div`,{ref:d,className:`relative`,children:[(0,L.jsxs)(`button`,{onClick:()=>o(e=>!e),disabled:e===void 0,className:`flex max-w-[260px] items-center gap-1 truncate rounded border border-neutral-700 bg-neutral-900 px-2 py-1 text-left text-[11px] text-neutral-200 disabled:opacity-50`,title:`Override the model for this session (click to search)`,children:[(0,L.jsx)(`span`,{className:`text-neutral-500`,children:`model:`}),(0,L.jsx)(`span`,{className:`truncate`,children:_}),(0,L.jsx)(`span`,{className:`ml-1 text-neutral-500`,children:`▾`})]}),a&&(0,L.jsxs)(`div`,{className:`absolute bottom-full left-0 z-10 mb-1 w-[360px] rounded border border-neutral-700 bg-neutral-950 shadow-xl`,children:[(0,L.jsx)(`input`,{ref:f,value:s,onChange:e=>{c(e.target.value),u(0)},onKeyDown:e=>{e.key===`ArrowDown`?(e.preventDefault(),u(e=>Math.min(e+1,m.length-1))):e.key===`ArrowUp`?(e.preventDefault(),u(e=>Math.max(e-1,-1))):e.key===`Enter`?(e.preventDefault(),y(l)):e.key===`Escape`&&(e.preventDefault(),o(!1))},placeholder:`Search provider or model…`,className:`w-full border-b border-neutral-800 bg-transparent px-3 py-2 text-xs text-neutral-100 outline-none`}),(0,L.jsxs)(`div`,{ref:p,className:`max-h-72 overflow-y-auto py-1`,children:[(0,L.jsxs)(`button`,{"data-idx":-1,onMouseEnter:()=>u(-1),onClick:()=>y(-1),className:`flex w-full items-center justify-between px-3 py-1.5 text-left text-xs ${l===-1?`bg-neutral-800 text-neutral-100`:`text-neutral-400`}`,children:[(0,L.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,L.jsx)(`span`,{children:`Use agent default`}),g.length>0&&(0,L.jsx)(`span`,{className:`truncate font-mono text-[10px] text-neutral-500`,children:g})]}),n===``&&(0,L.jsx)(`span`,{className:`text-emerald-400`,children:`●`})]}),m.length===0?(0,L.jsx)(`p`,{className:`px-3 py-2 text-xs italic text-neutral-500`,children:`No models match. Add an API key in Settings → Providers.`}):m.map((e,t)=>(0,L.jsxs)(`button`,{"data-idx":t,onMouseEnter:()=>u(t),onClick:()=>y(t),className:`flex w-full items-center justify-between px-3 py-1.5 text-left text-xs ${t===l?`bg-neutral-800 text-neutral-100`:`text-neutral-300`}`,children:[(0,L.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,L.jsx)(`span`,{className:`text-neutral-500`,children:e.provider}),(0,L.jsx)(`span`,{className:`truncate font-mono`,children:e.name})]}),e.value===n&&(0,L.jsx)(`span`,{className:`text-emerald-400`,children:`●`})]},e.value))]}),(0,L.jsxs)(`div`,{className:`border-t border-neutral-800 px-3 py-1.5 text-[10px] text-neutral-600`,children:[m.length,` of `,i.length,` models — ↑↓ to move, Enter to pick, Esc to close`]})]})]})}function ZO({attachments:e,previewUrls:t,onRemove:n}){return(0,L.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map((e,r)=>{let i=e.type.startsWith(`image/`),a=t.get(e);return(0,L.jsxs)(`div`,{className:`group relative flex items-center gap-1.5 rounded-md border border-neutral-700 bg-neutral-900 pr-1 text-xs text-neutral-200`,children:[i&&a!==void 0?(0,L.jsx)(`img`,{src:a,alt:e.name,className:`h-12 w-12 shrink-0 rounded-l-md object-cover`}):(0,L.jsx)(`span`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-l-md bg-neutral-800 text-neutral-400`,children:i?(0,L.jsx)(we,{size:14}):(0,L.jsx)(Ae,{size:12})}),(0,L.jsxs)(`span`,{className:`flex flex-col py-1 pl-1`,children:[(0,L.jsx)(`span`,{className:`max-w-[160px] truncate font-mono text-[11px]`,title:e.name,children:e.name}),(0,L.jsx)(`span`,{className:`text-[10px] text-neutral-500`,children:QO(e.size)})]}),(0,L.jsx)(`button`,{onClick:()=>n(e),className:`ml-1 rounded p-1 text-neutral-500 hover:bg-neutral-800 hover:text-red-300`,title:`Remove ${e.name}`,children:(0,L.jsx)(Ke,{size:16})})]},`${r}-${e.name}`)})})}function QO(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function $O({sessionId:e,alreadyOnChangesTab:t,onOpen:n}){let r=$n(t=>t.streamingBySession[e]??!1),i=$n(t=>t.agentEndCountBySession[e]??0),[a,o]=(0,v.useState)(0);return(0,v.useEffect)(()=>{o(0)},[e]),(0,v.useEffect)(()=>{if(r)return;let t=!1;return I.getTurnDiff(e).then(e=>{t||o(e.entries.length)}).catch(e=>{t||(e instanceof M&&e.status===404||typeof console<`u`&&console.warn(`[ChangedFilesBadge] turn-diff fetch failed:`,e),o(0))}),()=>{t=!0}},[e,i,r]),a===0||t?null:(0,L.jsx)(`div`,{className:`border-t border-neutral-800 bg-neutral-950 px-6 py-2`,children:(0,L.jsx)(`div`,{className:`mx-auto max-w-3xl`,children:(0,L.jsxs)(`button`,{onClick:n,className:`flex items-center gap-2 rounded-md border border-neutral-700 bg-neutral-900 px-3 py-1.5 text-xs text-neutral-200 hover:border-neutral-500 hover:bg-neutral-800`,title:`Open the Last turn pane to review what the agent just wrote`,children:[(0,L.jsx)(_e,{size:12}),a===1?`1 file edited`:`${a} files edited`,(0,L.jsx)(`span`,{className:`text-[10px] text-neutral-500`,children:`— review`})]})})})}var ek=3e4,tk=[];function nk(e){return e instanceof M?e.code:e instanceof Error?e.message:String(e)}var rk=Qe((e,t)=>({settings:void 0,globalServers:{},byProject:{},loading:!1,error:void 0,pollHandle:void 0,startPolling:()=>{if(t().pollHandle!==void 0)return;let n=()=>{typeof document<`u`&&document.hidden||t().refreshSettings()};n(),e({pollHandle:window.setInterval(n,ek)})},stopPolling:()=>{let n=t().pollHandle;n!==void 0&&(window.clearInterval(n),e({pollHandle:void 0}))},refreshSettings:async()=>{try{e({settings:await I.getMcpSettings(),error:void 0})}catch(t){if(!(t instanceof M)||t.status===401)return;e({error:nk(t)})}},refreshProject:async t=>{if(t===void 0){try{e({globalServers:(await I.listMcpServers()).servers,error:void 0})}catch(t){if(t instanceof M&&t.status===401)return;e({error:nk(t)})}return}e({loading:!0});try{let n=await I.listMcpServers(t);e(e=>({loading:!1,error:void 0,globalServers:n.servers,byProject:{...e.byProject,[t]:{status:n.status,loadedAt:Date.now()}}}))}catch(t){e({loading:!1,error:nk(t)})}},setMcpEnabled:async n=>{let r=t().settings;r!==void 0&&e({settings:{...r,enabled:n}});try{e({settings:await I.setMcpEnabled(n),error:void 0})}catch(t){throw r!==void 0&&e({settings:r}),e({error:nk(t)}),t}},upsertServer:async(n,r)=>{try{await I.upsertMcpServer(n,r),await Promise.all([t().refreshSettings(),...Object.keys(t().byProject).map(e=>t().refreshProject(e))])}catch(t){throw e({error:nk(t)}),t}},deleteServer:async n=>{try{await I.deleteMcpServer(n),await Promise.all([t().refreshSettings(),...Object.keys(t().byProject).map(e=>t().refreshProject(e))])}catch(t){throw e({error:nk(t)}),t}},probeServer:async(n,r)=>{try{await I.probeMcpServer(n,r),await Promise.all([t().refreshSettings(),t().refreshProject(r)])}catch(t){throw e({error:nk(t)}),t}}})),ik=[{id:`dark`,label:`Dark (default)`,mode:`dark`},{id:`light`,label:`Light`,mode:`light`},{id:`dracula`,label:`Dracula`,mode:`dark`},{id:`solarized-dark`,label:`Solarized Dark`,mode:`dark`},{id:`catppuccin-mocha`,label:`Catppuccin Mocha`,mode:`dark`}],ak=`forge.theme`;function ok(e){return typeof e==`string`&&ik.some(t=>t.id===e)}function sk(){try{let e=localStorage.getItem(ak);if(ok(e))return e}catch{}return`dark`}function ck(e){try{localStorage.setItem(ak,e)}catch{}}function lk(e){typeof document>`u`||(document.documentElement.dataset.theme=e)}function uk(){let e=sk();return lk(e),e}var dk=Qe(e=>({theme:sk(),setTheme:t=>{lk(t),ck(t),e({theme:t})}}));function fk(e){return ik.find(t=>t.id===e)??ik[0]}function pk(e,t){if(typeof getComputedStyle>`u`)return t;let n=getComputedStyle(document.documentElement).getPropertyValue(e).trim();return n.length>0?n:t}function mk({onClose:e,initialTab:t}){let n=pr(e=>e.minimal),r=(0,v.useMemo)(()=>n?[`skills`,`tools`,`appearance`,`backup`,`general`]:[`providers`,`agent`,`mcp`,`tools`,`skills`,`appearance`,`backup`,`general`],[n]),[i,a]=(0,v.useState)(t??(n?`skills`:`providers`));(0,v.useEffect)(()=>{r.includes(i)||a(r[0])},[r,i]),(0,v.useEffect)(()=>{t!==void 0&&r.includes(t)&&a(t)},[t,r]);let[o,s]=(0,v.useState)(void 0);return(0,L.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 px-4 py-8`,onClick:e,children:(0,L.jsxs)(`div`,{onClick:e=>e.stopPropagation(),className:`flex h-full max-h-[640px] w-full max-w-3xl flex-col overflow-hidden rounded-lg border border-neutral-800 bg-neutral-950 shadow-2xl`,children:[(0,L.jsxs)(`header`,{className:`flex items-center justify-between border-b border-neutral-800 px-4 py-3`,children:[(0,L.jsx)(`div`,{className:`flex items-center gap-1`,children:r.map(e=>(0,L.jsx)(`button`,{onClick:()=>a(e),className:`rounded px-3 py-1 text-xs ${i===e?`bg-neutral-800 text-neutral-100`:`text-neutral-400 hover:bg-neutral-900 hover:text-neutral-200`}`,children:e===`providers`?`Providers`:e===`agent`?`Agent`:e===`mcp`?`MCP`:e===`tools`?`Tools`:e===`skills`?`Skills`:e===`appearance`?`Appearance`:e===`backup`?`Backup`:`General`},e))}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`button`,{onClick:()=>{let e=Et(),t=e===void 0?`/api/docs`:`/api/docs?token=${encodeURIComponent(e.token)}`;window.open(t,`_blank`,`noopener,noreferrer`)},className:`rounded border border-neutral-700 px-2 py-1 text-xs text-neutral-300 hover:border-neutral-500`,title:`Open the OpenAPI / Swagger UI in a new tab. Carries your auth token automatically.`,children:`API Docs ↗`}),(0,L.jsx)(`button`,{onClick:e,className:`rounded border border-neutral-700 px-2 py-1 text-xs text-neutral-300 hover:border-neutral-500`,title:`Close (Esc)`,children:`Close`})]})]}),o!==void 0&&(0,L.jsx)(`div`,{className:`border-b border-red-700/40 bg-red-900/20 px-4 py-2 text-xs text-red-300`,children:o}),(0,L.jsxs)(`div`,{className:`flex-1 overflow-y-auto px-4 py-3 text-sm text-neutral-200`,children:[i===`providers`&&(0,L.jsx)(gk,{onError:s}),i===`agent`&&(0,L.jsx)(vk,{onError:s}),i===`mcp`&&(0,L.jsx)(Ik,{onError:s}),i===`tools`&&(0,L.jsx)(kk,{onError:s}),i===`skills`&&(0,L.jsx)(Tk,{onError:s}),i===`appearance`&&(0,L.jsx)(jk,{}),i===`backup`&&(0,L.jsx)(Nk,{onError:s}),i===`general`&&(0,L.jsx)(Vk,{})]})]})})}function hk(e){return e instanceof M?e.code:e.message}function gk({onError:e}){let[t,n]=(0,v.useState)(void 0),[r,i]=(0,v.useState)(void 0),[a,o]=(0,v.useState)(void 0),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(!1),d=async()=>{e(void 0);try{let[e,t]=await Promise.all([I.getProviders(),I.getAuthSummary()]);n(e),i(t)}catch(t){e(`Failed to load providers: ${hk(t)}`)}};(0,v.useEffect)(()=>{d()},[]);let f=async t=>{if(s.trim().length!==0){u(!0);try{await I.setApiKey(t,s.trim()),o(void 0),c(``),await d()}catch(t){e(`Save key failed: ${hk(t)}`)}finally{u(!1)}}},p=async t=>{if(confirm(`Remove the stored key for "${t}"?`)){u(!0);try{await I.removeApiKey(t),await d()}catch(t){e(`Remove key failed: ${hk(t)}`)}finally{u(!1)}}};return t===void 0?(0,L.jsx)(`p`,{className:`text-xs italic text-neutral-500`,children:`Loading providers…`}):(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsxs)(`p`,{className:`text-xs text-neutral-500`,children:[`Built-in providers and anything in `,(0,L.jsx)(`code`,{className:`font-mono`,children:`models.json`}),`. Stored API keys are presence-only — actual values are never sent to the browser.`]}),t.providers.length===0&&(0,L.jsx)(`p`,{className:`text-xs italic text-neutral-500`,children:`No providers configured.`}),t.providers.map(e=>{let t=r?.providers[e.provider],n=t?.configured===!0,i=a===e.provider;return(0,L.jsxs)(`div`,{className:`rounded border border-neutral-800 bg-neutral-900/40 p-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`font-mono text-sm text-neutral-100`,children:e.provider}),(0,L.jsx)(`span`,{className:`rounded px-1.5 py-0.5 text-[10px] uppercase tracking-wider ${n?`bg-emerald-900/40 text-emerald-300`:`bg-neutral-800 text-neutral-500`}`,children:n?`key set`:`no key`}),t?.source!==void 0&&(0,L.jsxs)(`span`,{className:`text-[10px] text-neutral-500`,children:[`via `,t.source]})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-1 text-xs`,children:[!i&&(0,L.jsx)(`button`,{onClick:()=>{o(e.provider),c(``)},className:`rounded border border-neutral-700 px-2 py-0.5 text-neutral-300 hover:border-neutral-500`,children:n?`Replace key`:`Add key`}),n&&!i&&(0,L.jsx)(`button`,{onClick:()=>void p(e.provider),disabled:l,className:`rounded border border-red-700/50 px-2 py-0.5 text-red-300 hover:bg-red-900/20 disabled:opacity-50`,children:`Remove`})]})]}),i&&(0,L.jsxs)(`div`,{className:`mt-2 flex items-center gap-2`,children:[(0,L.jsx)(`input`,{type:`password`,value:s,onChange:e=>c(e.target.value),placeholder:`Paste API key`,autoFocus:!0,className:`flex-1 rounded border border-neutral-700 bg-neutral-950 px-2 py-1 text-xs text-neutral-100 outline-none focus:border-neutral-500`}),(0,L.jsx)(`button`,{onClick:()=>void f(e.provider),disabled:l||s.trim().length===0,className:`rounded bg-neutral-100 px-2 py-1 text-xs font-medium text-neutral-900 disabled:opacity-50`,children:`Save`}),(0,L.jsx)(`button`,{onClick:()=>{o(void 0),c(``)},className:`rounded border border-neutral-700 px-2 py-1 text-xs text-neutral-300`,children:`Cancel`})]}),(0,L.jsxs)(`details`,{className:`mt-2`,children:[(0,L.jsxs)(`summary`,{className:`cursor-pointer text-[11px] text-neutral-500`,children:[e.models.length,` model`,e.models.length===1?``:`s`]}),(0,L.jsx)(`ul`,{className:`mt-1 space-y-0.5 text-[11px]`,children:e.models.map(e=>(0,L.jsxs)(`li`,{className:`flex justify-between font-mono`,children:[(0,L.jsx)(`span`,{className:e.hasAuth?`text-neutral-300`:`text-neutral-600`,children:e.name}),(0,L.jsxs)(`span`,{className:`text-neutral-600`,children:[`ctx `,Math.round(e.contextWindow/1e3),`k`]})]},e.id))})]})]},e.provider)}),(0,L.jsx)(_k,{onError:e})]})}function _k({onError:e}){let[t,n]=(0,v.useState)(void 0),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(void 0);xk(a,()=>o(void 0));let s=async()=>{try{let e=await I.getModelsJson();n(JSON.stringify(e,null,2))}catch(t){e(`Load models.json failed: ${hk(t)}`)}},c=async()=>{if(t===void 0)return;let n;try{n=JSON.parse(t)}catch{e(`models.json: invalid JSON`);return}if(typeof n!=`object`||!n||typeof n.providers!=`object`||n.providers===null){e(`models.json: top-level must be { "providers": { ... } }`);return}i(!0),o(void 0);try{await I.setModelsJson(n),e(void 0),o(Date.now())}catch(t){e(`Save failed: ${hk(t)}`)}finally{i(!1)}};return(0,L.jsxs)(`details`,{className:`rounded border border-neutral-800 bg-neutral-900/40 p-3`,children:[(0,L.jsx)(`summary`,{className:`cursor-pointer text-xs text-neutral-300`,onClick:()=>{t===void 0&&s()},children:`Custom providers (models.json)`}),(0,L.jsx)(`p`,{className:`mt-1 text-[11px] text-neutral-500`,children:`Raw JSON editor. Add vLLM / LiteLLM / Ollama / OpenAI-compatible endpoints here. The SDK validates on next session creation.`}),t===void 0?(0,L.jsx)(`p`,{className:`mt-2 text-xs italic text-neutral-500`,children:`Loading…`}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`textarea`,{value:t,onChange:e=>n(e.target.value),spellCheck:!1,rows:10,className:`mt-2 w-full rounded border border-neutral-700 bg-neutral-950 px-2 py-1 font-mono text-[11px] text-neutral-100 outline-none focus:border-neutral-500`}),(0,L.jsxs)(`div`,{className:`mt-2 flex items-center justify-end gap-2 text-xs`,children:[a!==void 0&&(0,L.jsx)(`span`,{className:`text-emerald-400`,"aria-live":`polite`,children:`Saved`}),(0,L.jsx)(`button`,{onClick:()=>void s(),disabled:r,className:`rounded border border-neutral-700 px-2 py-1 text-neutral-300`,children:`Reload`}),(0,L.jsx)(`button`,{onClick:()=>void c(),disabled:r,className:`rounded bg-neutral-100 px-3 py-1 font-medium text-neutral-900 disabled:opacity-50`,children:r?`Saving…`:`Save`})]})]})]})}function vk({onError:e}){let[t,n]=(0,v.useState)(void 0),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(`form`),s=async()=>{e(void 0);try{n(await I.getSettings())}catch(t){e(`Failed to load settings: ${hk(t)}`)}};(0,v.useEffect)(()=>{s()},[]);let c=e=>{if(t===void 0)return``;let n=t[e];return typeof n==`string`?n:``},l=async t=>{i(!0);try{n(await I.updateSettings(t))}catch(t){e(`Save failed: ${hk(t)}`)}finally{i(!1)}};return t===void 0?(0,L.jsx)(`p`,{className:`text-xs italic text-neutral-500`,children:`Loading settings…`}):a===`json`?(0,L.jsx)(yk,{initial:t,onSave:async r=>{let a={...r};for(let e of Object.keys(t))e in r||(a[e]=null);i(!0);try{n(await I.updateSettings(a)),e(void 0)}catch(t){throw e(`Save failed: ${hk(t)}`),t}finally{i(!1)}},onSwitchToForm:()=>o(`form`),busy:r,onError:e}):(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,L.jsx)(`p`,{className:`text-xs text-neutral-500`,children:`Defaults for new sessions. The form covers common keys; switch to JSON to edit anything the SDK accepts.`}),(0,L.jsx)(`button`,{onClick:()=>o(`json`),className:`rounded border border-neutral-700 px-2 py-0.5 text-[11px] text-neutral-300 hover:border-neutral-500`,children:`Edit as JSON`})]}),(0,L.jsx)(Sk,{label:`Default provider`,hint:`e.g. anthropic, openai, google, custom`,children:(0,L.jsx)(Ck,{value:c(`defaultProvider`),onSave:e=>l({defaultProvider:e.length===0?null:e}),disabled:r})}),(0,L.jsx)(Sk,{label:`Default model`,hint:`model id from the chosen provider`,children:(0,L.jsx)(Ck,{value:c(`defaultModel`),onSave:e=>l({defaultModel:e.length===0?null:e}),disabled:r})}),(0,L.jsx)(Sk,{label:`Thinking level`,hint:`off, low, medium, high (provider-dependent)`,children:(0,L.jsx)(wk,{value:c(`defaultThinkingLevel`),options:[``,`off`,`low`,`medium`,`high`],onSave:e=>l({defaultThinkingLevel:e.length===0?null:e}),disabled:r})}),(0,L.jsx)(Sk,{label:`Steering mode`,hint:`how interruptions during streaming are queued`,children:(0,L.jsx)(wk,{value:c(`steeringMode`),options:[``,`steer`,`followUp`],onSave:e=>l({steeringMode:e.length===0?null:e}),disabled:r})}),(0,L.jsx)(Sk,{label:`Follow-up mode`,hint:`how queued messages are delivered after agent_end`,children:(0,L.jsx)(wk,{value:c(`followUpMode`),options:[``,`steer`,`followUp`],onSave:e=>l({followUpMode:e.length===0?null:e}),disabled:r})})]})}function yk({initial:e,onSave:t,onSwitchToForm:n,busy:r,onError:i}){let[a,o]=(0,v.useState)(()=>JSON.stringify(e,null,2)),[s,c]=(0,v.useState)(void 0);xk(s,()=>c(void 0));let l=async()=>{let e;try{e=JSON.parse(a)}catch{i(`settings.json: invalid JSON`);return}if(typeof e!=`object`||!e||Array.isArray(e)){i(`settings.json: top-level must be an object`);return}c(void 0);try{await t(e),c(Date.now())}catch{}};return(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,L.jsxs)(`p`,{className:`text-[11px] text-neutral-500`,children:[`Raw `,(0,L.jsx)(`code`,{className:`font-mono`,children:`settings.json`}),`. Keys removed here are deleted on save (mapped to `,(0,L.jsx)(`code`,{className:`font-mono`,children:`null`}),` in the merge patch). The SDK validates on next session creation.`]}),(0,L.jsx)(`button`,{onClick:n,className:`rounded border border-neutral-700 px-2 py-0.5 text-[11px] text-neutral-300 hover:border-neutral-500`,children:`Back to form`})]}),(0,L.jsx)(`textarea`,{value:a,onChange:e=>o(e.target.value),spellCheck:!1,rows:18,className:`w-full rounded border border-neutral-700 bg-neutral-950 px-2 py-1 font-mono text-[11px] text-neutral-100 outline-none focus:border-neutral-500`}),(0,L.jsxs)(`div`,{className:`flex items-center justify-end gap-2 text-xs`,children:[s!==void 0&&(0,L.jsx)(`span`,{className:`text-emerald-400`,"aria-live":`polite`,children:`Saved`}),(0,L.jsx)(`button`,{onClick:()=>o(JSON.stringify(e,null,2)),disabled:r,className:`rounded border border-neutral-700 px-2 py-1 text-neutral-300`,children:`Reset`}),(0,L.jsx)(`button`,{onClick:()=>void l(),disabled:r,className:`rounded bg-neutral-100 px-3 py-1 font-medium text-neutral-900 disabled:opacity-50`,children:r?`Saving…`:`Save`})]})]})}var bk=2500;function xk(e,t){(0,v.useEffect)(()=>{if(e===void 0)return;let n=window.setTimeout(t,bk);return()=>window.clearTimeout(n)},[e,t])}function Sk({label:e,hint:t,children:n}){return(0,L.jsxs)(`div`,{className:`space-y-1`,children:[(0,L.jsx)(`label`,{className:`block text-xs font-medium text-neutral-200`,children:e}),t!==void 0&&(0,L.jsx)(`p`,{className:`text-[11px] text-neutral-500`,children:t}),n]})}function Ck({value:e,onSave:t,disabled:n}){let[r,i]=(0,v.useState)(e);return(0,v.useEffect)(()=>i(e),[e]),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`input`,{value:r,onChange:e=>i(e.target.value),disabled:n,className:`flex-1 rounded border border-neutral-700 bg-neutral-950 px-2 py-1 text-xs text-neutral-100 outline-none focus:border-neutral-500`}),(0,L.jsx)(`button`,{onClick:()=>void t(r),disabled:n||r===e,className:`rounded bg-neutral-100 px-2 py-1 text-xs font-medium text-neutral-900 disabled:opacity-50`,children:`Save`})]})}function wk({value:e,options:t,onSave:n,disabled:r}){return(0,L.jsx)(`select`,{value:e,disabled:r,onChange:e=>void n(e.target.value),className:`rounded border border-neutral-700 bg-neutral-950 px-2 py-1 text-xs text-neutral-100`,children:t.map(e=>(0,L.jsx)(`option`,{value:e,children:e.length===0?`(unset)`:e},e))})}function Tk({onError:e}){let t=kn(),n=On(e=>e.projects),[r,i]=(0,v.useState)(void 0),[a,o]=(0,v.useState)([]),[s,c]=(0,v.useState)({}),[l,u]=(0,v.useState)({}),[d,f]=(0,v.useState)(!1),p=async()=>{if(t!==void 0){e(void 0);try{let[{skills:e,diagnostics:n},r]=await Promise.all([I.listSkills(t.id),I.listSkillOverrides()]);i(e),o(n),c(r.projects)}catch(t){e(`Failed to load skills: ${hk(t)}`)}}};if((0,v.useEffect)(()=>{p()},[t?.id]),t===void 0)return(0,L.jsx)(`p`,{className:`text-xs italic text-neutral-500`,children:`Pick a project from the header to manage its skills.`});if(r===void 0)return(0,L.jsxs)(`p`,{className:`text-xs italic text-neutral-500`,children:[`Loading skills for `,t.name,`…`]});let m=async(n,r)=>{f(!0);try{let{skills:e}=await I.setSkillEnabled(t.id,n,r,`global`);i(e)}catch(t){e(`Toggle failed: ${hk(t)}`)}finally{f(!1)}},h=async(t,n,r)=>{f(!0);try{r===void 0?await I.clearSkillProjectOverride(t,n):await I.setSkillEnabled(t,n,r===`enabled`,`project`),await p()}catch(t){e(`Override write failed: ${hk(t)}`)}finally{f(!1)}},g=(e,t)=>{let n=s[e];if(n!==void 0){if(n.enable.includes(t))return`enabled`;if(n.disable.includes(t))return`disabled`}};return(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsxs)(`p`,{className:`text-xs text-neutral-500`,children:[`Skills discovered in `,(0,L.jsx)(`code`,{className:`font-mono`,children:`~/.pi/agent/skills/`}),` and`,` `,(0,L.jsxs)(`code`,{className:`font-mono`,children:[t.path,`/.pi/skills/`]}),`. The global toggle writes to pi's `,(0,L.jsx)(`code`,{className:`font-mono`,children:`settings.skills`}),`; per-project overrides write to the pi-forge-private file at`,` `,(0,L.jsx)(`code`,{className:`font-mono`,children:"${FORGE_DATA_DIR}/skills-overrides.json"}),`.`]}),(0,L.jsxs)(`div`,{className:`rounded border border-amber-700/40 bg-amber-900/10 px-3 py-2 text-[11px] text-amber-200`,children:[`Skill changes apply to the `,(0,L.jsx)(`strong`,{children:`next session`}),` you start in the affected project. Live sessions keep the skill set they booted with — start a new session to use a freshly enabled skill.`]}),a.length>0&&(0,L.jsx)(Ek,{diagnostics:a}),r.length===0&&(0,L.jsx)(`p`,{className:`text-xs italic text-neutral-500`,children:`No skills found for this project.`}),r.map(e=>{let r=`${e.source}:${e.name}`,i=l[r]===!0,a=n.map(t=>({project:t,state:g(t.id,e.name)})).filter(e=>e.state!==void 0),o=n.filter(t=>g(t.id,e.name)===void 0);return(0,L.jsxs)(`div`,{className:`rounded border border-neutral-800 bg-neutral-900/40`,children:[(0,L.jsxs)(`div`,{className:`flex items-start gap-3 p-3`,children:[(0,L.jsx)(`span`,{className:`mt-1.5 inline-block h-2.5 w-2.5 rounded-full ${e.effective?`bg-emerald-500`:`bg-neutral-700`}`,title:`Effective for ${t.name}: ${e.effective?`enabled`:`disabled`}`}),(0,L.jsxs)(`div`,{className:`flex-1 space-y-0.5`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,L.jsx)(`span`,{className:`font-mono text-neutral-100`,children:e.name}),(0,L.jsx)(`span`,{className:`rounded bg-neutral-800 px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-neutral-400`,children:e.source}),e.projectOverride!==void 0&&(0,L.jsxs)(`span`,{className:`rounded px-1.5 py-0.5 text-[10px] uppercase tracking-wider ${e.projectOverride===`enabled`?`bg-emerald-900/40 text-emerald-300`:`bg-red-900/40 text-red-300`}`,title:`Active project ('${t.name}') has an override`,children:[`Project: `,e.projectOverride]})]}),(0,L.jsx)(`p`,{className:`text-xs text-neutral-400`,children:e.description||`(no description)`}),(0,L.jsx)(`p`,{className:`font-mono text-[10px] text-neutral-600`,children:e.filePath})]}),(0,L.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 text-xs`,children:[(0,L.jsxs)(`button`,{onClick:()=>void m(e.name,!e.enabled),disabled:d,className:`rounded border px-2 py-0.5 ${e.enabled?`border-emerald-700/50 bg-emerald-900/20 text-emerald-300`:`border-neutral-700 text-neutral-300 hover:border-neutral-500`}`,title:`Global enable in pi's settings.skills`,children:[`Global: `,e.enabled?`enabled`:`disabled`]}),(0,L.jsx)(`button`,{onClick:()=>u(e=>({...e,[r]:!i})),className:`rounded border border-neutral-700 px-2 py-0.5 text-neutral-300 hover:border-neutral-500`,title:`Show per-project overrides`,children:i?`▾ Overrides`:`▸ Overrides (${a.length})`})]})]}),i&&(0,L.jsxs)(`div`,{className:`border-t border-neutral-800 px-3 py-2`,children:[a.length===0?(0,L.jsx)(`p`,{className:`mb-2 text-[11px] italic text-neutral-500`,children:`No project overrides yet — every project inherits the global state.`}):(0,L.jsx)(`div`,{className:`mb-2 space-y-1`,children:a.map(({project:t,state:n})=>(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded bg-neutral-900/60 px-2 py-1 text-xs`,children:[(0,L.jsx)(`span`,{className:`truncate text-neutral-200`,title:t.path,children:t.name}),(0,L.jsx)(Dk,{value:n,disabled:d,onChange:n=>void h(t.id,e.name,n)})]},t.id))}),o.length>0&&(0,L.jsx)(Ok,{projects:o,disabled:d,onAdd:(t,n)=>void h(t,e.name,n)})]})]},r)})]})}function Ek({diagnostics:e}){return(0,L.jsxs)(`div`,{className:`space-y-1 rounded border border-red-700/40 bg-red-900/10 px-3 py-2 text-[11px] text-red-200`,children:[(0,L.jsxs)(`p`,{className:`font-medium`,children:[e.length,` skill `,e.length===1?`file`:`files`,` were not loaded:`]}),(0,L.jsx)(`ul`,{className:`space-y-1.5`,children:e.map((e,t)=>(0,L.jsxs)(`li`,{className:`border-l-2 border-red-700/60 pl-2`,children:[(0,L.jsxs)(`div`,{className:`text-red-100`,children:[(0,L.jsx)(`span`,{className:`rounded bg-red-900/40 px-1 py-0.5 text-[10px] uppercase tracking-wider text-red-300`,children:e.type}),` `,e.message]}),e.collision!==void 0&&(0,L.jsxs)(`div`,{className:`mt-0.5 font-mono text-[10px] text-red-300/80`,children:[(0,L.jsxs)(`div`,{children:[`loser:\xA0\xA0`,(0,L.jsx)(`span`,{className:`text-red-200`,children:e.collision.loserPath})]}),(0,L.jsxs)(`div`,{children:[`winner:\xA0`,(0,L.jsx)(`span`,{className:`text-red-200`,children:e.collision.winnerPath})]}),(0,L.jsxs)(`div`,{className:`mt-1 text-red-300/70`,children:[`Add `,(0,L.jsxs)(`code`,{className:`rounded bg-red-900/40 px-1`,children:[`name: `,`<unique>`]}),` to the loser's frontmatter, or move it to`,` `,(0,L.jsx)(`code`,{className:`rounded bg-red-900/40 px-1`,children:`<unique>/SKILL.md`}),` so the parent dir name disambiguates.`]})]}),e.collision===void 0&&e.path!==void 0&&(0,L.jsx)(`div`,{className:`mt-0.5 font-mono text-[10px] text-red-300/80`,children:e.path})]},t))})]})}function Dk({value:e,disabled:t,onChange:n}){let r=(e,r,i)=>(0,L.jsx)(`button`,{onClick:()=>n(r),disabled:t,className:`rounded px-2 py-0.5 text-[11px] ${i?r===`enabled`?`bg-emerald-900/40 text-emerald-300`:r===`disabled`?`bg-red-900/40 text-red-300`:`bg-neutral-800 text-neutral-400`:`text-neutral-500 hover:bg-neutral-800 hover:text-neutral-300`}`,children:e});return(0,L.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5 rounded border border-neutral-700 px-0.5`,children:[r(`Inherit`,void 0,e===void 0),r(`Enabled`,`enabled`,e===`enabled`),r(`Disabled`,`disabled`,e===`disabled`)]})}function Ok({projects:e,disabled:t,onAdd:n}){let[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(``);return r?(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 text-[11px]`,children:[(0,L.jsxs)(`select`,{value:a,onChange:e=>o(e.target.value),className:`rounded border border-neutral-700 bg-neutral-950 px-2 py-0.5 text-neutral-100 outline-none focus:border-neutral-500`,children:[(0,L.jsx)(`option`,{value:``,children:`Pick project…`}),e.map(e=>(0,L.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),(0,L.jsx)(`button`,{onClick:()=>{a.length!==0&&(n(a,`enabled`),i(!1),o(``))},disabled:t||a.length===0,className:`rounded bg-emerald-900/40 px-2 py-0.5 text-emerald-300 disabled:opacity-50`,children:`Enable here`}),(0,L.jsx)(`button`,{onClick:()=>{a.length!==0&&(n(a,`disabled`),i(!1),o(``))},disabled:t||a.length===0,className:`rounded bg-red-900/40 px-2 py-0.5 text-red-300 disabled:opacity-50`,children:`Disable here`}),(0,L.jsx)(`button`,{onClick:()=>{i(!1),o(``)},className:`rounded border border-neutral-700 px-2 py-0.5 text-neutral-400 hover:border-neutral-500`,children:`Cancel`})]}):(0,L.jsx)(`button`,{onClick:()=>i(!0),disabled:t,className:`rounded border border-neutral-700 px-2 py-0.5 text-[11px] text-neutral-300 hover:border-neutral-500`,children:`+ Add override for…`})}function kk({onError:e}){let t=On(e=>e.projects),[n,r]=(0,v.useState)(void 0),[i,a]=(0,v.useState)({}),[o,s]=(0,v.useState)(!1),c=async()=>{e(void 0);try{let[e,t]=await Promise.all([I.listTools(),I.listToolOverrides()]);r(e),a(t.projects)}catch(t){e(`Failed to load tools: ${hk(t)}`)}};(0,v.useEffect)(()=>{c()},[]);let l=async(t,n,r)=>{s(!0);try{await I.setToolEnabled(t,n,r,`global`),await c()}catch(t){e(`Toggle failed: ${hk(t)}`)}finally{s(!1)}},u=async(t,n,r,i)=>{s(!0);try{i===void 0?await I.clearToolProjectOverride(t,r,n):await I.setToolEnabled(t,r,i===`enabled`,`project`,n),await c()}catch(t){e(`Override write failed: ${hk(t)}`)}finally{s(!1)}};return n===void 0?(0,L.jsx)(`p`,{className:`text-xs italic text-neutral-500`,children:`Loading tools…`}):(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsxs)(`p`,{className:`text-xs text-neutral-500`,children:[`Toggle individual built-in tools the agent can call. The global toggle on the right is the default for every project. Use `,(0,L.jsx)(`strong`,{children:`Overrides`}),` to enable/disable a tool per project — explicit project overrides win over the global default. Changes apply to the next session — already-running sessions keep the tool set they started with. MCP server tools live under their respective server in the `,(0,L.jsx)(`strong`,{children:`MCP`}),` tab.`]}),(0,L.jsxs)(`section`,{children:[(0,L.jsx)(`h3`,{className:`mb-2 text-xs font-semibold uppercase tracking-wider text-neutral-400`,children:`Built-in tools`}),(0,L.jsx)(`div`,{className:`space-y-2`,children:n.builtin.map(e=>(0,L.jsx)(Ak,{family:`builtin`,name:e.name,fqn:e.name,description:e.description,globalEnabled:e.globalEnabled,projects:t,allOverrides:i,busy:o,onToggleGlobal:t=>void l(`builtin`,e.name,t),onSetProjectOverride:(t,n)=>void u(`builtin`,t,e.name,n)},`builtin:${e.name}`))})]}),n.extension.length>0&&(0,L.jsxs)(`section`,{children:[(0,L.jsx)(`h3`,{className:`mb-2 text-xs font-semibold uppercase tracking-wider text-neutral-400`,children:`Extension tools`}),(0,L.jsxs)(`p`,{className:`mb-2 text-[11px] text-neutral-500`,children:[`Tools registered programmatically by pi extensions installed under`,` `,(0,L.jsx)(`code`,{className:`font-mono`,children:`~/.pi/agent/extensions/`}),` or a project's`,` `,(0,L.jsx)(`code`,{className:`font-mono`,children:`.pi/extensions/`}),`. Disabled tools are dropped from the allowlist passed to the next session — the extension itself remains loaded.`]}),(0,L.jsx)(`div`,{className:`space-y-4`,children:n.extension.map(e=>(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsxs)(`div`,{className:`text-[11px] font-semibold text-neutral-300`,children:[`Package: `,(0,L.jsx)(`code`,{className:`font-mono text-neutral-400`,children:e.packageSource})]}),(0,L.jsx)(`div`,{className:`space-y-2`,children:e.tools.map(n=>(0,L.jsx)(Ak,{family:`extension`,name:n.name,fqn:n.name,description:n.description,globalEnabled:n.globalEnabled,projects:t,allOverrides:i,busy:o,onToggleGlobal:e=>void l(`extension`,n.name,e),onSetProjectOverride:(e,t)=>void u(`extension`,e,n.name,t)},`extension:${e.packageSource}:${n.name}`))})]},e.packageSource))})]})]})}function Ak({family:e,name:t,fqn:n,description:r,globalEnabled:i,projects:a,allOverrides:o,busy:s,onToggleGlobal:c,onSetProjectOverride:l}){let[u,d]=(0,v.useState)(!1),f=t=>{let r=o[t];if(r===void 0)return;let i=e===`builtin`?r.builtin:e===`mcp`?r.mcp:r.extension;if(i!==void 0){if(i.enable.includes(n))return`enabled`;if(i.disable.includes(n))return`disabled`}},p=a.map(e=>({project:e,state:f(e.id)})).filter(e=>e.state!==void 0),m=a.filter(e=>f(e.id)===void 0);return(0,L.jsxs)(`div`,{className:`rounded border border-neutral-800 bg-neutral-900/40`,children:[(0,L.jsxs)(`div`,{className:`flex items-start gap-3 p-3`,children:[(0,L.jsx)(`span`,{className:`mt-1.5 inline-block h-2.5 w-2.5 rounded-full ${i?`bg-emerald-500`:`bg-neutral-700`}`,title:`Global default: ${i?`enabled`:`disabled`}`}),(0,L.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,L.jsx)(`span`,{className:`font-mono text-neutral-100`,children:t}),n!==t&&(0,L.jsx)(`span`,{className:`font-mono text-[10px] text-neutral-500`,title:`Bridged tool name pi sees on the wire`,children:n})]}),r.length>0&&(0,L.jsx)(`p`,{className:`line-clamp-2 text-[11px] text-neutral-500`,title:r,children:r})]}),(0,L.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 text-xs`,children:[(0,L.jsxs)(`button`,{onClick:()=>c(!i),disabled:s,className:`rounded border px-2 py-0.5 disabled:opacity-50 ${i?`border-emerald-700/50 bg-emerald-900/20 text-emerald-300`:`border-neutral-700 text-neutral-300 hover:border-neutral-500`}`,title:`Global default for every project that doesn't override`,children:[`Global: `,i?`enabled`:`disabled`]}),(0,L.jsx)(`button`,{onClick:()=>d(e=>!e),className:`rounded border border-neutral-700 px-2 py-0.5 text-neutral-300 hover:border-neutral-500`,title:`Show per-project overrides`,children:u?`▾ Overrides`:`▸ Overrides (${p.length})`})]})]}),u&&(0,L.jsxs)(`div`,{className:`border-t border-neutral-800 px-3 py-2`,children:[p.length===0?(0,L.jsx)(`p`,{className:`mb-2 text-[11px] italic text-neutral-500`,children:`No project overrides yet — every project inherits the global state.`}):(0,L.jsx)(`div`,{className:`mb-2 space-y-1`,children:p.map(({project:e,state:t})=>(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2 rounded bg-neutral-900/60 px-2 py-1 text-xs`,children:[(0,L.jsx)(`span`,{className:`truncate text-neutral-200`,title:e.path,children:e.name}),(0,L.jsx)(Dk,{value:t,disabled:s,onChange:t=>l(e.id,t)})]},e.id))}),m.length>0&&(0,L.jsx)(Ok,{projects:m,disabled:s,onAdd:(e,t)=>l(e,t)}),a.length===0&&(0,L.jsx)(`p`,{className:`text-[11px] italic text-neutral-500`,children:`No projects exist yet. Create a project first to add per-project overrides.`})]})]})}function jk(){let e=dk(e=>e.theme),t=dk(e=>e.setTheme);return(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h2`,{className:`text-sm font-semibold text-neutral-100`,children:`Theme`}),(0,L.jsx)(`p`,{className:`mt-1 text-xs text-neutral-400`,children:`Sets the color palette for the chrome, editor, and terminal. Persisted in this browser only — open in another browser to use a different theme there.`})]}),(0,L.jsx)(`div`,{className:`grid grid-cols-1 gap-2 sm:grid-cols-2`,children:ik.map(n=>(0,L.jsxs)(`button`,{onClick:()=>t(n.id),className:`flex items-center justify-between gap-3 rounded border px-3 py-2 text-left ${n.id===e?`border-neutral-400 bg-neutral-800`:`border-neutral-700 hover:border-neutral-500`}`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`text-sm text-neutral-100`,children:n.label}),(0,L.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider text-neutral-500`,children:n.mode})]}),(0,L.jsx)(Mk,{id:n.id})]},n.id))})]})}function Mk({id:e}){return(0,L.jsxs)(`div`,{"data-theme":e,className:`flex h-6 overflow-hidden rounded border border-neutral-700`,children:[(0,L.jsx)(`div`,{className:`w-4 bg-neutral-950`}),(0,L.jsx)(`div`,{className:`w-4 bg-neutral-800`}),(0,L.jsx)(`div`,{className:`w-4 bg-neutral-500`}),(0,L.jsx)(`div`,{className:`w-4 bg-neutral-200`})]})}function Nk({onError:e}){let[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(void 0),[a,o]=(0,v.useState)(void 0),s=(0,v.useRef)(null),[c,l]=(0,v.useState)(void 0),[u,d]=(0,v.useState)(void 0),f=(0,v.useRef)(null),p=(0,v.useRef)(null),m=async()=>{e(void 0),n(!0),o(void 0);try{let{blob:e,filename:t,files:n}=await I.exportConfig(),r=URL.createObjectURL(e),a=document.createElement(`a`);a.href=r,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),requestAnimationFrame(()=>URL.revokeObjectURL(r)),i({filename:t,files:n})}catch(t){e(`Export failed: ${hk(t)}`)}finally{n(!1)}},h=async t=>{e(void 0),n(!0),i(void 0);try{o(await I.importConfig(t))}catch(t){e(`Import failed: ${hk(t)}`)}finally{n(!1),s.current&&(s.current.value=``)}},g=(e,t)=>{let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),requestAnimationFrame(()=>URL.revokeObjectURL(n))},_=async()=>{e(void 0),n(!0),d(void 0),l(void 0);try{let{blob:e,filename:t,fileCount:n}=await I.exportSkills();g(e,t),l({filename:t,fileCount:n})}catch(t){t instanceof M&&t.code===`skills_directory_empty`?l({filename:``,fileCount:0}):e(`Skills export failed: ${hk(t)}`)}finally{n(!1)}},y=async t=>{if(t.length!==0){e(void 0),n(!0),l(void 0);try{d(await I.importSkills(t))}catch(t){e(`Skills import failed: ${hk(t)}`)}finally{n(!1),f.current&&(f.current.value=``),p.current&&(p.current.value=``)}}};return(0,L.jsxs)(`div`,{className:`space-y-6`,children:[(0,L.jsxs)(`section`,{children:[(0,L.jsx)(`h3`,{className:`mb-2 text-sm font-medium text-neutral-100`,children:`Export config`}),(0,L.jsxs)(`p`,{className:`mb-3 text-xs text-neutral-400`,children:[`Downloads a `,(0,L.jsx)(`code`,{className:`font-mono`,children:`.tar.gz`}),` with`,` `,(0,L.jsx)(`code`,{className:`font-mono`,children:`mcp.json`}),`,`,` `,(0,L.jsx)(`code`,{className:`font-mono`,children:`settings.json`}),`, and`,` `,(0,L.jsx)(`code`,{className:`font-mono`,children:`models.json`}),`. Provider auth (`,(0,L.jsx)(`code`,{className:`font-mono`,children:`auth.json`}),` — API keys, OAuth tokens) is`,` `,(0,L.jsx)(`strong`,{children:`not`}),` included; re-authenticate providers after restoring on a new install.`]}),(0,L.jsx)(`button`,{onClick:()=>void m(),disabled:t,className:`rounded border border-neutral-700 bg-neutral-900 px-3 py-1.5 text-xs text-neutral-100 hover:border-neutral-500 disabled:opacity-50`,children:t?`Exporting…`:`Download config archive`}),r!==void 0&&(0,L.jsxs)(`p`,{className:`mt-2 text-xs text-emerald-400`,children:[`Exported `,(0,L.jsx)(`code`,{className:`font-mono`,children:r.filename}),` (`,r.files.length===0?`no files were on disk`:`included: ${r.files.join(`, `)}`,`)`]})]}),(0,L.jsxs)(`section`,{children:[(0,L.jsx)(`h3`,{className:`mb-2 text-sm font-medium text-neutral-100`,children:`Import config`}),(0,L.jsxs)(`p`,{className:`mb-3 text-xs text-neutral-400`,children:[`Restores a previously-exported archive. Each file is parsed before any disk write — if any file fails validation, `,(0,L.jsx)(`strong`,{children:`nothing`}),` is imported. Existing live agent sessions keep their original settings until restarted.`]}),(0,L.jsx)(`input`,{ref:s,type:`file`,accept:`.gz,.tgz,application/gzip,application/x-gzip`,disabled:t,onChange:e=>{let t=e.target.files?.[0];t!==void 0&&h(t)},className:`block text-xs text-neutral-300 file:mr-3 file:rounded file:border file:border-neutral-700 file:bg-neutral-900 file:px-3 file:py-1.5 file:text-xs file:text-neutral-100 hover:file:border-neutral-500 disabled:opacity-50`}),a!==void 0&&(0,L.jsxs)(`div`,{className:`mt-3 space-y-1 text-xs`,children:[a.imported.length>0&&(0,L.jsxs)(`p`,{className:`text-emerald-400`,children:[`Imported: `,(0,L.jsx)(`code`,{className:`font-mono`,children:a.imported.join(`, `)})]}),a.skipped.length>0&&(0,L.jsxs)(`p`,{className:`text-amber-400`,children:[`Skipped (not in allow-list):`,` `,(0,L.jsx)(`code`,{className:`font-mono`,children:a.skipped.join(`, `)})]}),a.errors.length>0&&(0,L.jsxs)(`div`,{className:`text-red-400`,children:[(0,L.jsx)(`p`,{children:`Errors — nothing was written:`}),(0,L.jsx)(`ul`,{className:`ml-4 list-disc`,children:a.errors.map(e=>(0,L.jsxs)(`li`,{children:[(0,L.jsx)(`code`,{className:`font-mono`,children:e.file}),`: `,e.reason]},e.file))})]}),a.imported.length===0&&a.errors.length===0&&a.skipped.length===0&&(0,L.jsx)(`p`,{className:`italic text-neutral-500`,children:`Archive was empty.`})]})]}),(0,L.jsxs)(`section`,{children:[(0,L.jsx)(`h3`,{className:`mb-2 text-sm font-medium text-neutral-100`,children:`Export skills`}),(0,L.jsxs)(`p`,{className:`mb-3 text-xs text-neutral-400`,children:[`Downloads a `,(0,L.jsx)(`code`,{className:`font-mono`,children:`.tar.gz`}),` of every file under`,` `,(0,L.jsx)(`code`,{className:`font-mono`,children:`~/.pi/agent/skills/`}),` — both single-file (`,(0,L.jsx)(`code`,{className:`font-mono`,children:`<name>.md`}),`) and directory skills (`,(0,L.jsx)(`code`,{className:`font-mono`,children:`<name>/SKILL.md`}),` + assets) round-trip verbatim.`]}),(0,L.jsx)(`button`,{onClick:()=>void _(),disabled:t,className:`rounded border border-neutral-700 bg-neutral-900 px-3 py-1.5 text-xs text-neutral-100 hover:border-neutral-500 disabled:opacity-50`,children:t?`Working…`:`Download skills archive`}),c!==void 0&&(c.fileCount===0?(0,L.jsx)(`p`,{className:`mt-2 text-xs text-neutral-400`,children:`No skills to export — your skills directory is empty.`}):(0,L.jsxs)(`p`,{className:`mt-2 text-xs text-emerald-400`,children:[`Exported `,(0,L.jsx)(`code`,{className:`font-mono`,children:c.filename}),` (`,c.fileCount,` file`,c.fileCount===1?``:`s`,` packed)`]}))]}),(0,L.jsxs)(`section`,{children:[(0,L.jsx)(`h3`,{className:`mb-2 text-sm font-medium text-neutral-100`,children:`Import skills`}),(0,L.jsxs)(`p`,{className:`mb-3 text-xs text-neutral-400`,children:[`Restore skills from a previously-exported `,(0,L.jsx)(`code`,{className:`font-mono`,children:`.tar.gz`}),`, OR upload a folder of skill files directly. Existing files at the same path are`,` `,(0,L.jsx)(`strong`,{children:`overwritten`}),`; new files are added. Path traversal and absolute paths are rejected.`]}),(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsxs)(`label`,{className:`block space-y-1`,children:[(0,L.jsx)(`span`,{className:`text-[11px] uppercase tracking-wider text-neutral-500`,children:`From tar.gz`}),(0,L.jsx)(`input`,{ref:f,type:`file`,accept:`.gz,.tgz,application/gzip,application/x-gzip`,disabled:t,onChange:e=>{let t=e.target.files?.[0];t!==void 0&&y([t])},className:`block text-xs text-neutral-300 file:mr-3 file:rounded file:border file:border-neutral-700 file:bg-neutral-900 file:px-3 file:py-1.5 file:text-xs file:text-neutral-100 hover:file:border-neutral-500 disabled:opacity-50`})]}),(0,L.jsxs)(`label`,{className:`block space-y-1`,children:[(0,L.jsx)(`span`,{className:`text-[11px] uppercase tracking-wider text-neutral-500`,children:`From folder (Chromium / WebKit only)`}),(0,L.jsx)(`input`,{ref:p,type:`file`,multiple:!0,webkitdirectory:``,disabled:t,onChange:e=>{let t=e.target.files;t===null||t.length===0||y(Array.from(t))},className:`block text-xs text-neutral-300 file:mr-3 file:rounded file:border file:border-neutral-700 file:bg-neutral-900 file:px-3 file:py-1.5 file:text-xs file:text-neutral-100 hover:file:border-neutral-500 disabled:opacity-50`})]})]}),u!==void 0&&(0,L.jsxs)(`div`,{className:`mt-3 space-y-1 text-xs`,children:[u.imported.length>0&&(0,L.jsxs)(`p`,{className:`text-emerald-400`,children:[`Imported `,u.imported.length,` file`,u.imported.length===1?``:`s`,`:`,` `,(0,L.jsx)(`code`,{className:`font-mono`,children:u.imported.join(`, `)})]}),u.skipped.length>0&&(0,L.jsxs)(`div`,{className:`text-amber-400`,children:[(0,L.jsxs)(`p`,{children:[`Skipped `,u.skipped.length,` entr`,u.skipped.length===1?`y`:`ies`,`:`]}),(0,L.jsx)(`ul`,{className:`ml-4 list-disc`,children:u.skipped.map(e=>(0,L.jsxs)(`li`,{children:[(0,L.jsx)(`code`,{className:`font-mono`,children:e.name}),` (`,e.reason,`)`]},e.name))})]}),u.imported.length===0&&u.skipped.length===0&&(0,L.jsx)(`p`,{className:`italic text-neutral-500`,children:`No files were imported.`})]})]})]})}var Pk=`***REDACTED***`;function Fk(){return{name:``,url:``,transport:`auto`,enabled:!0,headers:[]}}function Ik({onError:e}){let t=kn(),n=On(e=>e.projects),r=rk(e=>e.settings),i=rk(e=>e.globalServers),a=rk(e=>e.byProject[t?.id??`__no_project__`]?.status??tk),o=rk(e=>e.refreshProject),s=rk(e=>e.setMcpEnabled),c=rk(e=>e.upsertServer),l=rk(e=>e.deleteServer),u=rk(e=>e.probeServer),[d,f]=(0,v.useState)(void 0),[p,m]=(0,v.useState)(void 0),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)(void 0),[b,x]=(0,v.useState)(new Map),[S,C]=(0,v.useState)({}),[w,T]=(0,v.useState)(new Set),E=async()=>{try{let[e,n]=await Promise.all([I.listTools(t?.id),I.listToolOverrides()]),r=new Map;for(let t of e.mcp)r.set(`${t.scope}:${t.server}`,t.tools);x(r),C(n.projects)}catch(t){e(`Failed to load tool listing: ${hk(t)}`)}};(0,v.useEffect)(()=>{o(t?.id).catch(t=>{e(`Failed to load MCP config: ${hk(t)}`)}),E()},[t?.id]);let D=async n=>{g(!0);try{await s(n),e(void 0),await o(t?.id)}catch(t){e(`Failed to toggle MCP: ${hk(t)}`)}finally{g(!1)}},O=async(t,n)=>{let r=i[t];if(r!==void 0){g(!0);try{await c(t,{...r,enabled:n}),e(void 0)}catch(t){e(`Failed to update server: ${hk(t)}`)}finally{g(!1)}}},ee=e=>{let t=i[e];t!==void 0&&(m(e),f({name:e,url:t.url,transport:t.transport??`auto`,enabled:t.enabled!==!1,headers:Object.entries(t.headers??{}).map(([e,t])=>({key:e,value:t}))}))},te=()=>{m(void 0),f(Fk())},ne=async()=>{if(d===void 0)return;if(d.name.trim().length===0||d.url.trim().length===0){e(`Name and URL are required.`);return}let t={};for(let e of d.headers)e.key.trim().length!==0&&(t[e.key]=e.value);let n={url:d.url,transport:d.transport,enabled:d.enabled};Object.keys(t).length>0&&(n.headers=t),g(!0);try{await c(d.name,n),e(void 0),f(void 0),m(void 0)}catch(t){e(`Failed to save server: ${hk(t)}`)}finally{g(!1)}},re=async t=>{if(window.confirm(`Remove MCP server '${t}' from the global registry?`)){g(!0);try{await l(t),e(void 0)}catch(t){e(`Failed to remove server: ${hk(t)}`)}finally{g(!1)}}},k=async(n,r)=>{y(n);try{await u(n,r===`project`?t?.id:void 0),e(void 0),E()}catch(t){e(`Probe failed for '${n}': ${hk(t)}`)}finally{y(void 0)}},ie=async(t,n)=>{g(!0);try{await I.setToolEnabled(`mcp`,t,n,`global`),await E()}catch(t){e(`Toggle failed: ${hk(t)}`)}finally{g(!1)}},ae=async(t,n,r)=>{g(!0);try{r===void 0?await I.clearToolProjectOverride(`mcp`,n,t):await I.setToolEnabled(`mcp`,n,r===`enabled`,`project`,t),await E()}catch(t){e(`Override write failed: ${hk(t)}`)}finally{g(!1)}},A=e=>{T(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};if(r===void 0)return(0,L.jsx)(`p`,{className:`text-xs italic text-neutral-500`,children:`Loading MCP config…`});let oe=r.enabled,j=a.filter(e=>e.scope===`global`),se=a.filter(e=>e.scope===`project`);return(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsxs)(`p`,{className:`text-xs text-neutral-500`,children:[`MCP servers extend the agent with custom tools. Servers configured here are loaded by every new session. Project-scoped servers in `,(0,L.jsx)(`code`,{className:`font-mono`,children:`.mcp.json`}),` at the project root are also loaded for sessions in that project (project entries override globals on name collision).`]}),(0,L.jsxs)(`div`,{className:`flex items-center justify-between rounded border border-neutral-800 bg-neutral-900/40 p-3`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`text-sm font-medium text-neutral-100`,children:`MCP tools`}),(0,L.jsx)(`div`,{className:`text-[11px] text-neutral-500`,children:`Master switch. When off, no MCP tools reach the agent regardless of per-server state.`})]}),(0,L.jsx)(`button`,{onClick:()=>void D(!oe),disabled:h,className:`rounded border px-3 py-1 text-xs ${oe?`border-emerald-700/50 bg-emerald-900/20 text-emerald-300`:`border-neutral-700 text-neutral-300 hover:border-neutral-500`}`,children:oe?`Enabled`:`Disabled`})]}),(0,L.jsx)(Lk,{title:`Global servers`,emptyHint:`No global MCP servers configured. Click 'Add server' to add one.`,servers:j.map(e=>({status:e,config:i[e.name]})),editable:!0,editingName:p??null,probingName:_??null,toolsByServer:b,expandedServers:w,allOverrides:S,projects:n,busy:h,onToggleExpanded:A,onToggleToolGlobal:(e,t)=>void ie(e,t),onSetProjectToolOverride:(e,t,n)=>void ae(e,t,n),onToggle:(e,t)=>void O(e,t),onProbe:e=>void k(e,`global`),onEdit:ee,onRemove:e=>void re(e)}),t!==void 0&&(0,L.jsx)(Lk,{title:`Project servers (${t.name})`,emptyHint:(0,L.jsxs)(L.Fragment,{children:[`No project servers. Add a `,(0,L.jsx)(`code`,{className:`font-mono`,children:`.mcp.json`}),` file at the project root to define some — supports both`,` `,(0,L.jsx)(`code`,{className:`font-mono`,children:`{ servers: {...} }`}),` and the standard`,` `,(0,L.jsx)(`code`,{className:`font-mono`,children:`{ mcpServers: {...} }`}),` shape.`]}),servers:se.map(e=>({status:e,config:void 0})),editable:!1,probingName:_??null,toolsByServer:b,expandedServers:w,allOverrides:S,projects:n,busy:h,onToggleExpanded:A,onToggleToolGlobal:(e,t)=>void ie(e,t),onSetProjectToolOverride:(e,t,n)=>void ae(e,t,n),onProbe:e=>void k(e,`project`)}),d===void 0?(0,L.jsx)(`button`,{onClick:te,className:`rounded-md border border-neutral-700 px-3 py-1 text-xs text-neutral-200 hover:border-neutral-500`,children:`+ Add server`}):(0,L.jsx)(zk,{draft:d,isEditing:p!==void 0,busy:h,onChange:f,onSave:()=>void ne(),onCancel:()=>{f(void 0),m(void 0)}})]})}function Lk(e){return(0,L.jsxs)(`section`,{className:`space-y-2`,children:[(0,L.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wider text-neutral-400`,children:e.title}),e.servers.length===0?(0,L.jsx)(`p`,{className:`text-[11px] italic text-neutral-500`,children:e.emptyHint}):(0,L.jsx)(`div`,{className:`space-y-2`,children:e.servers.map(t=>{let n=t.status,r=e.editingName===n.name,i=e.probingName===n.name,a=`${n.scope}:${n.name}`,o=e.toolsByServer.get(a)??[],s=e.expandedServers.has(a),c=o.length>0;return(0,L.jsxs)(`div`,{className:`rounded border ${r?`border-neutral-500 bg-neutral-900`:`border-neutral-800 bg-neutral-900/40`}`,children:[(0,L.jsxs)(`div`,{className:`p-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:()=>c&&e.onToggleExpanded(a),disabled:!c,className:`flex h-5 w-5 items-center justify-center rounded text-neutral-300 hover:bg-neutral-800 hover:text-neutral-100 disabled:opacity-30`,title:c?s?`Hide tools`:`Show tools`:`No tools to show (server not connected or empty)`,children:s?(0,L.jsx)(le,{size:16}):(0,L.jsx)(ue,{size:16})}),(0,L.jsx)(Rk,{state:n.state}),(0,L.jsx)(`span`,{className:`font-mono text-sm text-neutral-100`,children:n.name}),(0,L.jsx)(`span`,{className:`rounded bg-neutral-800 px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-neutral-400`,children:n.transport??`auto`}),(0,L.jsxs)(`span`,{className:`text-[11px] text-neutral-500`,children:[n.toolCount,` tools`]})]}),(0,L.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1 text-xs`,children:[e.editable&&e.onToggle!==void 0&&(0,L.jsx)(`button`,{onClick:()=>e.onToggle?.(n.name,!n.enabled),className:`rounded border px-2 py-0.5 ${n.enabled?`border-emerald-700/50 bg-emerald-900/20 text-emerald-300`:`border-neutral-700 text-neutral-400 hover:border-neutral-500`}`,children:n.enabled?`Enabled`:`Disabled`}),(0,L.jsx)(`button`,{onClick:()=>e.onProbe(n.name),disabled:i,className:`rounded border border-neutral-700 px-2 py-0.5 text-neutral-300 hover:border-neutral-500 disabled:opacity-50`,title:`Reconnect and refresh tool list`,children:i?`Probing…`:`Probe`}),e.editable&&e.onEdit!==void 0&&(0,L.jsx)(`button`,{onClick:()=>e.onEdit?.(n.name),className:`rounded border border-neutral-700 px-2 py-0.5 text-neutral-300 hover:border-neutral-500`,children:`Edit`}),e.editable&&e.onRemove!==void 0&&(0,L.jsx)(`button`,{onClick:()=>e.onRemove?.(n.name),className:`rounded border border-red-700/50 px-2 py-0.5 text-red-300 hover:bg-red-900/20`,children:`Remove`})]})]}),(0,L.jsx)(`div`,{className:`mt-1 truncate text-[11px] text-neutral-500`,title:n.url,children:n.url}),n.lastError!==void 0&&(0,L.jsx)(`div`,{className:`mt-1 truncate text-[11px] text-red-300`,title:n.lastError,children:n.lastError})]}),s&&c&&(0,L.jsxs)(`div`,{className:`space-y-2 border-t border-neutral-800 bg-neutral-950/40 px-3 py-2`,children:[(0,L.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider text-neutral-500`,children:`Tools`}),(0,L.jsx)(`div`,{className:`space-y-2`,children:o.map(t=>(0,L.jsx)(Ak,{family:`mcp`,name:t.shortName,fqn:t.name,description:t.description,globalEnabled:t.globalEnabled,projects:e.projects,allOverrides:e.allOverrides,busy:e.busy,onToggleGlobal:n=>e.onToggleToolGlobal(t.name,n),onSetProjectOverride:(n,r)=>e.onSetProjectToolOverride(n,t.name,r)},`mcp:${t.name}`))})]})]},a)})})]})}function Rk({state:e}){return(0,L.jsx)(`span`,{className:`h-2 w-2 rounded-full ${e===`connected`?`bg-emerald-500`:e===`connecting`?`bg-amber-400 animate-pulse`:e===`error`?`bg-red-500`:e===`disabled`?`bg-neutral-700`:`bg-neutral-500`}`,title:e})}function zk(e){let{draft:t,busy:n}=e,r=(n,r)=>{e.onChange({...t,[n]:r})};return(0,L.jsxs)(`div`,{className:`rounded border border-neutral-700 bg-neutral-900 p-3`,children:[(0,L.jsx)(`h4`,{className:`mb-2 text-xs font-semibold uppercase tracking-wider text-neutral-400`,children:e.isEditing?`Edit '${t.name}'`:`Add MCP server`}),(0,L.jsxs)(`div`,{className:`grid grid-cols-[80px_1fr] items-center gap-2 text-xs`,children:[(0,L.jsx)(`label`,{className:`text-neutral-500`,children:`Name`}),(0,L.jsx)(`input`,{value:t.name,onChange:e=>r(`name`,e.target.value),disabled:e.isEditing,placeholder:`my-server`,className:`rounded border border-neutral-700 bg-neutral-950 px-2 py-1 text-neutral-100 outline-none focus:border-neutral-500 disabled:opacity-50`}),(0,L.jsx)(`label`,{className:`text-neutral-500`,children:`URL`}),(0,L.jsx)(`input`,{value:t.url,onChange:e=>r(`url`,e.target.value),placeholder:`https://mcp.example.com/sse`,className:`rounded border border-neutral-700 bg-neutral-950 px-2 py-1 text-neutral-100 outline-none focus:border-neutral-500`}),(0,L.jsx)(`label`,{className:`text-neutral-500`,children:`Transport`}),(0,L.jsxs)(`select`,{value:t.transport,onChange:e=>r(`transport`,e.target.value),className:`rounded border border-neutral-700 bg-neutral-950 px-2 py-1 text-neutral-100 outline-none focus:border-neutral-500`,children:[(0,L.jsx)(`option`,{value:`auto`,children:`auto (StreamableHTTP, fall back to SSE)`}),(0,L.jsx)(`option`,{value:`streamable-http`,children:`streamable-http`}),(0,L.jsx)(`option`,{value:`sse`,children:`sse`})]}),(0,L.jsx)(`label`,{className:`text-neutral-500`,children:`Enabled`}),(0,L.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`input`,{type:`checkbox`,checked:t.enabled,onChange:e=>r(`enabled`,e.target.checked)}),(0,L.jsx)(`span`,{className:`text-[11px] text-neutral-500`,children:`Disabled servers don't connect or contribute tools.`})]})]}),(0,L.jsxs)(`div`,{className:`mt-3`,children:[(0,L.jsxs)(`div`,{className:`mb-1 flex items-center justify-between`,children:[(0,L.jsx)(`h5`,{className:`text-[11px] font-semibold uppercase tracking-wider text-neutral-500`,children:`Headers`}),(0,L.jsx)(`button`,{onClick:()=>r(`headers`,[...t.headers,{key:``,value:``}]),className:`rounded border border-neutral-700 px-2 py-0.5 text-[11px] text-neutral-300 hover:border-neutral-500`,children:`+ Header`})]}),t.headers.length===0&&(0,L.jsx)(`p`,{className:`text-[11px] italic text-neutral-600`,children:"No headers. Add `Authorization: Bearer …` here for auth."}),t.headers.map((e,n)=>(0,L.jsxs)(`div`,{className:`mb-1 grid grid-cols-[1fr_2fr_auto] gap-1`,children:[(0,L.jsx)(`input`,{value:e.key,onChange:i=>{let a=[...t.headers];a[n]={...e,key:i.target.value},r(`headers`,a)},placeholder:`Authorization`,className:`rounded border border-neutral-700 bg-neutral-950 px-2 py-1 text-[11px] font-mono text-neutral-100 outline-none focus:border-neutral-500`}),(0,L.jsx)(`input`,{value:e.value===Pk?``:e.value,onChange:i=>{let a=[...t.headers];a[n]={...e,value:i.target.value},r(`headers`,a)},placeholder:e.value===Pk?`leave blank to keep stored value`:`Bearer …`,type:`password`,className:`rounded border border-neutral-700 bg-neutral-950 px-2 py-1 text-[11px] font-mono text-neutral-100 outline-none focus:border-neutral-500`}),(0,L.jsx)(`button`,{onClick:()=>{r(`headers`,t.headers.filter((e,t)=>t!==n))},className:`rounded border border-neutral-700 px-2 text-[11px] text-neutral-400 hover:text-red-300`,title:`Remove header`,children:`×`})]},n)),t.headers.some(e=>e.value===Pk)&&(0,L.jsx)(`p`,{className:`mt-1 text-[10px] italic text-neutral-500`,children:`Headers with the redaction sentinel keep their stored value when you save.`})]}),(0,L.jsxs)(`div`,{className:`mt-3 flex justify-end gap-2`,children:[(0,L.jsx)(`button`,{onClick:e.onCancel,className:`rounded border border-neutral-700 px-3 py-1 text-xs text-neutral-300 hover:border-neutral-500`,children:`Cancel`}),(0,L.jsx)(`button`,{onClick:e.onSave,disabled:n,className:`rounded bg-neutral-100 px-3 py-1 text-xs font-medium text-neutral-900 disabled:opacity-50`,children:n?`Saving…`:`Save`})]})]})}var Bk=8;function Vk(){let e=pr(e=>e.version),t=pr(e=>e.loaded),n=pr(e=>e.passwordAuthEnabled);return(0,L.jsxs)(`div`,{className:`space-y-6 text-sm text-neutral-300`,children:[(0,L.jsxs)(`header`,{className:`space-y-1`,children:[(0,L.jsx)(`h2`,{className:`text-base font-semibold text-neutral-100`,children:`pi-forge`}),(0,L.jsxs)(`p`,{className:`text-xs text-neutral-500`,children:[`Browser interface for the`,` `,(0,L.jsx)(`a`,{href:`https://github.com/badlogic/pi-mono`,target:`_blank`,rel:`noopener noreferrer`,className:`text-blue-400 underline hover:text-blue-300`,children:`pi coding agent`}),`.`]})]}),(0,L.jsxs)(`section`,{className:`space-y-2`,children:[(0,L.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wider text-neutral-500`,children:`Version`}),(0,L.jsx)(`p`,{className:`font-mono text-sm`,children:t?e.length>0?e:(0,L.jsx)(`span`,{className:`text-neutral-500`,children:`unknown`}):(0,L.jsx)(`span`,{className:`text-neutral-500`,children:`loading…`})})]}),(0,L.jsxs)(`section`,{className:`space-y-2`,children:[(0,L.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wider text-neutral-500`,children:`Links`}),(0,L.jsxs)(`ul`,{className:`space-y-1 text-xs`,children:[(0,L.jsx)(`li`,{children:(0,L.jsx)(`a`,{href:`https://github.com/Devin-Marks/pi-forge`,target:`_blank`,rel:`noopener noreferrer`,className:`text-blue-400 underline hover:text-blue-300`,children:`github.com/Devin-Marks/pi-forge`})}),(0,L.jsx)(`li`,{children:(0,L.jsx)(`a`,{href:`https://github.com/Devin-Marks/pi-forge/blob/main/CHANGELOG.md`,target:`_blank`,rel:`noopener noreferrer`,className:`text-blue-400 underline hover:text-blue-300`,children:`Changelog`})}),(0,L.jsx)(`li`,{children:(0,L.jsx)(`a`,{href:`https://github.com/Devin-Marks/pi-forge/blob/main/SECURITY.md`,target:`_blank`,rel:`noopener noreferrer`,className:`text-blue-400 underline hover:text-blue-300`,children:`Security`})})]})]}),n&&(0,L.jsx)(Hk,{})]})}function Hk(){let e=Cn(e=>e.changePassword),t=Cn(e=>e.changePasswordPending),n=Cn(e=>e.changePasswordError),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(void 0),[d,f]=(0,v.useState)(!1),p=(0,v.useRef)(!1);(0,v.useEffect)(()=>{if(p.current&&!t&&n===void 0){i(``),o(``),c(``),f(!0);let e=window.setTimeout(()=>f(!1),2500);return()=>window.clearTimeout(e)}p.current=t},[t,n]);let m=t=>{if(t.preventDefault(),u(void 0),f(!1),a.length<Bk){u(`New password must be at least ${Bk} characters.`);return}if(a!==s){u(`New password and confirmation do not match.`);return}if(a===r){u(`New password must differ from the current one.`);return}e(r,a)},h=l??Uk(n);return(0,L.jsxs)(`section`,{className:`space-y-2 border-t border-neutral-800 pt-5`,children:[(0,L.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wider text-neutral-500`,children:`Change password`}),(0,L.jsx)(`p`,{className:`text-xs text-neutral-500`,children:`Updates the scrypt hash on disk; existing browser sessions stay signed in.`}),(0,L.jsxs)(`form`,{onSubmit:m,className:`space-y-2`,children:[(0,L.jsxs)(`label`,{className:`block space-y-1`,children:[(0,L.jsx)(`span`,{className:`text-xs text-neutral-400`,children:`Current password`}),(0,L.jsx)(`input`,{type:`password`,value:r,onChange:e=>i(e.target.value),autoComplete:`current-password`,className:`w-full rounded-md border border-neutral-700 bg-neutral-950 px-3 py-1.5 text-sm outline-none focus:border-neutral-500`})]}),(0,L.jsxs)(`label`,{className:`block space-y-1`,children:[(0,L.jsx)(`span`,{className:`text-xs text-neutral-400`,children:`New password`}),(0,L.jsx)(`input`,{type:`password`,value:a,onChange:e=>o(e.target.value),autoComplete:`new-password`,minLength:Bk,className:`w-full rounded-md border border-neutral-700 bg-neutral-950 px-3 py-1.5 text-sm outline-none focus:border-neutral-500`})]}),(0,L.jsxs)(`label`,{className:`block space-y-1`,children:[(0,L.jsx)(`span`,{className:`text-xs text-neutral-400`,children:`Confirm new password`}),(0,L.jsx)(`input`,{type:`password`,value:s,onChange:e=>c(e.target.value),autoComplete:`new-password`,minLength:Bk,className:`w-full rounded-md border border-neutral-700 bg-neutral-950 px-3 py-1.5 text-sm outline-none focus:border-neutral-500`})]}),h!==void 0&&(0,L.jsx)(`p`,{role:`alert`,className:`text-xs text-red-400`,children:h}),d&&(0,L.jsx)(`p`,{role:`status`,className:`text-xs text-emerald-400`,children:`Password updated.`}),(0,L.jsx)(`button`,{type:`submit`,disabled:t||r.length===0||a.length===0,className:`rounded-md bg-neutral-100 px-3 py-1.5 text-xs font-medium text-neutral-900 transition hover:bg-white disabled:cursor-not-allowed disabled:opacity-50`,children:t?`Saving…`:`Update password`})]})]})}function Uk(e){if(e!==void 0)switch(e){case`invalid_password`:return`Current password is incorrect.`;case`password_unchanged`:return`New password must differ from the current one.`;case`ui_password_not_configured`:return`Password auth is not configured on this server.`;case`auth_required`:return`Session expired — sign in again.`;default:return`Could not change password: ${e}`}}function Wk(){let e=kn(),t=ur(t=>e===void 0?void 0:t.treeByProject[e.id]),n=ur(t=>e===void 0?!1:t.treeLoading[e.id]??!1),r=ur(e=>e.error),i=ur(e=>e.loadTree),a=ur(e=>e.openFile),o=ur(e=>e.createFile),s=ur(e=>e.createFolder),c=ur(e=>e.renameEntry),l=ur(e=>e.moveEntry),u=ur(e=>e.deleteEntry),[d,f]=(0,v.useState)({"":!0}),[p,m]=(0,v.useState)(void 0),[h,g]=(0,v.useState)(``),[_,y]=(0,v.useState)(void 0),[b,x]=(0,v.useState)(void 0),[S,C]=(0,v.useState)(void 0),w=(0,v.useRef)(null),T=(0,v.useRef)(void 0),E=ur(e=>e.uploadFiles),[D,O]=(0,v.useState)(void 0),ee=IO(e=>e.requestChatInsert),[te,ne]=(0,v.useState)(new Set);if((0,v.useEffect)(()=>{e!==void 0&&i(e.id)},[e?.id,i]),e===void 0)return(0,L.jsx)(`div`,{className:`p-4 text-xs italic text-neutral-500`,children:`Select a project to browse its files.`});let re=async(t,n,r)=>{x(void 0);try{if(t===`file`){let t=await o(e.id,n,r);await a(e.id,t)}else await s(e.id,n,r)}catch{}},k=(e,t,n)=>{f(e=>({...e,[t]:!0})),x({kind:`create`,entryKind:n,parentAbsPath:e})},ie=(e,t)=>{m(e),g(t)},ae=async t=>{let n=h.trim();if(m(void 0),g(``),n.length!==0)try{await c(e.id,t,n)}catch{}},A=()=>ne(new Set),oe=e=>{ne(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},j=(e,t,n)=>{x({kind:`delete`,absPath:e,name:t,isDir:n,recursive:!1})},se=async()=>{if(b?.kind!==`delete`)return;let{absPath:t,name:n,isDir:r,recursive:i}=b;x(void 0);try{await u(e.id,t,i?{recursive:!0}:void 0)}catch(e){if(e instanceof M&&e.code===`directory_not_empty`){x({kind:`delete`,absPath:t,name:n,isDir:r,recursive:!0});return}}},ce=async()=>{if(b?.kind!==`deleteMany`)return;let{paths:t}=b;x(void 0);for(let n of t)try{await u(e.id,n,{recursive:!0})}catch{}A()},le=async t=>{if(t.type===`directory`){f(e=>({...e,[t.path]:!e[t.path]}));return}await a(e.id,Jk(e.path,t.path))},ue=(e,t)=>{e.preventDefault(),e.stopPropagation(),O({x:e.clientX,y:e.clientY,kind:t.isDir?`folder`:`file`,absPath:t.absPath,name:t.name,relPath:t.relPath})},de=t=>{t.preventDefault(),O({x:t.clientX,y:t.clientY,kind:`empty`,absPath:e.path,name:``,relPath:``})},fe=t=>{let n=t;t.startsWith(`${e.path}/`)&&(n=t.slice(e.path.length+1)),ee(/\s/.test(n)?`@"${n}"`:`@${n}`),O(void 0)},pe=async(t,n)=>{if(t.preventDefault(),t.stopPropagation(),y(void 0),t.dataTransfer.files.length>0){await he(n,Array.from(t.dataTransfer.files));return}let r=t.dataTransfer.getData(`application/x-pi-path`);if(r.length===0)return;let i=r.split(`/`).pop()??``;if(i.length===0)return;let a=`${n}/${i}`;if(a!==r&&!(n===r||n.startsWith(`${r}/`)))try{await l(e.id,r,a)}catch{}},he=async(t,n)=>{if(n.length===0)return;let r=n.reduce((e,t)=>e+t.size,0);C(`Hashing ${n.length} file${n.length===1?``:`s`} (${$k(r)})…`);try{let r=await E(e.id,t,n,{onHashProgress:(e,t)=>{C(e<t?`Hashing ${$k(e)} / ${$k(t)} (${Math.floor(e/t*100)}%)…`:`Uploading ${n.length} file${n.length===1?``:`s`} (${$k(t)})…`)}});C(`Uploaded ${r.length} file${r.length===1?``:`s`}.`),window.setTimeout(()=>C(void 0),2500)}catch{C(void 0)}},ge=e=>{T.current=e,w.current?.click()},_e=async t=>{C(`Preparing download…`);try{let{blob:n,filename:r}=await I.filesDownload(e.id,t),i=URL.createObjectURL(n),a=document.createElement(`a`);a.href=i,a.download=r,document.body.appendChild(a),a.click(),a.remove(),window.setTimeout(()=>URL.revokeObjectURL(i),1e3),C(void 0)}catch(e){C(void 0),ur.setState({error:e instanceof Error?e.message:`download_failed`})}},ye=async t=>{let n=t.target.files,r=n===null?[]:Array.from(n),i=T.current??e.path;t.target.value=``,T.current=void 0,r.length!==0&&await he(i,r)};return(0,L.jsxs)(`div`,{className:`flex h-full flex-col text-xs text-neutral-300`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between border-b border-neutral-800 px-3 py-2`,children:[(0,L.jsx)(`span`,{className:`truncate font-medium text-neutral-200`,title:e.path,children:e.name}),(0,L.jsxs)(`div`,{className:`flex gap-1`,children:[(0,L.jsx)(`button`,{onClick:()=>x({kind:`create`,entryKind:`file`,parentAbsPath:e.path}),className:`rounded p-1 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200`,title:`New file`,children:(0,L.jsx)(ve,{size:14})}),(0,L.jsx)(`button`,{onClick:()=>x({kind:`create`,entryKind:`folder`,parentAbsPath:e.path}),className:`rounded p-1 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200`,title:`New folder`,children:(0,L.jsx)(be,{size:14})}),(0,L.jsx)(`button`,{onClick:()=>ge(e.path),className:`rounded p-1 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200`,title:`Upload files into project root (drag-and-drop also works on any folder)`,children:(0,L.jsx)(We,{size:14})}),(0,L.jsx)(`button`,{onClick:()=>void _e(void 0),className:`rounded p-1 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200`,title:`Download project as .tar.gz (skips node_modules, .git, dist, etc.)`,children:(0,L.jsx)(me,{size:14})}),(0,L.jsx)(`button`,{onClick:()=>void i(e.id),className:`rounded p-1 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200`,title:`Refresh`,children:(0,L.jsx)(Ne,{size:14,className:n?`animate-spin`:``})})]})]}),(0,L.jsx)(`input`,{ref:w,type:`file`,multiple:!0,className:`hidden`,onChange:e=>void ye(e)}),S!==void 0&&(0,L.jsxs)(`div`,{className:`flex items-center gap-1.5 border-b border-emerald-700/40 bg-emerald-900/20 px-3 py-1.5 text-[11px] text-emerald-200`,children:[!S.startsWith(`Uploaded`)&&(0,L.jsx)(Ee,{size:11,className:`animate-spin`}),(0,L.jsx)(`span`,{children:S})]}),r!==void 0&&(0,L.jsx)(`div`,{className:`border-b border-red-700/40 bg-red-900/20 px-3 py-1.5 text-[11px] text-red-300`,children:r}),te.size>0&&(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-neutral-800 bg-neutral-900/60 px-3 py-1.5 text-[11px] text-neutral-300`,children:[(0,L.jsxs)(`span`,{children:[te.size,` selected`,(0,L.jsx)(`span`,{className:`ml-2 text-neutral-500`,children:`(Cmd/Ctrl+click rows to add or remove)`})]}),(0,L.jsxs)(`div`,{className:`flex gap-1`,children:[(0,L.jsx)(`button`,{onClick:()=>x({kind:`deleteMany`,paths:Array.from(te)}),className:`rounded border border-red-700/50 px-2 py-0.5 text-red-300 hover:bg-red-900/20`,children:`Delete selected`}),(0,L.jsx)(`button`,{onClick:A,className:`rounded border border-neutral-700 px-2 py-0.5 text-neutral-300 hover:border-neutral-500`,children:`Clear`})]})]}),(0,L.jsxs)(`div`,{className:`flex-1 overflow-y-auto py-1`,onContextMenu:de,onDragOver:e=>{(e.dataTransfer.types.includes(`application/x-pi-path`)||e.dataTransfer.types.includes(`Files`))&&(e.preventDefault(),e.dataTransfer.dropEffect=e.dataTransfer.types.includes(`Files`)?`copy`:`move`)},onDrop:t=>void pe(t,e.path),children:[t===void 0&&!n&&(0,L.jsx)(`p`,{className:`px-3 py-2 italic text-neutral-500`,children:`Tree not loaded.`}),t!==void 0&&(0,L.jsx)(qk,{node:t,depth:0,projectPath:e.path,expanded:d,onToggle:e=>f(t=>({...t,[e]:!t[e]})),onOpen:e=>void le(e),renaming:p,renameDraft:h,onRenameDraftChange:g,onRenameCommit:e=>void ae(e),onRenameStart:ie,onDelete:(e,t,n)=>j(e,t,n),onCreate:(e,t,n)=>k(e,t,n),onUpload:e=>ge(e),onDownload:e=>void _e(e),dropTarget:_,onDropTargetChange:y,onDrop:(e,t)=>void pe(e,t),onContextMenu:ue,selectedPaths:te,onToggleSelect:oe})]}),(0,L.jsx)(Sr,{open:b?.kind===`create`,onClose:()=>x(void 0),onSubmit:e=>{b?.kind===`create`&&re(b.entryKind,b.parentAbsPath,e)},title:Xk(b,e.path),label:Zk(b,e.path),placeholder:Qk(b),primaryLabel:`Create`}),(0,L.jsx)(Cr,{open:b?.kind===`delete`,onClose:()=>x(void 0),onConfirm:()=>void se(),title:b?.kind===`delete`?b.recursive?`"${b.name}" is not empty`:b.isDir?`Delete directory`:`Delete file`:``,message:b?.kind===`delete`?b.recursive?`"${b.name}" contains files. Delete the directory and ALL its contents? This cannot be undone.`:`Delete ${b.isDir?`directory`:`file`} "${b.name}"? This cannot be undone.`:``,primaryLabel:b?.kind===`delete`&&b.recursive?`Delete contents`:`Delete`,tone:`danger`}),(0,L.jsx)(Cr,{open:b?.kind===`deleteMany`,onClose:()=>x(void 0),onConfirm:()=>void ce(),title:b?.kind===`deleteMany`?`Delete ${b.paths.length} item${b.paths.length===1?``:`s`}`:``,message:b?.kind===`deleteMany`?`Delete the ${b.paths.length} selected file${b.paths.length===1?``:`s`} / folder${b.paths.length===1?``:`s`}? Folders are deleted recursively. This cannot be undone.`:``,primaryLabel:`Delete all`,tone:`danger`}),D!==void 0&&(0,L.jsx)(Gk,{x:D.x,y:D.y,kind:D.kind,onClose:()=>O(void 0),onAddAsContext:()=>fe(D.absPath),...D.kind!==`empty`&&{onRename:()=>ie(D.absPath,D.name),onDelete:()=>j(D.absPath,D.name,D.kind===`folder`),onDownload:()=>void _e(D.absPath)},...D.kind!==`file`&&{onAddFile:()=>k(D.absPath,D.relPath,`file`),onAddFolder:()=>k(D.absPath,D.relPath,`folder`)}})]})}function Gk(e){let t=(0,v.useRef)(e.onClose);t.current=e.onClose,(0,v.useEffect)(()=>{let e=e=>{e.key===`Escape`&&t.current()},n=()=>t.current();window.addEventListener(`keydown`,e);let r=setTimeout(()=>window.addEventListener(`mousedown`,n),0);return()=>{window.removeEventListener(`keydown`,e),window.removeEventListener(`mousedown`,n),clearTimeout(r)}},[]);let n=t=>{if(t!==void 0)return()=>{t(),e.onClose()}},r=e.kind===`empty`?void 0:n(e.onAddAsContext),i=n(e.onRename),a=n(e.onDelete),o=n(e.onDownload),s=n(e.onAddFile),c=n(e.onAddFolder);return(0,L.jsxs)(`div`,{className:`fixed z-50 min-w-[200px] overflow-hidden rounded-md border border-neutral-700 bg-neutral-900 shadow-lg`,style:{left:e.x,top:e.y},onMouseDown:e=>e.stopPropagation(),children:[r!==void 0&&(0,L.jsx)(Kk,{onClick:r,icon:(0,L.jsx)(se,{size:12}),label:`Add as @ context`,title:e.kind===`folder`?`Append @<path>/ to the chat input so the model can ls / grep this folder`:`Append @<path> to the chat input so the file's content is sent with the next prompt`}),s!==void 0&&(0,L.jsx)(Kk,{onClick:s,icon:(0,L.jsx)(ve,{size:12}),label:`Add file`,title:e.kind===`folder`?`Create a new file inside this folder`:`Create a new file at the project root`}),c!==void 0&&(0,L.jsx)(Kk,{onClick:c,icon:(0,L.jsx)(be,{size:12}),label:`Add folder`,title:e.kind===`folder`?`Create a new subfolder inside this folder`:`Create a new folder at the project root`}),i!==void 0&&(0,L.jsx)(Kk,{onClick:i,icon:(0,L.jsx)(je,{size:12}),label:`Rename`,title:`Rename this file or folder`}),o!==void 0&&(0,L.jsx)(Kk,{onClick:o,icon:(0,L.jsx)(me,{size:12}),label:`Download`,title:e.kind===`folder`?`Download folder as .tar.gz`:`Download this file`}),a!==void 0&&(0,L.jsx)(Kk,{onClick:a,icon:(0,L.jsx)(Ve,{size:12}),label:`Delete`,title:`Delete this file or folder`,tone:`danger`})]})}function Kk(e){let t=e.tone===`danger`;return(0,L.jsxs)(`button`,{type:`button`,onClick:e.onClick,title:e.title,className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs ${t?`text-red-300 hover:bg-red-900/30 hover:text-red-100`:`text-neutral-200 hover:bg-neutral-800`}`,children:[e.icon,e.label]})}function qk(e){let{node:t,depth:n,projectPath:r}=e;if(n===0&&t.type===`directory`)return(0,L.jsx)(`ul`,{children:t.children?.map(t=>(0,L.jsx)(qk,{...e,node:t,depth:1},t.path))});let i=Jk(r,t.path),a=t.type===`directory`,o=a&&(e.expanded[t.path]??!1),s=e.renaming===i,c=a&&e.dropTarget===i;return(0,L.jsxs)(`li`,{children:[(0,L.jsxs)(`div`,{className:`group flex items-center gap-1 border-l-2 py-0.5 pr-2 ${e.selectedPaths.has(i)?`border-blue-400 bg-blue-500/15 hover:bg-blue-500/25`:`border-transparent hover:bg-neutral-900`} ${c?`bg-emerald-900/30 ring-1 ring-emerald-700/50`:``}`,style:{paddingLeft:`${n*12+6}px`},onContextMenu:s?void 0:n=>e.onContextMenu(n,{absPath:i,isDir:a,name:t.name,relPath:t.path}),draggable:!s,onDragStart:e=>{e.dataTransfer.setData(`application/x-pi-path`,i),e.dataTransfer.effectAllowed=`move`},onDragOver:a?t=>{let n=t.dataTransfer.types.includes(`Files`),r=t.dataTransfer.types.includes(`application/x-pi-path`);!n&&!r||(t.preventDefault(),t.stopPropagation(),t.dataTransfer.dropEffect=n?`copy`:`move`,e.dropTarget!==i&&e.onDropTargetChange(i))}:void 0,onDragLeave:a?()=>{e.dropTarget===i&&e.onDropTargetChange(void 0)}:void 0,onDrop:a?t=>{t.stopPropagation(),e.onDrop(t,i)}:void 0,children:[(0,L.jsxs)(`button`,{onClick:n=>{if(n.metaKey||n.ctrlKey){e.onToggleSelect(i);return}e.onOpen(t)},className:`flex flex-1 items-center gap-1 truncate text-left`,title:i,children:[a?o?(0,L.jsx)(le,{size:12,className:`text-neutral-500`}):(0,L.jsx)(ue,{size:12,className:`text-neutral-500`}):(0,L.jsx)(`span`,{className:`inline-block w-3`}),s?(0,L.jsx)(`input`,{autoFocus:!0,value:e.renameDraft,onChange:t=>e.onRenameDraftChange(t.target.value),onKeyDown:t=>{(t.key===`Enter`||t.key===`Escape`)&&(t.preventDefault(),e.onRenameCommit(i))},onBlur:()=>e.onRenameCommit(i),onClick:e=>e.stopPropagation(),className:`flex-1 rounded border border-neutral-700 bg-neutral-950 px-1 text-[11px] text-neutral-100 outline-none focus:border-neutral-500`}):(0,L.jsx)(`span`,{className:`truncate ${a?`text-neutral-200`:`text-neutral-300`}`,children:t.name}),t.truncated===!0&&(0,L.jsx)(`span`,{className:`ml-1 text-[10px] text-neutral-600`,children:`…`})]}),!s&&(0,L.jsxs)(`div`,{className:`hidden items-center gap-0.5 group-hover:flex`,children:[a&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`button`,{onClick:n=>{n.stopPropagation(),e.onCreate(i,t.path,`file`)},className:`rounded p-0.5 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200`,title:`New file in this folder`,children:(0,L.jsx)(ve,{size:11})}),(0,L.jsx)(`button`,{onClick:n=>{n.stopPropagation(),e.onCreate(i,t.path,`folder`)},className:`rounded p-0.5 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200`,title:`New subfolder in this folder`,children:(0,L.jsx)(be,{size:11})}),(0,L.jsx)(`button`,{onClick:t=>{t.stopPropagation(),e.onUpload(i)},className:`rounded p-0.5 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200`,title:`Upload into this folder`,children:(0,L.jsx)(We,{size:11})})]}),(0,L.jsx)(`button`,{onClick:t=>{t.stopPropagation(),e.onDownload(i)},className:`rounded p-0.5 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200`,title:a?`Download folder as .tar.gz`:`Download file`,children:(0,L.jsx)(me,{size:11})}),(0,L.jsx)(`button`,{onClick:n=>{n.stopPropagation(),e.onRenameStart(i,t.name)},className:`rounded p-0.5 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200`,title:`Rename`,children:(0,L.jsx)(je,{size:11})}),(0,L.jsx)(`button`,{onClick:n=>{n.stopPropagation(),e.onDelete(i,t.name,a)},className:`rounded p-0.5 text-neutral-500 hover:bg-red-900/30 hover:text-red-300`,title:`Delete`,children:(0,L.jsx)(Ve,{size:11})})]})]}),a&&o&&t.children!==void 0&&(0,L.jsx)(`ul`,{children:t.children.map(t=>(0,L.jsx)(qk,{...e,node:t,depth:n+1},t.path))})]})}function Jk(e,t){return t===``?e:`${e}/${t.replaceAll(`\\`,`/`)}`}function Yk(e,t){if(e!==t)return e.startsWith(`${t}/`)?e.slice(t.length+1):e}function Xk(e,t){if(e?.kind!==`create`)return``;let n=Yk(e.parentAbsPath,t),r=e.entryKind===`folder`?`folder`:`file`;return n===void 0?`New ${r}`:`New ${r} in ${n}/`}function Zk(e,t){if(e?.kind!==`create`)return``;let n=Yk(e.parentAbsPath,t),r=e.entryKind===`folder`?`Folder name`:`File name`;return n===void 0?`${r} (relative to project root)`:`${r} (in ${n}/)`}function Qk(e){return e?.kind===`create`?e.entryKind===`folder`?`utils`:`index.ts`:``}function $k(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`}var eA=`forge.editor.wrap.`,tA=[];function nA(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`)),n=t===-1?e:e.slice(t+1),r=n.lastIndexOf(`.`);return r<=0?``:n.slice(r+1).toLowerCase()}function rA(e){try{let t=localStorage.getItem(eA+e);if(t===`0`)return!1;if(t===`1`)return!0}catch{}return!0}function iA(e,t){try{localStorage.setItem(eA+e,t?`1`:`0`)}catch{}}var aA=(0,v.lazy)(()=>C(()=>import(`./CodeMirrorEditor-EHkmefTD.js`).then(e=>({default:e.CodeMirrorEditor})),[]));function oA(){let e=kn(),t=ur(e=>e.openFiles),n=ur(e=>e.activePath),r=ur(e=>e.setActiveFile),i=ur(e=>e.closeFile),a=ur(e=>e.closeAllFiles),o=ur(e=>e.updateDraft),s=ur(e=>e.saveFile),c=ur(e=>e.reloadFile),l=ur(e=>e.externallyChanged),u=ur(e=>e.gitDiffByPath),d=t.find(e=>e.path===n),f=d===void 0?``:nA(d.path),[p,m]=(0,v.useState)(()=>rA(f));(0,v.useEffect)(()=>{m(rA(f))},[f]);let h=(0,v.useCallback)(()=>{m(e=>{let t=!e;return iA(f,t),t})},[f]);return(0,L.jsxs)(`div`,{className:`flex h-full flex-col bg-neutral-950 text-sm text-neutral-200`,children:[(0,L.jsx)(cA,{files:t,activePath:n,externallyChanged:l,onActivate:r,onClose:i,onCloseAll:a}),d===void 0?(0,L.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-xs italic text-neutral-500`,children:`No file open. Click a file in the tree to start editing.`}):(0,L.jsxs)(L.Fragment,{children:[l[d.path]===!0&&(0,L.jsx)(lA,{path:d.path,onReload:()=>{e!==void 0&&c(e.id,d.path)},onDiscard:()=>ur.getState().dismissExternallyChanged(d.path)}),d.binary?(0,L.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-6 text-center text-sm text-neutral-500`,children:d.loadingError??`Binary file.`}):(0,L.jsx)(v.Suspense,{fallback:(0,L.jsx)(sA,{}),children:(0,L.jsx)(aA,{file:d,wrap:p,diffChanges:u[d.path]??tA,onChange:e=>o(d.path,e),onSaveShortcut:()=>{e!==void 0&&s(e.id,d.path)},onConsumePendingNav:e=>ur.getState().consumePendingNav(e)},d.tabId)}),(0,L.jsx)(uA,{file:d,wrap:p,onToggleWrap:h,onSave:()=>{e!==void 0&&s(e.id,d.path)}})]})]})}function sA(){return(0,L.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-xs italic text-neutral-500`,children:`Loading editor…`})}function cA({files:e,activePath:t,externallyChanged:n,onActivate:r,onClose:i,onCloseAll:a}){if(e.length===0)return null;let o=e.filter(e=>e.dirty).length;return(0,L.jsxs)(`div`,{className:`flex border-b border-neutral-800 bg-neutral-900/40`,children:[(0,L.jsx)(`button`,{onClick:()=>{o>0&&!window.confirm(`Close ${e.length} tab${e.length===1?``:`s`}? ${o} ha${o===1?`s`:`ve`} unsaved changes that will be lost.`)||a()},className:`flex shrink-0 items-center justify-center border-r border-neutral-800 px-2 py-1.5 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200`,title:`Close all ${e.length} tab${e.length===1?``:`s`}`,children:(0,L.jsx)(Re,{size:14})}),(0,L.jsx)(`div`,{className:`flex flex-1 overflow-x-auto`,children:e.map(e=>{let a=e.path.split(`/`).pop()??e.path,o=e.path===t,s=n[e.path]===!0;return(0,L.jsxs)(`div`,{className:`group flex items-center gap-1 border-r border-neutral-800 px-3 py-1.5 text-xs ${o?`bg-neutral-950 text-neutral-100`:`text-neutral-400 hover:bg-neutral-900 hover:text-neutral-200`} ${s?`bg-amber-900/30 text-amber-200`:``}`,title:s?`${e.path}\n\nExternal change while you have unsaved edits — open the tab to review.`:e.path,children:[(0,L.jsxs)(`button`,{onClick:()=>r(e.path),className:`truncate`,children:[s?(0,L.jsx)(He,{size:11,className:`mr-1 inline text-amber-400`}):e.dirty?(0,L.jsx)(`span`,{className:`mr-1 text-amber-400`,children:`•`}):null,a]}),(0,L.jsx)(`button`,{onClick:()=>i(e.path),className:`rounded p-1 text-neutral-600 hover:bg-neutral-800 hover:text-neutral-200`,title:`Close (any unsaved changes are lost)`,children:(0,L.jsx)(Ke,{size:16})})]},e.tabId)})})]})}function lA({path:e,onReload:t,onDiscard:n}){return(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-amber-700/40 bg-amber-900/20 px-4 py-1.5 text-xs text-amber-200`,children:[(0,L.jsxs)(`span`,{children:[`File changed externally — local edits in this tab are stale. Reload from disk?`,(0,L.jsx)(`span`,{className:`ml-2 font-mono text-[10px] text-amber-400/70`,children:e})]}),(0,L.jsxs)(`div`,{className:`flex gap-1`,children:[(0,L.jsx)(`button`,{onClick:t,className:`rounded border border-amber-700/50 px-2 py-0.5 hover:bg-amber-900/30`,children:`Reload`}),(0,L.jsx)(`button`,{onClick:n,className:`rounded border border-neutral-700 px-2 py-0.5 text-neutral-300 hover:border-neutral-500`,children:`Keep mine`})]})]})}function uA({file:e,wrap:t,onToggleWrap:n,onSave:r}){let i=e.dirty,a=e.saving,o=e.savedAt,s=e.saveError,c,l=`text-neutral-500`;s===void 0?a?c=`Saving…`:i?(c=`Unsaved changes`,l=`text-amber-400`):o===void 0?c=`Up to date`:(c=`Saved ${new Date(o).toLocaleTimeString()}`,l=`text-emerald-500`):(c=`Save failed (${s}) — Cmd/Ctrl+S or Save to retry`,l=`text-rose-400`);let u=(i||s!==void 0)&&!a&&!e.binary;return(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-t border-neutral-800 bg-neutral-900/40 px-3 py-1 text-[11px]`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`font-mono text-neutral-500`,children:e.language}),(0,L.jsxs)(`button`,{onClick:n,className:`flex items-center gap-1 rounded px-1 py-0.5 text-[10px] hover:bg-neutral-800 ${t?`text-neutral-300`:`text-neutral-500`}`,title:t?`Wrap on (click to switch to horizontal scroll, persisted per file extension)`:`Wrap off (click to enable wrap, persisted per file extension)`,children:[(0,L.jsx)(Be,{size:11}),t?`wrap`:`no wrap`]})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`span`,{className:l,children:c}),(0,L.jsxs)(`button`,{onClick:r,disabled:!u,className:`flex items-center gap-1 rounded border border-neutral-700 px-1.5 py-0.5 text-[10px] text-neutral-200 hover:border-neutral-500 disabled:cursor-not-allowed disabled:border-neutral-800 disabled:text-neutral-600`,title:`Save (Cmd/Ctrl+S)`,children:[(0,L.jsx)(Ie,{size:11}),`Save`]})]})]})}var dA=o(((e,t)=>{(function(n,r){if(typeof e==`object`&&typeof t==`object`)t.exports=r();else if(typeof define==`function`&&define.amd)define([],r);else{var i=r();for(var a in i)(typeof e==`object`?e:n)[a]=i[a]}})(globalThis,(()=>(()=>{var e={4567:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.AccessibilityManager=void 0;let a=n(9042),o=n(9924),s=n(844),c=n(4725),l=n(2585),u=n(3656),d=t.AccessibilityManager=class extends s.Disposable{constructor(e,t,n,r){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=r,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce=``,this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement(`div`),this._accessibilityContainer.classList.add(`xterm-accessibility`),this._rowContainer=this._coreBrowserService.mainDocument.createElement(`div`),this._rowContainer.setAttribute(`role`,`list`),this._rowContainer.classList.add(`xterm-accessibility-tree`),this._rowElements=[];for(let e=0;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);if(this._topBoundaryFocusListener=e=>this._handleBoundaryFocus(e,0),this._bottomBoundaryFocusListener=e=>this._handleBoundaryFocus(e,1),this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement(`div`),this._liveRegion.classList.add(`live-region`),this._liveRegion.setAttribute(`aria-live`,`assertive`),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new o.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw Error(`Cannot enable accessibility before Terminal.open`);this._terminal.element.insertAdjacentElement(`afterbegin`,this._accessibilityContainer),this.register(this._terminal.onResize((e=>this._handleResize(e.rows)))),this.register(this._terminal.onRender((e=>this._refreshRows(e.start,e.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((e=>this._handleChar(e)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
347
+ `)))),this.register(this._terminal.onA11yTab((e=>this._handleTab(e)))),this.register(this._terminal.onKey((e=>this._handleKey(e.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,u.addDisposableDomListener)(document,`selectionchange`,(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,s.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(` `)}_handleChar(e){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
348
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=a.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent=``,this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,r=n.lines.length.toString();for(let i=e;i<=t;i++){let e=n.lines.get(n.ydisp+i),t=[],a=e?.translateToString(!0,void 0,void 0,t)||``,o=(n.ydisp+i+1).toString(),s=this._rowElements[i];s&&(a.length===0?(s.innerText=`\xA0`,this._rowColumns.set(s,[0,1])):(s.textContent=a,this._rowColumns.set(s,t)),s.setAttribute(`aria-posinset`,o),s.setAttribute(`aria-setsize`,r))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce=``)}_handleBoundaryFocus(e,t){let n=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2];if(n.getAttribute(`aria-posinset`)===(t===0?`1`:`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==r)return;let i,a;if(t===0?(i=n,a=this._rowElements.pop(),this._rowContainer.removeChild(a)):(i=this._rowElements.shift(),a=n,this._rowContainer.removeChild(i)),i.removeEventListener(`focus`,this._topBoundaryFocusListener),a.removeEventListener(`focus`,this._bottomBoundaryFocusListener),t===0){let e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement(`afterbegin`,e)}else{let e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=document.getSelection();if(!e)return;if(e.isCollapsed)return void(this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection());if(!e.anchorNode||!e.focusNode)return void console.error(`anchorNode and/or focusNode are null`);let t={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let r=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:r,offset:r.textContent?.length??0}),!this._rowContainer.contains(n.node))return;let i=({node:e,offset:t})=>{let n=e instanceof Text?e.parentNode:e,r=parseInt(n?.getAttribute(`aria-posinset`),10)-1;if(isNaN(r))return console.warn(`row is invalid. Race condition?`),null;let i=this._rowColumns.get(n);if(!i)return console.warn(`columns is null. Race condition?`),null;let a=t<i.length?i[t]:i.slice(-1)[0]+1;return a>=this._terminal.cols&&(++r,a=0),{row:r,column:a}},a=i(t),o=i(n);if(a&&o){if(a.row>o.row||a.row===o.row&&a.column>=o.column)throw Error(`invalid range`);this._terminal.select(a.column,a.row,(o.row-a.row)*this._terminal.cols-a.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener(`focus`,this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement(`div`);return e.setAttribute(`role`,`listitem`),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}};t.AccessibilityManager=d=r([i(1,l.IInstantiationService),i(2,c.ICoreBrowserService),i(3,c.IRenderService)],d)},3614:(e,t)=>{function n(e){return e.replace(/\r?\n/g,`\r`)}function r(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function i(e,t,i,a){e=r(e=n(e),i.decPrivateModes.bracketedPasteMode&&!0!==a.rawOptions.ignoreBracketedPasteMode),i.triggerDataEvent(e,!0),t.value=``}function a(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}Object.defineProperty(t,`__esModule`,{value:!0}),t.rightClickHandler=t.moveTextAreaUnderMouseCursor=t.paste=t.handlePasteEvent=t.copyHandler=t.bracketTextForPaste=t.prepareTextForTerminal=void 0,t.prepareTextForTerminal=n,t.bracketTextForPaste=r,t.copyHandler=function(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()},t.handlePasteEvent=function(e,t,n,r){e.stopPropagation(),e.clipboardData&&i(e.clipboardData.getData(`text/plain`),t,n,r)},t.paste=i,t.moveTextAreaUnderMouseCursor=a,t.rightClickHandler=function(e,t,n,r,i){a(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}},7239:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.ColorContrastCache=void 0;let r=n(1505);t.ColorContrastCache=class{constructor(){this._color=new r.TwoKeyMap,this._css=new r.TwoKeyMap}setCss(e,t,n){this._css.set(e,t,n)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,n){this._color.set(e,t,n)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}}},3656:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.addDisposableDomListener=void 0,t.addDisposableDomListener=function(e,t,n,r){e.addEventListener(t,n,r);let i=!1;return{dispose:()=>{i||(i=!0,e.removeEventListener(t,n,r))}}}},3551:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.Linkifier=void 0;let a=n(3656),o=n(8460),s=n(844),c=n(2585),l=n(4725),u=t.Linkifier=class extends s.Disposable{get currentLink(){return this._currentLink}constructor(e,t,n,r,i){super(),this._element=e,this._mouseService=t,this._renderService=n,this._bufferService=r,this._linkProviderService=i,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new o.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new o.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,s.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,s.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,a.addDisposableDomListener)(this._element,`mouseleave`,(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,a.addDisposableDomListener)(this._element,`mousemove`,this._handleMouseMove.bind(this))),this.register((0,a.addDisposableDomListener)(this._element,`mousedown`,this._handleMouseDown.bind(this))),this.register((0,a.addDisposableDomListener)(this._element,`mouseup`,this._handleMouseUp.bind(this)))}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let n=e.composedPath();for(let e=0;e<n.length;e++){let t=n[e];if(t.classList.contains(`xterm`))break;if(t.classList.contains(`xterm-hover`))return}this._lastBufferCell&&t.x===this._lastBufferCell.x&&t.y===this._lastBufferCell.y||(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(e,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){this._activeProviderReplies&&t||(this._activeProviderReplies?.forEach((e=>{e?.forEach((e=>{e.link.dispose&&e.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[r,i]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(r)&&(n=this._checkLinkProviderResult(r,e,n)):i.provideLinks(e.y,(t=>{if(this._isMouseOut)return;let i=t?.map((e=>({link:e})));this._activeProviderReplies?.set(r,i),n=this._checkLinkProviderResult(r,e,n),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)}))}_removeIntersectingLinks(e,t){let n=new Set;for(let r=0;r<t.size;r++){let i=t.get(r);if(i)for(let t=0;t<i.length;t++){let r=i[t],a=r.link.range.start.y<e?0:r.link.range.start.x,o=r.link.range.end.y>e?this._bufferService.cols:r.link.range.end.x;for(let e=a;e<=o;e++){if(n.has(e)){i.splice(t--,1);break}n.add(e)}}}}_checkLinkProviderResult(e,t,n){if(!this._activeProviderReplies)return n;let r=this._activeProviderReplies.get(e),i=!1;for(let t=0;t<e;t++)this._activeProviderReplies.has(t)&&!this._activeProviderReplies.get(t)||(i=!0);if(!i&&r){let e=r.find((e=>this._linkAtPosition(e.link,t)));e&&(n=!0,this._handleNewLink(e))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let e=0;e<this._activeProviderReplies.size;e++){let r=this._activeProviderReplies.get(e)?.find((e=>this._linkAtPosition(e.link,t)));if(r){n=!0,this._handleNewLink(r);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){this._currentLink&&this._lastMouseEvent&&(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,s.disposeArray)(this._linkCacheDisposables))}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0||e.link.decorations.underline,pointerCursor:e.link.decorations===void 0||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:e=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==e&&(this._currentLink.state.decorations.pointerCursor=e,this._currentLink.state.isHovered&&this._element.classList.toggle(`xterm-cursor-pointer`,e))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:t=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,t))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((e=>{if(!this._currentLink)return;let t=e.start===0?0:e.start+1+this._bufferService.buffer.ydisp,n=this._bufferService.buffer.ydisp+1+e.end;if(this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=n&&(this._clearCurrentLink(t,n),this._lastMouseEvent)){let e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._askForLink(e,!1)}}))))}_linkHover(e,t,n){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add(`xterm-cursor-pointer`)),t.hover&&t.hover(n,t.text)}_fireUnderlineEvent(e,t){let n=e.range,r=this._bufferService.buffer.ydisp,i=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-r-1,n.end.x,n.end.y-r-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(i)}_linkLeave(e,t,n){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove(`xterm-cursor-pointer`)),t.leave&&t.leave(n,t.text)}_linkAtPosition(e,t){let n=e.range.start.y*this._bufferService.cols+e.range.start.x,r=e.range.end.y*this._bufferService.cols+e.range.end.x,i=t.y*this._bufferService.cols+t.x;return n<=i&&i<=r}_positionFromMouseEvent(e,t,n){let r=n.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(r)return{x:r[0],y:r[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,n,r,i){return{x1:e,y1:t,x2:n,y2:r,cols:this._bufferService.cols,fg:i}}};t.Linkifier=u=r([i(1,l.IMouseService),i(2,l.IRenderService),i(3,c.IBufferService),i(4,l.ILinkProviderService)],u)},9042:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.tooMuchOutput=t.promptLabel=void 0,t.promptLabel=`Terminal input`,t.tooMuchOutput=`Too much output to announce, navigate to rows manually to read`},3730:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.OscLinkProvider=void 0;let a=n(511),o=n(2585),s=t.OscLinkProvider=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n)return void t(void 0);let r=[],i=this._optionsService.rawOptions.linkHandler,o=new a.CellData,s=n.getTrimmedLength(),l=-1,u=-1,d=!1;for(let t=0;t<s;t++)if(u!==-1||n.hasContent(t)){if(n.loadCell(t,o),o.hasExtendedAttrs()&&o.extended.urlId){if(u===-1){u=t,l=o.extended.urlId;continue}d=o.extended.urlId!==l}else u!==-1&&(d=!0);if(d||u!==-1&&t===s-1){let n=this._oscLinkService.getLinkData(l)?.uri;if(n){let a={start:{x:u+1,y:e},end:{x:t+(d||t!==s-1?0:1),y:e}},o=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(o=!0)}catch{o=!0}o||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):c(0,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}d=!1,o.hasExtendedAttrs()&&o.extended.urlId?(u=t,l=o.extended.urlId):(u=-1,l=-1)}}t(r)}};function c(e,t){if(confirm(`Do you want to navigate to ${t}?\n\nWARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}}t.OscLinkProvider=s=r([i(0,o.IBufferService),i(1,o.IOptionsService),i(2,o.IOscLinkService)],s)},6193:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.RenderDebouncer=void 0,t.RenderDebouncer=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&=(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())),this._animationFrame}refresh(e,t,n){this._rowCount=n,e=e===void 0?0:e,t=t===void 0?this._rowCount-1:t,this._rowStart=this._rowStart===void 0?e:Math.min(this._rowStart,e),this._rowEnd=this._rowEnd===void 0?t:Math.max(this._rowEnd,t),this._animationFrame||=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}}},3236:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.Terminal=void 0;let r=n(3614),i=n(3656),a=n(3551),o=n(9042),s=n(3730),c=n(1680),l=n(3107),u=n(5744),d=n(2950),f=n(1296),p=n(428),m=n(4269),h=n(5114),g=n(8934),_=n(3230),v=n(9312),y=n(4725),b=n(6731),x=n(8055),S=n(8969),C=n(8460),w=n(844),T=n(6114),E=n(8437),D=n(2584),O=n(7399),ee=n(5941),te=n(9074),ne=n(2585),re=n(5435),k=n(4567),ie=n(779);class ae extends S.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(e={}){super(e),this.browser=T,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new w.MutableDisposable),this._onCursorMove=this.register(new C.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new C.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new C.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new C.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new C.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new C.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new C.EventEmitter),this._onBlur=this.register(new C.EventEmitter),this._onA11yCharEmitter=this.register(new C.EventEmitter),this._onA11yTabEmitter=this.register(new C.EventEmitter),this._onWillOpen=this.register(new C.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(te.DecorationService),this._instantiationService.setService(ne.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ie.LinkProviderService),this._instantiationService.setService(y.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(s.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((e,t)=>this.refresh(e,t)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((e=>this._reportWindowsOptions(e)))),this.register(this._inputHandler.onColor((e=>this._handleColorEvent(e)))),this.register((0,C.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,C.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,C.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,C.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((e=>this._afterResize(e.cols,e.rows)))),this.register((0,w.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(e){if(this._themeService)for(let t of e){let e,n=``;switch(t.index){case 256:e=`foreground`,n=`10`;break;case 257:e=`background`,n=`11`;break;case 258:e=`cursor`,n=`12`;break;default:e=`ansi`,n=`4;`+t.index}switch(t.type){case 0:let r=x.color.toColorRGB(e===`ansi`?this._themeService.colors.ansi[t.index]:this._themeService.colors[e]);this.coreService.triggerDataEvent(`${D.C0.ESC}]${n};${(0,ee.toRgbString)(r)}${D.C1_ESCAPED.ST}`);break;case 1:if(e===`ansi`)this._themeService.modifyColors((e=>e.ansi[t.index]=x.channels.toColor(...t.color)));else{let n=e;this._themeService.modifyColors((e=>e[n]=x.channels.toColor(...t.color)))}break;case 2:this._themeService.restoreColor(t.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(k.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(D.C0.ESC+`[I`),this.element.classList.add(`focus`),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value=``,this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(D.C0.ESC+`[O`),this.element.classList.remove(`focus`),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let n=Math.min(this.buffer.x,this.cols-1),r=this._renderService.dimensions.css.cell.height,i=t.getWidth(n),a=this._renderService.dimensions.css.cell.width*i,o=this.buffer.y*this._renderService.dimensions.css.cell.height,s=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=s+`px`,this.textarea.style.top=o+`px`,this.textarea.style.width=a+`px`,this.textarea.style.height=r+`px`,this.textarea.style.lineHeight=r+`px`,this.textarea.style.zIndex=`-5`}_initGlobal(){this._bindKeys(),this.register((0,i.addDisposableDomListener)(this.element,`copy`,(e=>{this.hasSelection()&&(0,r.copyHandler)(e,this._selectionService)})));let e=e=>(0,r.handlePasteEvent)(e,this.textarea,this.coreService,this.optionsService);this.register((0,i.addDisposableDomListener)(this.textarea,`paste`,e)),this.register((0,i.addDisposableDomListener)(this.element,`paste`,e)),T.isFirefox?this.register((0,i.addDisposableDomListener)(this.element,`mousedown`,(e=>{e.button===2&&(0,r.rightClickHandler)(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,i.addDisposableDomListener)(this.element,`contextmenu`,(e=>{(0,r.rightClickHandler)(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),T.isLinux&&this.register((0,i.addDisposableDomListener)(this.element,`auxclick`,(e=>{e.button===1&&(0,r.moveTextAreaUnderMouseCursor)(e,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,i.addDisposableDomListener)(this.textarea,`keyup`,(e=>this._keyUp(e)),!0)),this.register((0,i.addDisposableDomListener)(this.textarea,`keydown`,(e=>this._keyDown(e)),!0)),this.register((0,i.addDisposableDomListener)(this.textarea,`keypress`,(e=>this._keyPress(e)),!0)),this.register((0,i.addDisposableDomListener)(this.textarea,`compositionstart`,(()=>this._compositionHelper.compositionstart()))),this.register((0,i.addDisposableDomListener)(this.textarea,`compositionupdate`,(e=>this._compositionHelper.compositionupdate(e)))),this.register((0,i.addDisposableDomListener)(this.textarea,`compositionend`,(()=>this._compositionHelper.compositionend()))),this.register((0,i.addDisposableDomListener)(this.textarea,`input`,(e=>this._inputEvent(e)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(e){if(!e)throw Error(`Terminal requires a parent element.`);if(e.isConnected||this._logService.debug(`Terminal.open was called on an element that was not attached to the DOM`),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement(`div`),this.element.dir=`ltr`,this.element.classList.add(`terminal`),this.element.classList.add(`xterm`),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement(`div`),this._viewportElement.classList.add(`xterm-viewport`),t.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement(`div`),this._viewportScrollArea.classList.add(`xterm-scroll-area`),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement(`div`),this.screenElement.classList.add(`xterm-screen`),this.register((0,i.addDisposableDomListener)(this.screenElement,`mousemove`,(e=>this.updateCursorStyle(e)))),this._helperContainer=this._document.createElement(`div`),this._helperContainer.classList.add(`xterm-helpers`),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement),this.textarea=this._document.createElement(`textarea`),this.textarea.classList.add(`xterm-helper-textarea`),this.textarea.setAttribute(`aria-label`,o.promptLabel),T.isChromeOS||this.textarea.setAttribute(`aria-multiline`,`false`),this.textarea.setAttribute(`autocorrect`,`off`),this.textarea.setAttribute(`autocapitalize`,`off`),this.textarea.setAttribute(`spellcheck`,`false`),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(h.CoreBrowserService,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<`u`?window.document:null)),this._instantiationService.setService(y.ICoreBrowserService,this._coreBrowserService),this.register((0,i.addDisposableDomListener)(this.textarea,`focus`,(e=>this._handleTextAreaFocus(e)))),this.register((0,i.addDisposableDomListener)(this.textarea,`blur`,(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(p.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(y.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(b.ThemeService),this._instantiationService.setService(y.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(m.CharacterJoinerService),this._instantiationService.setService(y.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(_.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(y.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((e=>this._onRender.fire(e)))),this.onResize((e=>this._renderService.resize(e.cols,e.rows))),this._compositionView=this._document.createElement(`div`),this._compositionView.classList.add(`composition-view`),this._compositionHelper=this._instantiationService.createInstance(d.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(g.MouseService),this._instantiationService.setService(y.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(a.Linkifier,this.screenElement)),this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(c.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((e=>this.scrollLines(e.amount,e.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(v.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(y.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((e=>this.scrollLines(e.amount,e.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((e=>this._renderService.handleSelectionChanged(e.start,e.end,e.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((e=>{this.textarea.value=e,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((e=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,i.addDisposableDomListener)(this._viewportElement,`scroll`,(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(l.BufferDecorationRenderer,this.screenElement)),this.register((0,i.addDisposableDomListener)(this.element,`mousedown`,(e=>this._selectionService.handleMouseDown(e)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add(`enable-mouse-events`)):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(k.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange(`screenReaderMode`,(e=>this._handleScreenReaderModeOptionChange(e)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange(`overviewRulerWidth`,(e=>{!this._overviewRulerRenderer&&e&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(f.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function n(t){let n=e._mouseService.getMouseReportCoords(t,e.screenElement);if(!n)return!1;let r,i;switch(t.overrideType||t.type){case`mousemove`:i=32,t.buttons===void 0?(r=3,t.button!==void 0&&(r=t.button<3?t.button:3)):r=1&t.buttons?0:4&t.buttons?1:2&t.buttons?2:3;break;case`mouseup`:i=0,r=t.button<3?t.button:3;break;case`mousedown`:i=1,r=t.button<3?t.button:3;break;case`wheel`:if(e._customWheelEventHandler&&!1===e._customWheelEventHandler(t)||e.viewport.getLinesScrolled(t)===0)return!1;i=t.deltaY<0?0:1,r=4;break;default:return!1}return!(i===void 0||r===void 0||r>4)&&e.coreMouseService.triggerMouseEvent({col:n.col,row:n.row,x:n.x,y:n.y,button:r,action:i,ctrl:t.ctrlKey,alt:t.altKey,shift:t.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},a={mouseup:e=>(n(e),e.buttons||(this._document.removeEventListener(`mouseup`,r.mouseup),r.mousedrag&&this._document.removeEventListener(`mousemove`,r.mousedrag)),this.cancel(e)),wheel:e=>(n(e),this.cancel(e,!0)),mousedrag:e=>{e.buttons&&n(e)},mousemove:e=>{e.buttons||n(e)}};this.register(this.coreMouseService.onProtocolChange((e=>{e?(this.optionsService.rawOptions.logLevel===`debug`&&this._logService.debug(`Binding to mouse events:`,this.coreMouseService.explainEvents(e)),this.element.classList.add(`enable-mouse-events`),this._selectionService.disable()):(this._logService.debug(`Unbinding from mouse events.`),this.element.classList.remove(`enable-mouse-events`),this._selectionService.enable()),8&e?r.mousemove||=(t.addEventListener(`mousemove`,a.mousemove),a.mousemove):(t.removeEventListener(`mousemove`,r.mousemove),r.mousemove=null),16&e?r.wheel||=(t.addEventListener(`wheel`,a.wheel,{passive:!1}),a.wheel):(t.removeEventListener(`wheel`,r.wheel),r.wheel=null),2&e?r.mouseup||=a.mouseup:(this._document.removeEventListener(`mouseup`,r.mouseup),r.mouseup=null),4&e?r.mousedrag||=a.mousedrag:(this._document.removeEventListener(`mousemove`,r.mousedrag),r.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,i.addDisposableDomListener)(t,`mousedown`,(e=>{if(e.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(e))return n(e),r.mouseup&&this._document.addEventListener(`mouseup`,r.mouseup),r.mousedrag&&this._document.addEventListener(`mousemove`,r.mousedrag),this.cancel(e)}))),this.register((0,i.addDisposableDomListener)(t,`wheel`,(e=>{if(!r.wheel){if(this._customWheelEventHandler&&!1===this._customWheelEventHandler(e))return!1;if(!this.buffer.hasScrollback){let t=this.viewport.getLinesScrolled(e);if(t===0)return;let n=D.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?`O`:`[`)+(e.deltaY<0?`A`:`B`),r=``;for(let e=0;e<Math.abs(t);e++)r+=n;return this.coreService.triggerDataEvent(r,!0),this.cancel(e,!0)}return this.viewport.handleWheel(e)?this.cancel(e):void 0}}),{passive:!1})),this.register((0,i.addDisposableDomListener)(t,`touchstart`,(e=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(e),this.cancel(e)}),{passive:!0})),this.register((0,i.addDisposableDomListener)(t,`touchmove`,(e=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(e)?void 0:this.cancel(e)}),{passive:!1}))}refresh(e,t){this._renderService?.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add(`column-select`):this.element.classList.remove(`column-select`)}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t,n=0){n===1?(super.scrollLines(e,t,n),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(e)}paste(e){(0,r.paste)(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw Error(`Terminal must be opened first`);let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw Error(`Terminal must be opened first`);this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(e,t,n){this._selectionService.setSelection(e,t,n)}getSelection(){return this._selectionService?this._selectionService.selectionText:``}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,t){this._selectionService?.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;t||e.key!==`Dead`&&e.key!==`AltGraph`||(this._unprocessedDeadKey=!0);let n=(0,O.evaluateKeyboardEvent)(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let t=this.rows-1;return this.scrollLines(n.type===2?-t:t),this.cancel(e,!0)}return n.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.key||!!(e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(n.key!==D.C0.ETX&&n.key!==D.C0.CR||(this.textarea.value=``),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey?this.cancel(e,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(e,t){let n=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState(`AltGraph`);return t.type===`keypress`?n:n&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e)||(function(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else{if(e.which===0||e.charCode===0)return!1;t=e.which}return!(!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)||(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(e){if(e.data&&e.inputType===`insertText`&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){e!==this.cols||t!==this.rows?super.resize(e,t):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(e,t){this._charSizeService?.measure(),this.viewport?.syncScrollArea(!0)}clear(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(E.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),this.viewport?.reset(),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains(`focus`)?this.coreService.triggerDataEvent(D.C0.ESC+`[I`):this.coreService.triggerDataEvent(D.C0.ESC+`[O`)}_reportWindowsOptions(e){if(this._renderService)switch(e){case re.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:let e=this._renderService.dimensions.css.canvas.width.toFixed(0),t=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${D.C0.ESC}[4;${t};${e}t`);break;case re.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:let n=this._renderService.dimensions.css.cell.width.toFixed(0),r=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${D.C0.ESC}[6;${r};${n}t`)}}cancel(e,t){if(this.options.cancelEvents||t)return e.preventDefault(),e.stopPropagation(),!1}}t.Terminal=ae},9924:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.TimeBasedDebouncer=void 0,t.TimeBasedDebouncer=class{constructor(e,t=1e3){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,n){this._rowCount=n,e=e===void 0?0:e,t=t===void 0?this._rowCount-1:t,this._rowStart=this._rowStart===void 0?e:Math.min(this._rowStart,e),this._rowEnd=this._rowEnd===void 0?t:Math.max(this._rowEnd,t);let r=Date.now();if(r-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=r,this._innerRefresh();else if(!this._additionalRefreshRequested){let e=r-this._lastRefreshMs,t=this._debounceThresholdMS-e;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),t)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}}},1680:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.Viewport=void 0;let a=n(3656),o=n(4725),s=n(8460),c=n(844),l=n(2585),u=t.Viewport=class extends c.Disposable{constructor(e,t,n,r,i,o,c,l){super(),this._viewportElement=e,this._scrollArea=t,this._bufferService=n,this._optionsService=r,this._charSizeService=i,this._renderService=o,this._coreBrowserService=c,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new s.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,a.addDisposableDomListener)(this._viewportElement,`scroll`,this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((e=>this._activeBuffer=e.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((e=>this._renderDimensions=e))),this._handleThemeChange(l.colors),this.register(l.onChangeColors((e=>this._handleThemeChange(e)))),this.register(this._optionsService.onSpecificOptionChange(`scrollback`,(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(e){this._viewportElement.style.backgroundColor=e.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(e){if(e)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;let e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+`px`)}let e=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==e&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=e),this._refreshAnimationFrame=null}syncScrollArea(e=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(e);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(e)}_handleScroll(e){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});let t=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:t,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;let e=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(e*(this._smoothScrollState.target-this._smoothScrollState.origin)),e<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(e,t){let n=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(t<0&&this._viewportElement.scrollTop!==0||t>0&&n<this._lastRecordedBufferHeight)||(e.cancelable&&e.preventDefault(),!1)}handleWheel(e){let t=this._getPixelsScrolled(e);return t!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+t:this._smoothScrollState.target+=t,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))}scrollLines(e){if(e!==0)if(this._optionsService.rawOptions.smoothScrollDuration){let t=e*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+t,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:e,suppressScrollEvent:!1})}_getPixelsScrolled(e){if(e.deltaY===0||e.shiftKey)return 0;let t=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_LINE?t*=this._currentRowHeight:e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._currentRowHeight*this._bufferService.rows),t}getBufferElements(e,t){let n,r=``,i=[],a=t??this._bufferService.buffer.lines.length,o=this._bufferService.buffer.lines;for(let t=e;t<a;t++){let e=o.get(t);if(!e)continue;let a=o.get(t+1)?.isWrapped;if(r+=e.translateToString(!a),!a||t===o.length-1){let e=document.createElement(`div`);e.textContent=r,i.push(e),r.length>0&&(n=e),r=``}}return{bufferElements:i,cursorElement:n}}getLinesScrolled(e){if(e.deltaY===0||e.shiftKey)return 0;let t=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(t/=this._currentRowHeight+0,this._wheelPartialScroll+=t,t=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._bufferService.rows),t}_applyScrollModifier(e,t){let n=this._optionsService.rawOptions.fastScrollModifier;return n===`alt`&&t.altKey||n===`ctrl`&&t.ctrlKey||n===`shift`&&t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(e){this._lastTouchY=e.touches[0].pageY}handleTouchMove(e){let t=this._lastTouchY-e.touches[0].pageY;return this._lastTouchY=e.touches[0].pageY,t!==0&&(this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))}};t.Viewport=u=r([i(2,l.IBufferService),i(3,l.IOptionsService),i(4,o.ICharSizeService),i(5,o.IRenderService),i(6,o.ICoreBrowserService),i(7,o.IThemeService)],u)},3107:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.BufferDecorationRenderer=void 0;let a=n(4725),o=n(844),s=n(2585),c=t.BufferDecorationRenderer=class extends o.Disposable{constructor(e,t,n,r,i){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=r,this._renderService=i,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement(`div`),this._container.classList.add(`xterm-decoration-container`),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((e=>this._removeDecoration(e)))),this.register((0,o.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let t=this._coreBrowserService.mainDocument.createElement(`div`);t.classList.add(`xterm-decoration`),t.classList.toggle(`xterm-decoration-top-layer`,e?.options?.layer===`top`),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=(e.options.height||1)*this._renderService.dimensions.css.cell.height+`px`,t.style.top=(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+`px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(t.style.display=`none`),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display=`none`,e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose((()=>{this._decorationElements.delete(e),n.remove()}))),n.style.top=t*this._renderService.dimensions.css.cell.height+`px`,n.style.display=this._altBufferIsActive?`none`:`block`,e.onRenderEmitter.fire(n)}}_refreshXPosition(e,t=e.element){if(!t)return;let n=e.options.x??0;(e.options.anchor||`left`)===`right`?t.style.right=n?n*this._renderService.dimensions.css.cell.width+`px`:``:t.style.left=n?n*this._renderService.dimensions.css.cell.width+`px`:``}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};t.BufferDecorationRenderer=c=r([i(1,s.IBufferService),i(2,a.ICoreBrowserService),i(3,s.IDecorationService),i(4,a.IRenderService)],c)},5871:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.ColorZoneStore=void 0,t.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position))return void this._addLineToZone(t,e.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,n){return t>=e.startBufferLine-this._linePadding[n||`full`]&&t<=e.endBufferLine+this._linePadding[n||`full`]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}}},5744:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.OverviewRulerRenderer=void 0;let a=n(5871),o=n(4725),s=n(844),c=n(2585),l={full:0,left:0,center:0,right:0},u={full:0,left:0,center:0,right:0},d={full:0,left:0,center:0,right:0},f=t.OverviewRulerRenderer=class extends s.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(e,t,n,r,i,o,c){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=n,this._decorationService=r,this._renderService=i,this._optionsService=o,this._coreBrowserService=c,this._colorZoneStore=new a.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement(`canvas`),this._canvas.classList.add(`xterm-decoration-overview-ruler`),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);let l=this._canvas.getContext(`2d`);if(!l)throw Error(`Ctx cannot be null`);this._ctx=l,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,s.toDisposable)((()=>{this._canvas?.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?`none`:`block`}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange(`overviewRulerWidth`,(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){let e=Math.floor(this._canvas.width/3),t=Math.ceil(this._canvas.width/3);u.full=this._canvas.width,u.left=e,u.center=t,u.right=e,this._refreshDrawHeightConstants(),d.full=0,d.left=0,d.center=u.left,d.right=u.left+u.center}_refreshDrawHeightConstants(){l.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);l.left=t,l.center=t,l.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let e of this._decorationService.decorations)this._colorZoneStore.addDecoration(e);this._ctx.lineWidth=1;let e=this._colorZoneStore.zones;for(let t of e)t.position!==`full`&&this._renderColorZone(t);for(let t of e)t.position===`full`&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(d[e.position||`full`],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-l[e.position||`full`]/2),u[e.position||`full`],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+l[e.position||`full`]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};t.OverviewRulerRenderer=f=r([i(2,c.IBufferService),i(3,c.IDecorationService),i(4,o.IRenderService),i(5,c.IOptionsService),i(6,o.ICoreBrowserService)],f)},2950:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.CompositionHelper=void 0;let a=n(4725),o=n(2585),s=n(2584),c=t.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(e,t,n,r,i,a){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=i,this._renderService=a,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=``}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent=``,this._dataAlreadySent=``,this._compositionView.classList.add(`active`)}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(e){if(this._compositionView.classList.remove(`active`),this._isComposing=!1,e){let e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let t;this._isSendingComposition=!1,e.start+=this._dataAlreadySent.length,t=this._isComposing?this._textarea.value.substring(e.start,e.end):this._textarea.value.substring(e.start),t.length>0&&this._coreService.triggerDataEvent(t,!0)}}),0)}else{this._isSendingComposition=!1;let e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout((()=>{if(!this._isComposing){let t=this._textarea.value,n=t.replace(e,``);this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.length<e.length?this._coreService.triggerDataEvent(`${s.C0.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}}),0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),t=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,r=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=r+`px`,this._compositionView.style.top=n+`px`,this._compositionView.style.height=t+`px`,this._compositionView.style.lineHeight=t+`px`,this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+`px`;let i=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+`px`,this._textarea.style.top=n+`px`,this._textarea.style.width=Math.max(i.width,1)+`px`,this._textarea.style.height=Math.max(i.height,1)+`px`,this._textarea.style.lineHeight=i.height+`px`}e||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};t.CompositionHelper=c=r([i(2,o.IBufferService),i(3,o.IOptionsService),i(4,o.ICoreService),i(5,a.IRenderService)],c)},9806:(e,t)=>{function n(e,t,n){let r=n.getBoundingClientRect(),i=e.getComputedStyle(n),a=parseInt(i.getPropertyValue(`padding-left`)),o=parseInt(i.getPropertyValue(`padding-top`));return[t.clientX-r.left-a,t.clientY-r.top-o]}Object.defineProperty(t,`__esModule`,{value:!0}),t.getCoords=t.getCoordsRelativeToElement=void 0,t.getCoordsRelativeToElement=n,t.getCoords=function(e,t,r,i,a,o,s,c,l){if(!o)return;let u=n(e,t,r);return u?(u[0]=Math.ceil((u[0]+(l?s/2:0))/s),u[1]=Math.ceil(u[1]/c),u[0]=Math.min(Math.max(u[0],1),i+ +!!l),u[1]=Math.min(Math.max(u[1],1),a),u):void 0}},9504:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.moveToCellSequence=void 0;let r=n(2584);function i(e,t,n,r){let i=e-a(e,n),s=t-a(t,n);return l(Math.abs(i-s)-function(e,t,n){let r=0,i=e-a(e,n),s=t-a(t,n);for(let a=0;a<Math.abs(i-s);a++){let s=o(e,t)===`A`?-1:1;n.buffer.lines.get(i+s*a)?.isWrapped&&r++}return r}(e,t,n),c(o(e,t),r))}function a(e,t){let n=0,r=t.buffer.lines.get(e),i=r?.isWrapped;for(;i&&e>=0&&e<t.rows;)n++,r=t.buffer.lines.get(--e),i=r?.isWrapped;return n}function o(e,t){return e>t?`A`:`B`}function s(e,t,n,r,i,a){let o=e,s=t,c=``;for(;o!==n||s!==r;)o+=i?1:-1,i&&o>a.cols-1?(c+=a.buffer.translateBufferLineToString(s,!1,e,o),o=0,e=0,s++):!i&&o<0&&(c+=a.buffer.translateBufferLineToString(s,!1,0,e+1),o=a.cols-1,e=o,s--);return c+a.buffer.translateBufferLineToString(s,!1,e,o)}function c(e,t){let n=t?`O`:`[`;return r.C0.ESC+n+e}function l(e,t){e=Math.floor(e);let n=``;for(let r=0;r<e;r++)n+=t;return n}t.moveToCellSequence=function(e,t,n,r){let o=n.buffer.x,u=n.buffer.y;if(!n.buffer.hasScrollback)return function(e,t,n,r,o,u){return i(t,r,o,u).length===0?``:l(s(e,t,e,t-a(t,o),!1,o).length,c(`D`,u))}(o,u,0,t,n,r)+i(u,t,n,r)+function(e,t,n,r,o,u){let d;d=i(t,r,o,u).length>0?r-a(r,o):t;let f=r,p=function(e,t,n,r,o,s){let c;return c=i(n,r,o,s).length>0?r-a(r,o):t,e<n&&c<=r||e>=n&&c<r?`C`:`D`}(e,t,n,r,o,u);return l(s(e,d,n,f,p===`C`,o).length,c(p,u))}(o,u,e,t,n,r);let d;if(u===t)return d=o>e?`D`:`C`,l(Math.abs(o-e),c(d,r));d=u>t?`D`:`C`;let f=Math.abs(u-t);return l(function(e,t){return t.cols-e}(u>t?e:o,n)+(f-1)*n.cols+1+((u>t?o:e)-1),c(d,r))}},1296:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.DomRenderer=void 0;let a=n(3787),o=n(2550),s=n(2223),c=n(6171),l=n(6052),u=n(4725),d=n(8055),f=n(8460),p=n(844),m=n(2585),h=`xterm-dom-renderer-owner-`,g=`xterm-rows`,_=`xterm-fg-`,v=`xterm-bg-`,y=`xterm-focus`,b=`xterm-selection`,x=1,S=t.DomRenderer=class extends p.Disposable{constructor(e,t,n,r,i,s,u,d,m,_,v,y,S){super(),this._terminal=e,this._document=t,this._element=n,this._screenElement=r,this._viewportElement=i,this._helperContainer=s,this._linkifier2=u,this._charSizeService=m,this._optionsService=_,this._bufferService=v,this._coreBrowserService=y,this._themeService=S,this._terminalClass=x++,this._rowElements=[],this._selectionRenderModel=(0,l.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new f.EventEmitter).event,this._rowContainer=this._document.createElement(`div`),this._rowContainer.classList.add(g),this._rowContainer.style.lineHeight=`normal`,this._rowContainer.setAttribute(`aria-hidden`,`true`),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement(`div`),this._selectionContainer.classList.add(b),this._selectionContainer.setAttribute(`aria-hidden`,`true`),this.dimensions=(0,c.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((e=>this._injectCss(e)))),this._injectCss(this._themeService.colors),this._rowFactory=d.createInstance(a.DomRendererRowFactory,document),this._element.classList.add(h+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((e=>this._handleLinkHover(e)))),this.register(this._linkifier2.onHideLinkUnderline((e=>this._handleLinkLeave(e)))),this.register((0,p.toDisposable)((()=>{this._element.classList.remove(h+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new o.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let e of this._rowElements)e.style.width=`${this.dimensions.css.canvas.width}px`,e.style.height=`${this.dimensions.css.cell.height}px`,e.style.lineHeight=`${this.dimensions.css.cell.height}px`,e.style.overflow=`hidden`;this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement(`style`),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${g} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement(`style`),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${g} { color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${g} .xterm-dim { color: ${d.color.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let n=`blink_underline_${this._terminalClass}`,r=`blink_bar_${this._terminalClass}`,i=`blink_block_${this._terminalClass}`;t+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${r} { 50% { box-shadow: none; }}`,t+=`@keyframes ${i} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${g}.${y} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${g}.${y} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${g}.${y} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${g} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${b} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${b} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${b} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[n,r]of e.ansi.entries())t+=`${this._terminalSelector} .${_}${n} { color: ${r.css}; }${this._terminalSelector} .${_}${n}.xterm-dim { color: ${d.color.multiplyOpacity(r,.5).css}; }${this._terminalSelector} .${v}${n} { background-color: ${r.css}; }`;t+=`${this._terminalSelector} .${_}${s.INVERTED_DEFAULT_COLOR} { color: ${d.color.opaque(e.background).css}; }${this._terminalSelector} .${_}${s.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${d.color.multiplyOpacity(d.color.opaque(e.background),.5).css}; }${this._terminalSelector} .${v}${s.INVERTED_DEFAULT_COLOR} { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get(`W`,!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let e=this._rowElements.length;e<=t;e++){let e=this._document.createElement(`div`);this._rowContainer.appendChild(e),this._rowElements.push(e)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(y),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(y),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,n),this.renderRows(0,this._bufferService.rows-1),!e||!t)return;this._selectionRenderModel.update(this._terminal,e,t,n);let r=this._selectionRenderModel.viewportStartRow,i=this._selectionRenderModel.viewportEndRow,a=this._selectionRenderModel.viewportCappedStartRow,o=this._selectionRenderModel.viewportCappedEndRow;if(a>=this._bufferService.rows||o<0)return;let s=this._document.createDocumentFragment();if(n){let n=e[0]>t[0];s.appendChild(this._createSelectionElement(a,n?t[0]:e[0],n?e[0]:t[0],o-a+1))}else{let n=r===a?e[0]:0,c=a===i?t[0]:this._bufferService.cols;s.appendChild(this._createSelectionElement(a,n,c));let l=o-a-1;if(s.appendChild(this._createSelectionElement(a+1,0,this._bufferService.cols,l)),a!==o){let e=i===o?t[0]:this._bufferService.cols;s.appendChild(this._createSelectionElement(o,0,e))}}this._selectionContainer.appendChild(s)}_createSelectionElement(e,t,n,r=1){let i=this._document.createElement(`div`),a=t*this.dimensions.css.cell.width,o=this.dimensions.css.cell.width*(n-t);return a+o>this.dimensions.css.canvas.width&&(o=this.dimensions.css.canvas.width-a),i.style.height=r*this.dimensions.css.cell.height+`px`,i.style.top=e*this.dimensions.css.cell.height+`px`,i.style.left=`${a}px`,i.style.width=`${o}px`,i}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let n=this._bufferService.buffer,r=n.ybase+n.y,i=Math.min(n.x,this._bufferService.cols-1),a=this._optionsService.rawOptions.cursorBlink,o=this._optionsService.rawOptions.cursorStyle,s=this._optionsService.rawOptions.cursorInactiveStyle;for(let c=e;c<=t;c++){let e=c+n.ydisp,t=this._rowElements[c],l=n.lines.get(e);if(!t||!l)break;t.replaceChildren(...this._rowFactory.createRow(l,e,e===r,o,s,i,a,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${h}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,n,r,i,a){n<0&&(e=0),r<0&&(t=0);let o=this._bufferService.rows-1;n=Math.max(Math.min(n,o),0),r=Math.max(Math.min(r,o),0),i=Math.min(i,this._bufferService.cols);let s=this._bufferService.buffer,c=s.ybase+s.y,l=Math.min(s.x,i-1),u=this._optionsService.rawOptions.cursorBlink,d=this._optionsService.rawOptions.cursorStyle,f=this._optionsService.rawOptions.cursorInactiveStyle;for(let o=n;o<=r;++o){let p=o+s.ydisp,m=this._rowElements[o],h=s.lines.get(p);if(!m||!h)break;m.replaceChildren(...this._rowFactory.createRow(h,p,p===c,d,f,l,u,this.dimensions.css.cell.width,this._widthCache,a?o===n?e:0:-1,a?(o===r?t:i)-1:-1))}}};t.DomRenderer=S=r([i(7,m.IInstantiationService),i(8,u.ICharSizeService),i(9,m.IOptionsService),i(10,m.IBufferService),i(11,u.ICoreBrowserService),i(12,u.IThemeService)],S)},3787:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.DomRendererRowFactory=void 0;let a=n(2223),o=n(643),s=n(511),c=n(2585),l=n(8055),u=n(4725),d=n(4269),f=n(6171),p=n(3734),m=t.DomRendererRowFactory=class{constructor(e,t,n,r,i,a,o){this._document=e,this._characterJoinerService=t,this._optionsService=n,this._coreBrowserService=r,this._coreService=i,this._decorationService=a,this._themeService=o,this._workCell=new s.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,n){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=n}createRow(e,t,n,r,i,s,c,u,f,m,g){let _=[],v=this._characterJoinerService.getJoinedCharacters(t),y=this._themeService.colors,b,x=e.getNoBgTrimmedLength();n&&x<s+1&&(x=s+1);let S=0,C=``,w=0,T=0,E=0,D=!1,O=0,ee=!1,te=0,ne=[],re=m!==-1&&g!==-1;for(let k=0;k<x;k++){e.loadCell(k,this._workCell);let x=this._workCell.getWidth();if(x===0)continue;let ie=!1,ae=k,A=this._workCell;if(v.length>0&&k===v[0][0]){ie=!0;let t=v.shift();A=new d.JoinedCellData(this._workCell,e.translateToString(!0,t[0],t[1]),t[1]-t[0]),ae=t[1]-1,x=A.getWidth()}let oe=this._isCellInSelection(k,t),j=n&&k===s,se=re&&k>=m&&k<=g,ce=!1;this._decorationService.forEachDecorationAtCell(k,t,void 0,(e=>{ce=!0}));let le=A.getChars()||o.WHITESPACE_CELL_CHAR;if(le===` `&&(A.isUnderline()||A.isOverline())&&(le=`\xA0`),te=x*u-f.get(le,A.isBold(),A.isItalic()),b){if(S&&(oe&&ee||!oe&&!ee&&A.bg===w)&&(oe&&ee&&y.selectionForeground||A.fg===T)&&A.extended.ext===E&&se===D&&te===O&&!j&&!ie&&!ce){A.isInvisible()?C+=o.WHITESPACE_CELL_CHAR:C+=le,S++;continue}S&&(b.textContent=C),b=this._document.createElement(`span`),S=0,C=``}else b=this._document.createElement(`span`);if(w=A.bg,T=A.fg,E=A.extended.ext,D=se,O=te,ee=oe,ie&&s>=k&&s<=ae&&(s=k),!this._coreService.isCursorHidden&&j&&this._coreService.isCursorInitialized){if(ne.push(`xterm-cursor`),this._coreBrowserService.isFocused)c&&ne.push(`xterm-cursor-blink`),ne.push(r===`bar`?`xterm-cursor-bar`:r===`underline`?`xterm-cursor-underline`:`xterm-cursor-block`);else if(i)switch(i){case`outline`:ne.push(`xterm-cursor-outline`);break;case`block`:ne.push(`xterm-cursor-block`);break;case`bar`:ne.push(`xterm-cursor-bar`);break;case`underline`:ne.push(`xterm-cursor-underline`)}}if(A.isBold()&&ne.push(`xterm-bold`),A.isItalic()&&ne.push(`xterm-italic`),A.isDim()&&ne.push(`xterm-dim`),C=A.isInvisible()?o.WHITESPACE_CELL_CHAR:A.getChars()||o.WHITESPACE_CELL_CHAR,A.isUnderline()&&(ne.push(`xterm-underline-${A.extended.underlineStyle}`),C===` `&&(C=`\xA0`),!A.isUnderlineColorDefault()))if(A.isUnderlineColorRGB())b.style.textDecorationColor=`rgb(${p.AttributeData.toColorRGB(A.getUnderlineColor()).join(`,`)})`;else{let e=A.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&A.isBold()&&e<8&&(e+=8),b.style.textDecorationColor=y.ansi[e].css}A.isOverline()&&(ne.push(`xterm-overline`),C===` `&&(C=`\xA0`)),A.isStrikethrough()&&ne.push(`xterm-strikethrough`),se&&(b.style.textDecoration=`underline`);let ue=A.getFgColor(),de=A.getFgColorMode(),fe=A.getBgColor(),pe=A.getBgColorMode(),me=!!A.isInverse();if(me){let e=ue;ue=fe,fe=e;let t=de;de=pe,pe=t}let he,ge,_e,ve=!1;switch(this._decorationService.forEachDecorationAtCell(k,t,void 0,(e=>{e.options.layer!==`top`&&ve||(e.backgroundColorRGB&&(pe=50331648,fe=e.backgroundColorRGB.rgba>>8&16777215,he=e.backgroundColorRGB),e.foregroundColorRGB&&(de=50331648,ue=e.foregroundColorRGB.rgba>>8&16777215,ge=e.foregroundColorRGB),ve=e.options.layer===`top`)})),!ve&&oe&&(he=this._coreBrowserService.isFocused?y.selectionBackgroundOpaque:y.selectionInactiveBackgroundOpaque,fe=he.rgba>>8&16777215,pe=50331648,ve=!0,y.selectionForeground&&(de=50331648,ue=y.selectionForeground.rgba>>8&16777215,ge=y.selectionForeground)),ve&&ne.push(`xterm-decoration-top`),pe){case 16777216:case 33554432:_e=y.ansi[fe],ne.push(`xterm-bg-${fe}`);break;case 50331648:_e=l.channels.toColor(fe>>16,fe>>8&255,255&fe),this._addStyle(b,`background-color:#${h((fe>>>0).toString(16),`0`,6)}`);break;default:me?(_e=y.foreground,ne.push(`xterm-bg-${a.INVERTED_DEFAULT_COLOR}`)):_e=y.background}switch(he||A.isDim()&&(he=l.color.multiplyOpacity(_e,.5)),de){case 16777216:case 33554432:A.isBold()&&ue<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ue+=8),this._applyMinimumContrast(b,_e,y.ansi[ue],A,he,void 0)||ne.push(`xterm-fg-${ue}`);break;case 50331648:let e=l.channels.toColor(ue>>16&255,ue>>8&255,255&ue);this._applyMinimumContrast(b,_e,e,A,he,ge)||this._addStyle(b,`color:#${h(ue.toString(16),`0`,6)}`);break;default:this._applyMinimumContrast(b,_e,y.foreground,A,he,ge)||me&&ne.push(`xterm-fg-${a.INVERTED_DEFAULT_COLOR}`)}ne.length&&=(b.className=ne.join(` `),0),j||ie||ce?b.textContent=C:S++,te!==this.defaultSpacing&&(b.style.letterSpacing=`${te}px`),_.push(b),k=ae}return b&&S&&(b.textContent=C),_}_applyMinimumContrast(e,t,n,r,i,a){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,f.treatGlyphAsBackgroundColor)(r.getCode()))return!1;let o=this._getContrastCache(r),s;if(i||a||(s=o.getColor(t.rgba,n.rgba)),s===void 0){let e=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);s=l.color.ensureContrastRatio(i||t,a||n,e),o.setColor((i||t).rgba,(a||n).rgba,s??null)}return!!s&&(this._addStyle(e,`color:${s.css}`),!0)}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute(`style`,`${e.getAttribute(`style`)||``}${t};`)}_isCellInSelection(e,t){let n=this._selectionStart,r=this._selectionEnd;return!(!n||!r)&&(this._columnSelectMode?n[0]<=r[0]?e>=n[0]&&t>=n[1]&&e<r[0]&&t<=r[1]:e<n[0]&&t>=n[1]&&e>=r[0]&&t<=r[1]:t>n[1]&&t<r[1]||n[1]===r[1]&&t===n[1]&&e>=n[0]&&e<r[0]||n[1]<r[1]&&t===r[1]&&e<r[0]||n[1]<r[1]&&t===n[1]&&e>=n[0])}};function h(e,t,n){for(;e.length<n;)e=t+e;return e}t.DomRendererRowFactory=m=r([i(1,u.ICharacterJoinerService),i(2,c.IOptionsService),i(3,u.ICoreBrowserService),i(4,c.ICoreService),i(5,c.IDecorationService),i(6,u.IThemeService)],m)},2550:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.WidthCache=void 0,t.WidthCache=class{constructor(e,t){this._flat=new Float32Array(256),this._font=``,this._fontSize=0,this._weight=`normal`,this._weightBold=`bold`,this._measureElements=[],this._container=e.createElement(`div`),this._container.classList.add(`xterm-width-cache-measure-container`),this._container.setAttribute(`aria-hidden`,`true`),this._container.style.whiteSpace=`pre`,this._container.style.fontKerning=`none`;let n=e.createElement(`span`);n.classList.add(`xterm-char-measure-element`);let r=e.createElement(`span`);r.classList.add(`xterm-char-measure-element`),r.style.fontWeight=`bold`;let i=e.createElement(`span`);i.classList.add(`xterm-char-measure-element`),i.style.fontStyle=`italic`;let a=e.createElement(`span`);a.classList.add(`xterm-char-measure-element`),a.style.fontWeight=`bold`,a.style.fontStyle=`italic`,this._measureElements=[n,r,i,a],this._container.appendChild(n),this._container.appendChild(r),this._container.appendChild(i),this._container.appendChild(a),t.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,t,n,r){e===this._font&&t===this._fontSize&&n===this._weight&&r===this._weightBold||(this._font=e,this._fontSize=t,this._weight=n,this._weightBold=r,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${r}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${r}`,this.clear())}get(e,t,n){let r=0;if(!t&&!n&&e.length===1&&(r=e.charCodeAt(0))<256){if(this._flat[r]!==-9999)return this._flat[r];let t=this._measure(e,0);return t>0&&(this._flat[r]=t),t}let i=e;t&&(i+=`B`),n&&(i+=`I`);let a=this._holey.get(i);if(a===void 0){let r=0;t&&(r|=1),n&&(r|=2),a=this._measure(e,r),a>0&&this._holey.set(i,a)}return a}_measure(e,t){let n=this._measureElements[t];return n.textContent=e.repeat(32),n.offsetWidth/32}}},2223:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;let r=n(6114);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=r.isFirefox||r.isLegacyEdge?`bottom`:`ideographic`},6171:(e,t)=>{function n(e){return 57508<=e&&e<=57558}function r(e){return e>=128512&&e<=128591||e>=127744&&e<=128511||e>=128640&&e<=128767||e>=9728&&e<=9983||e>=9984&&e<=10175||e>=65024&&e<=65039||e>=129280&&e<=129535||e>=127462&&e<=127487}Object.defineProperty(t,`__esModule`,{value:!0}),t.computeNextVariantOffset=t.createRenderDimensions=t.treatGlyphAsBackgroundColor=t.allowRescaling=t.isEmoji=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(e){if(!e)throw Error(`value must not be falsy`);return e},t.isPowerlineGlyph=n,t.isRestrictedPowerlineGlyph=function(e){return 57520<=e&&e<=57527},t.isEmoji=r,t.allowRescaling=function(e,t,i,a){return t===1&&i>Math.ceil(1.5*a)&&e!==void 0&&e>255&&!r(e)&&!n(e)&&!function(e){return 57344<=e&&e<=63743}(e)},t.treatGlyphAsBackgroundColor=function(e){return n(e)||function(e){return 9472<=e&&e<=9631}(e)},t.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},t.computeNextVariantOffset=function(e,t,n=0){return(e-(2*Math.round(t)-n))%(2*Math.round(t))}},6052:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.createSelectionRenderModel=void 0;class n{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,n,r=!1){if(this.selectionStart=t,this.selectionEnd=n,!t||!n||t[0]===n[0]&&t[1]===n[1])return void this.clear();let i=e.buffers.active.ydisp,a=t[1]-i,o=n[1]-i,s=Math.max(a,0),c=Math.min(o,e.rows-1);s>=e.rows||c<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=a,this.viewportEndRow=o,this.viewportCappedStartRow=s,this.viewportCappedEndRow=c,this.startCol=t[0],this.endCol=n[0])}isCellSelected(e,t,n){return!!this.hasSelection&&(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&n>=this.viewportCappedStartRow&&t<this.endCol&&n<=this.viewportCappedEndRow:t<this.startCol&&n>=this.viewportCappedStartRow&&t>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol)}}t.createSelectionRenderModel=function(){return new n}},456:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.SelectionModel=void 0,t.SelectionModel=class{constructor(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!(!e||!t)&&(e[1]>t[1]||e[1]===t[1]&&e[0]>t[0])}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.CharSizeService=void 0;let a=n(2585),o=n(8460),s=n(844),c=t.CharSizeService=class extends s.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this.register(new o.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new d(this._optionsService))}catch{this._measureStrategy=this.register(new u(e,t,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange([`fontFamily`,`fontSize`],(()=>this.measure())))}measure(){let e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};t.CharSizeService=c=r([i(2,a.IOptionsService)],c);class l extends s.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}}class u extends l{constructor(e,t,n){super(),this._document=e,this._parentElement=t,this._optionsService=n,this._measureElement=this._document.createElement(`span`),this._measureElement.classList.add(`xterm-char-measure-element`),this._measureElement.textContent=`W`.repeat(32),this._measureElement.setAttribute(`aria-hidden`,`true`),this._measureElement.style.whiteSpace=`pre`,this._measureElement.style.fontKerning=`none`,this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class d extends l{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext(`2d`);let t=this._ctx.measureText(`W`);if(!(`width`in t&&`fontBoundingBoxAscent`in t&&`fontBoundingBoxDescent`in t))throw Error(`Required font metrics not supported`)}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText(`W`);return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}}},4269:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.CharacterJoinerService=t.JoinedCellData=void 0;let a=n(3734),o=n(643),s=n(511),c=n(2585);class l extends a.AttributeData{constructor(e,t,n){super(),this.content=0,this.combinedData=``,this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw Error(`not implemented`)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.JoinedCellData=l;let u=t.CharacterJoinerService=class e{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new s.CellData}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let n=[],r=t.translateToString(!0),i=0,a=0,s=0,c=t.getFg(0),l=t.getBg(0);for(let e=0;e<t.getTrimmedLength();e++)if(t.loadCell(e,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==c||this._workCell.bg!==l){if(e-i>1){let e=this._getJoinedRanges(r,s,a,t,i);for(let t=0;t<e.length;t++)n.push(e[t])}i=e,s=a,c=this._workCell.fg,l=this._workCell.bg}a+=this._workCell.getChars().length||o.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-i>1){let e=this._getJoinedRanges(r,s,a,t,i);for(let t=0;t<e.length;t++)n.push(e[t])}return n}_getJoinedRanges(t,n,r,i,a){let o=t.substring(n,r),s=[];try{s=this._characterJoiners[0].handler(o)}catch(e){console.error(e)}for(let t=1;t<this._characterJoiners.length;t++)try{let n=this._characterJoiners[t].handler(o);for(let t=0;t<n.length;t++)e._mergeRanges(s,n[t])}catch(e){console.error(e)}return this._stringRangesToCellRanges(s,i,a),s}_stringRangesToCellRanges(e,t,n){let r=0,i=!1,a=0,s=e[r];if(s){for(let c=n;c<this._bufferService.cols;c++){let n=t.getWidth(c),l=t.getString(c).length||o.WHITESPACE_CELL_CHAR.length;if(n!==0){if(!i&&s[0]<=a&&(s[0]=c,i=!0),s[1]<=a){if(s[1]=c,s=e[++r],!s)break;s[0]<=a?(s[0]=c,i=!0):i=!1}a+=l}}s&&(s[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(n){if(t[1]<=i[0])return e[r-1][1]=t[1],e;if(t[1]<=i[1])return e[r-1][1]=Math.max(t[1],i[1]),e.splice(r,1),e;e.splice(r,1),r--}else{if(t[1]<=i[0])return e.splice(r,0,t),e;if(t[1]<=i[1])return i[0]=Math.min(t[0],i[0]),e;t[0]<i[1]&&(i[0]=Math.min(t[0],i[0]),n=!0)}}return n?e[e.length-1][1]=t[1]:e.push(t),e}};t.CharacterJoinerService=u=r([i(0,c.IBufferService)],u)},5114:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.CoreBrowserService=void 0;let r=n(844),i=n(8460),a=n(3656);class o extends r.Disposable{constructor(e,t,n){super(),this._textarea=e,this._window=t,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new s(this._window),this._onDprChange=this.register(new i.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new i.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((e=>this._screenDprMonitor.setWindow(e)))),this.register((0,i.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener(`focus`,(()=>this._isFocused=!0)),this._textarea.addEventListener(`blur`,(()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}t.CoreBrowserService=o;class s extends r.Disposable{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this.register(new r.MutableDisposable),this._onDprChange=this.register(new i.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,r.toDisposable)((()=>this.clearListener())))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,a.addDisposableDomListener)(this._parentWindow,`resize`,(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.LinkProviderService=void 0;let r=n(844);class i extends r.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,r.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}}t.LinkProviderService=i},8934:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.MouseService=void 0;let a=n(4725),o=n(9806),s=t.MouseService=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,r,i){return(0,o.getCoords)(window,e,t,n,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,i)}getMouseReportCoords(e,t){let n=(0,o.getCoordsRelativeToElement)(window,e,t);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};t.MouseService=s=r([i(0,a.IRenderService),i(1,a.ICharSizeService)],s)},3230:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.RenderService=void 0;let a=n(6193),o=n(4725),s=n(8460),c=n(844),l=n(7226),u=n(2585),d=t.RenderService=class extends c.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(e,t,n,r,i,o,u,d){super(),this._rowCount=e,this._charSizeService=r,this._renderer=this.register(new c.MutableDisposable),this._pausedResizeTask=new l.DebouncedIdleTask,this._observerDisposable=this.register(new c.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new s.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new s.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new s.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new s.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new a.RenderDebouncer(((e,t)=>this._renderRows(e,t)),u),this.register(this._renderDebouncer),this.register(u.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(o.onResize((()=>this._fullRefresh()))),this.register(o.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(n.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(i.onDecorationRegistered((()=>this._fullRefresh()))),this.register(i.onDecorationRemoved((()=>this._fullRefresh()))),this.register(n.onMultipleOptionChange([`customGlyphs`,`drawBoldTextInBrightColors`,`letterSpacing`,`lineHeight`,`fontFamily`,`fontSize`,`fontWeight`,`fontWeightBold`,`minimumContrastRatio`,`rescaleOverlappingGlyphs`],(()=>{this.clear(),this.handleResize(o.cols,o.rows),this._fullRefresh()}))),this.register(n.onMultipleOptionChange([`cursorBlink`,`cursorStyle`],(()=>this.refreshRows(o.buffer.y,o.buffer.y,!0)))),this.register(d.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(u.window,t),this.register(u.onWindowChange((e=>this._registerIntersectionObserver(e,t))))}_registerIntersectionObserver(e,t){if(`IntersectionObserver`in e){let n=new e.IntersectionObserver((e=>this._handleIntersectionChange(e[e.length-1])),{threshold:0});n.observe(t),this._observerDisposable.value=(0,c.toDisposable)((()=>n.disconnect()))}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,n=!1){this._isPaused?this._needsFullRefresh=!0:(n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount))}_renderRows(e,t){this._renderer.value&&(e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&=(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0)}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw((e=>this.refreshRows(e.start,e.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(e,t))):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,t,n){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=n,this._renderer.value?.handleSelectionChanged(e,t,n)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};t.RenderService=d=r([i(2,u.IOptionsService),i(3,o.ICharSizeService),i(4,u.IDecorationService),i(5,u.IBufferService),i(6,o.ICoreBrowserService),i(7,o.IThemeService)],d)},9312:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.SelectionService=void 0;let a=n(9806),o=n(9504),s=n(456),c=n(4725),l=n(8460),u=n(844),d=n(6114),f=n(4841),p=n(511),m=n(2585),h=RegExp(`\xA0`,`g`),g=t.SelectionService=class extends u.Disposable{constructor(e,t,n,r,i,a,o,c,d){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=r,this._coreService=i,this._mouseService=a,this._optionsService=o,this._renderService=c,this._coreBrowserService=d,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new p.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new l.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new l.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new l.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new l.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=e=>this._handleMouseMove(e),this._mouseUpListener=e=>this._handleMouseUp(e),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((e=>this._handleTrim(e))),this.register(this._bufferService.buffers.onBufferActivate((e=>this._handleBufferActivate(e)))),this.enable(),this._model=new s.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,u.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!(!e||!t||e[0]===t[0]&&e[1]===t[1])}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return``;let n=this._bufferService.buffer,r=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return``;let i=e[0]<t[0]?e[0]:t[0],a=e[0]<t[0]?t[0]:e[0];for(let o=e[1];o<=t[1];o++){let e=n.translateBufferLineToString(o,!0,i,a);r.push(e)}}else{let i=e[1]===t[1]?t[0]:void 0;r.push(n.translateBufferLineToString(e[1],!0,e[0],i));for(let i=e[1]+1;i<=t[1]-1;i++){let e=n.lines.get(i),t=n.translateBufferLineToString(i,!0);e?.isWrapped?r[r.length-1]+=t:r.push(t)}if(e[1]!==t[1]){let e=n.lines.get(t[1]),i=n.translateBufferLineToString(t[1],!0,0,t[0]);e&&e.isWrapped?r[r.length-1]+=i:r.push(i)}}return r.map((e=>e.replace(h,` `))).join(d.isWindows?`\r
349
+ `:`
350
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh())),d.isLinux&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!!(n&&r&&t)&&this._areCoordsInSelection(t,n,r)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!(!n||!r)&&this._areCoordsInSelection([e,t],n,r)}_areCoordsInSelection(e,t,n){return e[1]>t[1]&&e[1]<n[1]||t[1]===n[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<n[0]||t[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||t[1]<n[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let n=this._linkifier.currentLink?.link?.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=(0,f.getRangeLength)(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return!!r&&(this._selectWordAt(r,t),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=(0,a.getCoordsRelativeToElement)(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=n?0:(t>n&&(t-=n),t=Math.min(Math.max(t,-50),50),t/=50,t/Math.abs(t)+Math.round(14*t))}shouldForceSelection(e){return d.isMac?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,(e.button!==2||!this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener(`mousemove`,this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener(`mouseup`,this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener(`mousemove`,this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener(`mouseup`,this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(d.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let n=this._bufferService.buffer;if(this._model.selectionEnd[1]<n.lines.length){let e=n.lines.get(this._model.selectionEnd[1]);e&&e.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}t&&t[0]===this._model.selectionEnd[0]&&t[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<500&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let t=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(t&&t[0]!==void 0&&t[1]!==void 0){let e=(0,o.moveToCellSequence)(t[0]-1,t[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(e,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,n=!(!e||!t||e[0]===t[0]&&e[1]===t[1]);n?e&&t&&(this._oldSelectionStart&&this._oldSelectionEnd&&e[0]===this._oldSelectionStart[0]&&e[1]===this._oldSelectionStart[1]&&t[0]===this._oldSelectionEnd[0]&&t[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(e,t,n)):this._oldHasSelection&&this._fireOnSelectionChange(e,t,n)}_fireOnSelectionChange(e,t,n){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=n,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim((e=>this._handleTrim(e)))}_convertViewportColToCharacterIndex(e,t){let n=t;for(let r=0;t>=r;r++){let i=e.loadCell(r,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:i>1&&t!==r&&(n+=i-1)}return n}setSelection(e,t,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,n=!0,r=!0){if(e[0]>=this._bufferService.cols)return;let i=this._bufferService.buffer,a=i.lines.get(e[1]);if(!a)return;let o=i.translateBufferLineToString(e[1],!1),s=this._convertViewportColToCharacterIndex(a,e[0]),c=s,l=e[0]-s,u=0,d=0,f=0,p=0;if(o.charAt(s)===` `){for(;s>0&&o.charAt(s-1)===` `;)s--;for(;c<o.length&&o.charAt(c+1)===` `;)c++}else{let t=e[0],n=e[0];a.getWidth(t)===0&&(u++,t--),a.getWidth(n)===2&&(d++,n++);let r=a.getString(n).length;for(r>1&&(p+=r-1,c+=r-1);t>0&&s>0&&!this._isCharWordSeparator(a.loadCell(t-1,this._workCell));){a.loadCell(t-1,this._workCell);let e=this._workCell.getChars().length;this._workCell.getWidth()===0?(u++,t--):e>1&&(f+=e-1,s-=e-1),s--,t--}for(;n<a.length&&c+1<o.length&&!this._isCharWordSeparator(a.loadCell(n+1,this._workCell));){a.loadCell(n+1,this._workCell);let e=this._workCell.getChars().length;this._workCell.getWidth()===2?(d++,n++):e>1&&(p+=e-1,c+=e-1),c++,n++}}c++;let m=s+l-u+f,h=Math.min(this._bufferService.cols,c-s+u+d-f-p);if(t||o.slice(s,c).trim()!==``){if(n&&m===0&&a.getCodePoint(0)!==32){let t=i.lines.get(e[1]-1);if(t&&a.isWrapped&&t.getCodePoint(this._bufferService.cols-1)!==32){let t=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(t){let e=this._bufferService.cols-t.start;m-=e,h+=e}}}if(r&&m+h===this._bufferService.cols&&a.getCodePoint(this._bufferService.cols-1)!==32){let t=i.lines.get(e[1]+1);if(t?.isWrapped&&t.getCodePoint(0)!==32){let t=this._getWordAt([0,e[1]+1],!1,!1,!0);t&&(h+=t.length)}}return{start:m,length:h}}}_selectWordAt(e,t){let n=this._getWordAt(e,t);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[n.start,e[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let n=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,n]}}_isCharWordSeparator(e){return e.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),n={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,f.getRangeLength)(n,this._bufferService.cols)}};t.SelectionService=g=r([i(3,m.IBufferService),i(4,m.ICoreService),i(5,c.IMouseService),i(6,m.IOptionsService),i(7,c.IRenderService),i(8,c.ICoreBrowserService)],g)},4725:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.ILinkProviderService=t.IThemeService=t.ICharacterJoinerService=t.ISelectionService=t.IRenderService=t.IMouseService=t.ICoreBrowserService=t.ICharSizeService=void 0;let r=n(8343);t.ICharSizeService=(0,r.createDecorator)(`CharSizeService`),t.ICoreBrowserService=(0,r.createDecorator)(`CoreBrowserService`),t.IMouseService=(0,r.createDecorator)(`MouseService`),t.IRenderService=(0,r.createDecorator)(`RenderService`),t.ISelectionService=(0,r.createDecorator)(`SelectionService`),t.ICharacterJoinerService=(0,r.createDecorator)(`CharacterJoinerService`),t.IThemeService=(0,r.createDecorator)(`ThemeService`),t.ILinkProviderService=(0,r.createDecorator)(`LinkProviderService`)},6731:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.ThemeService=t.DEFAULT_ANSI_COLORS=void 0;let a=n(7239),o=n(8055),s=n(8460),c=n(844),l=n(2585),u=o.css.toColor(`#ffffff`),d=o.css.toColor(`#000000`),f=o.css.toColor(`#ffffff`),p=o.css.toColor(`#000000`),m={css:`rgba(255, 255, 255, 0.3)`,rgba:4294967117};t.DEFAULT_ANSI_COLORS=Object.freeze((()=>{let e=[o.css.toColor(`#2e3436`),o.css.toColor(`#cc0000`),o.css.toColor(`#4e9a06`),o.css.toColor(`#c4a000`),o.css.toColor(`#3465a4`),o.css.toColor(`#75507b`),o.css.toColor(`#06989a`),o.css.toColor(`#d3d7cf`),o.css.toColor(`#555753`),o.css.toColor(`#ef2929`),o.css.toColor(`#8ae234`),o.css.toColor(`#fce94f`),o.css.toColor(`#729fcf`),o.css.toColor(`#ad7fa8`),o.css.toColor(`#34e2e2`),o.css.toColor(`#eeeeec`)],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let r=t[n/36%6|0],i=t[n/6%6|0],a=t[n%6];e.push({css:o.channels.toCss(r,i,a),rgba:o.channels.toRgba(r,i,a)})}for(let t=0;t<24;t++){let n=8+10*t;e.push({css:o.channels.toCss(n,n,n),rgba:o.channels.toRgba(n,n,n)})}return e})());let h=t.ThemeService=class extends c.Disposable{get colors(){return this._colors}constructor(e){super(),this._optionsService=e,this._contrastCache=new a.ColorContrastCache,this._halfContrastCache=new a.ColorContrastCache,this._onChangeColors=this.register(new s.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:u,background:d,cursor:f,cursorAccent:p,selectionForeground:void 0,selectionBackgroundTransparent:m,selectionBackgroundOpaque:o.color.blend(d,m),selectionInactiveBackgroundTransparent:m,selectionInactiveBackgroundOpaque:o.color.blend(d,m),ansi:t.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange(`minimumContrastRatio`,(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange(`theme`,(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(e={}){let n=this._colors;if(n.foreground=g(e.foreground,u),n.background=g(e.background,d),n.cursor=g(e.cursor,f),n.cursorAccent=g(e.cursorAccent,p),n.selectionBackgroundTransparent=g(e.selectionBackground,m),n.selectionBackgroundOpaque=o.color.blend(n.background,n.selectionBackgroundTransparent),n.selectionInactiveBackgroundTransparent=g(e.selectionInactiveBackground,n.selectionBackgroundTransparent),n.selectionInactiveBackgroundOpaque=o.color.blend(n.background,n.selectionInactiveBackgroundTransparent),n.selectionForeground=e.selectionForeground?g(e.selectionForeground,o.NULL_COLOR):void 0,n.selectionForeground===o.NULL_COLOR&&(n.selectionForeground=void 0),o.color.isOpaque(n.selectionBackgroundTransparent)&&(n.selectionBackgroundTransparent=o.color.opacity(n.selectionBackgroundTransparent,.3)),o.color.isOpaque(n.selectionInactiveBackgroundTransparent)&&(n.selectionInactiveBackgroundTransparent=o.color.opacity(n.selectionInactiveBackgroundTransparent,.3)),n.ansi=t.DEFAULT_ANSI_COLORS.slice(),n.ansi[0]=g(e.black,t.DEFAULT_ANSI_COLORS[0]),n.ansi[1]=g(e.red,t.DEFAULT_ANSI_COLORS[1]),n.ansi[2]=g(e.green,t.DEFAULT_ANSI_COLORS[2]),n.ansi[3]=g(e.yellow,t.DEFAULT_ANSI_COLORS[3]),n.ansi[4]=g(e.blue,t.DEFAULT_ANSI_COLORS[4]),n.ansi[5]=g(e.magenta,t.DEFAULT_ANSI_COLORS[5]),n.ansi[6]=g(e.cyan,t.DEFAULT_ANSI_COLORS[6]),n.ansi[7]=g(e.white,t.DEFAULT_ANSI_COLORS[7]),n.ansi[8]=g(e.brightBlack,t.DEFAULT_ANSI_COLORS[8]),n.ansi[9]=g(e.brightRed,t.DEFAULT_ANSI_COLORS[9]),n.ansi[10]=g(e.brightGreen,t.DEFAULT_ANSI_COLORS[10]),n.ansi[11]=g(e.brightYellow,t.DEFAULT_ANSI_COLORS[11]),n.ansi[12]=g(e.brightBlue,t.DEFAULT_ANSI_COLORS[12]),n.ansi[13]=g(e.brightMagenta,t.DEFAULT_ANSI_COLORS[13]),n.ansi[14]=g(e.brightCyan,t.DEFAULT_ANSI_COLORS[14]),n.ansi[15]=g(e.brightWhite,t.DEFAULT_ANSI_COLORS[15]),e.extendedAnsi){let r=Math.min(n.ansi.length-16,e.extendedAnsi.length);for(let i=0;i<r;i++)n.ansi[i+16]=g(e.extendedAnsi[i],t.DEFAULT_ANSI_COLORS[i+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e!==void 0)switch(e){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[e]=this._restoreColors.ansi[e]}else for(let e=0;e<this._restoreColors.ansi.length;++e)this._colors.ansi[e]=this._restoreColors.ansi[e]}modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function g(e,t){if(e!==void 0)try{return o.css.toColor(e)}catch{}return t}t.ThemeService=h=r([i(0,l.IOptionsService)],h)},6349:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.CircularList=void 0;let r=n(8460),i=n(844);class a extends i.Disposable{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this.register(new r.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new r.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new r.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=Array(e);for(let n=0;n<Math.min(e,this.length);n++)t[n]=this._array[this._getCyclicIndex(n)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw Error(`Can only recycle when the buffer is full`);return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,t,...n){if(t){for(let n=e;n<this._length-t;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let t=this._length-1;t>=e;t--)this._array[this._getCyclicIndex(t+n.length)]=this._array[this._getCyclicIndex(t)];for(let t=0;t<n.length;t++)this._array[this._getCyclicIndex(e+t)]=n[t];if(n.length&&this.onInsertEmitter.fire({index:e,amount:n.length}),this._length+n.length>this._maxLength){let e=this._length+n.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=n.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,n){if(!(t<=0)){if(e<0||e>=this._length)throw Error(`start argument out of range`);if(e+n<0)throw Error(`Cannot shift elements in list beyond index 0`);if(n>0){for(let r=t-1;r>=0;r--)this.set(e+r+n,this.get(e+r));let r=e+t+n-this._length;if(r>0)for(this._length+=r;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let r=0;r<t;r++)this.set(e+r+n,this.get(e+r))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}}t.CircularList=a},1439:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.clone=void 0,t.clone=function e(t,n=5){if(typeof t!=`object`)return t;let r=Array.isArray(t)?[]:{};for(let i in t)r[i]=n<=1?t[i]:t[i]&&e(t[i],n-1);return r}},8055:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=t.NULL_COLOR=void 0;let n=0,r=0,i=0,a=0;var o,s,c,l,u;function d(e){let t=e.toString(16);return t.length<2?`0`+t:t}function f(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}t.NULL_COLOR={css:`#00000000`,rgba:0},function(e){e.toCss=function(e,t,n,r){return r===void 0?`#${d(e)}${d(t)}${d(n)}`:`#${d(e)}${d(t)}${d(n)}${d(r)}`},e.toRgba=function(e,t,n,r=255){return(e<<24|t<<16|n<<8|r)>>>0},e.toColor=function(t,n,r,i){return{css:e.toCss(t,n,r,i),rgba:e.toRgba(t,n,r,i)}}}(o||(t.channels=o={})),function(e){function t(e,t){return a=Math.round(255*t),[n,r,i]=u.toChannels(e.rgba),{css:o.toCss(n,r,i,a),rgba:o.toRgba(n,r,i,a)}}e.blend=function(e,t){if(a=(255&t.rgba)/255,a===1)return{css:t.css,rgba:t.rgba};let s=t.rgba>>24&255,c=t.rgba>>16&255,l=t.rgba>>8&255,u=e.rgba>>24&255,d=e.rgba>>16&255,f=e.rgba>>8&255;return n=u+Math.round((s-u)*a),r=d+Math.round((c-d)*a),i=f+Math.round((l-f)*a),{css:o.toCss(n,r,i),rgba:o.toRgba(n,r,i)}},e.isOpaque=function(e){return(255&e.rgba)==255},e.ensureContrastRatio=function(e,t,n){let r=u.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return o.toColor(r>>24&255,r>>16&255,r>>8&255)},e.opaque=function(e){let t=(255|e.rgba)>>>0;return[n,r,i]=u.toChannels(t),{css:o.toCss(n,r,i),rgba:t}},e.opacity=t,e.multiplyOpacity=function(e,n){return a=255&e.rgba,t(e,a*n/255)},e.toColorRGB=function(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}}(s||(t.color=s={})),function(e){let t,s;try{let e=document.createElement(`canvas`);e.width=1,e.height=1;let n=e.getContext(`2d`,{willReadFrequently:!0});n&&(t=n,t.globalCompositeOperation=`copy`,s=t.createLinearGradient(0,0,1,1))}catch{}e.toColor=function(e){if(e.match(/#[\da-f]{3,8}/i))switch(e.length){case 4:return n=parseInt(e.slice(1,2).repeat(2),16),r=parseInt(e.slice(2,3).repeat(2),16),i=parseInt(e.slice(3,4).repeat(2),16),o.toColor(n,r,i);case 5:return n=parseInt(e.slice(1,2).repeat(2),16),r=parseInt(e.slice(2,3).repeat(2),16),i=parseInt(e.slice(3,4).repeat(2),16),a=parseInt(e.slice(4,5).repeat(2),16),o.toColor(n,r,i,a);case 7:return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0};case 9:return{css:e,rgba:parseInt(e.slice(1),16)>>>0}}let c=e.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(c)return n=parseInt(c[1]),r=parseInt(c[2]),i=parseInt(c[3]),a=Math.round(255*(c[5]===void 0?1:parseFloat(c[5]))),o.toColor(n,r,i,a);if(!t||!s||(t.fillStyle=s,t.fillStyle=e,typeof t.fillStyle!=`string`)||(t.fillRect(0,0,1,1),[n,r,i,a]=t.getImageData(0,0,1,1).data,a!==255))throw Error(`css.toColor: Unsupported css format`);return{rgba:o.toRgba(n,r,i,a),css:e}}}(c||(t.css=c={})),function(e){function t(e,t,n){let r=e/255,i=t/255,a=n/255;return .2126*(r<=.03928?r/12.92:((r+.055)/1.055)**2.4)+.7152*(i<=.03928?i/12.92:((i+.055)/1.055)**2.4)+.0722*(a<=.03928?a/12.92:((a+.055)/1.055)**2.4)}e.relativeLuminance=function(e){return t(e>>16&255,e>>8&255,255&e)},e.relativeLuminance2=t}(l||(t.rgb=l={})),function(e){function t(e,t,n){let r=e>>24&255,i=e>>16&255,a=e>>8&255,o=t>>24&255,s=t>>16&255,c=t>>8&255,u=f(l.relativeLuminance2(o,s,c),l.relativeLuminance2(r,i,a));for(;u<n&&(o>0||s>0||c>0);)o-=Math.max(0,Math.ceil(.1*o)),s-=Math.max(0,Math.ceil(.1*s)),c-=Math.max(0,Math.ceil(.1*c)),u=f(l.relativeLuminance2(o,s,c),l.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}function s(e,t,n){let r=e>>24&255,i=e>>16&255,a=e>>8&255,o=t>>24&255,s=t>>16&255,c=t>>8&255,u=f(l.relativeLuminance2(o,s,c),l.relativeLuminance2(r,i,a));for(;u<n&&(o<255||s<255||c<255);)o=Math.min(255,o+Math.ceil(.1*(255-o))),s=Math.min(255,s+Math.ceil(.1*(255-s))),c=Math.min(255,c+Math.ceil(.1*(255-c))),u=f(l.relativeLuminance2(o,s,c),l.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}e.blend=function(e,t){if(a=(255&t)/255,a===1)return t;let s=t>>24&255,c=t>>16&255,l=t>>8&255,u=e>>24&255,d=e>>16&255,f=e>>8&255;return n=u+Math.round((s-u)*a),r=d+Math.round((c-d)*a),i=f+Math.round((l-f)*a),o.toRgba(n,r,i)},e.ensureContrastRatio=function(e,n,r){let i=l.relativeLuminance(e>>8),a=l.relativeLuminance(n>>8);if(f(i,a)<r){if(a<i){let a=t(e,n,r),o=f(i,l.relativeLuminance(a>>8));if(o<r){let t=s(e,n,r);return o>f(i,l.relativeLuminance(t>>8))?a:t}return a}let o=s(e,n,r),c=f(i,l.relativeLuminance(o>>8));if(c<r){let a=t(e,n,r);return c>f(i,l.relativeLuminance(a>>8))?o:a}return o}},e.reduceLuminance=t,e.increaseLuminance=s,e.toChannels=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]}}(u||(t.rgba=u={})),t.toPaddedHex=d,t.contrastRatio=f},8969:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.CoreTerminal=void 0;let r=n(844),i=n(2585),a=n(4348),o=n(7866),s=n(744),c=n(7302),l=n(6975),u=n(8460),d=n(1753),f=n(1480),p=n(7994),m=n(9282),h=n(5435),g=n(5981),_=n(2660),v=!1;class y extends r.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new u.EventEmitter),this._onScroll.event((e=>{this._onScrollApi?.fire(e.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let t in e)this.optionsService.options[t]=e[t]}constructor(e){super(),this._windowsWrappingHeuristics=this.register(new r.MutableDisposable),this._onBinary=this.register(new u.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new u.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new u.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new u.EventEmitter),this._instantiationService=new a.InstantiationService,this.optionsService=this.register(new c.OptionsService(e)),this._instantiationService.setService(i.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(s.BufferService)),this._instantiationService.setService(i.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(o.LogService)),this._instantiationService.setService(i.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(l.CoreService)),this._instantiationService.setService(i.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(d.CoreMouseService)),this._instantiationService.setService(i.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(f.UnicodeService)),this._instantiationService.setService(i.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(p.CharsetService),this._instantiationService.setService(i.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(_.OscLinkService),this._instantiationService.setService(i.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new h.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,u.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,u.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,u.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,u.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange([`windowsMode`,`windowsPty`],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((e=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((e=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new g.WriteBuffer(((e,t)=>this._inputHandler.parse(e,t)))),this.register((0,u.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=i.LogLevelEnum.WARN&&!v&&(this._logService.warn(`writeSync is unreliable and will be removed soon.`),v=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,s.MINIMUM_COLS),t=Math.max(t,s.MINIMUM_ROWS),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t,n){this._bufferService.scrollLines(e,t,n)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend===`conpty`&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(m.updateWindowsModeWrappedState.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:`H`},(()=>((0,m.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,r.toDisposable)((()=>{for(let t of e)t.dispose()}))}}}t.CoreTerminal=y},8460:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.runAndSubscribe=t.forwardEvent=t.EventEmitter=void 0,t.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||=e=>(this._listeners.push(e),{dispose:()=>{if(!this._disposed){for(let t=0;t<this._listeners.length;t++)if(this._listeners[t]===e)return void this._listeners.splice(t,1)}}}),this._event}fire(e,t){let n=[];for(let e=0;e<this._listeners.length;e++)n.push(this._listeners[e]);for(let r=0;r<n.length;r++)n[r].call(void 0,e,t)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},t.forwardEvent=function(e,t){return e((e=>t.fire(e)))},t.runAndSubscribe=function(e,t){return t(void 0),e((e=>t(e)))}},5435:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.InputHandler=t.WindowsOptionsReportType=void 0;let a=n(2584),o=n(7116),s=n(2015),c=n(844),l=n(482),u=n(8437),d=n(8460),f=n(643),p=n(511),m=n(3734),h=n(2585),g=n(1480),_=n(6242),v=n(6351),y=n(5941),b={"(":0,")":1,"*":2,"+":3,"-":1,".":2},x=131072;function S(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var C;(function(e){e[e.GET_WIN_SIZE_PIXELS=0]=`GET_WIN_SIZE_PIXELS`,e[e.GET_CELL_SIZE_PIXELS=1]=`GET_CELL_SIZE_PIXELS`})(C||(t.WindowsOptionsReportType=C={}));let w=0;class T extends c.Disposable{getAttrData(){return this._curAttrData}constructor(e,t,n,r,i,c,f,m,h=new s.EscapeSequenceParser){super(),this._bufferService=e,this._charsetService=t,this._coreService=n,this._logService=r,this._optionsService=i,this._oscLinkService=c,this._coreMouseService=f,this._unicodeService=m,this._parser=h,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new l.StringToUtf32,this._utf8Decoder=new l.Utf8ToUtf32,this._workCell=new p.CellData,this._windowTitle=``,this._iconName=``,this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new d.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new d.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new d.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new d.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new d.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new d.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new d.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new d.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new d.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new d.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new d.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new d.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new E(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((e=>this._activeBuffer=e.activeBuffer))),this._parser.setCsiHandlerFallback(((e,t)=>{this._logService.debug(`Unknown CSI code: `,{identifier:this._parser.identToString(e),params:t.toArray()})})),this._parser.setEscHandlerFallback((e=>{this._logService.debug(`Unknown ESC code: `,{identifier:this._parser.identToString(e)})})),this._parser.setExecuteHandlerFallback((e=>{this._logService.debug(`Unknown EXECUTE code: `,{code:e})})),this._parser.setOscHandlerFallback(((e,t,n)=>{this._logService.debug(`Unknown OSC code: `,{identifier:e,action:t,data:n})})),this._parser.setDcsHandlerFallback(((e,t,n)=>{t===`HOOK`&&(n=n.toArray()),this._logService.debug(`Unknown DCS code: `,{identifier:this._parser.identToString(e),action:t,payload:n})})),this._parser.setPrintHandler(((e,t,n)=>this.print(e,t,n))),this._parser.registerCsiHandler({final:`@`},(e=>this.insertChars(e))),this._parser.registerCsiHandler({intermediates:` `,final:`@`},(e=>this.scrollLeft(e))),this._parser.registerCsiHandler({final:`A`},(e=>this.cursorUp(e))),this._parser.registerCsiHandler({intermediates:` `,final:`A`},(e=>this.scrollRight(e))),this._parser.registerCsiHandler({final:`B`},(e=>this.cursorDown(e))),this._parser.registerCsiHandler({final:`C`},(e=>this.cursorForward(e))),this._parser.registerCsiHandler({final:`D`},(e=>this.cursorBackward(e))),this._parser.registerCsiHandler({final:`E`},(e=>this.cursorNextLine(e))),this._parser.registerCsiHandler({final:`F`},(e=>this.cursorPrecedingLine(e))),this._parser.registerCsiHandler({final:`G`},(e=>this.cursorCharAbsolute(e))),this._parser.registerCsiHandler({final:`H`},(e=>this.cursorPosition(e))),this._parser.registerCsiHandler({final:`I`},(e=>this.cursorForwardTab(e))),this._parser.registerCsiHandler({final:`J`},(e=>this.eraseInDisplay(e,!1))),this._parser.registerCsiHandler({prefix:`?`,final:`J`},(e=>this.eraseInDisplay(e,!0))),this._parser.registerCsiHandler({final:`K`},(e=>this.eraseInLine(e,!1))),this._parser.registerCsiHandler({prefix:`?`,final:`K`},(e=>this.eraseInLine(e,!0))),this._parser.registerCsiHandler({final:`L`},(e=>this.insertLines(e))),this._parser.registerCsiHandler({final:`M`},(e=>this.deleteLines(e))),this._parser.registerCsiHandler({final:`P`},(e=>this.deleteChars(e))),this._parser.registerCsiHandler({final:`S`},(e=>this.scrollUp(e))),this._parser.registerCsiHandler({final:`T`},(e=>this.scrollDown(e))),this._parser.registerCsiHandler({final:`X`},(e=>this.eraseChars(e))),this._parser.registerCsiHandler({final:`Z`},(e=>this.cursorBackwardTab(e))),this._parser.registerCsiHandler({final:"`"},(e=>this.charPosAbsolute(e))),this._parser.registerCsiHandler({final:`a`},(e=>this.hPositionRelative(e))),this._parser.registerCsiHandler({final:`b`},(e=>this.repeatPrecedingCharacter(e))),this._parser.registerCsiHandler({final:`c`},(e=>this.sendDeviceAttributesPrimary(e))),this._parser.registerCsiHandler({prefix:`>`,final:`c`},(e=>this.sendDeviceAttributesSecondary(e))),this._parser.registerCsiHandler({final:`d`},(e=>this.linePosAbsolute(e))),this._parser.registerCsiHandler({final:`e`},(e=>this.vPositionRelative(e))),this._parser.registerCsiHandler({final:`f`},(e=>this.hVPosition(e))),this._parser.registerCsiHandler({final:`g`},(e=>this.tabClear(e))),this._parser.registerCsiHandler({final:`h`},(e=>this.setMode(e))),this._parser.registerCsiHandler({prefix:`?`,final:`h`},(e=>this.setModePrivate(e))),this._parser.registerCsiHandler({final:`l`},(e=>this.resetMode(e))),this._parser.registerCsiHandler({prefix:`?`,final:`l`},(e=>this.resetModePrivate(e))),this._parser.registerCsiHandler({final:`m`},(e=>this.charAttributes(e))),this._parser.registerCsiHandler({final:`n`},(e=>this.deviceStatus(e))),this._parser.registerCsiHandler({prefix:`?`,final:`n`},(e=>this.deviceStatusPrivate(e))),this._parser.registerCsiHandler({intermediates:`!`,final:`p`},(e=>this.softReset(e))),this._parser.registerCsiHandler({intermediates:` `,final:`q`},(e=>this.setCursorStyle(e))),this._parser.registerCsiHandler({final:`r`},(e=>this.setScrollRegion(e))),this._parser.registerCsiHandler({final:`s`},(e=>this.saveCursor(e))),this._parser.registerCsiHandler({final:`t`},(e=>this.windowOptions(e))),this._parser.registerCsiHandler({final:`u`},(e=>this.restoreCursor(e))),this._parser.registerCsiHandler({intermediates:`'`,final:`}`},(e=>this.insertColumns(e))),this._parser.registerCsiHandler({intermediates:`'`,final:`~`},(e=>this.deleteColumns(e))),this._parser.registerCsiHandler({intermediates:`"`,final:`q`},(e=>this.selectProtected(e))),this._parser.registerCsiHandler({intermediates:`$`,final:`p`},(e=>this.requestMode(e,!0))),this._parser.registerCsiHandler({prefix:`?`,intermediates:`$`,final:`p`},(e=>this.requestMode(e,!1))),this._parser.setExecuteHandler(a.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(a.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(a.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(a.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(a.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(a.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(a.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(a.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(a.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new _.OscHandler((e=>(this.setTitle(e),this.setIconName(e),!0)))),this._parser.registerOscHandler(1,new _.OscHandler((e=>this.setIconName(e)))),this._parser.registerOscHandler(2,new _.OscHandler((e=>this.setTitle(e)))),this._parser.registerOscHandler(4,new _.OscHandler((e=>this.setOrReportIndexedColor(e)))),this._parser.registerOscHandler(8,new _.OscHandler((e=>this.setHyperlink(e)))),this._parser.registerOscHandler(10,new _.OscHandler((e=>this.setOrReportFgColor(e)))),this._parser.registerOscHandler(11,new _.OscHandler((e=>this.setOrReportBgColor(e)))),this._parser.registerOscHandler(12,new _.OscHandler((e=>this.setOrReportCursorColor(e)))),this._parser.registerOscHandler(104,new _.OscHandler((e=>this.restoreIndexedColor(e)))),this._parser.registerOscHandler(110,new _.OscHandler((e=>this.restoreFgColor(e)))),this._parser.registerOscHandler(111,new _.OscHandler((e=>this.restoreBgColor(e)))),this._parser.registerOscHandler(112,new _.OscHandler((e=>this.restoreCursorColor(e)))),this._parser.registerEscHandler({final:`7`},(()=>this.saveCursor())),this._parser.registerEscHandler({final:`8`},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:`D`},(()=>this.index())),this._parser.registerEscHandler({final:`E`},(()=>this.nextLine())),this._parser.registerEscHandler({final:`H`},(()=>this.tabSet())),this._parser.registerEscHandler({final:`M`},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:`=`},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:`>`},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:`c`},(()=>this.fullReset())),this._parser.registerEscHandler({final:`n`},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:`o`},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:`|`},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:`}`},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:`~`},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:`%`,final:`@`},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:`%`,final:`G`},(()=>this.selectDefaultCharset()));for(let e in o.CHARSETS)this._parser.registerEscHandler({intermediates:`(`,final:e},(()=>this.selectCharset(`(`+e))),this._parser.registerEscHandler({intermediates:`)`,final:e},(()=>this.selectCharset(`)`+e))),this._parser.registerEscHandler({intermediates:`*`,final:e},(()=>this.selectCharset(`*`+e))),this._parser.registerEscHandler({intermediates:`+`,final:e},(()=>this.selectCharset(`+`+e))),this._parser.registerEscHandler({intermediates:`-`,final:e},(()=>this.selectCharset(`-`+e))),this._parser.registerEscHandler({intermediates:`.`,final:e},(()=>this.selectCharset(`.`+e))),this._parser.registerEscHandler({intermediates:`/`,final:e},(()=>this.selectCharset(`/`+e)));this._parser.registerEscHandler({intermediates:`#`,final:`8`},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((e=>(this._logService.error(`Parsing error: `,e),e))),this._parser.registerDcsHandler({intermediates:`$`,final:`q`},new v.DcsHandler(((e,t)=>this.requestStatusString(e,t))))}_preserveStack(e,t,n,r){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=n,this._parseStack.position=r}_logSlowResolvingAsync(e){this._logService.logLevel<=h.LogLevelEnum.WARN&&Promise.race([e,new Promise(((e,t)=>setTimeout((()=>t(`#SLOW_TIMEOUT`)),5e3)))]).catch((e=>{if(e!==`#SLOW_TIMEOUT`)throw e;console.warn(`async parser handler taking longer than 5000 ms`)}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let n,r=this._activeBuffer.x,i=this._activeBuffer.y,a=0,o=this._parseStack.paused;if(o){if(n=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(n),n;r=this._parseStack.cursorStartX,i=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>x&&(a=this._parseStack.position+x)}if(this._logService.logLevel<=h.LogLevelEnum.DEBUG&&this._logService.debug(`parsing data`+(typeof e==`string`?` "${e}"`:` "${Array.prototype.map.call(e,(e=>String.fromCharCode(e))).join(``)}"`),typeof e==`string`?e.split(``).map((e=>e.charCodeAt(0))):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<x&&(this._parseBuffer=new Uint32Array(Math.min(e.length,x))),o||this._dirtyRowTracker.clearRange(),e.length>x)for(let t=a;t<e.length;t+=x){let a=t+x<e.length?t+x:e.length,o=typeof e==`string`?this._stringDecoder.decode(e.substring(t,a),this._parseBuffer):this._utf8Decoder.decode(e.subarray(t,a),this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,o))return this._preserveStack(r,i,o,t),this._logSlowResolvingAsync(n),n}else if(!o){let t=typeof e==`string`?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,t))return this._preserveStack(r,i,t,0),this._logSlowResolvingAsync(n),n}this._activeBuffer.x===r&&this._activeBuffer.y===i||this._onCursorMove.fire();let s=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),c=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);c<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(c,this._bufferService.rows-1),Math.min(s,this._bufferService.rows-1))}print(e,t,n){let r,i,a=this._charsetService.charset,o=this._optionsService.rawOptions.screenReaderMode,s=this._bufferService.cols,c=this._coreService.decPrivateModes.wraparound,d=this._coreService.modes.insertMode,p=this._curAttrData,m=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&n-t>0&&m.getWidth(this._activeBuffer.x-1)===2&&m.setCellFromCodepoint(this._activeBuffer.x-1,0,1,p);let h=this._parser.precedingJoinState;for(let _=t;_<n;++_){if(r=e[_],r<127&&a){let e=a[String.fromCharCode(r)];e&&(r=e.charCodeAt(0))}let t=this._unicodeService.charProperties(r,h);i=g.UnicodeService.extractWidth(t);let n=g.UnicodeService.extractShouldJoin(t),v=n?g.UnicodeService.extractWidth(h):0;if(h=t,o&&this._onA11yChar.fire((0,l.stringFromCodePoint)(r)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+i-v>s){if(c){let e=m,t=this._activeBuffer.x-v;for(this._activeBuffer.x=v,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),m=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),v>0&&m instanceof u.BufferLine&&m.copyCellsFrom(e,t,0,v,!1);t<s;)e.setCellFromCodepoint(t++,0,1,p)}else if(this._activeBuffer.x=s-1,i===2)continue}if(n&&this._activeBuffer.x){let e=m.getWidth(this._activeBuffer.x-1)?1:2;m.addCodepointToCell(this._activeBuffer.x-e,r,i);for(let e=i-v;--e>=0;)m.setCellFromCodepoint(this._activeBuffer.x++,0,0,p)}else if(d&&(m.insertCells(this._activeBuffer.x,i-v,this._activeBuffer.getNullCell(p)),m.getWidth(s-1)===2&&m.setCellFromCodepoint(s-1,f.NULL_CELL_CODE,f.NULL_CELL_WIDTH,p)),m.setCellFromCodepoint(this._activeBuffer.x++,r,i,p),i>0)for(;--i;)m.setCellFromCodepoint(this._activeBuffer.x++,0,0,p)}this._parser.precedingJoinState=h,this._activeBuffer.x<s&&n-t>0&&m.getWidth(this._activeBuffer.x)===0&&!m.hasContent(this._activeBuffer.x)&&m.setCellFromCodepoint(this._activeBuffer.x,0,1,p),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final!==`t`||e.prefix||e.intermediates?this._parser.registerCsiHandler(e,t):this._parser.registerCsiHandler(e,(e=>!S(e.params[0],this._optionsService.rawOptions.windowOptions)||t(e)))}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new v.DcsHandler(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new _.OscHandler(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),t!==2&&t!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,n,r=!1,i=!1){let a=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);a.replaceCells(t,n,this._activeBuffer.getNullCell(this._eraseAttrData()),i),r&&(a.isWrapped=!1)}_resetBufferLine(e,t=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n&&(n.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),n.isWrapped=!1)}eraseInDisplay(e,t=!1){let n;switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);n<this._bufferService.rows;n++)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(n);break;case 1:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(n+1).isWrapped=!1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0);break;case 2:for(n=this._bufferService.rows,this._dirtyRowTracker.markDirty(n-1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0);break;case 3:let e=this._activeBuffer.lines.length-this._bufferService.rows;e>0&&(this._activeBuffer.lines.trimStart(e),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-e,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-e,0),this._onScroll.fire(0))}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,i=this._bufferService.rows-1+this._activeBuffer.ybase-r+1;for(;t--;)this._activeBuffer.lines.splice(i-1,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r;for(r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-r;t--;)this._activeBuffer.lines.splice(n,1),this._activeBuffer.lines.splice(r,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(u.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let n=e.params[0]||1,r=g.UnicodeService.extractWidth(t),i=this._activeBuffer.x-r,a=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(i),o=new Uint32Array(a.length*n),s=0;for(let e=0;e<a.length;){let t=a.codePointAt(e)||0;o[s++]=t,e+=t>65535?2:1}let c=s;for(let e=1;e<n;++e)o.copyWithin(c,0,s),c+=s;return this.print(o,0,c),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is(`xterm`)||this._is(`rxvt-unicode`)||this._is(`screen`)?this._coreService.triggerDataEvent(a.C0.ESC+`[?1;2c`):this._is(`linux`)&&this._coreService.triggerDataEvent(a.C0.ESC+`[?6c`)),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is(`xterm`)?this._coreService.triggerDataEvent(a.C0.ESC+`[>0;276;0c`):this._is(`rxvt-unicode`)?this._coreService.triggerDataEvent(a.C0.ESC+`[>85;95;0c`):this._is(`linux`)?this._coreService.triggerDataEvent(e.params[0]+`c`):this._is(`screen`)&&this._coreService.triggerDataEvent(a.C0.ESC+`[>83;40003;0c`)),!0}_is(e){return(this._optionsService.rawOptions.termName+``).indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,o.DEFAULT_CHARSET),this._charsetService.setgCharset(1,o.DEFAULT_CHARSET),this._charsetService.setgCharset(2,o.DEFAULT_CHARSET),this._charsetService.setgCharset(3,o.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug(`Serial port requested application keypad.`),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol=`X10`;break;case 1e3:this._coreMouseService.activeProtocol=`VT200`;break;case 1002:this._coreMouseService.activeProtocol=`DRAG`;break;case 1003:this._coreMouseService.activeProtocol=`ANY`;break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug(`DECSET 1005 not supported (see #2507)`);break;case 1006:this._coreMouseService.activeEncoding=`SGR`;break;case 1015:this._logService.debug(`DECSET 1015 not supported (see #2507)`);break;case 1016:this._coreMouseService.activeEncoding=`SGR_PIXELS`;break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug(`Switching back to normal keypad.`),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol=`NONE`;break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug(`DECRST 1005 not supported (see #2507)`);break;case 1006:case 1016:this._coreMouseService.activeEncoding=`DEFAULT`;break;case 1015:this._logService.debug(`DECRST 1015 not supported (see #2507)`);break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(e,t){let n=this._coreService.decPrivateModes,{activeProtocol:r,activeEncoding:i}=this._coreMouseService,o=this._coreService,{buffers:s,cols:c}=this._bufferService,{active:l,alt:u}=s,d=this._optionsService.rawOptions,f=e=>e?1:2,p=e.params[0];return m=p,h=t?p===2?4:p===4?f(o.modes.insertMode):p===12?3:p===20?f(d.convertEol):0:p===1?f(n.applicationCursorKeys):p===3?d.windowOptions.setWinLines?c===80?2:+(c===132):0:p===6?f(n.origin):p===7?f(n.wraparound):p===8?3:p===9?f(r===`X10`):p===12?f(d.cursorBlink):p===25?f(!o.isCursorHidden):p===45?f(n.reverseWraparound):p===66?f(n.applicationKeypad):p===67?4:p===1e3?f(r===`VT200`):p===1002?f(r===`DRAG`):p===1003?f(r===`ANY`):p===1004?f(n.sendFocus):p===1005?4:p===1006?f(i===`SGR`):p===1015?4:p===1016?f(i===`SGR_PIXELS`):p===1048?1:p===47||p===1047||p===1049?f(l===u):p===2004?f(n.bracketedPasteMode):0,o.triggerDataEvent(`${a.C0.ESC}[${t?``:`?`}${m};${h}$y`),!0;var m,h}_updateAttrColor(e,t,n,r,i){return t===2?(e|=50331648,e&=-16777216,e|=m.AttributeData.fromColorRGB([n,r,i])):t===5&&(e&=-50331904,e|=33554432|255&n),e}_extractColor(e,t,n){let r=[0,0,-1,0,0,0],i=0,a=0;do{if(r[a+i]=e.params[t+a],e.hasSubParams(t+a)){let n=e.getSubParams(t+a),o=0;do r[1]===5&&(i=1),r[a+o+1+i]=n[o];while(++o<n.length&&o+a+1+i<r.length);break}if(r[1]===5&&a+i>=2||r[1]===2&&a+i>=5)break;r[1]&&(i=1)}while(++a+t<e.length&&a+i<r.length);for(let e=2;e<r.length;++e)r[e]===-1&&(r[e]=0);switch(r[0]){case 38:n.fg=this._updateAttrColor(n.fg,r[1],r[3],r[4],r[5]);break;case 48:n.bg=this._updateAttrColor(n.bg,r[1],r[3],r[4],r[5]);break;case 58:n.extended=n.extended.clone(),n.extended.underlineColor=this._updateAttrColor(n.extended.underlineColor,r[1],r[3],r[4],r[5])}return a}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=u.DEFAULT_ATTR_DATA.fg,e.bg=u.DEFAULT_ATTR_DATA.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,n,r=this._curAttrData;for(let i=0;i<t;i++)n=e.params[i],n>=30&&n<=37?(r.fg&=-50331904,r.fg|=16777216|n-30):n>=40&&n<=47?(r.bg&=-50331904,r.bg|=16777216|n-40):n>=90&&n<=97?(r.fg&=-50331904,r.fg|=16777224|n-90):n>=100&&n<=107?(r.bg&=-50331904,r.bg|=16777224|n-100):n===0?this._processSGR0(r):n===1?r.fg|=134217728:n===3?r.bg|=67108864:n===4?(r.fg|=268435456,this._processUnderline(e.hasSubParams(i)?e.getSubParams(i)[0]:1,r)):n===5?r.fg|=536870912:n===7?r.fg|=67108864:n===8?r.fg|=1073741824:n===9?r.fg|=2147483648:n===2?r.bg|=134217728:n===21?this._processUnderline(2,r):n===22?(r.fg&=-134217729,r.bg&=-134217729):n===23?r.bg&=-67108865:n===24?(r.fg&=-268435457,this._processUnderline(0,r)):n===25?r.fg&=-536870913:n===27?r.fg&=-67108865:n===28?r.fg&=-1073741825:n===29?r.fg&=2147483647:n===39?(r.fg&=-67108864,r.fg|=16777215&u.DEFAULT_ATTR_DATA.fg):n===49?(r.bg&=-67108864,r.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):n===38||n===48||n===58?i+=this._extractColor(e,i,r):n===53?r.bg|=1073741824:n===55?r.bg&=-1073741825:n===59?(r.extended=r.extended.clone(),r.extended.underlineColor=-1,r.updateExtended()):n===100?(r.fg&=-67108864,r.fg|=16777215&u.DEFAULT_ATTR_DATA.fg,r.bg&=-67108864,r.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):this._logService.debug(`Unknown SGR attribute: %d.`,n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${a.C0.ESC}[0n`);break;case 6:let e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${a.C0.ESC}[${e};${t}R`)}return!0}deviceStatusPrivate(e){if(e.params[0]===6){let e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${a.C0.ESC}[?${e};${t}R`)}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let t=e.params[0]||1;switch(t){case 1:case 2:this._optionsService.options.cursorStyle=`block`;break;case 3:case 4:this._optionsService.options.cursorStyle=`underline`;break;case 5:case 6:this._optionsService.options.cursorStyle=`bar`}let n=t%2==1;return this._optionsService.options.cursorBlink=n,!0}setScrollRegion(e){let t=e.params[0]||1,n;return(e.length<2||(n=e.params[1])>this._bufferService.rows||n===0)&&(n=this._bufferService.rows),n>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=n-1,this._setCursor(0,0)),!0}windowOptions(e){if(!S(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(C.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(C.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${a.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:t!==0&&t!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),t!==0&&t!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:t!==0&&t!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),t!==0&&t!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],n=e.split(`;`);for(;n.length>1;){let e=n.shift(),r=n.shift();if(/^\d+$/.exec(e)){let n=parseInt(e);if(D(n))if(r===`?`)t.push({type:0,index:n});else{let e=(0,y.parseColor)(r);e&&t.push({type:1,index:n,color:e})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.split(`;`);return!(t.length<2)&&(t[1]?this._createHyperlink(t[0],t[1]):!t[0]&&this._finishHyperlink())}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let n=e.split(`:`),r,i=n.findIndex((e=>e.startsWith(`id=`)));return i!==-1&&(r=n[i].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:r,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let n=e.split(`;`);for(let e=0;e<n.length&&!(t>=this._specialColors.length);++e,++t)if(n[e]===`?`)this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let r=(0,y.parseColor)(n[e]);r&&this._onColor.fire([{type:1,index:this._specialColors[t],color:r}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],n=e.split(`;`);for(let e=0;e<n.length;++e)if(/^\d+$/.exec(n[e])){let r=parseInt(n[e]);D(r)&&t.push({type:2,index:r})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug(`Serial port requested application keypad.`),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug(`Switching back to normal keypad.`),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,o.DEFAULT_CHARSET),!0}selectCharset(e){return e.length===2?(e[0]===`/`||this._charsetService.setgCharset(b[e[0]],o.CHARSETS[e[1]]||o.DEFAULT_CHARSET),!0):(this.selectDefaultCharset(),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new p.CellData;e.content=4194373,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let n=this._activeBuffer.ybase+this._activeBuffer.y+t,r=this._activeBuffer.lines.get(n);r&&(r.fill(e),r.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let n=this._bufferService.buffer,r=this._optionsService.rawOptions;return(e=>(this._coreService.triggerDataEvent(`${a.C0.ESC}${e}${a.C0.ESC}\\`),!0))(e===`"q`?`P1$r${+!!this._curAttrData.isProtected()}"q`:e===`"p`?`P1$r61;1"p`:e===`r`?`P1$r${n.scrollTop+1};${n.scrollBottom+1}r`:e===`m`?`P1$r0m`:e===` q`?`P1$r${{block:2,underline:4,bar:6}[r.cursorStyle]-+!!r.cursorBlink} q`:`P0$r`)}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}}t.InputHandler=T;let E=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(w=e,e=t,t=w),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function D(e){return 0<=e&&e<256}E=r([i(0,h.IBufferService)],E)},844:(e,t)=>{function n(e){for(let t of e)t.dispose();e.length=0}Object.defineProperty(t,`__esModule`,{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.MutableDisposable=t.Disposable=void 0,t.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(let e of this._disposables)e.dispose();this._disposables.length=0}register(e){return this._disposables.push(e),e}unregister(e){let t=this._disposables.indexOf(e);t!==-1&&this._disposables.splice(t,1)}},t.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},t.toDisposable=function(e){return{dispose:e}},t.disposeArray=n,t.getDisposeArrayDisposable=function(e){return{dispose:()=>n(e)}}},1505:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class n{constructor(){this._data={}}set(e,t,n){this._data[e]||(this._data[e]={}),this._data[e][t]=n}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}}t.TwoKeyMap=n,t.FourKeyMap=class{constructor(){this._data=new n}set(e,t,r,i,a){this._data.get(e,t)||this._data.set(e,t,new n),this._data.get(e,t).set(r,i,a)}get(e,t,n,r){return this._data.get(e,t)?.get(n,r)}clear(){this._data.clear()}}},6114:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.isChromeOS=t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.getSafariVersion=t.isSafari=t.isLegacyEdge=t.isFirefox=t.isNode=void 0,t.isNode=typeof process<`u`&&`title`in process;let n=t.isNode?`node`:navigator.userAgent,r=t.isNode?`node`:navigator.platform;t.isFirefox=n.includes(`Firefox`),t.isLegacyEdge=n.includes(`Edge`),t.isSafari=/^((?!chrome|android).)*safari/i.test(n),t.getSafariVersion=function(){if(!t.isSafari)return 0;let e=n.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])},t.isMac=[`Macintosh`,`MacIntel`,`MacPPC`,`Mac68K`].includes(r),t.isIpad=r===`iPad`,t.isIphone=r===`iPhone`,t.isWindows=[`Windows`,`Win16`,`Win32`,`WinCE`].includes(r),t.isLinux=r.indexOf(`Linux`)>=0,t.isChromeOS=/\bCrOS\b/.test(n)},6106:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.SortedList=void 0;let n=0;t.SortedList=class{constructor(e){this._getKey=e,this._array=[]}clear(){this._array.length=0}insert(e){this._array.length===0?this._array.push(e):(n=this._search(this._getKey(e)),this._array.splice(n,0,e))}delete(e){if(this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(n=this._search(t),n===-1)||this._getKey(this._array[n])!==t)return!1;do if(this._array[n]===e)return this._array.splice(n,1),!0;while(++n<this._array.length&&this._getKey(this._array[n])===t);return!1}*getKeyIterator(e){if(this._array.length!==0&&(n=this._search(e),!(n<0||n>=this._array.length)&&this._getKey(this._array[n])===e))do yield this._array[n];while(++n<this._array.length&&this._getKey(this._array[n])===e)}forEachByKey(e,t){if(this._array.length!==0&&(n=this._search(e),!(n<0||n>=this._array.length)&&this._getKey(this._array[n])===e))do t(this._array[n]);while(++n<this._array.length&&this._getKey(this._array[n])===e)}values(){return[...this._array].values()}_search(e){let t=0,n=this._array.length-1;for(;n>=t;){let r=t+n>>1,i=this._getKey(this._array[r]);if(i>e)n=r-1;else{if(!(i<e)){for(;r>0&&this._getKey(this._array[r-1])===e;)r--;return r}t=r+1}}return t}}},7226:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.DebouncedIdleTask=t.IdleTaskQueue=t.PriorityTaskQueue=void 0;let r=n(6114);class i{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&=(this._cancelCallback(this._idleCallback),void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||=this._requestCallback(this._process.bind(this))}_process(e){this._idleCallback=void 0;let t=0,n=0,r=e.timeRemaining(),i=0;for(;this._i<this._tasks.length;){if(t=Date.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,Date.now()-t),n=Math.max(t,n),i=e.timeRemaining(),1.5*n>i)return r-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-t))}ms`),void this._start();r=i}this.clear()}}class a extends i{_requestCallback(e){return setTimeout((()=>e(this._createDeadline(16))))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=Date.now()+e;return{timeRemaining:()=>Math.max(0,t-Date.now())}}}t.PriorityTaskQueue=a,t.IdleTaskQueue=!r.isNode&&`requestIdleCallback`in window?class extends i{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}}:a,t.DebouncedIdleTask=class{constructor(){this._queue=new t.IdleTaskQueue}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}}},9282:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.updateWindowsModeWrappedState=void 0;let r=n(643);t.updateWindowsModeWrappedState=function(e){let t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);n&&t&&(n.isWrapped=t[r.CHAR_DATA_CODE_INDEX]!==r.NULL_CELL_CODE&&t[r.CHAR_DATA_CODE_INDEX]!==r.WHITESPACE_CELL_CODE)}},3734:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;class n{constructor(){this.fg=0,this.bg=0,this.extended=new r}static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}clone(){let e=new n;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}t.AttributeData=n;class r{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(e){this._ext&=-67108864,this._ext|=67108863&e}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(3758096384&this._ext)>>29;return e<0?4294967288^e:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}clone(){return new r(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}t.ExtendedAttrs=r},9092:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.Buffer=t.MAX_BUFFER_SIZE=void 0;let r=n(6349),i=n(7226),a=n(3734),o=n(8437),s=n(4634),c=n(511),l=n(643),u=n(4863),d=n(7116);t.MAX_BUFFER_SIZE=4294967295,t.Buffer=class{constructor(e,t,n){this._hasScrollback=e,this._optionsService=t,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=o.DEFAULT_ATTR_DATA.clone(),this.savedCharset=d.DEFAULT_CHARSET,this.markers=[],this._nullCell=c.CellData.fromCharData([0,l.NULL_CELL_CHAR,l.NULL_CELL_WIDTH,l.NULL_CELL_CODE]),this._whitespaceCell=c.CellData.fromCharData([0,l.WHITESPACE_CELL_CHAR,l.WHITESPACE_CELL_WIDTH,l.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new i.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new r.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new a.ExtendedAttrs),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new a.ExtendedAttrs),this._whitespaceCell}getBlankLine(e,t){return new o.BufferLine(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let n=e+this._optionsService.rawOptions.scrollback;return n>t.MAX_BUFFER_SIZE?t.MAX_BUFFER_SIZE:n}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=o.DEFAULT_ATTR_DATA);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new r.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let n=this.getNullCell(o.DEFAULT_ATTR_DATA),r=0,i=this._getCorrectBufferLength(t);if(i>this.lines.maxLength&&(this.lines.maxLength=i),this.lines.length>0){if(this._cols<e)for(let t=0;t<this.lines.length;t++)r+=+this.lines.get(t).resize(e,n);let a=0;if(this._rows<t)for(let r=this._rows;r<t;r++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new o.BufferLine(e,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+a+1?(this.ybase--,a++,this.ydisp>0&&this.ydisp--):this.lines.push(new o.BufferLine(e,n)));else for(let e=this._rows;e>t;e--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(i<this.lines.maxLength){let e=this.lines.length-i;e>0&&(this.lines.trimStart(e),this.ybase=Math.max(this.ybase-e,0),this.ydisp=Math.max(this.ydisp-e,0),this.savedY=Math.max(this.savedY-e,0)),this.lines.maxLength=i}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),a&&(this.y+=a),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let t=0;t<this.lines.length;t++)r+=+this.lines.get(t).resize(e,n);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),r>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend===`conpty`&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let n=(0,s.reflowLargerGetLinesToRemove)(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(o.DEFAULT_ATTR_DATA));if(n.length>0){let r=(0,s.reflowLargerCreateNewLayout)(this.lines,n);(0,s.reflowLargerApplyNewLayout)(this.lines,r.layout),this._reflowLargerAdjustViewport(e,t,r.countRemoved)}}_reflowLargerAdjustViewport(e,t,n){let r=this.getNullCell(o.DEFAULT_ATTR_DATA),i=n;for(;i-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new o.BufferLine(e,r))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-n,0)}_reflowSmaller(e,t){let n=this.getNullCell(o.DEFAULT_ATTR_DATA),r=[],i=0;for(let a=this.lines.length-1;a>=0;a--){let c=this.lines.get(a);if(!c||!c.isWrapped&&c.getTrimmedLength()<=e)continue;let l=[c];for(;c.isWrapped&&a>0;)c=this.lines.get(--a),l.unshift(c);let u=this.ybase+this.y;if(u>=a&&u<a+l.length)continue;let d=l[l.length-1].getTrimmedLength(),f=(0,s.reflowSmallerGetNewLineLengths)(l,this._cols,e),p=f.length-l.length,m;m=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+p):Math.max(0,this.lines.length-this.lines.maxLength+p);let h=[];for(let e=0;e<p;e++){let e=this.getBlankLine(o.DEFAULT_ATTR_DATA,!0);h.push(e)}h.length>0&&(r.push({start:a+l.length+i,newLines:h}),i+=h.length),l.push(...h);let g=f.length-1,_=f[g];_===0&&(g--,_=f[g]);let v=l.length-p-1,y=d;for(;v>=0;){let e=Math.min(y,_);if(l[g]===void 0)break;if(l[g].copyCellsFrom(l[v],y-e,_-e,e,!0),_-=e,_===0&&(g--,_=f[g]),y-=e,y===0){v--;let e=Math.max(v,0);y=(0,s.getWrappedLineTrimmedLength)(l,e,this._cols)}}for(let t=0;t<l.length;t++)f[t]<e&&l[t].setCell(f[t],n);let b=p-m;for(;b-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+i)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+p,this.ybase+t-1)}if(r.length>0){let e=[],t=[];for(let e=0;e<this.lines.length;e++)t.push(this.lines.get(e));let n=this.lines.length,a=n-1,o=0,s=r[o];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+i);let c=0;for(let l=Math.min(this.lines.maxLength-1,n+i-1);l>=0;l--)if(s&&s.start>a+c){for(let e=s.newLines.length-1;e>=0;e--)this.lines.set(l--,s.newLines[e]);l++,e.push({index:a+1,amount:s.newLines.length}),c+=s.newLines.length,s=r[++o]}else this.lines.set(l,t[a--]);let l=0;for(let t=e.length-1;t>=0;t--)e[t].index+=l,this.lines.onInsertEmitter.fire(e[t]),l+=e[t].amount;let u=Math.max(0,n+i-this.lines.maxLength);u>0&&this.lines.onTrimEmitter.fire(u)}}translateBufferLineToString(e,t,n=0,r){let i=this.lines.get(e);return i?i.translateToString(t,n,r):``}getWrappedRangeForLine(e){let t=e,n=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;n+1<this.lines.length&&this.lines.get(n+1).isWrapped;)n++;return{first:t,last:n}}setupTabStops(e){for(e==null?(this.tabs={},e=0):this.tabs[e]||(e=this.prevStop(e));e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e??=this.x;!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e??=this.x;!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose(),this.markers.splice(e--,1);this._isClearing=!1}addMarker(e){let t=new u.Marker(e);return this.markers.push(t),t.register(this.lines.onTrim((e=>{t.line-=e,t.line<0&&t.dispose()}))),t.register(this.lines.onInsert((e=>{t.line>=e.index&&(t.line+=e.amount)}))),t.register(this.lines.onDelete((e=>{t.line>=e.index&&t.line<e.index+e.amount&&t.dispose(),t.line>e.index&&(t.line-=e.amount)}))),t.register(t.onDispose((()=>this._removeMarker(t)))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}}},8437:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.BufferLine=t.DEFAULT_ATTR_DATA=void 0;let r=n(3734),i=n(511),a=n(643),o=n(482);t.DEFAULT_ATTR_DATA=Object.freeze(new r.AttributeData);let s=0;class c{constructor(e,t,n=!1){this.isWrapped=n,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e);let r=t||i.CellData.fromCharData([0,a.NULL_CELL_CHAR,a.NULL_CELL_WIDTH,a.NULL_CELL_CODE]);for(let t=0;t<e;++t)this.setCell(t,r);this.length=e}get(e){let t=this._data[3*e+0],n=2097151&t;return[this._data[3*e+1],2097152&t?this._combined[e]:n?(0,o.stringFromCodePoint)(n):``,t>>22,2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):n]}set(e,t){this._data[3*e+1]=t[a.CHAR_DATA_ATTR_INDEX],t[a.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[e]=t[1],this._data[3*e+0]=2097152|e|t[a.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e+0]=t[a.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|t[a.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(e){return this._data[3*e+0]>>22}hasWidth(e){return 12582912&this._data[3*e+0]}getFg(e){return this._data[3*e+1]}getBg(e){return this._data[3*e+2]}hasContent(e){return 4194303&this._data[3*e+0]}getCodePoint(e){let t=this._data[3*e+0];return 2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&t}isCombined(e){return 2097152&this._data[3*e+0]}getString(e){let t=this._data[3*e+0];return 2097152&t?this._combined[e]:2097151&t?(0,o.stringFromCodePoint)(2097151&t):``}isProtected(e){return 536870912&this._data[3*e+2]}loadCell(e,t){return s=3*e,t.content=this._data[s+0],t.fg=this._data[s+1],t.bg=this._data[s+2],2097152&t.content&&(t.combinedData=this._combined[e]),268435456&t.bg&&(t.extended=this._extendedAttrs[e]),t}setCell(e,t){2097152&t.content&&(this._combined[e]=t.combinedData),268435456&t.bg&&(this._extendedAttrs[e]=t.extended),this._data[3*e+0]=t.content,this._data[3*e+1]=t.fg,this._data[3*e+2]=t.bg}setCellFromCodepoint(e,t,n,r){268435456&r.bg&&(this._extendedAttrs[e]=r.extended),this._data[3*e+0]=t|n<<22,this._data[3*e+1]=r.fg,this._data[3*e+2]=r.bg}addCodepointToCell(e,t,n){let r=this._data[3*e+0];2097152&r?this._combined[e]+=(0,o.stringFromCodePoint)(t):2097151&r?(this._combined[e]=(0,o.stringFromCodePoint)(2097151&r)+(0,o.stringFromCodePoint)(t),r&=-2097152,r|=2097152):r=t|1<<22,n&&(r&=-12582913,r|=n<<22),this._data[3*e+0]=r}insertCells(e,t,n){if((e%=this.length)&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),t<this.length-e){let r=new i.CellData;for(let n=this.length-e-t-1;n>=0;--n)this.setCell(e+t+n,this.loadCell(e+n,r));for(let r=0;r<t;++r)this.setCell(e+r,n)}else for(let t=e;t<this.length;++t)this.setCell(t,n);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,n)}deleteCells(e,t,n){if(e%=this.length,t<this.length-e){let r=new i.CellData;for(let n=0;n<this.length-e-t;++n)this.setCell(e+n,this.loadCell(e+t+n,r));for(let e=this.length-t;e<this.length;++e)this.setCell(e,n)}else for(let t=e;t<this.length;++t)this.setCell(t,n);e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),this.getWidth(e)!==0||this.hasContent(e)||this.setCellFromCodepoint(e,0,1,n)}replaceCells(e,t,n,r=!1){if(r)for(e&&this.getWidth(e-1)===2&&!this.isProtected(e-1)&&this.setCellFromCodepoint(e-1,0,1,n),t<this.length&&this.getWidth(t-1)===2&&!this.isProtected(t)&&this.setCellFromCodepoint(t,0,1,n);e<t&&e<this.length;)this.isProtected(e)||this.setCell(e,n),e++;else for(e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),t<this.length&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t,0,1,n);e<t&&e<this.length;)this.setCell(e++,n)}resize(e,t){if(e===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;let n=3*e;if(e>this.length){if(this._data.buffer.byteLength>=4*n)this._data=new Uint32Array(this._data.buffer,0,n);else{let e=new Uint32Array(n);e.set(this._data),this._data=e}for(let n=this.length;n<e;++n)this.setCell(n,t)}else{this._data=this._data.subarray(0,n);let t=Object.keys(this._combined);for(let n=0;n<t.length;n++){let r=parseInt(t[n],10);r>=e&&delete this._combined[r]}let r=Object.keys(this._extendedAttrs);for(let t=0;t<r.length;t++){let n=parseInt(r[t],10);n>=e&&delete this._extendedAttrs[n]}}return this.length=e,4*n*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){let e=new Uint32Array(this._data.length);return e.set(this._data),this._data=e,1}return 0}fill(e,t=!1){if(t)for(let t=0;t<this.length;++t)this.isProtected(t)||this.setCell(t,e);else{this._combined={},this._extendedAttrs={};for(let t=0;t<this.length;++t)this.setCell(t,e)}}copyFrom(e){this.length===e.length?this._data.set(e._data):this._data=new Uint32Array(e._data),this.length=e.length,this._combined={};for(let t in e._combined)this._combined[t]=e._combined[t];this._extendedAttrs={};for(let t in e._extendedAttrs)this._extendedAttrs[t]=e._extendedAttrs[t];this.isWrapped=e.isWrapped}clone(){let e=new c(0);e._data=new Uint32Array(this._data),e.length=this.length;for(let t in this._combined)e._combined[t]=this._combined[t];for(let t in this._extendedAttrs)e._extendedAttrs[t]=this._extendedAttrs[t];return e.isWrapped=this.isWrapped,e}getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0])return e+(this._data[3*e+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0]||50331648&this._data[3*e+2])return e+(this._data[3*e+0]>>22);return 0}copyCellsFrom(e,t,n,r,i){let a=e._data;if(i)for(let i=r-1;i>=0;i--){for(let e=0;e<3;e++)this._data[3*(n+i)+e]=a[3*(t+i)+e];268435456&a[3*(t+i)+2]&&(this._extendedAttrs[n+i]=e._extendedAttrs[t+i])}else for(let i=0;i<r;i++){for(let e=0;e<3;e++)this._data[3*(n+i)+e]=a[3*(t+i)+e];268435456&a[3*(t+i)+2]&&(this._extendedAttrs[n+i]=e._extendedAttrs[t+i])}let o=Object.keys(e._combined);for(let r=0;r<o.length;r++){let i=parseInt(o[r],10);i>=t&&(this._combined[i-t+n]=e._combined[i])}}translateToString(e,t,n,r){t??=0,n??=this.length,e&&(n=Math.min(n,this.getTrimmedLength())),r&&(r.length=0);let i=``;for(;t<n;){let e=this._data[3*t+0],n=2097151&e,s=2097152&e?this._combined[t]:n?(0,o.stringFromCodePoint)(n):a.WHITESPACE_CELL_CHAR;if(i+=s,r)for(let e=0;e<s.length;++e)r.push(t);t+=e>>22||1}return r&&r.push(t),i}}t.BufferLine=c},4841:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.getRangeLength=void 0,t.getRangeLength=function(e,t){if(e.start.y>e.end.y)throw Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}},4634:(e,t)=>{function n(e,t,n){if(t===e.length-1)return e[t].getTrimmedLength();let r=!e[t].hasContent(n-1)&&e[t].getWidth(n-1)===1,i=e[t+1].getWidth(0)===2;return r&&i?n-1:n}Object.defineProperty(t,`__esModule`,{value:!0}),t.getWrappedLineTrimmedLength=t.reflowSmallerGetNewLineLengths=t.reflowLargerApplyNewLayout=t.reflowLargerCreateNewLayout=t.reflowLargerGetLinesToRemove=void 0,t.reflowLargerGetLinesToRemove=function(e,t,r,i,a){let o=[];for(let s=0;s<e.length-1;s++){let c=s,l=e.get(++c);if(!l.isWrapped)continue;let u=[e.get(s)];for(;c<e.length&&l.isWrapped;)u.push(l),l=e.get(++c);if(i>=s&&i<c){s+=u.length-1;continue}let d=0,f=n(u,d,t),p=1,m=0;for(;p<u.length;){let e=n(u,p,t),i=e-m,o=r-f,s=Math.min(i,o);u[d].copyCellsFrom(u[p],m,f,s,!1),f+=s,f===r&&(d++,f=0),m+=s,m===e&&(p++,m=0),f===0&&d!==0&&u[d-1].getWidth(r-1)===2&&(u[d].copyCellsFrom(u[d-1],r-1,f++,1,!1),u[d-1].setCell(r-1,a))}u[d].replaceCells(f,r,a);let h=0;for(let e=u.length-1;e>0&&(e>d||u[e].getTrimmedLength()===0);e--)h++;h>0&&(o.push(s+u.length-h),o.push(h)),s+=u.length-1}return o},t.reflowLargerCreateNewLayout=function(e,t){let n=[],r=0,i=t[r],a=0;for(let o=0;o<e.length;o++)if(i===o){let n=t[++r];e.onDeleteEmitter.fire({index:o-a,amount:n}),o+=n-1,a+=n,i=t[++r]}else n.push(o);return{layout:n,countRemoved:a}},t.reflowLargerApplyNewLayout=function(e,t){let n=[];for(let r=0;r<t.length;r++)n.push(e.get(t[r]));for(let t=0;t<n.length;t++)e.set(t,n[t]);e.length=t.length},t.reflowSmallerGetNewLineLengths=function(e,t,r){let i=[],a=e.map(((r,i)=>n(e,i,t))).reduce(((e,t)=>e+t)),o=0,s=0,c=0;for(;c<a;){if(a-c<r){i.push(a-c);break}o+=r;let l=n(e,s,t);o>l&&(o-=l,s++);let u=e[s].getWidth(o-1)===2;u&&o--;let d=u?r-1:r;i.push(d),c+=d}return i},t.getWrappedLineTrimmedLength=n},5295:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.BufferSet=void 0;let r=n(8460),i=n(844),a=n(9092);class o extends i.Disposable{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this.register(new r.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange(`scrollback`,(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange(`tabStopWidth`,(()=>this.setupTabStops())))}reset(){this._normal=new a.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new a.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}}t.BufferSet=o},511:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.CellData=void 0;let r=n(482),i=n(643),a=n(3734);class o extends a.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new a.ExtendedAttrs,this.combinedData=``}static fromCharData(e){let t=new o;return t.setFromCharData(e),t}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,r.stringFromCodePoint)(2097151&this.content):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e){this.fg=e[i.CHAR_DATA_ATTR_INDEX],this.bg=0;let t=!1;if(e[i.CHAR_DATA_CHAR_INDEX].length>2)t=!0;else if(e[i.CHAR_DATA_CHAR_INDEX].length===2){let n=e[i.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[i.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=r&&r<=57343?this.content=1024*(n-55296)+r-56320+65536|e[i.CHAR_DATA_WIDTH_INDEX]<<22:t=!0}else t=!0}else this.content=e[i.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|e[i.CHAR_DATA_WIDTH_INDEX]<<22;t&&(this.combinedData=e[i.CHAR_DATA_CHAR_INDEX],this.content=2097152|e[i.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=o},643:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=0,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR=``,t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=` `,t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},4863:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.Marker=void 0;let r=n(8460),i=n(844);class a{get id(){return this._id}constructor(e){this.line=e,this.isDisposed=!1,this._disposables=[],this._id=a._nextId++,this._onDispose=this.register(new r.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,i.disposeArray)(this._disposables),this._disposables.length=0)}register(e){return this._disposables.push(e),e}}t.Marker=a,a._nextId=1},7116:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.DEFAULT_CHARSET=t.CHARSETS=void 0,t.CHARSETS={},t.DEFAULT_CHARSET=t.CHARSETS.B,t.CHARSETS[0]={"`":`◆`,a:`▒`,b:`␉`,c:`␌`,d:`␍`,e:`␊`,f:`°`,g:`±`,h:`␤`,i:`␋`,j:`┘`,k:`┐`,l:`┌`,m:`└`,n:`┼`,o:`⎺`,p:`⎻`,q:`─`,r:`⎼`,s:`⎽`,t:`├`,u:`┤`,v:`┴`,w:`┬`,x:`│`,y:`≤`,z:`≥`,"{":`π`,"|":`≠`,"}":`£`,"~":`·`},t.CHARSETS.A={"#":`£`},t.CHARSETS.B=void 0,t.CHARSETS[4]={"#":`£`,"@":`¾`,"[":`ij`,"\\":`½`,"]":`|`,"{":`¨`,"|":`f`,"}":`¼`,"~":`´`},t.CHARSETS.C=t.CHARSETS[5]={"[":`Ä`,"\\":`Ö`,"]":`Å`,"^":`Ü`,"`":`é`,"{":`ä`,"|":`ö`,"}":`å`,"~":`ü`},t.CHARSETS.R={"#":`£`,"@":`à`,"[":`°`,"\\":`ç`,"]":`§`,"{":`é`,"|":`ù`,"}":`è`,"~":`¨`},t.CHARSETS.Q={"@":`à`,"[":`â`,"\\":`ç`,"]":`ê`,"^":`î`,"`":`ô`,"{":`é`,"|":`ù`,"}":`è`,"~":`û`},t.CHARSETS.K={"@":`§`,"[":`Ä`,"\\":`Ö`,"]":`Ü`,"{":`ä`,"|":`ö`,"}":`ü`,"~":`ß`},t.CHARSETS.Y={"#":`£`,"@":`§`,"[":`°`,"\\":`ç`,"]":`é`,"`":`ù`,"{":`à`,"|":`ò`,"}":`è`,"~":`ì`},t.CHARSETS.E=t.CHARSETS[6]={"@":`Ä`,"[":`Æ`,"\\":`Ø`,"]":`Å`,"^":`Ü`,"`":`ä`,"{":`æ`,"|":`ø`,"}":`å`,"~":`ü`},t.CHARSETS.Z={"#":`£`,"@":`§`,"[":`¡`,"\\":`Ñ`,"]":`¿`,"{":`°`,"|":`ñ`,"}":`ç`},t.CHARSETS.H=t.CHARSETS[7]={"@":`É`,"[":`Ä`,"\\":`Ö`,"]":`Å`,"^":`Ü`,"`":`é`,"{":`ä`,"|":`ö`,"}":`å`,"~":`ü`},t.CHARSETS[`=`]={"#":`ù`,"@":`à`,"[":`é`,"\\":`ç`,"]":`ê`,"^":`î`,_:`è`,"`":`ô`,"{":`ä`,"|":`ö`,"}":`ü`,"~":`û`}},2584:(e,t)=>{var n,r,i;Object.defineProperty(t,`__esModule`,{value:!0}),t.C1_ESCAPED=t.C1=t.C0=void 0,function(e){e.NUL=`\0`,e.SOH=``,e.STX=``,e.ETX=``,e.EOT=``,e.ENQ=``,e.ACK=``,e.BEL=`\x07`,e.BS=`\b`,e.HT=` `,e.LF=`
351
+ `,e.VT=`\v`,e.FF=`\f`,e.CR=`\r`,e.SO=``,e.SI=``,e.DLE=``,e.DC1=``,e.DC2=``,e.DC3=``,e.DC4=``,e.NAK=``,e.SYN=``,e.ETB=``,e.CAN=``,e.EM=``,e.SUB=``,e.ESC=`\x1B`,e.FS=``,e.GS=``,e.RS=``,e.US=``,e.SP=` `,e.DEL=``}(n||(t.C0=n={})),function(e){e.PAD=`€`,e.HOP=``,e.BPH=`‚`,e.NBH=`ƒ`,e.IND=`„`,e.NEL=`…`,e.SSA=`†`,e.ESA=`‡`,e.HTS=`ˆ`,e.HTJ=`‰`,e.VTS=`Š`,e.PLD=`‹`,e.PLU=`Œ`,e.RI=``,e.SS2=`Ž`,e.SS3=``,e.DCS=``,e.PU1=`‘`,e.PU2=`’`,e.STS=`“`,e.CCH=`”`,e.MW=`•`,e.SPA=`–`,e.EPA=`—`,e.SOS=`˜`,e.SGCI=`™`,e.SCI=`š`,e.CSI=`›`,e.ST=`œ`,e.OSC=``,e.PM=`ž`,e.APC=`Ÿ`}(r||(t.C1=r={})),function(e){e.ST=`${n.ESC}\\`}(i||(t.C1_ESCAPED=i={}))},7399:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.evaluateKeyboardEvent=void 0;let r=n(2584),i={48:[`0`,`)`],49:[`1`,`!`],50:[`2`,`@`],51:[`3`,`#`],52:[`4`,`$`],53:[`5`,`%`],54:[`6`,`^`],55:[`7`,`&`],56:[`8`,`*`],57:[`9`,`(`],186:[`;`,`:`],187:[`=`,`+`],188:[`,`,`<`],189:[`-`,`_`],190:[`.`,`>`],191:[`/`,`?`],192:["`",`~`],219:[`[`,`{`],220:[`\\`,`|`],221:[`]`,`}`],222:[`'`,`"`]};t.evaluateKeyboardEvent=function(e,t,n,a){let o={type:0,cancel:!1,key:void 0},s=!!e.shiftKey|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key===`UIKeyInputUpArrow`?o.key=t?r.C0.ESC+`OA`:r.C0.ESC+`[A`:e.key===`UIKeyInputLeftArrow`?o.key=t?r.C0.ESC+`OD`:r.C0.ESC+`[D`:e.key===`UIKeyInputRightArrow`?o.key=t?r.C0.ESC+`OC`:r.C0.ESC+`[C`:e.key===`UIKeyInputDownArrow`&&(o.key=t?r.C0.ESC+`OB`:r.C0.ESC+`[B`);break;case 8:o.key=e.ctrlKey?`\b`:r.C0.DEL,e.altKey&&(o.key=r.C0.ESC+o.key);break;case 9:if(e.shiftKey){o.key=r.C0.ESC+`[Z`;break}o.key=r.C0.HT,o.cancel=!0;break;case 13:o.key=e.altKey?r.C0.ESC+r.C0.CR:r.C0.CR,o.cancel=!0;break;case 27:o.key=r.C0.ESC,e.altKey&&(o.key=r.C0.ESC+r.C0.ESC),o.cancel=!0;break;case 37:if(e.metaKey)break;s?(o.key=r.C0.ESC+`[1;`+(s+1)+`D`,o.key===r.C0.ESC+`[1;3D`&&(o.key=r.C0.ESC+(n?`b`:`[1;5D`))):o.key=t?r.C0.ESC+`OD`:r.C0.ESC+`[D`;break;case 39:if(e.metaKey)break;s?(o.key=r.C0.ESC+`[1;`+(s+1)+`C`,o.key===r.C0.ESC+`[1;3C`&&(o.key=r.C0.ESC+(n?`f`:`[1;5C`))):o.key=t?r.C0.ESC+`OC`:r.C0.ESC+`[C`;break;case 38:if(e.metaKey)break;s?(o.key=r.C0.ESC+`[1;`+(s+1)+`A`,n||o.key!==r.C0.ESC+`[1;3A`||(o.key=r.C0.ESC+`[1;5A`)):o.key=t?r.C0.ESC+`OA`:r.C0.ESC+`[A`;break;case 40:if(e.metaKey)break;s?(o.key=r.C0.ESC+`[1;`+(s+1)+`B`,n||o.key!==r.C0.ESC+`[1;3B`||(o.key=r.C0.ESC+`[1;5B`)):o.key=t?r.C0.ESC+`OB`:r.C0.ESC+`[B`;break;case 45:e.shiftKey||e.ctrlKey||(o.key=r.C0.ESC+`[2~`);break;case 46:o.key=s?r.C0.ESC+`[3;`+(s+1)+`~`:r.C0.ESC+`[3~`;break;case 36:o.key=s?r.C0.ESC+`[1;`+(s+1)+`H`:t?r.C0.ESC+`OH`:r.C0.ESC+`[H`;break;case 35:o.key=s?r.C0.ESC+`[1;`+(s+1)+`F`:t?r.C0.ESC+`OF`:r.C0.ESC+`[F`;break;case 33:e.shiftKey?o.type=2:e.ctrlKey?o.key=r.C0.ESC+`[5;`+(s+1)+`~`:o.key=r.C0.ESC+`[5~`;break;case 34:e.shiftKey?o.type=3:e.ctrlKey?o.key=r.C0.ESC+`[6;`+(s+1)+`~`:o.key=r.C0.ESC+`[6~`;break;case 112:o.key=s?r.C0.ESC+`[1;`+(s+1)+`P`:r.C0.ESC+`OP`;break;case 113:o.key=s?r.C0.ESC+`[1;`+(s+1)+`Q`:r.C0.ESC+`OQ`;break;case 114:o.key=s?r.C0.ESC+`[1;`+(s+1)+`R`:r.C0.ESC+`OR`;break;case 115:o.key=s?r.C0.ESC+`[1;`+(s+1)+`S`:r.C0.ESC+`OS`;break;case 116:o.key=s?r.C0.ESC+`[15;`+(s+1)+`~`:r.C0.ESC+`[15~`;break;case 117:o.key=s?r.C0.ESC+`[17;`+(s+1)+`~`:r.C0.ESC+`[17~`;break;case 118:o.key=s?r.C0.ESC+`[18;`+(s+1)+`~`:r.C0.ESC+`[18~`;break;case 119:o.key=s?r.C0.ESC+`[19;`+(s+1)+`~`:r.C0.ESC+`[19~`;break;case 120:o.key=s?r.C0.ESC+`[20;`+(s+1)+`~`:r.C0.ESC+`[20~`;break;case 121:o.key=s?r.C0.ESC+`[21;`+(s+1)+`~`:r.C0.ESC+`[21~`;break;case 122:o.key=s?r.C0.ESC+`[23;`+(s+1)+`~`:r.C0.ESC+`[23~`;break;case 123:o.key=s?r.C0.ESC+`[24;`+(s+1)+`~`:r.C0.ESC+`[24~`;break;default:if(!e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)if(n&&!a||!e.altKey||e.metaKey)!n||e.altKey||e.ctrlKey||e.shiftKey||!e.metaKey?e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?o.key=e.key:e.key&&e.ctrlKey&&(e.key===`_`&&(o.key=r.C0.US),e.key===`@`&&(o.key=r.C0.NUL)):e.keyCode===65&&(o.type=1);else{let t=i[e.keyCode]?.[+!!e.shiftKey];if(t)o.key=r.C0.ESC+t;else if(e.keyCode>=65&&e.keyCode<=90){let t=e.ctrlKey?e.keyCode-64:e.keyCode+32,n=String.fromCharCode(t);e.shiftKey&&(n=n.toUpperCase()),o.key=r.C0.ESC+n}else if(e.keyCode===32)o.key=r.C0.ESC+(e.ctrlKey?r.C0.NUL:` `);else if(e.key===`Dead`&&e.code.startsWith(`Key`)){let t=e.code.slice(3,4);e.shiftKey||(t=t.toLowerCase()),o.key=r.C0.ESC+t,o.cancel=!0}}else e.keyCode>=65&&e.keyCode<=90?o.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?o.key=r.C0.NUL:e.keyCode>=51&&e.keyCode<=55?o.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?o.key=r.C0.DEL:e.keyCode===219?o.key=r.C0.ESC:e.keyCode===220?o.key=r.C0.FS:e.keyCode===221&&(o.key=r.C0.GS)}return o}},482:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)},t.utf32ToString=function(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode(55296+(t>>10))+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=1024*(this._interim-55296)+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=1024*(i-55296)+o-56320+65536:(t[r++]=i,t[r++]=o)}else i!==65279&&(t[r++]=i)}return r}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r,i,a,o,s=0,c=0,l=0;if(this.interim[0]){let r=!1,i=this.interim[0];i&=(224&i)==192?31:(240&i)==224?15:7;let a,o=0;for(;(a=63&this.interim[++o])&&o<4;)i<<=6,i|=a;let c=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(a=e[l++],(192&a)!=128){l--,r=!0;break}this.interim[o++]=a,i<<=6,i|=63&a}r||(c===2?i<128?l--:t[s++]=i:c===3?i<2048||i>=55296&&i<=57343||i===65279||(t[s++]=i):i<65536||i>1114111||(t[s++]=i)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;!(!(d<u)||128&(r=e[d])||128&(i=e[d+1])||128&(a=e[d+2])||128&(o=e[d+3]));)t[s++]=r,t[s++]=i,t[s++]=a,t[s++]=o,d+=4;if(r=e[d++],r<128)t[s++]=r;else if((224&r)==192){if(d>=n)return this.interim[0]=r,s;if(i=e[d++],(192&i)!=128){d--;continue}if(c=(31&r)<<6|63&i,c<128){d--;continue}t[s++]=c}else if((240&r)==224){if(d>=n)return this.interim[0]=r,s;if(i=e[d++],(192&i)!=128){d--;continue}if(d>=n)return this.interim[0]=r,this.interim[1]=i,s;if(a=e[d++],(192&a)!=128){d--;continue}if(c=(15&r)<<12|(63&i)<<6|63&a,c<2048||c>=55296&&c<=57343||c===65279)continue;t[s++]=c}else if((248&r)==240){if(d>=n)return this.interim[0]=r,s;if(i=e[d++],(192&i)!=128){d--;continue}if(d>=n)return this.interim[0]=r,this.interim[1]=i,s;if(a=e[d++],(192&a)!=128){d--;continue}if(d>=n)return this.interim[0]=r,this.interim[1]=i,this.interim[2]=a,s;if(o=e[d++],(192&o)!=128){d--;continue}if(c=(7&r)<<18|(63&i)<<12|(63&a)<<6|63&o,c<65536||c>1114111)continue;t[s++]=c}}return s}}},225:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.UnicodeV6=void 0;let r=n(1480),i=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],a=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],o;t.UnicodeV6=class{constructor(){if(this.version=`6`,!o){o=new Uint8Array(65536),o.fill(1),o[0]=0,o.fill(0,1,32),o.fill(0,127,160),o.fill(2,4352,4448),o[9001]=2,o[9002]=2,o.fill(2,11904,42192),o[12351]=1,o.fill(2,44032,55204),o.fill(2,63744,64256),o.fill(2,65040,65050),o.fill(2,65072,65136),o.fill(2,65280,65377),o.fill(2,65504,65511);for(let e=0;e<i.length;++e)o.fill(0,i[e][0],i[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?o[e]:function(e,t){let n,r=0,i=t.length-1;if(e<t[0][0]||e>t[i][1])return!1;for(;i>=r;)if(n=r+i>>1,e>t[n][1])r=n+1;else{if(!(e<t[n][0]))return!0;i=n-1}return!1}(e,a)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),i=n===0&&t!==0;if(i){let e=r.UnicodeService.extractWidth(t);e===0?i=!1:e>n&&(n=e)}return r.UnicodeService.createPropertyValue(0,n,i)}}},5981:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.WriteBuffer=void 0;let r=n(8460),i=n(844);class a extends i.Disposable{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new r.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t)return void(this._syncCalls=0);if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let n;for(this._isSyncWriting=!0;n=this._writeBuffer.shift();){this._action(n);let e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>5e7)throw Error(`write data discarded, use flow control to avoid losing data`);if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let n=e||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){let e=this._writeBuffer[this._bufferOffset],r=this._action(e,t);if(r){r.catch((e=>(queueMicrotask((()=>{throw e})),Promise.resolve(!1)))).then(e=>Date.now()-n>=12?setTimeout((()=>this._innerWrite(0,e))):this._innerWrite(n,e));return}let i=this._callbacks[this._bufferOffset];if(i&&i(),this._bufferOffset++,this._pendingData-=e.length,Date.now()-n>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}t.WriteBuffer=a},5941:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.toRgbString=t.parseColor=void 0;let n=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,r=/^[\da-f]+$/;function i(e,t){let n=e.toString(16),r=n.length<2?`0`+n:n;switch(t){case 4:return n[0];case 8:return r;case 12:return(r+r).slice(0,3);default:return r+r}}t.parseColor=function(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf(`rgb:`)===0){t=t.slice(4);let e=n.exec(t);if(e){let t=e[1]?15:e[4]?255:e[7]?4095:65535;return[Math.round(parseInt(e[1]||e[4]||e[7]||e[10],16)/t*255),Math.round(parseInt(e[2]||e[5]||e[8]||e[11],16)/t*255),Math.round(parseInt(e[3]||e[6]||e[9]||e[12],16)/t*255)]}}else if(t.indexOf(`#`)===0&&(t=t.slice(1),r.exec(t)&&[3,6,9,12].includes(t.length))){let e=t.length/3,n=[0,0,0];for(let r=0;r<3;++r){let i=parseInt(t.slice(e*r,e*r+e),16);n[r]=e===1?i<<4:e===2?i:e===3?i>>4:i>>8}return n}},t.toRgbString=function(e,t=16){let[n,r,a]=e;return`rgb:${i(n,t)}/${i(r,t)}/${i(a,t)}`}},5770:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.PAYLOAD_LIMIT=void 0,t.PAYLOAD_LIMIT=1e7},6351:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.DcsHandler=t.DcsParser=void 0;let r=n(482),i=n(8742),a=n(5770),o=[];t.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=o,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=o}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=o,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||o,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(t);else this._handlerFb(this._ident,`HOOK`,t)}put(e,t,n){if(this._active.length)for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n);else this._handlerFb(this._ident,`PUT`,(0,r.utf32ToString)(e,t,n))}unhook(e,t=!0){if(this._active.length){let n=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&!1===n){for(;r>=0&&(n=this._active[r].unhook(e),!0!==n);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}else this._handlerFb(this._ident,`UNHOOK`,e);this._active=o,this._ident=0}};let s=new i.Params;s.addParam(0),t.DcsHandler=class{constructor(e){this._handler=e,this._data=``,this._params=s,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():s,this._data=``,this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=(0,r.utf32ToString)(e,t,n),this._data.length>a.PAYLOAD_LIMIT&&(this._data=``,this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then((e=>(this._params=s,this._data=``,this._hitLimit=!1,e)));return this._params=s,this._data=``,this._hitLimit=!1,t}}},2015:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.EscapeSequenceParser=t.VT500_TRANSITION_TABLE=t.TransitionTable=void 0;let r=n(844),i=n(8742),a=n(6242),o=n(6351);class s{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,n,r){this.table[t<<8|e]=n<<4|r}addMany(e,t,n,r){for(let i=0;i<e.length;i++)this.table[t<<8|e[i]]=n<<4|r}}t.TransitionTable=s,t.VT500_TRANSITION_TABLE=function(){let e=new s(4095),t=Array.apply(null,Array(256)).map(((e,t)=>t)),n=(e,n)=>t.slice(e,n),r=n(32,127),i=n(0,24);i.push(25),i.push.apply(i,n(28,32));let a=n(0,14),o;for(o in e.setDefault(1,0),e.addMany(r,0,2,0),a)e.addMany([24,26,153,154],o,3,0),e.addMany(n(128,144),o,3,0),e.addMany(n(144,152),o,3,0),e.add(156,o,0,0),e.add(27,o,11,1),e.add(157,o,4,8),e.addMany([152,158,159],o,0,7),e.add(155,o,11,3),e.add(144,o,11,9);return e.addMany(i,0,3,0),e.addMany(i,1,3,1),e.add(127,1,0,1),e.addMany(i,8,0,8),e.addMany(i,3,3,3),e.add(127,3,0,3),e.addMany(i,4,3,4),e.add(127,4,0,4),e.addMany(i,6,3,6),e.addMany(i,5,3,5),e.add(127,5,0,5),e.addMany(i,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(r,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(n(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(r,7,0,7),e.addMany(i,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(n(64,127),3,7,0),e.addMany(n(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(n(48,60),4,8,4),e.addMany(n(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(n(32,64),6,0,6),e.add(127,6,0,6),e.addMany(n(64,127),6,0,0),e.addMany(n(32,48),3,9,5),e.addMany(n(32,48),5,9,5),e.addMany(n(48,64),5,0,6),e.addMany(n(64,127),5,7,0),e.addMany(n(32,48),4,9,5),e.addMany(n(32,48),1,9,2),e.addMany(n(32,48),2,9,2),e.addMany(n(48,127),2,10,0),e.addMany(n(48,80),1,10,0),e.addMany(n(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(n(96,127),1,10,0),e.add(80,1,11,9),e.addMany(i,9,0,9),e.add(127,9,0,9),e.addMany(n(28,32),9,0,9),e.addMany(n(32,48),9,9,12),e.addMany(n(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(i,11,0,11),e.addMany(n(32,128),11,0,11),e.addMany(n(28,32),11,0,11),e.addMany(i,10,0,10),e.add(127,10,0,10),e.addMany(n(28,32),10,0,10),e.addMany(n(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(n(32,48),10,9,12),e.addMany(i,12,0,12),e.add(127,12,0,12),e.addMany(n(28,32),12,0,12),e.addMany(n(32,48),12,9,12),e.addMany(n(48,64),12,0,11),e.addMany(n(64,127),12,12,13),e.addMany(n(64,127),10,12,13),e.addMany(n(64,127),9,12,13),e.addMany(i,13,13,13),e.addMany(r,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(160,0,2,0),e.add(160,8,5,8),e.add(160,6,0,6),e.add(160,11,0,11),e.add(160,13,13,13),e}();class c extends r.Disposable{constructor(e=t.VT500_TRANSITION_TABLE){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new i.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(e,t,n)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,t)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,r.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new a.OscParser),this._dcsParser=this.register(new o.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:`\\`},(()=>!0))}_identifier(e,t=[64,126]){let n=0;if(e.prefix){if(e.prefix.length>1)throw Error(`only one byte as prefix supported`);if(n=e.prefix.charCodeAt(0),n&&60>n||n>63)throw Error(`prefix must be in range 0x3c .. 0x3f`)}if(e.intermediates){if(e.intermediates.length>2)throw Error(`only two bytes as intermediates are supported`);for(let t=0;t<e.intermediates.length;++t){let r=e.intermediates.charCodeAt(t);if(32>r||r>47)throw Error(`intermediate must be in range 0x20 .. 0x2f`);n<<=8,n|=r}}if(e.final.length!==1)throw Error(`final must be a single byte`);let r=e.final.charCodeAt(0);if(t[0]>r||r>t[1])throw Error(`final must be in range ${t[0]} .. ${t[1]}`);return n<<=8,n|=r,n}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(255&e)),e>>=8;return t.reverse().join(``)}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let n=this._identifier(e,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let r=this._escHandlers[n];return r.push(t),{dispose:()=>{let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let n=this._identifier(e);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let r=this._csiHandlers[n];return r.push(t),{dispose:()=>{let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,n,r,i){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=n,this._parseStack.transition=r,this._parseStack.chunkPos=i}parse(e,t,n){let r,i=0,a=0,o=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,o=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,Error(`improper continuation due to previous async handler, giving up parsing`);let t=this._parseStack.handlers,a=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(!1===n&&a>-1){for(;a>=0&&(r=t[a](this._params),!0!==r);a--)if(r instanceof Promise)return this._parseStack.handlerPos=a,r}this._parseStack.handlers=[];break;case 4:if(!1===n&&a>-1){for(;a>=0&&(r=t[a](),!0!==r);a--)if(r instanceof Promise)return this._parseStack.handlerPos=a,r}this._parseStack.handlers=[];break;case 6:if(i=e[this._parseStack.chunkPos],r=this._dcsParser.unhook(i!==24&&i!==26,n),r)return r;i===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(i=e[this._parseStack.chunkPos],r=this._oscParser.end(i!==24&&i!==26,n),r)return r;i===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,o=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let n=o;n<t;++n){switch(i=e[n],a=this._transitions.table[this.currentState<<8|(i<160?i:160)],a>>4){case 2:for(let r=n+1;;++r){if(r>=t||(i=e[r])<32||i>126&&i<160){this._printHandler(e,n,r),n=r-1;break}if(++r>=t||(i=e[r])<32||i>126&&i<160){this._printHandler(e,n,r),n=r-1;break}if(++r>=t||(i=e[r])<32||i>126&&i<160){this._printHandler(e,n,r),n=r-1;break}if(++r>=t||(i=e[r])<32||i>126&&i<160){this._printHandler(e,n,r),n=r-1;break}}break;case 3:this._executeHandlers[i]?this._executeHandlers[i]():this._executeHandlerFb(i),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:n,code:i,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let o=this._csiHandlers[this._collect<<8|i],s=o?o.length-1:-1;for(;s>=0&&(r=o[s](this._params),!0!==r);s--)if(r instanceof Promise)return this._preserveStack(3,o,s,a,n),r;s<0&&this._csiHandlerFb(this._collect<<8|i,this._params),this.precedingJoinState=0;break;case 8:do switch(i){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(i-48)}while(++n<t&&(i=e[n])>47&&i<60);n--;break;case 9:this._collect<<=8,this._collect|=i;break;case 10:let c=this._escHandlers[this._collect<<8|i],l=c?c.length-1:-1;for(;l>=0&&(r=c[l](),!0!==r);l--)if(r instanceof Promise)return this._preserveStack(4,c,l,a,n),r;l<0&&this._escHandlerFb(this._collect<<8|i),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|i,this._params);break;case 13:for(let r=n+1;;++r)if(r>=t||(i=e[r])===24||i===26||i===27||i>127&&i<160){this._dcsParser.put(e,n,r),n=r-1;break}break;case 14:if(r=this._dcsParser.unhook(i!==24&&i!==26),r)return this._preserveStack(6,[],0,a,n),r;i===27&&(a|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let r=n+1;;r++)if(r>=t||(i=e[r])<32||i>127&&i<160){this._oscParser.put(e,n,r),n=r-1;break}break;case 6:if(r=this._oscParser.end(i!==24&&i!==26),r)return this._preserveStack(5,[],0,a,n),r;i===27&&(a|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&a}}}t.EscapeSequenceParser=c},6242:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.OscHandler=t.OscParser=void 0;let r=n(5770),i=n(482),a=[];t.OscParser=class{constructor(){this._state=0,this._active=a,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=a}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=a,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||a,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].start();else this._handlerFb(this._id,`START`)}_put(e,t,n){if(this._active.length)for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n);else this._handlerFb(this._id,`PUT`,(0,i.utf32ToString)(e,t,n))}start(){this.reset(),this._state=1}put(e,t,n){if(this._state!==3){if(this._state===1)for(;t<n;){let n=e[t++];if(n===59){this._state=2,this._start();break}if(n<48||57<n)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+n-48}this._state===2&&n-t>0&&this._put(e,t,n)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let n=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&!1===n){for(;r>=0&&(n=this._active[r].end(e),!0!==n);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}else this._handlerFb(this._id,`END`,e);this._active=a,this._id=-1,this._state=0}}},t.OscHandler=class{constructor(e){this._handler=e,this._data=``,this._hitLimit=!1}start(){this._data=``,this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=(0,i.utf32ToString)(e,t,n),this._data.length>r.PAYLOAD_LIMIT&&(this._data=``,this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then((e=>(this._data=``,this._hitLimit=!1,e)));return this._data=``,this._hitLimit=!1,t}}},8742:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.Params=void 0;let n=2147483647;class r{static fromArray(e){let t=new r;if(!e.length)return t;for(let n=+!!Array.isArray(e[0]);n<e.length;++n){let r=e[n];if(Array.isArray(r))for(let e=0;e<r.length;++e)t.addSubParam(r[e]);else t.addParam(r)}return t}constructor(e=32,t=32){if(this.maxLength=e,this.maxSubParamsLength=t,t>256)throw Error(`maxSubParamsLength must not be greater than 256`);this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(t),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){let e=new r(this.maxLength,this.maxSubParamsLength);return e.params.set(this.params),e.length=this.length,e._subParams.set(this._subParams),e._subParamsLength=this._subParamsLength,e._subParamsIdx.set(this._subParamsIdx),e._rejectDigits=this._rejectDigits,e._rejectSubDigits=this._rejectSubDigits,e._digitIsSub=this._digitIsSub,e}toArray(){let e=[];for(let t=0;t<this.length;++t){e.push(this.params[t]);let n=this._subParamsIdx[t]>>8,r=255&this._subParamsIdx[t];r-n>0&&e.push(Array.prototype.slice.call(this._subParams,n,r))}return e}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(e<-1)throw Error(`values lesser than -1 are not allowed`);this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>n?n:e}}addSubParam(e){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(e<-1)throw Error(`values lesser than -1 are not allowed`);this._subParams[this._subParamsLength++]=e>n?n:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return(255&this._subParamsIdx[e])-(this._subParamsIdx[e]>>8)>0}getSubParams(e){let t=this._subParamsIdx[e]>>8,n=255&this._subParamsIdx[e];return n-t>0?this._subParams.subarray(t,n):null}getSubParamsAll(){let e={};for(let t=0;t<this.length;++t){let n=this._subParamsIdx[t]>>8,r=255&this._subParamsIdx[t];r-n>0&&(e[t]=this._subParams.slice(n,r))}return e}addDigit(e){let t;if(this._rejectDigits||!(t=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let r=this._digitIsSub?this._subParams:this.params,i=r[t-1];r[t-1]=~i?Math.min(10*i+e,n):e}}t.Params=r},5741:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.AddonManager=void 0,t.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let n={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(n),t.dispose=()=>this._wrappedAddonDispose(n),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===e){t=n;break}if(t===-1)throw Error(`Could not dispose an addon that has not been loaded`);e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}}},8771:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.BufferApiView=void 0;let r=n(3785),i=n(511);t.BufferApiView=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new r.BufferLineApiView(t)}getNullCell(){return new i.CellData}}},3785:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.BufferLineApiView=void 0;let r=n(511);t.BufferLineApiView=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new r.CellData)}translateToString(e,t,n){return this._line.translateToString(e,t,n)}}},8285:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.BufferNamespaceApi=void 0;let r=n(8771),i=n(8460),a=n(844);class o extends a.Disposable{constructor(e){super(),this._core=e,this._onBufferChange=this.register(new i.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new r.BufferApiView(this._core.buffers.normal,`normal`),this._alternate=new r.BufferApiView(this._core.buffers.alt,`alternate`),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw Error(`Active buffer is neither normal nor alternate`)}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}t.BufferNamespaceApi=o},7975:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.ParserApi=void 0,t.ParserApi=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,(e=>t(e.toArray())))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,((e,n)=>t(e,n.toArray())))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}}},7090:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.UnicodeApi=void 0,t.UnicodeApi=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}}},744:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.BufferService=t.MINIMUM_ROWS=t.MINIMUM_COLS=void 0;let a=n(8460),o=n(844),s=n(5295),c=n(2585);t.MINIMUM_COLS=2,t.MINIMUM_ROWS=1;let l=t.BufferService=class extends o.Disposable{get buffer(){return this.buffers.active}constructor(e){super(),this.isUserScrolling=!1,this._onResize=this.register(new a.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new a.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,t.MINIMUM_COLS),this.rows=Math.max(e.rawOptions.rows||0,t.MINIMUM_ROWS),this.buffers=this.register(new s.BufferSet(e,this))}resize(e,t){this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let n=this.buffer,r;r=this._cachedBlankLine,r&&r.length===this.cols&&r.getFg(0)===e.fg&&r.getBg(0)===e.bg||(r=n.getBlankLine(e,t),this._cachedBlankLine=r),r.isWrapped=t;let i=n.ybase+n.scrollTop,a=n.ybase+n.scrollBottom;if(n.scrollTop===0){let e=n.lines.isFull;a===n.lines.length-1?e?n.lines.recycle().copyFrom(r):n.lines.push(r.clone()):n.lines.splice(a+1,0,r.clone()),e?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let e=a-i+1;n.lines.shiftElements(i+1,e-1,-1),n.lines.set(a,r.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(e,t,n){let r=this.buffer;if(e<0){if(r.ydisp===0)return;this.isUserScrolling=!0}else e+r.ydisp>=r.ybase&&(this.isUserScrolling=!1);let i=r.ydisp;r.ydisp=Math.max(Math.min(r.ydisp+e,r.ybase),0),i!==r.ydisp&&(t||this._onScroll.fire(r.ydisp))}};t.BufferService=l=r([i(0,c.IOptionsService)],l)},7994:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.CharsetService=void 0,t.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}}},1753:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.CoreMouseService=void 0;let a=n(2585),o=n(8460),s=n(844),c={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button!==4&&e.action===1&&(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>e.action!==32||e.button!==3},ANY:{events:31,restrict:e=>!0}};function l(e,t){let n=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(n|=64,n|=e.action):(n|=3&e.button,4&e.button&&(n|=64),8&e.button&&(n|=128),e.action===32?n|=32:e.action!==0||t||(n|=3)),n}let u=String.fromCharCode,d={DEFAULT:e=>{let t=[l(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?``:`${u(t[0])}${u(t[1])}${u(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?`m`:`M`;return`[<${l(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?`m`:`M`;return`[<${l(e,!0)};${e.x};${e.y}${t}`}},f=t.CoreMouseService=class extends s.Disposable{constructor(e,t){super(),this._bufferService=e,this._coreService=t,this._protocols={},this._encodings={},this._activeProtocol=``,this._activeEncoding=``,this._lastEvent=null,this._onProtocolChange=this.register(new o.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(let e of Object.keys(c))this.addProtocol(e,c[e]);for(let e of Object.keys(d))this.addEncoding(e,d[e]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol=`NONE`,this.activeEncoding=`DEFAULT`,this._lastEvent=null}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding===`SGR_PIXELS`))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding===`DEFAULT`?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(1&e),up:!!(2&e),drag:!!(4&e),move:!!(8&e),wheel:!!(16&e)}}_equalEvents(e,t,n){if(n){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return e.button===t.button&&e.action===t.action&&e.ctrl===t.ctrl&&e.alt===t.alt&&e.shift===t.shift}};t.CoreMouseService=f=r([i(0,a.IBufferService),i(1,a.ICoreService)],f)},6975:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.CoreService=void 0;let a=n(1439),o=n(8460),s=n(844),c=n(2585),l=Object.freeze({insertMode:!1}),u=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0}),d=t.CoreService=class extends s.Disposable{constructor(e,t,n){super(),this._bufferService=e,this._logService=t,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new o.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new o.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new o.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new o.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,a.clone)(l),this.decPrivateModes=(0,a.clone)(u)}reset(){this.modes=(0,a.clone)(l),this.decPrivateModes=(0,a.clone)(u)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`,(()=>e.split(``).map((e=>e.charCodeAt(0))))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`,(()=>e.split(``).map((e=>e.charCodeAt(0))))),this._onBinary.fire(e))}};t.CoreService=d=r([i(0,c.IBufferService),i(1,c.ILogService),i(2,c.IOptionsService)],d)},9074:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.DecorationService=void 0;let r=n(8055),i=n(8460),a=n(844),o=n(6106),s=0,c=0;class l extends a.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new o.SortedList((e=>e?.marker.line)),this._onDecorationRegistered=this.register(new i.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new i.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,a.toDisposable)((()=>this.reset())))}registerDecoration(e){if(e.marker.isDisposed)return;let t=new u(e);if(t){let e=t.marker.onDispose((()=>t.dispose()));t.onDispose((()=>{t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),e.dispose())})),this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,n){let r=0,i=0;for(let a of this._decorations.getKeyIterator(t))r=a.options.x??0,i=r+(a.options.width??1),e>=r&&e<i&&(!n||(a.options.layer??`bottom`)===n)&&(yield a)}forEachDecorationAtCell(e,t,n,r){this._decorations.forEachByKey(t,(t=>{s=t.options.x??0,c=s+(t.options.width??1),e>=s&&e<c&&(!n||(t.options.layer??`bottom`)===n)&&r(t)}))}}t.DecorationService=l;class u extends a.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=r.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=r.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(e){super(),this.options=e,this.onRenderEmitter=this.register(new i.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new i.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position=`full`)}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.InstantiationService=t.ServiceCollection=void 0;let r=n(2585),i=n(8343);class a{constructor(...e){this._entries=new Map;for(let[t,n]of e)this.set(t,n)}set(e,t){let n=this._entries.get(e);return this._entries.set(e,t),n}forEach(e){for(let[t,n]of this._entries.entries())e(t,n)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}}t.ServiceCollection=a,t.InstantiationService=class{constructor(){this._services=new a,this._services.set(r.IInstantiationService,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let n=(0,i.getServiceDependencies)(e).sort(((e,t)=>e.index-t.index)),r=[];for(let t of n){let n=this._services.get(t.id);if(!n)throw Error(`[createInstance] ${e.name} depends on UNKNOWN service ${t.id}.`);r.push(n)}let a=n.length>0?n[0].index:t.length;if(t.length!==a)throw Error(`[createInstance] First service dependency of ${e.name} at position ${a+1} conflicts with ${t.length} static arguments`);return new e(...t,...r)}}},7866:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.traceCall=t.setTraceLogger=t.LogService=void 0;let a=n(844),o=n(2585),s={trace:o.LogLevelEnum.TRACE,debug:o.LogLevelEnum.DEBUG,info:o.LogLevelEnum.INFO,warn:o.LogLevelEnum.WARN,error:o.LogLevelEnum.ERROR,off:o.LogLevelEnum.OFF},c,l=t.LogService=class extends a.Disposable{get logLevel(){return this._logLevel}constructor(e){super(),this._optionsService=e,this._logLevel=o.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange(`logLevel`,(()=>this._updateLogLevel()))),c=this}_updateLogLevel(){this._logLevel=s[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]==`function`&&(e[t]=e[t]())}_log(e,t,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?``:`xterm.js: `)+t,...n)}trace(e,...t){this._logLevel<=o.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=o.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=o.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=o.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=o.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};t.LogService=l=r([i(0,o.IOptionsService)],l),t.setTraceLogger=function(e){c=e},t.traceCall=function(e,t,n){if(typeof n.value!=`function`)throw Error(`not supported`);let r=n.value;n.value=function(...e){if(c.logLevel!==o.LogLevelEnum.TRACE)return r.apply(this,e);c.trace(`GlyphRenderer#${r.name}(${e.map((e=>JSON.stringify(e))).join(`, `)})`);let t=r.apply(this,e);return c.trace(`GlyphRenderer#${r.name} return`,t),t}}},7302:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.OptionsService=t.DEFAULT_OPTIONS=void 0;let r=n(8460),i=n(844);t.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:`block`,cursorWidth:1,cursorInactiveStyle:`outline`,customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:`alt`,fastScrollSensitivity:5,fontFamily:`courier-new, courier, monospace`,fontSize:15,fontWeight:`normal`,fontWeightBold:`bold`,ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:`info`,logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:n(6114).isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:` ()[]{}',"\``,altClickMovesCursor:!0,convertEol:!1,termName:`xterm`,cancelEvents:!1,overviewRulerWidth:0};let a=[`normal`,`bold`,`100`,`200`,`300`,`400`,`500`,`600`,`700`,`800`,`900`];class o extends i.Disposable{constructor(e){super(),this._onOptionChange=this.register(new r.EventEmitter),this.onOptionChange=this._onOptionChange.event;let n={...t.DEFAULT_OPTIONS};for(let t in e)if(t in n)try{let r=e[t];n[t]=this._sanitizeAndValidateOption(t,r)}catch(e){console.error(e)}this.rawOptions=n,this.options={...n},this._setupOptions(),this.register((0,i.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(e,t){return this.onOptionChange((n=>{n===e&&t(this.rawOptions[e])}))}onMultipleOptionChange(e,t){return this.onOptionChange((n=>{e.indexOf(n)!==-1&&t()}))}_setupOptions(){let e=e=>{if(!(e in t.DEFAULT_OPTIONS))throw Error(`No option with key "${e}"`);return this.rawOptions[e]},n=(e,n)=>{if(!(e in t.DEFAULT_OPTIONS))throw Error(`No option with key "${e}"`);n=this._sanitizeAndValidateOption(e,n),this.rawOptions[e]!==n&&(this.rawOptions[e]=n,this._onOptionChange.fire(e))};for(let t in this.rawOptions){let r={get:e.bind(this,t),set:n.bind(this,t)};Object.defineProperty(this.options,t,r)}}_sanitizeAndValidateOption(e,n){switch(e){case`cursorStyle`:if(n||=t.DEFAULT_OPTIONS[e],!function(e){return e===`block`||e===`underline`||e===`bar`}(n))throw Error(`"${n}" is not a valid value for ${e}`);break;case`wordSeparator`:n||=t.DEFAULT_OPTIONS[e];break;case`fontWeight`:case`fontWeightBold`:if(typeof n==`number`&&1<=n&&n<=1e3)break;n=a.includes(n)?n:t.DEFAULT_OPTIONS[e];break;case`cursorWidth`:n=Math.floor(n);case`lineHeight`:case`tabStopWidth`:if(n<1)throw Error(`${e} cannot be less than 1, value: ${n}`);break;case`minimumContrastRatio`:n=Math.max(1,Math.min(21,Math.round(10*n)/10));break;case`scrollback`:if((n=Math.min(n,4294967295))<0)throw Error(`${e} cannot be less than 0, value: ${n}`);break;case`fastScrollSensitivity`:case`scrollSensitivity`:if(n<=0)throw Error(`${e} cannot be less than or equal to 0, value: ${n}`);break;case`rows`:case`cols`:if(!n&&n!==0)throw Error(`${e} must be numeric, value: ${n}`);break;case`windowsPty`:n??={}}return n}}t.OptionsService=o},2660:function(e,t,n){var r=this&&this.__decorate||function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},i=this&&this.__param||function(e,t){return function(n,r){t(n,r,e)}};Object.defineProperty(t,`__esModule`,{value:!0}),t.OscLinkService=void 0;let a=n(2585),o=t.OscLinkService=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let n=t.addMarker(t.ybase+t.y),r={data:e,id:this._nextId++,lines:[n]};return n.onDispose((()=>this._removeMarkerFromLink(r,n))),this._dataByLinkId.set(r.id,r),r.id}let n=e,r=this._getEntryIdKey(n),i=this._entriesWithId.get(r);if(i)return this.addLineToLink(i.id,t.ybase+t.y),i.id;let a=t.addMarker(t.ybase+t.y),o={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[a]};return a.onDispose((()=>this._removeMarkerFromLink(o,a))),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,t){let n=this._dataByLinkId.get(e);if(n&&n.lines.every((e=>e.line!==t))){let e=this._bufferService.buffer.addMarker(t);n.lines.push(e),e.onDispose((()=>this._removeMarkerFromLink(n,e)))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let n=e.lines.indexOf(t);n!==-1&&(e.lines.splice(n,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};t.OscLinkService=o=r([i(0,a.IBufferService)],o)},8343:(e,t)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0;let n=`di$target`,r=`di$dependencies`;t.serviceRegistry=new Map,t.getServiceDependencies=function(e){return e[r]||[]},t.createDecorator=function(e){if(t.serviceRegistry.has(e))return t.serviceRegistry.get(e);let i=function(e,t,a){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);(function(e,t,i){t[n]===t?t[r].push({id:e,index:i}):(t[r]=[{id:e,index:i}],t[n]=t)})(i,e,a)};return i.toString=()=>e,t.serviceRegistry.set(e,i),i}},2585:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;let r=n(8343);var i;t.IBufferService=(0,r.createDecorator)(`BufferService`),t.ICoreMouseService=(0,r.createDecorator)(`CoreMouseService`),t.ICoreService=(0,r.createDecorator)(`CoreService`),t.ICharsetService=(0,r.createDecorator)(`CharsetService`),t.IInstantiationService=(0,r.createDecorator)(`InstantiationService`),function(e){e[e.TRACE=0]=`TRACE`,e[e.DEBUG=1]=`DEBUG`,e[e.INFO=2]=`INFO`,e[e.WARN=3]=`WARN`,e[e.ERROR=4]=`ERROR`,e[e.OFF=5]=`OFF`}(i||(t.LogLevelEnum=i={})),t.ILogService=(0,r.createDecorator)(`LogService`),t.IOptionsService=(0,r.createDecorator)(`OptionsService`),t.IOscLinkService=(0,r.createDecorator)(`OscLinkService`),t.IUnicodeService=(0,r.createDecorator)(`UnicodeService`),t.IDecorationService=(0,r.createDecorator)(`DecorationService`)},1480:(e,t,n)=>{Object.defineProperty(t,`__esModule`,{value:!0}),t.UnicodeService=void 0;let r=n(8460),i=n(225);class a{static extractShouldJoin(e){return(1&e)!=0}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,t,n=!1){return(16777215&e)<<3|(3&t)<<1|!!n}constructor(){this._providers=Object.create(null),this._active=``,this._onChange=new r.EventEmitter,this.onChange=this._onChange.event;let e=new i.UnicodeV6;this.register(e),this._active=e.version,this._activeProvider=e}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(e){let t=0,n=0,r=e.length;for(let i=0;i<r;++i){let o=e.charCodeAt(i);if(55296<=o&&o<=56319){if(++i>=r)return t+this.wcwidth(o);let n=e.charCodeAt(i);56320<=n&&n<=57343?o=1024*(o-55296)+n-56320+65536:t+=this.wcwidth(n)}let s=this.charProperties(o,n),c=a.extractWidth(s);a.extractShouldJoin(s)&&(c-=a.extractWidth(n)),t+=c,n=s}return t}charProperties(e,t){return this._activeProvider.charProperties(e,t)}}t.UnicodeService=a}},t={};function n(r){var i=t[r];if(i!==void 0)return i.exports;var a=t[r]={exports:{}};return e[r].call(a.exports,a,a.exports,n),a.exports}var r={};return(()=>{var e=r;Object.defineProperty(e,`__esModule`,{value:!0}),e.Terminal=void 0;let t=n(9042),i=n(3236),a=n(844),o=n(5741),s=n(8285),c=n(7975),l=n(7090),u=[`cols`,`rows`];class d extends a.Disposable{constructor(e){super(),this._core=this.register(new i.Terminal(e)),this._addonManager=this.register(new o.AddonManager),this._publicOptions={...this._core.options};let t=e=>this._core.options[e],n=(e,t)=>{this._checkReadonlyOptions(e),this._core.options[e]=t};for(let e in this._core.options){let r={get:t.bind(this,e),set:n.bind(this,e)};Object.defineProperty(this._publicOptions,e,r)}}_checkReadonlyOptions(e){if(u.includes(e))throw Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw Error(`You must set the allowProposedApi option to true to use proposed API`)}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||=new c.ParserApi(this._core),this._parser}get unicode(){return this._checkProposedApi(),new l.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||=this.register(new s.BufferNamespaceApi(this._core)),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t=`none`;switch(this._core.coreMouseService.activeProtocol){case`X10`:t=`x10`;break;case`VT200`:t=`vt200`;break;case`DRAG`:t=`drag`;break;case`ANY`:t=`any`}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,n){this._verifyIntegers(e,t,n),this._core.select(e,t,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
352
+ `,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return t}_verifyIntegers(...e){for(let t of e)if(t===1/0||isNaN(t)||t%1!=0)throw Error(`This API only accepts integers`)}_verifyPositiveIntegers(...e){for(let t of e)if(t&&(t===1/0||isNaN(t)||t%1!=0||t<0))throw Error(`This API only accepts positive integers`)}}e.Terminal=d})(),r})()))})),fA=o(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define([],r):typeof e==`object`?e.FitAddon=r():n.FitAddon=r()})(self,(()=>(()=>{var e={};return(()=>{var t=e;Object.defineProperty(t,`__esModule`,{value:!0}),t.FitAddon=void 0,t.FitAddon=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;this._terminal.rows===e.rows&&this._terminal.cols===e.cols||(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core,t=e._renderService.dimensions;if(t.css.cell.width===0||t.css.cell.height===0)return;let n=this._terminal.options.scrollback===0?0:e.viewport.scrollBarWidth,r=window.getComputedStyle(this._terminal.element.parentElement),i=parseInt(r.getPropertyValue(`height`)),a=Math.max(0,parseInt(r.getPropertyValue(`width`))),o=window.getComputedStyle(this._terminal.element),s=i-(parseInt(o.getPropertyValue(`padding-top`))+parseInt(o.getPropertyValue(`padding-bottom`))),c=a-(parseInt(o.getPropertyValue(`padding-right`))+parseInt(o.getPropertyValue(`padding-left`)))-n;return{cols:Math.max(2,Math.floor(c/t.css.cell.width)),rows:Math.max(1,Math.floor(s/t.css.cell.height))}}}})(),e})()))})),pA=o(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define([],r):typeof e==`object`?e.WebLinksAddon=r():n.WebLinksAddon=r()})(self,(()=>(()=>{var e={6:(e,t)=>{function n(e){try{let t=new URL(e),n=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(t,`__esModule`,{value:!0}),t.LinkComputer=t.WebLinkProvider=void 0,t.WebLinkProvider=class{constructor(e,t,n,r={}){this._terminal=e,this._regex=t,this._handler=n,this._options=r}provideLinks(e,t){let n=r.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(n))}_addCallbacks(e){return e.map((e=>(e.leave=this._options.leave,e.hover=(t,n)=>{if(this._options.hover){let{range:r}=e;this._options.hover(t,n,r)}},e)))}};class r{static computeLink(e,t,i,a){let o=new RegExp(t.source,(t.flags||``)+`g`),[s,c]=r._getWindowedLineStrings(e-1,i),l=s.join(``),u,d=[];for(;u=o.exec(l);){let e=u[0];if(!n(e))continue;let[t,o]=r._mapStrIdx(i,c,0,u.index),[s,l]=r._mapStrIdx(i,t,o,e.length);if(t===-1||o===-1||s===-1||l===-1)continue;let f={start:{x:o+1,y:t+1},end:{x:l,y:s+1}};d.push({range:f,text:e,activate:a})}return d}static _getWindowedLineStrings(e,t){let n,r=e,i=e,a=0,o=``,s=[];if(n=t.buffer.active.getLine(e)){let e=n.translateToString(!0);if(n.isWrapped&&e[0]!==` `){for(a=0;(n=t.buffer.active.getLine(--r))&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),n.isWrapped&&o.indexOf(` `)===-1););s.reverse()}for(s.push(e),a=0;(n=t.buffer.active.getLine(++i))&&n.isWrapped&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),o.indexOf(` `)===-1););}return[s,r]}static _mapStrIdx(e,t,n,r){let i=e.buffer.active,a=i.getNullCell(),o=n;for(;r;){let e=i.getLine(t);if(!e)return[-1,-1];for(let n=o;n<e.length;++n){e.getCell(n,a);let o=a.getChars();if(a.getWidth()&&(r-=o.length||1,n===e.length-1&&o===``)){let e=i.getLine(t+1);e&&e.isWrapped&&(e.getCell(0,a),a.getWidth()===2&&(r+=1))}if(r<0)return[t,n]}t++,o=0}return[t,o]}}t.LinkComputer=r}},t={};function n(r){var i=t[r];if(i!==void 0)return i.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}var r={};return(()=>{var e=r;Object.defineProperty(e,`__esModule`,{value:!0}),e.WebLinksAddon=void 0;let t=n(6),i=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function a(e,t){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}e.WebLinksAddon=class{constructor(e=a,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;let n=this._options,r=n.urlRegex||i;this._linkProvider=this._terminal.registerLinkProvider(new t.WebLinkProvider(this._terminal,r,this._handler,n))}dispose(){this._linkProvider?.dispose()}}})(),r})()))})),mA=dA(),hA=fA(),gA=pA(),_A=`forge.terminal.tabs.v1`;function vA(){try{if(sessionStorage.getItem(_A)===null){let e=localStorage.getItem(_A);e!==null&&(sessionStorage.setItem(_A,e),localStorage.removeItem(_A))}let e=sessionStorage.getItem(_A);if(e===null)return{tabs:[],activeTabId:void 0};let t=JSON.parse(e);if(typeof t!=`object`||!t||!Array.isArray(t.tabs))return{tabs:[],activeTabId:void 0};let n=[];for(let e of t.tabs)typeof e==`object`&&e&&typeof e.id==`string`&&typeof e.projectId==`string`&&typeof e.label==`string`&&typeof e.createdAt==`number`&&n.push(e);let r=t.activeTabId,i=typeof r==`string`?r:void 0;return{tabs:n,activeTabId:n.some(e=>e.id===i)?i:n[0]?.id}}catch{return{tabs:[],activeTabId:void 0}}}function yA(e){try{sessionStorage.setItem(_A,JSON.stringify(e))}catch{}}var bA=0,xA=()=>`term-${Date.now().toString(36)}-${(bA++).toString(36)}`,SA=vA(),CA=Qe(e=>({tabs:SA.tabs,activeTabId:SA.activeTabId,openTab:t=>{let n=xA();return e(e=>{let r={id:n,projectId:t,label:`Terminal ${e.tabs.filter(e=>e.projectId===t).length+1}`,createdAt:Date.now()},i={tabs:[...e.tabs,r],activeTabId:n};return yA(i),i}),n},closeTab:t=>{e(e=>{let n=e.tabs.findIndex(e=>e.id===t);if(n===-1)return{};let r=e.tabs.slice(0,n).concat(e.tabs.slice(n+1)),i={tabs:r,activeTabId:e.activeTabId===t?(r[n]??r[n-1]??r[0])?.id:e.activeTabId};return yA(i),i})},setActiveTab:t=>e(e=>(yA({tabs:{...e,activeTabId:t}.tabs,activeTabId:t}),{activeTabId:t})),closeProjectTabs:t=>{e(e=>{let n=e.tabs.filter(e=>e.projectId!==t),r={tabs:n,activeTabId:n.some(t=>t.id===e.activeTabId)?e.activeTabId:n[0]?.id};return yA(r),r})}})),wA=new Map;function TA(e){let t=[1,2,4,8,16,30];return(t[Math.min(e,t.length-1)]??30)*1e3}function EA(e){return e===1e3||e===4401||e===4404}function DA(){let e=kn(),t=CA(e=>e.tabs),n=CA(e=>e.activeTabId),r=CA(e=>e.openTab),i=CA(e=>e.closeTab),a=CA(e=>e.setActiveTab),o=On(e=>e.projects),s=t.filter(t=>t.projectId===e?.id),c=s.find(e=>e.id===n)??s[0],l=new Map(o.map(e=>[e.id,e.path]));if(e===void 0)return(0,L.jsx)(`div`,{className:`flex h-full items-center justify-center text-xs italic text-neutral-500`,children:`Select a project to open a terminal.`});let u=()=>{r(e.id)},d=e=>{AA(e),i(e)};return(0,L.jsxs)(`div`,{className:`flex h-full flex-col bg-black`,children:[(0,L.jsx)(`div`,{className:`flex items-center justify-between border-b border-neutral-800 bg-neutral-900/40 px-2 py-1`,children:(0,L.jsxs)(`div`,{className:`flex items-center gap-1 overflow-x-auto`,children:[s.length===0&&(0,L.jsx)(`span`,{className:`px-2 text-[11px] italic text-neutral-500`,children:`No terminals open.`}),s.map(e=>(0,L.jsxs)(`div`,{className:`group flex items-center gap-1 rounded px-2 py-0.5 text-xs ${e.id===c?.id?`bg-neutral-800 text-neutral-100`:`text-neutral-400 hover:bg-neutral-900 hover:text-neutral-200`}`,children:[(0,L.jsxs)(`button`,{onClick:()=>a(e.id),className:`flex items-center gap-1`,children:[(0,L.jsx)(ze,{size:11}),e.label]}),(0,L.jsx)(`button`,{onClick:()=>d(e.id),className:`rounded p-1 text-neutral-600 hover:bg-neutral-800 hover:text-neutral-200`,title:`Close terminal (kills the PTY)`,children:(0,L.jsx)(Ke,{size:16})})]},e.id)),(0,L.jsxs)(`button`,{onClick:u,className:`ml-1 flex items-center gap-1 rounded px-2 py-0.5 text-xs text-neutral-400 hover:bg-neutral-900 hover:text-neutral-200`,title:`New terminal`,children:[(0,L.jsx)(Me,{size:14}),`New`]})]})}),(0,L.jsxs)(`div`,{className:`relative flex-1 overflow-hidden`,children:[s.length===0&&(0,L.jsxs)(`div`,{className:`flex h-full items-center justify-center text-xs italic text-neutral-500`,children:[`Click "New" to open a terminal in `,e.path,`.`]}),t.map(t=>(0,L.jsx)(OA,{tab:t,projectPath:l.get(t.projectId)??``,visible:t.projectId===e.id&&t.id===c?.id},t.id))]})]})}function OA({tab:e,projectPath:t,visible:n}){let r=(0,v.useRef)(null);return(0,v.useEffect)(()=>{if(r.current===null)return;let t=r.current,n=wA.get(e.id);if(n!==void 0){try{let e=n.term.element;e!==void 0&&e.parentNode!==t?t.appendChild(e):n.term.open(t),n.fit.fit()}catch{}let e=new ResizeObserver(()=>{try{n.fit.fit()}catch{}let e=n.term.cols,t=n.term.rows;e===n.lastSize.cols&&t===n.lastSize.rows||(n.lastSize={cols:e,rows:t},n.ws.readyState===WebSocket.OPEN&&n.ws.send(JSON.stringify({type:`resize`,cols:e,rows:t})))});e.observe(t);try{n.observer.disconnect()}catch{}return n.observer=e,requestAnimationFrame(()=>{try{n.fit.fit(),n.term.focus()}catch{}}),()=>{try{e.disconnect()}catch{}}}let i=new mA.Terminal({theme:{background:pk(`--pi-terminal-bg`,`#0a0a0a`),foreground:pk(`--pi-terminal-fg`,`#e5e5e5`),cursor:pk(`--pi-terminal-fg`,`#e5e5e5`),black:pk(`--color-neutral-800`,`#262626`),brightBlack:pk(`--color-neutral-600`,`#525252`)},fontFamily:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace`,fontSize:13,cursorBlink:!0,scrollback:5e3,convertEol:!1}),a=new hA.FitAddon,o=new gA.WebLinksAddon;i.loadAddon(a),i.loadAddon(o),i.open(t),a.fit();let s={cols:i.cols,rows:i.rows},c=kA(e.id,e.projectId,i,s,!1);i.onData(t=>{let n=wA.get(e.id)?.ws;n?.readyState===WebSocket.OPEN&&n.send(JSON.stringify({type:`input`,data:t}))});let l=new ResizeObserver(()=>{try{a.fit()}catch{}let t=i.cols,n=i.rows,r=wA.get(e.id);r!==void 0&&(t===r.lastSize.cols&&n===r.lastSize.rows||(r.lastSize={cols:t,rows:n},r.ws.readyState===WebSocket.OPEN&&r.ws.send(JSON.stringify({type:`resize`,cols:t,rows:n}))))});return l.observe(r.current),wA.set(e.id,{term:i,fit:a,ws:c,observer:l,lastSize:s,reconnectAttempt:0,reconnectTimer:void 0,disposed:!1}),()=>{try{l.disconnect()}catch{}}},[e.id]),(0,v.useEffect)(()=>{if(!n)return;let t=wA.get(e.id);t!==void 0&&requestAnimationFrame(()=>{try{t.fit.fit(),t.term.focus()}catch{}})},[n,e.id]),(0,v.useEffect)(()=>{let t=wA.get(e.id);t!==void 0&&(t.term.options.theme={background:pk(`--pi-terminal-bg`,`#0a0a0a`),foreground:pk(`--pi-terminal-fg`,`#e5e5e5`),cursor:pk(`--pi-terminal-fg`,`#e5e5e5`),black:pk(`--color-neutral-800`,`#262626`),brightBlack:pk(`--color-neutral-600`,`#525252`)})},[dk(e=>e.theme),e.id]),(0,L.jsx)(`div`,{ref:r,onClick:()=>{wA.get(e.id)?.term.focus()},className:`absolute inset-y-0 left-2 right-0`,style:{visibility:n?`visible`:`hidden`,pointerEvents:n?`auto`:`none`,zIndex:+!!n},title:t})}function kA(e,t,n,r,i){let a=window.location.protocol===`https:`?`wss`:`ws`,o=Et(),s=o===void 0?``:`&token=${encodeURIComponent(o.token)}`,c=`${a}://${window.location.host}/api/v1/terminal?projectId=${encodeURIComponent(t)}&tabId=${encodeURIComponent(e)}${s}`,l=new WebSocket(c);return l.binaryType=`arraybuffer`,l.onopen=()=>{l.send(JSON.stringify({type:`resize`,cols:r.cols,rows:r.rows}));let t=wA.get(e);t!==void 0&&(t.reconnectAttempt=0)},l.onmessage=e=>{typeof e.data==`string`?n.write(e.data):e.data instanceof ArrayBuffer&&n.write(new Uint8Array(e.data))},l.onclose=r=>{let i=wA.get(e);if(i===void 0||i.disposed)return;if(EA(r.code)){let e=`[connection closed: ${String(r.code)}]`;r.code===4401?e=`[connection closed (4401): your session expired — refresh the page after logging back in]`:r.code===4404&&(e=`[connection closed (4404): project no longer exists]`),n.write(`\r\n${e}\r\n`);return}let a=i.reconnectAttempt+1;i.reconnectAttempt=a;let o=TA(a);n.write(`\r\n[connection lost (${String(r.code)}) — reconnecting in ${String(o/1e3)}s, attempt ${String(a)}]\r\n`),i.reconnectTimer=setTimeout(()=>{let r=wA.get(e);r===void 0||r.disposed||(r.reconnectTimer=void 0,r.ws=kA(e,t,n,r.lastSize,!0))},o)},l}function AA(e){let t=wA.get(e);if(t!==void 0){t.disposed=!0,t.reconnectTimer!==void 0&&clearTimeout(t.reconnectTimer),wA.delete(e);try{t.observer.disconnect()}catch{}try{(t.ws.readyState===WebSocket.OPEN||t.ws.readyState===WebSocket.CONNECTING)&&t.ws.close(1e3,`tab_closed`)}catch{}try{t.term.dispose()}catch{}}}function jA(){let e=rk(e=>e.settings),t=IO(e=>e.openSettings);if(e===void 0||e.total===0&&e.enabled)return null;let{enabled:n,connected:r,total:i}=e,a=n?r===i?`bg-emerald-500`:r===0?`bg-red-500`:`bg-amber-400`:`bg-neutral-600`,o=n?`MCP ${r}/${i}`:`MCP off`;return(0,L.jsxs)(`button`,{type:`button`,onClick:()=>t(`mcp`),className:`inline-flex items-center gap-1.5 rounded-md border border-neutral-700 px-2 py-1 text-xs text-neutral-300 hover:border-neutral-500 hover:text-neutral-100`,title:n?`${r} of ${i} MCP server(s) connected. Click to open Settings → MCP.`:`MCP tools disabled. Click to open Settings → MCP.`,children:[(0,L.jsx)(`span`,{className:`h-2 w-2 rounded-full ${a}`}),o]})}var MA=`forge.turnDiff.viewType`;function NA(){try{return localStorage.getItem(MA)===`split`?`split`:`unified`}catch{return`unified`}}function PA(){let e=$n(e=>e.activeSessionId),t=$n(t=>e===void 0?0:t.agentEndCountBySession[e]??0),n=$n(t=>e===void 0?!1:t.streamingBySession[e]??!1),[r,i]=(0,v.useState)([]),[a,o]=(0,v.useState)(void 0),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)({}),[d,f]=(0,v.useState)(NA),p=e=>{f(e);try{localStorage.setItem(MA,e)}catch{}},m=async()=>{if(e!==void 0){c(!0),o(void 0);try{i((await I.getTurnDiff(e)).entries)}catch(e){e instanceof M&&e.status===404?i([]):(i([]),o(e instanceof M?e.code:e.message))}finally{c(!1)}}};return(0,v.useEffect)(()=>{i([]),o(void 0)},[e]),(0,v.useEffect)(()=>{e===void 0||n||m()},[e,t,n]),e===void 0?(0,L.jsx)(`div`,{className:`flex h-full items-center justify-center px-4 text-center text-xs italic text-neutral-500`,children:`Pick a session to see its file changes.`}):(0,L.jsxs)(`div`,{className:`flex h-full flex-col text-xs text-neutral-300`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between border-b border-neutral-800 px-3 py-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 font-medium text-neutral-200`,children:[(0,L.jsx)(_e,{size:13}),`Last turn`,r.length>0&&(0,L.jsx)(`span`,{className:`rounded bg-neutral-800 px-1.5 py-0.5 text-[10px] text-neutral-400`,children:r.length})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,L.jsx)(`button`,{onClick:()=>p(d===`split`?`unified`:`split`),className:`rounded p-1 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200`,title:d===`split`?`Switch to unified view`:`Switch to side-by-side view`,children:d===`split`?(0,L.jsx)(Fe,{size:13}):(0,L.jsx)(fe,{size:13})}),(0,L.jsx)(`button`,{onClick:()=>void m(),className:`rounded p-1 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200`,title:`Refresh diff`,children:(0,L.jsx)(Ne,{size:13,className:s?`animate-spin`:``})})]})]}),a!==void 0&&(0,L.jsx)(`div`,{className:`border-b border-red-700/40 bg-red-900/20 px-3 py-1.5 text-[11px] text-red-300`,children:a}),(0,L.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[r.length===0&&(0,L.jsx)(`p`,{className:`px-3 py-3 italic text-neutral-500`,children:s?`Loading…`:a===void 0?`No file changes from the most recent turn.`:`Couldn't load the latest turn diff (see banner).`}),r.map(e=>{let t=l[e.file]??!1,n=e.file.split(`/`).pop()??e.file;return(0,L.jsxs)(`div`,{className:`border-b border-neutral-800/60`,children:[(0,L.jsxs)(`button`,{onClick:()=>u(n=>({...n,[e.file]:!t})),className:`flex w-full items-center justify-between gap-2 px-3 py-2 text-left hover:bg-neutral-900`,title:e.file,children:[(0,L.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,L.jsx)(`span`,{className:`truncate font-mono text-neutral-200`,children:n}),e.isPureAddition&&(0,L.jsx)(`span`,{className:`rounded bg-emerald-900/40 px-1 py-0.5 text-[9px] uppercase tracking-wider text-emerald-300`,children:`new`})]}),(0,L.jsxs)(`span`,{className:`flex shrink-0 items-baseline gap-2 text-[11px]`,children:[(0,L.jsxs)(`span`,{className:`text-emerald-400`,children:[`+`,e.additions]}),(0,L.jsxs)(`span`,{className:`text-red-400`,children:[`−`,e.deletions]})]})]}),t&&(0,L.jsx)(OD,{diff:e.diff,viewType:d})]},e.file)})]})]})}var FA=15e3;function IA(e){let[t,n]=(0,v.useState)(void 0),[r,i]=(0,v.useState)(void 0),a=$n(e=>e.activeSessionId),o=$n(e=>a===void 0?!1:e.streamingBySession[a]??!1),s=$n(e=>a===void 0?0:e.agentEndCountBySession[a]??0),c=(0,v.useRef)(0),l=async()=>{if(e===void 0)return;let t=c.current,r=e;try{let e=await I.gitStatus(r);if(c.current!==t)return;n(e),i(void 0)}catch(e){if(c.current!==t)return;i(e instanceof M?e.code:e.message)}};return(0,v.useEffect)(()=>{c.current+=1,n(void 0),i(void 0)},[e]),(0,v.useEffect)(()=>{if(e===void 0)return;if(l(),o)return()=>void 0;let t=window.setInterval(()=>{l()},FA);return()=>{window.clearInterval(t)}},[e,o]),(0,v.useEffect)(()=>{e!==void 0&&s!==0&&l()},[e,a,s]),{status:t,error:r,refresh:l}}function LA(e){let t=[],n=[];for(let r of e){let e=t.slice(),i=t.findIndex(e=>e===r.hash);i===-1&&(i=t.findIndex(e=>e===void 0),i===-1&&(i=t.length,t.push(void 0)));let a=[];for(let e=0;e<t.length;e++)t[e]===r.hash&&a.push(e);for(let e of a)t[e]=void 0;let o=[];if(r.parents.length>0){let e=r.parents[0];t[i]=e,o.push({lane:i,parent:e})}for(let e=1;e<r.parents.length;e++){let n=r.parents[e],i=t.findIndex(e=>e===n);i===-1&&(i=t.findIndex(e=>e===void 0),i===-1&&(i=t.length,t.push(void 0)),t[i]=n),o.push({lane:i,parent:n})}for(;t.length>0&&t[t.length-1]===void 0;)t.pop();let s=[];for(let t=0;t<e.length;t++)e[t]!==void 0&&t!==i&&(a.includes(t)||s.push(t));let c=Math.max(i+1,t.length,...a.map(e=>e+1),...o.map(e=>e.lane+1),...s.map(e=>e+1));n.push({hash:r.hash,lane:i,incomingLanes:a,outgoingLanes:o,through:s,width:c})}return n}var RA=[`#a5b4fc`,`#fde047`,`#a3e635`,`#f472b6`,`#67e8f9`,`#fb923c`,`#c084fc`,`#86efac`];function zA(e){return RA[e%RA.length]??`#a5b4fc`}function BA(){let e=kn(),{status:t,error:n,refresh:r}=IA(e?.id),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(void 0),[u,d]=(0,v.useState)(void 0),[f,p]=(0,v.useState)(void 0),[m,h]=(0,v.useState)(void 0),[g,_]=(0,v.useState)(void 0),[y,b]=(0,v.useState)(!1),[x,S]=(0,v.useState)(!1),[C,w]=(0,v.useState)(!1),[T,E]=(0,v.useState)(void 0),[D,O]=(0,v.useState)(void 0),[ee,te]=(0,v.useState)(void 0),[ne,re]=(0,v.useState)(!1),[k,ie]=(0,v.useState)(``),[ae,A]=(0,v.useState)(``),[oe,j]=(0,v.useState)(void 0),se=async()=>{if(e!==void 0)try{_((await I.gitRemotes(e.id)).remotes)}catch(e){l(e instanceof M?e.code:e.message)}},le=async()=>{if(e===void 0)return;let t=k.trim(),n=ae.trim();if(!(t.length===0||n.length===0)){te(t),l(void 0);try{await I.gitRemoteAdd(e.id,t,n),re(!1),ie(``),A(``),await se()}catch(e){l(e instanceof M?e.message||e.code:e.message)}finally{te(void 0)}}},ue=async()=>{if(e===void 0||oe===void 0)return;let t=oe;j(void 0),te(t),l(void 0);try{await I.gitRemoteRemove(e.id,t),await se()}catch(e){l(e instanceof M?e.message||e.code:e.message)}finally{te(void 0)}},de=async()=>{if(e!==void 0)try{h((await I.gitBranches(e.id)).branches)}catch(e){l(e instanceof M?e.code:e.message)}},pe=async t=>{if(e!==void 0){E(t),l(void 0);try{await I.gitCheckout(e.id,t),await de(),r()}catch(e){l(e instanceof M?e.code:e.message)}finally{E(void 0)}}},me=async t=>{if(e!==void 0){O(void 0),E(t),l(void 0);try{await I.gitBranchCreate(e.id,t,{checkout:!0}),await de(),r()}catch(e){l(e instanceof M?e.code:e.message)}finally{E(void 0)}}},he=async t=>{if(e===void 0||D?.kind!==`delete`)return;let{name:n}=D;O(void 0),E(n),l(void 0);try{await I.gitBranchDelete(e.id,n,t),await de()}catch(e){l(e instanceof M?e.code:e.message)}finally{E(void 0)}},[ge,_e]=(0,v.useState)({}),[ve,ye]=(0,v.useState)(void 0),[be,xe]=(0,v.useState)(``),[we,Te]=(0,v.useState)(!1),[Ee,De]=(0,v.useState)(!1),[Oe,ke]=(0,v.useState)(()=>{try{return localStorage.getItem(`forge.gitPanel.viewType`)===`split`?`split`:`unified`}catch{return`unified`}}),Ae=e=>{ke(e);try{localStorage.setItem(`forge.gitPanel.viewType`,e)}catch{}};if((0,v.useEffect)(()=>{if(t===void 0)return;let e=new Set(t.files.map(e=>e.path));_e(t=>{let n=!1,r={};for(let[i,a]of Object.entries(t)){let t=i.split(`|`)[0]??``;e.has(t)?r[i]=a:n=!0}return n?r:t})},[t]),(0,v.useEffect)(()=>{y&&e!==void 0&&I.gitLog(e.id,30).then(e=>p(e.commits)).catch(e=>l(e instanceof M?e.code:e.message))},[y,e?.id]),(0,v.useEffect)(()=>{x&&e!==void 0&&I.gitBranches(e.id).then(e=>h(e.branches)).catch(e=>l(e instanceof M?e.code:e.message))},[x,e?.id]),(0,v.useEffect)(()=>{C&&e!==void 0&&I.gitRemotes(e.id).then(e=>_(e.remotes)).catch(e=>l(e instanceof M?e.code:e.message))},[C,e?.id]),e===void 0)return(0,L.jsx)(`div`,{className:`flex h-full items-center justify-center px-4 text-center text-xs italic text-neutral-500`,children:`Pick a project to see its git status.`});if(t?.isGitRepo===!1){let t=async()=>{s(!0),l(void 0);try{await I.gitInit(e.id),await r()}catch(e){l(e instanceof M?e.code:e.message)}finally{s(!1)}};return(0,L.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 px-4 text-center text-xs text-neutral-500`,children:[(0,L.jsxs)(`p`,{className:`italic`,children:[e.name,` isn't a git repository.`]}),(0,L.jsx)(`button`,{onClick:()=>void t(),disabled:o,className:`rounded-md bg-neutral-100 px-3 py-1.5 text-xs font-medium text-neutral-900 hover:bg-white disabled:cursor-not-allowed disabled:opacity-50`,title:"Run `git init -b main` in the project root",children:o?`Initializing…`:`Initialize git repo`}),(0,L.jsxs)(`p`,{className:`text-[10px] text-neutral-600`,children:[`Default branch will be `,(0,L.jsx)(`code`,{className:`font-mono text-neutral-400`,children:`main`}),`.`]}),c!==void 0&&(0,L.jsxs)(`p`,{className:`text-[10px] text-red-400`,children:[`git init failed: `,c]})]})}let je=t?.files.filter(e=>e.staged)??[],Pe=t?.files.filter(e=>e.unstaged&&!e.staged)??[],Ie=t?.files.filter(e=>e.kind===`untracked`)??[],Le=async(t,n)=>{let r=`${t.path}|${n?`staged`:`unstaged`}`;if(ge[r]!==void 0){_e(e=>{let t={...e};return delete t[r],t});return}_e(e=>({...e,[r]:`loading`}));try{let i=await I.gitDiffFile(e.id,t.path,n);_e(e=>({...e,[r]:i.diff}))}catch{_e(e=>({...e,[r]:`error`}))}},Re=async t=>{if(t.length!==0){s(!0),l(void 0);try{await I.gitStage(e.id,t),await r()}catch(e){l((e instanceof M,e.message))}finally{s(!1)}}},ze=async t=>{if(t.length!==0){s(!0),l(void 0),d(void 0);try{await I.gitRevert(e.id,t),d(t.length===1?`Reverted ${t[0]}`:`Reverted ${t.length} files`),await r()}catch(e){l((e instanceof M,e.message))}finally{s(!1)}}},Be=async t=>{if(t.length!==0){s(!0),l(void 0);try{await I.gitUnstage(e.id,t),await r()}catch(e){l((e instanceof M,e.message))}finally{s(!1)}}},He=async()=>{let t=i.trim();if(t.length!==0){s(!0),l(void 0),d(void 0);try{let{hash:n}=await I.gitCommit(e.id,t);a(``),d(`Committed ${n.slice(0,7)}`),await r(),y&&p((await I.gitLog(e.id,30)).commits)}catch(e){l((e instanceof M,e.message))}finally{s(!1)}}},Ue=(()=>{if(g!==void 0)return g.map(e=>e.name).sort();if(m===void 0)return[];let e=new Set;for(let t of m){if(!t.remote)continue;let n=t.name.indexOf(`/`);n>0&&e.add(t.name.slice(0,n))}return Array.from(e).sort()})(),Ge=m===void 0?[]:m.filter(e=>!e.remote).map(e=>e.name).sort(),Ke=async()=>{s(!0),l(void 0),d(void 0);try{let t={};ve!==void 0&&(t.remote=ve);let{output:n}=await I.gitFetch(e.id,t);d(n.trim().length>0?n.trim().split(`
353
+ `).pop()??`Fetched`:`Fetched`)}catch(e){l((e instanceof M,e.message))}finally{s(!1)}},qe=async()=>{s(!0),l(void 0),d(void 0);try{let t={};ve!==void 0&&(t.remote=ve);let n=be.trim();n.length>0&&(t.branch=n);let{output:i}=await I.gitPull(e.id,t);d(i.trim().length>0?i.trim().split(`
354
+ `).pop()??`Pulled`:`Pulled`),r()}catch(e){l((e instanceof M,e.message))}finally{s(!1)}},Je=async()=>{s(!0),l(void 0),d(void 0);try{let t={};ve!==void 0&&(t.remote=ve);let n=be.trim();n.length>0&&(t.branch=n),we&&(t.setUpstream=!0);let{output:r}=await I.gitPush(e.id,t);d(r.trim().length>0?r.trim().split(`
355
+ `).pop()??`Pushed`:`Pushed`),we&&Te(!1)}catch(e){l((e instanceof M,e.message))}finally{s(!1)}};return(0,L.jsxs)(`div`,{className:`flex h-full flex-col text-xs text-neutral-300`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between border-b border-neutral-800 px-3 py-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 font-medium text-neutral-200`,children:[(0,L.jsx)(Se,{size:13}),t?.branch??`—`,t!==void 0&&t.files.length>0&&(0,L.jsx)(`span`,{className:`rounded bg-neutral-800 px-1.5 py-0.5 text-[10px] text-neutral-400`,children:t.files.length})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,L.jsx)(`button`,{onClick:()=>Ae(Oe===`split`?`unified`:`split`),className:`rounded p-1 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200`,title:Oe===`split`?`Switch git diffs to unified view`:`Switch git diffs to side-by-side view`,children:Oe===`split`?(0,L.jsx)(Fe,{size:13}):(0,L.jsx)(fe,{size:13})}),(0,L.jsx)(`button`,{onClick:()=>void r(),className:`rounded p-1 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200`,title:`Refresh`,children:(0,L.jsx)(Ne,{size:13,className:o?`animate-spin`:``})})]})]}),(n!==void 0||c!==void 0)&&(0,L.jsx)(`div`,{className:`border-b border-red-700/40 bg-red-900/20 px-3 py-1.5 text-[11px] text-red-300`,children:c??n}),u!==void 0&&(0,L.jsx)(`div`,{className:`border-b border-emerald-700/40 bg-emerald-900/20 px-3 py-1.5 text-[11px] text-emerald-300`,children:u}),(0,L.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[t===void 0&&(0,L.jsx)(`p`,{className:`px-3 py-3 italic text-neutral-500`,children:`Loading…`}),t?.files.length===0&&(0,L.jsx)(`p`,{className:`px-3 py-3 italic text-neutral-500`,children:`Working tree clean.`}),je.length>0&&(0,L.jsx)(HA,{label:`Staged`,files:je,actionLabel:`Unstage all`,onGroupAction:()=>void Be(je.map(e=>e.path)),onFileAction:e=>void Be([e.path]),fileActionLabel:`Unstage`,onRevert:e=>void ze([e.path]),onClickFile:e=>void Le(e,!0),openDiffs:ge,staged:!0,diffViewType:Oe}),Pe.length>0&&(0,L.jsx)(HA,{label:`Unstaged`,files:Pe,actionLabel:`Stage all`,onGroupAction:()=>void Re(Pe.map(e=>e.path)),onFileAction:e=>void Re([e.path]),fileActionLabel:`Stage`,onRevert:e=>void ze([e.path]),onClickFile:e=>void Le(e,!1),openDiffs:ge,staged:!1,diffViewType:Oe}),Ie.length>0&&(0,L.jsx)(HA,{label:`Untracked`,files:Ie,actionLabel:`Stage all`,onGroupAction:()=>void Re(Ie.map(e=>e.path)),onFileAction:e=>void Re([e.path]),fileActionLabel:`Stage`,onRevert:void 0,onClickFile:e=>void Le(e,!1),openDiffs:ge,staged:!1,diffViewType:Oe}),(0,L.jsxs)(`div`,{className:`border-t border-neutral-800/60 px-3 py-3`,children:[(0,L.jsxs)(`div`,{className:`mb-1 flex items-center gap-1 text-[10px] uppercase tracking-wider text-neutral-500`,children:[(0,L.jsx)(Ce,{size:10}),` Commit`]}),(0,L.jsx)(`textarea`,{value:i,onChange:e=>a(e.target.value),placeholder:`Commit message…`,rows:3,className:`w-full resize-none rounded border border-neutral-700 bg-neutral-950 px-2 py-1 text-xs text-neutral-100 outline-none focus:border-neutral-500`}),(0,L.jsxs)(`div`,{className:`mt-1 flex items-center justify-between gap-2`,children:[(0,L.jsxs)(`span`,{className:`text-[10px] text-neutral-500`,children:[je.length,` staged`]}),(0,L.jsx)(`button`,{onClick:()=>void He(),disabled:o||je.length===0||i.trim().length===0,className:`rounded bg-neutral-100 px-3 py-1 text-xs font-medium text-neutral-900 disabled:cursor-not-allowed disabled:opacity-50`,children:`Commit`})]})]}),(0,L.jsxs)(`div`,{className:`border-t border-neutral-800/60 px-3 py-3`,children:[(0,L.jsxs)(`div`,{className:`mb-1 flex items-center justify-between gap-1 text-[10px] uppercase tracking-wider text-neutral-500`,children:[(0,L.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,L.jsx)(We,{size:10}),` Push`]}),(0,L.jsx)(`button`,{onClick:()=>{De(e=>!e),!Ee&&m===void 0&&I.gitBranches(e.id).then(e=>h(e.branches)).catch(()=>void 0),!Ee&&g===void 0&&I.gitRemotes(e.id).then(e=>_(e.remotes)).catch(()=>void 0)},className:`rounded px-1 py-0.5 text-[10px] normal-case text-neutral-400 hover:bg-neutral-900 hover:text-neutral-200`,children:Ee?`Hide options`:`Options`})]}),Ee&&(0,L.jsxs)(`div`,{className:`mb-2 space-y-1.5 rounded border border-neutral-800 bg-neutral-900/40 p-2`,children:[(0,L.jsxs)(`label`,{className:`flex items-center gap-2 text-[11px]`,children:[(0,L.jsx)(`span`,{className:`w-16 shrink-0 text-neutral-400`,children:`Remote`}),Ue.length>0?(0,L.jsxs)(`select`,{value:ve??``,onChange:e=>ye(e.target.value===``?void 0:e.target.value),className:`flex-1 rounded border border-neutral-700 bg-neutral-950 px-1 py-0.5 text-[11px] text-neutral-100 outline-none focus:border-neutral-500`,children:[(0,L.jsx)(`option`,{value:``,children:`configured upstream`}),Ue.map(e=>(0,L.jsx)(`option`,{value:e,children:e},e))]}):(0,L.jsx)(`input`,{type:`text`,value:ve??``,onChange:e=>ye(e.target.value.length===0?void 0:e.target.value),placeholder:`origin`,className:`flex-1 rounded border border-neutral-700 bg-neutral-950 px-1 py-0.5 text-[11px] text-neutral-100 outline-none focus:border-neutral-500`})]}),(0,L.jsxs)(`label`,{className:`flex items-center gap-2 text-[11px]`,children:[(0,L.jsx)(`span`,{className:`w-16 shrink-0 text-neutral-400`,children:`Branch`}),Ge.length>0?(0,L.jsxs)(`select`,{value:be,onChange:e=>xe(e.target.value),className:`flex-1 rounded border border-neutral-700 bg-neutral-950 px-1 py-0.5 text-[11px] text-neutral-100 outline-none focus:border-neutral-500`,children:[(0,L.jsx)(`option`,{value:``,children:t?.branch??`current branch`}),Ge.map(e=>(0,L.jsx)(`option`,{value:e,children:e},e))]}):(0,L.jsx)(`input`,{type:`text`,value:be,onChange:e=>xe(e.target.value),placeholder:t?.branch??`current`,className:`flex-1 rounded border border-neutral-700 bg-neutral-950 px-1 py-0.5 text-[11px] text-neutral-100 outline-none focus:border-neutral-500`})]}),(0,L.jsxs)(`label`,{className:`flex items-center gap-2 text-[11px] text-neutral-300`,children:[(0,L.jsx)(`input`,{type:`checkbox`,checked:we,onChange:e=>Te(e.target.checked),className:`h-3 w-3`}),(0,L.jsx)(`span`,{children:`Set upstream (first push of a new branch)`})]})]}),(0,L.jsxs)(`div`,{className:`flex gap-1`,children:[(0,L.jsx)(`button`,{onClick:()=>void Ke(),disabled:o,className:`flex-1 rounded border border-neutral-700 px-3 py-1 text-xs text-neutral-200 hover:border-neutral-500 disabled:opacity-50`,title:ve===void 0?`git fetch (configured upstream)`:`git fetch ${ve}`,children:`Fetch`}),(0,L.jsx)(`button`,{onClick:()=>void qe(),disabled:o,className:`flex-1 rounded border border-neutral-700 px-3 py-1 text-xs text-neutral-200 hover:border-neutral-500 disabled:opacity-50`,title:`git pull — conflicts surface in the error banner; resolve via the integrated terminal`,children:`Pull`}),(0,L.jsx)(`button`,{onClick:()=>void Je(),disabled:o,className:`flex-1 rounded border border-neutral-700 px-3 py-1 text-xs text-neutral-200 hover:border-neutral-500 disabled:opacity-50`,title:ve===void 0&&be.trim().length===0?`git push (configured upstream)`:`git push ${ve??`(upstream)`}${be.trim().length>0?` ${be.trim()}`:``}`,children:`Push`})]})]}),(0,L.jsxs)(`div`,{className:`border-t border-neutral-800/60`,children:[(0,L.jsxs)(`button`,{onClick:()=>b(e=>!e),className:`flex w-full items-center justify-between px-3 py-2 text-left text-[10px] uppercase tracking-wider text-neutral-400 hover:bg-neutral-900`,children:[(0,L.jsx)(`span`,{children:`Log`}),(0,L.jsx)(`span`,{children:y?`−`:`+`})]}),y&&(0,L.jsx)(`div`,{className:`px-3 pb-3 text-[11px]`,children:f===void 0?(0,L.jsx)(`p`,{className:`italic text-neutral-500`,children:`Loading…`}):f.length===0?(0,L.jsx)(`p`,{className:`italic text-neutral-500`,children:`No commits yet.`}):(0,L.jsx)(KA,{commits:f})})]}),(0,L.jsxs)(`div`,{className:`border-t border-neutral-800/60`,children:[(0,L.jsxs)(`button`,{onClick:()=>S(e=>!e),className:`flex w-full items-center justify-between px-3 py-2 text-left text-[10px] uppercase tracking-wider text-neutral-400 hover:bg-neutral-900`,children:[(0,L.jsx)(`span`,{children:`Branches`}),(0,L.jsx)(`span`,{children:x?`−`:`+`})]}),x&&(0,L.jsx)(`div`,{className:`px-3 pb-3 text-[11px]`,children:m===void 0?(0,L.jsx)(`p`,{className:`italic text-neutral-500`,children:`Loading…`}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`ul`,{className:`space-y-0.5`,children:m.map(e=>{let t=T===e.name;return(0,L.jsxs)(`li`,{className:`group flex items-center gap-1 rounded px-1 py-0.5 font-mono hover:bg-neutral-900 ${e.current?`text-emerald-400`:`text-neutral-300`}`,children:[(0,L.jsx)(`span`,{className:`w-3 shrink-0`,children:e.current?(0,L.jsx)(ce,{size:10}):null}),(0,L.jsx)(`span`,{className:`flex-1 truncate`,title:e.name,children:e.name}),e.remote&&(0,L.jsx)(`span`,{className:`ml-1 text-[10px] text-neutral-600`,children:`remote`}),!e.current&&(0,L.jsxs)(`div`,{className:`hidden gap-0.5 group-hover:flex`,children:[(0,L.jsx)(`button`,{onClick:()=>void pe(e.name),disabled:t,className:`rounded px-1 py-0.5 text-[10px] text-neutral-400 hover:bg-neutral-800 hover:text-neutral-100 disabled:opacity-40`,title:e.remote?`Checkout (creates a tracking branch from ${e.name})`:`Checkout ${e.name}`,children:`checkout`}),!e.remote&&(0,L.jsx)(`button`,{onClick:()=>O({kind:`delete`,name:e.name}),disabled:t,className:`rounded p-0.5 text-neutral-500 hover:bg-red-900/30 hover:text-red-300 disabled:opacity-40`,title:`Delete branch`,children:(0,L.jsx)(Ve,{size:10})})]})]},e.name)})}),(0,L.jsxs)(`button`,{onClick:()=>O({kind:`create`}),className:`mt-2 flex items-center gap-1 rounded px-1 py-0.5 text-[11px] text-neutral-400 hover:bg-neutral-900 hover:text-neutral-100`,children:[(0,L.jsx)(Me,{size:10}),` New branch`]})]})})]}),(0,L.jsxs)(`div`,{className:`border-t border-neutral-800/60`,children:[(0,L.jsxs)(`button`,{onClick:()=>w(e=>!e),className:`flex w-full items-center justify-between px-3 py-2 text-left text-[10px] uppercase tracking-wider text-neutral-400 hover:bg-neutral-900`,children:[(0,L.jsx)(`span`,{children:`Remotes`}),(0,L.jsx)(`span`,{children:C?`−`:`+`})]}),C&&(0,L.jsx)(`div`,{className:`px-3 pb-3 text-[11px]`,children:g===void 0?(0,L.jsx)(`p`,{className:`italic text-neutral-500`,children:`Loading…`}):(0,L.jsxs)(L.Fragment,{children:[g.length===0?(0,L.jsx)(`p`,{className:`italic text-neutral-500`,children:`No remotes configured.`}):(0,L.jsx)(`ul`,{className:`space-y-1`,children:g.map(e=>{let t=e.fetchUrl!==e.pushUrl,n=ee===e.name;return(0,L.jsxs)(`li`,{className:`group flex flex-col gap-0.5`,children:[(0,L.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,L.jsx)(`span`,{className:`font-mono text-neutral-200`,children:e.name}),t&&(0,L.jsx)(`span`,{className:`rounded bg-amber-900/30 px-1 py-0.5 text-[9px] uppercase tracking-wider text-amber-300`,children:`fetch ≠ push`}),(0,L.jsx)(`button`,{onClick:()=>j(e.name),disabled:n,className:`ml-auto hidden rounded p-0.5 text-neutral-500 hover:bg-red-900/30 hover:text-red-300 disabled:opacity-40 group-hover:inline-flex`,title:`Remove remote "${e.name}"`,children:(0,L.jsx)(Ve,{size:10})})]}),(0,L.jsx)(`span`,{className:`break-all font-mono text-[10px] text-neutral-500`,title:e.fetchUrl,children:e.fetchUrl}),t&&(0,L.jsxs)(`span`,{className:`break-all font-mono text-[10px] text-neutral-500`,title:`push → ${e.pushUrl}`,children:[`push → `,e.pushUrl]})]},e.name)})}),(0,L.jsxs)(`button`,{onClick:()=>{ie(``),A(``),re(!0)},className:`mt-2 flex items-center gap-1 rounded px-1 py-0.5 text-[11px] text-neutral-400 hover:bg-neutral-900 hover:text-neutral-100`,children:[(0,L.jsx)(Me,{size:10}),` Add remote`]})]})})]})]}),(0,L.jsx)(Sr,{open:D?.kind===`create`,onClose:()=>O(void 0),onSubmit:e=>void me(e),title:`New branch`,label:`Branch name`,placeholder:`feature/my-change`,primaryLabel:`Create + checkout`}),(0,L.jsx)(Cr,{open:D?.kind===`delete`,onClose:()=>O(void 0),onConfirm:()=>void he(!1),title:`Delete branch`,message:D?.kind===`delete`?`Delete branch "${D.name}"? Refused if not merged into HEAD; force-delete from the terminal if you really mean it.`:``,primaryLabel:`Delete`,tone:`danger`}),(0,L.jsx)(xr,{open:ne,onClose:()=>re(!1),title:`Add remote`,children:(0,L.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),le()},className:`flex flex-col gap-3 px-4 py-3`,children:[(0,L.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,L.jsx)(`span`,{className:`text-xs text-neutral-300`,children:`Name`}),(0,L.jsx)(`input`,{type:`text`,value:k,onChange:e=>ie(e.target.value),placeholder:`origin`,autoFocus:!0,className:`w-full rounded-md border border-neutral-700 bg-neutral-950 px-3 py-1.5 font-mono text-sm text-neutral-100 outline-none focus:border-neutral-500`})]}),(0,L.jsxs)(`label`,{className:`block space-y-1.5`,children:[(0,L.jsx)(`span`,{className:`text-xs text-neutral-300`,children:`URL`}),(0,L.jsx)(`input`,{type:`text`,value:ae,onChange:e=>A(e.target.value),placeholder:`git@github.com:user/repo.git`,className:`w-full rounded-md border border-neutral-700 bg-neutral-950 px-3 py-1.5 font-mono text-sm text-neutral-100 outline-none focus:border-neutral-500`})]}),(0,L.jsxs)(`footer`,{className:`flex justify-end gap-2 pt-1`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:()=>re(!1),className:`rounded-md border border-neutral-700 px-3 py-1 text-xs text-neutral-200 hover:bg-neutral-800`,children:`Cancel`}),(0,L.jsx)(`button`,{type:`submit`,disabled:k.trim().length===0||ae.trim().length===0,className:`rounded-md bg-neutral-100 px-3 py-1 text-xs font-medium text-neutral-900 hover:bg-white disabled:cursor-not-allowed disabled:opacity-40`,children:`Add`})]})]})}),(0,L.jsx)(Cr,{open:oe!==void 0,onClose:()=>j(void 0),onConfirm:()=>void ue(),title:`Remove remote`,message:oe===void 0?``:`Remove remote "${oe}"? The local repo loses its reference to this URL; existing commits aren't affected.`,primaryLabel:`Remove`,tone:`danger`})]})}var VA=3e3;function HA(e){let[t,n]=(0,v.useState)(void 0),r=(0,v.useRef)(void 0),i=()=>{r.current!==void 0&&(window.clearTimeout(r.current),r.current=void 0),n(void 0)};(0,v.useEffect)(()=>()=>{r.current!==void 0&&window.clearTimeout(r.current)},[]);let a=a=>{if(e.onRevert!==void 0){if(t===a.path){i(),e.onRevert(a);return}r.current!==void 0&&window.clearTimeout(r.current),n(a.path),r.current=window.setTimeout(()=>{n(void 0),r.current=void 0},VA)}};return(0,L.jsxs)(`div`,{className:`border-t border-neutral-800/60`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-1.5`,children:[(0,L.jsxs)(`span`,{className:`text-[10px] uppercase tracking-wider text-neutral-500`,children:[e.label,` (`,e.files.length,`)`]}),(0,L.jsx)(`button`,{onClick:e.onGroupAction,className:`text-[10px] text-neutral-400 hover:text-neutral-200`,children:e.actionLabel})]}),(0,L.jsx)(`ul`,{children:e.files.map(n=>{let r=`${n.path}|${e.staged?`staged`:`unstaged`}`,i=e.openDiffs[r],o=t===n.path;return(0,L.jsxs)(`li`,{className:`border-t border-neutral-900`,children:[(0,L.jsxs)(`div`,{className:`group flex items-center gap-2 px-3 py-1 hover:bg-neutral-900`,children:[(0,L.jsx)(`span`,{className:`inline-block w-5 shrink-0 text-center font-mono text-[10px] text-neutral-500`,title:`porcelain code: ${n.code}`,children:UA(n.kind)}),(0,L.jsx)(`button`,{onClick:()=>e.onClickFile(n),className:`flex-1 truncate text-left font-mono`,title:n.path,children:n.path}),e.onRevert!==void 0&&(0,L.jsxs)(`button`,{onClick:()=>a(n),className:o?`inline-flex items-center gap-1 rounded bg-red-900/40 px-1 py-0.5 text-[10px] text-red-200`:`hidden items-center gap-1 text-[10px] text-neutral-500 hover:text-red-300 group-hover:inline-flex`,title:o?`Click again to discard local changes (this cannot be undone)`:`Revert: discard local changes for this file`,children:[(0,L.jsx)(Ue,{size:10}),o?`Confirm?`:`Revert`]}),(0,L.jsxs)(`button`,{onClick:()=>e.onFileAction(n),className:`ml-3 hidden items-center gap-1 text-[10px] text-neutral-500 hover:text-neutral-200 group-hover:inline-flex`,children:[e.fileActionLabel===`Stage`?(0,L.jsx)(Me,{size:10}):e.fileActionLabel===`Unstage`?(0,L.jsx)(Oe,{size:10}):null,e.fileActionLabel]})]}),i!==void 0&&(0,L.jsx)(`div`,{className:`border-t border-neutral-900 bg-neutral-950`,children:i===`loading`?(0,L.jsx)(`p`,{className:`px-3 py-2 italic text-neutral-500`,children:`Loading…`}):i===`error`?(0,L.jsx)(`p`,{className:`px-3 py-2 text-red-400`,children:`Failed to load diff.`}):i.length===0?(0,L.jsx)(`p`,{className:`px-3 py-2 italic text-neutral-500`,children:`(no diff — file is binary or unchanged)`}):(0,L.jsx)(OD,{diff:i,viewType:e.diffViewType})})]},n.path)})})]})}function UA(e){switch(e){case`modified`:return`M`;case`added`:return`A`;case`deleted`:return`D`;case`renamed`:return`R`;case`copied`:return`C`;case`untracked`:return`?`;case`ignored`:return`!`;case`conflicted`:return`U`;default:return`·`}}var WA=14,GA=36;function KA({commits:e}){let t=LA(e),n=Math.max(1,...t.map(e=>e.width));return(0,L.jsx)(`ul`,{className:`space-y-0`,children:e.map((e,r)=>{let i=t[r];return i===void 0?null:(0,L.jsxs)(`li`,{className:`group flex items-stretch`,children:[(0,L.jsx)(qA,{layout:i,isLast:r===t.length-1,maxLanes:n}),(0,L.jsxs)(`div`,{className:`flex flex-col justify-center gap-0.5 pl-2`,style:{minHeight:GA},children:[(0,L.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,L.jsx)(`span`,{className:`font-mono text-neutral-500`,children:e.hash.slice(0,7)}),e.refs.map((e,t)=>(0,L.jsx)(JA,{ref_:e},`${t}-${e}`)),(0,L.jsx)(`span`,{className:`truncate text-neutral-200`,title:e.message,children:e.message})]}),(0,L.jsxs)(`span`,{className:`font-mono text-[10px] text-neutral-600`,children:[e.author,` · `,new Date(e.date).toLocaleString()]})]})]},e.hash)})})}function qA({layout:e,isLast:t,maxLanes:n}){let r=n*WA,i=GA,a=e.lane*WA+WA/2,o=i/2,s=[];for(let t of e.through){let e=t*WA+WA/2;s.push({x1:e,y1:0,x2:e,y2:i,color:zA(t)})}for(let t of e.incomingLanes){let e=t*WA+WA/2;s.push({x1:e,y1:0,x2:a,y2:o,color:zA(t)})}if(!t)for(let t of e.outgoingLanes){let e=t.lane*WA+WA/2;s.push({x1:a,y1:o,x2:e,y2:i,color:zA(t.lane)})}if(t&&e.outgoingLanes.length>0)for(let t of e.outgoingLanes){let e=t.lane*WA+WA/2;s.push({x1:a,y1:o,x2:e,y2:o+6,color:zA(t.lane)})}return(0,L.jsxs)(`svg`,{width:r,height:i,viewBox:`0 0 ${r} ${i}`,className:`shrink-0`,"aria-hidden":!0,children:[s.map((e,t)=>(0,L.jsx)(`line`,{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,stroke:e.color,strokeWidth:1.5,strokeLinecap:`round`},t)),(0,L.jsx)(`circle`,{cx:a,cy:o,r:3.5,fill:zA(e.lane)})]})}function JA({ref_:e}){let t=e.startsWith(`HEAD ->`)||e===`HEAD`,n=e.startsWith(`tag:`),r=t?e.replace(/^HEAD ->\s*/,``):n?e.replace(/^tag:\s*/,``):e;return(0,L.jsx)(`span`,{className:`shrink-0 rounded px-1.5 py-0 text-[9px] uppercase tracking-wider ${t?`bg-emerald-900/40 text-emerald-300`:n?`bg-amber-900/40 text-amber-300`:e.includes(`/`)?`bg-neutral-800 text-neutral-500`:`bg-neutral-800 text-neutral-300`}`,children:n?`▼ ${r}`:r})}var YA=250,XA=2,ZA=200;function QA(){let e=kn(),t=ur(e=>e.openFile),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)(void 0),[y,b]=(0,v.useState)(!1),[x,S]=(0,v.useState)(void 0),C=(0,v.useRef)(void 0),w=(0,v.useCallback)(async t=>{if(e===void 0)return;if(t.length<XA){_(void 0),S(void 0);return}C.current?.abort();let n=new AbortController;C.current=n,b(!0),S(void 0);try{let r={query:t,regex:i,caseSensitive:o,includeGitignored:c,limit:ZA,...u.length>0?{include:u}:{},...f.length>0?{exclude:f}:{}},a=await I.searchFiles(e.id,r,n.signal);if(n.signal.aborted)return;_(a)}catch(e){if(n.signal.aborted||e instanceof Error&&e.name===`AbortError`)return;e instanceof M&&e.code===`invalid_response_body`?S(`server returned an unexpected response`):e instanceof Error?S(e.message):S(`search failed`),_(void 0)}finally{n.signal.aborted||b(!1)}},[e,i,o,c,u,f]);(0,v.useEffect)(()=>{let e=window.setTimeout(()=>void w(n),YA);return()=>window.clearTimeout(e)},[n,w]),(0,v.useEffect)(()=>()=>{C.current?.abort()},[]);let T=(0,v.useMemo)(()=>ej(g?.matches??[]),[g]);return e===void 0?(0,L.jsx)(`div`,{className:`p-4 text-xs italic text-neutral-500`,children:`Select a project to search its files.`}):(0,L.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,L.jsxs)(`div`,{className:`border-b border-neutral-800 bg-neutral-900/40 p-2`,children:[(0,L.jsxs)(`div`,{className:`relative`,children:[(0,L.jsx)(Le,{size:12,className:`pointer-events-none absolute left-2 top-1/2 -translate-y-1/2 text-neutral-500`}),(0,L.jsx)(`input`,{type:`text`,value:n,onChange:e=>r(e.target.value),placeholder:i?`Regex…`:`Search project…`,className:`w-full rounded border border-neutral-700 bg-neutral-900 py-1.5 pl-7 pr-2 text-xs text-neutral-100 placeholder:text-neutral-500 focus:border-neutral-500 focus:outline-none`,autoFocus:!0})]}),(0,L.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:[(0,L.jsx)(tj,{label:`Regex`,active:i,onClick:()=>a(e=>!e)}),(0,L.jsx)(tj,{label:`Aa`,title:`Case sensitive`,active:o,onClick:()=>s(e=>!e)}),(0,L.jsx)(tj,{label:`+ignored`,title:`Include files that .gitignore would normally skip`,active:c,onClick:()=>l(e=>!e)}),(0,L.jsxs)(`button`,{onClick:()=>h(e=>!e),className:`ml-auto flex items-center gap-1 rounded border border-neutral-700 px-1.5 py-0.5 text-[10px] text-neutral-400 hover:border-neutral-500`,children:[m?(0,L.jsx)(le,{size:10}):(0,L.jsx)(ue,{size:10}),`Globs`]})]}),m&&(0,L.jsxs)(`div`,{className:`mt-2 grid grid-cols-1 gap-1.5`,children:[(0,L.jsx)(`input`,{type:`text`,value:u,onChange:e=>d(e.target.value),placeholder:`include glob — e.g. **/*.ts`,className:`rounded border border-neutral-700 bg-neutral-900 px-2 py-1 text-[11px] text-neutral-200 placeholder:text-neutral-500 focus:border-neutral-500 focus:outline-none`}),(0,L.jsx)(`input`,{type:`text`,value:f,onChange:e=>p(e.target.value),placeholder:`exclude glob — e.g. **/dist/**`,className:`rounded border border-neutral-700 bg-neutral-900 px-2 py-1 text-[11px] text-neutral-200 placeholder:text-neutral-500 focus:border-neutral-500 focus:outline-none`})]})]}),(0,L.jsxs)(`div`,{className:`flex-1 overflow-auto`,children:[(0,L.jsx)(nj,{query:n,loading:y,error:x,results:g,totalFiles:T.length}),(0,L.jsx)(`ul`,{className:`divide-y divide-neutral-900`,children:T.map(([n,r])=>(0,L.jsx)(rj,{path:n,matches:r,onPick:r=>void t(e.id,$A(e.path,n),{line:r.line,column:r.column})},n))})]})]})}function $A(e,t){return t.startsWith(`/`)?t:`${e}${e.endsWith(`/`)?``:`/`}${t}`}function ej(e){let t=new Map;for(let n of e){let e=t.get(n.path);e===void 0?t.set(n.path,[n]):e.push(n)}return Array.from(t.entries())}function tj({label:e,title:t,active:n,onClick:r}){return(0,L.jsx)(`button`,{onClick:r,title:t,className:`rounded border px-1.5 py-0.5 text-[10px] ${n?`border-neutral-500 bg-neutral-800 text-neutral-100`:`border-neutral-700 text-neutral-400 hover:border-neutral-500`}`,children:e})}function nj({query:e,loading:t,error:n,results:r,totalFiles:i}){return e.length===0?(0,L.jsxs)(`div`,{className:`flex flex-col items-center gap-2 px-4 py-8 text-center text-xs text-neutral-500`,children:[(0,L.jsx)(ye,{size:20,className:`text-neutral-700`}),(0,L.jsx)(`p`,{children:`Type to search across project files.`}),(0,L.jsxs)(`p`,{className:`text-[10px] text-neutral-600`,children:[`Min `,XA,` chars · Click a result to jump to that line.`]})]}):e.length<XA?(0,L.jsxs)(`div`,{className:`px-4 py-3 text-xs italic text-neutral-500`,children:[`Keep typing — at least `,XA,` characters.`]}):t&&r===void 0?(0,L.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-neutral-400`,children:[(0,L.jsx)(Ee,{size:12,className:`animate-spin`}),` Searching…`]}):n===void 0?r===void 0?null:r.matches.length===0?(0,L.jsx)(`div`,{className:`px-4 py-3 text-xs italic text-neutral-500`,children:`No matches.`}):(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-neutral-800 bg-neutral-950/60 px-3 py-1.5 text-[10px]`,children:[(0,L.jsxs)(`span`,{className:`text-neutral-400`,children:[r.matches.length,` match`,r.matches.length===1?``:`es`,` in `,i,` `,`file`,i===1?``:`s`,r.truncated&&(0,L.jsxs)(`span`,{className:`ml-1 text-amber-400`,children:[`· truncated at `,ZA]})]}),r.engine===`node`&&(0,L.jsx)(`span`,{className:`rounded bg-amber-900/40 px-1.5 py-0.5 text-[9px] uppercase tracking-wider text-amber-300`,title:`ripgrep was not found on this host — using the slower in-process fallback`,children:`fallback`})]}):(0,L.jsx)(`div`,{className:`px-4 py-3 text-xs text-rose-400`,children:n})}function rj({path:e,matches:t,onPick:n}){let[r,i]=(0,v.useState)(!0);return(0,L.jsxs)(`li`,{className:`bg-neutral-950`,children:[(0,L.jsxs)(`button`,{onClick:()=>i(e=>!e),className:`flex w-full items-center gap-1 truncate px-2 py-1 text-left text-[11px] text-neutral-300 hover:bg-neutral-900`,title:e,children:[r?(0,L.jsx)(le,{size:11}):(0,L.jsx)(ue,{size:11}),(0,L.jsx)(`span`,{className:`truncate font-mono`,children:e}),(0,L.jsx)(`span`,{className:`ml-auto text-[10px] text-neutral-500`,children:t.length})]}),r&&(0,L.jsx)(`ul`,{children:t.map((t,r)=>(0,L.jsx)(`li`,{children:(0,L.jsxs)(`button`,{onClick:()=>n(t),className:`flex w-full gap-2 px-2 py-0.5 text-left font-mono text-[11px] text-neutral-400 hover:bg-neutral-900 hover:text-neutral-100`,title:`${e}:${t.line}:${t.column}`,children:[(0,L.jsx)(`span`,{className:`w-10 shrink-0 text-right text-neutral-600`,children:t.line}),(0,L.jsx)(`span`,{className:`truncate`,children:ij(t.lineSnippet,t.column,t.length)})]})},`${t.line}:${t.column}:${r}`))})]})}function ij(e,t,n){let r=Math.max(0,Math.min(e.length,t-1)),i=Math.max(r,Math.min(e.length,r+n)),a=e.length-e.trimStart().length,o=Math.min(a,r),s=e.slice(o,r),c=e.slice(r,i),l=e.slice(i);return n===0||c.length===0?(0,L.jsx)(`span`,{children:e.slice(o)}):(0,L.jsxs)(`span`,{children:[(0,L.jsx)(`span`,{children:s}),(0,L.jsx)(`span`,{className:`bg-amber-700/30 text-amber-100`,children:c}),(0,L.jsx)(`span`,{children:l})]})}function aj(){let e=$n(e=>e.activeSessionId),t=$n(t=>e===void 0?0:t.agentEndCountBySession[e]??0),n=$n(t=>e===void 0?0:t.compactionEndCountBySession[e]??0),r=$n(t=>e===void 0?!1:t.streamingBySession[e]??!1),i=$n(t=>e===void 0?``:t.streamingTextBySession[e]??``),[a,o]=(0,v.useState)(void 0),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(void 0),[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(``),[_,y]=(0,v.useState)(void 0),b=(0,v.useRef)(void 0),x=async()=>{if(e===void 0){o(void 0);return}b.current?.abort();let t=new AbortController;b.current=t,c(!0),u(void 0);try{let n=await I.getSessionContext(e,t.signal);if(t.signal.aborted)return;o(n)}catch(e){if(t.signal.aborted||e instanceof Error&&e.name===`AbortError`)return;e instanceof M&&e.status===404?(o(void 0),u(void 0)):u(e instanceof M?e.code:e.message)}finally{t.signal.aborted||c(!1)}};return(0,v.useEffect)(()=>{x()},[e,t,n]),(0,v.useEffect)(()=>()=>{b.current?.abort()},[]),e===void 0?(0,L.jsx)(`div`,{className:`flex h-full items-center justify-center px-4 py-6 text-center text-xs italic text-neutral-500`,children:`Select a session to inspect its context.`}):(0,L.jsxs)(`div`,{className:`flex h-full flex-col bg-neutral-950 text-xs text-neutral-200`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between border-b border-neutral-800 bg-neutral-900/40 px-3 py-1.5`,children:[(0,L.jsx)(`span`,{className:`text-[10px] uppercase tracking-wider text-neutral-400`,children:`Context inspector`}),(0,L.jsxs)(`div`,{className:`flex items-center gap-1`,children:[s&&(0,L.jsx)(Ee,{size:11,className:`animate-spin text-neutral-500`}),(0,L.jsx)(`button`,{onClick:()=>void x(),disabled:s,className:`rounded p-1 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-200 disabled:opacity-40`,title:`Refresh`,children:(0,L.jsx)(Ne,{size:11,className:s?`animate-spin`:``})})]})]}),l!==void 0&&(0,L.jsx)(`div`,{className:`border-b border-red-700/40 bg-red-900/20 px-3 py-1.5 text-[11px] text-red-300`,children:l}),(0,L.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:a===void 0?(0,L.jsx)(`div`,{className:`px-4 py-6 text-center text-xs italic text-neutral-500`,children:s?`Loading…`:`No data — try refresh.`}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(oj,{data:a,turnsExpanded:d,onToggleTurns:()=>f(e=>!e)}),(0,L.jsx)(dj,{messages:a.messages,showThinking:p,onToggleThinking:()=>m(e=>!e),onViewRaw:(e,t)=>y({index:e,payload:t}),search:h,onSearchChange:g,...r&&i.length>0?{streamingTail:{content:i}}:{}})]})}),_!==void 0&&(0,L.jsx)(pj,{title:`Message ${_.index} — raw AgentMessage JSON`,payload:_.payload,onClose:()=>y(void 0)})]})}function oj({data:e,turnsExpanded:t,onToggleTurns:n}){let r=e.contextUsage,i=(0,v.useMemo)(()=>lj(e.messages,r.tokens),[e.messages,r.tokens]),a=(0,v.useMemo)(()=>_j(e.messages,e.turns),[e.messages,e.turns]),o=r.tokens??i.total,s=r.contextWindow>0?Math.min(1,o/r.contextWindow):0;return(0,L.jsxs)(`div`,{className:`space-y-2 border-b border-neutral-800 px-3 py-2`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`div`,{className:`mb-1 flex items-center justify-between text-[10px] text-neutral-400`,children:[(0,L.jsxs)(`span`,{children:[`Context window (`,r.tokens===void 0?`estimate`:`current`,`)`]}),(0,L.jsxs)(`span`,{children:[bj(o),` /`,` `,r.contextWindow>0?bj(r.contextWindow):`unknown`,r.contextWindow>0&&(0,L.jsxs)(`span`,{className:`ml-1 text-neutral-600`,children:[`(`,(s*100).toFixed(1),`%)`]})]})]}),(0,L.jsx)(`div`,{className:`h-1.5 w-full overflow-hidden rounded bg-neutral-800`,children:(0,L.jsx)(`div`,{className:`h-full ${s>.9?`bg-red-500`:s>.7?`bg-amber-500`:`bg-emerald-500`}`,style:{width:`${Math.max(2,Math.min(100,s*100))}%`}})})]}),(0,L.jsx)(cj,{breakdown:i,contextWindow:r.contextWindow}),(0,L.jsxs)(`div`,{className:`space-y-0.5 border-t border-neutral-800 pt-1.5`,children:[e.turns.length>0&&(()=>{let t=e.turns[e.turns.length-1],n=a.get(t.index)??0;return(0,L.jsxs)(`div`,{className:`flex items-center justify-between text-[11px]`,children:[(0,L.jsx)(`span`,{className:`text-neutral-500`,children:`Last turn`}),(0,L.jsxs)(`span`,{className:`font-mono text-neutral-300`,title:`New = user message + tool results since the prior assistant turn (estimate). Out = assistant output tokens. Cost = that turn's billed cost.`,children:[`~`,bj(n),` new · `,bj(t.outputTokens),` out ·`,` `,xj(t.cost)]})]})})(),(0,L.jsxs)(`div`,{className:`flex items-center justify-between text-[11px]`,children:[(0,L.jsx)(`span`,{className:`text-neutral-500`,title:"Sum of `usage.input` per turn — NEW non-cached input the LLM saw across the session. Excludes cached portions (tracked separately below).",children:`Input (lifetime)`}),(0,L.jsx)(`span`,{className:`font-mono text-neutral-400`,children:bj(e.totalInputTokens)})]}),(0,L.jsxs)(`div`,{className:`flex items-center justify-between text-[11px]`,children:[(0,L.jsx)(`span`,{className:`text-neutral-500`,title:"Sum of `usage.cacheRead` per turn — prior context served from the prompt cache. Counted ONCE PER API CALL: every turn re-reads the same cached content and re-pays the (discounted) read fee, so this number grows ~quadratically with conversation length. Billed at ~10% of input rate on most providers.",children:`Cache served (lifetime)`}),(0,L.jsx)(`span`,{className:`font-mono text-neutral-400`,children:bj(e.totalCacheReadTokens)})]}),(0,L.jsxs)(`div`,{className:`flex items-center justify-between text-[11px]`,children:[(0,L.jsx)(`span`,{className:`text-neutral-500`,title:"Sum of `usage.cacheWrite` per turn — portions cached for reuse on subsequent turns. Billed at ~125% of input rate; small premium up front for big savings on the cache-served line.",children:`Cache written (lifetime)`}),(0,L.jsx)(`span`,{className:`font-mono text-neutral-400`,children:bj(e.totalCacheWriteTokens)})]}),(0,L.jsxs)(`div`,{className:`flex items-center justify-between text-[11px]`,children:[(0,L.jsx)(`span`,{className:`text-neutral-500`,title:"Sum of `usage.output` per turn — assistant tokens generated.",children:`Output (lifetime)`}),(0,L.jsx)(`span`,{className:`font-mono text-neutral-400`,children:bj(e.totalOutputTokens)})]}),(0,L.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] font-medium`,children:[(0,L.jsx)(`span`,{className:`text-neutral-300`,children:`Total cost`}),(0,L.jsx)(`span`,{className:`font-mono text-emerald-400`,children:xj(e.totalCost)})]})]}),e.turns.length>0&&(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`button`,{onClick:n,className:`flex items-center gap-1 text-[10px] uppercase tracking-wider text-neutral-400 hover:text-neutral-200`,children:[t?(0,L.jsx)(le,{size:10}):(0,L.jsx)(ue,{size:10}),`Per-turn (`,e.turns.length,`)`]}),t&&(0,L.jsx)(uj,{turns:e.turns,newDeltas:a})]})]})}var sj=[{key:`systemAndTools`,label:`System + tools`,color:`#64748b`},{key:`userPrompts`,label:`User prompts`,color:`#0ea5e9`},{key:`assistantText`,label:`Assistant text`,color:`#a78bfa`},{key:`thinking`,label:`Thinking`,color:`#71717a`},{key:`toolCalls`,label:`Tool calls`,color:`#f59e0b`},{key:`toolResults`,label:`Tool results`,color:`#10b981`},{key:`images`,label:`Images`,color:`#ec4899`}];function cj({breakdown:e,contextWindow:t}){let n=e.total;return n===0?null:(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`div`,{className:`mb-1 flex items-center justify-between text-[10px] text-neutral-400`,children:[(0,L.jsx)(`span`,{children:`What’s in the context`}),(0,L.jsxs)(`span`,{className:`text-neutral-600`,title:`Sum of category estimates (~chars/4)`,children:[`~`,bj(n),` tok`,t>0&&(0,L.jsxs)(`span`,{className:`ml-1`,children:[`(`,(n/t*100).toFixed(1),`%)`]})]})]}),(0,L.jsx)(`div`,{className:`flex h-1.5 w-full overflow-hidden rounded bg-neutral-800`,children:sj.map(t=>{let r=e[t.key];if(r===0)return null;let i=r/n*100;return(0,L.jsx)(`div`,{style:{width:`${i}%`,background:t.color},title:`${t.label}: ${bj(r)} tok (${i.toFixed(1)}%)`},t.key)})}),(0,L.jsx)(`ul`,{className:`mt-1 grid grid-cols-2 gap-x-3 gap-y-0.5 text-[10px]`,children:sj.map(t=>{let r=e[t.key];if(r===0)return null;let i=r/n*100;return(0,L.jsxs)(`li`,{className:`flex items-center gap-1.5`,children:[(0,L.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-sm`,style:{background:t.color},"aria-hidden":`true`}),(0,L.jsx)(`span`,{className:`flex-1 truncate text-neutral-400`,children:t.label}),(0,L.jsx)(`span`,{className:`font-mono text-neutral-300`,children:bj(r)}),(0,L.jsxs)(`span`,{className:`w-10 text-right text-neutral-600`,children:[i.toFixed(0),`%`]})]},t.key)})})]})}function lj(e,t){let n=0,r=0,i=0,a=0,o=0,s=0;for(let t of e){let e=typeof t.role==`string`?t.role:``,c=t.content;if(e===`user`){if(typeof c==`string`)n+=c.length;else if(Array.isArray(c))for(let e of c){let t=e;t.type===`text`&&typeof t.text==`string`?n+=t.text.length:t.type===`image`&&(s+=1)}}else if(e===`assistant`&&Array.isArray(c))for(let e of c){let t=e;if(t.type===`text`&&typeof t.text==`string`)r+=t.text.length;else if(t.type===`thinking`&&typeof t.text==`string`)i+=t.text.length;else if(t.type===`toolUse`)try{a+=JSON.stringify(t.input??{}).length}catch{a+=String(t.input??``).length}}else if(e===`toolResult`){if(typeof c==`string`)o+=c.length;else if(Array.isArray(c))for(let e of c){let t=e;t.type===`text`&&typeof t.text==`string`?o+=t.text.length:t.type===`image`&&(s+=1)}}}let c=e=>Math.ceil(e/4),l=c(n),u=c(r),d=c(i),f=c(a),p=c(o),m=s*1500,h=l+u+d+f+p+m,g=t!==void 0&&t>h?t-h:0;return{systemAndTools:g,userPrompts:l,assistantText:u,thinking:d,toolCalls:f,toolResults:p,images:m,total:h+g}}function uj({turns:e,newDeltas:t}){return(0,L.jsx)(`div`,{className:`mt-1 overflow-x-auto`,children:(0,L.jsxs)(`table`,{className:`w-full font-mono text-[10px]`,children:[(0,L.jsx)(`thead`,{className:`text-neutral-500`,children:(0,L.jsxs)(`tr`,{children:[(0,L.jsx)(`th`,{className:`pr-2 text-left font-normal`,children:`#`}),(0,L.jsx)(`th`,{className:`pr-2 text-left font-normal`,children:`Model`}),(0,L.jsx)(`th`,{className:`pr-2 text-right font-normal`,title:`Estimated new tokens this turn — user message + tool results since the prior assistant turn (~chars/4 estimate). Distinct from Prompt.`,children:`New`}),(0,L.jsx)(`th`,{className:`pr-2 text-right font-normal`,title:`Full prompt sent to the LLM = usage.input + cacheRead + cacheWrite. Includes ALL re-sent prior context — this grows monotonically with conversation length, which is normal LLM behavior.`,children:`Prompt`}),(0,L.jsx)(`th`,{className:`pr-2 text-right font-normal`,title:`Assistant output tokens this turn`,children:`Out`}),(0,L.jsx)(`th`,{className:`text-right font-normal`,title:`Cost billed for this turn`,children:`Cost`})]})}),(0,L.jsx)(`tbody`,{className:`text-neutral-300`,children:e.map((e,n)=>{let r=e.inputTokens+e.cacheReadTokens+e.cacheWriteTokens,i=t.get(e.index)??0;return(0,L.jsxs)(`tr`,{className:`border-t border-neutral-800/60`,children:[(0,L.jsx)(`td`,{className:`pr-2 text-neutral-600`,children:n+1}),(0,L.jsx)(`td`,{className:`max-w-[140px] truncate pr-2`,title:`${e.provider}/${e.model}`,children:e.model}),(0,L.jsxs)(`td`,{className:`pr-2 text-right text-neutral-200`,title:`New content (estimate)`,children:[`~`,bj(i)]}),(0,L.jsx)(`td`,{className:`pr-2 text-right`,title:`input ${bj(e.inputTokens)} + cR ${bj(e.cacheReadTokens)} + cW ${bj(e.cacheWriteTokens)}`,children:bj(r)}),(0,L.jsx)(`td`,{className:`pr-2 text-right`,children:bj(e.outputTokens)}),(0,L.jsx)(`td`,{className:`text-right text-emerald-400`,children:xj(e.cost)})]},`${e.index}-${e.timestamp}`)})})]})})}function dj({messages:e,showThinking:t,onToggleThinking:n,onViewRaw:r,search:i,onSearchChange:a,streamingTail:o}){let s=i.trim().toLowerCase(),c=(0,v.useMemo)(()=>s.length===0?e.map((e,t)=>({msg:e,originalIndex:t})):e.map((e,t)=>({msg:e,originalIndex:t})).filter(({msg:e})=>(typeof e.role==`string`?e.role.toLowerCase():``).includes(s)?!0:hj(e,!0).toLowerCase().includes(s)),[e,s]);return(0,L.jsxs)(`div`,{className:`px-2 py-2`,children:[(0,L.jsxs)(`div`,{className:`mb-1 flex items-center justify-between gap-2 px-1`,children:[(0,L.jsxs)(`span`,{className:`shrink-0 text-[10px] uppercase tracking-wider text-neutral-400`,children:[`Messages (`,s.length>0?`${c.length}/${e.length}`:e.length,`)`]}),(0,L.jsxs)(`label`,{className:`flex items-center gap-1 text-[10px] text-neutral-500 hover:text-neutral-300`,children:[(0,L.jsx)(`input`,{type:`checkbox`,checked:t,onChange:n,className:`h-3 w-3`}),`Show thinking blocks`]})]}),e.length>=10&&(0,L.jsxs)(`div`,{className:`relative mb-1 px-1`,children:[(0,L.jsx)(Le,{size:11,className:`pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-neutral-500`}),(0,L.jsx)(`input`,{type:`text`,value:i,onChange:e=>a(e.target.value),placeholder:`Find in messages…`,className:`w-full rounded border border-neutral-800 bg-neutral-950 py-1 pl-6 pr-2 text-[11px] text-neutral-200 placeholder:text-neutral-600 focus:border-neutral-600 focus:outline-none`})]}),(0,L.jsxs)(`ul`,{className:`space-y-1`,children:[c.map(({msg:e,originalIndex:n})=>(0,L.jsx)(fj,{index:n,message:e,showThinking:t,onViewRaw:()=>r(n,e)},n)),o!==void 0&&s.length===0&&(0,L.jsx)(`li`,{className:`rounded border border-violet-700/40 bg-violet-900/10`,children:(0,L.jsxs)(`div`,{className:`flex items-start gap-2 px-2 py-1.5`,children:[(0,L.jsx)(Ee,{size:11,className:`mt-0.5 shrink-0 animate-spin text-violet-300`}),(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,L.jsx)(`div`,{className:`flex items-center gap-1.5`,children:(0,L.jsx)(`span`,{className:`rounded bg-violet-900/40 px-1.5 py-0.5 text-[9px] uppercase tracking-wider text-violet-300`,children:`assistant (streaming)`})}),(0,L.jsx)(`p`,{className:`line-clamp-2 text-[11px] text-neutral-300`,children:o.content})]})]})})]})]})}function fj({index:e,message:t,showThinking:n,onViewRaw:r}){let[i,a]=(0,v.useState)(!1),o=typeof t.role==`string`?t.role:`unknown`,s=o===`compactionSummary`,c=(0,v.useMemo)(()=>hj(t,n),[t,n]),l=gj(t),u=typeof t.timestamp==`number`?t.timestamp:0;return(0,L.jsxs)(`li`,{className:`rounded border border-neutral-800/70 bg-neutral-900/30`,children:[(0,L.jsxs)(`button`,{onClick:()=>a(e=>!e),className:`flex w-full items-start gap-2 px-2 py-1.5 text-left hover:bg-neutral-900/60`,children:[(0,L.jsx)(`span`,{className:`pt-0.5 text-neutral-600`,children:i?(0,L.jsx)(le,{size:11}):(0,L.jsx)(ue,{size:11})}),(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,L.jsx)(`span`,{className:`rounded px-1.5 py-0.5 text-[9px] uppercase tracking-wider ${mj(o)}`,children:o}),s&&(0,L.jsx)(`span`,{className:`rounded bg-fuchsia-900/40 px-1.5 py-0.5 text-[9px] text-fuchsia-300`,children:`compacted`}),(0,L.jsxs)(`span`,{className:`text-[10px] text-neutral-600`,children:[`~`,bj(l),` tok`]}),u>0&&(0,L.jsx)(`span`,{className:`text-[10px] text-neutral-600`,children:new Date(u).toLocaleTimeString()})]}),!i&&c.length>0&&(0,L.jsx)(`p`,{className:`line-clamp-2 text-[11px] text-neutral-400`,children:c})]}),(0,L.jsx)(`button`,{onClick:e=>{e.stopPropagation(),r()},className:`rounded p-1 text-neutral-500 hover:bg-neutral-800 hover:text-neutral-100`,title:`View raw AgentMessage JSON`,children:(0,L.jsx)(de,{size:11})})]}),i&&(0,L.jsx)(`div`,{className:`space-y-1 border-t border-neutral-800/70 px-3 py-2`,children:vj(t,n,e)})]})}function pj({title:e,payload:t,onClose:n}){let r=(0,v.useMemo)(()=>{try{return JSON.stringify(t,null,2)}catch{return String(t)}},[t]);return(0,v.useEffect)(()=>{let e=e=>{e.key===`Escape`&&n()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n]),(0,L.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/70 px-4 py-8`,onClick:n,children:(0,L.jsxs)(`div`,{onClick:e=>e.stopPropagation(),className:`flex h-full max-h-[720px] w-full max-w-4xl flex-col overflow-hidden rounded-lg border border-neutral-800 bg-neutral-950 shadow-2xl`,children:[(0,L.jsxs)(`header`,{className:`flex items-center justify-between border-b border-neutral-800 px-3 py-2`,children:[(0,L.jsx)(`span`,{className:`text-xs text-neutral-200`,children:e}),(0,L.jsx)(`button`,{onClick:n,className:`rounded p-2 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-200`,title:`Close (Esc)`,children:(0,L.jsx)(Ke,{size:20})})]}),(0,L.jsx)(Ci,{code:r,language:`json`,theme:Kr.vsDark,children:({style:e,tokens:t,getLineProps:n,getTokenProps:r})=>(0,L.jsx)(`pre`,{className:`flex-1 overflow-auto whitespace-pre p-3 font-mono text-[11px]`,style:{...e,background:`transparent`},children:t.map((e,t)=>(0,L.jsx)(`div`,{...n({line:e}),children:e.map((e,t)=>(0,L.jsx)(`span`,{...r({token:e})},t))},t))})})]})})}function mj(e){return e===`user`?`bg-sky-900/40 text-sky-300`:e===`assistant`?`bg-violet-900/40 text-violet-300`:e===`tool`||e===`toolResult`?`bg-amber-900/40 text-amber-300`:e===`compactionSummary`?`bg-fuchsia-900/40 text-fuchsia-300`:`bg-neutral-800 text-neutral-400`}function hj(e,t){let n=e.content;if(typeof n==`string`)return n.slice(0,200);if(!Array.isArray(n))return``;let r=[];for(let e of n){let n=e;n.type===`thinking`&&!t||(n.type===`text`&&typeof n.text==`string`?r.push(n.text):n.type===`thinking`&&typeof n.text==`string`?r.push(`[thinking] ${n.text}`):n.type===`toolUse`&&typeof n.name==`string`&&r.push(`[tool: ${n.name}]`))}return r.join(` `).slice(0,200)}function gj(e){let t=e.usage;if(t!==void 0&&typeof t.totalTokens==`number`)return t.totalTokens;let n=e.content;if(typeof n==`string`)return Math.ceil(n.length/4);if(!Array.isArray(n))return 0;let r=0,i=0;for(let e of n){let t=e;typeof t.text==`string`&&(r+=t.text.length),t.type===`image`&&(i+=1)}return Math.ceil(r/4)+i*1500}function _j(e,t){let n=new Map,r=-1;for(let i of t){let t=0;for(let n=r+1;n<i.index;n++){let r=e[n];if(r===void 0)continue;let i=typeof r.role==`string`?r.role:``;i!==`user`&&i!==`toolResult`||(t+=gj(r))}n.set(i.index,t),r=i.index}return n}function vj(e,t,n){let r=typeof e.role==`string`?e.role:`unknown`,i=e.content;return r===`toolResult`?(0,L.jsxs)(`div`,{children:[(0,L.jsxs)(`p`,{className:`mb-1 text-[10px] text-neutral-500`,children:[`tool: `,(0,L.jsx)(`span`,{className:`font-mono`,children:String(e.toolName??`unknown`)}),` `,e.isError===!0&&(0,L.jsx)(`span`,{className:`text-red-400`,children:`(error)`})]}),(0,L.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap break-words rounded bg-neutral-950 p-2 font-mono text-[10px] text-neutral-300`,children:yj(i)})]}):Array.isArray(i)?(0,L.jsx)(L.Fragment,{children:i.map((e,r)=>{let i=e;return i.type===`thinking`&&!t?null:i.type===`text`||i.type===`thinking`?(0,L.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-sans text-[11px] ${i.type===`thinking`?`italic text-neutral-500`:`text-neutral-200`}`,children:String(i.text??``)},`${n}-${r}`):i.type===`toolUse`?(0,L.jsxs)(`div`,{className:`rounded border border-neutral-800 p-2`,children:[(0,L.jsxs)(`p`,{className:`mb-1 text-[10px] text-neutral-500`,children:[`tool call: `,(0,L.jsx)(`span`,{className:`font-mono`,children:String(i.name??`unknown`)})]}),(0,L.jsx)(`pre`,{className:`max-h-48 overflow-auto whitespace-pre-wrap break-words font-mono text-[10px] text-neutral-300`,children:yj(i.input)})]},`${n}-${r}`):i.type===`image`?(0,L.jsx)(`p`,{className:`text-[11px] italic text-neutral-500`,children:`[image attachment]`},`${n}-${r}`):(0,L.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-[10px] text-neutral-500`,children:yj(i)},`${n}-${r}`)})}):typeof i==`string`?(0,L.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-sans text-[11px] text-neutral-200`,children:i}):(0,L.jsx)(`pre`,{className:`whitespace-pre-wrap break-words font-mono text-[10px] text-neutral-500`,children:yj(e)})}function yj(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function bj(e){return e<1e3?String(e):e<1e6?`${(e/1e3).toFixed(+(e<1e4))}k`:`${(e/1e6).toFixed(2)}M`}function xj(e){return e===0?`$0`:e<.01?`$${e.toFixed(4)}`:e<1?`$${e.toFixed(3)}`:`$${e.toFixed(2)}`}function Sj({getStartSize:e,onResize:t,direction:n,minSize:r,maxSize:i,orientation:a=`vertical`}){let o=(0,v.useRef)(null),s=a===`horizontal`,c=s?`row-resize`:`col-resize`;(0,v.useEffect)(()=>{let e=()=>{o.current!==null&&(o.current=null,document.body.style.removeProperty(`cursor`),document.body.style.removeProperty(`user-select`))},t=t=>{t.key===`Escape`&&e()};return window.addEventListener(`keydown`,t),window.addEventListener(`blur`,e),()=>{e(),window.removeEventListener(`keydown`,t),window.removeEventListener(`blur`,e)}},[]);let l=t=>{t.preventDefault(),t.currentTarget.setPointerCapture(t.pointerId),o.current={start:s?t.clientY:t.clientX,startSize:e()},document.body.style.cursor=c,document.body.style.userSelect=`none`},u=e=>{if(o.current===null)return;let a=(s?e.clientY:e.clientX)-o.current.start,c=o.current.startSize+a*n;t(Math.min(Math.max(c,r),i))},d=e=>{o.current!==null&&(e.currentTarget.releasePointerCapture(e.pointerId),o.current=null,document.body.style.removeProperty(`cursor`),document.body.style.removeProperty(`user-select`))},f=s?`h-1 w-full cursor-row-resize`:`w-1 h-full cursor-col-resize`,p=s?`absolute inset-x-0 -top-1 -bottom-1`:`absolute inset-y-0 -left-1 -right-1`;return(0,L.jsx)(`div`,{onPointerDown:l,onPointerMove:u,onPointerUp:d,onPointerCancel:d,className:`group relative shrink-0 bg-neutral-800 hover:bg-neutral-600 active:bg-neutral-500 ${f}`,role:`separator`,"aria-orientation":s?`horizontal`:`vertical`,children:(0,L.jsx)(`div`,{className:p})})}var Cj=`pi-forge/files-width`,wj=`pi-forge/editor-width`,Tj=`pi-forge/terminal-height`,Ej=280,Dj=480,Oj=280,kj=200,Aj=320,jj=320,Mj=140;function Nj(e,t){let n=localStorage.getItem(e);if(n===null)return t;let r=Number.parseInt(n,10);return Number.isFinite(r)&&r>0?r:t}function Pj(){let e=Cn(e=>e.ready),t=Cn(e=>e.isAuthenticated),n=Cn(e=>e.mustChangePassword),r=Cn(e=>e.bootstrap),i=Cn(e=>e.logout),a=On(e=>e.projects),o=On(e=>!e.loading),s=On(e=>e.load),c=kn(),l=$n(e=>e.activeSessionId),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(()=>localStorage.getItem(`pi-forge/files-open`)===`true`),m=e=>{p(e),localStorage.setItem(`pi-forge/files-open`,e?`true`:`false`)},[h,g]=(0,v.useState)(()=>{let e=localStorage.getItem(`pi-forge/right-tab`);return e===`files`||e===`search`||e===`changes`||e===`git`||e===`context`?e:`files`}),_=e=>{g(e),localStorage.setItem(`pi-forge/right-tab`,e)},[y,b]=(0,v.useState)(()=>localStorage.getItem(`pi-forge/terminal-open`)===`true`),x=e=>{b(e),localStorage.setItem(`pi-forge/terminal-open`,e?`true`:`false`)},[S,C]=(0,v.useState)(()=>localStorage.getItem(`pi-forge/chat-open`)!==`false`),w=e=>{C(e),localStorage.setItem(`pi-forge/chat-open`,e?`true`:`false`)},[T,E]=(0,v.useState)(()=>localStorage.getItem(`pi-forge/editor-open`)!==`false`),D=e=>{E(e),localStorage.setItem(`pi-forge/editor-open`,e?`true`:`false`)},[O,ee]=(0,v.useState)(!1),[te,ne]=(0,v.useState)(()=>Nj(Tj,Oj)),re=(0,v.useRef)(te);(0,v.useEffect)(()=>{re.current=te,localStorage.setItem(Tj,String(te))},[te]);let[k,ie]=(0,v.useState)(()=>Nj(Cj,Ej)),[ae,A]=(0,v.useState)(()=>Nj(wj,Dj)),oe=(0,v.useRef)(k),j=(0,v.useRef)(ae);(0,v.useEffect)(()=>{oe.current=k,localStorage.setItem(Cj,String(k))},[k]),(0,v.useEffect)(()=>{j.current=ae,localStorage.setItem(wj,String(ae))},[ae]);let se=ur(e=>e.openFiles.length),ce=T&&se>0,le=IA(c?.id).status?.files.length??0,ue=$n(e=>l===void 0?0:e.agentEndCountBySession[l]??0),de=$n(e=>l===void 0?!1:e.streamingBySession[l]??!1),fe=ur(e=>e.loadTree),pe=ur(e=>e.restoreTabs),me=ur(e=>e.refreshOpenFiles);(0,v.useEffect)(()=>{c===void 0||de||(fe(c.id),me(c.id))},[c?.id,de,ue]),(0,v.useEffect)(()=>{c!==void 0&&pe(c.id)},[c?.id]),(0,v.useEffect)(()=>{if(!u)return;let e=e=>{e.key===`Escape`&&d(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[u]);let he=IO(e=>e.settingsRequest),_e=IO(e=>e.clearSettingsRequest),[ve,ye]=(0,v.useState)(void 0);(0,v.useEffect)(()=>{he!==void 0&&(d(!0),he.tab!==void 0&&ye(he.tab),_e())},[he,_e]),(0,v.useEffect)(()=>{r()},[r]);let be=pr(e=>e.load),Se=pr(e=>e.minimal);(0,v.useEffect)(()=>{be()},[be]),(0,v.useEffect)(()=>{t&&!n&&s()},[t,n,s]);let Ce=rk(e=>e.startPolling),we=rk(e=>e.stopPolling);return(0,v.useEffect)(()=>{t&&!n?Ce():we()},[t,n,Ce,we]),e?t?n?(0,L.jsx)(vr,{}):(0,L.jsxs)(`div`,{className:`flex h-screen flex-col bg-neutral-950 text-neutral-100`,children:[(0,L.jsxs)(`header`,{className:`flex items-center justify-between border-b border-neutral-800 px-4 py-2`,children:[(0,L.jsx)(`div`,{className:`flex items-center gap-3`,children:(0,L.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,L.jsx)(`img`,{src:`/icons/icon.svg`,alt:``,className:`h-8 w-8`,"aria-hidden":`true`}),(0,L.jsx)(`span`,{className:`text-sm font-semibold tracking-tight`,children:`pi-forge`})]})}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsxs)(`button`,{onClick:()=>w(!S),className:`flex items-center gap-1 rounded-md border px-2 py-1 text-xs ${S?`border-neutral-500 bg-neutral-800 text-neutral-100`:`border-neutral-700 text-neutral-300 hover:border-neutral-500`}`,title:`Toggle the chat pane`,children:[(0,L.jsx)(De,{size:13}),`Chat`]}),(0,L.jsxs)(`button`,{onClick:()=>D(!T),className:`flex items-center gap-1 rounded-md border px-2 py-1 text-xs ${T?`border-neutral-500 bg-neutral-800 text-neutral-100`:`border-neutral-700 text-neutral-300 hover:border-neutral-500`}`,title:`Toggle the editor pane (open tabs persist across reloads)`,children:[(0,L.jsx)(ge,{size:13}),`Editor`]}),(0,L.jsxs)(`button`,{onClick:()=>m(!f),className:`flex items-center gap-1 rounded-md border px-2 py-1 text-xs ${f?`border-neutral-500 bg-neutral-800 text-neutral-100`:`border-neutral-700 text-neutral-300 hover:border-neutral-500`}`,title:`Toggle the file browser tree`,children:[(0,L.jsx)(xe,{size:13}),`Files`]}),!Se&&(0,L.jsxs)(`button`,{onClick:()=>x(!y),className:`flex items-center gap-1 rounded-md border px-2 py-1 text-xs ${y?`border-neutral-500 bg-neutral-800 text-neutral-100`:`border-neutral-700 text-neutral-300 hover:border-neutral-500`}`,title:`Toggle the integrated terminal`,children:[(0,L.jsx)(ze,{size:13}),`Terminal`]}),(0,L.jsx)(jA,{}),(0,L.jsx)(`button`,{onClick:()=>d(!0),className:`rounded-md border border-neutral-700 px-2 py-1 text-xs text-neutral-300 hover:border-neutral-500`,title:`Settings (providers, agent defaults, MCP, skills)`,children:`Settings`}),(0,L.jsx)(`button`,{onClick:i,className:`rounded-md border border-neutral-700 px-2 py-1 text-xs text-neutral-300 hover:border-neutral-500`,children:`Sign out`})]})]}),u&&(0,L.jsx)(mk,{onClose:()=>{d(!1),ye(void 0)},...ve===void 0?{}:{initialTab:ve}}),(0,L.jsxs)(`div`,{className:`flex flex-1 flex-col overflow-hidden`,children:[(0,L.jsxs)(`div`,{className:`flex flex-1 overflow-hidden`,children:[(0,L.jsx)(Er,{}),(0,L.jsxs)(`main`,{className:`flex flex-1 overflow-hidden`,children:[S&&(0,L.jsx)(`div`,{className:`flex flex-1 flex-col overflow-hidden`,children:o&&a.length===0?O?(0,L.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-6 text-center`,children:(0,L.jsxs)(`div`,{className:`space-y-3 text-sm text-neutral-400`,children:[(0,L.jsx)(`p`,{children:`No projects yet.`}),(0,L.jsx)(`button`,{onClick:()=>ee(!1),className:`rounded-md bg-neutral-100 px-3 py-1.5 text-sm font-medium text-neutral-900 hover:bg-white`,children:`+ New project`})]})}):(0,L.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,L.jsx)(br,{onClose:()=>ee(!0)})}):l===void 0?c?(0,L.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-6 text-center`,children:(0,L.jsxs)(`div`,{className:`space-y-3 text-sm text-neutral-400`,children:[(0,L.jsx)(`h2`,{className:`text-xl font-semibold text-neutral-100`,children:c.name}),(0,L.jsx)(`p`,{className:`font-mono text-xs`,children:c.path}),(0,L.jsx)(`p`,{children:`Pick a session from the sidebar — or start a new one here.`}),(0,L.jsx)(`button`,{onClick:()=>{$n.getState().createSession(c.id)},className:`rounded-md bg-neutral-100 px-3 py-1.5 text-sm font-medium text-neutral-900 hover:bg-white`,children:`+ New session`})]})}):(0,L.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,L.jsx)(`p`,{className:`text-sm text-neutral-400`,children:`Select a project from the sidebar.`})}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(pO,{sessionId:l}),!Se&&(0,L.jsx)($O,{sessionId:l,alreadyOnChangesTab:f&&h===`changes`,onOpen:()=>{f||m(!0),_(`changes`)}}),(0,L.jsx)(YO,{sessionId:l})]})}),ce&&(S?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Sj,{getStartSize:()=>j.current,onResize:e=>A(e),direction:-1,minSize:Aj,maxSize:Math.max(Aj,window.innerWidth-(f?k:0)-jj-240)}),(0,L.jsx)(`div`,{className:`flex shrink-0 flex-col border-l border-neutral-800`,style:{width:`${ae}px`},children:(0,L.jsx)(oA,{})})]}):(0,L.jsx)(`div`,{className:`flex flex-1 flex-col overflow-hidden`,children:(0,L.jsx)(oA,{})})),f&&(()=>{let e=!S&&!ce,t=(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{className:`flex border-b border-neutral-800 bg-neutral-900/40`,children:(Se?[`files`,`search`,`context`]:[`files`,`search`,`changes`,`git`,`context`]).map(e=>(0,L.jsxs)(`button`,{onClick:()=>_(e),className:`flex items-center gap-1 px-3 py-1.5 text-[11px] uppercase tracking-wider ${h===e?`border-b border-neutral-100 text-neutral-100`:`text-neutral-500 hover:text-neutral-300`}`,children:[e===`files`?`Files`:e===`search`?`Search`:e===`changes`?`Last turn`:e===`git`?`Git`:`Context`,e===`git`&&le>0&&(0,L.jsx)(`span`,{className:`rounded bg-amber-900/40 px-1 py-0.5 text-[9px] text-amber-300`,children:le})]},e))}),(0,L.jsx)(`div`,{className:`flex-1 overflow-hidden`,children:h===`files`?(0,L.jsx)(Wk,{}):h===`search`?(0,L.jsx)(QA,{}):!Se&&h===`changes`?(0,L.jsx)(PA,{}):!Se&&h===`git`?(0,L.jsx)(BA,{}):h===`context`?(0,L.jsx)(aj,{}):(0,L.jsx)(Wk,{})})]});return e?(0,L.jsx)(`div`,{className:`flex flex-1 flex-col overflow-hidden`,children:t}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Sj,{getStartSize:()=>oe.current,onResize:e=>ie(e),direction:-1,minSize:kj,maxSize:Math.max(kj,window.innerWidth-jj-240-(ce?Aj:0))}),(0,L.jsx)(`div`,{className:`flex shrink-0 flex-col border-l border-neutral-800`,style:{width:`${k}px`},children:t})]})})()]})]}),!Se&&y&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Sj,{orientation:`horizontal`,getStartSize:()=>re.current,onResize:e=>ne(e),direction:-1,minSize:Mj,maxSize:Math.max(Mj,Math.floor(window.innerHeight*.7))}),(0,L.jsx)(`div`,{className:`shrink-0 border-t border-neutral-800`,style:{height:`${te}px`},children:(0,L.jsx)(DA,{})})]})]})]}):(0,L.jsx)(gr,{}):(0,L.jsx)(`main`,{className:`flex min-h-screen items-center justify-center text-sm text-neutral-400`,children:`Loading…`})}uk(),O({immediate:!0});var Fj=class extends v.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(`[pi-forge] root render error`,e,t)}render(){return this.state.error===null?this.props.children:(0,L.jsxs)(`main`,{style:{padding:`2rem`,fontFamily:`monospace`,color:`#fca5a5`,background:`#0a0a0a`,minHeight:`100vh`,whiteSpace:`pre-wrap`,overflow:`auto`},children:[(0,L.jsx)(`h1`,{style:{color:`#fff`,marginBottom:`1rem`},children:`pi-forge: render crash`}),(0,L.jsx)(`p`,{style:{color:`#d4d4d4`,marginBottom:`1rem`},children:this.state.error.message}),(0,L.jsx)(`pre`,{style:{fontSize:`11px`,color:`#a3a3a3`},children:this.state.error.stack??`(no stack)`}),(0,L.jsx)(`p`,{style:{marginTop:`2rem`,color:`#71717a`,fontSize:`12px`},children:`Tip: open the browser console for more detail. Try clearing localStorage (devtools → Application → Local Storage → Clear) and refreshing if the error mentions stale state.`})]})}};window.addEventListener(`error`,e=>{console.error(`[pi-forge] uncaught error`,e.error)}),window.addEventListener(`unhandledrejection`,e=>{console.error(`[pi-forge] unhandled rejection`,e.reason)});var Ij=document.getElementById(`root`);if(!Ij)throw Error(`#root element missing in index.html`);(0,y.createRoot)(Ij).render((0,L.jsx)(v.StrictMode,{children:(0,L.jsx)(Fj,{children:(0,L.jsx)(Pj,{})})}));export{l as a,d as i,dk as n,hr as r,fk as t};
356
+ //# sourceMappingURL=index-B0ffzJ0t.js.map