@seele00/seele-work 0.1.136 → 0.1.138
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/libexec/seele-server +0 -0
- package/libexec/seele-worker +0 -0
- package/libexec/seele-workspace-observe +0 -0
- package/package.json +1 -1
- package/release-manifest.json +133 -130
- package/web/dist/assets/{abnfDiagram-VRR7QNED-BNaPvcWq.js → abnfDiagram-VRR7QNED-Ct2GQkbU.js} +1 -1
- package/web/dist/assets/{arc-slZQXmKC.js → arc-c-AyZpma.js} +1 -1
- package/web/dist/assets/{architectureDiagram-ZJ3FMSHR-DWuUVI3l.js → architectureDiagram-ZJ3FMSHR-DcQnHmxr.js} +1 -1
- package/web/dist/assets/{blockDiagram-677ZJIJ3-BAGQvy_f.js → blockDiagram-677ZJIJ3-CuzlKh71.js} +1 -1
- package/web/dist/assets/{c4Diagram-LMCZKHZV-DxULde0Z.js → c4Diagram-LMCZKHZV-E8bsHBdm.js} +1 -1
- package/web/dist/assets/channel-aB3XAXtS.js +1 -0
- package/web/dist/assets/{chunk-2Q5K7J3B-C5XXnM6W.js → chunk-2Q5K7J3B-C-H394b8.js} +1 -1
- package/web/dist/assets/{chunk-32BRIVSS-Da9UmCi2.js → chunk-32BRIVSS-C4mmptCt.js} +1 -1
- package/web/dist/assets/{chunk-5VM5RSS4-c0vfNTKk.js → chunk-5VM5RSS4-CXGW1K2y.js} +1 -1
- package/web/dist/assets/{chunk-EX3LRPZG-Cz8hIOnx.js → chunk-EX3LRPZG-DHQE5zlb.js} +1 -1
- package/web/dist/assets/{chunk-JWPE2WC7-BtaaRjvn.js → chunk-JWPE2WC7-DiyU9MEu.js} +1 -1
- package/web/dist/assets/{chunk-MOJQB5TN-CKlCE6Y_.js → chunk-MOJQB5TN-18LdSRAI.js} +1 -1
- package/web/dist/assets/{chunk-RYQCIY6F-BOJfAuUe.js → chunk-RYQCIY6F-9xd-aMlF.js} +1 -1
- package/web/dist/assets/{chunk-V7JOEXUC-9r4xqhPh.js → chunk-V7JOEXUC-Dz7FVwpq.js} +1 -1
- package/web/dist/assets/{chunk-VR4S4FIN-BhxMrkrg.js → chunk-VR4S4FIN-C9JFDHSP.js} +1 -1
- package/web/dist/assets/{chunk-XXDRQBXY-CwU8qWGO.js → chunk-XXDRQBXY-DY8Du8Zg.js} +1 -1
- package/web/dist/assets/classDiagram-OUVF2IWQ-BKFc-eMN.js +1 -0
- package/web/dist/assets/classDiagram-v2-EOCWNBFH-BKFc-eMN.js +1 -0
- package/web/dist/assets/{core-DSYKin3G.js → core-1UxKLd8w.js} +1 -1
- package/web/dist/assets/{cose-bilkent-JH36ORCC-Dab6pAkj.js → cose-bilkent-JH36ORCC-C7s5TP-U.js} +1 -1
- package/web/dist/assets/{cynefin-VYW2F7L2-BZwISilI.js → cynefin-VYW2F7L2-Cpb_Ne2W.js} +1 -1
- package/web/dist/assets/{cynefinDiagram-TSTJHNR4-C_d0wHJq.js → cynefinDiagram-TSTJHNR4-CBJZx0Gi.js} +1 -1
- package/web/dist/assets/{dagre-VKFMJZFB-DTTgXtAQ.js → dagre-VKFMJZFB-CPEyRgjb.js} +1 -1
- package/web/dist/assets/{diagram-FQU43EPY-BBfijNn2.js → diagram-FQU43EPY-4T9gOHu5.js} +1 -1
- package/web/dist/assets/{diagram-G47NLZAW-C15MlfiE.js → diagram-G47NLZAW-BbLuOnho.js} +1 -1
- package/web/dist/assets/{diagram-NH7WQ7WH-Dk2WRsUE.js → diagram-NH7WQ7WH-C2r0kENE.js} +1 -1
- package/web/dist/assets/{diagram-OA4YK3LP-C0n7-pOO.js → diagram-OA4YK3LP-CcWN9-aD.js} +1 -1
- package/web/dist/assets/{diagram-WEI45ONY-BbpkQrN8.js → diagram-WEI45ONY-Bzc6vqA0.js} +1 -1
- package/web/dist/assets/{ebnfDiagram-CCIWWBDH-15IV2cO1.js → ebnfDiagram-CCIWWBDH-DskijeYu.js} +1 -1
- package/web/dist/assets/{erDiagram-Q63AITRT-DRNK9qPN.js → erDiagram-Q63AITRT-D3belTmE.js} +1 -1
- package/web/dist/assets/{flowDiagram-23GEKE2U-CtJDOPEq.js → flowDiagram-23GEKE2U-Bj9NgWSN.js} +1 -1
- package/web/dist/assets/{ganttDiagram-NO4QXBWP-7WFEH8I5.js → ganttDiagram-NO4QXBWP-CYQ_bXAg.js} +1 -1
- package/web/dist/assets/{gitGraphDiagram-IHSO6WYX-BeyKux_J.js → gitGraphDiagram-IHSO6WYX-BwiKMRpS.js} +1 -1
- package/web/dist/assets/{index-Bex-AmFk.js → index-BGU5HMhp.js} +29 -29
- package/web/dist/assets/index-DI3Jzxi6.css +1 -0
- package/web/dist/assets/{infoDiagram-FWYZ7A6U-BhYR9ZNu.js → infoDiagram-FWYZ7A6U-DOuTaNed.js} +1 -1
- package/web/dist/assets/{ishikawaDiagram-FXEZZL3T-JIbz-qII.js → ishikawaDiagram-FXEZZL3T-B-qFjRhf.js} +1 -1
- package/web/dist/assets/{journeyDiagram-5HDEW3XC-bp7juubn.js → journeyDiagram-5HDEW3XC-C0jJBDsB.js} +1 -1
- package/web/dist/assets/{kanban-definition-HUTT4EX6-CeuJOjFT.js → kanban-definition-HUTT4EX6-BBhlEDRX.js} +1 -1
- package/web/dist/assets/{linear-TmSe7pXF.js → linear-m6Udutly.js} +1 -1
- package/web/dist/assets/{mermaid.core-CeDonWvV.js → mermaid.core-CmWgft13.js} +5 -5
- package/web/dist/assets/{mindmap-definition-LN4V7U3C-CxMQjNc5.js → mindmap-definition-LN4V7U3C-m_b5JPz-.js} +1 -1
- package/web/dist/assets/{pegDiagram-2B236MQR-B8eZKJlL.js → pegDiagram-2B236MQR-CCC7GbDD.js} +1 -1
- package/web/dist/assets/{pieDiagram-ENE6RG2P-CZnzYtLB.js → pieDiagram-ENE6RG2P-D2NhttNH.js} +1 -1
- package/web/dist/assets/{quadrantDiagram-ABIIQ3AL-JOieDU2e.js → quadrantDiagram-ABIIQ3AL-DtefqrFt.js} +1 -1
- package/web/dist/assets/{railroadDiagram-RFXS5EU6-BYcXbhCh.js → railroadDiagram-RFXS5EU6-DwtlRAPB.js} +1 -1
- package/web/dist/assets/{requirementDiagram-TGXJPOKE-AUa3MyAP.js → requirementDiagram-TGXJPOKE-Cxk7fDpp.js} +1 -1
- package/web/dist/assets/{sankeyDiagram-HTMAVEWB-DzFX2PDH.js → sankeyDiagram-HTMAVEWB-pzdouhIL.js} +1 -1
- package/web/dist/assets/{sequenceDiagram-DBY2YBRQ-BqBqIwM6.js → sequenceDiagram-DBY2YBRQ-CczxVFLm.js} +1 -1
- package/web/dist/assets/{sizeCapture-X5ZJPWSS-BXfRSJN_.js → sizeCapture-X5ZJPWSS-DsnF0zLU.js} +1 -1
- package/web/dist/assets/{stateDiagram-2N3HPSRC-DdCs_b_T.js → stateDiagram-2N3HPSRC-CRmYD6kw.js} +1 -1
- package/web/dist/assets/stateDiagram-v2-6OUMAXLB-D9DoKbvR.js +1 -0
- package/web/dist/assets/{swimlanes-5IMT3BWC-a1MhyOsA.js → swimlanes-5IMT3BWC-Brq7120o.js} +2 -2
- package/web/dist/assets/swimlanesDiagram-G3AALYLV-C-buVjad.js +8 -0
- package/web/dist/assets/{timeline-definition-FHXFAJF6-yqYzUuD1.js → timeline-definition-FHXFAJF6-DsOYBj1u.js} +1 -1
- package/web/dist/assets/{vennDiagram-L72KCM5P--ECkNj85.js → vennDiagram-L72KCM5P-CNvnpwH4.js} +1 -1
- package/web/dist/assets/{wardleyDiagram-EHGQE667-D8zKt4eJ.js → wardleyDiagram-EHGQE667-CyazNrjc.js} +1 -1
- package/web/dist/assets/{xychartDiagram-FW5EYKEG-RWwbDAca.js → xychartDiagram-FW5EYKEG-VeiDchaU.js} +1 -1
- package/web/dist/index.html +2 -2
- package/web/dist/assets/channel-DO44n-sY.js +0 -1
- package/web/dist/assets/classDiagram-OUVF2IWQ-BkIIQno9.js +0 -1
- package/web/dist/assets/classDiagram-v2-EOCWNBFH-BkIIQno9.js +0 -1
- package/web/dist/assets/index-DLjjNhyv.css +0 -1
- package/web/dist/assets/stateDiagram-v2-6OUMAXLB-BFLR_iEx.js +0 -1
- package/web/dist/assets/swimlanesDiagram-G3AALYLV-Ca3W_S1t.js +0 -8
|
@@ -15,7 +15,7 @@ var db=Object.defineProperty;var fb=(e,t,n)=>t in e?db(e,t,{enumerable:!0,config
|
|
|
15
15
|
*
|
|
16
16
|
* This source code is licensed under the MIT license found in the
|
|
17
17
|
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var F2;function yb(){if(F2)return ot;F2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),k=Symbol.iterator;function b(_){return _===null||typeof _!="object"?null:(_=k&&_[k]||_["@@iterator"],typeof _=="function"?_:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,q={};function z(_,te,O){this.props=_,this.context=te,this.refs=q,this.updater=O||T}z.prototype.isReactComponent={},z.prototype.setState=function(_,te){if(typeof _!="object"&&typeof _!="function"&&_!=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,_,te,"setState")},z.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function M(){}M.prototype=z.prototype;function B(_,te,O){this.props=_,this.context=te,this.refs=q,this.updater=O||T}var U=B.prototype=new M;U.constructor=B,A(U,z.prototype),U.isPureReactComponent=!0;var
|
|
18
|
+
*/var F2;function yb(){if(F2)return ot;F2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),k=Symbol.iterator;function b(_){return _===null||typeof _!="object"?null:(_=k&&_[k]||_["@@iterator"],typeof _=="function"?_:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,q={};function z(_,te,O){this.props=_,this.context=te,this.refs=q,this.updater=O||T}z.prototype.isReactComponent={},z.prototype.setState=function(_,te){if(typeof _!="object"&&typeof _!="function"&&_!=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,_,te,"setState")},z.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function M(){}M.prototype=z.prototype;function B(_,te,O){this.props=_,this.context=te,this.refs=q,this.updater=O||T}var U=B.prototype=new M;U.constructor=B,A(U,z.prototype),U.isPureReactComponent=!0;var ne=Array.isArray;function L(){}var K={H:null,A:null,T:null,S:null},ie=Object.prototype.hasOwnProperty;function Q(_,te,O){var ee=O.ref;return{$$typeof:e,type:_,key:te,ref:ee!==void 0?ee:null,props:O}}function F(_,te){return Q(_.type,te,_.props)}function he(_){return typeof _=="object"&&_!==null&&_.$$typeof===e}function ce(_){var te={"=":"=0",":":"=2"};return"$"+_.replace(/[=:]/g,function(O){return te[O]})}var Ie=/\/+/g;function be(_,te){return typeof _=="object"&&_!==null&&_.key!=null?ce(""+_.key):te.toString(36)}function pe(_){switch(_.status){case"fulfilled":return _.value;case"rejected":throw _.reason;default:switch(typeof _.status=="string"?_.then(L,L):(_.status="pending",_.then(function(te){_.status==="pending"&&(_.status="fulfilled",_.value=te)},function(te){_.status==="pending"&&(_.status="rejected",_.reason=te)})),_.status){case"fulfilled":return _.value;case"rejected":throw _.reason}}throw _}function J(_,te,O,ee,Ae){var re=typeof _;(re==="undefined"||re==="boolean")&&(_=null);var we=!1;if(_===null)we=!0;else switch(re){case"bigint":case"string":case"number":we=!0;break;case"object":switch(_.$$typeof){case e:case t:we=!0;break;case g:return we=_._init,J(we(_._payload),te,O,ee,Ae)}}if(we)return Ae=Ae(_),we=ee===""?"."+be(_,0):ee,ne(Ae)?(O="",we!=null&&(O=we.replace(Ie,"$&/")+"/"),J(Ae,te,O,"",function(wt){return wt})):Ae!=null&&(he(Ae)&&(Ae=F(Ae,O+(Ae.key==null||_&&_.key===Ae.key?"":(""+Ae.key).replace(Ie,"$&/")+"/")+we)),te.push(Ae)),1;we=0;var _e=ee===""?".":ee+":";if(ne(_))for(var He=0;He<_.length;He++)ee=_[He],re=_e+be(ee,He),we+=J(ee,te,O,re,Ae);else if(He=b(_),typeof He=="function")for(_=He.call(_),He=0;!(ee=_.next()).done;)ee=ee.value,re=_e+be(ee,He++),we+=J(ee,te,O,re,Ae);else if(re==="object"){if(typeof _.then=="function")return J(pe(_),te,O,ee,Ae);throw te=String(_),Error("Objects are not valid as a React child (found: "+(te==="[object Object]"?"object with keys {"+Object.keys(_).join(", ")+"}":te)+"). If you meant to render a collection of children, use an array instead.")}return we}function Y(_,te,O){if(_==null)return _;var ee=[],Ae=0;return J(_,ee,"","",function(re){return te.call(O,re,Ae++)}),ee}function ge(_){if(_._status===-1){var te=_._result;te=te(),te.then(function(O){(_._status===0||_._status===-1)&&(_._status=1,_._result=O)},function(O){(_._status===0||_._status===-1)&&(_._status=2,_._result=O)}),_._status===-1&&(_._status=0,_._result=te)}if(_._status===1)return _._result.default;throw _._result}var Te=typeof reportError=="function"?reportError:function(_){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var te=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof _=="object"&&_!==null&&typeof _.message=="string"?String(_.message):String(_),error:_});if(!window.dispatchEvent(te))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",_);return}console.error(_)},H={map:Y,forEach:function(_,te,O){Y(_,function(){te.apply(this,arguments)},O)},count:function(_){var te=0;return Y(_,function(){te++}),te},toArray:function(_){return Y(_,function(te){return te})||[]},only:function(_){if(!he(_))throw Error("React.Children.only expected to receive a single React element child.");return _}};return ot.Activity=v,ot.Children=H,ot.Component=z,ot.Fragment=n,ot.Profiler=l,ot.PureComponent=B,ot.StrictMode=a,ot.Suspense=h,ot.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=K,ot.__COMPILER_RUNTIME={__proto__:null,c:function(_){return K.H.useMemoCache(_)}},ot.cache=function(_){return function(){return _.apply(null,arguments)}},ot.cacheSignal=function(){return null},ot.cloneElement=function(_,te,O){if(_==null)throw Error("The argument must be a React element, but you passed "+_+".");var ee=A({},_.props),Ae=_.key;if(te!=null)for(re in te.key!==void 0&&(Ae=""+te.key),te)!ie.call(te,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&te.ref===void 0||(ee[re]=te[re]);var re=arguments.length-2;if(re===1)ee.children=O;else if(1<re){for(var we=Array(re),_e=0;_e<re;_e++)we[_e]=arguments[_e+2];ee.children=we}return Q(_.type,Ae,ee)},ot.createContext=function(_){return _={$$typeof:c,_currentValue:_,_currentValue2:_,_threadCount:0,Provider:null,Consumer:null},_.Provider=_,_.Consumer={$$typeof:o,_context:_},_},ot.createElement=function(_,te,O){var ee,Ae={},re=null;if(te!=null)for(ee in te.key!==void 0&&(re=""+te.key),te)ie.call(te,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(Ae[ee]=te[ee]);var we=arguments.length-2;if(we===1)Ae.children=O;else if(1<we){for(var _e=Array(we),He=0;He<we;He++)_e[He]=arguments[He+2];Ae.children=_e}if(_&&_.defaultProps)for(ee in we=_.defaultProps,we)Ae[ee]===void 0&&(Ae[ee]=we[ee]);return Q(_,re,Ae)},ot.createRef=function(){return{current:null}},ot.forwardRef=function(_){return{$$typeof:f,render:_}},ot.isValidElement=he,ot.lazy=function(_){return{$$typeof:g,_payload:{_status:-1,_result:_},_init:ge}},ot.memo=function(_,te){return{$$typeof:m,type:_,compare:te===void 0?null:te}},ot.startTransition=function(_){var te=K.T,O={};K.T=O;try{var ee=_(),Ae=K.S;Ae!==null&&Ae(O,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(L,Te)}catch(re){Te(re)}finally{te!==null&&O.types!==null&&(te.types=O.types),K.T=te}},ot.unstable_useCacheRefresh=function(){return K.H.useCacheRefresh()},ot.use=function(_){return K.H.use(_)},ot.useActionState=function(_,te,O){return K.H.useActionState(_,te,O)},ot.useCallback=function(_,te){return K.H.useCallback(_,te)},ot.useContext=function(_){return K.H.useContext(_)},ot.useDebugValue=function(){},ot.useDeferredValue=function(_,te){return K.H.useDeferredValue(_,te)},ot.useEffect=function(_,te){return K.H.useEffect(_,te)},ot.useEffectEvent=function(_){return K.H.useEffectEvent(_)},ot.useId=function(){return K.H.useId()},ot.useImperativeHandle=function(_,te,O){return K.H.useImperativeHandle(_,te,O)},ot.useInsertionEffect=function(_,te){return K.H.useInsertionEffect(_,te)},ot.useLayoutEffect=function(_,te){return K.H.useLayoutEffect(_,te)},ot.useMemo=function(_,te){return K.H.useMemo(_,te)},ot.useOptimistic=function(_,te){return K.H.useOptimistic(_,te)},ot.useReducer=function(_,te,O){return K.H.useReducer(_,te,O)},ot.useRef=function(_){return K.H.useRef(_)},ot.useState=function(_){return K.H.useState(_)},ot.useSyncExternalStore=function(_,te,O){return K.H.useSyncExternalStore(_,te,O)},ot.useTransition=function(){return K.H.useTransition()},ot.version="19.2.7",ot}var P2;function o1(){return P2||(P2=1,gm.exports=yb()),gm.exports}var D=o1(),ym={exports:{}},xc={},vm={exports:{}},xm={};/**
|
|
19
19
|
* @license React
|
|
20
20
|
* scheduler.production.js
|
|
21
21
|
*
|
|
@@ -23,7 +23,7 @@ var db=Object.defineProperty;var fb=(e,t,n)=>t in e?db(e,t,{enumerable:!0,config
|
|
|
23
23
|
*
|
|
24
24
|
* This source code is licensed under the MIT license found in the
|
|
25
25
|
* LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/var G2;function vb(){return G2||(G2=1,(function(e){function t(J,Y){var ge=J.length;J.push(Y);e:for(;0<ge;){var Te=ge-1>>>1,H=J[Te];if(0<l(H,Y))J[Te]=Y,J[ge]=H,ge=Te;else break e}}function n(J){return J.length===0?null:J[0]}function a(J){if(J.length===0)return null;var Y=J[0],ge=J.pop();if(ge!==Y){J[0]=ge;e:for(var Te=0,H=J.length,_=H>>>1;Te<_;){var te=2*(Te+1)-1,O=J[te],ee=te+1,Ae=J[ee];if(0>l(O,ge))ee<H&&0>l(Ae,O)?(J[Te]=Ae,J[ee]=ge,Te=ee):(J[Te]=O,J[te]=ge,Te=te);else if(ee<H&&0>l(Ae,ge))J[Te]=Ae,J[ee]=ge,Te=ee;else break e}}return Y}function l(J,Y){var ge=J.sortIndex-Y.sortIndex;return ge!==0?ge:J.id-Y.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var c=Date,f=c.now();e.unstable_now=function(){return c.now()-f}}var h=[],m=[],g=1,v=null,k=3,b=!1,T=!1,A=!1,q=!1,z=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,B=typeof setImmediate<"u"?setImmediate:null;function U(J){for(var Y=n(m);Y!==null;){if(Y.callback===null)a(m);else if(Y.startTime<=J)a(m),Y.sortIndex=Y.expirationTime,t(h,Y);else break;Y=n(m)}}function
|
|
26
|
+
*/var G2;function vb(){return G2||(G2=1,(function(e){function t(J,Y){var ge=J.length;J.push(Y);e:for(;0<ge;){var Te=ge-1>>>1,H=J[Te];if(0<l(H,Y))J[Te]=Y,J[ge]=H,ge=Te;else break e}}function n(J){return J.length===0?null:J[0]}function a(J){if(J.length===0)return null;var Y=J[0],ge=J.pop();if(ge!==Y){J[0]=ge;e:for(var Te=0,H=J.length,_=H>>>1;Te<_;){var te=2*(Te+1)-1,O=J[te],ee=te+1,Ae=J[ee];if(0>l(O,ge))ee<H&&0>l(Ae,O)?(J[Te]=Ae,J[ee]=ge,Te=ee):(J[Te]=O,J[te]=ge,Te=te);else if(ee<H&&0>l(Ae,ge))J[Te]=Ae,J[ee]=ge,Te=ee;else break e}}return Y}function l(J,Y){var ge=J.sortIndex-Y.sortIndex;return ge!==0?ge:J.id-Y.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var c=Date,f=c.now();e.unstable_now=function(){return c.now()-f}}var h=[],m=[],g=1,v=null,k=3,b=!1,T=!1,A=!1,q=!1,z=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,B=typeof setImmediate<"u"?setImmediate:null;function U(J){for(var Y=n(m);Y!==null;){if(Y.callback===null)a(m);else if(Y.startTime<=J)a(m),Y.sortIndex=Y.expirationTime,t(h,Y);else break;Y=n(m)}}function ne(J){if(A=!1,U(J),!T)if(n(h)!==null)T=!0,L||(L=!0,ce());else{var Y=n(m);Y!==null&&pe(ne,Y.startTime-J)}}var L=!1,K=-1,ie=5,Q=-1;function F(){return q?!0:!(e.unstable_now()-Q<ie)}function he(){if(q=!1,L){var J=e.unstable_now();Q=J;var Y=!0;try{e:{T=!1,A&&(A=!1,M(K),K=-1),b=!0;var ge=k;try{t:{for(U(J),v=n(h);v!==null&&!(v.expirationTime>J&&F());){var Te=v.callback;if(typeof Te=="function"){v.callback=null,k=v.priorityLevel;var H=Te(v.expirationTime<=J);if(J=e.unstable_now(),typeof H=="function"){v.callback=H,U(J),Y=!0;break t}v===n(h)&&a(h),U(J)}else a(h);v=n(h)}if(v!==null)Y=!0;else{var _=n(m);_!==null&&pe(ne,_.startTime-J),Y=!1}}break e}finally{v=null,k=ge,b=!1}Y=void 0}}finally{Y?ce():L=!1}}}var ce;if(typeof B=="function")ce=function(){B(he)};else if(typeof MessageChannel<"u"){var Ie=new MessageChannel,be=Ie.port2;Ie.port1.onmessage=he,ce=function(){be.postMessage(null)}}else ce=function(){z(he,0)};function pe(J,Y){K=z(function(){J(e.unstable_now())},Y)}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(J){J.callback=null},e.unstable_forceFrameRate=function(J){0>J||125<J?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ie=0<J?Math.floor(1e3/J):5},e.unstable_getCurrentPriorityLevel=function(){return k},e.unstable_next=function(J){switch(k){case 1:case 2:case 3:var Y=3;break;default:Y=k}var ge=k;k=Y;try{return J()}finally{k=ge}},e.unstable_requestPaint=function(){q=!0},e.unstable_runWithPriority=function(J,Y){switch(J){case 1:case 2:case 3:case 4:case 5:break;default:J=3}var ge=k;k=J;try{return Y()}finally{k=ge}},e.unstable_scheduleCallback=function(J,Y,ge){var Te=e.unstable_now();switch(typeof ge=="object"&&ge!==null?(ge=ge.delay,ge=typeof ge=="number"&&0<ge?Te+ge:Te):ge=Te,J){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=ge+H,J={id:g++,callback:Y,priorityLevel:J,startTime:ge,expirationTime:H,sortIndex:-1},ge>Te?(J.sortIndex=ge,t(m,J),n(h)===null&&J===n(m)&&(A?(M(K),K=-1):A=!0,pe(ne,ge-Te))):(J.sortIndex=H,t(h,J),T||b||(T=!0,L||(L=!0,ce()))),J},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(J){var Y=k;return function(){var ge=k;k=Y;try{return J.apply(this,arguments)}finally{k=ge}}}})(xm)),xm}var V2;function xb(){return V2||(V2=1,vm.exports=vb()),vm.exports}var bm={exports:{}},Kn={};/**
|
|
27
27
|
* @license React
|
|
28
28
|
* react-dom.production.js
|
|
29
29
|
*
|
|
@@ -39,18 +39,18 @@ var db=Object.defineProperty;var fb=(e,t,n)=>t in e?db(e,t,{enumerable:!0,config
|
|
|
39
39
|
*
|
|
40
40
|
* This source code is licensed under the MIT license found in the
|
|
41
41
|
* LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/var K2;function kb(){if(K2)return xc;K2=1;var e=xb(),t=o1(),n=wb();function a(r){var i="https://react.dev/errors/"+r;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)i+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+r+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function o(r){var i=r,s=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,(i.flags&4098)!==0&&(s=i.return),r=i.return;while(r)}return i.tag===3?s:null}function c(r){if(r.tag===13){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function f(r){if(r.tag===31){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function h(r){if(o(r)!==r)throw Error(a(188))}function m(r){var i=r.alternate;if(!i){if(i=o(r),i===null)throw Error(a(188));return i!==r?null:r}for(var s=r,d=i;;){var p=s.return;if(p===null)break;var y=p.alternate;if(y===null){if(d=p.return,d!==null){s=d;continue}break}if(p.child===y.child){for(y=p.child;y;){if(y===s)return h(p),r;if(y===d)return h(p),i;y=y.sibling}throw Error(a(188))}if(s.return!==d.return)s=p,d=y;else{for(var j=!1,R=p.child;R;){if(R===s){j=!0,s=p,d=y;break}if(R===d){j=!0,d=p,s=y;break}R=R.sibling}if(!j){for(R=y.child;R;){if(R===s){j=!0,s=y,d=p;break}if(R===d){j=!0,d=y,s=p;break}R=R.sibling}if(!j)throw Error(a(189))}}if(s.alternate!==d)throw Error(a(190))}if(s.tag!==3)throw Error(a(188));return s.stateNode.current===s?r:i}function g(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r;for(r=r.child;r!==null;){if(i=g(r),i!==null)return i;r=r.sibling}return null}var v=Object.assign,k=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),B=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),
|
|
42
|
+
*/var K2;function kb(){if(K2)return xc;K2=1;var e=xb(),t=o1(),n=wb();function a(r){var i="https://react.dev/errors/"+r;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)i+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+r+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function o(r){var i=r,s=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,(i.flags&4098)!==0&&(s=i.return),r=i.return;while(r)}return i.tag===3?s:null}function c(r){if(r.tag===13){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function f(r){if(r.tag===31){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function h(r){if(o(r)!==r)throw Error(a(188))}function m(r){var i=r.alternate;if(!i){if(i=o(r),i===null)throw Error(a(188));return i!==r?null:r}for(var s=r,d=i;;){var p=s.return;if(p===null)break;var y=p.alternate;if(y===null){if(d=p.return,d!==null){s=d;continue}break}if(p.child===y.child){for(y=p.child;y;){if(y===s)return h(p),r;if(y===d)return h(p),i;y=y.sibling}throw Error(a(188))}if(s.return!==d.return)s=p,d=y;else{for(var j=!1,R=p.child;R;){if(R===s){j=!0,s=p,d=y;break}if(R===d){j=!0,d=p,s=y;break}R=R.sibling}if(!j){for(R=y.child;R;){if(R===s){j=!0,s=y,d=p;break}if(R===d){j=!0,d=y,s=p;break}R=R.sibling}if(!j)throw Error(a(189))}}if(s.alternate!==d)throw Error(a(190))}if(s.tag!==3)throw Error(a(188));return s.stateNode.current===s?r:i}function g(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r;for(r=r.child;r!==null;){if(i=g(r),i!==null)return i;r=r.sibling}return null}var v=Object.assign,k=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),q=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),B=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),ne=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),ie=Symbol.for("react.lazy"),Q=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),he=Symbol.iterator;function ce(r){return r===null||typeof r!="object"?null:(r=he&&r[he]||r["@@iterator"],typeof r=="function"?r:null)}var Ie=Symbol.for("react.client.reference");function be(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===Ie?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case A:return"Fragment";case z:return"Profiler";case q:return"StrictMode";case ne:return"Suspense";case L:return"SuspenseList";case Q:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case T:return"Portal";case B:return r.displayName||"Context";case M:return(r._context.displayName||"Context")+".Consumer";case U:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case K:return i=r.displayName||null,i!==null?i:be(r.type)||"Memo";case ie:i=r._payload,r=r._init;try{return be(r(i))}catch{}}return null}var pe=Array.isArray,J=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ge={pending:!1,data:null,method:null,action:null},Te=[],H=-1;function _(r){return{current:r}}function te(r){0>H||(r.current=Te[H],Te[H]=null,H--)}function O(r,i){H++,Te[H]=r.current,r.current=i}var ee=_(null),Ae=_(null),re=_(null),we=_(null);function _e(r,i){switch(O(re,i),O(Ae,r),O(ee,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?u2(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=u2(i),r=c2(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}te(ee),O(ee,r)}function He(){te(ee),te(Ae),te(re)}function wt(r){r.memoizedState!==null&&O(we,r);var i=ee.current,s=c2(i,r.type);i!==s&&(O(Ae,r),O(ee,s))}function et(r){Ae.current===r&&(te(ee),te(Ae)),we.current===r&&(te(we),mc._currentValue=ge)}var $t,tt;function fe(r){if($t===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);$t=i&&i[1]||"",tt=-1<s.stack.indexOf(`
|
|
43
43
|
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
44
|
`+$t+r+tt}var qe=!1;function Je(r,i){if(!r||qe)return"";qe=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(i){var xe=function(){throw Error()};if(Object.defineProperty(xe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xe,[])}catch(de){var ue=de}Reflect.construct(r,[],xe)}else{try{xe.call()}catch(de){ue=de}r.call(xe.prototype)}}else{try{throw Error()}catch(de){ue=de}(xe=r())&&typeof xe.catch=="function"&&xe.catch(function(){})}}catch(de){if(de&&ue&&typeof de.stack=="string")return[de.stack,ue.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=d.DetermineComponentFrameRoot(),j=y[0],R=y[1];if(j&&R){var V=j.split(`
|
|
45
45
|
`),se=R.split(`
|
|
46
46
|
`);for(p=d=0;d<V.length&&!V[d].includes("DetermineComponentFrameRoot");)d++;for(;p<se.length&&!se[p].includes("DetermineComponentFrameRoot");)p++;if(d===V.length||p===se.length)for(d=V.length-1,p=se.length-1;1<=d&&0<=p&&V[d]!==se[p];)p--;for(;1<=d&&0<=p;d--,p--)if(V[d]!==se[p]){if(d!==1||p!==1)do if(d--,p--,0>p||V[d]!==se[p]){var ye=`
|
|
47
47
|
`+V[d].replace(" at new "," at ");return r.displayName&&ye.includes("<anonymous>")&&(ye=ye.replace("<anonymous>",r.displayName)),ye}while(1<=d&&0<=p);break}}}finally{qe=!1,Error.prepareStackTrace=s}return(s=r?r.displayName||r.name:"")?fe(s):""}function Xe(r,i){switch(r.tag){case 26:case 27:case 5:return fe(r.type);case 16:return fe("Lazy");case 13:return r.child!==i&&i!==null?fe("Suspense Fallback"):fe("Suspense");case 19:return fe("SuspenseList");case 0:case 15:return Je(r.type,!1);case 11:return Je(r.type.render,!1);case 1:return Je(r.type,!0);case 31:return fe("Activity");default:return""}}function Lt(r){try{var i="",s=null;do i+=Xe(r,s),s=r,r=r.return;while(r);return i}catch(d){return`
|
|
48
48
|
Error generating stack: `+d.message+`
|
|
49
|
-
`+d.stack}}var Tt=Object.prototype.hasOwnProperty,mt=e.unstable_scheduleCallback,At=e.unstable_cancelCallback,pn=e.unstable_shouldYield,en=e.unstable_requestPaint,ht=e.unstable_now,ur=e.unstable_getCurrentPriorityLevel,me=e.unstable_ImmediatePriority,Se=e.unstable_UserBlockingPriority,$e=e.unstable_NormalPriority,at=e.unstable_LowPriority,kt=e.unstable_IdlePriority,wn=e.log,Yr=e.unstable_setDisableYieldValue,Bt=null,dn=null;function Gn(r){if(typeof wn=="function"&&Yr(r),dn&&typeof dn.setStrictMode=="function")try{dn.setStrictMode(Bt,r)}catch{}}var _t=Math.clz32?Math.clz32:_f,Ta=Math.log,Tr=Math.LN2;function _f(r){return r>>>=0,r===0?32:31-(Ta(r)/Tr|0)|0}var $l=256,Fl=262144,$i=4194304;function zn(r){var i=r&42;if(i!==0)return i;switch(r&-r){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 r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function sa(r,i,s){var d=r.pendingLanes;if(d===0)return 0;var p=0,y=r.suspendedLanes,j=r.pingedLanes;r=r.warmLanes;var R=d&134217727;return R!==0?(d=R&~y,d!==0?p=zn(d):(j&=R,j!==0?p=zn(j):s||(s=R&~r,s!==0&&(p=zn(s))))):(R=d&~y,R!==0?p=zn(R):j!==0?p=zn(j):s||(s=d&~r,s!==0&&(p=zn(s)))),p===0?0:i!==0&&i!==p&&(i&y)===0&&(y=p&-p,s=i&-i,y>=s||y===32&&(s&4194048)!==0)?i:p}function Ft(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function Pl(r,i){switch(r){case 1:case 2:case 4:case 8:case 64:return i+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 i+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 ou(){var r=$i;return $i<<=1,($i&62914560)===0&&($i=4194304),r}function ai(r){for(var i=[],s=0;31>s;s++)i.push(r);return i}function Fi(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function Gl(r,i,s,d,p,y){var j=r.pendingLanes;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=s,r.entangledLanes&=s,r.errorRecoveryDisabledLanes&=s,r.shellSuspendCounter=0;var R=r.entanglements,V=r.expirationTimes,se=r.hiddenUpdates;for(s=j&~s;0<s;){var ye=31-_t(s),xe=1<<ye;R[ye]=0,V[ye]=-1;var ue=se[ye];if(ue!==null)for(se[ye]=null,ye=0;ye<ue.length;ye++){var de=ue[ye];de!==null&&(de.lane&=-536870913)}s&=~xe}d!==0&&n0(r,d,0),y!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=y&~(j&~i))}function n0(r,i,s){r.pendingLanes|=i,r.suspendedLanes&=~i;var d=31-_t(i);r.entangledLanes|=i,r.entanglements[d]=r.entanglements[d]|1073741824|s&261930}function uu(r,i){var s=r.entangledLanes|=i;for(r=r.entanglements;s;){var d=31-_t(s),p=1<<d;p&i|r[d]&i&&(r[d]|=i),s&=~p}}function r0(r,i){var s=i&-i;return s=(s&42)!==0?1:qs(s),(s&(r.suspendedLanes|i))!==0?0:s}function qs(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=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:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function cu(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function Us(){var r=Y.p;return r!==0?r:(r=window.event,r===void 0?32:R2(r.type))}function a0(r,i){var s=Y.p;try{return Y.p=r,i()}finally{Y.p=s}}var cr=Math.random().toString(36).slice(2),rn="__reactFiber$"+cr,gn="__reactProps$"+cr,Ar="__reactContainer$"+cr,Aa="__reactEvents$"+cr,du="__reactListeners$"+cr,Hs="__reactHandles$"+cr,i0="__reactResources$"+cr,oa="__reactMarker$"+cr;function Vl(r){delete r[rn],delete r[gn],delete r[Aa],delete r[du],delete r[Hs]}function Ea(r){var i=r[rn];if(i)return i;for(var s=r.parentNode;s;){if(i=s[Ar]||s[rn]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(r=y2(r);r!==null;){if(s=r[rn])return s;r=y2(r)}return i}r=s,s=r.parentNode}return null}function Na(r){if(r=r[rn]||r[Ar]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function ii(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function Pi(r){var i=r[i0];return i||(i=r[i0]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function yn(r){r[oa]=!0}var ua=new Set,$s={};function Ma(r,i){Gi(r,i),Gi(r+"Capture",i)}function Gi(r,i){for($s[r]=i,r=0;r<i.length;r++)ua.add(i[r])}var Lf=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]*$"),Yl={},fu={};function Fs(r){return Tt.call(fu,r)?!0:Tt.call(Yl,r)?!1:Lf.test(r)?fu[r]=!0:(Yl[r]=!0,!1)}function Ps(r,i,s){if(Fs(i))if(s===null)r.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var d=i.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+s)}}function Wl(r,i,s){if(s===null)r.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(i);return}r.setAttribute(i,""+s)}}function Ln(r,i,s,d){if(d===null)r.removeAttribute(s);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(s);return}r.setAttributeNS(i,s,""+d)}}function kn(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function l0(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function za(r,i,s){var d=Object.getOwnPropertyDescriptor(r.constructor.prototype,i);if(!r.hasOwnProperty(i)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var p=d.get,y=d.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return p.call(this)},set:function(j){s=""+j,y.call(this,j)}}),Object.defineProperty(r,i,{enumerable:d.enumerable}),{getValue:function(){return s},setValue:function(j){s=""+j},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function li(r){if(!r._valueTracker){var i=l0(r)?"checked":"value";r._valueTracker=za(r,i,""+r[i])}}function hu(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var s=i.getValue(),d="";return r&&(d=l0(r)?r.checked?"true":"false":r.value),r=d,r!==s?(i.setValue(r),!0):!1}function dr(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var ca=/[\n"\\]/g;function Sn(r){return r.replace(ca,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Gs(r,i,s,d,p,y,j,R){r.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?r.type=j:r.removeAttribute("type"),i!=null?j==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+kn(i)):r.value!==""+kn(i)&&(r.value=""+kn(i)):j!=="submit"&&j!=="reset"||r.removeAttribute("value"),i!=null?Vs(r,j,kn(i)):s!=null?Vs(r,j,kn(s)):d!=null&&r.removeAttribute("value"),p==null&&y!=null&&(r.defaultChecked=!!y),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?r.name=""+kn(R):r.removeAttribute("name")}function Vi(r,i,s,d,p,y,j,R){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(r.type=y),i!=null||s!=null){if(!(y!=="submit"&&y!=="reset"||i!=null)){li(r);return}s=s!=null?""+kn(s):"",i=i!=null?""+kn(i):s,R||i===r.value||(r.value=i),r.defaultValue=i}d=d??p,d=typeof d!="function"&&typeof d!="symbol"&&!!d,r.checked=R?r.checked:!!d,r.defaultChecked=!!d,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(r.name=j),li(r)}function Vs(r,i,s){i==="number"&&dr(r.ownerDocument)===r||r.defaultValue===""+s||(r.defaultValue=""+s)}function da(r,i,s,d){if(r=r.options,i){i={};for(var p=0;p<s.length;p++)i["$"+s[p]]=!0;for(s=0;s<r.length;s++)p=i.hasOwnProperty("$"+r[s].value),r[s].selected!==p&&(r[s].selected=p),p&&d&&(r[s].defaultSelected=!0)}else{for(s=""+kn(s),i=null,p=0;p<r.length;p++){if(r[p].value===s){r[p].selected=!0,d&&(r[p].defaultSelected=!0);return}i!==null||r[p].disabled||(i=r[p])}i!==null&&(i.selected=!0)}}function s0(r,i,s){if(i!=null&&(i=""+kn(i),i!==r.value&&(r.value=i),s==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=s!=null?""+kn(s):""}function Yi(r,i,s,d){if(i==null){if(d!=null){if(s!=null)throw Error(a(92));if(pe(d)){if(1<d.length)throw Error(a(93));d=d[0]}s=d}s==null&&(s=""),i=s}s=kn(i),r.defaultValue=s,d=r.textContent,d===s&&d!==""&&d!==null&&(r.value=d),li(r)}function Er(r,i){if(i){var s=r.firstChild;if(s&&s===r.lastChild&&s.nodeType===3){s.nodeValue=i;return}}r.textContent=i}var mu=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 Kl(r,i,s){var d=i.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?d?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":d?r.setProperty(i,s):typeof s!="number"||s===0||mu.has(i)?i==="float"?r.cssFloat=s:r[i]=(""+s).trim():r[i]=s+"px"}function pu(r,i,s){if(i!=null&&typeof i!="object")throw Error(a(62));if(r=r.style,s!=null){for(var d in s)!s.hasOwnProperty(d)||i!=null&&i.hasOwnProperty(d)||(d.indexOf("--")===0?r.setProperty(d,""):d==="float"?r.cssFloat="":r[d]="");for(var p in i)d=i[p],i.hasOwnProperty(p)&&s[p]!==d&&Kl(r,p,d)}else for(var y in i)i.hasOwnProperty(y)&&Kl(r,y,i[y])}function si(r){if(r.indexOf("-")===-1)return!1;switch(r){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 Wr=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"]]),fa=/^[\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 Wi(r){return fa.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function er(){}var oi=null;function Xl(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Yt=null,Kr=null;function o0(r){var i=Na(r);if(i&&(r=i.stateNode)){var s=r[gn]||null;e:switch(r=i.stateNode,i.type){case"input":if(Gs(r,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),i=s.name,s.type==="radio"&&i!=null){for(s=r;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Sn(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var d=s[i];if(d!==r&&d.form===r.form){var p=d[gn]||null;if(!p)throw Error(a(90));Gs(d,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(i=0;i<s.length;i++)d=s[i],d.form===r.form&&hu(d)}break e;case"textarea":s0(r,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&da(r,!!s.multiple,i,!1)}}}var Zl=!1;function gu(r,i,s){if(Zl)return r(i,s);Zl=!0;try{var d=r(i);return d}finally{if(Zl=!1,(Yt!==null||Kr!==null)&&(Z0(),Yt&&(i=Yt,r=Kr,Kr=Yt=null,o0(i),r)))for(i=0;i<r.length;i++)o0(r[i])}}function Ql(r,i){var s=r.stateNode;if(s===null)return null;var d=s[gn]||null;if(d===null)return null;s=d[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(r=r.type,d=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!d;break e;default:r=!1}if(r)return null;if(s&&typeof s!="function")throw Error(a(231,i,typeof s));return s}var Vn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yu=!1;if(Vn)try{var Jl={};Object.defineProperty(Jl,"passive",{get:function(){yu=!0}}),window.addEventListener("test",Jl,Jl),window.removeEventListener("test",Jl,Jl)}catch{yu=!1}var Da=null,Ys=null,ui=null;function vu(){if(ui)return ui;var r,i=Ys,s=i.length,d,p="value"in Da?Da.value:Da.textContent,y=p.length;for(r=0;r<s&&i[r]===p[r];r++);var j=s-r;for(d=1;d<=j&&i[s-d]===p[y-d];d++);return ui=p.slice(r,1<d?1-d:void 0)}function Ki(r){var i=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&i===13&&(r=13)):r=i,r===10&&(r=13),32<=r||r===13?r:0}function ha(){return!0}function es(){return!1}function Un(r){function i(s,d,p,y,j){this._reactName=s,this._targetInst=p,this.type=d,this.nativeEvent=y,this.target=j,this.currentTarget=null;for(var R in r)r.hasOwnProperty(R)&&(s=r[R],this[R]=s?s(y):y[R]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?ha:es,this.isPropagationStopped=es,this}return v(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=ha)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=ha)},persist:function(){},isPersistent:ha}),i}var Nr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Xi=Un(Nr),Ra=v({},Nr,{view:0,detail:0}),xu=Un(Ra),ts,ci,Zi,Oa=v({},Ra,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:rs,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==Zi&&(Zi&&r.type==="mousemove"?(ts=r.screenX-Zi.screenX,ci=r.screenY-Zi.screenY):ci=ts=0,Zi=r),ts)},movementY:function(r){return"movementY"in r?r.movementY:ci}}),Qi=Un(Oa),Ws=v({},Oa,{dataTransfer:0}),Ks=Un(Ws),ns=v({},Ra,{relatedTarget:0}),Ia=Un(ns),Ji=v({},Nr,{animationName:0,elapsedTime:0,pseudoElement:0}),_a=Un(Ji),fr=v({},Nr,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),hr=Un(fr),el=v({},Nr,{data:0}),tl=Un(el),Xs={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Zs={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"},Qs={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Js(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=Qs[r])?!!i[r]:!1}function rs(){return Js}var bu=v({},Ra,{key:function(r){if(r.key){var i=Xs[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=Ki(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?Zs[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:rs,charCode:function(r){return r.type==="keypress"?Ki(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Ki(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),eo=Un(bu),Ze=v({},Oa,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),wu=Un(Ze),Xr=v({},Ra,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rs}),vn=Un(Xr),ku=v({},Nr,{propertyName:0,elapsedTime:0,pseudoElement:0}),di=Un(ku),to=v({},Oa,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),Nt=Un(to),nl=v({},Nr,{newState:0,oldState:0}),no=Un(nl),as=[9,13,27,32],fi=Vn&&"CompositionEvent"in window,hi=null;Vn&&"documentMode"in document&&(hi=document.documentMode);var mi=Vn&&"TextEvent"in window&&!hi,u0=Vn&&(!fi||hi&&8<hi&&11>=hi),c0=" ",rl=!1;function Su(r,i){switch(r){case"keyup":return as.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ro(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var La=!1;function ao(r,i){switch(r){case"compositionend":return ro(i);case"keypress":return i.which!==32?null:(rl=!0,c0);case"textInput":return r=i.data,r===c0&&rl?null:r;default:return null}}function Bf(r,i){if(La)return r==="compositionend"||!fi&&Su(r,i)?(r=vu(),ui=Ys=Da=null,La=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return u0&&i.locale!=="ko"?null:i.data;default:return null}}var d0={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 io(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!d0[r.type]:i==="textarea"}function is(r,i,s,d){Yt?Kr?Kr.push(d):Kr=[d]:Yt=d,i=ad(i,"onChange"),0<i.length&&(s=new Xi("onChange","change",null,s,d),r.push({event:s,listeners:i}))}var ls=null,ma=null;function qf(r){r2(r,0)}function lo(r){var i=ii(r);if(hu(i))return r}function f0(r,i){if(r==="change")return i}var so=!1;if(Vn){var pa;if(Vn){var pi="oninput"in document;if(!pi){var Pe=document.createElement("div");Pe.setAttribute("oninput","return;"),pi=typeof Pe.oninput=="function"}pa=pi}else pa=!1;so=pa&&(!document.documentMode||9<document.documentMode)}function ss(){ls&&(ls.detachEvent("onpropertychange",al),ma=ls=null)}function al(r){if(r.propertyName==="value"&&lo(ma)){var i=[];is(i,ma,r,Xl(r)),gu(qf,i)}}function h0(r,i,s){r==="focusin"?(ss(),ls=i,ma=s,ls.attachEvent("onpropertychange",al)):r==="focusout"&&ss()}function ju(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return lo(ma)}function Cu(r,i){if(r==="click")return lo(i)}function Uf(r,i){if(r==="input"||r==="change")return lo(i)}function Yn(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var tr=typeof Object.is=="function"?Object.is:Yn;function os(r,i){if(tr(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var s=Object.keys(r),d=Object.keys(i);if(s.length!==d.length)return!1;for(d=0;d<s.length;d++){var p=s[d];if(!Tt.call(i,p)||!tr(r[p],i[p]))return!1}return!0}function us(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function m0(r,i){var s=us(r);r=0;for(var d;s;){if(s.nodeType===3){if(d=r+s.textContent.length,r<=i&&d>=i)return{node:s,offset:i-r};r=d}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=us(s)}}function Tu(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Tu(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function oo(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=dr(r.document);i instanceof r.HTMLIFrameElement;){try{var s=typeof i.contentWindow.location.href=="string"}catch{s=!1}if(s)r=i.contentWindow;else break;i=dr(r.document)}return i}function Au(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i&&(i==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||i==="textarea"||r.contentEditable==="true")}var Hf=Vn&&"documentMode"in document&&11>=document.documentMode,ga=null,cs=null,gi=null,Eu=!1;function uo(r,i,s){var d=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Eu||ga==null||ga!==dr(d)||(d=ga,"selectionStart"in d&&Au(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),gi&&os(gi,d)||(gi=d,d=ad(cs,"onSelect"),0<d.length&&(i=new Xi("onSelect","select",null,i,s),r.push({event:i,listeners:d}),i.target=ga)))}function yi(r,i){var s={};return s[r.toLowerCase()]=i.toLowerCase(),s["Webkit"+r]="webkit"+i,s["Moz"+r]="moz"+i,s}var il={animationend:yi("Animation","AnimationEnd"),animationiteration:yi("Animation","AnimationIteration"),animationstart:yi("Animation","AnimationStart"),transitionrun:yi("Transition","TransitionRun"),transitionstart:yi("Transition","TransitionStart"),transitioncancel:yi("Transition","TransitionCancel"),transitionend:yi("Transition","TransitionEnd")},ds={},Nu={};Vn&&(Nu=document.createElement("div").style,"AnimationEvent"in window||(delete il.animationend.animation,delete il.animationiteration.animation,delete il.animationstart.animation),"TransitionEvent"in window||delete il.transitionend.transition);function vi(r){if(ds[r])return ds[r];if(!il[r])return r;var i=il[r],s;for(s in i)if(i.hasOwnProperty(s)&&s in Nu)return ds[r]=i[s];return r}var p0=vi("animationend"),Mu=vi("animationiteration"),g0=vi("animationstart"),$f=vi("transitionrun"),Ff=vi("transitionstart"),Pf=vi("transitioncancel"),y0=vi("transitionend"),v0=new Map,zu="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(" ");zu.push("scrollEnd");function Mr(r,i){v0.set(r,i),Ma(i,[r])}var co=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},mr=[],ll=0,Du=0;function fo(){for(var r=ll,i=Du=ll=0;i<r;){var s=mr[i];mr[i++]=null;var d=mr[i];mr[i++]=null;var p=mr[i];mr[i++]=null;var y=mr[i];if(mr[i++]=null,d!==null&&p!==null){var j=d.pending;j===null?p.next=p:(p.next=j.next,j.next=p),d.pending=p}y!==0&&x0(s,p,y)}}function ho(r,i,s,d){mr[ll++]=r,mr[ll++]=i,mr[ll++]=s,mr[ll++]=d,Du|=d,r.lanes|=d,r=r.alternate,r!==null&&(r.lanes|=d)}function Ru(r,i,s,d){return ho(r,i,s,d),mo(r)}function xi(r,i){return ho(r,null,null,i),mo(r)}function x0(r,i,s){r.lanes|=s;var d=r.alternate;d!==null&&(d.lanes|=s);for(var p=!1,y=r.return;y!==null;)y.childLanes|=s,d=y.alternate,d!==null&&(d.childLanes|=s),y.tag===22&&(r=y.stateNode,r===null||r._visibility&1||(p=!0)),r=y,y=y.return;return r.tag===3?(y=r.stateNode,p&&i!==null&&(p=31-_t(s),r=y.hiddenUpdates,d=r[p],d===null?r[p]=[i]:d.push(i),i.lane=s|536870912),y):null}function mo(r){if(50<sc)throw sc=0,qh=null,Error(a(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var sl={};function b0(r,i,s,d){this.tag=r,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function tn(r,i,s,d){return new b0(r,i,s,d)}function po(r){return r=r.prototype,!(!r||!r.isReactComponent)}function ya(r,i){var s=r.alternate;return s===null?(s=tn(r.tag,i,r.key,r.mode),s.elementType=r.elementType,s.type=r.type,s.stateNode=r.stateNode,s.alternate=r,r.alternate=s):(s.pendingProps=i,s.type=r.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=r.flags&65011712,s.childLanes=r.childLanes,s.lanes=r.lanes,s.child=r.child,s.memoizedProps=r.memoizedProps,s.memoizedState=r.memoizedState,s.updateQueue=r.updateQueue,i=r.dependencies,s.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},s.sibling=r.sibling,s.index=r.index,s.ref=r.ref,s.refCleanup=r.refCleanup,s}function w0(r,i){r.flags&=65011714;var s=r.alternate;return s===null?(r.childLanes=0,r.lanes=i,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=s.childLanes,r.lanes=s.lanes,r.child=s.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=s.memoizedProps,r.memoizedState=s.memoizedState,r.updateQueue=s.updateQueue,r.type=s.type,i=s.dependencies,r.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),r}function go(r,i,s,d,p,y){var j=0;if(d=r,typeof r=="function")po(r)&&(j=1);else if(typeof r=="string")j=J7(r,s,ee.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case Q:return r=tn(31,s,i,p),r.elementType=Q,r.lanes=y,r;case A:return Ba(s.children,p,y,i);case q:j=8,p|=24;break;case z:return r=tn(12,s,i,p|2),r.elementType=z,r.lanes=y,r;case ae:return r=tn(13,s,i,p),r.elementType=ae,r.lanes=y,r;case L:return r=tn(19,s,i,p),r.elementType=L,r.lanes=y,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case B:j=10;break e;case M:j=9;break e;case U:j=11;break e;case K:j=14;break e;case ie:j=16,d=null;break e}j=29,s=Error(a(130,r===null?"null":typeof r,"")),d=null}return i=tn(j,s,i,p),i.elementType=r,i.type=d,i.lanes=y,i}function Ba(r,i,s,d){return r=tn(7,r,d,i),r.lanes=s,r}function Ou(r,i,s){return r=tn(6,r,null,i),r.lanes=s,r}function yo(r){var i=tn(18,null,null,0);return i.stateNode=r,i}function Iu(r,i,s){return i=tn(4,r.children!==null?r.children:[],r.key,i),i.lanes=s,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var _u=new WeakMap;function nr(r,i){if(typeof r=="object"&&r!==null){var s=_u.get(r);return s!==void 0?s:(i={value:r,source:i,stack:Lt(i)},_u.set(r,i),i)}return{value:r,source:i,stack:Lt(i)}}var ol=[],ul=0,vo=null,Zr=0,Hn=[],pr=0,va=null,zr=1,Qr="";function Jr(r,i){ol[ul++]=Zr,ol[ul++]=vo,vo=r,Zr=i}function k0(r,i,s){Hn[pr++]=zr,Hn[pr++]=Qr,Hn[pr++]=va,va=r;var d=zr;r=Qr;var p=32-_t(d)-1;d&=~(1<<p),s+=1;var y=32-_t(i)+p;if(30<y){var j=p-p%5;y=(d&(1<<j)-1).toString(32),d>>=j,p-=j,zr=1<<32-_t(i)+p|s<<p|d,Qr=y+r}else zr=1<<y|s<<p|d,Qr=r}function Lu(r){r.return!==null&&(Jr(r,1),k0(r,1,0))}function Bu(r){for(;r===vo;)vo=ol[--ul],ol[ul]=null,Zr=ol[--ul],ol[ul]=null;for(;r===va;)va=Hn[--pr],Hn[pr]=null,Qr=Hn[--pr],Hn[pr]=null,zr=Hn[--pr],Hn[pr]=null}function S0(r,i){Hn[pr++]=zr,Hn[pr++]=Qr,Hn[pr++]=va,zr=i.id,Qr=i.overflow,va=r}var Dn=null,Wt=null,yt=!1,qa=null,gr=!1,qu=Error(a(519));function Ua(r){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw hs(nr(i,r)),qu}function j0(r){var i=r.stateNode,s=r.type,d=r.memoizedProps;switch(i[rn]=r,i[gn]=d,s){case"dialog":xt("cancel",i),xt("close",i);break;case"iframe":case"object":case"embed":xt("load",i);break;case"video":case"audio":for(s=0;s<uc.length;s++)xt(uc[s],i);break;case"source":xt("error",i);break;case"img":case"image":case"link":xt("error",i),xt("load",i);break;case"details":xt("toggle",i);break;case"input":xt("invalid",i),Vi(i,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":xt("invalid",i);break;case"textarea":xt("invalid",i),Yi(i,d.value,d.defaultValue,d.children)}s=d.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||i.textContent===""+s||d.suppressHydrationWarning===!0||s2(i.textContent,s)?(d.popover!=null&&(xt("beforetoggle",i),xt("toggle",i)),d.onScroll!=null&&xt("scroll",i),d.onScrollEnd!=null&&xt("scrollend",i),d.onClick!=null&&(i.onclick=er),i=!0):i=!1,i||Ua(r,!0)}function C0(r){for(Dn=r.return;Dn;)switch(Dn.tag){case 5:case 31:case 13:gr=!1;return;case 27:case 3:gr=!0;return;default:Dn=Dn.return}}function xa(r){if(r!==Dn)return!1;if(!yt)return C0(r),yt=!0,!1;var i=r.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=r.type,s=!(s!=="form"&&s!=="button")||em(r.type,r.memoizedProps)),s=!s),s&&Wt&&Ua(r),C0(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));Wt=g2(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));Wt=g2(r)}else i===27?(i=Wt,kl(r.type)?(r=im,im=null,Wt=r):Wt=i):Wt=Dn?ta(r.stateNode.nextSibling):null;return!0}function bi(){Wt=Dn=null,yt=!1}function fs(){var r=qa;return r!==null&&(br===null?br=r:br.push.apply(br,r),qa=null),r}function hs(r){qa===null?qa=[r]:qa.push(r)}var Uu=_(null),Dr=null,ba=null;function Wn(r,i,s){O(Uu,i._currentValue),i._currentValue=s}function Rr(r){r._currentValue=Uu.current,te(Uu)}function xo(r,i,s){for(;r!==null;){var d=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,d!==null&&(d.childLanes|=i)):d!==null&&(d.childLanes&i)!==i&&(d.childLanes|=i),r===s)break;r=r.return}}function bo(r,i,s,d){var p=r.child;for(p!==null&&(p.return=r);p!==null;){var y=p.dependencies;if(y!==null){var j=p.child;y=y.firstContext;e:for(;y!==null;){var R=y;y=p;for(var V=0;V<i.length;V++)if(R.context===i[V]){y.lanes|=s,R=y.alternate,R!==null&&(R.lanes|=s),xo(y.return,s,r),d||(j=null);break e}y=R.next}}else if(p.tag===18){if(j=p.return,j===null)throw Error(a(341));j.lanes|=s,y=j.alternate,y!==null&&(y.lanes|=s),xo(j,s,r),j=null}else j=p.child;if(j!==null)j.return=p;else for(j=p;j!==null;){if(j===r){j=null;break}if(p=j.sibling,p!==null){p.return=j.return,j=p;break}j=j.return}p=j}}function Ha(r,i,s,d){r=null;for(var p=i,y=!1;p!==null;){if(!y){if((p.flags&524288)!==0)y=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var j=p.alternate;if(j===null)throw Error(a(387));if(j=j.memoizedProps,j!==null){var R=p.type;tr(p.pendingProps.value,j.value)||(r!==null?r.push(R):r=[R])}}else if(p===we.current){if(j=p.alternate,j===null)throw Error(a(387));j.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(mc):r=[mc])}p=p.return}r!==null&&bo(i,r,s,d),i.flags|=262144}function $a(r){for(r=r.firstContext;r!==null;){if(!tr(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function wi(r){Dr=r,ba=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function Rn(r){return cl(Dr,r)}function wo(r,i){return Dr===null&&wi(r),cl(r,i)}function cl(r,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},ba===null){if(r===null)throw Error(a(308));ba=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else ba=ba.next=i;return s}var Gf=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(s,d){r.push(d)}};this.abort=function(){i.aborted=!0,r.forEach(function(s){return s()})}},T0=e.unstable_scheduleCallback,Vf=e.unstable_NormalPriority,Jt={$$typeof:B,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ki(){return{controller:new Gf,data:new Map,refCount:0}}function wa(r){r.refCount--,r.refCount===0&&T0(Vf,function(){r.controller.abort()})}var ms=null,Hu=0,dl=0,Et=null;function Fa(r,i){if(ms===null){var s=ms=[];Hu=0,dl=Gh(),Et={status:"pending",value:void 0,then:function(d){s.push(d)}}}return Hu++,i.then(A0,A0),i}function A0(){if(--Hu===0&&ms!==null){Et!==null&&(Et.status="fulfilled");var r=ms;ms=null,dl=0,Et=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function Or(r,i){var s=[],d={status:"pending",value:null,reason:null,then:function(p){s.push(p)}};return r.then(function(){d.status="fulfilled",d.value=i;for(var p=0;p<s.length;p++)(0,s[p])(i)},function(p){for(d.status="rejected",d.reason=p,p=0;p<s.length;p++)(0,s[p])(void 0)}),d}var E0=J.S;J.S=function(r,i){zg=ht(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&Fa(r,i),E0!==null&&E0(r,i)};var $n=_(null);function $u(){var r=$n.current;return r!==null?r:Kt.pooledCache}function ps(r,i){i===null?O($n,$n.current):O($n,i.pool)}function N0(){var r=$u();return r===null?null:{parent:Jt._currentValue,pool:r}}var Pa=Error(a(460)),Fu=Error(a(474)),ko=Error(a(542)),So={then:function(){}};function Pu(r){return r=r.status,r==="fulfilled"||r==="rejected"}function Gu(r,i,s){switch(s=r[s],s===void 0?r.push(i):s!==i&&(i.then(er,er),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,C(r),r;default:if(typeof i.status=="string")i.then(er,er);else{if(r=Kt,r!==null&&100<r.shellSuspendCounter)throw Error(a(482));r=i,r.status="pending",r.then(function(d){if(i.status==="pending"){var p=i;p.status="fulfilled",p.value=d}},function(d){if(i.status==="pending"){var p=i;p.status="rejected",p.reason=d}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,C(r),r}throw Va=i,Pa}}function Ga(r){try{var i=r._init;return i(r._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Va=s,Pa):s}}var Va=null;function x(){if(Va===null)throw Error(a(459));var r=Va;return Va=null,r}function C(r){if(r===Pa||r===ko)throw Error(a(483))}var N=null,$=0;function W(r){var i=$;return $+=1,N===null&&(N=[]),Gu(N,r,i)}function oe(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function je(r,i){throw i.$$typeof===k?Error(a(525)):(r=Object.prototype.toString.call(i),Error(a(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r)))}function Ve(r){function i(re,X){if(r){var le=re.deletions;le===null?(re.deletions=[X],re.flags|=16):le.push(X)}}function s(re,X){if(!r)return null;for(;X!==null;)i(re,X),X=X.sibling;return null}function d(re){for(var X=new Map;re!==null;)re.key!==null?X.set(re.key,re):X.set(re.index,re),re=re.sibling;return X}function p(re,X){return re=ya(re,X),re.index=0,re.sibling=null,re}function y(re,X,le){return re.index=le,r?(le=re.alternate,le!==null?(le=le.index,le<X?(re.flags|=67108866,X):le):(re.flags|=67108866,X)):(re.flags|=1048576,X)}function j(re){return r&&re.alternate===null&&(re.flags|=67108866),re}function R(re,X,le,ve){return X===null||X.tag!==6?(X=Ou(le,re.mode,ve),X.return=re,X):(X=p(X,le),X.return=re,X)}function V(re,X,le,ve){var Qe=le.type;return Qe===A?ye(re,X,le.props.children,ve,le.key):X!==null&&(X.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===ie&&Ga(Qe)===X.type)?(X=p(X,le.props),oe(X,le),X.return=re,X):(X=go(le.type,le.key,le.props,null,re.mode,ve),oe(X,le),X.return=re,X)}function se(re,X,le,ve){return X===null||X.tag!==4||X.stateNode.containerInfo!==le.containerInfo||X.stateNode.implementation!==le.implementation?(X=Iu(le,re.mode,ve),X.return=re,X):(X=p(X,le.children||[]),X.return=re,X)}function ye(re,X,le,ve,Qe){return X===null||X.tag!==7?(X=Ba(le,re.mode,ve,Qe),X.return=re,X):(X=p(X,le),X.return=re,X)}function xe(re,X,le){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=Ou(""+X,re.mode,le),X.return=re,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case b:return le=go(X.type,X.key,X.props,null,re.mode,le),oe(le,X),le.return=re,le;case T:return X=Iu(X,re.mode,le),X.return=re,X;case ie:return X=Ga(X),xe(re,X,le)}if(pe(X)||ce(X))return X=Ba(X,re.mode,le,null),X.return=re,X;if(typeof X.then=="function")return xe(re,W(X),le);if(X.$$typeof===B)return xe(re,wo(re,X),le);je(re,X)}return null}function ue(re,X,le,ve){var Qe=X!==null?X.key:null;if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return Qe!==null?null:R(re,X,""+le,ve);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case b:return le.key===Qe?V(re,X,le,ve):null;case T:return le.key===Qe?se(re,X,le,ve):null;case ie:return le=Ga(le),ue(re,X,le,ve)}if(pe(le)||ce(le))return Qe!==null?null:ye(re,X,le,ve,null);if(typeof le.then=="function")return ue(re,X,W(le),ve);if(le.$$typeof===B)return ue(re,X,wo(re,le),ve);je(re,le)}return null}function de(re,X,le,ve,Qe){if(typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint")return re=re.get(le)||null,R(X,re,""+ve,Qe);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case b:return re=re.get(ve.key===null?le:ve.key)||null,V(X,re,ve,Qe);case T:return re=re.get(ve.key===null?le:ve.key)||null,se(X,re,ve,Qe);case ie:return ve=Ga(ve),de(re,X,le,ve,Qe)}if(pe(ve)||ce(ve))return re=re.get(le)||null,ye(X,re,ve,Qe,null);if(typeof ve.then=="function")return de(re,X,le,W(ve),Qe);if(ve.$$typeof===B)return de(re,X,le,wo(X,ve),Qe);je(X,ve)}return null}function Ge(re,X,le,ve){for(var Qe=null,zt=null,Ye=X,dt=X=0,jt=null;Ye!==null&&dt<le.length;dt++){Ye.index>dt?(jt=Ye,Ye=null):jt=Ye.sibling;var Dt=ue(re,Ye,le[dt],ve);if(Dt===null){Ye===null&&(Ye=jt);break}r&&Ye&&Dt.alternate===null&&i(re,Ye),X=y(Dt,X,dt),zt===null?Qe=Dt:zt.sibling=Dt,zt=Dt,Ye=jt}if(dt===le.length)return s(re,Ye),yt&&Jr(re,dt),Qe;if(Ye===null){for(;dt<le.length;dt++)Ye=xe(re,le[dt],ve),Ye!==null&&(X=y(Ye,X,dt),zt===null?Qe=Ye:zt.sibling=Ye,zt=Ye);return yt&&Jr(re,dt),Qe}for(Ye=d(Ye);dt<le.length;dt++)jt=de(Ye,re,dt,le[dt],ve),jt!==null&&(r&&jt.alternate!==null&&Ye.delete(jt.key===null?dt:jt.key),X=y(jt,X,dt),zt===null?Qe=jt:zt.sibling=jt,zt=jt);return r&&Ye.forEach(function(Al){return i(re,Al)}),yt&&Jr(re,dt),Qe}function rt(re,X,le,ve){if(le==null)throw Error(a(151));for(var Qe=null,zt=null,Ye=X,dt=X=0,jt=null,Dt=le.next();Ye!==null&&!Dt.done;dt++,Dt=le.next()){Ye.index>dt?(jt=Ye,Ye=null):jt=Ye.sibling;var Al=ue(re,Ye,Dt.value,ve);if(Al===null){Ye===null&&(Ye=jt);break}r&&Ye&&Al.alternate===null&&i(re,Ye),X=y(Al,X,dt),zt===null?Qe=Al:zt.sibling=Al,zt=Al,Ye=jt}if(Dt.done)return s(re,Ye),yt&&Jr(re,dt),Qe;if(Ye===null){for(;!Dt.done;dt++,Dt=le.next())Dt=xe(re,Dt.value,ve),Dt!==null&&(X=y(Dt,X,dt),zt===null?Qe=Dt:zt.sibling=Dt,zt=Dt);return yt&&Jr(re,dt),Qe}for(Ye=d(Ye);!Dt.done;dt++,Dt=le.next())Dt=de(Ye,re,dt,Dt.value,ve),Dt!==null&&(r&&Dt.alternate!==null&&Ye.delete(Dt.key===null?dt:Dt.key),X=y(Dt,X,dt),zt===null?Qe=Dt:zt.sibling=Dt,zt=Dt);return r&&Ye.forEach(function(cb){return i(re,cb)}),yt&&Jr(re,dt),Qe}function Vt(re,X,le,ve){if(typeof le=="object"&&le!==null&&le.type===A&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case b:e:{for(var Qe=le.key;X!==null;){if(X.key===Qe){if(Qe=le.type,Qe===A){if(X.tag===7){s(re,X.sibling),ve=p(X,le.props.children),ve.return=re,re=ve;break e}}else if(X.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===ie&&Ga(Qe)===X.type){s(re,X.sibling),ve=p(X,le.props),oe(ve,le),ve.return=re,re=ve;break e}s(re,X);break}else i(re,X);X=X.sibling}le.type===A?(ve=Ba(le.props.children,re.mode,ve,le.key),ve.return=re,re=ve):(ve=go(le.type,le.key,le.props,null,re.mode,ve),oe(ve,le),ve.return=re,re=ve)}return j(re);case T:e:{for(Qe=le.key;X!==null;){if(X.key===Qe)if(X.tag===4&&X.stateNode.containerInfo===le.containerInfo&&X.stateNode.implementation===le.implementation){s(re,X.sibling),ve=p(X,le.children||[]),ve.return=re,re=ve;break e}else{s(re,X);break}else i(re,X);X=X.sibling}ve=Iu(le,re.mode,ve),ve.return=re,re=ve}return j(re);case ie:return le=Ga(le),Vt(re,X,le,ve)}if(pe(le))return Ge(re,X,le,ve);if(ce(le)){if(Qe=ce(le),typeof Qe!="function")throw Error(a(150));return le=Qe.call(le),rt(re,X,le,ve)}if(typeof le.then=="function")return Vt(re,X,W(le),ve);if(le.$$typeof===B)return Vt(re,X,wo(re,le),ve);je(re,le)}return typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint"?(le=""+le,X!==null&&X.tag===6?(s(re,X.sibling),ve=p(X,le),ve.return=re,re=ve):(s(re,X),ve=Ou(le,re.mode,ve),ve.return=re,re=ve),j(re)):s(re,X)}return function(re,X,le,ve){try{$=0;var Qe=Vt(re,X,le,ve);return N=null,Qe}catch(Ye){if(Ye===Pa||Ye===ko)throw Ye;var zt=tn(29,Ye,null,re.mode);return zt.lanes=ve,zt.return=re,zt}finally{}}}var De=Ve(!0),Be=Ve(!1),Mt=!1;function qt(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Bn(r,i){r=r.updateQueue,i.updateQueue===r&&(i.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function ka(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function fl(r,i,s){var d=r.updateQueue;if(d===null)return null;if(d=d.shared,(Rt&2)!==0){var p=d.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),d.pending=i,i=mo(r),x0(r,null,s),i}return ho(r,d,i,s),mo(r)}function Vu(r,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var d=i.lanes;d&=r.pendingLanes,s|=d,i.lanes=s,uu(r,s)}}function Yf(r,i){var s=r.updateQueue,d=r.alternate;if(d!==null&&(d=d.updateQueue,s===d)){var p=null,y=null;if(s=s.firstBaseUpdate,s!==null){do{var j={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};y===null?p=y=j:y=y.next=j,s=s.next}while(s!==null);y===null?p=y=i:y=y.next=i}else p=y=i;s={baseState:d.baseState,firstBaseUpdate:p,lastBaseUpdate:y,shared:d.shared,callbacks:d.callbacks},r.updateQueue=s;return}r=s.lastBaseUpdate,r===null?s.firstBaseUpdate=i:r.next=i,s.lastBaseUpdate=i}var Wf=!1;function Yu(){if(Wf){var r=Et;if(r!==null)throw r}}function Wu(r,i,s,d){Wf=!1;var p=r.updateQueue;Mt=!1;var y=p.firstBaseUpdate,j=p.lastBaseUpdate,R=p.shared.pending;if(R!==null){p.shared.pending=null;var V=R,se=V.next;V.next=null,j===null?y=se:j.next=se,j=V;var ye=r.alternate;ye!==null&&(ye=ye.updateQueue,R=ye.lastBaseUpdate,R!==j&&(R===null?ye.firstBaseUpdate=se:R.next=se,ye.lastBaseUpdate=V))}if(y!==null){var xe=p.baseState;j=0,ye=se=V=null,R=y;do{var ue=R.lane&-536870913,de=ue!==R.lane;if(de?(St&ue)===ue:(d&ue)===ue){ue!==0&&ue===dl&&(Wf=!0),ye!==null&&(ye=ye.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var Ge=r,rt=R;ue=i;var Vt=s;switch(rt.tag){case 1:if(Ge=rt.payload,typeof Ge=="function"){xe=Ge.call(Vt,xe,ue);break e}xe=Ge;break e;case 3:Ge.flags=Ge.flags&-65537|128;case 0:if(Ge=rt.payload,ue=typeof Ge=="function"?Ge.call(Vt,xe,ue):Ge,ue==null)break e;xe=v({},xe,ue);break e;case 2:Mt=!0}}ue=R.callback,ue!==null&&(r.flags|=64,de&&(r.flags|=8192),de=p.callbacks,de===null?p.callbacks=[ue]:de.push(ue))}else de={lane:ue,tag:R.tag,payload:R.payload,callback:R.callback,next:null},ye===null?(se=ye=de,V=xe):ye=ye.next=de,j|=ue;if(R=R.next,R===null){if(R=p.shared.pending,R===null)break;de=R,R=de.next,de.next=null,p.lastBaseUpdate=de,p.shared.pending=null}}while(!0);ye===null&&(V=xe),p.baseState=V,p.firstBaseUpdate=se,p.lastBaseUpdate=ye,y===null&&(p.shared.lanes=0),yl|=j,r.lanes=j,r.memoizedState=xe}}function n4(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function r4(r,i){var s=r.callbacks;if(s!==null)for(r.callbacks=null,r=0;r<s.length;r++)n4(s[r],i)}var jo=_(null),M0=_(0);function a4(r,i){r=zi,O(M0,r),O(jo,i),zi=r|i.baseLanes}function Kf(){O(M0,zi),O(jo,jo.current)}function Xf(){zi=M0.current,te(jo),te(M0)}var Ir=_(null),ea=null;function hl(r){var i=r.alternate;O(xn,xn.current&1),O(Ir,r),ea===null&&(i===null||jo.current!==null||i.memoizedState!==null)&&(ea=r)}function Zf(r){O(xn,xn.current),O(Ir,r),ea===null&&(ea=r)}function i4(r){r.tag===22?(O(xn,xn.current),O(Ir,r),ea===null&&(ea=r)):ml()}function ml(){O(xn,xn.current),O(Ir,Ir.current)}function _r(r){te(Ir),ea===r&&(ea=null),te(xn)}var xn=_(0);function z0(r){for(var i=r;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||rm(s)||am(s)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Si=0,ut=null,Pt=null,jn=null,D0=!1,Co=!1,gs=!1,R0=0,Ku=0,To=null,e7=0;function fn(){throw Error(a(321))}function Qf(r,i){if(i===null)return!1;for(var s=0;s<i.length&&s<r.length;s++)if(!tr(r[s],i[s]))return!1;return!0}function Jf(r,i,s,d,p,y){return Si=y,ut=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,J.H=r===null||r.memoizedState===null?$4:mh,gs=!1,y=s(d,p),gs=!1,Co&&(y=s4(i,s,d,p)),l4(r),y}function l4(r){J.H=Qu;var i=Pt!==null&&Pt.next!==null;if(Si=0,jn=Pt=ut=null,D0=!1,Ku=0,To=null,i)throw Error(a(300));r===null||Cn||(r=r.dependencies,r!==null&&$a(r)&&(Cn=!0))}function s4(r,i,s,d){ut=r;var p=0;do{if(Co&&(To=null),Ku=0,Co=!1,25<=p)throw Error(a(301));if(p+=1,jn=Pt=null,r.updateQueue!=null){var y=r.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}J.H=F4,y=i(s,d)}while(Co);return y}function t7(){var r=J.H,i=r.useState()[0];return i=typeof i.then=="function"?Xu(i):i,r=r.useState()[0],(Pt!==null?Pt.memoizedState:null)!==r&&(ut.flags|=1024),i}function eh(){var r=R0!==0;return R0=0,r}function th(r,i,s){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~s}function nh(r){if(D0){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}D0=!1}Si=0,jn=Pt=ut=null,Co=!1,Ku=R0=0,To=null}function rr(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jn===null?ut.memoizedState=jn=r:jn=jn.next=r,jn}function bn(){if(Pt===null){var r=ut.alternate;r=r!==null?r.memoizedState:null}else r=Pt.next;var i=jn===null?ut.memoizedState:jn.next;if(i!==null)jn=i,Pt=r;else{if(r===null)throw ut.alternate===null?Error(a(467)):Error(a(310));Pt=r,r={memoizedState:Pt.memoizedState,baseState:Pt.baseState,baseQueue:Pt.baseQueue,queue:Pt.queue,next:null},jn===null?ut.memoizedState=jn=r:jn=jn.next=r}return jn}function O0(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Xu(r){var i=Ku;return Ku+=1,To===null&&(To=[]),r=Gu(To,r,i),i=ut,(jn===null?i.memoizedState:jn.next)===null&&(i=i.alternate,J.H=i===null||i.memoizedState===null?$4:mh),r}function I0(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Xu(r);if(r.$$typeof===B)return Rn(r)}throw Error(a(438,String(r)))}function rh(r){var i=null,s=ut.updateQueue;if(s!==null&&(i=s.memoCache),i==null){var d=ut.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(i={data:d.data.map(function(p){return p.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),s===null&&(s=O0(),ut.updateQueue=s),s.memoCache=i,s=i.data[i.index],s===void 0)for(s=i.data[i.index]=Array(r),d=0;d<r;d++)s[d]=F;return i.index++,s}function ji(r,i){return typeof i=="function"?i(r):i}function _0(r){var i=bn();return ah(i,Pt,r)}function ah(r,i,s){var d=r.queue;if(d===null)throw Error(a(311));d.lastRenderedReducer=s;var p=r.baseQueue,y=d.pending;if(y!==null){if(p!==null){var j=p.next;p.next=y.next,y.next=j}i.baseQueue=p=y,d.pending=null}if(y=r.baseState,p===null)r.memoizedState=y;else{i=p.next;var R=j=null,V=null,se=i,ye=!1;do{var xe=se.lane&-536870913;if(xe!==se.lane?(St&xe)===xe:(Si&xe)===xe){var ue=se.revertLane;if(ue===0)V!==null&&(V=V.next={lane:0,revertLane:0,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),xe===dl&&(ye=!0);else if((Si&ue)===ue){se=se.next,ue===dl&&(ye=!0);continue}else xe={lane:0,revertLane:se.revertLane,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},V===null?(R=V=xe,j=y):V=V.next=xe,ut.lanes|=ue,yl|=ue;xe=se.action,gs&&s(y,xe),y=se.hasEagerState?se.eagerState:s(y,xe)}else ue={lane:xe,revertLane:se.revertLane,gesture:se.gesture,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},V===null?(R=V=ue,j=y):V=V.next=ue,ut.lanes|=xe,yl|=xe;se=se.next}while(se!==null&&se!==i);if(V===null?j=y:V.next=R,!tr(y,r.memoizedState)&&(Cn=!0,ye&&(s=Et,s!==null)))throw s;r.memoizedState=y,r.baseState=j,r.baseQueue=V,d.lastRenderedState=y}return p===null&&(d.lanes=0),[r.memoizedState,d.dispatch]}function ih(r){var i=bn(),s=i.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=r;var d=s.dispatch,p=s.pending,y=i.memoizedState;if(p!==null){s.pending=null;var j=p=p.next;do y=r(y,j.action),j=j.next;while(j!==p);tr(y,i.memoizedState)||(Cn=!0),i.memoizedState=y,i.baseQueue===null&&(i.baseState=y),s.lastRenderedState=y}return[y,d]}function o4(r,i,s){var d=ut,p=bn(),y=yt;if(y){if(s===void 0)throw Error(a(407));s=s()}else s=i();var j=!tr((Pt||p).memoizedState,s);if(j&&(p.memoizedState=s,Cn=!0),p=p.queue,oh(d4.bind(null,d,p,r),[r]),p.getSnapshot!==i||j||jn!==null&&jn.memoizedState.tag&1){if(d.flags|=2048,Ao(9,{destroy:void 0},c4.bind(null,d,p,s,i),null),Kt===null)throw Error(a(349));y||(Si&127)!==0||u4(d,i,s)}return s}function u4(r,i,s){r.flags|=16384,r={getSnapshot:i,value:s},i=ut.updateQueue,i===null?(i=O0(),ut.updateQueue=i,i.stores=[r]):(s=i.stores,s===null?i.stores=[r]:s.push(r))}function c4(r,i,s,d){i.value=s,i.getSnapshot=d,f4(i)&&h4(r)}function d4(r,i,s){return s(function(){f4(i)&&h4(r)})}function f4(r){var i=r.getSnapshot;r=r.value;try{var s=i();return!tr(r,s)}catch{return!0}}function h4(r){var i=xi(r,2);i!==null&&wr(i,r,2)}function lh(r){var i=rr();if(typeof r=="function"){var s=r;if(r=s(),gs){Gn(!0);try{s()}finally{Gn(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ji,lastRenderedState:r},i}function m4(r,i,s,d){return r.baseState=s,ah(r,Pt,typeof d=="function"?d:ji)}function n7(r,i,s,d,p){if(q0(r))throw Error(a(485));if(r=i.action,r!==null){var y={payload:p,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(j){y.listeners.push(j)}};J.T!==null?s(!0):y.isTransition=!1,d(y),s=i.pending,s===null?(y.next=i.pending=y,p4(i,y)):(y.next=s.next,i.pending=s.next=y)}}function p4(r,i){var s=i.action,d=i.payload,p=r.state;if(i.isTransition){var y=J.T,j={};J.T=j;try{var R=s(p,d),V=J.S;V!==null&&V(j,R),g4(r,i,R)}catch(se){sh(r,i,se)}finally{y!==null&&j.types!==null&&(y.types=j.types),J.T=y}}else try{y=s(p,d),g4(r,i,y)}catch(se){sh(r,i,se)}}function g4(r,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(d){y4(r,i,d)},function(d){return sh(r,i,d)}):y4(r,i,s)}function y4(r,i,s){i.status="fulfilled",i.value=s,v4(i),r.state=s,i=r.pending,i!==null&&(s=i.next,s===i?r.pending=null:(s=s.next,i.next=s,p4(r,s)))}function sh(r,i,s){var d=r.pending;if(r.pending=null,d!==null){d=d.next;do i.status="rejected",i.reason=s,v4(i),i=i.next;while(i!==d)}r.action=null}function v4(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function x4(r,i){return i}function b4(r,i){if(yt){var s=Kt.formState;if(s!==null){e:{var d=ut;if(yt){if(Wt){t:{for(var p=Wt,y=gr;p.nodeType!==8;){if(!y){p=null;break t}if(p=ta(p.nextSibling),p===null){p=null;break t}}y=p.data,p=y==="F!"||y==="F"?p:null}if(p){Wt=ta(p.nextSibling),d=p.data==="F!";break e}}Ua(d)}d=!1}d&&(i=s[0])}}return s=rr(),s.memoizedState=s.baseState=i,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:x4,lastRenderedState:i},s.queue=d,s=q4.bind(null,ut,d),d.dispatch=s,d=lh(!1),y=hh.bind(null,ut,!1,d.queue),d=rr(),p={state:i,dispatch:null,action:r,pending:null},d.queue=p,s=n7.bind(null,ut,p,y,s),p.dispatch=s,d.memoizedState=r,[i,s,!1]}function w4(r){var i=bn();return k4(i,Pt,r)}function k4(r,i,s){if(i=ah(r,i,x4)[0],r=_0(ji)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var d=Xu(i)}catch(j){throw j===Pa?ko:j}else d=i;i=bn();var p=i.queue,y=p.dispatch;return s!==i.memoizedState&&(ut.flags|=2048,Ao(9,{destroy:void 0},r7.bind(null,p,s),null)),[d,y,r]}function r7(r,i){r.action=i}function S4(r){var i=bn(),s=Pt;if(s!==null)return k4(i,s,r);bn(),i=i.memoizedState,s=bn();var d=s.queue.dispatch;return s.memoizedState=r,[i,d,!1]}function Ao(r,i,s,d){return r={tag:r,create:s,deps:d,inst:i,next:null},i=ut.updateQueue,i===null&&(i=O0(),ut.updateQueue=i),s=i.lastEffect,s===null?i.lastEffect=r.next=r:(d=s.next,s.next=r,r.next=d,i.lastEffect=r),r}function j4(){return bn().memoizedState}function L0(r,i,s,d){var p=rr();ut.flags|=r,p.memoizedState=Ao(1|i,{destroy:void 0},s,d===void 0?null:d)}function B0(r,i,s,d){var p=bn();d=d===void 0?null:d;var y=p.memoizedState.inst;Pt!==null&&d!==null&&Qf(d,Pt.memoizedState.deps)?p.memoizedState=Ao(i,y,s,d):(ut.flags|=r,p.memoizedState=Ao(1|i,y,s,d))}function C4(r,i){L0(8390656,8,r,i)}function oh(r,i){B0(2048,8,r,i)}function a7(r){ut.flags|=4;var i=ut.updateQueue;if(i===null)i=O0(),ut.updateQueue=i,i.events=[r];else{var s=i.events;s===null?i.events=[r]:s.push(r)}}function T4(r){var i=bn().memoizedState;return a7({ref:i,nextImpl:r}),function(){if((Rt&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function A4(r,i){return B0(4,2,r,i)}function E4(r,i){return B0(4,4,r,i)}function N4(r,i){if(typeof i=="function"){r=r();var s=i(r);return function(){typeof s=="function"?s():i(null)}}if(i!=null)return r=r(),i.current=r,function(){i.current=null}}function M4(r,i,s){s=s!=null?s.concat([r]):null,B0(4,4,N4.bind(null,i,r),s)}function uh(){}function z4(r,i){var s=bn();i=i===void 0?null:i;var d=s.memoizedState;return i!==null&&Qf(i,d[1])?d[0]:(s.memoizedState=[r,i],r)}function D4(r,i){var s=bn();i=i===void 0?null:i;var d=s.memoizedState;if(i!==null&&Qf(i,d[1]))return d[0];if(d=r(),gs){Gn(!0);try{r()}finally{Gn(!1)}}return s.memoizedState=[d,i],d}function ch(r,i,s){return s===void 0||(Si&1073741824)!==0&&(St&261930)===0?r.memoizedState=i:(r.memoizedState=s,r=Rg(),ut.lanes|=r,yl|=r,s)}function R4(r,i,s,d){return tr(s,i)?s:jo.current!==null?(r=ch(r,s,d),tr(r,i)||(Cn=!0),r):(Si&42)===0||(Si&1073741824)!==0&&(St&261930)===0?(Cn=!0,r.memoizedState=s):(r=Rg(),ut.lanes|=r,yl|=r,i)}function O4(r,i,s,d,p){var y=Y.p;Y.p=y!==0&&8>y?y:8;var j=J.T,R={};J.T=R,hh(r,!1,i,s);try{var V=p(),se=J.S;if(se!==null&&se(R,V),V!==null&&typeof V=="object"&&typeof V.then=="function"){var ye=Or(V,d);Zu(r,i,ye,qr(r))}else Zu(r,i,d,qr(r))}catch(xe){Zu(r,i,{then:function(){},status:"rejected",reason:xe},qr())}finally{Y.p=y,j!==null&&R.types!==null&&(j.types=R.types),J.T=j}}function i7(){}function dh(r,i,s,d){if(r.tag!==5)throw Error(a(476));var p=I4(r).queue;O4(r,p,i,ge,s===null?i7:function(){return _4(r),s(d)})}function I4(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:ge,baseState:ge,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ji,lastRenderedState:ge},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ji,lastRenderedState:s},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function _4(r){var i=I4(r);i.next===null&&(i=r.alternate.memoizedState),Zu(r,i.next.queue,{},qr())}function fh(){return Rn(mc)}function L4(){return bn().memoizedState}function B4(){return bn().memoizedState}function l7(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var s=qr();r=ka(s);var d=fl(i,r,s);d!==null&&(wr(d,i,s),Vu(d,i,s)),i={cache:ki()},r.payload=i;return}i=i.return}}function s7(r,i,s){var d=qr();s={lane:d,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},q0(r)?U4(i,s):(s=Ru(r,i,s,d),s!==null&&(wr(s,r,d),H4(s,i,d)))}function q4(r,i,s){var d=qr();Zu(r,i,s,d)}function Zu(r,i,s,d){var p={lane:d,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(q0(r))U4(i,p);else{var y=r.alternate;if(r.lanes===0&&(y===null||y.lanes===0)&&(y=i.lastRenderedReducer,y!==null))try{var j=i.lastRenderedState,R=y(j,s);if(p.hasEagerState=!0,p.eagerState=R,tr(R,j))return ho(r,i,p,0),Kt===null&&fo(),!1}catch{}finally{}if(s=Ru(r,i,p,d),s!==null)return wr(s,r,d),H4(s,i,d),!0}return!1}function hh(r,i,s,d){if(d={lane:2,revertLane:Gh(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},q0(r)){if(i)throw Error(a(479))}else i=Ru(r,s,d,2),i!==null&&wr(i,r,2)}function q0(r){var i=r.alternate;return r===ut||i!==null&&i===ut}function U4(r,i){Co=D0=!0;var s=r.pending;s===null?i.next=i:(i.next=s.next,s.next=i),r.pending=i}function H4(r,i,s){if((s&4194048)!==0){var d=i.lanes;d&=r.pendingLanes,s|=d,i.lanes=s,uu(r,s)}}var Qu={readContext:Rn,use:I0,useCallback:fn,useContext:fn,useEffect:fn,useImperativeHandle:fn,useLayoutEffect:fn,useInsertionEffect:fn,useMemo:fn,useReducer:fn,useRef:fn,useState:fn,useDebugValue:fn,useDeferredValue:fn,useTransition:fn,useSyncExternalStore:fn,useId:fn,useHostTransitionStatus:fn,useFormState:fn,useActionState:fn,useOptimistic:fn,useMemoCache:fn,useCacheRefresh:fn};Qu.useEffectEvent=fn;var $4={readContext:Rn,use:I0,useCallback:function(r,i){return rr().memoizedState=[r,i===void 0?null:i],r},useContext:Rn,useEffect:C4,useImperativeHandle:function(r,i,s){s=s!=null?s.concat([r]):null,L0(4194308,4,N4.bind(null,i,r),s)},useLayoutEffect:function(r,i){return L0(4194308,4,r,i)},useInsertionEffect:function(r,i){L0(4,2,r,i)},useMemo:function(r,i){var s=rr();i=i===void 0?null:i;var d=r();if(gs){Gn(!0);try{r()}finally{Gn(!1)}}return s.memoizedState=[d,i],d},useReducer:function(r,i,s){var d=rr();if(s!==void 0){var p=s(i);if(gs){Gn(!0);try{s(i)}finally{Gn(!1)}}}else p=i;return d.memoizedState=d.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},d.queue=r,r=r.dispatch=s7.bind(null,ut,r),[d.memoizedState,r]},useRef:function(r){var i=rr();return r={current:r},i.memoizedState=r},useState:function(r){r=lh(r);var i=r.queue,s=q4.bind(null,ut,i);return i.dispatch=s,[r.memoizedState,s]},useDebugValue:uh,useDeferredValue:function(r,i){var s=rr();return ch(s,r,i)},useTransition:function(){var r=lh(!1);return r=O4.bind(null,ut,r.queue,!0,!1),rr().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,s){var d=ut,p=rr();if(yt){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),Kt===null)throw Error(a(349));(St&127)!==0||u4(d,i,s)}p.memoizedState=s;var y={value:s,getSnapshot:i};return p.queue=y,C4(d4.bind(null,d,y,r),[r]),d.flags|=2048,Ao(9,{destroy:void 0},c4.bind(null,d,y,s,i),null),s},useId:function(){var r=rr(),i=Kt.identifierPrefix;if(yt){var s=Qr,d=zr;s=(d&~(1<<32-_t(d)-1)).toString(32)+s,i="_"+i+"R_"+s,s=R0++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=e7++,i="_"+i+"r_"+s.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:fh,useFormState:b4,useActionState:b4,useOptimistic:function(r){var i=rr();i.memoizedState=i.baseState=r;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=hh.bind(null,ut,!0,s),s.dispatch=i,[r,i]},useMemoCache:rh,useCacheRefresh:function(){return rr().memoizedState=l7.bind(null,ut)},useEffectEvent:function(r){var i=rr(),s={impl:r};return i.memoizedState=s,function(){if((Rt&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},mh={readContext:Rn,use:I0,useCallback:z4,useContext:Rn,useEffect:oh,useImperativeHandle:M4,useInsertionEffect:A4,useLayoutEffect:E4,useMemo:D4,useReducer:_0,useRef:j4,useState:function(){return _0(ji)},useDebugValue:uh,useDeferredValue:function(r,i){var s=bn();return R4(s,Pt.memoizedState,r,i)},useTransition:function(){var r=_0(ji)[0],i=bn().memoizedState;return[typeof r=="boolean"?r:Xu(r),i]},useSyncExternalStore:o4,useId:L4,useHostTransitionStatus:fh,useFormState:w4,useActionState:w4,useOptimistic:function(r,i){var s=bn();return m4(s,Pt,r,i)},useMemoCache:rh,useCacheRefresh:B4};mh.useEffectEvent=T4;var F4={readContext:Rn,use:I0,useCallback:z4,useContext:Rn,useEffect:oh,useImperativeHandle:M4,useInsertionEffect:A4,useLayoutEffect:E4,useMemo:D4,useReducer:ih,useRef:j4,useState:function(){return ih(ji)},useDebugValue:uh,useDeferredValue:function(r,i){var s=bn();return Pt===null?ch(s,r,i):R4(s,Pt.memoizedState,r,i)},useTransition:function(){var r=ih(ji)[0],i=bn().memoizedState;return[typeof r=="boolean"?r:Xu(r),i]},useSyncExternalStore:o4,useId:L4,useHostTransitionStatus:fh,useFormState:S4,useActionState:S4,useOptimistic:function(r,i){var s=bn();return Pt!==null?m4(s,Pt,r,i):(s.baseState=r,[r,s.queue.dispatch])},useMemoCache:rh,useCacheRefresh:B4};F4.useEffectEvent=T4;function ph(r,i,s,d){i=r.memoizedState,s=s(d,i),s=s==null?i:v({},i,s),r.memoizedState=s,r.lanes===0&&(r.updateQueue.baseState=s)}var gh={enqueueSetState:function(r,i,s){r=r._reactInternals;var d=qr(),p=ka(d);p.payload=i,s!=null&&(p.callback=s),i=fl(r,p,d),i!==null&&(wr(i,r,d),Vu(i,r,d))},enqueueReplaceState:function(r,i,s){r=r._reactInternals;var d=qr(),p=ka(d);p.tag=1,p.payload=i,s!=null&&(p.callback=s),i=fl(r,p,d),i!==null&&(wr(i,r,d),Vu(i,r,d))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var s=qr(),d=ka(s);d.tag=2,i!=null&&(d.callback=i),i=fl(r,d,s),i!==null&&(wr(i,r,s),Vu(i,r,s))}};function P4(r,i,s,d,p,y,j){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(d,y,j):i.prototype&&i.prototype.isPureReactComponent?!os(s,d)||!os(p,y):!0}function G4(r,i,s,d){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(s,d),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(s,d),i.state!==r&&gh.enqueueReplaceState(i,i.state,null)}function ys(r,i){var s=i;if("ref"in i){s={};for(var d in i)d!=="ref"&&(s[d]=i[d])}if(r=r.defaultProps){s===i&&(s=v({},s));for(var p in r)s[p]===void 0&&(s[p]=r[p])}return s}function V4(r){co(r)}function Y4(r){console.error(r)}function W4(r){co(r)}function U0(r,i){try{var s=r.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(d){setTimeout(function(){throw d})}}function K4(r,i,s){try{var d=r.onCaughtError;d(s.value,{componentStack:s.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function yh(r,i,s){return s=ka(s),s.tag=3,s.payload={element:null},s.callback=function(){U0(r,i)},s}function X4(r){return r=ka(r),r.tag=3,r}function Z4(r,i,s,d){var p=s.type.getDerivedStateFromError;if(typeof p=="function"){var y=d.value;r.payload=function(){return p(y)},r.callback=function(){K4(i,s,d)}}var j=s.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(r.callback=function(){K4(i,s,d),typeof p!="function"&&(vl===null?vl=new Set([this]):vl.add(this));var R=d.stack;this.componentDidCatch(d.value,{componentStack:R!==null?R:""})})}function o7(r,i,s,d,p){if(s.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(i=s.alternate,i!==null&&Ha(i,s,p,!0),s=Ir.current,s!==null){switch(s.tag){case 31:case 13:return ea===null?Q0():s.alternate===null&&hn===0&&(hn=3),s.flags&=-257,s.flags|=65536,s.lanes=p,d===So?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([d]):i.add(d),$h(r,d,p)),!1;case 22:return s.flags|=65536,d===So?s.flags|=16384:(i=s.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([d])},s.updateQueue=i):(s=i.retryQueue,s===null?i.retryQueue=new Set([d]):s.add(d)),$h(r,d,p)),!1}throw Error(a(435,s.tag))}return $h(r,d,p),Q0(),!1}if(yt)return i=Ir.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=p,d!==qu&&(r=Error(a(422),{cause:d}),hs(nr(r,s)))):(d!==qu&&(i=Error(a(423),{cause:d}),hs(nr(i,s))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,d=nr(d,s),p=yh(r.stateNode,d,p),Yf(r,p),hn!==4&&(hn=2)),!1;var y=Error(a(520),{cause:d});if(y=nr(y,s),lc===null?lc=[y]:lc.push(y),hn!==4&&(hn=2),i===null)return!0;d=nr(d,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,r=p&-p,s.lanes|=r,r=yh(s.stateNode,d,r),Yf(s,r),!1;case 1:if(i=s.type,y=s.stateNode,(s.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(vl===null||!vl.has(y))))return s.flags|=65536,p&=-p,s.lanes|=p,p=X4(p),Z4(p,r,s,d),Yf(s,p),!1}s=s.return}while(s!==null);return!1}var vh=Error(a(461)),Cn=!1;function Fn(r,i,s,d){i.child=r===null?Be(i,null,s,d):De(i,r.child,s,d)}function Q4(r,i,s,d,p){s=s.render;var y=i.ref;if("ref"in d){var j={};for(var R in d)R!=="ref"&&(j[R]=d[R])}else j=d;return wi(i),d=Jf(r,i,s,j,y,p),R=eh(),r!==null&&!Cn?(th(r,i,p),Ci(r,i,p)):(yt&&R&&Lu(i),i.flags|=1,Fn(r,i,d,p),i.child)}function J4(r,i,s,d,p){if(r===null){var y=s.type;return typeof y=="function"&&!po(y)&&y.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=y,eg(r,i,y,d,p)):(r=go(s.type,null,d,i,i.mode,p),r.ref=i.ref,r.return=i,i.child=r)}if(y=r.child,!Th(r,p)){var j=y.memoizedProps;if(s=s.compare,s=s!==null?s:os,s(j,d)&&r.ref===i.ref)return Ci(r,i,p)}return i.flags|=1,r=ya(y,d),r.ref=i.ref,r.return=i,i.child=r}function eg(r,i,s,d,p){if(r!==null){var y=r.memoizedProps;if(os(y,d)&&r.ref===i.ref)if(Cn=!1,i.pendingProps=d=y,Th(r,p))(r.flags&131072)!==0&&(Cn=!0);else return i.lanes=r.lanes,Ci(r,i,p)}return xh(r,i,s,d,p)}function tg(r,i,s,d){var p=d.children,y=r!==null?r.memoizedState:null;if(r===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((i.flags&128)!==0){if(y=y!==null?y.baseLanes|s:s,r!==null){for(d=i.child=r.child,p=0;d!==null;)p=p|d.lanes|d.childLanes,d=d.sibling;d=p&~y}else d=0,i.child=null;return ng(r,i,y,s,d)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&ps(i,y!==null?y.cachePool:null),y!==null?a4(i,y):Kf(),i4(i);else return d=i.lanes=536870912,ng(r,i,y!==null?y.baseLanes|s:s,s,d)}else y!==null?(ps(i,y.cachePool),a4(i,y),ml(),i.memoizedState=null):(r!==null&&ps(i,null),Kf(),ml());return Fn(r,i,p,s),i.child}function Ju(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function ng(r,i,s,d,p){var y=$u();return y=y===null?null:{parent:Jt._currentValue,pool:y},i.memoizedState={baseLanes:s,cachePool:y},r!==null&&ps(i,null),Kf(),i4(i),r!==null&&Ha(r,i,d,!0),i.childLanes=p,null}function H0(r,i){return i=F0({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function rg(r,i,s){return De(i,r.child,null,s),r=H0(i,i.pendingProps),r.flags|=2,_r(i),i.memoizedState=null,r}function u7(r,i,s){var d=i.pendingProps,p=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(yt){if(d.mode==="hidden")return r=H0(i,d),i.lanes=536870912,Ju(null,r);if(Zf(i),(r=Wt)?(r=p2(r,gr),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:va!==null?{id:zr,overflow:Qr}:null,retryLane:536870912,hydrationErrors:null},s=yo(r),s.return=i,i.child=s,Dn=i,Wt=null)):r=null,r===null)throw Ua(i);return i.lanes=536870912,null}return H0(i,d)}var y=r.memoizedState;if(y!==null){var j=y.dehydrated;if(Zf(i),p)if(i.flags&256)i.flags&=-257,i=rg(r,i,s);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(a(558));else if(Cn||Ha(r,i,s,!1),p=(s&r.childLanes)!==0,Cn||p){if(d=Kt,d!==null&&(j=r0(d,s),j!==0&&j!==y.retryLane))throw y.retryLane=j,xi(r,j),wr(d,r,j),vh;Q0(),i=rg(r,i,s)}else r=y.treeContext,Wt=ta(j.nextSibling),Dn=i,yt=!0,qa=null,gr=!1,r!==null&&S0(i,r),i=H0(i,d),i.flags|=4096;return i}return r=ya(r.child,{mode:d.mode,children:d.children}),r.ref=i.ref,i.child=r,r.return=i,r}function $0(r,i){var s=i.ref;if(s===null)r!==null&&r.ref!==null&&(i.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(a(284));(r===null||r.ref!==s)&&(i.flags|=4194816)}}function xh(r,i,s,d,p){return wi(i),s=Jf(r,i,s,d,void 0,p),d=eh(),r!==null&&!Cn?(th(r,i,p),Ci(r,i,p)):(yt&&d&&Lu(i),i.flags|=1,Fn(r,i,s,p),i.child)}function ag(r,i,s,d,p,y){return wi(i),i.updateQueue=null,s=s4(i,d,s,p),l4(r),d=eh(),r!==null&&!Cn?(th(r,i,y),Ci(r,i,y)):(yt&&d&&Lu(i),i.flags|=1,Fn(r,i,s,y),i.child)}function ig(r,i,s,d,p){if(wi(i),i.stateNode===null){var y=sl,j=s.contextType;typeof j=="object"&&j!==null&&(y=Rn(j)),y=new s(d,y),i.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=gh,i.stateNode=y,y._reactInternals=i,y=i.stateNode,y.props=d,y.state=i.memoizedState,y.refs={},qt(i),j=s.contextType,y.context=typeof j=="object"&&j!==null?Rn(j):sl,y.state=i.memoizedState,j=s.getDerivedStateFromProps,typeof j=="function"&&(ph(i,s,j,d),y.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(j=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),j!==y.state&&gh.enqueueReplaceState(y,y.state,null),Wu(i,d,y,p),Yu(),y.state=i.memoizedState),typeof y.componentDidMount=="function"&&(i.flags|=4194308),d=!0}else if(r===null){y=i.stateNode;var R=i.memoizedProps,V=ys(s,R);y.props=V;var se=y.context,ye=s.contextType;j=sl,typeof ye=="object"&&ye!==null&&(j=Rn(ye));var xe=s.getDerivedStateFromProps;ye=typeof xe=="function"||typeof y.getSnapshotBeforeUpdate=="function",R=i.pendingProps!==R,ye||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(R||se!==j)&&G4(i,y,d,j),Mt=!1;var ue=i.memoizedState;y.state=ue,Wu(i,d,y,p),Yu(),se=i.memoizedState,R||ue!==se||Mt?(typeof xe=="function"&&(ph(i,s,xe,d),se=i.memoizedState),(V=Mt||P4(i,s,V,d,ue,se,j))?(ye||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(i.flags|=4194308)):(typeof y.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=d,i.memoizedState=se),y.props=d,y.state=se,y.context=j,d=V):(typeof y.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{y=i.stateNode,Bn(r,i),j=i.memoizedProps,ye=ys(s,j),y.props=ye,xe=i.pendingProps,ue=y.context,se=s.contextType,V=sl,typeof se=="object"&&se!==null&&(V=Rn(se)),R=s.getDerivedStateFromProps,(se=typeof R=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(j!==xe||ue!==V)&&G4(i,y,d,V),Mt=!1,ue=i.memoizedState,y.state=ue,Wu(i,d,y,p),Yu();var de=i.memoizedState;j!==xe||ue!==de||Mt||r!==null&&r.dependencies!==null&&$a(r.dependencies)?(typeof R=="function"&&(ph(i,s,R,d),de=i.memoizedState),(ye=Mt||P4(i,s,ye,d,ue,de,V)||r!==null&&r.dependencies!==null&&$a(r.dependencies))?(se||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(d,de,V),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(d,de,V)),typeof y.componentDidUpdate=="function"&&(i.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof y.componentDidUpdate!="function"||j===r.memoizedProps&&ue===r.memoizedState||(i.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||j===r.memoizedProps&&ue===r.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=de),y.props=d,y.state=de,y.context=V,d=ye):(typeof y.componentDidUpdate!="function"||j===r.memoizedProps&&ue===r.memoizedState||(i.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||j===r.memoizedProps&&ue===r.memoizedState||(i.flags|=1024),d=!1)}return y=d,$0(r,i),d=(i.flags&128)!==0,y||d?(y=i.stateNode,s=d&&typeof s.getDerivedStateFromError!="function"?null:y.render(),i.flags|=1,r!==null&&d?(i.child=De(i,r.child,null,p),i.child=De(i,null,s,p)):Fn(r,i,s,p),i.memoizedState=y.state,r=i.child):r=Ci(r,i,p),r}function lg(r,i,s,d){return bi(),i.flags|=256,Fn(r,i,s,d),i.child}var bh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function wh(r){return{baseLanes:r,cachePool:N0()}}function kh(r,i,s){return r=r!==null?r.childLanes&~s:0,i&&(r|=Br),r}function sg(r,i,s){var d=i.pendingProps,p=!1,y=(i.flags&128)!==0,j;if((j=y)||(j=r!==null&&r.memoizedState===null?!1:(xn.current&2)!==0),j&&(p=!0,i.flags&=-129),j=(i.flags&32)!==0,i.flags&=-33,r===null){if(yt){if(p?hl(i):ml(),(r=Wt)?(r=p2(r,gr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:va!==null?{id:zr,overflow:Qr}:null,retryLane:536870912,hydrationErrors:null},s=yo(r),s.return=i,i.child=s,Dn=i,Wt=null)):r=null,r===null)throw Ua(i);return am(r)?i.lanes=32:i.lanes=536870912,null}var R=d.children;return d=d.fallback,p?(ml(),p=i.mode,R=F0({mode:"hidden",children:R},p),d=Ba(d,p,s,null),R.return=i,d.return=i,R.sibling=d,i.child=R,d=i.child,d.memoizedState=wh(s),d.childLanes=kh(r,j,s),i.memoizedState=bh,Ju(null,d)):(hl(i),Sh(i,R))}var V=r.memoizedState;if(V!==null&&(R=V.dehydrated,R!==null)){if(y)i.flags&256?(hl(i),i.flags&=-257,i=jh(r,i,s)):i.memoizedState!==null?(ml(),i.child=r.child,i.flags|=128,i=null):(ml(),R=d.fallback,p=i.mode,d=F0({mode:"visible",children:d.children},p),R=Ba(R,p,s,null),R.flags|=2,d.return=i,R.return=i,d.sibling=R,i.child=d,De(i,r.child,null,s),d=i.child,d.memoizedState=wh(s),d.childLanes=kh(r,j,s),i.memoizedState=bh,i=Ju(null,d));else if(hl(i),am(R)){if(j=R.nextSibling&&R.nextSibling.dataset,j)var se=j.dgst;j=se,d=Error(a(419)),d.stack="",d.digest=j,hs({value:d,source:null,stack:null}),i=jh(r,i,s)}else if(Cn||Ha(r,i,s,!1),j=(s&r.childLanes)!==0,Cn||j){if(j=Kt,j!==null&&(d=r0(j,s),d!==0&&d!==V.retryLane))throw V.retryLane=d,xi(r,d),wr(j,r,d),vh;rm(R)||Q0(),i=jh(r,i,s)}else rm(R)?(i.flags|=192,i.child=r.child,i=null):(r=V.treeContext,Wt=ta(R.nextSibling),Dn=i,yt=!0,qa=null,gr=!1,r!==null&&S0(i,r),i=Sh(i,d.children),i.flags|=4096);return i}return p?(ml(),R=d.fallback,p=i.mode,V=r.child,se=V.sibling,d=ya(V,{mode:"hidden",children:d.children}),d.subtreeFlags=V.subtreeFlags&65011712,se!==null?R=ya(se,R):(R=Ba(R,p,s,null),R.flags|=2),R.return=i,d.return=i,d.sibling=R,i.child=d,Ju(null,d),d=i.child,R=r.child.memoizedState,R===null?R=wh(s):(p=R.cachePool,p!==null?(V=Jt._currentValue,p=p.parent!==V?{parent:V,pool:V}:p):p=N0(),R={baseLanes:R.baseLanes|s,cachePool:p}),d.memoizedState=R,d.childLanes=kh(r,j,s),i.memoizedState=bh,Ju(r.child,d)):(hl(i),s=r.child,r=s.sibling,s=ya(s,{mode:"visible",children:d.children}),s.return=i,s.sibling=null,r!==null&&(j=i.deletions,j===null?(i.deletions=[r],i.flags|=16):j.push(r)),i.child=s,i.memoizedState=null,s)}function Sh(r,i){return i=F0({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function F0(r,i){return r=tn(22,r,null,i),r.lanes=0,r}function jh(r,i,s){return De(i,r.child,null,s),r=Sh(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function og(r,i,s){r.lanes|=i;var d=r.alternate;d!==null&&(d.lanes|=i),xo(r.return,i,s)}function Ch(r,i,s,d,p,y){var j=r.memoizedState;j===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:d,tail:s,tailMode:p,treeForkCount:y}:(j.isBackwards=i,j.rendering=null,j.renderingStartTime=0,j.last=d,j.tail=s,j.tailMode=p,j.treeForkCount=y)}function ug(r,i,s){var d=i.pendingProps,p=d.revealOrder,y=d.tail;d=d.children;var j=xn.current,R=(j&2)!==0;if(R?(j=j&1|2,i.flags|=128):j&=1,O(xn,j),Fn(r,i,d,s),d=yt?Zr:0,!R&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&og(r,s,i);else if(r.tag===19)og(r,s,i);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(p){case"forwards":for(s=i.child,p=null;s!==null;)r=s.alternate,r!==null&&z0(r)===null&&(p=s),s=s.sibling;s=p,s===null?(p=i.child,i.child=null):(p=s.sibling,s.sibling=null),Ch(i,!1,p,s,y,d);break;case"backwards":case"unstable_legacy-backwards":for(s=null,p=i.child,i.child=null;p!==null;){if(r=p.alternate,r!==null&&z0(r)===null){i.child=p;break}r=p.sibling,p.sibling=s,s=p,p=r}Ch(i,!0,s,null,y,d);break;case"together":Ch(i,!1,null,null,void 0,d);break;default:i.memoizedState=null}return i.child}function Ci(r,i,s){if(r!==null&&(i.dependencies=r.dependencies),yl|=i.lanes,(s&i.childLanes)===0)if(r!==null){if(Ha(r,i,s,!1),(s&i.childLanes)===0)return null}else return null;if(r!==null&&i.child!==r.child)throw Error(a(153));if(i.child!==null){for(r=i.child,s=ya(r,r.pendingProps),i.child=s,s.return=i;r.sibling!==null;)r=r.sibling,s=s.sibling=ya(r,r.pendingProps),s.return=i;s.sibling=null}return i.child}function Th(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&$a(r)))}function c7(r,i,s){switch(i.tag){case 3:_e(i,i.stateNode.containerInfo),Wn(i,Jt,r.memoizedState.cache),bi();break;case 27:case 5:wt(i);break;case 4:_e(i,i.stateNode.containerInfo);break;case 10:Wn(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Zf(i),null;break;case 13:var d=i.memoizedState;if(d!==null)return d.dehydrated!==null?(hl(i),i.flags|=128,null):(s&i.child.childLanes)!==0?sg(r,i,s):(hl(i),r=Ci(r,i,s),r!==null?r.sibling:null);hl(i);break;case 19:var p=(r.flags&128)!==0;if(d=(s&i.childLanes)!==0,d||(Ha(r,i,s,!1),d=(s&i.childLanes)!==0),p){if(d)return ug(r,i,s);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),O(xn,xn.current),d)break;return null;case 22:return i.lanes=0,tg(r,i,s,i.pendingProps);case 24:Wn(i,Jt,r.memoizedState.cache)}return Ci(r,i,s)}function cg(r,i,s){if(r!==null)if(r.memoizedProps!==i.pendingProps)Cn=!0;else{if(!Th(r,s)&&(i.flags&128)===0)return Cn=!1,c7(r,i,s);Cn=(r.flags&131072)!==0}else Cn=!1,yt&&(i.flags&1048576)!==0&&k0(i,Zr,i.index);switch(i.lanes=0,i.tag){case 16:e:{var d=i.pendingProps;if(r=Ga(i.elementType),i.type=r,typeof r=="function")po(r)?(d=ys(r,d),i.tag=1,i=ig(null,i,r,d,s)):(i.tag=0,i=xh(null,i,r,d,s));else{if(r!=null){var p=r.$$typeof;if(p===U){i.tag=11,i=Q4(null,i,r,d,s);break e}else if(p===K){i.tag=14,i=J4(null,i,r,d,s);break e}}throw i=be(r)||r,Error(a(306,i,""))}}return i;case 0:return xh(r,i,i.type,i.pendingProps,s);case 1:return d=i.type,p=ys(d,i.pendingProps),ig(r,i,d,p,s);case 3:e:{if(_e(i,i.stateNode.containerInfo),r===null)throw Error(a(387));d=i.pendingProps;var y=i.memoizedState;p=y.element,Bn(r,i),Wu(i,d,null,s);var j=i.memoizedState;if(d=j.cache,Wn(i,Jt,d),d!==y.cache&&bo(i,[Jt],s,!0),Yu(),d=j.element,y.isDehydrated)if(y={element:d,isDehydrated:!1,cache:j.cache},i.updateQueue.baseState=y,i.memoizedState=y,i.flags&256){i=lg(r,i,d,s);break e}else if(d!==p){p=nr(Error(a(424)),i),hs(p),i=lg(r,i,d,s);break e}else{switch(r=i.stateNode.containerInfo,r.nodeType){case 9:r=r.body;break;default:r=r.nodeName==="HTML"?r.ownerDocument.body:r}for(Wt=ta(r.firstChild),Dn=i,yt=!0,qa=null,gr=!0,s=Be(i,null,d,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(bi(),d===p){i=Ci(r,i,s);break e}Fn(r,i,d,s)}i=i.child}return i;case 26:return $0(r,i),r===null?(s=w2(i.type,null,i.pendingProps,null))?i.memoizedState=s:yt||(s=i.type,r=i.pendingProps,d=id(ne.current).createElement(s),d[rn]=i,d[gn]=r,Pn(d,s,r),yn(d),i.stateNode=d):i.memoizedState=w2(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return wt(i),r===null&&yt&&(d=i.stateNode=v2(i.type,i.pendingProps,ne.current),Dn=i,gr=!0,p=Wt,kl(i.type)?(im=p,Wt=ta(d.firstChild)):Wt=p),Fn(r,i,i.pendingProps.children,s),$0(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&yt&&((p=d=Wt)&&(d=U7(d,i.type,i.pendingProps,gr),d!==null?(i.stateNode=d,Dn=i,Wt=ta(d.firstChild),gr=!1,p=!0):p=!1),p||Ua(i)),wt(i),p=i.type,y=i.pendingProps,j=r!==null?r.memoizedProps:null,d=y.children,em(p,y)?d=null:j!==null&&em(p,j)&&(i.flags|=32),i.memoizedState!==null&&(p=Jf(r,i,t7,null,null,s),mc._currentValue=p),$0(r,i),Fn(r,i,d,s),i.child;case 6:return r===null&&yt&&((r=s=Wt)&&(s=H7(s,i.pendingProps,gr),s!==null?(i.stateNode=s,Dn=i,Wt=null,r=!0):r=!1),r||Ua(i)),null;case 13:return sg(r,i,s);case 4:return _e(i,i.stateNode.containerInfo),d=i.pendingProps,r===null?i.child=De(i,null,d,s):Fn(r,i,d,s),i.child;case 11:return Q4(r,i,i.type,i.pendingProps,s);case 7:return Fn(r,i,i.pendingProps,s),i.child;case 8:return Fn(r,i,i.pendingProps.children,s),i.child;case 12:return Fn(r,i,i.pendingProps.children,s),i.child;case 10:return d=i.pendingProps,Wn(i,i.type,d.value),Fn(r,i,d.children,s),i.child;case 9:return p=i.type._context,d=i.pendingProps.children,wi(i),p=Rn(p),d=d(p),i.flags|=1,Fn(r,i,d,s),i.child;case 14:return J4(r,i,i.type,i.pendingProps,s);case 15:return eg(r,i,i.type,i.pendingProps,s);case 19:return ug(r,i,s);case 31:return u7(r,i,s);case 22:return tg(r,i,s,i.pendingProps);case 24:return wi(i),d=Rn(Jt),r===null?(p=$u(),p===null&&(p=Kt,y=ki(),p.pooledCache=y,y.refCount++,y!==null&&(p.pooledCacheLanes|=s),p=y),i.memoizedState={parent:d,cache:p},qt(i),Wn(i,Jt,p)):((r.lanes&s)!==0&&(Bn(r,i),Wu(i,null,null,s),Yu()),p=r.memoizedState,y=i.memoizedState,p.parent!==d?(p={parent:d,cache:d},i.memoizedState=p,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=p),Wn(i,Jt,d)):(d=y.cache,Wn(i,Jt,d),d!==p.cache&&bo(i,[Jt],s,!0))),Fn(r,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function Ti(r){r.flags|=4}function Ah(r,i,s,d,p){if((i=(r.mode&32)!==0)&&(i=!1),i){if(r.flags|=16777216,(p&335544128)===p)if(r.stateNode.complete)r.flags|=8192;else if(Lg())r.flags|=8192;else throw Va=So,Fu}else r.flags&=-16777217}function dg(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!T2(i))if(Lg())r.flags|=8192;else throw Va=So,Fu}function P0(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?ou():536870912,r.lanes|=i,zo|=i)}function ec(r,i){if(!yt)switch(r.tailMode){case"hidden":i=r.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?r.tail=null:s.sibling=null;break;case"collapsed":s=r.tail;for(var d=null;s!==null;)s.alternate!==null&&(d=s),s=s.sibling;d===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:d.sibling=null}}function nn(r){var i=r.alternate!==null&&r.alternate.child===r.child,s=0,d=0;if(i)for(var p=r.child;p!==null;)s|=p.lanes|p.childLanes,d|=p.subtreeFlags&65011712,d|=p.flags&65011712,p.return=r,p=p.sibling;else for(p=r.child;p!==null;)s|=p.lanes|p.childLanes,d|=p.subtreeFlags,d|=p.flags,p.return=r,p=p.sibling;return r.subtreeFlags|=d,r.childLanes=s,i}function d7(r,i,s){var d=i.pendingProps;switch(Bu(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return nn(i),null;case 1:return nn(i),null;case 3:return s=i.stateNode,d=null,r!==null&&(d=r.memoizedState.cache),i.memoizedState.cache!==d&&(i.flags|=2048),Rr(Jt),He(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(r===null||r.child===null)&&(xa(i)?Ti(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,fs())),nn(i),null;case 26:var p=i.type,y=i.memoizedState;return r===null?(Ti(i),y!==null?(nn(i),dg(i,y)):(nn(i),Ah(i,p,null,d,s))):y?y!==r.memoizedState?(Ti(i),nn(i),dg(i,y)):(nn(i),i.flags&=-16777217):(r=r.memoizedProps,r!==d&&Ti(i),nn(i),Ah(i,p,r,d,s)),null;case 27:if(et(i),s=ne.current,p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==d&&Ti(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return nn(i),null}r=ee.current,xa(i)?j0(i):(r=v2(p,d,s),i.stateNode=r,Ti(i))}return nn(i),null;case 5:if(et(i),p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==d&&Ti(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return nn(i),null}if(y=ee.current,xa(i))j0(i);else{var j=id(ne.current);switch(y){case 1:y=j.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:y=j.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":y=j.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":y=j.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":y=j.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof d.is=="string"?j.createElement("select",{is:d.is}):j.createElement("select"),d.multiple?y.multiple=!0:d.size&&(y.size=d.size);break;default:y=typeof d.is=="string"?j.createElement(p,{is:d.is}):j.createElement(p)}}y[rn]=i,y[gn]=d;e:for(j=i.child;j!==null;){if(j.tag===5||j.tag===6)y.appendChild(j.stateNode);else if(j.tag!==4&&j.tag!==27&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===i)break e;for(;j.sibling===null;){if(j.return===null||j.return===i)break e;j=j.return}j.sibling.return=j.return,j=j.sibling}i.stateNode=y;e:switch(Pn(y,p,d),p){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&Ti(i)}}return nn(i),Ah(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,s),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==d&&Ti(i);else{if(typeof d!="string"&&i.stateNode===null)throw Error(a(166));if(r=ne.current,xa(i)){if(r=i.stateNode,s=i.memoizedProps,d=null,p=Dn,p!==null)switch(p.tag){case 27:case 5:d=p.memoizedProps}r[rn]=i,r=!!(r.nodeValue===s||d!==null&&d.suppressHydrationWarning===!0||s2(r.nodeValue,s)),r||Ua(i,!0)}else r=id(r).createTextNode(d),r[rn]=i,i.stateNode=r}return nn(i),null;case 31:if(s=i.memoizedState,r===null||r.memoizedState!==null){if(d=xa(i),s!==null){if(r===null){if(!d)throw Error(a(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));r[rn]=i}else bi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;nn(i),r=!1}else s=fs(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=s),r=!0;if(!r)return i.flags&256?(_r(i),i):(_r(i),null);if((i.flags&128)!==0)throw Error(a(558))}return nn(i),null;case 13:if(d=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=xa(i),d!==null&&d.dehydrated!==null){if(r===null){if(!p)throw Error(a(318));if(p=i.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(a(317));p[rn]=i}else bi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;nn(i),p=!1}else p=fs(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return i.flags&256?(_r(i),i):(_r(i),null)}return _r(i),(i.flags&128)!==0?(i.lanes=s,i):(s=d!==null,r=r!==null&&r.memoizedState!==null,s&&(d=i.child,p=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(p=d.alternate.memoizedState.cachePool.pool),y=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(y=d.memoizedState.cachePool.pool),y!==p&&(d.flags|=2048)),s!==r&&s&&(i.child.flags|=8192),P0(i,i.updateQueue),nn(i),null);case 4:return He(),r===null&&Kh(i.stateNode.containerInfo),nn(i),null;case 10:return Rr(i.type),nn(i),null;case 19:if(te(xn),d=i.memoizedState,d===null)return nn(i),null;if(p=(i.flags&128)!==0,y=d.rendering,y===null)if(p)ec(d,!1);else{if(hn!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(y=z0(r),y!==null){for(i.flags|=128,ec(d,!1),r=y.updateQueue,i.updateQueue=r,P0(i,r),i.subtreeFlags=0,r=s,s=i.child;s!==null;)w0(s,r),s=s.sibling;return O(xn,xn.current&1|2),yt&&Jr(i,d.treeForkCount),i.child}r=r.sibling}d.tail!==null&&ht()>K0&&(i.flags|=128,p=!0,ec(d,!1),i.lanes=4194304)}else{if(!p)if(r=z0(y),r!==null){if(i.flags|=128,p=!0,r=r.updateQueue,i.updateQueue=r,P0(i,r),ec(d,!0),d.tail===null&&d.tailMode==="hidden"&&!y.alternate&&!yt)return nn(i),null}else 2*ht()-d.renderingStartTime>K0&&s!==536870912&&(i.flags|=128,p=!0,ec(d,!1),i.lanes=4194304);d.isBackwards?(y.sibling=i.child,i.child=y):(r=d.last,r!==null?r.sibling=y:i.child=y,d.last=y)}return d.tail!==null?(r=d.tail,d.rendering=r,d.tail=r.sibling,d.renderingStartTime=ht(),r.sibling=null,s=xn.current,O(xn,p?s&1|2:s&1),yt&&Jr(i,d.treeForkCount),r):(nn(i),null);case 22:case 23:return _r(i),Xf(),d=i.memoizedState!==null,r!==null?r.memoizedState!==null!==d&&(i.flags|=8192):d&&(i.flags|=8192),d?(s&536870912)!==0&&(i.flags&128)===0&&(nn(i),i.subtreeFlags&6&&(i.flags|=8192)):nn(i),s=i.updateQueue,s!==null&&P0(i,s.retryQueue),s=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),d=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),d!==s&&(i.flags|=2048),r!==null&&te($n),null;case 24:return s=null,r!==null&&(s=r.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),Rr(Jt),nn(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function f7(r,i){switch(Bu(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return Rr(Jt),He(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return et(i),null;case 31:if(i.memoizedState!==null){if(_r(i),i.alternate===null)throw Error(a(340));bi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(_r(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));bi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return te(xn),null;case 4:return He(),null;case 10:return Rr(i.type),null;case 22:case 23:return _r(i),Xf(),r!==null&&te($n),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return Rr(Jt),null;case 25:return null;default:return null}}function fg(r,i){switch(Bu(i),i.tag){case 3:Rr(Jt),He();break;case 26:case 27:case 5:et(i);break;case 4:He();break;case 31:i.memoizedState!==null&&_r(i);break;case 13:_r(i);break;case 19:te(xn);break;case 10:Rr(i.type);break;case 22:case 23:_r(i),Xf(),r!==null&&te($n);break;case 24:Rr(Jt)}}function tc(r,i){try{var s=i.updateQueue,d=s!==null?s.lastEffect:null;if(d!==null){var p=d.next;s=p;do{if((s.tag&r)===r){d=void 0;var y=s.create,j=s.inst;d=y(),j.destroy=d}s=s.next}while(s!==p)}}catch(R){Ht(i,i.return,R)}}function pl(r,i,s){try{var d=i.updateQueue,p=d!==null?d.lastEffect:null;if(p!==null){var y=p.next;d=y;do{if((d.tag&r)===r){var j=d.inst,R=j.destroy;if(R!==void 0){j.destroy=void 0,p=i;var V=s,se=R;try{se()}catch(ye){Ht(p,V,ye)}}}d=d.next}while(d!==y)}}catch(ye){Ht(i,i.return,ye)}}function hg(r){var i=r.updateQueue;if(i!==null){var s=r.stateNode;try{r4(i,s)}catch(d){Ht(r,r.return,d)}}}function mg(r,i,s){s.props=ys(r.type,r.memoizedProps),s.state=r.memoizedState;try{s.componentWillUnmount()}catch(d){Ht(r,i,d)}}function nc(r,i){try{var s=r.ref;if(s!==null){switch(r.tag){case 26:case 27:case 5:var d=r.stateNode;break;case 30:d=r.stateNode;break;default:d=r.stateNode}typeof s=="function"?r.refCleanup=s(d):s.current=d}}catch(p){Ht(r,i,p)}}function Ya(r,i){var s=r.ref,d=r.refCleanup;if(s!==null)if(typeof d=="function")try{d()}catch(p){Ht(r,i,p)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(p){Ht(r,i,p)}else s.current=null}function pg(r){var i=r.type,s=r.memoizedProps,d=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":s.autoFocus&&d.focus();break e;case"img":s.src?d.src=s.src:s.srcSet&&(d.srcset=s.srcSet)}}catch(p){Ht(r,r.return,p)}}function Eh(r,i,s){try{var d=r.stateNode;O7(d,r.type,s,i),d[gn]=i}catch(p){Ht(r,r.return,p)}}function gg(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&kl(r.type)||r.tag===4}function Nh(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||gg(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&kl(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Mh(r,i,s){var d=r.tag;if(d===5||d===6)r=r.stateNode,i?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(r,i):(i=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,i.appendChild(r),s=s._reactRootContainer,s!=null||i.onclick!==null||(i.onclick=er));else if(d!==4&&(d===27&&kl(r.type)&&(s=r.stateNode,i=null),r=r.child,r!==null))for(Mh(r,i,s),r=r.sibling;r!==null;)Mh(r,i,s),r=r.sibling}function G0(r,i,s){var d=r.tag;if(d===5||d===6)r=r.stateNode,i?s.insertBefore(r,i):s.appendChild(r);else if(d!==4&&(d===27&&kl(r.type)&&(s=r.stateNode),r=r.child,r!==null))for(G0(r,i,s),r=r.sibling;r!==null;)G0(r,i,s),r=r.sibling}function yg(r){var i=r.stateNode,s=r.memoizedProps;try{for(var d=r.type,p=i.attributes;p.length;)i.removeAttributeNode(p[0]);Pn(i,d,s),i[rn]=r,i[gn]=s}catch(y){Ht(r,r.return,y)}}var Ai=!1,Tn=!1,zh=!1,vg=typeof WeakSet=="function"?WeakSet:Set,qn=null;function h7(r,i){if(r=r.containerInfo,Qh=fd,r=oo(r),Au(r)){if("selectionStart"in r)var s={start:r.selectionStart,end:r.selectionEnd};else e:{s=(s=r.ownerDocument)&&s.defaultView||window;var d=s.getSelection&&s.getSelection();if(d&&d.rangeCount!==0){s=d.anchorNode;var p=d.anchorOffset,y=d.focusNode;d=d.focusOffset;try{s.nodeType,y.nodeType}catch{s=null;break e}var j=0,R=-1,V=-1,se=0,ye=0,xe=r,ue=null;t:for(;;){for(var de;xe!==s||p!==0&&xe.nodeType!==3||(R=j+p),xe!==y||d!==0&&xe.nodeType!==3||(V=j+d),xe.nodeType===3&&(j+=xe.nodeValue.length),(de=xe.firstChild)!==null;)ue=xe,xe=de;for(;;){if(xe===r)break t;if(ue===s&&++se===p&&(R=j),ue===y&&++ye===d&&(V=j),(de=xe.nextSibling)!==null)break;xe=ue,ue=xe.parentNode}xe=de}s=R===-1||V===-1?null:{start:R,end:V}}else s=null}s=s||{start:0,end:0}}else s=null;for(Jh={focusedElem:r,selectionRange:s},fd=!1,qn=i;qn!==null;)if(i=qn,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,qn=r;else for(;qn!==null;){switch(i=qn,y=i.alternate,r=i.flags,i.tag){case 0:if((r&4)!==0&&(r=i.updateQueue,r=r!==null?r.events:null,r!==null))for(s=0;s<r.length;s++)p=r[s],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&y!==null){r=void 0,s=i,p=y.memoizedProps,y=y.memoizedState,d=s.stateNode;try{var Ge=ys(s.type,p);r=d.getSnapshotBeforeUpdate(Ge,y),d.__reactInternalSnapshotBeforeUpdate=r}catch(rt){Ht(s,s.return,rt)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,s=r.nodeType,s===9)nm(r);else if(s===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":nm(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(a(163))}if(r=i.sibling,r!==null){r.return=i.return,qn=r;break}qn=i.return}}function xg(r,i,s){var d=s.flags;switch(s.tag){case 0:case 11:case 15:Ni(r,s),d&4&&tc(5,s);break;case 1:if(Ni(r,s),d&4)if(r=s.stateNode,i===null)try{r.componentDidMount()}catch(j){Ht(s,s.return,j)}else{var p=ys(s.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(p,i,r.__reactInternalSnapshotBeforeUpdate)}catch(j){Ht(s,s.return,j)}}d&64&&hg(s),d&512&&nc(s,s.return);break;case 3:if(Ni(r,s),d&64&&(r=s.updateQueue,r!==null)){if(i=null,s.child!==null)switch(s.child.tag){case 27:case 5:i=s.child.stateNode;break;case 1:i=s.child.stateNode}try{r4(r,i)}catch(j){Ht(s,s.return,j)}}break;case 27:i===null&&d&4&&yg(s);case 26:case 5:Ni(r,s),i===null&&d&4&&pg(s),d&512&&nc(s,s.return);break;case 12:Ni(r,s);break;case 31:Ni(r,s),d&4&&kg(r,s);break;case 13:Ni(r,s),d&4&&Sg(r,s),d&64&&(r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(s=k7.bind(null,s),$7(r,s))));break;case 22:if(d=s.memoizedState!==null||Ai,!d){i=i!==null&&i.memoizedState!==null||Tn,p=Ai;var y=Tn;Ai=d,(Tn=i)&&!y?Mi(r,s,(s.subtreeFlags&8772)!==0):Ni(r,s),Ai=p,Tn=y}break;case 30:break;default:Ni(r,s)}}function bg(r){var i=r.alternate;i!==null&&(r.alternate=null,bg(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&Vl(i)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var an=null,yr=!1;function Ei(r,i,s){for(s=s.child;s!==null;)wg(r,i,s),s=s.sibling}function wg(r,i,s){if(dn&&typeof dn.onCommitFiberUnmount=="function")try{dn.onCommitFiberUnmount(Bt,s)}catch{}switch(s.tag){case 26:Tn||Ya(s,i),Ei(r,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Tn||Ya(s,i);var d=an,p=yr;kl(s.type)&&(an=s.stateNode,yr=!1),Ei(r,i,s),dc(s.stateNode),an=d,yr=p;break;case 5:Tn||Ya(s,i);case 6:if(d=an,p=yr,an=null,Ei(r,i,s),an=d,yr=p,an!==null)if(yr)try{(an.nodeType===9?an.body:an.nodeName==="HTML"?an.ownerDocument.body:an).removeChild(s.stateNode)}catch(y){Ht(s,i,y)}else try{an.removeChild(s.stateNode)}catch(y){Ht(s,i,y)}break;case 18:an!==null&&(yr?(r=an,h2(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,s.stateNode),qo(r)):h2(an,s.stateNode));break;case 4:d=an,p=yr,an=s.stateNode.containerInfo,yr=!0,Ei(r,i,s),an=d,yr=p;break;case 0:case 11:case 14:case 15:pl(2,s,i),Tn||pl(4,s,i),Ei(r,i,s);break;case 1:Tn||(Ya(s,i),d=s.stateNode,typeof d.componentWillUnmount=="function"&&mg(s,i,d)),Ei(r,i,s);break;case 21:Ei(r,i,s);break;case 22:Tn=(d=Tn)||s.memoizedState!==null,Ei(r,i,s),Tn=d;break;default:Ei(r,i,s)}}function kg(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{qo(r)}catch(s){Ht(i,i.return,s)}}}function Sg(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{qo(r)}catch(s){Ht(i,i.return,s)}}function m7(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new vg),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new vg),i;default:throw Error(a(435,r.tag))}}function V0(r,i){var s=m7(r);i.forEach(function(d){if(!s.has(d)){s.add(d);var p=S7.bind(null,r,d);d.then(p,p)}})}function vr(r,i){var s=i.deletions;if(s!==null)for(var d=0;d<s.length;d++){var p=s[d],y=r,j=i,R=j;e:for(;R!==null;){switch(R.tag){case 27:if(kl(R.type)){an=R.stateNode,yr=!1;break e}break;case 5:an=R.stateNode,yr=!1;break e;case 3:case 4:an=R.stateNode.containerInfo,yr=!0;break e}R=R.return}if(an===null)throw Error(a(160));wg(y,j,p),an=null,yr=!1,y=p.alternate,y!==null&&(y.return=null),p.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)jg(i,r),i=i.sibling}var Sa=null;function jg(r,i){var s=r.alternate,d=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:vr(i,r),xr(r),d&4&&(pl(3,r,r.return),tc(3,r),pl(5,r,r.return));break;case 1:vr(i,r),xr(r),d&512&&(Tn||s===null||Ya(s,s.return)),d&64&&Ai&&(r=r.updateQueue,r!==null&&(d=r.callbacks,d!==null&&(s=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=s===null?d:s.concat(d))));break;case 26:var p=Sa;if(vr(i,r),xr(r),d&512&&(Tn||s===null||Ya(s,s.return)),d&4){var y=s!==null?s.memoizedState:null;if(d=r.memoizedState,s===null)if(d===null)if(r.stateNode===null){e:{d=r.type,s=r.memoizedProps,p=p.ownerDocument||p;t:switch(d){case"title":y=p.getElementsByTagName("title")[0],(!y||y[oa]||y[rn]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=p.createElement(d),p.head.insertBefore(y,p.querySelector("head > title"))),Pn(y,d,s),y[rn]=r,yn(y),d=y;break e;case"link":var j=j2("link","href",p).get(d+(s.href||""));if(j){for(var R=0;R<j.length;R++)if(y=j[R],y.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&y.getAttribute("rel")===(s.rel==null?null:s.rel)&&y.getAttribute("title")===(s.title==null?null:s.title)&&y.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){j.splice(R,1);break t}}y=p.createElement(d),Pn(y,d,s),p.head.appendChild(y);break;case"meta":if(j=j2("meta","content",p).get(d+(s.content||""))){for(R=0;R<j.length;R++)if(y=j[R],y.getAttribute("content")===(s.content==null?null:""+s.content)&&y.getAttribute("name")===(s.name==null?null:s.name)&&y.getAttribute("property")===(s.property==null?null:s.property)&&y.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&y.getAttribute("charset")===(s.charSet==null?null:s.charSet)){j.splice(R,1);break t}}y=p.createElement(d),Pn(y,d,s),p.head.appendChild(y);break;default:throw Error(a(468,d))}y[rn]=r,yn(y),d=y}r.stateNode=d}else C2(p,r.type,r.stateNode);else r.stateNode=S2(p,d,r.memoizedProps);else y!==d?(y===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):y.count--,d===null?C2(p,r.type,r.stateNode):S2(p,d,r.memoizedProps)):d===null&&r.stateNode!==null&&Eh(r,r.memoizedProps,s.memoizedProps)}break;case 27:vr(i,r),xr(r),d&512&&(Tn||s===null||Ya(s,s.return)),s!==null&&d&4&&Eh(r,r.memoizedProps,s.memoizedProps);break;case 5:if(vr(i,r),xr(r),d&512&&(Tn||s===null||Ya(s,s.return)),r.flags&32){p=r.stateNode;try{Er(p,"")}catch(Ge){Ht(r,r.return,Ge)}}d&4&&r.stateNode!=null&&(p=r.memoizedProps,Eh(r,p,s!==null?s.memoizedProps:p)),d&1024&&(zh=!0);break;case 6:if(vr(i,r),xr(r),d&4){if(r.stateNode===null)throw Error(a(162));d=r.memoizedProps,s=r.stateNode;try{s.nodeValue=d}catch(Ge){Ht(r,r.return,Ge)}}break;case 3:if(od=null,p=Sa,Sa=ld(i.containerInfo),vr(i,r),Sa=p,xr(r),d&4&&s!==null&&s.memoizedState.isDehydrated)try{qo(i.containerInfo)}catch(Ge){Ht(r,r.return,Ge)}zh&&(zh=!1,Cg(r));break;case 4:d=Sa,Sa=ld(r.stateNode.containerInfo),vr(i,r),xr(r),Sa=d;break;case 12:vr(i,r),xr(r);break;case 31:vr(i,r),xr(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,V0(r,d)));break;case 13:vr(i,r),xr(r),r.child.flags&8192&&r.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(W0=ht()),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,V0(r,d)));break;case 22:p=r.memoizedState!==null;var V=s!==null&&s.memoizedState!==null,se=Ai,ye=Tn;if(Ai=se||p,Tn=ye||V,vr(i,r),Tn=ye,Ai=se,xr(r),d&8192)e:for(i=r.stateNode,i._visibility=p?i._visibility&-2:i._visibility|1,p&&(s===null||V||Ai||Tn||vs(r)),s=null,i=r;;){if(i.tag===5||i.tag===26){if(s===null){V=s=i;try{if(y=V.stateNode,p)j=y.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none";else{R=V.stateNode;var xe=V.memoizedProps.style,ue=xe!=null&&xe.hasOwnProperty("display")?xe.display:null;R.style.display=ue==null||typeof ue=="boolean"?"":(""+ue).trim()}}catch(Ge){Ht(V,V.return,Ge)}}}else if(i.tag===6){if(s===null){V=i;try{V.stateNode.nodeValue=p?"":V.memoizedProps}catch(Ge){Ht(V,V.return,Ge)}}}else if(i.tag===18){if(s===null){V=i;try{var de=V.stateNode;p?m2(de,!0):m2(V.stateNode,!1)}catch(Ge){Ht(V,V.return,Ge)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===r)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;s===i&&(s=null),i=i.return}s===i&&(s=null),i.sibling.return=i.return,i=i.sibling}d&4&&(d=r.updateQueue,d!==null&&(s=d.retryQueue,s!==null&&(d.retryQueue=null,V0(r,s))));break;case 19:vr(i,r),xr(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,V0(r,d)));break;case 30:break;case 21:break;default:vr(i,r),xr(r)}}function xr(r){var i=r.flags;if(i&2){try{for(var s,d=r.return;d!==null;){if(gg(d)){s=d;break}d=d.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var p=s.stateNode,y=Nh(r);G0(r,y,p);break;case 5:var j=s.stateNode;s.flags&32&&(Er(j,""),s.flags&=-33);var R=Nh(r);G0(r,R,j);break;case 3:case 4:var V=s.stateNode.containerInfo,se=Nh(r);Mh(r,se,V);break;default:throw Error(a(161))}}catch(ye){Ht(r,r.return,ye)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function Cg(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;Cg(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function Ni(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)xg(r,i.alternate,i),i=i.sibling}function vs(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:pl(4,i,i.return),vs(i);break;case 1:Ya(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&mg(i,i.return,s),vs(i);break;case 27:dc(i.stateNode);case 26:case 5:Ya(i,i.return),vs(i);break;case 22:i.memoizedState===null&&vs(i);break;case 30:vs(i);break;default:vs(i)}r=r.sibling}}function Mi(r,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var d=i.alternate,p=r,y=i,j=y.flags;switch(y.tag){case 0:case 11:case 15:Mi(p,y,s),tc(4,y);break;case 1:if(Mi(p,y,s),d=y,p=d.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(se){Ht(d,d.return,se)}if(d=y,p=d.updateQueue,p!==null){var R=d.stateNode;try{var V=p.shared.hiddenCallbacks;if(V!==null)for(p.shared.hiddenCallbacks=null,p=0;p<V.length;p++)n4(V[p],R)}catch(se){Ht(d,d.return,se)}}s&&j&64&&hg(y),nc(y,y.return);break;case 27:yg(y);case 26:case 5:Mi(p,y,s),s&&d===null&&j&4&&pg(y),nc(y,y.return);break;case 12:Mi(p,y,s);break;case 31:Mi(p,y,s),s&&j&4&&kg(p,y);break;case 13:Mi(p,y,s),s&&j&4&&Sg(p,y);break;case 22:y.memoizedState===null&&Mi(p,y,s),nc(y,y.return);break;case 30:break;default:Mi(p,y,s)}i=i.sibling}}function Dh(r,i){var s=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==s&&(r!=null&&r.refCount++,s!=null&&wa(s))}function Rh(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&wa(r))}function ja(r,i,s,d){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Tg(r,i,s,d),i=i.sibling}function Tg(r,i,s,d){var p=i.flags;switch(i.tag){case 0:case 11:case 15:ja(r,i,s,d),p&2048&&tc(9,i);break;case 1:ja(r,i,s,d);break;case 3:ja(r,i,s,d),p&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&wa(r)));break;case 12:if(p&2048){ja(r,i,s,d),r=i.stateNode;try{var y=i.memoizedProps,j=y.id,R=y.onPostCommit;typeof R=="function"&&R(j,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(V){Ht(i,i.return,V)}}else ja(r,i,s,d);break;case 31:ja(r,i,s,d);break;case 13:ja(r,i,s,d);break;case 23:break;case 22:y=i.stateNode,j=i.alternate,i.memoizedState!==null?y._visibility&2?ja(r,i,s,d):rc(r,i):y._visibility&2?ja(r,i,s,d):(y._visibility|=2,Eo(r,i,s,d,(i.subtreeFlags&10256)!==0||!1)),p&2048&&Dh(j,i);break;case 24:ja(r,i,s,d),p&2048&&Rh(i.alternate,i);break;default:ja(r,i,s,d)}}function Eo(r,i,s,d,p){for(p=p&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var y=r,j=i,R=s,V=d,se=j.flags;switch(j.tag){case 0:case 11:case 15:Eo(y,j,R,V,p),tc(8,j);break;case 23:break;case 22:var ye=j.stateNode;j.memoizedState!==null?ye._visibility&2?Eo(y,j,R,V,p):rc(y,j):(ye._visibility|=2,Eo(y,j,R,V,p)),p&&se&2048&&Dh(j.alternate,j);break;case 24:Eo(y,j,R,V,p),p&&se&2048&&Rh(j.alternate,j);break;default:Eo(y,j,R,V,p)}i=i.sibling}}function rc(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var s=r,d=i,p=d.flags;switch(d.tag){case 22:rc(s,d),p&2048&&Dh(d.alternate,d);break;case 24:rc(s,d),p&2048&&Rh(d.alternate,d);break;default:rc(s,d)}i=i.sibling}}var ac=8192;function No(r,i,s){if(r.subtreeFlags&ac)for(r=r.child;r!==null;)Ag(r,i,s),r=r.sibling}function Ag(r,i,s){switch(r.tag){case 26:No(r,i,s),r.flags&ac&&r.memoizedState!==null&&eb(s,Sa,r.memoizedState,r.memoizedProps);break;case 5:No(r,i,s);break;case 3:case 4:var d=Sa;Sa=ld(r.stateNode.containerInfo),No(r,i,s),Sa=d;break;case 22:r.memoizedState===null&&(d=r.alternate,d!==null&&d.memoizedState!==null?(d=ac,ac=16777216,No(r,i,s),ac=d):No(r,i,s));break;default:No(r,i,s)}}function Eg(r){var i=r.alternate;if(i!==null&&(r=i.child,r!==null)){i.child=null;do i=r.sibling,r.sibling=null,r=i;while(r!==null)}}function ic(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var d=i[s];qn=d,Mg(d,r)}Eg(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Ng(r),r=r.sibling}function Ng(r){switch(r.tag){case 0:case 11:case 15:ic(r),r.flags&2048&&pl(9,r,r.return);break;case 3:ic(r);break;case 12:ic(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,Y0(r)):ic(r);break;default:ic(r)}}function Y0(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var d=i[s];qn=d,Mg(d,r)}Eg(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:pl(8,i,i.return),Y0(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,Y0(i));break;default:Y0(i)}r=r.sibling}}function Mg(r,i){for(;qn!==null;){var s=qn;switch(s.tag){case 0:case 11:case 15:pl(8,s,i);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var d=s.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:wa(s.memoizedState.cache)}if(d=s.child,d!==null)d.return=s,qn=d;else e:for(s=r;qn!==null;){d=qn;var p=d.sibling,y=d.return;if(bg(d),d===s){qn=null;break e}if(p!==null){p.return=y,qn=p;break e}qn=y}}}var p7={getCacheForType:function(r){var i=Rn(Jt),s=i.data.get(r);return s===void 0&&(s=r(),i.data.set(r,s)),s},cacheSignal:function(){return Rn(Jt).controller.signal}},g7=typeof WeakMap=="function"?WeakMap:Map,Rt=0,Kt=null,vt=null,St=0,Ut=0,Lr=null,gl=!1,Mo=!1,Oh=!1,zi=0,hn=0,yl=0,xs=0,Ih=0,Br=0,zo=0,lc=null,br=null,_h=!1,W0=0,zg=0,K0=1/0,X0=null,vl=null,On=0,xl=null,Do=null,Di=0,Lh=0,Bh=null,Dg=null,sc=0,qh=null;function qr(){return(Rt&2)!==0&&St!==0?St&-St:J.T!==null?Gh():Us()}function Rg(){if(Br===0)if((St&536870912)===0||yt){var r=Fl;Fl<<=1,(Fl&3932160)===0&&(Fl=262144),Br=r}else Br=536870912;return r=Ir.current,r!==null&&(r.flags|=32),Br}function wr(r,i,s){(r===Kt&&(Ut===2||Ut===9)||r.cancelPendingCommit!==null)&&(Ro(r,0),bl(r,St,Br,!1)),Fi(r,s),((Rt&2)===0||r!==Kt)&&(r===Kt&&((Rt&2)===0&&(xs|=s),hn===4&&bl(r,St,Br,!1)),Wa(r))}function Og(r,i,s){if((Rt&6)!==0)throw Error(a(327));var d=!s&&(i&127)===0&&(i&r.expiredLanes)===0||Ft(r,i),p=d?x7(r,i):Hh(r,i,!0),y=d;do{if(p===0){Mo&&!d&&bl(r,i,0,!1);break}else{if(s=r.current.alternate,y&&!y7(s)){p=Hh(r,i,!1),y=!1;continue}if(p===2){if(y=i,r.errorRecoveryDisabledLanes&y)var j=0;else j=r.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){i=j;e:{var R=r;p=lc;var V=R.current.memoizedState.isDehydrated;if(V&&(Ro(R,j).flags|=256),j=Hh(R,j,!1),j!==2){if(Oh&&!V){R.errorRecoveryDisabledLanes|=y,xs|=y,p=4;break e}y=br,br=p,y!==null&&(br===null?br=y:br.push.apply(br,y))}p=j}if(y=!1,p!==2)continue}}if(p===1){Ro(r,0),bl(r,i,0,!0);break}e:{switch(d=r,y=p,y){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:bl(d,i,Br,!gl);break e;case 2:br=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(p=W0+300-ht(),10<p)){if(bl(d,i,Br,!gl),sa(d,0,!0)!==0)break e;Di=i,d.timeoutHandle=d2(Ig.bind(null,d,s,br,X0,_h,i,Br,xs,zo,gl,y,"Throttled",-0,0),p);break e}Ig(d,s,br,X0,_h,i,Br,xs,zo,gl,y,null,-0,0)}}break}while(!0);Wa(r)}function Ig(r,i,s,d,p,y,j,R,V,se,ye,xe,ue,de){if(r.timeoutHandle=-1,xe=i.subtreeFlags,xe&8192||(xe&16785408)===16785408){xe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:er},Ag(i,y,xe);var Ge=(y&62914560)===y?W0-ht():(y&4194048)===y?zg-ht():0;if(Ge=tb(xe,Ge),Ge!==null){Di=y,r.cancelPendingCommit=Ge(Fg.bind(null,r,i,y,s,d,p,j,R,V,ye,xe,null,ue,de)),bl(r,y,j,!se);return}}Fg(r,i,y,s,d,p,j,R,V)}function y7(r){for(var i=r;;){var s=i.tag;if((s===0||s===11||s===15)&&i.flags&16384&&(s=i.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var d=0;d<s.length;d++){var p=s[d],y=p.getSnapshot;p=p.value;try{if(!tr(y(),p))return!1}catch{return!1}}if(s=i.child,i.subtreeFlags&16384&&s!==null)s.return=i,i=s;else{if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function bl(r,i,s,d){i&=~Ih,i&=~xs,r.suspendedLanes|=i,r.pingedLanes&=~i,d&&(r.warmLanes|=i),d=r.expirationTimes;for(var p=i;0<p;){var y=31-_t(p),j=1<<y;d[y]=-1,p&=~j}s!==0&&n0(r,s,i)}function Z0(){return(Rt&6)===0?(oc(0),!1):!0}function Uh(){if(vt!==null){if(Ut===0)var r=vt.return;else r=vt,ba=Dr=null,nh(r),N=null,$=0,r=vt;for(;r!==null;)fg(r.alternate,r),r=r.return;vt=null}}function Ro(r,i){var s=r.timeoutHandle;s!==-1&&(r.timeoutHandle=-1,L7(s)),s=r.cancelPendingCommit,s!==null&&(r.cancelPendingCommit=null,s()),Di=0,Uh(),Kt=r,vt=s=ya(r.current,null),St=i,Ut=0,Lr=null,gl=!1,Mo=Ft(r,i),Oh=!1,zo=Br=Ih=xs=yl=hn=0,br=lc=null,_h=!1,(i&8)!==0&&(i|=i&32);var d=r.entangledLanes;if(d!==0)for(r=r.entanglements,d&=i;0<d;){var p=31-_t(d),y=1<<p;i|=r[p],d&=~y}return zi=i,fo(),s}function _g(r,i){ut=null,J.H=Qu,i===Pa||i===ko?(i=x(),Ut=3):i===Fu?(i=x(),Ut=4):Ut=i===vh?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Lr=i,vt===null&&(hn=1,U0(r,nr(i,r.current)))}function Lg(){var r=Ir.current;return r===null?!0:(St&4194048)===St?ea===null:(St&62914560)===St||(St&536870912)!==0?r===ea:!1}function Bg(){var r=J.H;return J.H=Qu,r===null?Qu:r}function qg(){var r=J.A;return J.A=p7,r}function Q0(){hn=4,gl||(St&4194048)!==St&&Ir.current!==null||(Mo=!0),(yl&134217727)===0&&(xs&134217727)===0||Kt===null||bl(Kt,St,Br,!1)}function Hh(r,i,s){var d=Rt;Rt|=2;var p=Bg(),y=qg();(Kt!==r||St!==i)&&(X0=null,Ro(r,i)),i=!1;var j=hn;e:do try{if(Ut!==0&&vt!==null){var R=vt,V=Lr;switch(Ut){case 8:Uh(),j=6;break e;case 3:case 2:case 9:case 6:Ir.current===null&&(i=!0);var se=Ut;if(Ut=0,Lr=null,Oo(r,R,V,se),s&&Mo){j=0;break e}break;default:se=Ut,Ut=0,Lr=null,Oo(r,R,V,se)}}v7(),j=hn;break}catch(ye){_g(r,ye)}while(!0);return i&&r.shellSuspendCounter++,ba=Dr=null,Rt=d,J.H=p,J.A=y,vt===null&&(Kt=null,St=0,fo()),j}function v7(){for(;vt!==null;)Ug(vt)}function x7(r,i){var s=Rt;Rt|=2;var d=Bg(),p=qg();Kt!==r||St!==i?(X0=null,K0=ht()+500,Ro(r,i)):Mo=Ft(r,i);e:do try{if(Ut!==0&&vt!==null){i=vt;var y=Lr;t:switch(Ut){case 1:Ut=0,Lr=null,Oo(r,i,y,1);break;case 2:case 9:if(Pu(y)){Ut=0,Lr=null,Hg(i);break}i=function(){Ut!==2&&Ut!==9||Kt!==r||(Ut=7),Wa(r)},y.then(i,i);break e;case 3:Ut=7;break e;case 4:Ut=5;break e;case 7:Pu(y)?(Ut=0,Lr=null,Hg(i)):(Ut=0,Lr=null,Oo(r,i,y,7));break;case 5:var j=null;switch(vt.tag){case 26:j=vt.memoizedState;case 5:case 27:var R=vt;if(j?T2(j):R.stateNode.complete){Ut=0,Lr=null;var V=R.sibling;if(V!==null)vt=V;else{var se=R.return;se!==null?(vt=se,J0(se)):vt=null}break t}}Ut=0,Lr=null,Oo(r,i,y,5);break;case 6:Ut=0,Lr=null,Oo(r,i,y,6);break;case 8:Uh(),hn=6;break e;default:throw Error(a(462))}}b7();break}catch(ye){_g(r,ye)}while(!0);return ba=Dr=null,J.H=d,J.A=p,Rt=s,vt!==null?0:(Kt=null,St=0,fo(),hn)}function b7(){for(;vt!==null&&!pn();)Ug(vt)}function Ug(r){var i=cg(r.alternate,r,zi);r.memoizedProps=r.pendingProps,i===null?J0(r):vt=i}function Hg(r){var i=r,s=i.alternate;switch(i.tag){case 15:case 0:i=ag(s,i,i.pendingProps,i.type,void 0,St);break;case 11:i=ag(s,i,i.pendingProps,i.type.render,i.ref,St);break;case 5:nh(i);default:fg(s,i),i=vt=w0(i,zi),i=cg(s,i,zi)}r.memoizedProps=r.pendingProps,i===null?J0(r):vt=i}function Oo(r,i,s,d){ba=Dr=null,nh(i),N=null,$=0;var p=i.return;try{if(o7(r,p,i,s,St)){hn=1,U0(r,nr(s,r.current)),vt=null;return}}catch(y){if(p!==null)throw vt=p,y;hn=1,U0(r,nr(s,r.current)),vt=null;return}i.flags&32768?(yt||d===1?r=!0:Mo||(St&536870912)!==0?r=!1:(gl=r=!0,(d===2||d===9||d===3||d===6)&&(d=Ir.current,d!==null&&d.tag===13&&(d.flags|=16384))),$g(i,r)):J0(i)}function J0(r){var i=r;do{if((i.flags&32768)!==0){$g(i,gl);return}r=i.return;var s=d7(i.alternate,i,zi);if(s!==null){vt=s;return}if(i=i.sibling,i!==null){vt=i;return}vt=i=r}while(i!==null);hn===0&&(hn=5)}function $g(r,i){do{var s=f7(r.alternate,r);if(s!==null){s.flags&=32767,vt=s;return}if(s=r.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(r=r.sibling,r!==null)){vt=r;return}vt=r=s}while(r!==null);hn=6,vt=null}function Fg(r,i,s,d,p,y,j,R,V){r.cancelPendingCommit=null;do ed();while(On!==0);if((Rt&6)!==0)throw Error(a(327));if(i!==null){if(i===r.current)throw Error(a(177));if(y=i.lanes|i.childLanes,y|=Du,Gl(r,s,y,j,R,V),r===Kt&&(vt=Kt=null,St=0),Do=i,xl=r,Di=s,Lh=y,Bh=p,Dg=d,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,j7($e,function(){return Wg(),null})):(r.callbackNode=null,r.callbackPriority=0),d=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||d){d=J.T,J.T=null,p=Y.p,Y.p=2,j=Rt,Rt|=4;try{h7(r,i,s)}finally{Rt=j,Y.p=p,J.T=d}}On=1,Pg(),Gg(),Vg()}}function Pg(){if(On===1){On=0;var r=xl,i=Do,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=J.T,J.T=null;var d=Y.p;Y.p=2;var p=Rt;Rt|=4;try{jg(i,r);var y=Jh,j=oo(r.containerInfo),R=y.focusedElem,V=y.selectionRange;if(j!==R&&R&&R.ownerDocument&&Tu(R.ownerDocument.documentElement,R)){if(V!==null&&Au(R)){var se=V.start,ye=V.end;if(ye===void 0&&(ye=se),"selectionStart"in R)R.selectionStart=se,R.selectionEnd=Math.min(ye,R.value.length);else{var xe=R.ownerDocument||document,ue=xe&&xe.defaultView||window;if(ue.getSelection){var de=ue.getSelection(),Ge=R.textContent.length,rt=Math.min(V.start,Ge),Vt=V.end===void 0?rt:Math.min(V.end,Ge);!de.extend&&rt>Vt&&(j=Vt,Vt=rt,rt=j);var re=m0(R,rt),X=m0(R,Vt);if(re&&X&&(de.rangeCount!==1||de.anchorNode!==re.node||de.anchorOffset!==re.offset||de.focusNode!==X.node||de.focusOffset!==X.offset)){var le=xe.createRange();le.setStart(re.node,re.offset),de.removeAllRanges(),rt>Vt?(de.addRange(le),de.extend(X.node,X.offset)):(le.setEnd(X.node,X.offset),de.addRange(le))}}}}for(xe=[],de=R;de=de.parentNode;)de.nodeType===1&&xe.push({element:de,left:de.scrollLeft,top:de.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<xe.length;R++){var ve=xe[R];ve.element.scrollLeft=ve.left,ve.element.scrollTop=ve.top}}fd=!!Qh,Jh=Qh=null}finally{Rt=p,Y.p=d,J.T=s}}r.current=i,On=2}}function Gg(){if(On===2){On=0;var r=xl,i=Do,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=J.T,J.T=null;var d=Y.p;Y.p=2;var p=Rt;Rt|=4;try{xg(r,i.alternate,i)}finally{Rt=p,Y.p=d,J.T=s}}On=3}}function Vg(){if(On===4||On===3){On=0,en();var r=xl,i=Do,s=Di,d=Dg;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?On=5:(On=0,Do=xl=null,Yg(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(vl=null),cu(s),i=i.stateNode,dn&&typeof dn.onCommitFiberRoot=="function")try{dn.onCommitFiberRoot(Bt,i,void 0,(i.current.flags&128)===128)}catch{}if(d!==null){i=J.T,p=Y.p,Y.p=2,J.T=null;try{for(var y=r.onRecoverableError,j=0;j<d.length;j++){var R=d[j];y(R.value,{componentStack:R.stack})}}finally{J.T=i,Y.p=p}}(Di&3)!==0&&ed(),Wa(r),p=r.pendingLanes,(s&261930)!==0&&(p&42)!==0?r===qh?sc++:(sc=0,qh=r):sc=0,oc(0)}}function Yg(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,wa(i)))}function ed(){return Pg(),Gg(),Vg(),Wg()}function Wg(){if(On!==5)return!1;var r=xl,i=Lh;Lh=0;var s=cu(Di),d=J.T,p=Y.p;try{Y.p=32>s?32:s,J.T=null,s=Bh,Bh=null;var y=xl,j=Di;if(On=0,Do=xl=null,Di=0,(Rt&6)!==0)throw Error(a(331));var R=Rt;if(Rt|=4,Ng(y.current),Tg(y,y.current,j,s),Rt=R,oc(0,!1),dn&&typeof dn.onPostCommitFiberRoot=="function")try{dn.onPostCommitFiberRoot(Bt,y)}catch{}return!0}finally{Y.p=p,J.T=d,Yg(r,i)}}function Kg(r,i,s){i=nr(s,i),i=yh(r.stateNode,i,2),r=fl(r,i,2),r!==null&&(Fi(r,2),Wa(r))}function Ht(r,i,s){if(r.tag===3)Kg(r,r,s);else for(;i!==null;){if(i.tag===3){Kg(i,r,s);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(vl===null||!vl.has(d))){r=nr(s,r),s=X4(2),d=fl(i,s,2),d!==null&&(Z4(s,d,i,r),Fi(d,2),Wa(d));break}}i=i.return}}function $h(r,i,s){var d=r.pingCache;if(d===null){d=r.pingCache=new g7;var p=new Set;d.set(i,p)}else p=d.get(i),p===void 0&&(p=new Set,d.set(i,p));p.has(s)||(Oh=!0,p.add(s),r=w7.bind(null,r,i,s),i.then(r,r))}function w7(r,i,s){var d=r.pingCache;d!==null&&d.delete(i),r.pingedLanes|=r.suspendedLanes&s,r.warmLanes&=~s,Kt===r&&(St&s)===s&&(hn===4||hn===3&&(St&62914560)===St&&300>ht()-W0?(Rt&2)===0&&Ro(r,0):Ih|=s,zo===St&&(zo=0)),Wa(r)}function Xg(r,i){i===0&&(i=ou()),r=xi(r,i),r!==null&&(Fi(r,i),Wa(r))}function k7(r){var i=r.memoizedState,s=0;i!==null&&(s=i.retryLane),Xg(r,s)}function S7(r,i){var s=0;switch(r.tag){case 31:case 13:var d=r.stateNode,p=r.memoizedState;p!==null&&(s=p.retryLane);break;case 19:d=r.stateNode;break;case 22:d=r.stateNode._retryCache;break;default:throw Error(a(314))}d!==null&&d.delete(i),Xg(r,s)}function j7(r,i){return mt(r,i)}var td=null,Io=null,Fh=!1,nd=!1,Ph=!1,wl=0;function Wa(r){r!==Io&&r.next===null&&(Io===null?td=Io=r:Io=Io.next=r),nd=!0,Fh||(Fh=!0,T7())}function oc(r,i){if(!Ph&&nd){Ph=!0;do for(var s=!1,d=td;d!==null;){if(r!==0){var p=d.pendingLanes;if(p===0)var y=0;else{var j=d.suspendedLanes,R=d.pingedLanes;y=(1<<31-_t(42|r)+1)-1,y&=p&~(j&~R),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(s=!0,e2(d,y))}else y=St,y=sa(d,d===Kt?y:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(y&3)===0||Ft(d,y)||(s=!0,e2(d,y));d=d.next}while(s);Ph=!1}}function C7(){Zg()}function Zg(){nd=Fh=!1;var r=0;wl!==0&&_7()&&(r=wl);for(var i=ht(),s=null,d=td;d!==null;){var p=d.next,y=Qg(d,i);y===0?(d.next=null,s===null?td=p:s.next=p,p===null&&(Io=s)):(s=d,(r!==0||(y&3)!==0)&&(nd=!0)),d=p}On!==0&&On!==5||oc(r),wl!==0&&(wl=0)}function Qg(r,i){for(var s=r.suspendedLanes,d=r.pingedLanes,p=r.expirationTimes,y=r.pendingLanes&-62914561;0<y;){var j=31-_t(y),R=1<<j,V=p[j];V===-1?((R&s)===0||(R&d)!==0)&&(p[j]=Pl(R,i)):V<=i&&(r.expiredLanes|=R),y&=~R}if(i=Kt,s=St,s=sa(r,r===i?s:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d=r.callbackNode,s===0||r===i&&(Ut===2||Ut===9)||r.cancelPendingCommit!==null)return d!==null&&d!==null&&At(d),r.callbackNode=null,r.callbackPriority=0;if((s&3)===0||Ft(r,s)){if(i=s&-s,i===r.callbackPriority)return i;switch(d!==null&&At(d),cu(s)){case 2:case 8:s=Se;break;case 32:s=$e;break;case 268435456:s=kt;break;default:s=$e}return d=Jg.bind(null,r),s=mt(s,d),r.callbackPriority=i,r.callbackNode=s,i}return d!==null&&d!==null&&At(d),r.callbackPriority=2,r.callbackNode=null,2}function Jg(r,i){if(On!==0&&On!==5)return r.callbackNode=null,r.callbackPriority=0,null;var s=r.callbackNode;if(ed()&&r.callbackNode!==s)return null;var d=St;return d=sa(r,r===Kt?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d===0?null:(Og(r,d,i),Qg(r,ht()),r.callbackNode!=null&&r.callbackNode===s?Jg.bind(null,r):null)}function e2(r,i){if(ed())return null;Og(r,i,!0)}function T7(){B7(function(){(Rt&6)!==0?mt(me,C7):Zg()})}function Gh(){if(wl===0){var r=dl;r===0&&(r=$l,$l<<=1,($l&261888)===0&&($l=256)),wl=r}return wl}function t2(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:Wi(""+r)}function n2(r,i){var s=i.ownerDocument.createElement("input");return s.name=i.name,s.value=i.value,r.id&&s.setAttribute("form",r.id),i.parentNode.insertBefore(s,i),r=new FormData(r),s.parentNode.removeChild(s),r}function A7(r,i,s,d,p){if(i==="submit"&&s&&s.stateNode===p){var y=t2((p[gn]||null).action),j=d.submitter;j&&(i=(i=j[gn]||null)?t2(i.formAction):j.getAttribute("formAction"),i!==null&&(y=i,j=null));var R=new Xi("action","action",null,d,p);r.push({event:R,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(wl!==0){var V=j?n2(p,j):new FormData(p);dh(s,{pending:!0,data:V,method:p.method,action:y},null,V)}}else typeof y=="function"&&(R.preventDefault(),V=j?n2(p,j):new FormData(p),dh(s,{pending:!0,data:V,method:p.method,action:y},y,V))},currentTarget:p}]})}}for(var Vh=0;Vh<zu.length;Vh++){var Yh=zu[Vh],E7=Yh.toLowerCase(),N7=Yh[0].toUpperCase()+Yh.slice(1);Mr(E7,"on"+N7)}Mr(p0,"onAnimationEnd"),Mr(Mu,"onAnimationIteration"),Mr(g0,"onAnimationStart"),Mr("dblclick","onDoubleClick"),Mr("focusin","onFocus"),Mr("focusout","onBlur"),Mr($f,"onTransitionRun"),Mr(Ff,"onTransitionStart"),Mr(Pf,"onTransitionCancel"),Mr(y0,"onTransitionEnd"),Gi("onMouseEnter",["mouseout","mouseover"]),Gi("onMouseLeave",["mouseout","mouseover"]),Gi("onPointerEnter",["pointerout","pointerover"]),Gi("onPointerLeave",["pointerout","pointerover"]),Ma("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ma("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ma("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ma("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ma("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ma("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var uc="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(" "),M7=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(uc));function r2(r,i){i=(i&4)!==0;for(var s=0;s<r.length;s++){var d=r[s],p=d.event;d=d.listeners;e:{var y=void 0;if(i)for(var j=d.length-1;0<=j;j--){var R=d[j],V=R.instance,se=R.currentTarget;if(R=R.listener,V!==y&&p.isPropagationStopped())break e;y=R,p.currentTarget=se;try{y(p)}catch(ye){co(ye)}p.currentTarget=null,y=V}else for(j=0;j<d.length;j++){if(R=d[j],V=R.instance,se=R.currentTarget,R=R.listener,V!==y&&p.isPropagationStopped())break e;y=R,p.currentTarget=se;try{y(p)}catch(ye){co(ye)}p.currentTarget=null,y=V}}}}function xt(r,i){var s=i[Aa];s===void 0&&(s=i[Aa]=new Set);var d=r+"__bubble";s.has(d)||(a2(i,r,2,!1),s.add(d))}function Wh(r,i,s){var d=0;i&&(d|=4),a2(s,r,d,i)}var rd="_reactListening"+Math.random().toString(36).slice(2);function Kh(r){if(!r[rd]){r[rd]=!0,ua.forEach(function(s){s!=="selectionchange"&&(M7.has(s)||Wh(s,!1,r),Wh(s,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[rd]||(i[rd]=!0,Wh("selectionchange",!1,i))}}function a2(r,i,s,d){switch(R2(i)){case 2:var p=ab;break;case 8:p=ib;break;default:p=cm}s=p.bind(null,i,s,r),p=void 0,!yu||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(p=!0),d?p!==void 0?r.addEventListener(i,s,{capture:!0,passive:p}):r.addEventListener(i,s,!0):p!==void 0?r.addEventListener(i,s,{passive:p}):r.addEventListener(i,s,!1)}function Xh(r,i,s,d,p){var y=d;if((i&1)===0&&(i&2)===0&&d!==null)e:for(;;){if(d===null)return;var j=d.tag;if(j===3||j===4){var R=d.stateNode.containerInfo;if(R===p)break;if(j===4)for(j=d.return;j!==null;){var V=j.tag;if((V===3||V===4)&&j.stateNode.containerInfo===p)return;j=j.return}for(;R!==null;){if(j=Ea(R),j===null)return;if(V=j.tag,V===5||V===6||V===26||V===27){d=y=j;continue e}R=R.parentNode}}d=d.return}gu(function(){var se=y,ye=Xl(s),xe=[];e:{var ue=v0.get(r);if(ue!==void 0){var de=Xi,Ge=r;switch(r){case"keypress":if(Ki(s)===0)break e;case"keydown":case"keyup":de=eo;break;case"focusin":Ge="focus",de=Ia;break;case"focusout":Ge="blur",de=Ia;break;case"beforeblur":case"afterblur":de=Ia;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":de=Qi;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":de=Ks;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":de=vn;break;case p0:case Mu:case g0:de=_a;break;case y0:de=di;break;case"scroll":case"scrollend":de=xu;break;case"wheel":de=Nt;break;case"copy":case"cut":case"paste":de=hr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":de=wu;break;case"toggle":case"beforetoggle":de=no}var rt=(i&4)!==0,Vt=!rt&&(r==="scroll"||r==="scrollend"),re=rt?ue!==null?ue+"Capture":null:ue;rt=[];for(var X=se,le;X!==null;){var ve=X;if(le=ve.stateNode,ve=ve.tag,ve!==5&&ve!==26&&ve!==27||le===null||re===null||(ve=Ql(X,re),ve!=null&&rt.push(cc(X,ve,le))),Vt)break;X=X.return}0<rt.length&&(ue=new de(ue,Ge,null,s,ye),xe.push({event:ue,listeners:rt}))}}if((i&7)===0){e:{if(ue=r==="mouseover"||r==="pointerover",de=r==="mouseout"||r==="pointerout",ue&&s!==oi&&(Ge=s.relatedTarget||s.fromElement)&&(Ea(Ge)||Ge[Ar]))break e;if((de||ue)&&(ue=ye.window===ye?ye:(ue=ye.ownerDocument)?ue.defaultView||ue.parentWindow:window,de?(Ge=s.relatedTarget||s.toElement,de=se,Ge=Ge?Ea(Ge):null,Ge!==null&&(Vt=o(Ge),rt=Ge.tag,Ge!==Vt||rt!==5&&rt!==27&&rt!==6)&&(Ge=null)):(de=null,Ge=se),de!==Ge)){if(rt=Qi,ve="onMouseLeave",re="onMouseEnter",X="mouse",(r==="pointerout"||r==="pointerover")&&(rt=wu,ve="onPointerLeave",re="onPointerEnter",X="pointer"),Vt=de==null?ue:ii(de),le=Ge==null?ue:ii(Ge),ue=new rt(ve,X+"leave",de,s,ye),ue.target=Vt,ue.relatedTarget=le,ve=null,Ea(ye)===se&&(rt=new rt(re,X+"enter",Ge,s,ye),rt.target=le,rt.relatedTarget=Vt,ve=rt),Vt=ve,de&&Ge)t:{for(rt=z7,re=de,X=Ge,le=0,ve=re;ve;ve=rt(ve))le++;ve=0;for(var Qe=X;Qe;Qe=rt(Qe))ve++;for(;0<le-ve;)re=rt(re),le--;for(;0<ve-le;)X=rt(X),ve--;for(;le--;){if(re===X||X!==null&&re===X.alternate){rt=re;break t}re=rt(re),X=rt(X)}rt=null}else rt=null;de!==null&&i2(xe,ue,de,rt,!1),Ge!==null&&Vt!==null&&i2(xe,Vt,Ge,rt,!0)}}e:{if(ue=se?ii(se):window,de=ue.nodeName&&ue.nodeName.toLowerCase(),de==="select"||de==="input"&&ue.type==="file")var zt=f0;else if(io(ue))if(so)zt=Uf;else{zt=ju;var Ye=h0}else de=ue.nodeName,!de||de.toLowerCase()!=="input"||ue.type!=="checkbox"&&ue.type!=="radio"?se&&si(se.elementType)&&(zt=f0):zt=Cu;if(zt&&(zt=zt(r,se))){is(xe,zt,s,ye);break e}Ye&&Ye(r,ue,se),r==="focusout"&&se&&ue.type==="number"&&se.memoizedProps.value!=null&&Vs(ue,"number",ue.value)}switch(Ye=se?ii(se):window,r){case"focusin":(io(Ye)||Ye.contentEditable==="true")&&(ga=Ye,cs=se,gi=null);break;case"focusout":gi=cs=ga=null;break;case"mousedown":Eu=!0;break;case"contextmenu":case"mouseup":case"dragend":Eu=!1,uo(xe,s,ye);break;case"selectionchange":if(Hf)break;case"keydown":case"keyup":uo(xe,s,ye)}var dt;if(fi)e:{switch(r){case"compositionstart":var jt="onCompositionStart";break e;case"compositionend":jt="onCompositionEnd";break e;case"compositionupdate":jt="onCompositionUpdate";break e}jt=void 0}else La?Su(r,s)&&(jt="onCompositionEnd"):r==="keydown"&&s.keyCode===229&&(jt="onCompositionStart");jt&&(u0&&s.locale!=="ko"&&(La||jt!=="onCompositionStart"?jt==="onCompositionEnd"&&La&&(dt=vu()):(Da=ye,Ys="value"in Da?Da.value:Da.textContent,La=!0)),Ye=ad(se,jt),0<Ye.length&&(jt=new tl(jt,r,null,s,ye),xe.push({event:jt,listeners:Ye}),dt?jt.data=dt:(dt=ro(s),dt!==null&&(jt.data=dt)))),(dt=mi?ao(r,s):Bf(r,s))&&(jt=ad(se,"onBeforeInput"),0<jt.length&&(Ye=new tl("onBeforeInput","beforeinput",null,s,ye),xe.push({event:Ye,listeners:jt}),Ye.data=dt)),A7(xe,r,se,s,ye)}r2(xe,i)})}function cc(r,i,s){return{instance:r,listener:i,currentTarget:s}}function ad(r,i){for(var s=i+"Capture",d=[];r!==null;){var p=r,y=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||y===null||(p=Ql(r,s),p!=null&&d.unshift(cc(r,p,y)),p=Ql(r,i),p!=null&&d.push(cc(r,p,y))),r.tag===3)return d;r=r.return}return[]}function z7(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function i2(r,i,s,d,p){for(var y=i._reactName,j=[];s!==null&&s!==d;){var R=s,V=R.alternate,se=R.stateNode;if(R=R.tag,V!==null&&V===d)break;R!==5&&R!==26&&R!==27||se===null||(V=se,p?(se=Ql(s,y),se!=null&&j.unshift(cc(s,se,V))):p||(se=Ql(s,y),se!=null&&j.push(cc(s,se,V)))),s=s.return}j.length!==0&&r.push({event:i,listeners:j})}var D7=/\r\n?/g,R7=/\u0000|\uFFFD/g;function l2(r){return(typeof r=="string"?r:""+r).replace(D7,`
|
|
50
|
-
`).replace(R7,"")}function s2(r,i){return i=l2(i),l2(r)===i}function Gt(r,i,s,d,p,y){switch(s){case"children":typeof d=="string"?i==="body"||i==="textarea"&&d===""||Er(r,d):(typeof d=="number"||typeof d=="bigint")&&i!=="body"&&Er(r,""+d);break;case"className":Wl(r,"class",d);break;case"tabIndex":Wl(r,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":Wl(r,s,d);break;case"style":pu(r,d,y);break;case"data":if(i!=="object"){Wl(r,"data",d);break}case"src":case"href":if(d===""&&(i!=="a"||s!=="href")){r.removeAttribute(s);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(s);break}d=Wi(""+d),r.setAttribute(s,d);break;case"action":case"formAction":if(typeof d=="function"){r.setAttribute(s,"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 y=="function"&&(s==="formAction"?(i!=="input"&&Gt(r,i,"name",p.name,p,null),Gt(r,i,"formEncType",p.formEncType,p,null),Gt(r,i,"formMethod",p.formMethod,p,null),Gt(r,i,"formTarget",p.formTarget,p,null)):(Gt(r,i,"encType",p.encType,p,null),Gt(r,i,"method",p.method,p,null),Gt(r,i,"target",p.target,p,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(s);break}d=Wi(""+d),r.setAttribute(s,d);break;case"onClick":d!=null&&(r.onclick=er);break;case"onScroll":d!=null&&xt("scroll",r);break;case"onScrollEnd":d!=null&&xt("scrollend",r);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(s=d.__html,s!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=s}}break;case"multiple":r.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":r.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){r.removeAttribute("xlink:href");break}s=Wi(""+d),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(s,""+d):r.removeAttribute(s);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":d&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(s,""):r.removeAttribute(s);break;case"capture":case"download":d===!0?r.setAttribute(s,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(s,d):r.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?r.setAttribute(s,d):r.removeAttribute(s);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?r.removeAttribute(s):r.setAttribute(s,d);break;case"popover":xt("beforetoggle",r),xt("toggle",r),Ps(r,"popover",d);break;case"xlinkActuate":Ln(r,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":Ln(r,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":Ln(r,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":Ln(r,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":Ln(r,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":Ln(r,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":Ln(r,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":Ln(r,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":Ln(r,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":Ps(r,"is",d);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=Wr.get(s)||s,Ps(r,s,d))}}function Zh(r,i,s,d,p,y){switch(s){case"style":pu(r,d,y);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(s=d.__html,s!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=s}}break;case"children":typeof d=="string"?Er(r,d):(typeof d=="number"||typeof d=="bigint")&&Er(r,""+d);break;case"onScroll":d!=null&&xt("scroll",r);break;case"onScrollEnd":d!=null&&xt("scrollend",r);break;case"onClick":d!=null&&(r.onclick=er);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!$s.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(p=s.endsWith("Capture"),i=s.slice(2,p?s.length-7:void 0),y=r[gn]||null,y=y!=null?y[s]:null,typeof y=="function"&&r.removeEventListener(i,y,p),typeof d=="function")){typeof y!="function"&&y!==null&&(s in r?r[s]=null:r.hasAttribute(s)&&r.removeAttribute(s)),r.addEventListener(i,d,p);break e}s in r?r[s]=d:d===!0?r.setAttribute(s,""):Ps(r,s,d)}}}function Pn(r,i,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":xt("error",r),xt("load",r);var d=!1,p=!1,y;for(y in s)if(s.hasOwnProperty(y)){var j=s[y];if(j!=null)switch(y){case"src":d=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Gt(r,i,y,j,s,null)}}p&&Gt(r,i,"srcSet",s.srcSet,s,null),d&&Gt(r,i,"src",s.src,s,null);return;case"input":xt("invalid",r);var R=y=j=p=null,V=null,se=null;for(d in s)if(s.hasOwnProperty(d)){var ye=s[d];if(ye!=null)switch(d){case"name":p=ye;break;case"type":j=ye;break;case"checked":V=ye;break;case"defaultChecked":se=ye;break;case"value":y=ye;break;case"defaultValue":R=ye;break;case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(a(137,i));break;default:Gt(r,i,d,ye,s,null)}}Vi(r,y,R,V,se,j,p,!1);return;case"select":xt("invalid",r),d=j=y=null;for(p in s)if(s.hasOwnProperty(p)&&(R=s[p],R!=null))switch(p){case"value":y=R;break;case"defaultValue":j=R;break;case"multiple":d=R;default:Gt(r,i,p,R,s,null)}i=y,s=j,r.multiple=!!d,i!=null?da(r,!!d,i,!1):s!=null&&da(r,!!d,s,!0);return;case"textarea":xt("invalid",r),y=p=d=null;for(j in s)if(s.hasOwnProperty(j)&&(R=s[j],R!=null))switch(j){case"value":d=R;break;case"defaultValue":p=R;break;case"children":y=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(a(91));break;default:Gt(r,i,j,R,s,null)}Yi(r,d,p,y);return;case"option":for(V in s)if(s.hasOwnProperty(V)&&(d=s[V],d!=null))switch(V){case"selected":r.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:Gt(r,i,V,d,s,null)}return;case"dialog":xt("beforetoggle",r),xt("toggle",r),xt("cancel",r),xt("close",r);break;case"iframe":case"object":xt("load",r);break;case"video":case"audio":for(d=0;d<uc.length;d++)xt(uc[d],r);break;case"image":xt("error",r),xt("load",r);break;case"details":xt("toggle",r);break;case"embed":case"source":case"link":xt("error",r),xt("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(se in s)if(s.hasOwnProperty(se)&&(d=s[se],d!=null))switch(se){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Gt(r,i,se,d,s,null)}return;default:if(si(i)){for(ye in s)s.hasOwnProperty(ye)&&(d=s[ye],d!==void 0&&Zh(r,i,ye,d,s,void 0));return}}for(R in s)s.hasOwnProperty(R)&&(d=s[R],d!=null&&Gt(r,i,R,d,s,null))}function O7(r,i,s,d){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,y=null,j=null,R=null,V=null,se=null,ye=null;for(de in s){var xe=s[de];if(s.hasOwnProperty(de)&&xe!=null)switch(de){case"checked":break;case"value":break;case"defaultValue":V=xe;default:d.hasOwnProperty(de)||Gt(r,i,de,null,d,xe)}}for(var ue in d){var de=d[ue];if(xe=s[ue],d.hasOwnProperty(ue)&&(de!=null||xe!=null))switch(ue){case"type":y=de;break;case"name":p=de;break;case"checked":se=de;break;case"defaultChecked":ye=de;break;case"value":j=de;break;case"defaultValue":R=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(a(137,i));break;default:de!==xe&&Gt(r,i,ue,de,d,xe)}}Gs(r,j,R,V,se,ye,y,p);return;case"select":de=j=R=ue=null;for(y in s)if(V=s[y],s.hasOwnProperty(y)&&V!=null)switch(y){case"value":break;case"multiple":de=V;default:d.hasOwnProperty(y)||Gt(r,i,y,null,d,V)}for(p in d)if(y=d[p],V=s[p],d.hasOwnProperty(p)&&(y!=null||V!=null))switch(p){case"value":ue=y;break;case"defaultValue":R=y;break;case"multiple":j=y;default:y!==V&&Gt(r,i,p,y,d,V)}i=R,s=j,d=de,ue!=null?da(r,!!s,ue,!1):!!d!=!!s&&(i!=null?da(r,!!s,i,!0):da(r,!!s,s?[]:"",!1));return;case"textarea":de=ue=null;for(R in s)if(p=s[R],s.hasOwnProperty(R)&&p!=null&&!d.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:Gt(r,i,R,null,d,p)}for(j in d)if(p=d[j],y=s[j],d.hasOwnProperty(j)&&(p!=null||y!=null))switch(j){case"value":ue=p;break;case"defaultValue":de=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==y&&Gt(r,i,j,p,d,y)}s0(r,ue,de);return;case"option":for(var Ge in s)if(ue=s[Ge],s.hasOwnProperty(Ge)&&ue!=null&&!d.hasOwnProperty(Ge))switch(Ge){case"selected":r.selected=!1;break;default:Gt(r,i,Ge,null,d,ue)}for(V in d)if(ue=d[V],de=s[V],d.hasOwnProperty(V)&&ue!==de&&(ue!=null||de!=null))switch(V){case"selected":r.selected=ue&&typeof ue!="function"&&typeof ue!="symbol";break;default:Gt(r,i,V,ue,d,de)}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 rt in s)ue=s[rt],s.hasOwnProperty(rt)&&ue!=null&&!d.hasOwnProperty(rt)&&Gt(r,i,rt,null,d,ue);for(se in d)if(ue=d[se],de=s[se],d.hasOwnProperty(se)&&ue!==de&&(ue!=null||de!=null))switch(se){case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(a(137,i));break;default:Gt(r,i,se,ue,d,de)}return;default:if(si(i)){for(var Vt in s)ue=s[Vt],s.hasOwnProperty(Vt)&&ue!==void 0&&!d.hasOwnProperty(Vt)&&Zh(r,i,Vt,void 0,d,ue);for(ye in d)ue=d[ye],de=s[ye],!d.hasOwnProperty(ye)||ue===de||ue===void 0&&de===void 0||Zh(r,i,ye,ue,d,de);return}}for(var re in s)ue=s[re],s.hasOwnProperty(re)&&ue!=null&&!d.hasOwnProperty(re)&&Gt(r,i,re,null,d,ue);for(xe in d)ue=d[xe],de=s[xe],!d.hasOwnProperty(xe)||ue===de||ue==null&&de==null||Gt(r,i,xe,ue,d,de)}function o2(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function I7(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,s=performance.getEntriesByType("resource"),d=0;d<s.length;d++){var p=s[d],y=p.transferSize,j=p.initiatorType,R=p.duration;if(y&&R&&o2(j)){for(j=0,R=p.responseEnd,d+=1;d<s.length;d++){var V=s[d],se=V.startTime;if(se>R)break;var ye=V.transferSize,xe=V.initiatorType;ye&&o2(xe)&&(V=V.responseEnd,j+=ye*(V<R?1:(R-se)/(V-se)))}if(--d,i+=8*(y+j)/(p.duration/1e3),r++,10<r)break}}if(0<r)return i/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var Qh=null,Jh=null;function id(r){return r.nodeType===9?r:r.ownerDocument}function u2(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function c2(r,i){if(r===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&i==="foreignObject"?0:r}function em(r,i){return r==="textarea"||r==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var tm=null;function _7(){var r=window.event;return r&&r.type==="popstate"?r===tm?!1:(tm=r,!0):(tm=null,!1)}var d2=typeof setTimeout=="function"?setTimeout:void 0,L7=typeof clearTimeout=="function"?clearTimeout:void 0,f2=typeof Promise=="function"?Promise:void 0,B7=typeof queueMicrotask=="function"?queueMicrotask:typeof f2<"u"?function(r){return f2.resolve(null).then(r).catch(q7)}:d2;function q7(r){setTimeout(function(){throw r})}function kl(r){return r==="head"}function h2(r,i){var s=i,d=0;do{var p=s.nextSibling;if(r.removeChild(s),p&&p.nodeType===8)if(s=p.data,s==="/$"||s==="/&"){if(d===0){r.removeChild(p),qo(i);return}d--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")d++;else if(s==="html")dc(r.ownerDocument.documentElement);else if(s==="head"){s=r.ownerDocument.head,dc(s);for(var y=s.firstChild;y;){var j=y.nextSibling,R=y.nodeName;y[oa]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&y.rel.toLowerCase()==="stylesheet"||s.removeChild(y),y=j}}else s==="body"&&dc(r.ownerDocument.body);s=p}while(s);qo(i)}function m2(r,i){var s=r;r=0;do{var d=s.nextSibling;if(s.nodeType===1?i?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(i?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),d&&d.nodeType===8)if(s=d.data,s==="/$"){if(r===0)break;r--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||r++;s=d}while(s)}function nm(r){var i=r.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var s=i;switch(i=i.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":nm(s),Vl(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}r.removeChild(s)}}function U7(r,i,s,d){for(;r.nodeType===1;){var p=s;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!d&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(d){if(!r[oa])switch(i){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(y=r.getAttribute("rel"),y==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(y!==p.rel||r.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||r.getAttribute("title")!==(p.title==null?null:p.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(y=r.getAttribute("src"),(y!==(p.src==null?null:p.src)||r.getAttribute("type")!==(p.type==null?null:p.type)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&y&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(i==="input"&&r.type==="hidden"){var y=p.name==null?null:""+p.name;if(p.type==="hidden"&&r.getAttribute("name")===y)return r}else return r;if(r=ta(r.nextSibling),r===null)break}return null}function H7(r,i,s){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!s||(r=ta(r.nextSibling),r===null))return null;return r}function p2(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=ta(r.nextSibling),r===null))return null;return r}function rm(r){return r.data==="$?"||r.data==="$~"}function am(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function $7(r,i){var s=r.ownerDocument;if(r.data==="$~")r._reactRetry=i;else if(r.data!=="$?"||s.readyState!=="loading")i();else{var d=function(){i(),s.removeEventListener("DOMContentLoaded",d)};s.addEventListener("DOMContentLoaded",d),r._reactRetry=d}}function ta(r){for(;r!=null;r=r.nextSibling){var i=r.nodeType;if(i===1||i===3)break;if(i===8){if(i=r.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return r}var im=null;function g2(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var s=r.data;if(s==="/$"||s==="/&"){if(i===0)return ta(r.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}r=r.nextSibling}return null}function y2(r){r=r.previousSibling;for(var i=0;r;){if(r.nodeType===8){var s=r.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(i===0)return r;i--}else s!=="/$"&&s!=="/&"||i++}r=r.previousSibling}return null}function v2(r,i,s){switch(i=id(s),r){case"html":if(r=i.documentElement,!r)throw Error(a(452));return r;case"head":if(r=i.head,!r)throw Error(a(453));return r;case"body":if(r=i.body,!r)throw Error(a(454));return r;default:throw Error(a(451))}}function dc(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);Vl(r)}var na=new Map,x2=new Set;function ld(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var Ri=Y.d;Y.d={f:F7,r:P7,D:G7,C:V7,L:Y7,m:W7,X:X7,S:K7,M:Z7};function F7(){var r=Ri.f(),i=Z0();return r||i}function P7(r){var i=Na(r);i!==null&&i.tag===5&&i.type==="form"?_4(i):Ri.r(r)}var _o=typeof document>"u"?null:document;function b2(r,i,s){var d=_o;if(d&&typeof i=="string"&&i){var p=Sn(i);p='link[rel="'+r+'"][href="'+p+'"]',typeof s=="string"&&(p+='[crossorigin="'+s+'"]'),x2.has(p)||(x2.add(p),r={rel:r,crossOrigin:s,href:i},d.querySelector(p)===null&&(i=d.createElement("link"),Pn(i,"link",r),yn(i),d.head.appendChild(i)))}}function G7(r){Ri.D(r),b2("dns-prefetch",r,null)}function V7(r,i){Ri.C(r,i),b2("preconnect",r,i)}function Y7(r,i,s){Ri.L(r,i,s);var d=_o;if(d&&r&&i){var p='link[rel="preload"][as="'+Sn(i)+'"]';i==="image"&&s&&s.imageSrcSet?(p+='[imagesrcset="'+Sn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(p+='[imagesizes="'+Sn(s.imageSizes)+'"]')):p+='[href="'+Sn(r)+'"]';var y=p;switch(i){case"style":y=Lo(r);break;case"script":y=Bo(r)}na.has(y)||(r=v({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:r,as:i},s),na.set(y,r),d.querySelector(p)!==null||i==="style"&&d.querySelector(fc(y))||i==="script"&&d.querySelector(hc(y))||(i=d.createElement("link"),Pn(i,"link",r),yn(i),d.head.appendChild(i)))}}function W7(r,i){Ri.m(r,i);var s=_o;if(s&&r){var d=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+Sn(d)+'"][href="'+Sn(r)+'"]',y=p;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=Bo(r)}if(!na.has(y)&&(r=v({rel:"modulepreload",href:r},i),na.set(y,r),s.querySelector(p)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(hc(y)))return}d=s.createElement("link"),Pn(d,"link",r),yn(d),s.head.appendChild(d)}}}function K7(r,i,s){Ri.S(r,i,s);var d=_o;if(d&&r){var p=Pi(d).hoistableStyles,y=Lo(r);i=i||"default";var j=p.get(y);if(!j){var R={loading:0,preload:null};if(j=d.querySelector(fc(y)))R.loading=5;else{r=v({rel:"stylesheet",href:r,"data-precedence":i},s),(s=na.get(y))&&lm(r,s);var V=j=d.createElement("link");yn(V),Pn(V,"link",r),V._p=new Promise(function(se,ye){V.onload=se,V.onerror=ye}),V.addEventListener("load",function(){R.loading|=1}),V.addEventListener("error",function(){R.loading|=2}),R.loading|=4,sd(j,i,d)}j={type:"stylesheet",instance:j,count:1,state:R},p.set(y,j)}}}function X7(r,i){Ri.X(r,i);var s=_o;if(s&&r){var d=Pi(s).hoistableScripts,p=Bo(r),y=d.get(p);y||(y=s.querySelector(hc(p)),y||(r=v({src:r,async:!0},i),(i=na.get(p))&&sm(r,i),y=s.createElement("script"),yn(y),Pn(y,"link",r),s.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},d.set(p,y))}}function Z7(r,i){Ri.M(r,i);var s=_o;if(s&&r){var d=Pi(s).hoistableScripts,p=Bo(r),y=d.get(p);y||(y=s.querySelector(hc(p)),y||(r=v({src:r,async:!0,type:"module"},i),(i=na.get(p))&&sm(r,i),y=s.createElement("script"),yn(y),Pn(y,"link",r),s.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},d.set(p,y))}}function w2(r,i,s,d){var p=(p=ne.current)?ld(p):null;if(!p)throw Error(a(446));switch(r){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(i=Lo(s.href),s=Pi(p).hoistableStyles,d=s.get(i),d||(d={type:"style",instance:null,count:0,state:null},s.set(i,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){r=Lo(s.href);var y=Pi(p).hoistableStyles,j=y.get(r);if(j||(p=p.ownerDocument||p,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(r,j),(y=p.querySelector(fc(r)))&&!y._p&&(j.instance=y,j.state.loading=5),na.has(r)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},na.set(r,s),y||Q7(p,r,s,j.state))),i&&d===null)throw Error(a(528,""));return j}if(i&&d!==null)throw Error(a(529,""));return null;case"script":return i=s.async,s=s.src,typeof s=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=Bo(s),s=Pi(p).hoistableScripts,d=s.get(i),d||(d={type:"script",instance:null,count:0,state:null},s.set(i,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function Lo(r){return'href="'+Sn(r)+'"'}function fc(r){return'link[rel="stylesheet"]['+r+"]"}function k2(r){return v({},r,{"data-precedence":r.precedence,precedence:null})}function Q7(r,i,s,d){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?d.loading=1:(i=r.createElement("link"),d.preload=i,i.addEventListener("load",function(){return d.loading|=1}),i.addEventListener("error",function(){return d.loading|=2}),Pn(i,"link",s),yn(i),r.head.appendChild(i))}function Bo(r){return'[src="'+Sn(r)+'"]'}function hc(r){return"script[async]"+r}function S2(r,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var d=r.querySelector('style[data-href~="'+Sn(s.href)+'"]');if(d)return i.instance=d,yn(d),d;var p=v({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return d=(r.ownerDocument||r).createElement("style"),yn(d),Pn(d,"style",p),sd(d,s.precedence,r),i.instance=d;case"stylesheet":p=Lo(s.href);var y=r.querySelector(fc(p));if(y)return i.state.loading|=4,i.instance=y,yn(y),y;d=k2(s),(p=na.get(p))&&lm(d,p),y=(r.ownerDocument||r).createElement("link"),yn(y);var j=y;return j._p=new Promise(function(R,V){j.onload=R,j.onerror=V}),Pn(y,"link",d),i.state.loading|=4,sd(y,s.precedence,r),i.instance=y;case"script":return y=Bo(s.src),(p=r.querySelector(hc(y)))?(i.instance=p,yn(p),p):(d=s,(p=na.get(y))&&(d=v({},s),sm(d,p)),r=r.ownerDocument||r,p=r.createElement("script"),yn(p),Pn(p,"link",d),r.head.appendChild(p),i.instance=p);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(d=i.instance,i.state.loading|=4,sd(d,s.precedence,r));return i.instance}function sd(r,i,s){for(var d=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=d.length?d[d.length-1]:null,y=p,j=0;j<d.length;j++){var R=d[j];if(R.dataset.precedence===i)y=R;else if(y!==p)break}y?y.parentNode.insertBefore(r,y.nextSibling):(i=s.nodeType===9?s.head:s,i.insertBefore(r,i.firstChild))}function lm(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function sm(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var od=null;function j2(r,i,s){if(od===null){var d=new Map,p=od=new Map;p.set(s,d)}else p=od,d=p.get(s),d||(d=new Map,p.set(s,d));if(d.has(r))return d;for(d.set(r,null),s=s.getElementsByTagName(r),p=0;p<s.length;p++){var y=s[p];if(!(y[oa]||y[rn]||r==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var j=y.getAttribute(i)||"";j=r+j;var R=d.get(j);R?R.push(y):d.set(j,[y])}}return d}function C2(r,i,s){r=r.ownerDocument||r,r.head.insertBefore(s,i==="title"?r.querySelector("head > title"):null)}function J7(r,i,s){if(s===1||i.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return r=i.disabled,typeof i.precedence=="string"&&r==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function T2(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function eb(r,i,s,d){if(s.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var p=Lo(d.href),y=i.querySelector(fc(p));if(y){i=y._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=ud.bind(r),i.then(r,r)),s.state.loading|=4,s.instance=y,yn(y);return}y=i.ownerDocument||i,d=k2(d),(p=na.get(p))&&lm(d,p),y=y.createElement("link"),yn(y);var j=y;j._p=new Promise(function(R,V){j.onload=R,j.onerror=V}),Pn(y,"link",d),s.instance=y}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(s,i),(i=s.state.preload)&&(s.state.loading&3)===0&&(r.count++,s=ud.bind(r),i.addEventListener("load",s),i.addEventListener("error",s))}}var om=0;function tb(r,i){return r.stylesheets&&r.count===0&&dd(r,r.stylesheets),0<r.count||0<r.imgCount?function(s){var d=setTimeout(function(){if(r.stylesheets&&dd(r,r.stylesheets),r.unsuspend){var y=r.unsuspend;r.unsuspend=null,y()}},6e4+i);0<r.imgBytes&&om===0&&(om=62500*I7());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&dd(r,r.stylesheets),r.unsuspend)){var y=r.unsuspend;r.unsuspend=null,y()}},(r.imgBytes>om?50:800)+i);return r.unsuspend=s,function(){r.unsuspend=null,clearTimeout(d),clearTimeout(p)}}:null}function ud(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)dd(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var cd=null;function dd(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,cd=new Map,i.forEach(nb,r),cd=null,ud.call(r))}function nb(r,i){if(!(i.state.loading&4)){var s=cd.get(r);if(s)var d=s.get(null);else{s=new Map,cd.set(r,s);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<p.length;y++){var j=p[y];(j.nodeName==="LINK"||j.getAttribute("media")!=="not all")&&(s.set(j.dataset.precedence,j),d=j)}d&&s.set(null,d)}p=i.instance,j=p.getAttribute("data-precedence"),y=s.get(j)||d,y===d&&s.set(null,p),s.set(j,p),this.count++,d=ud.bind(this),p.addEventListener("load",d),p.addEventListener("error",d),y?y.parentNode.insertBefore(p,y.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(p,r.firstChild)),i.state.loading|=4}}var mc={$$typeof:B,Provider:null,Consumer:null,_currentValue:ge,_currentValue2:ge,_threadCount:0};function rb(r,i,s,d,p,y,j,R,V){this.tag=1,this.containerInfo=r,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=ai(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ai(0),this.hiddenUpdates=ai(null),this.identifierPrefix=d,this.onUncaughtError=p,this.onCaughtError=y,this.onRecoverableError=j,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=V,this.incompleteTransitions=new Map}function A2(r,i,s,d,p,y,j,R,V,se,ye,xe){return r=new rb(r,i,s,j,V,se,ye,xe,R),i=1,y===!0&&(i|=24),y=tn(3,null,null,i),r.current=y,y.stateNode=r,i=ki(),i.refCount++,r.pooledCache=i,i.refCount++,y.memoizedState={element:d,isDehydrated:s,cache:i},qt(y),r}function E2(r){return r?(r=sl,r):sl}function N2(r,i,s,d,p,y){p=E2(p),d.context===null?d.context=p:d.pendingContext=p,d=ka(i),d.payload={element:s},y=y===void 0?null:y,y!==null&&(d.callback=y),s=fl(r,d,i),s!==null&&(wr(s,r,i),Vu(s,r,i))}function M2(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var s=r.retryLane;r.retryLane=s!==0&&s<i?s:i}}function um(r,i){M2(r,i),(r=r.alternate)&&M2(r,i)}function z2(r){if(r.tag===13||r.tag===31){var i=xi(r,67108864);i!==null&&wr(i,r,67108864),um(r,67108864)}}function D2(r){if(r.tag===13||r.tag===31){var i=qr();i=qs(i);var s=xi(r,i);s!==null&&wr(s,r,i),um(r,i)}}var fd=!0;function ab(r,i,s,d){var p=J.T;J.T=null;var y=Y.p;try{Y.p=2,cm(r,i,s,d)}finally{Y.p=y,J.T=p}}function ib(r,i,s,d){var p=J.T;J.T=null;var y=Y.p;try{Y.p=8,cm(r,i,s,d)}finally{Y.p=y,J.T=p}}function cm(r,i,s,d){if(fd){var p=dm(d);if(p===null)Xh(r,i,d,hd,s),O2(r,d);else if(sb(p,r,i,s,d))d.stopPropagation();else if(O2(r,d),i&4&&-1<lb.indexOf(r)){for(;p!==null;){var y=Na(p);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var j=zn(y.pendingLanes);if(j!==0){var R=y;for(R.pendingLanes|=2,R.entangledLanes|=2;j;){var V=1<<31-_t(j);R.entanglements[1]|=V,j&=~V}Wa(y),(Rt&6)===0&&(K0=ht()+500,oc(0))}}break;case 31:case 13:R=xi(y,2),R!==null&&wr(R,y,2),Z0(),um(y,2)}if(y=dm(d),y===null&&Xh(r,i,d,hd,s),y===p)break;p=y}p!==null&&d.stopPropagation()}else Xh(r,i,d,null,s)}}function dm(r){return r=Xl(r),fm(r)}var hd=null;function fm(r){if(hd=null,r=Ea(r),r!==null){var i=o(r);if(i===null)r=null;else{var s=i.tag;if(s===13){if(r=c(i),r!==null)return r;r=null}else if(s===31){if(r=f(i),r!==null)return r;r=null}else if(s===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null)}}return hd=r,null}function R2(r){switch(r){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(ur()){case me:return 2;case Se:return 8;case $e:case at:return 32;case kt:return 268435456;default:return 32}default:return 32}}var hm=!1,Sl=null,jl=null,Cl=null,pc=new Map,gc=new Map,Tl=[],lb="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 O2(r,i){switch(r){case"focusin":case"focusout":Sl=null;break;case"dragenter":case"dragleave":jl=null;break;case"mouseover":case"mouseout":Cl=null;break;case"pointerover":case"pointerout":pc.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":gc.delete(i.pointerId)}}function yc(r,i,s,d,p,y){return r===null||r.nativeEvent!==y?(r={blockedOn:i,domEventName:s,eventSystemFlags:d,nativeEvent:y,targetContainers:[p]},i!==null&&(i=Na(i),i!==null&&z2(i)),r):(r.eventSystemFlags|=d,i=r.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),r)}function sb(r,i,s,d,p){switch(i){case"focusin":return Sl=yc(Sl,r,i,s,d,p),!0;case"dragenter":return jl=yc(jl,r,i,s,d,p),!0;case"mouseover":return Cl=yc(Cl,r,i,s,d,p),!0;case"pointerover":var y=p.pointerId;return pc.set(y,yc(pc.get(y)||null,r,i,s,d,p)),!0;case"gotpointercapture":return y=p.pointerId,gc.set(y,yc(gc.get(y)||null,r,i,s,d,p)),!0}return!1}function I2(r){var i=Ea(r.target);if(i!==null){var s=o(i);if(s!==null){if(i=s.tag,i===13){if(i=c(s),i!==null){r.blockedOn=i,a0(r.priority,function(){D2(s)});return}}else if(i===31){if(i=f(s),i!==null){r.blockedOn=i,a0(r.priority,function(){D2(s)});return}}else if(i===3&&s.stateNode.current.memoizedState.isDehydrated){r.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}r.blockedOn=null}function md(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var s=dm(r.nativeEvent);if(s===null){s=r.nativeEvent;var d=new s.constructor(s.type,s);oi=d,s.target.dispatchEvent(d),oi=null}else return i=Na(s),i!==null&&z2(i),r.blockedOn=s,!1;i.shift()}return!0}function _2(r,i,s){md(r)&&s.delete(i)}function ob(){hm=!1,Sl!==null&&md(Sl)&&(Sl=null),jl!==null&&md(jl)&&(jl=null),Cl!==null&&md(Cl)&&(Cl=null),pc.forEach(_2),gc.forEach(_2)}function pd(r,i){r.blockedOn===i&&(r.blockedOn=null,hm||(hm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,ob)))}var gd=null;function L2(r){gd!==r&&(gd=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){gd===r&&(gd=null);for(var i=0;i<r.length;i+=3){var s=r[i],d=r[i+1],p=r[i+2];if(typeof d!="function"){if(fm(d||s)===null)continue;break}var y=Na(s);y!==null&&(r.splice(i,3),i-=3,dh(y,{pending:!0,data:p,method:s.method,action:d},d,p))}}))}function qo(r){function i(V){return pd(V,r)}Sl!==null&&pd(Sl,r),jl!==null&&pd(jl,r),Cl!==null&&pd(Cl,r),pc.forEach(i),gc.forEach(i);for(var s=0;s<Tl.length;s++){var d=Tl[s];d.blockedOn===r&&(d.blockedOn=null)}for(;0<Tl.length&&(s=Tl[0],s.blockedOn===null);)I2(s),s.blockedOn===null&&Tl.shift();if(s=(r.ownerDocument||r).$$reactFormReplay,s!=null)for(d=0;d<s.length;d+=3){var p=s[d],y=s[d+1],j=p[gn]||null;if(typeof y=="function")j||L2(s);else if(j){var R=null;if(y&&y.hasAttribute("formAction")){if(p=y,j=y[gn]||null)R=j.formAction;else if(fm(p)!==null)continue}else R=j.action;typeof R=="function"?s[d+1]=R:(s.splice(d,3),d-=3),L2(s)}}}function B2(){function r(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(j){return p=j})},focusReset:"manual",scroll:"manual"})}function i(){p!==null&&(p(),p=null),d||setTimeout(s,20)}function s(){if(!d&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,p=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(s,100),function(){d=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),p!==null&&(p(),p=null)}}}function mm(r){this._internalRoot=r}yd.prototype.render=mm.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,d=qr();N2(s,d,r,i,null,null)},yd.prototype.unmount=mm.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;N2(r.current,2,null,r,null,null),Z0(),i[Ar]=null}};function yd(r){this._internalRoot=r}yd.prototype.unstable_scheduleHydration=function(r){if(r){var i=Us();r={blockedOn:null,target:r,priority:i};for(var s=0;s<Tl.length&&i!==0&&i<Tl[s].priority;s++);Tl.splice(s,0,r),s===0&&I2(r)}};var q2=t.version;if(q2!=="19.2.7")throw Error(a(527,q2,"19.2.7"));Y.findDOMNode=function(r){var i=r._reactInternals;if(i===void 0)throw typeof r.render=="function"?Error(a(188)):(r=Object.keys(r).join(","),Error(a(268,r)));return r=m(i),r=r!==null?g(r):null,r=r===null?null:r.stateNode,r};var ub={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:J,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vd.isDisabled&&vd.supportsFiber)try{Bt=vd.inject(ub),dn=vd}catch{}}return xc.createRoot=function(r,i){if(!l(r))throw Error(a(299));var s=!1,d="",p=V4,y=Y4,j=W4;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onUncaughtError!==void 0&&(p=i.onUncaughtError),i.onCaughtError!==void 0&&(y=i.onCaughtError),i.onRecoverableError!==void 0&&(j=i.onRecoverableError)),i=A2(r,1,!1,null,null,s,d,null,p,y,j,B2),r[Ar]=i.current,Kh(r),new mm(i)},xc.hydrateRoot=function(r,i,s){if(!l(r))throw Error(a(299));var d=!1,p="",y=V4,j=Y4,R=W4,V=null;return s!=null&&(s.unstable_strictMode===!0&&(d=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onUncaughtError!==void 0&&(y=s.onUncaughtError),s.onCaughtError!==void 0&&(j=s.onCaughtError),s.onRecoverableError!==void 0&&(R=s.onRecoverableError),s.formState!==void 0&&(V=s.formState)),i=A2(r,1,!0,i,s??null,d,p,V,y,j,R,B2),i.context=E2(null),s=i.current,d=qr(),d=qs(d),p=ka(d),p.callback=null,fl(s,p,d),s=d,i.current.lanes=s,Fi(i,s),Wa(i),r[Ar]=i.current,Kh(r),new yd(i)},xc.version="19.2.7",xc}var X2;function Sb(){if(X2)return ym.exports;X2=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),ym.exports=kb(),ym.exports}var jb=Sb();function Z2(e){const t=[],n=String(e||"");let a=n.indexOf(","),l=0,o=!1;for(;!o;){a===-1&&(a=n.length,o=!0);const c=n.slice(l,a).trim();(c||!o)&&t.push(c),l=a+1,a=n.indexOf(",",l)}return t}function Cb(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Tb=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ab=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Eb={};function Q2(e,t){return(Eb.jsx?Ab:Tb).test(e)}const Nb=/[ \t\n\f\r]/g;function Mb(e){return typeof e=="object"?e.type==="text"?J2(e.value):!1:J2(e)}function J2(e){return e.replace(Nb,"")===""}class Xc{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}Xc.prototype.normal={};Xc.prototype.property={};Xc.prototype.space=void 0;function R5(e,t){const n={},a={};for(const l of e)Object.assign(n,l.property),Object.assign(a,l.normal);return new Xc(n,a,t)}function Fc(e){return e.toLowerCase()}class Cr{constructor(t,n){this.attribute=n,this.property=t}}Cr.prototype.attribute="";Cr.prototype.booleanish=!1;Cr.prototype.boolean=!1;Cr.prototype.commaOrSpaceSeparated=!1;Cr.prototype.commaSeparated=!1;Cr.prototype.defined=!1;Cr.prototype.mustUseProperty=!1;Cr.prototype.number=!1;Cr.prototype.overloadedBoolean=!1;Cr.prototype.property="";Cr.prototype.spaceSeparated=!1;Cr.prototype.space=void 0;let zb=0;const lt=Is(),An=Is(),vp=Is(),Ne=Is(),Xt=Is(),Ms=Is(),Ur=Is();function Is(){return 2**++zb}const xp=Object.freeze(Object.defineProperty({__proto__:null,boolean:lt,booleanish:An,commaOrSpaceSeparated:Ur,commaSeparated:Ms,number:Ne,overloadedBoolean:vp,spaceSeparated:Xt},Symbol.toStringTag,{value:"Module"})),wm=Object.keys(xp);class u1 extends Cr{constructor(t,n,a,l){let o=-1;if(super(t,n),ey(this,"space",l),typeof a=="number")for(;++o<wm.length;){const c=wm[o];ey(this,wm[o],(a&xp[c])===xp[c])}}}u1.prototype.defined=!0;function ey(e,t,n){n&&(e[t]=n)}function nu(e){const t={},n={};for(const[a,l]of Object.entries(e.properties)){const o=new u1(a,e.transform(e.attributes||{},a),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(o.mustUseProperty=!0),t[a]=o,n[Fc(a)]=a,n[Fc(o.attribute)]=a}return new Xc(t,n,e.space)}const O5=nu({properties:{ariaActiveDescendant:null,ariaAtomic:An,ariaAutoComplete:null,ariaBusy:An,ariaChecked:An,ariaColCount:Ne,ariaColIndex:Ne,ariaColSpan:Ne,ariaControls:Xt,ariaCurrent:null,ariaDescribedBy:Xt,ariaDetails:null,ariaDisabled:An,ariaDropEffect:Xt,ariaErrorMessage:null,ariaExpanded:An,ariaFlowTo:Xt,ariaGrabbed:An,ariaHasPopup:null,ariaHidden:An,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Xt,ariaLevel:Ne,ariaLive:null,ariaModal:An,ariaMultiLine:An,ariaMultiSelectable:An,ariaOrientation:null,ariaOwns:Xt,ariaPlaceholder:null,ariaPosInSet:Ne,ariaPressed:An,ariaReadOnly:An,ariaRelevant:null,ariaRequired:An,ariaRoleDescription:Xt,ariaRowCount:Ne,ariaRowIndex:Ne,ariaRowSpan:Ne,ariaSelected:An,ariaSetSize:Ne,ariaSort:null,ariaValueMax:Ne,ariaValueMin:Ne,ariaValueNow:Ne,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function I5(e,t){return t in e?e[t]:t}function _5(e,t){return I5(e,t.toLowerCase())}const Db=nu({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ms,acceptCharset:Xt,accessKey:Xt,action:null,allow:null,allowFullScreen:lt,allowPaymentRequest:lt,allowUserMedia:lt,alpha:lt,alt:null,as:null,async:lt,autoCapitalize:null,autoComplete:Xt,autoFocus:lt,autoPlay:lt,blocking:Xt,capture:null,charSet:null,checked:lt,cite:null,className:Xt,closedBy:null,colorSpace:null,cols:Ne,colSpan:Ne,command:null,commandFor:null,content:null,contentEditable:An,controls:lt,controlsList:Xt,coords:Ne|Ms,crossOrigin:null,data:null,dateTime:null,decoding:null,default:lt,defer:lt,dir:null,dirName:null,disabled:lt,download:vp,draggable:An,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:lt,formTarget:null,headers:Xt,height:Ne,hidden:vp,high:Ne,href:null,hrefLang:null,htmlFor:Xt,httpEquiv:Xt,id:null,imageSizes:null,imageSrcSet:null,inert:lt,inputMode:null,integrity:null,is:null,isMap:lt,itemId:null,itemProp:Xt,itemRef:Xt,itemScope:lt,itemType:Xt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:lt,low:Ne,manifest:null,max:null,maxLength:Ne,media:null,method:null,min:null,minLength:Ne,multiple:lt,muted:lt,name:null,nonce:null,noModule:lt,noValidate:lt,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:lt,optimum:Ne,pattern:null,ping:Xt,placeholder:null,playsInline:lt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:lt,referrerPolicy:null,rel:Xt,required:lt,reversed:lt,rows:Ne,rowSpan:Ne,sandbox:Xt,scope:null,scoped:lt,seamless:lt,selected:lt,shadowRootClonable:lt,shadowRootCustomElementRegistry:lt,shadowRootDelegatesFocus:lt,shadowRootMode:null,shadowRootSerializable:lt,shape:null,size:Ne,sizes:null,slot:null,span:Ne,spellCheck:An,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ne,step:null,style:null,tabIndex:Ne,target:null,title:null,translate:null,type:null,typeMustMatch:lt,useMap:null,value:An,width:Ne,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Xt,axis:null,background:null,bgColor:null,border:Ne,borderColor:null,bottomMargin:Ne,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:lt,declare:lt,event:null,face:null,frame:null,frameBorder:null,hSpace:Ne,leftMargin:Ne,link:null,longDesc:null,lowSrc:null,marginHeight:Ne,marginWidth:Ne,noResize:lt,noHref:lt,noShade:lt,noWrap:lt,object:null,profile:null,prompt:null,rev:null,rightMargin:Ne,rules:null,scheme:null,scrolling:An,standby:null,summary:null,text:null,topMargin:Ne,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ne,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:lt,disablePictureInPicture:lt,disableRemotePlayback:lt,exportParts:Ms,part:Xt,prefix:null,property:null,results:Ne,security:null,unselectable:null},space:"html",transform:_5}),Rb=nu({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",maskType:"mask-type",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:Ur,accentHeight:Ne,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ne,amplitude:Ne,arabicForm:null,ascent:Ne,attributeName:null,attributeType:null,azimuth:Ne,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ne,by:null,calcMode:null,capHeight:Ne,className:Xt,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:Ne,diffuseConstant:Ne,direction:null,display:null,dur:null,divisor:Ne,dominantBaseline:null,download:lt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ne,enableBackground:null,end:null,event:null,exponent:Ne,externalResourcesRequired:null,fill:null,fillOpacity:Ne,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:Ms,g2:Ms,glyphName:Ms,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ne,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ne,horizOriginX:Ne,horizOriginY:Ne,id:null,ideographic:Ne,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ne,k:Ne,k1:Ne,k2:Ne,k3:Ne,k4:Ne,kernelMatrix:Ur,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ne,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ne,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:Ne,overlineThickness:Ne,paintOrder:null,panose1:null,path:null,pathLength:Ne,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Xt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ne,pointsAtY:Ne,pointsAtZ:Ne,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ur,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ur,rev:Ur,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ur,requiredFeatures:Ur,requiredFonts:Ur,requiredFormats:Ur,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:Ne,specularExponent:Ne,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ne,strikethroughThickness:Ne,string:null,stroke:null,strokeDashArray:Ur,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ne,strokeOpacity:Ne,strokeWidth:null,style:null,surfaceScale:Ne,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ur,tabIndex:Ne,tableValues:null,target:null,targetX:Ne,targetY:Ne,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ur,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ne,underlineThickness:Ne,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ne,values:null,vAlphabetic:Ne,vMathematical:Ne,vectorEffect:null,vHanging:Ne,vIdeographic:Ne,version:null,vertAdvY:Ne,vertOriginX:Ne,vertOriginY:Ne,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ne,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:I5}),L5=nu({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()}}),B5=nu({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:_5}),q5=nu({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Ob={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"},Ib=/[A-Z]/g,ty=/-[a-z]/g,_b=/^data[-\w.:]+$/i;function U5(e,t){const n=Fc(t);let a=t,l=Cr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&_b.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(ty,Bb);a="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!ty.test(o)){let c=o.replace(Ib,Lb);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}l=u1}return new l(a,t)}function Lb(e){return"-"+e.toLowerCase()}function Bb(e){return e.charAt(1).toUpperCase()}const H5=R5([O5,Db,L5,B5,q5],"html"),mf=R5([O5,Rb,L5,B5,q5],"svg");function ny(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function qb(e){return e.join(" ").trim()}var Uo={},km,ry;function Ub(){if(ry)return km;ry=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
|
|
51
|
-
`,m="/",g="*",v="",k="comment",b="declaration";function T(q,z){if(typeof q!="string")throw new TypeError("First argument must be a string");if(!q)return[];z=z||{};var M=1,B=1;function U(be){var pe=be.match(t);pe&&(M+=pe.length);var J=be.lastIndexOf(h);B=~J?be.length-J:B+be.length}function ae(){var be={line:M,column:B};return function(pe){return pe.position=new L(be),Q(),pe}}function L(be){this.start=be,this.end={line:M,column:B},this.source=z.source}L.prototype.content=q;function K(be){var pe=new Error(z.source+":"+M+":"+B+": "+be);if(pe.reason=be,pe.filename=z.source,pe.line=M,pe.column=B,pe.source=q,!z.silent)throw pe}function ie(be){var pe=be.exec(q);if(pe){var J=pe[0];return U(J),q=q.slice(J.length),pe}}function Q(){ie(n)}function F(be){var pe;for(be=be||[];pe=he();)pe!==!1&&be.push(pe);return be}function he(){var be=ae();if(!(m!=q.charAt(0)||g!=q.charAt(1))){for(var pe=2;v!=q.charAt(pe)&&(g!=q.charAt(pe)||m!=q.charAt(pe+1));)++pe;if(pe+=2,v===q.charAt(pe-1))return K("End of comment missing");var J=q.slice(2,pe-2);return B+=2,U(J),q=q.slice(pe),B+=2,be({type:k,comment:J})}}function ce(){var be=ae(),pe=ie(a);if(pe){if(he(),!ie(l))return K("property missing ':'");var J=ie(o),Y=be({type:b,property:A(pe[0].replace(e,v)),value:J?A(J[0].replace(e,v)):v});return ie(c),Y}}function Ie(){var be=[];F(be);for(var pe;pe=ce();)pe!==!1&&(be.push(pe),F(be));return be}return Q(),Ie()}function A(q){return q?q.replace(f,v):v}return km=T,km}var ay;function Hb(){if(ay)return Uo;ay=1;var e=Uo&&Uo.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Uo,"__esModule",{value:!0}),Uo.default=n;const t=e(Ub());function n(a,l){let o=null;if(!a||typeof a!="string")return o;const c=(0,t.default)(a),f=typeof l=="function";return c.forEach(h=>{if(h.type!=="declaration")return;const{property:m,value:g}=h;f?l(m,g,h):g&&(o=o||{},o[m]=g)}),o}return Uo}var bc={},iy;function $b(){if(iy)return bc;iy=1,Object.defineProperty(bc,"__esModule",{value:!0}),bc.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,o=function(m){return!m||n.test(m)||e.test(m)},c=function(m,g){return g.toUpperCase()},f=function(m,g){return"".concat(g,"-")},h=function(m,g){return g===void 0&&(g={}),o(m)?m:(m=m.toLowerCase(),g.reactCompat?m=m.replace(l,f):m=m.replace(a,f),m.replace(t,c))};return bc.camelCase=h,bc}var wc,ly;function Fb(){if(ly)return wc;ly=1;var e=wc&&wc.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(Hb()),n=$b();function a(l,o){var c={};return!l||typeof l!="string"||(0,t.default)(l,function(f,h){f&&h&&(c[(0,n.camelCase)(f,o)]=h)}),c}return a.default=a,wc=a,wc}var Pb=Fb();const Gb=D5(Pb),$5=F5("end"),c1=F5("start");function F5(e){return t;function t(n){const a=n&&n.position&&n.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function Vb(e){const t=c1(e),n=$5(e);if(t&&n)return{start:t,end:n}}function Oc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?sy(e.position):"start"in e||"end"in e?sy(e):"line"in e||"column"in e?bp(e):""}function bp(e){return oy(e&&e.line)+":"+oy(e&&e.column)}function sy(e){return bp(e&&e.start)+"-"+bp(e&&e.end)}function oy(e){return e&&typeof e=="number"?e:1}class Jn extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let l="",o={},c=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?l=t:!o.cause&&t&&(c=!0,l=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof a=="string"){const h=a.indexOf(":");h===-1?o.ruleId=a:(o.source=a.slice(0,h),o.ruleId=a.slice(h+1))}if(!o.place&&o.ancestors&&o.ancestors){const h=o.ancestors[o.ancestors.length-1];h&&(o.place=h.position)}const f=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=f?f.line:void 0,this.name=Oc(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=c&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Jn.prototype.file="";Jn.prototype.name="";Jn.prototype.reason="";Jn.prototype.message="";Jn.prototype.stack="";Jn.prototype.column=void 0;Jn.prototype.line=void 0;Jn.prototype.ancestors=void 0;Jn.prototype.cause=void 0;Jn.prototype.fatal=void 0;Jn.prototype.place=void 0;Jn.prototype.ruleId=void 0;Jn.prototype.source=void 0;const d1={}.hasOwnProperty,Yb=new Map,Wb=/[A-Z]/g,Kb=new Set(["table","tbody","thead","tfoot","tr"]),Xb=new Set(["td","th"]),P5="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Zb(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let a;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=i8(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=a8(n,t.jsx,t.jsxs)}const l={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,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"?mf:H5,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=G5(l,e,void 0);return o&&typeof o!="string"?o:l.create(e,l.Fragment,{children:o||void 0},void 0)}function G5(e,t,n){if(t.type==="element")return Qb(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Jb(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return t8(e,t,n);if(t.type==="mdxjsEsm")return e8(e,t);if(t.type==="root")return n8(e,t,n);if(t.type==="text")return r8(e,t)}function Qb(e,t,n){const a=e.schema;let l=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(l=mf,e.schema=l),e.ancestors.push(t);const o=Y5(e,t.tagName,!1),c=l8(e,t);let f=h1(e,t);return Kb.has(t.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!Mb(h):!0})),V5(e,c,o,t),f1(c,f),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function Jb(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}Pc(e,t.position)}function e8(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Pc(e,t.position)}function t8(e,t,n){const a=e.schema;let l=a;t.name==="svg"&&a.space==="html"&&(l=mf,e.schema=l),e.ancestors.push(t);const o=t.name===null?e.Fragment:Y5(e,t.name,!0),c=s8(e,t),f=h1(e,t);return V5(e,c,o,t),f1(c,f),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function n8(e,t,n){const a={};return f1(a,h1(e,t)),e.create(t,e.Fragment,a,n)}function r8(e,t){return t.value}function V5(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function f1(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function a8(e,t,n){return a;function a(l,o,c,f){const m=Array.isArray(c.children)?n:t;return f?m(o,c,f):m(o,c)}}function i8(e,t){return n;function n(a,l,o,c){const f=Array.isArray(o.children),h=c1(a);return t(l,o,c,f,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function l8(e,t){const n={};let a,l;for(l in t.properties)if(l!=="children"&&d1.call(t.properties,l)){const o=o8(e,l,t.properties[l]);if(o){const[c,f]=o;e.tableCellAlignToStyle&&c==="align"&&typeof f=="string"&&Xb.has(t.tagName)?a=f:n[c]=f}}if(a){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function s8(e,t){const n={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const o=a.data.estree.body[0];o.type;const c=o.expression;c.type;const f=c.properties[0];f.type,Object.assign(n,e.evaluater.evaluateExpression(f.argument))}else Pc(e,t.position);else{const l=a.name;let o;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const f=a.value.data.estree.body[0];f.type,o=e.evaluater.evaluateExpression(f.expression)}else Pc(e,t.position);else o=a.value===null?!0:a.value;n[l]=o}return n}function h1(e,t){const n=[];let a=-1;const l=e.passKeys?new Map:Yb;for(;++a<t.children.length;){const o=t.children[a];let c;if(e.passKeys){const h=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(h){const m=l.get(h)||0;c=h+"-"+m,l.set(h,m+1)}}const f=G5(e,o,c);f!==void 0&&n.push(f)}return n}function o8(e,t,n){const a=U5(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?Cb(n):qb(n)),a.property==="style"){let l=typeof n=="object"?n:u8(e,String(n));return e.stylePropertyNameCase==="css"&&(l=c8(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&a.space?Ob[a.property]||a.property:a.attribute,n]}}function u8(e,t){try{return Gb(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,l=new Jn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=P5+"#cannot-parse-style-attribute",l}}function Y5(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const l=t.split(".");let o=-1,c;for(;++o<l.length;){const f=Q2(l[o])?{type:"Identifier",name:l[o]}:{type:"Literal",value:l[o]};c=c?{type:"MemberExpression",object:c,property:f,computed:!!(o&&f.type==="Literal"),optional:!1}:f}a=c}else a=Q2(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const l=a.value;return d1.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(a);Pc(e)}function Pc(e,t){const n=new Jn("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=P5+"#cannot-handle-mdx-estrees-without-createevaluater",n}function c8(e){const t={};let n;for(n in e)d1.call(e,n)&&(t[d8(n)]=e[n]);return t}function d8(e){let t=e.replace(Wb,f8);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function f8(e){return"-"+e.toLowerCase()}const Sm={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"]},h8={};function m1(e,t){const n=h8,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,l=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return W5(e,a,l)}function W5(e,t,n){if(m8(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 uy(e.children,t,n)}return Array.isArray(e)?uy(e,t,n):""}function uy(e,t,n){const a=[];let l=-1;for(;++l<e.length;)a[l]=W5(e[l],t,n);return a.join("")}function m8(e){return!!(e&&typeof e=="object")}const cy=document.createElement("i");function p1(e){const t="&"+e+";";cy.innerHTML=t;const n=cy.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Hr(e,t,n,a){const l=e.length;let o=0,c;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,n=n>0?n:0,a.length<1e4)c=Array.from(a),c.unshift(t,n),e.splice(...c);else for(n&&e.splice(t,n);o<a.length;)c=a.slice(o,o+1e4),c.unshift(t,0),e.splice(...c),o+=1e4,t+=1e4}function ra(e,t){return e.length>0?(Hr(e,e.length,0,t),e):t}const dy={}.hasOwnProperty;function K5(e){const t={};let n=-1;for(;++n<e.length;)p8(t,e[n]);return t}function p8(e,t){let n;for(n in t){const l=(dy.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let c;if(o)for(c in o){dy.call(l,c)||(l[c]=[]);const f=o[c];g8(l[c],Array.isArray(f)?f:f?[f]:[])}}}function g8(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);Hr(e,0,0,a)}function X5(e,t){const 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 Ca(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const lr=Ul(/[A-Za-z]/),Zn=Ul(/[\dA-Za-z]/),y8=Ul(/[#-'*+\--9=?A-Z^-~]/);function Qd(e){return e!==null&&(e<32||e===127)}const wp=Ul(/\d/),v8=Ul(/[\dA-Fa-f]/),x8=Ul(/[!-/:-@[-`{-~]/);function Ke(e){return e!==null&&e<-2}function Zt(e){return e!==null&&(e<0||e===32)}function bt(e){return e===-2||e===-1||e===32}const pf=Ul(new RegExp("\\p{P}|\\p{S}","u")),zs=Ul(/\s/);function Ul(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ru(e){const t=[];let n=-1,a=0,l=0;for(;++n<e.length;){const o=e.charCodeAt(n);let c="";if(o===37&&Zn(e.charCodeAt(n+1))&&Zn(e.charCodeAt(n+2)))l=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(c=String.fromCharCode(o));else if(o>55295&&o<57344){const f=e.charCodeAt(n+1);o<56320&&f>56319&&f<57344?(c=String.fromCharCode(o,f),l=1):c="�"}else c=String.fromCharCode(o);c&&(t.push(e.slice(a,n),encodeURIComponent(c)),a=n+l+1,c=""),l&&(n+=l,l=0)}return t.join("")+e.slice(a)}function gt(e,t,n,a){const l=a?a-1:Number.POSITIVE_INFINITY;let o=0;return c;function c(h){return bt(h)?(e.enter(n),f(h)):t(h)}function f(h){return bt(h)&&o++<l?(e.consume(h),f):(e.exit(n),t(h))}}const b8={tokenize:w8};function w8(e){const t=e.attempt(this.parser.constructs.contentInitial,a,l);let n;return t;function a(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),gt(e,t,"linePrefix")}function l(f){return e.enter("paragraph"),o(f)}function o(f){const h=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=h),n=h,c(f)}function c(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Ke(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),c)}}const k8={tokenize:S8},fy={tokenize:j8};function S8(e){const t=this,n=[];let a=0,l,o,c;return f;function f(B){if(a<n.length){const U=n[a];return t.containerState=U[1],e.attempt(U[0].continuation,h,m)(B)}return m(B)}function h(B){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&M();const U=t.events.length;let ae=U,L;for(;ae--;)if(t.events[ae][0]==="exit"&&t.events[ae][1].type==="chunkFlow"){L=t.events[ae][1].end;break}z(a);let K=U;for(;K<t.events.length;)t.events[K][1].end={...L},K++;return Hr(t.events,ae+1,0,t.events.slice(U)),t.events.length=K,m(B)}return f(B)}function m(B){if(a===n.length){if(!l)return k(B);if(l.currentConstruct&&l.currentConstruct.concrete)return T(B);t.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(fy,g,v)(B)}function g(B){return l&&M(),z(a),k(B)}function v(B){return t.parser.lazy[t.now().line]=a!==n.length,c=t.now().offset,T(B)}function k(B){return t.containerState={},e.attempt(fy,b,T)(B)}function b(B){return a++,n.push([t.currentConstruct,t.containerState]),k(B)}function T(B){if(B===null){l&&M(),z(0),e.consume(B);return}return l=l||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:o}),A(B)}function A(B){if(B===null){q(e.exit("chunkFlow"),!0),z(0),e.consume(B);return}return Ke(B)?(e.consume(B),q(e.exit("chunkFlow")),a=0,t.interrupt=void 0,f):(e.consume(B),A)}function q(B,U){const ae=t.sliceStream(B);if(U&&ae.push(null),B.previous=o,o&&(o.next=B),o=B,l.defineSkip(B.start),l.write(ae),t.parser.lazy[B.start.line]){let L=l.events.length;for(;L--;)if(l.events[L][1].start.offset<c&&(!l.events[L][1].end||l.events[L][1].end.offset>c))return;const K=t.events.length;let ie=K,Q,F;for(;ie--;)if(t.events[ie][0]==="exit"&&t.events[ie][1].type==="chunkFlow"){if(Q){F=t.events[ie][1].end;break}Q=!0}for(z(a),L=K;L<t.events.length;)t.events[L][1].end={...F},L++;Hr(t.events,ie+1,0,t.events.slice(K)),t.events.length=L}}function z(B){let U=n.length;for(;U-- >B;){const ae=n[U];t.containerState=ae[1],ae[0].exit.call(t,e)}n.length=B}function M(){l.write([null]),o=void 0,l=void 0,t.containerState._closeFlow=void 0}}function j8(e,t,n){return gt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Zo(e){if(e===null||Zt(e)||zs(e))return 1;if(pf(e))return 2}function gf(e,t,n){const a=[];let l=-1;for(;++l<e.length;){const o=e[l].resolveAll;o&&!a.includes(o)&&(t=o(t,n),a.push(o))}return t}const kp={name:"attention",resolveAll:C8,tokenize:T8};function C8(e,t){let n=-1,a,l,o,c,f,h,m,g;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(a=n;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&t.sliceSerialize(e[a][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[a][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;h=e[a][1].end.offset-e[a][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const v={...e[a][1].end},k={...e[n][1].start};hy(v,-h),hy(k,h),c={type:h>1?"strongSequence":"emphasisSequence",start:v,end:{...e[a][1].end}},f={type:h>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:k},o={type:h>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},l={type:h>1?"strong":"emphasis",start:{...c.start},end:{...f.end}},e[a][1].end={...c.start},e[n][1].start={...f.end},m=[],e[a][1].end.offset-e[a][1].start.offset&&(m=ra(m,[["enter",e[a][1],t],["exit",e[a][1],t]])),m=ra(m,[["enter",l,t],["enter",c,t],["exit",c,t],["enter",o,t]]),m=ra(m,gf(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),m=ra(m,[["exit",o,t],["enter",f,t],["exit",f,t],["exit",l,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,m=ra(m,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,Hr(e,a-1,n-a+3,m),n=a+m.length-g-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function T8(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,l=Zo(a);let o;return c;function c(h){return o=h,e.enter("attentionSequence"),f(h)}function f(h){if(h===o)return e.consume(h),f;const m=e.exit("attentionSequence"),g=Zo(h),v=!g||g===2&&l||n.includes(h),k=!l||l===2&&g||n.includes(a);return m._open=!!(o===42?v:v&&(l||!k)),m._close=!!(o===42?k:k&&(g||!v)),t(h)}}function hy(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const A8={name:"autolink",tokenize:E8};function E8(e,t,n){let a=0;return l;function l(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(b){return lr(b)?(e.consume(b),c):b===64?n(b):m(b)}function c(b){return b===43||b===45||b===46||Zn(b)?(a=1,f(b)):m(b)}function f(b){return b===58?(e.consume(b),a=0,h):(b===43||b===45||b===46||Zn(b))&&a++<32?(e.consume(b),f):(a=0,m(b))}function h(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||Qd(b)?n(b):(e.consume(b),h)}function m(b){return b===64?(e.consume(b),g):y8(b)?(e.consume(b),m):n(b)}function g(b){return Zn(b)?v(b):n(b)}function v(b){return b===46?(e.consume(b),a=0,g):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):k(b)}function k(b){if((b===45||Zn(b))&&a++<63){const T=b===45?k:v;return e.consume(b),T}return n(b)}}const Zc={partial:!0,tokenize:N8};function N8(e,t,n){return a;function a(o){return bt(o)?gt(e,l,"linePrefix")(o):l(o)}function l(o){return o===null||Ke(o)?t(o):n(o)}}const Z5={continuation:{tokenize:z8},exit:D8,name:"blockQuote",tokenize:M8};function M8(e,t,n){const a=this;return l;function l(c){if(c===62){const f=a.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),o}return n(c)}function o(c){return bt(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function z8(e,t,n){const a=this;return l;function l(c){return bt(c)?gt(e,o,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):o(c)}function o(c){return e.attempt(Z5,t,n)(c)}}function D8(e){e.exit("blockQuote")}const Q5={name:"characterEscape",tokenize:R8};function R8(e,t,n){return a;function a(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),l}function l(o){return x8(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const J5={name:"characterReference",tokenize:O8};function O8(e,t,n){const a=this;let l=0,o,c;return f;function f(v){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(v),e.exit("characterReferenceMarker"),h}function h(v){return v===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(v),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),o=31,c=Zn,g(v))}function m(v){return v===88||v===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(v),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,c=v8,g):(e.enter("characterReferenceValue"),o=7,c=wp,g(v))}function g(v){if(v===59&&l){const k=e.exit("characterReferenceValue");return c===Zn&&!p1(a.sliceSerialize(k))?n(v):(e.enter("characterReferenceMarker"),e.consume(v),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(v)&&l++<o?(e.consume(v),g):n(v)}}const my={partial:!0,tokenize:_8},py={concrete:!0,name:"codeFenced",tokenize:I8};function I8(e,t,n){const a=this,l={partial:!0,tokenize:ae};let o=0,c=0,f;return h;function h(L){return m(L)}function m(L){const K=a.events[a.events.length-1];return o=K&&K[1].type==="linePrefix"?K[2].sliceSerialize(K[1],!0).length:0,f=L,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(L)}function g(L){return L===f?(c++,e.consume(L),g):c<3?n(L):(e.exit("codeFencedFenceSequence"),bt(L)?gt(e,v,"whitespace")(L):v(L))}function v(L){return L===null||Ke(L)?(e.exit("codeFencedFence"),a.interrupt?t(L):e.check(my,A,U)(L)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),k(L))}function k(L){return L===null||Ke(L)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),v(L)):bt(L)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),gt(e,b,"whitespace")(L)):L===96&&L===f?n(L):(e.consume(L),k)}function b(L){return L===null||Ke(L)?v(L):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),T(L))}function T(L){return L===null||Ke(L)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),v(L)):L===96&&L===f?n(L):(e.consume(L),T)}function A(L){return e.attempt(l,U,q)(L)}function q(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),z}function z(L){return o>0&&bt(L)?gt(e,M,"linePrefix",o+1)(L):M(L)}function M(L){return L===null||Ke(L)?e.check(my,A,U)(L):(e.enter("codeFlowValue"),B(L))}function B(L){return L===null||Ke(L)?(e.exit("codeFlowValue"),M(L)):(e.consume(L),B)}function U(L){return e.exit("codeFenced"),t(L)}function ae(L,K,ie){let Q=0;return F;function F(pe){return L.enter("lineEnding"),L.consume(pe),L.exit("lineEnding"),he}function he(pe){return L.enter("codeFencedFence"),bt(pe)?gt(L,ce,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(pe):ce(pe)}function ce(pe){return pe===f?(L.enter("codeFencedFenceSequence"),Ie(pe)):ie(pe)}function Ie(pe){return pe===f?(Q++,L.consume(pe),Ie):Q>=c?(L.exit("codeFencedFenceSequence"),bt(pe)?gt(L,be,"whitespace")(pe):be(pe)):ie(pe)}function be(pe){return pe===null||Ke(pe)?(L.exit("codeFencedFence"),K(pe)):ie(pe)}}}function _8(e,t,n){const a=this;return l;function l(c){return c===null?n(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}const jm={name:"codeIndented",tokenize:B8},L8={partial:!0,tokenize:q8};function B8(e,t,n){const a=this;return l;function l(m){return e.enter("codeIndented"),gt(e,o,"linePrefix",5)(m)}function o(m){const g=a.events[a.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?c(m):n(m)}function c(m){return m===null?h(m):Ke(m)?e.attempt(L8,c,h)(m):(e.enter("codeFlowValue"),f(m))}function f(m){return m===null||Ke(m)?(e.exit("codeFlowValue"),c(m)):(e.consume(m),f)}function h(m){return e.exit("codeIndented"),t(m)}}function q8(e,t,n){const a=this;return l;function l(c){return a.parser.lazy[a.now().line]?n(c):Ke(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):gt(e,o,"linePrefix",5)(c)}function o(c){const f=a.events[a.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):Ke(c)?l(c):n(c)}}const U8={name:"codeText",previous:$8,resolve:H8,tokenize:F8};function H8(e){let t=e.length-4,n=3,a,l;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=n;++a<t;)if(e[a][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(a=n-1,t++;++a<=t;)l===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(l=a):(a===t||e[a][1].type==="lineEnding")&&(e[l][1].type="codeTextData",a!==l+2&&(e[l][1].end=e[a-1][1].end,e.splice(l+2,a-l-2),t-=a-l-2,a=l+2),l=void 0);return e}function $8(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function F8(e,t,n){let a=0,l,o;return c;function c(v){return e.enter("codeText"),e.enter("codeTextSequence"),f(v)}function f(v){return v===96?(e.consume(v),a++,f):(e.exit("codeTextSequence"),h(v))}function h(v){return v===null?n(v):v===32?(e.enter("space"),e.consume(v),e.exit("space"),h):v===96?(o=e.enter("codeTextSequence"),l=0,g(v)):Ke(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),h):(e.enter("codeTextData"),m(v))}function m(v){return v===null||v===32||v===96||Ke(v)?(e.exit("codeTextData"),h(v)):(e.consume(v),m)}function g(v){return v===96?(e.consume(v),l++,g):l===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(v)):(o.type="codeTextData",m(v))}}class P8{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const a=n??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(t,a):t>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(t,n,a){const l=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return a&&kc(this.left,a),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),kc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),kc(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);kc(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);kc(this.left,n.reverse())}}}function kc(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 ev(e){const t={};let n=-1,a,l,o,c,f,h,m;const g=new P8(e);for(;++n<g.length;){for(;n in t;)n=t[n];if(a=g.get(n),n&&a[1].type==="chunkFlow"&&g.get(n-1)[1].type==="listItemPrefix"&&(h=a[1]._tokenizer.events,o=0,o<h.length&&h[o][1].type==="lineEndingBlank"&&(o+=2),o<h.length&&h[o][1].type==="content"))for(;++o<h.length&&h[o][1].type!=="content";)h[o][1].type==="chunkText"&&(h[o][1]._isInFirstContentOfListItem=!0,o++);if(a[0]==="enter")a[1].contentType&&(Object.assign(t,G8(g,n)),n=t[n],m=!0);else if(a[1]._container){for(o=n,l=void 0;o--;)if(c=g.get(o),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(l&&(g.get(l)[1].type="lineEndingBlank"),c[1].type="lineEnding",l=o);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;l&&(a[1].end={...g.get(l)[1].start},f=g.slice(l,n),f.unshift(a),g.splice(l,n-l+1,f))}}return Hr(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!m}function G8(e,t){const n=e.get(t)[1],a=e.get(t)[2];let l=t-1;const o=[];let c=n._tokenizer;c||(c=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const f=c.events,h=[],m={};let g,v,k=-1,b=n,T=0,A=0;const q=[A];for(;b;){for(;e.get(++l)[1]!==b;);o.push(l),b._tokenizer||(g=a.sliceStream(b),b.next||g.push(null),v&&c.defineSkip(b.start),b._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(g),b._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),v=b,b=b.next}for(b=n;++k<f.length;)f[k][0]==="exit"&&f[k-1][0]==="enter"&&f[k][1].type===f[k-1][1].type&&f[k][1].start.line!==f[k][1].end.line&&(A=k+1,q.push(A),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(c.events=[],b?(b._tokenizer=void 0,b.previous=void 0):q.pop(),k=q.length;k--;){const z=f.slice(q[k],q[k+1]),M=o.pop();h.push([M,M+z.length-1]),e.splice(M,2,z)}for(h.reverse(),k=-1;++k<h.length;)m[T+h[k][0]]=T+h[k][1],T+=h[k][1]-h[k][0]-1;return m}const V8={resolve:W8,tokenize:K8},Y8={partial:!0,tokenize:X8};function W8(e){return ev(e),e}function K8(e,t){let n;return a;function a(f){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),l(f)}function l(f){return f===null?o(f):Ke(f)?e.check(Y8,c,o)(f):(e.consume(f),l)}function o(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function c(f){return e.consume(f),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,l}}function X8(e,t,n){const a=this;return l;function l(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),gt(e,o,"linePrefix")}function o(c){if(c===null||Ke(c))return n(c);const f=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):e.interrupt(a.parser.constructs.flow,n,t)(c)}}function tv(e,t,n,a,l,o,c,f,h){const m=h||Number.POSITIVE_INFINITY;let g=0;return v;function v(z){return z===60?(e.enter(a),e.enter(l),e.enter(o),e.consume(z),e.exit(o),k):z===null||z===32||z===41||Qd(z)?n(z):(e.enter(a),e.enter(c),e.enter(f),e.enter("chunkString",{contentType:"string"}),A(z))}function k(z){return z===62?(e.enter(o),e.consume(z),e.exit(o),e.exit(l),e.exit(a),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),b(z))}function b(z){return z===62?(e.exit("chunkString"),e.exit(f),k(z)):z===null||z===60||Ke(z)?n(z):(e.consume(z),z===92?T:b)}function T(z){return z===60||z===62||z===92?(e.consume(z),b):b(z)}function A(z){return!g&&(z===null||z===41||Zt(z))?(e.exit("chunkString"),e.exit(f),e.exit(c),e.exit(a),t(z)):g<m&&z===40?(e.consume(z),g++,A):z===41?(e.consume(z),g--,A):z===null||z===32||z===40||Qd(z)?n(z):(e.consume(z),z===92?q:A)}function q(z){return z===40||z===41||z===92?(e.consume(z),A):A(z)}}function nv(e,t,n,a,l,o){const c=this;let f=0,h;return m;function m(b){return e.enter(a),e.enter(l),e.consume(b),e.exit(l),e.enter(o),g}function g(b){return f>999||b===null||b===91||b===93&&!h||b===94&&!f&&"_hiddenFootnoteSupport"in c.parser.constructs?n(b):b===93?(e.exit(o),e.enter(l),e.consume(b),e.exit(l),e.exit(a),t):Ke(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),v(b))}function v(b){return b===null||b===91||b===93||Ke(b)||f++>999?(e.exit("chunkString"),g(b)):(e.consume(b),h||(h=!bt(b)),b===92?k:v)}function k(b){return b===91||b===92||b===93?(e.consume(b),f++,v):v(b)}}function rv(e,t,n,a,l,o){let c;return f;function f(k){return k===34||k===39||k===40?(e.enter(a),e.enter(l),e.consume(k),e.exit(l),c=k===40?41:k,h):n(k)}function h(k){return k===c?(e.enter(l),e.consume(k),e.exit(l),e.exit(a),t):(e.enter(o),m(k))}function m(k){return k===c?(e.exit(o),h(c)):k===null?n(k):Ke(k)?(e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),gt(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(k))}function g(k){return k===c||k===null||Ke(k)?(e.exit("chunkString"),m(k)):(e.consume(k),k===92?v:g)}function v(k){return k===c||k===92?(e.consume(k),g):g(k)}}function Ic(e,t){let n;return a;function a(l){return Ke(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,a):bt(l)?gt(e,a,n?"linePrefix":"lineSuffix")(l):t(l)}}const Z8={name:"definition",tokenize:J8},Q8={partial:!0,tokenize:e9};function J8(e,t,n){const a=this;let l;return o;function o(b){return e.enter("definition"),c(b)}function c(b){return nv.call(a,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function f(b){return l=Ca(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),h):n(b)}function h(b){return Zt(b)?Ic(e,m)(b):m(b)}function m(b){return tv(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function g(b){return e.attempt(Q8,v,v)(b)}function v(b){return bt(b)?gt(e,k,"whitespace")(b):k(b)}function k(b){return b===null||Ke(b)?(e.exit("definition"),a.parser.defined.push(l),t(b)):n(b)}}function e9(e,t,n){return a;function a(f){return Zt(f)?Ic(e,l)(f):n(f)}function l(f){return rv(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return bt(f)?gt(e,c,"whitespace")(f):c(f)}function c(f){return f===null||Ke(f)?t(f):n(f)}}const t9={name:"hardBreakEscape",tokenize:n9};function n9(e,t,n){return a;function a(o){return e.enter("hardBreakEscape"),e.consume(o),l}function l(o){return Ke(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const r9={name:"headingAtx",resolve:a9,tokenize:i9};function a9(e,t){let n=e.length-2,a=3,l,o;return e[a][1].type==="whitespace"&&(a+=2),n-2>a&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(a===n-1||n-4>a&&e[n-2][1].type==="whitespace")&&(n-=a+1===n?2:4),n>a&&(l={type:"atxHeadingText",start:e[a][1].start,end:e[n][1].end},o={type:"chunkText",start:e[a][1].start,end:e[n][1].end,contentType:"text"},Hr(e,a,n-a+1,[["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t]])),e}function i9(e,t,n){let a=0;return l;function l(g){return e.enter("atxHeading"),o(g)}function o(g){return e.enter("atxHeadingSequence"),c(g)}function c(g){return g===35&&a++<6?(e.consume(g),c):g===null||Zt(g)?(e.exit("atxHeadingSequence"),f(g)):n(g)}function f(g){return g===35?(e.enter("atxHeadingSequence"),h(g)):g===null||Ke(g)?(e.exit("atxHeading"),t(g)):bt(g)?gt(e,f,"whitespace")(g):(e.enter("atxHeadingText"),m(g))}function h(g){return g===35?(e.consume(g),h):(e.exit("atxHeadingSequence"),f(g))}function m(g){return g===null||g===35||Zt(g)?(e.exit("atxHeadingText"),f(g)):(e.consume(g),m)}}const l9=["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"],gy=["pre","script","style","textarea"],s9={concrete:!0,name:"htmlFlow",resolveTo:c9,tokenize:d9},o9={partial:!0,tokenize:h9},u9={partial:!0,tokenize:f9};function c9(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 d9(e,t,n){const a=this;let l,o,c,f,h;return m;function m(O){return g(O)}function g(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),v}function v(O){return O===33?(e.consume(O),k):O===47?(e.consume(O),o=!0,A):O===63?(e.consume(O),l=3,a.interrupt?t:H):lr(O)?(e.consume(O),c=String.fromCharCode(O),q):n(O)}function k(O){return O===45?(e.consume(O),l=2,b):O===91?(e.consume(O),l=5,f=0,T):lr(O)?(e.consume(O),l=4,a.interrupt?t:H):n(O)}function b(O){return O===45?(e.consume(O),a.interrupt?t:H):n(O)}function T(O){const ee="CDATA[";return O===ee.charCodeAt(f++)?(e.consume(O),f===ee.length?a.interrupt?t:ce:T):n(O)}function A(O){return lr(O)?(e.consume(O),c=String.fromCharCode(O),q):n(O)}function q(O){if(O===null||O===47||O===62||Zt(O)){const ee=O===47,Ae=c.toLowerCase();return!ee&&!o&&gy.includes(Ae)?(l=1,a.interrupt?t(O):ce(O)):l9.includes(c.toLowerCase())?(l=6,ee?(e.consume(O),z):a.interrupt?t(O):ce(O)):(l=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(O):o?M(O):B(O))}return O===45||Zn(O)?(e.consume(O),c+=String.fromCharCode(O),q):n(O)}function z(O){return O===62?(e.consume(O),a.interrupt?t:ce):n(O)}function M(O){return bt(O)?(e.consume(O),M):F(O)}function B(O){return O===47?(e.consume(O),F):O===58||O===95||lr(O)?(e.consume(O),U):bt(O)?(e.consume(O),B):F(O)}function U(O){return O===45||O===46||O===58||O===95||Zn(O)?(e.consume(O),U):ae(O)}function ae(O){return O===61?(e.consume(O),L):bt(O)?(e.consume(O),ae):B(O)}function L(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),h=O,K):bt(O)?(e.consume(O),L):ie(O)}function K(O){return O===h?(e.consume(O),h=null,Q):O===null||Ke(O)?n(O):(e.consume(O),K)}function ie(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||Zt(O)?ae(O):(e.consume(O),ie)}function Q(O){return O===47||O===62||bt(O)?B(O):n(O)}function F(O){return O===62?(e.consume(O),he):n(O)}function he(O){return O===null||Ke(O)?ce(O):bt(O)?(e.consume(O),he):n(O)}function ce(O){return O===45&&l===2?(e.consume(O),J):O===60&&l===1?(e.consume(O),Y):O===62&&l===4?(e.consume(O),_):O===63&&l===3?(e.consume(O),H):O===93&&l===5?(e.consume(O),Te):Ke(O)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(o9,te,Ie)(O)):O===null||Ke(O)?(e.exit("htmlFlowData"),Ie(O)):(e.consume(O),ce)}function Ie(O){return e.check(u9,be,te)(O)}function be(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),pe}function pe(O){return O===null||Ke(O)?Ie(O):(e.enter("htmlFlowData"),ce(O))}function J(O){return O===45?(e.consume(O),H):ce(O)}function Y(O){return O===47?(e.consume(O),c="",ge):ce(O)}function ge(O){if(O===62){const ee=c.toLowerCase();return gy.includes(ee)?(e.consume(O),_):ce(O)}return lr(O)&&c.length<8?(e.consume(O),c+=String.fromCharCode(O),ge):ce(O)}function Te(O){return O===93?(e.consume(O),H):ce(O)}function H(O){return O===62?(e.consume(O),_):O===45&&l===2?(e.consume(O),H):ce(O)}function _(O){return O===null||Ke(O)?(e.exit("htmlFlowData"),te(O)):(e.consume(O),_)}function te(O){return e.exit("htmlFlow"),t(O)}}function f9(e,t,n){const a=this;return l;function l(c){return Ke(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o):n(c)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}function h9(e,t,n){return a;function a(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(Zc,t,n)}}const m9={name:"htmlText",tokenize:p9};function p9(e,t,n){const a=this;let l,o,c;return f;function f(H){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(H),h}function h(H){return H===33?(e.consume(H),m):H===47?(e.consume(H),ae):H===63?(e.consume(H),B):lr(H)?(e.consume(H),ie):n(H)}function m(H){return H===45?(e.consume(H),g):H===91?(e.consume(H),o=0,T):lr(H)?(e.consume(H),M):n(H)}function g(H){return H===45?(e.consume(H),b):n(H)}function v(H){return H===null?n(H):H===45?(e.consume(H),k):Ke(H)?(c=v,Y(H)):(e.consume(H),v)}function k(H){return H===45?(e.consume(H),b):v(H)}function b(H){return H===62?J(H):H===45?k(H):v(H)}function T(H){const _="CDATA[";return H===_.charCodeAt(o++)?(e.consume(H),o===_.length?A:T):n(H)}function A(H){return H===null?n(H):H===93?(e.consume(H),q):Ke(H)?(c=A,Y(H)):(e.consume(H),A)}function q(H){return H===93?(e.consume(H),z):A(H)}function z(H){return H===62?J(H):H===93?(e.consume(H),z):A(H)}function M(H){return H===null||H===62?J(H):Ke(H)?(c=M,Y(H)):(e.consume(H),M)}function B(H){return H===null?n(H):H===63?(e.consume(H),U):Ke(H)?(c=B,Y(H)):(e.consume(H),B)}function U(H){return H===62?J(H):B(H)}function ae(H){return lr(H)?(e.consume(H),L):n(H)}function L(H){return H===45||Zn(H)?(e.consume(H),L):K(H)}function K(H){return Ke(H)?(c=K,Y(H)):bt(H)?(e.consume(H),K):J(H)}function ie(H){return H===45||Zn(H)?(e.consume(H),ie):H===47||H===62||Zt(H)?Q(H):n(H)}function Q(H){return H===47?(e.consume(H),J):H===58||H===95||lr(H)?(e.consume(H),F):Ke(H)?(c=Q,Y(H)):bt(H)?(e.consume(H),Q):J(H)}function F(H){return H===45||H===46||H===58||H===95||Zn(H)?(e.consume(H),F):he(H)}function he(H){return H===61?(e.consume(H),ce):Ke(H)?(c=he,Y(H)):bt(H)?(e.consume(H),he):Q(H)}function ce(H){return H===null||H===60||H===61||H===62||H===96?n(H):H===34||H===39?(e.consume(H),l=H,Ie):Ke(H)?(c=ce,Y(H)):bt(H)?(e.consume(H),ce):(e.consume(H),be)}function Ie(H){return H===l?(e.consume(H),l=void 0,pe):H===null?n(H):Ke(H)?(c=Ie,Y(H)):(e.consume(H),Ie)}function be(H){return H===null||H===34||H===39||H===60||H===61||H===96?n(H):H===47||H===62||Zt(H)?Q(H):(e.consume(H),be)}function pe(H){return H===47||H===62||Zt(H)?Q(H):n(H)}function J(H){return H===62?(e.consume(H),e.exit("htmlTextData"),e.exit("htmlText"),t):n(H)}function Y(H){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(H),e.exit("lineEnding"),ge}function ge(H){return bt(H)?gt(e,Te,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):Te(H)}function Te(H){return e.enter("htmlTextData"),c(H)}}const g1={name:"labelEnd",resolveAll:x9,resolveTo:b9,tokenize:w9},g9={tokenize:k9},y9={tokenize:S9},v9={tokenize:j9};function x9(e){let t=-1;const n=[];for(;++t<e.length;){const a=e[t][1];if(n.push(e[t]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const l=a.type==="labelImage"?4:2;a.type="data",t+=l}}return e.length!==n.length&&Hr(e,0,e.length,n),e}function b9(e,t){let n=e.length,a=0,l,o,c,f;for(;n--;)if(l=e[n][1],o){if(l.type==="link"||l.type==="labelLink"&&l._inactive)break;e[n][0]==="enter"&&l.type==="labelLink"&&(l._inactive=!0)}else if(c){if(e[n][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(o=n,l.type!=="labelLink")){a=2;break}}else l.type==="labelEnd"&&(c=n);const h={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[o][1].start},end:{...e[c][1].end}},g={type:"labelText",start:{...e[o+a+2][1].end},end:{...e[c-2][1].start}};return f=[["enter",h,t],["enter",m,t]],f=ra(f,e.slice(o+1,o+a+3)),f=ra(f,[["enter",g,t]]),f=ra(f,gf(t.parser.constructs.insideSpan.null,e.slice(o+a+4,c-3),t)),f=ra(f,[["exit",g,t],e[c-2],e[c-1],["exit",m,t]]),f=ra(f,e.slice(c+1)),f=ra(f,[["exit",h,t]]),Hr(e,o,e.length,f),e}function w9(e,t,n){const a=this;let l=a.events.length,o,c;for(;l--;)if((a.events[l][1].type==="labelImage"||a.events[l][1].type==="labelLink")&&!a.events[l][1]._balanced){o=a.events[l][1];break}return f;function f(k){return o?o._inactive?v(k):(c=a.parser.defined.includes(Ca(a.sliceSerialize({start:o.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(k),e.exit("labelMarker"),e.exit("labelEnd"),h):n(k)}function h(k){return k===40?e.attempt(g9,g,c?g:v)(k):k===91?e.attempt(y9,g,c?m:v)(k):c?g(k):v(k)}function m(k){return e.attempt(v9,g,v)(k)}function g(k){return t(k)}function v(k){return o._balanced=!0,n(k)}}function k9(e,t,n){return a;function a(v){return e.enter("resource"),e.enter("resourceMarker"),e.consume(v),e.exit("resourceMarker"),l}function l(v){return Zt(v)?Ic(e,o)(v):o(v)}function o(v){return v===41?g(v):tv(e,c,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(v)}function c(v){return Zt(v)?Ic(e,h)(v):g(v)}function f(v){return n(v)}function h(v){return v===34||v===39||v===40?rv(e,m,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(v):g(v)}function m(v){return Zt(v)?Ic(e,g)(v):g(v)}function g(v){return v===41?(e.enter("resourceMarker"),e.consume(v),e.exit("resourceMarker"),e.exit("resource"),t):n(v)}}function S9(e,t,n){const a=this;return l;function l(f){return nv.call(a,e,o,c,"reference","referenceMarker","referenceString")(f)}function o(f){return a.parser.defined.includes(Ca(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function c(f){return n(f)}}function j9(e,t,n){return a;function a(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),l}function l(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const C9={name:"labelStartImage",resolveAll:g1.resolveAll,tokenize:T9};function T9(e,t,n){const a=this;return l;function l(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),o}function o(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),c):n(f)}function c(f){return f===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):t(f)}}const A9={name:"labelStartLink",resolveAll:g1.resolveAll,tokenize:E9};function E9(e,t,n){const a=this;return l;function l(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),o}function o(c){return c===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(c):t(c)}}const Cm={name:"lineEnding",tokenize:N9};function N9(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),gt(e,t,"linePrefix")}}const Hd={name:"thematicBreak",tokenize:M9};function M9(e,t,n){let a=0,l;return o;function o(m){return e.enter("thematicBreak"),c(m)}function c(m){return l=m,f(m)}function f(m){return m===l?(e.enter("thematicBreakSequence"),h(m)):a>=3&&(m===null||Ke(m))?(e.exit("thematicBreak"),t(m)):n(m)}function h(m){return m===l?(e.consume(m),a++,h):(e.exit("thematicBreakSequence"),bt(m)?gt(e,f,"whitespace")(m):f(m))}}const kr={continuation:{tokenize:O9},exit:_9,name:"list",tokenize:R9},z9={partial:!0,tokenize:L9},D9={partial:!0,tokenize:I9};function R9(e,t,n){const a=this,l=a.events[a.events.length-1];let o=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,c=0;return f;function f(b){const T=a.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(T==="listUnordered"?!a.containerState.marker||b===a.containerState.marker:wp(b)){if(a.containerState.type||(a.containerState.type=T,e.enter(T,{_container:!0})),T==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(Hd,n,m)(b):m(b);if(!a.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(b)}return n(b)}function h(b){return wp(b)&&++c<10?(e.consume(b),h):(!a.interrupt||c<2)&&(a.containerState.marker?b===a.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),m(b)):n(b)}function m(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||b,e.check(Zc,a.interrupt?n:g,e.attempt(z9,k,v))}function g(b){return a.containerState.initialBlankLine=!0,o++,k(b)}function v(b){return bt(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),k):n(b)}function k(b){return a.containerState.size=o+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function O9(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(Zc,l,o);function l(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,gt(e,t,"listItemIndent",a.containerState.size+1)(f)}function o(f){return a.containerState.furtherBlankLines||!bt(f)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,c(f)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(D9,t,c)(f))}function c(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,gt(e,e.attempt(kr,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function I9(e,t,n){const a=this;return gt(e,l,"listItemIndent",a.containerState.size+1);function l(o){const c=a.events[a.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===a.containerState.size?t(o):n(o)}}function _9(e){e.exit(this.containerState.type)}function L9(e,t,n){const a=this;return gt(e,l,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(o){const c=a.events[a.events.length-1];return!bt(o)&&c&&c[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const yy={name:"setextUnderline",resolveTo:B9,tokenize:q9};function B9(e,t){let n=e.length,a,l,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){a=n;break}e[n][1].type==="paragraph"&&(l=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const c={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",o?(e.splice(l,0,["enter",c,t]),e.splice(o+1,0,["exit",e[a][1],t]),e[a][1].end={...e[o][1].end}):e[a][1]=c,e.push(["exit",c,t]),e}function q9(e,t,n){const a=this;let l;return o;function o(m){let g=a.events.length,v;for(;g--;)if(a.events[g][1].type!=="lineEnding"&&a.events[g][1].type!=="linePrefix"&&a.events[g][1].type!=="content"){v=a.events[g][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||v)?(e.enter("setextHeadingLine"),l=m,c(m)):n(m)}function c(m){return e.enter("setextHeadingLineSequence"),f(m)}function f(m){return m===l?(e.consume(m),f):(e.exit("setextHeadingLineSequence"),bt(m)?gt(e,h,"lineSuffix")(m):h(m))}function h(m){return m===null||Ke(m)?(e.exit("setextHeadingLine"),t(m)):n(m)}}const U9={tokenize:H9};function H9(e){const t=this,n=e.attempt(Zc,a,e.attempt(this.parser.constructs.flowInitial,l,gt(e,e.attempt(this.parser.constructs.flow,l,e.attempt(V8,l)),"linePrefix")));return n;function a(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function l(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const $9={resolveAll:iv()},F9=av("string"),P9=av("text");function av(e){return{resolveAll:iv(e==="text"?G9:void 0),tokenize:t};function t(n){const a=this,l=this.parser.constructs[e],o=n.attempt(l,c,f);return c;function c(g){return m(g)?o(g):f(g)}function f(g){if(g===null){n.consume(g);return}return n.enter("data"),n.consume(g),h}function h(g){return m(g)?(n.exit("data"),o(g)):(n.consume(g),h)}function m(g){if(g===null)return!0;const v=l[g];let k=-1;if(v)for(;++k<v.length;){const b=v[k];if(!b.previous||b.previous.call(a,a.previous))return!0}return!1}}}function iv(e){return t;function t(n,a){let l=-1,o;for(;++l<=n.length;)o===void 0?n[l]&&n[l][1].type==="data"&&(o=l,l++):(!n[l]||n[l][1].type!=="data")&&(l!==o+2&&(n[o][1].end=n[l-1][1].end,n.splice(o+2,l-o-2),l=o+2),o=void 0);return e?e(n,a):n}}function G9(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const a=e[n-1][1],l=t.sliceStream(a);let o=l.length,c=-1,f=0,h;for(;o--;){const m=l[o];if(typeof m=="string"){for(c=m.length;m.charCodeAt(c-1)===32;)f++,c--;if(c)break;c=-1}else if(m===-2)h=!0,f++;else if(m!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(f=0),f){const m={type:n===e.length||h||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?c:a.start._bufferIndex+c,_index:a.start._index+o,line:a.end.line,column:a.end.column-f,offset:a.end.offset-f},end:{...a.end}};a.end={...m.start},a.start.offset===a.end.offset?Object.assign(a,m):(e.splice(n,0,["enter",m,t],["exit",m,t]),n+=2)}n++}return e}const V9={42:kr,43:kr,45:kr,48:kr,49:kr,50:kr,51:kr,52:kr,53:kr,54:kr,55:kr,56:kr,57:kr,62:Z5},Y9={91:Z8},W9={[-2]:jm,[-1]:jm,32:jm},K9={35:r9,42:Hd,45:[yy,Hd],60:s9,61:yy,95:Hd,96:py,126:py},X9={38:J5,92:Q5},Z9={[-5]:Cm,[-4]:Cm,[-3]:Cm,33:C9,38:J5,42:kp,60:[A8,m9],91:A9,92:[t9,Q5],93:g1,95:kp,96:U8},Q9={null:[kp,$9]},J9={null:[42,95]},ew={null:[]},tw=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:J9,contentInitial:Y9,disable:ew,document:V9,flow:K9,flowInitial:W9,insideSpan:Q9,string:X9,text:Z9},Symbol.toStringTag,{value:"Module"}));function nw(e,t,n){let a={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const l={},o=[];let c=[],f=[];const h={attempt:K(ae),check:K(L),consume:M,enter:B,exit:U,interrupt:K(L,{interrupt:!0})},m={code:null,containerState:{},defineSkip:A,events:[],now:T,parser:e,previous:null,sliceSerialize:k,sliceStream:b,write:v};let g=t.tokenize.call(m,h);return t.resolveAll&&o.push(t),m;function v(he){return c=ra(c,he),q(),c[c.length-1]!==null?[]:(ie(t,0),m.events=gf(o,m.events,m),m.events)}function k(he,ce){return aw(b(he),ce)}function b(he){return rw(c,he)}function T(){const{_bufferIndex:he,_index:ce,line:Ie,column:be,offset:pe}=a;return{_bufferIndex:he,_index:ce,line:Ie,column:be,offset:pe}}function A(he){l[he.line]=he.column,F()}function q(){let he;for(;a._index<c.length;){const ce=c[a._index];if(typeof ce=="string")for(he=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===he&&a._bufferIndex<ce.length;)z(ce.charCodeAt(a._bufferIndex));else z(ce)}}function z(he){g=g(he)}function M(he){Ke(he)?(a.line++,a.column=1,a.offset+=he===-3?2:1,F()):he!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===c[a._index].length&&(a._bufferIndex=-1,a._index++)),m.previous=he}function B(he,ce){const Ie=ce||{};return Ie.type=he,Ie.start=T(),m.events.push(["enter",Ie,m]),f.push(Ie),Ie}function U(he){const ce=f.pop();return ce.end=T(),m.events.push(["exit",ce,m]),ce}function ae(he,ce){ie(he,ce.from)}function L(he,ce){ce.restore()}function K(he,ce){return Ie;function Ie(be,pe,J){let Y,ge,Te,H;return Array.isArray(be)?te(be):"tokenize"in be?te([be]):_(be);function _(ne){return we;function we(_e){const He=_e!==null&&ne[_e],wt=_e!==null&&ne.null,et=[...Array.isArray(He)?He:He?[He]:[],...Array.isArray(wt)?wt:wt?[wt]:[]];return te(et)(_e)}}function te(ne){return Y=ne,ge=0,ne.length===0?J:O(ne[ge])}function O(ne){return we;function we(_e){return H=Q(),Te=ne,ne.partial||(m.currentConstruct=ne),ne.name&&m.parser.constructs.disable.null.includes(ne.name)?Ae():ne.tokenize.call(ce?Object.assign(Object.create(m),ce):m,h,ee,Ae)(_e)}}function ee(ne){return he(Te,H),pe}function Ae(ne){return H.restore(),++ge<Y.length?O(Y[ge]):J}}}function ie(he,ce){he.resolveAll&&!o.includes(he)&&o.push(he),he.resolve&&Hr(m.events,ce,m.events.length-ce,he.resolve(m.events.slice(ce),m)),he.resolveTo&&(m.events=he.resolveTo(m.events,m))}function Q(){const he=T(),ce=m.previous,Ie=m.currentConstruct,be=m.events.length,pe=Array.from(f);return{from:be,restore:J};function J(){a=he,m.previous=ce,m.currentConstruct=Ie,m.events.length=be,f=pe,F()}}function F(){a.line in l&&a.column<2&&(a.column=l[a.line],a.offset+=l[a.line]-1)}}function rw(e,t){const n=t.start._index,a=t.start._bufferIndex,l=t.end._index,o=t.end._bufferIndex;let c;if(n===l)c=[e[n].slice(a,o)];else{if(c=e.slice(n,l),a>-1){const f=c[0];typeof f=="string"?c[0]=f.slice(a):c.shift()}o>0&&c.push(e[l].slice(0,o))}return c}function aw(e,t){let n=-1;const a=[];let l;for(;++n<e.length;){const o=e[n];let c;if(typeof o=="string")c=o;else switch(o){case-5:{c="\r";break}case-4:{c=`
|
|
49
|
+
`+d.stack}}var Tt=Object.prototype.hasOwnProperty,mt=e.unstable_scheduleCallback,At=e.unstable_cancelCallback,pn=e.unstable_shouldYield,en=e.unstable_requestPaint,ht=e.unstable_now,ur=e.unstable_getCurrentPriorityLevel,me=e.unstable_ImmediatePriority,Se=e.unstable_UserBlockingPriority,$e=e.unstable_NormalPriority,at=e.unstable_LowPriority,kt=e.unstable_IdlePriority,wn=e.log,Yr=e.unstable_setDisableYieldValue,Bt=null,dn=null;function Gn(r){if(typeof wn=="function"&&Yr(r),dn&&typeof dn.setStrictMode=="function")try{dn.setStrictMode(Bt,r)}catch{}}var _t=Math.clz32?Math.clz32:_f,Ta=Math.log,Tr=Math.LN2;function _f(r){return r>>>=0,r===0?32:31-(Ta(r)/Tr|0)|0}var $l=256,Fl=262144,$i=4194304;function zn(r){var i=r&42;if(i!==0)return i;switch(r&-r){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 r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function sa(r,i,s){var d=r.pendingLanes;if(d===0)return 0;var p=0,y=r.suspendedLanes,j=r.pingedLanes;r=r.warmLanes;var R=d&134217727;return R!==0?(d=R&~y,d!==0?p=zn(d):(j&=R,j!==0?p=zn(j):s||(s=R&~r,s!==0&&(p=zn(s))))):(R=d&~y,R!==0?p=zn(R):j!==0?p=zn(j):s||(s=d&~r,s!==0&&(p=zn(s)))),p===0?0:i!==0&&i!==p&&(i&y)===0&&(y=p&-p,s=i&-i,y>=s||y===32&&(s&4194048)!==0)?i:p}function Ft(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function Pl(r,i){switch(r){case 1:case 2:case 4:case 8:case 64:return i+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 i+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 ou(){var r=$i;return $i<<=1,($i&62914560)===0&&($i=4194304),r}function ai(r){for(var i=[],s=0;31>s;s++)i.push(r);return i}function Fi(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function Gl(r,i,s,d,p,y){var j=r.pendingLanes;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=s,r.entangledLanes&=s,r.errorRecoveryDisabledLanes&=s,r.shellSuspendCounter=0;var R=r.entanglements,V=r.expirationTimes,se=r.hiddenUpdates;for(s=j&~s;0<s;){var ye=31-_t(s),xe=1<<ye;R[ye]=0,V[ye]=-1;var ue=se[ye];if(ue!==null)for(se[ye]=null,ye=0;ye<ue.length;ye++){var de=ue[ye];de!==null&&(de.lane&=-536870913)}s&=~xe}d!==0&&n0(r,d,0),y!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=y&~(j&~i))}function n0(r,i,s){r.pendingLanes|=i,r.suspendedLanes&=~i;var d=31-_t(i);r.entangledLanes|=i,r.entanglements[d]=r.entanglements[d]|1073741824|s&261930}function uu(r,i){var s=r.entangledLanes|=i;for(r=r.entanglements;s;){var d=31-_t(s),p=1<<d;p&i|r[d]&i&&(r[d]|=i),s&=~p}}function r0(r,i){var s=i&-i;return s=(s&42)!==0?1:qs(s),(s&(r.suspendedLanes|i))!==0?0:s}function qs(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=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:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function cu(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function Us(){var r=Y.p;return r!==0?r:(r=window.event,r===void 0?32:R2(r.type))}function a0(r,i){var s=Y.p;try{return Y.p=r,i()}finally{Y.p=s}}var cr=Math.random().toString(36).slice(2),rn="__reactFiber$"+cr,gn="__reactProps$"+cr,Ar="__reactContainer$"+cr,Aa="__reactEvents$"+cr,du="__reactListeners$"+cr,Hs="__reactHandles$"+cr,i0="__reactResources$"+cr,oa="__reactMarker$"+cr;function Vl(r){delete r[rn],delete r[gn],delete r[Aa],delete r[du],delete r[Hs]}function Ea(r){var i=r[rn];if(i)return i;for(var s=r.parentNode;s;){if(i=s[Ar]||s[rn]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(r=y2(r);r!==null;){if(s=r[rn])return s;r=y2(r)}return i}r=s,s=r.parentNode}return null}function Na(r){if(r=r[rn]||r[Ar]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function ii(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function Pi(r){var i=r[i0];return i||(i=r[i0]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function yn(r){r[oa]=!0}var ua=new Set,$s={};function Ma(r,i){Gi(r,i),Gi(r+"Capture",i)}function Gi(r,i){for($s[r]=i,r=0;r<i.length;r++)ua.add(i[r])}var Lf=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]*$"),Yl={},fu={};function Fs(r){return Tt.call(fu,r)?!0:Tt.call(Yl,r)?!1:Lf.test(r)?fu[r]=!0:(Yl[r]=!0,!1)}function Ps(r,i,s){if(Fs(i))if(s===null)r.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var d=i.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+s)}}function Wl(r,i,s){if(s===null)r.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(i);return}r.setAttribute(i,""+s)}}function Ln(r,i,s,d){if(d===null)r.removeAttribute(s);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(s);return}r.setAttributeNS(i,s,""+d)}}function kn(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function l0(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function za(r,i,s){var d=Object.getOwnPropertyDescriptor(r.constructor.prototype,i);if(!r.hasOwnProperty(i)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var p=d.get,y=d.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return p.call(this)},set:function(j){s=""+j,y.call(this,j)}}),Object.defineProperty(r,i,{enumerable:d.enumerable}),{getValue:function(){return s},setValue:function(j){s=""+j},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function li(r){if(!r._valueTracker){var i=l0(r)?"checked":"value";r._valueTracker=za(r,i,""+r[i])}}function hu(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var s=i.getValue(),d="";return r&&(d=l0(r)?r.checked?"true":"false":r.value),r=d,r!==s?(i.setValue(r),!0):!1}function dr(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var ca=/[\n"\\]/g;function Sn(r){return r.replace(ca,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Gs(r,i,s,d,p,y,j,R){r.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?r.type=j:r.removeAttribute("type"),i!=null?j==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+kn(i)):r.value!==""+kn(i)&&(r.value=""+kn(i)):j!=="submit"&&j!=="reset"||r.removeAttribute("value"),i!=null?Vs(r,j,kn(i)):s!=null?Vs(r,j,kn(s)):d!=null&&r.removeAttribute("value"),p==null&&y!=null&&(r.defaultChecked=!!y),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?r.name=""+kn(R):r.removeAttribute("name")}function Vi(r,i,s,d,p,y,j,R){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(r.type=y),i!=null||s!=null){if(!(y!=="submit"&&y!=="reset"||i!=null)){li(r);return}s=s!=null?""+kn(s):"",i=i!=null?""+kn(i):s,R||i===r.value||(r.value=i),r.defaultValue=i}d=d??p,d=typeof d!="function"&&typeof d!="symbol"&&!!d,r.checked=R?r.checked:!!d,r.defaultChecked=!!d,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(r.name=j),li(r)}function Vs(r,i,s){i==="number"&&dr(r.ownerDocument)===r||r.defaultValue===""+s||(r.defaultValue=""+s)}function da(r,i,s,d){if(r=r.options,i){i={};for(var p=0;p<s.length;p++)i["$"+s[p]]=!0;for(s=0;s<r.length;s++)p=i.hasOwnProperty("$"+r[s].value),r[s].selected!==p&&(r[s].selected=p),p&&d&&(r[s].defaultSelected=!0)}else{for(s=""+kn(s),i=null,p=0;p<r.length;p++){if(r[p].value===s){r[p].selected=!0,d&&(r[p].defaultSelected=!0);return}i!==null||r[p].disabled||(i=r[p])}i!==null&&(i.selected=!0)}}function s0(r,i,s){if(i!=null&&(i=""+kn(i),i!==r.value&&(r.value=i),s==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=s!=null?""+kn(s):""}function Yi(r,i,s,d){if(i==null){if(d!=null){if(s!=null)throw Error(a(92));if(pe(d)){if(1<d.length)throw Error(a(93));d=d[0]}s=d}s==null&&(s=""),i=s}s=kn(i),r.defaultValue=s,d=r.textContent,d===s&&d!==""&&d!==null&&(r.value=d),li(r)}function Er(r,i){if(i){var s=r.firstChild;if(s&&s===r.lastChild&&s.nodeType===3){s.nodeValue=i;return}}r.textContent=i}var mu=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 Kl(r,i,s){var d=i.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?d?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":d?r.setProperty(i,s):typeof s!="number"||s===0||mu.has(i)?i==="float"?r.cssFloat=s:r[i]=(""+s).trim():r[i]=s+"px"}function pu(r,i,s){if(i!=null&&typeof i!="object")throw Error(a(62));if(r=r.style,s!=null){for(var d in s)!s.hasOwnProperty(d)||i!=null&&i.hasOwnProperty(d)||(d.indexOf("--")===0?r.setProperty(d,""):d==="float"?r.cssFloat="":r[d]="");for(var p in i)d=i[p],i.hasOwnProperty(p)&&s[p]!==d&&Kl(r,p,d)}else for(var y in i)i.hasOwnProperty(y)&&Kl(r,y,i[y])}function si(r){if(r.indexOf("-")===-1)return!1;switch(r){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 Wr=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"]]),fa=/^[\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 Wi(r){return fa.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function er(){}var oi=null;function Xl(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Yt=null,Kr=null;function o0(r){var i=Na(r);if(i&&(r=i.stateNode)){var s=r[gn]||null;e:switch(r=i.stateNode,i.type){case"input":if(Gs(r,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),i=s.name,s.type==="radio"&&i!=null){for(s=r;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Sn(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var d=s[i];if(d!==r&&d.form===r.form){var p=d[gn]||null;if(!p)throw Error(a(90));Gs(d,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(i=0;i<s.length;i++)d=s[i],d.form===r.form&&hu(d)}break e;case"textarea":s0(r,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&da(r,!!s.multiple,i,!1)}}}var Zl=!1;function gu(r,i,s){if(Zl)return r(i,s);Zl=!0;try{var d=r(i);return d}finally{if(Zl=!1,(Yt!==null||Kr!==null)&&(Z0(),Yt&&(i=Yt,r=Kr,Kr=Yt=null,o0(i),r)))for(i=0;i<r.length;i++)o0(r[i])}}function Ql(r,i){var s=r.stateNode;if(s===null)return null;var d=s[gn]||null;if(d===null)return null;s=d[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(r=r.type,d=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!d;break e;default:r=!1}if(r)return null;if(s&&typeof s!="function")throw Error(a(231,i,typeof s));return s}var Vn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),yu=!1;if(Vn)try{var Jl={};Object.defineProperty(Jl,"passive",{get:function(){yu=!0}}),window.addEventListener("test",Jl,Jl),window.removeEventListener("test",Jl,Jl)}catch{yu=!1}var Da=null,Ys=null,ui=null;function vu(){if(ui)return ui;var r,i=Ys,s=i.length,d,p="value"in Da?Da.value:Da.textContent,y=p.length;for(r=0;r<s&&i[r]===p[r];r++);var j=s-r;for(d=1;d<=j&&i[s-d]===p[y-d];d++);return ui=p.slice(r,1<d?1-d:void 0)}function Ki(r){var i=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&i===13&&(r=13)):r=i,r===10&&(r=13),32<=r||r===13?r:0}function ha(){return!0}function es(){return!1}function Un(r){function i(s,d,p,y,j){this._reactName=s,this._targetInst=p,this.type=d,this.nativeEvent=y,this.target=j,this.currentTarget=null;for(var R in r)r.hasOwnProperty(R)&&(s=r[R],this[R]=s?s(y):y[R]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?ha:es,this.isPropagationStopped=es,this}return v(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=ha)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=ha)},persist:function(){},isPersistent:ha}),i}var Nr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Xi=Un(Nr),Ra=v({},Nr,{view:0,detail:0}),xu=Un(Ra),ts,ci,Zi,Oa=v({},Ra,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:rs,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==Zi&&(Zi&&r.type==="mousemove"?(ts=r.screenX-Zi.screenX,ci=r.screenY-Zi.screenY):ci=ts=0,Zi=r),ts)},movementY:function(r){return"movementY"in r?r.movementY:ci}}),Qi=Un(Oa),Ws=v({},Oa,{dataTransfer:0}),Ks=Un(Ws),ns=v({},Ra,{relatedTarget:0}),Ia=Un(ns),Ji=v({},Nr,{animationName:0,elapsedTime:0,pseudoElement:0}),_a=Un(Ji),fr=v({},Nr,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),hr=Un(fr),el=v({},Nr,{data:0}),tl=Un(el),Xs={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Zs={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"},Qs={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Js(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=Qs[r])?!!i[r]:!1}function rs(){return Js}var bu=v({},Ra,{key:function(r){if(r.key){var i=Xs[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=Ki(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?Zs[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:rs,charCode:function(r){return r.type==="keypress"?Ki(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Ki(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),eo=Un(bu),Ze=v({},Oa,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),wu=Un(Ze),Xr=v({},Ra,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rs}),vn=Un(Xr),ku=v({},Nr,{propertyName:0,elapsedTime:0,pseudoElement:0}),di=Un(ku),to=v({},Oa,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),Nt=Un(to),nl=v({},Nr,{newState:0,oldState:0}),no=Un(nl),as=[9,13,27,32],fi=Vn&&"CompositionEvent"in window,hi=null;Vn&&"documentMode"in document&&(hi=document.documentMode);var mi=Vn&&"TextEvent"in window&&!hi,u0=Vn&&(!fi||hi&&8<hi&&11>=hi),c0=" ",rl=!1;function Su(r,i){switch(r){case"keyup":return as.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ro(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var La=!1;function ao(r,i){switch(r){case"compositionend":return ro(i);case"keypress":return i.which!==32?null:(rl=!0,c0);case"textInput":return r=i.data,r===c0&&rl?null:r;default:return null}}function Bf(r,i){if(La)return r==="compositionend"||!fi&&Su(r,i)?(r=vu(),ui=Ys=Da=null,La=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return u0&&i.locale!=="ko"?null:i.data;default:return null}}var d0={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 io(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!d0[r.type]:i==="textarea"}function is(r,i,s,d){Yt?Kr?Kr.push(d):Kr=[d]:Yt=d,i=ad(i,"onChange"),0<i.length&&(s=new Xi("onChange","change",null,s,d),r.push({event:s,listeners:i}))}var ls=null,ma=null;function qf(r){r2(r,0)}function lo(r){var i=ii(r);if(hu(i))return r}function f0(r,i){if(r==="change")return i}var so=!1;if(Vn){var pa;if(Vn){var pi="oninput"in document;if(!pi){var Pe=document.createElement("div");Pe.setAttribute("oninput","return;"),pi=typeof Pe.oninput=="function"}pa=pi}else pa=!1;so=pa&&(!document.documentMode||9<document.documentMode)}function ss(){ls&&(ls.detachEvent("onpropertychange",al),ma=ls=null)}function al(r){if(r.propertyName==="value"&&lo(ma)){var i=[];is(i,ma,r,Xl(r)),gu(qf,i)}}function h0(r,i,s){r==="focusin"?(ss(),ls=i,ma=s,ls.attachEvent("onpropertychange",al)):r==="focusout"&&ss()}function ju(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return lo(ma)}function Cu(r,i){if(r==="click")return lo(i)}function Uf(r,i){if(r==="input"||r==="change")return lo(i)}function Yn(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var tr=typeof Object.is=="function"?Object.is:Yn;function os(r,i){if(tr(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var s=Object.keys(r),d=Object.keys(i);if(s.length!==d.length)return!1;for(d=0;d<s.length;d++){var p=s[d];if(!Tt.call(i,p)||!tr(r[p],i[p]))return!1}return!0}function us(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function m0(r,i){var s=us(r);r=0;for(var d;s;){if(s.nodeType===3){if(d=r+s.textContent.length,r<=i&&d>=i)return{node:s,offset:i-r};r=d}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=us(s)}}function Tu(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Tu(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function oo(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=dr(r.document);i instanceof r.HTMLIFrameElement;){try{var s=typeof i.contentWindow.location.href=="string"}catch{s=!1}if(s)r=i.contentWindow;else break;i=dr(r.document)}return i}function Au(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i&&(i==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||i==="textarea"||r.contentEditable==="true")}var Hf=Vn&&"documentMode"in document&&11>=document.documentMode,ga=null,cs=null,gi=null,Eu=!1;function uo(r,i,s){var d=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Eu||ga==null||ga!==dr(d)||(d=ga,"selectionStart"in d&&Au(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),gi&&os(gi,d)||(gi=d,d=ad(cs,"onSelect"),0<d.length&&(i=new Xi("onSelect","select",null,i,s),r.push({event:i,listeners:d}),i.target=ga)))}function yi(r,i){var s={};return s[r.toLowerCase()]=i.toLowerCase(),s["Webkit"+r]="webkit"+i,s["Moz"+r]="moz"+i,s}var il={animationend:yi("Animation","AnimationEnd"),animationiteration:yi("Animation","AnimationIteration"),animationstart:yi("Animation","AnimationStart"),transitionrun:yi("Transition","TransitionRun"),transitionstart:yi("Transition","TransitionStart"),transitioncancel:yi("Transition","TransitionCancel"),transitionend:yi("Transition","TransitionEnd")},ds={},Nu={};Vn&&(Nu=document.createElement("div").style,"AnimationEvent"in window||(delete il.animationend.animation,delete il.animationiteration.animation,delete il.animationstart.animation),"TransitionEvent"in window||delete il.transitionend.transition);function vi(r){if(ds[r])return ds[r];if(!il[r])return r;var i=il[r],s;for(s in i)if(i.hasOwnProperty(s)&&s in Nu)return ds[r]=i[s];return r}var p0=vi("animationend"),Mu=vi("animationiteration"),g0=vi("animationstart"),$f=vi("transitionrun"),Ff=vi("transitionstart"),Pf=vi("transitioncancel"),y0=vi("transitionend"),v0=new Map,zu="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(" ");zu.push("scrollEnd");function Mr(r,i){v0.set(r,i),Ma(i,[r])}var co=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},mr=[],ll=0,Du=0;function fo(){for(var r=ll,i=Du=ll=0;i<r;){var s=mr[i];mr[i++]=null;var d=mr[i];mr[i++]=null;var p=mr[i];mr[i++]=null;var y=mr[i];if(mr[i++]=null,d!==null&&p!==null){var j=d.pending;j===null?p.next=p:(p.next=j.next,j.next=p),d.pending=p}y!==0&&x0(s,p,y)}}function ho(r,i,s,d){mr[ll++]=r,mr[ll++]=i,mr[ll++]=s,mr[ll++]=d,Du|=d,r.lanes|=d,r=r.alternate,r!==null&&(r.lanes|=d)}function Ru(r,i,s,d){return ho(r,i,s,d),mo(r)}function xi(r,i){return ho(r,null,null,i),mo(r)}function x0(r,i,s){r.lanes|=s;var d=r.alternate;d!==null&&(d.lanes|=s);for(var p=!1,y=r.return;y!==null;)y.childLanes|=s,d=y.alternate,d!==null&&(d.childLanes|=s),y.tag===22&&(r=y.stateNode,r===null||r._visibility&1||(p=!0)),r=y,y=y.return;return r.tag===3?(y=r.stateNode,p&&i!==null&&(p=31-_t(s),r=y.hiddenUpdates,d=r[p],d===null?r[p]=[i]:d.push(i),i.lane=s|536870912),y):null}function mo(r){if(50<sc)throw sc=0,qh=null,Error(a(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var sl={};function b0(r,i,s,d){this.tag=r,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function tn(r,i,s,d){return new b0(r,i,s,d)}function po(r){return r=r.prototype,!(!r||!r.isReactComponent)}function ya(r,i){var s=r.alternate;return s===null?(s=tn(r.tag,i,r.key,r.mode),s.elementType=r.elementType,s.type=r.type,s.stateNode=r.stateNode,s.alternate=r,r.alternate=s):(s.pendingProps=i,s.type=r.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=r.flags&65011712,s.childLanes=r.childLanes,s.lanes=r.lanes,s.child=r.child,s.memoizedProps=r.memoizedProps,s.memoizedState=r.memoizedState,s.updateQueue=r.updateQueue,i=r.dependencies,s.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},s.sibling=r.sibling,s.index=r.index,s.ref=r.ref,s.refCleanup=r.refCleanup,s}function w0(r,i){r.flags&=65011714;var s=r.alternate;return s===null?(r.childLanes=0,r.lanes=i,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=s.childLanes,r.lanes=s.lanes,r.child=s.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=s.memoizedProps,r.memoizedState=s.memoizedState,r.updateQueue=s.updateQueue,r.type=s.type,i=s.dependencies,r.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),r}function go(r,i,s,d,p,y){var j=0;if(d=r,typeof r=="function")po(r)&&(j=1);else if(typeof r=="string")j=J7(r,s,ee.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case Q:return r=tn(31,s,i,p),r.elementType=Q,r.lanes=y,r;case A:return Ba(s.children,p,y,i);case q:j=8,p|=24;break;case z:return r=tn(12,s,i,p|2),r.elementType=z,r.lanes=y,r;case ne:return r=tn(13,s,i,p),r.elementType=ne,r.lanes=y,r;case L:return r=tn(19,s,i,p),r.elementType=L,r.lanes=y,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case B:j=10;break e;case M:j=9;break e;case U:j=11;break e;case K:j=14;break e;case ie:j=16,d=null;break e}j=29,s=Error(a(130,r===null?"null":typeof r,"")),d=null}return i=tn(j,s,i,p),i.elementType=r,i.type=d,i.lanes=y,i}function Ba(r,i,s,d){return r=tn(7,r,d,i),r.lanes=s,r}function Ou(r,i,s){return r=tn(6,r,null,i),r.lanes=s,r}function yo(r){var i=tn(18,null,null,0);return i.stateNode=r,i}function Iu(r,i,s){return i=tn(4,r.children!==null?r.children:[],r.key,i),i.lanes=s,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var _u=new WeakMap;function nr(r,i){if(typeof r=="object"&&r!==null){var s=_u.get(r);return s!==void 0?s:(i={value:r,source:i,stack:Lt(i)},_u.set(r,i),i)}return{value:r,source:i,stack:Lt(i)}}var ol=[],ul=0,vo=null,Zr=0,Hn=[],pr=0,va=null,zr=1,Qr="";function Jr(r,i){ol[ul++]=Zr,ol[ul++]=vo,vo=r,Zr=i}function k0(r,i,s){Hn[pr++]=zr,Hn[pr++]=Qr,Hn[pr++]=va,va=r;var d=zr;r=Qr;var p=32-_t(d)-1;d&=~(1<<p),s+=1;var y=32-_t(i)+p;if(30<y){var j=p-p%5;y=(d&(1<<j)-1).toString(32),d>>=j,p-=j,zr=1<<32-_t(i)+p|s<<p|d,Qr=y+r}else zr=1<<y|s<<p|d,Qr=r}function Lu(r){r.return!==null&&(Jr(r,1),k0(r,1,0))}function Bu(r){for(;r===vo;)vo=ol[--ul],ol[ul]=null,Zr=ol[--ul],ol[ul]=null;for(;r===va;)va=Hn[--pr],Hn[pr]=null,Qr=Hn[--pr],Hn[pr]=null,zr=Hn[--pr],Hn[pr]=null}function S0(r,i){Hn[pr++]=zr,Hn[pr++]=Qr,Hn[pr++]=va,zr=i.id,Qr=i.overflow,va=r}var Dn=null,Wt=null,yt=!1,qa=null,gr=!1,qu=Error(a(519));function Ua(r){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw hs(nr(i,r)),qu}function j0(r){var i=r.stateNode,s=r.type,d=r.memoizedProps;switch(i[rn]=r,i[gn]=d,s){case"dialog":xt("cancel",i),xt("close",i);break;case"iframe":case"object":case"embed":xt("load",i);break;case"video":case"audio":for(s=0;s<uc.length;s++)xt(uc[s],i);break;case"source":xt("error",i);break;case"img":case"image":case"link":xt("error",i),xt("load",i);break;case"details":xt("toggle",i);break;case"input":xt("invalid",i),Vi(i,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":xt("invalid",i);break;case"textarea":xt("invalid",i),Yi(i,d.value,d.defaultValue,d.children)}s=d.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||i.textContent===""+s||d.suppressHydrationWarning===!0||s2(i.textContent,s)?(d.popover!=null&&(xt("beforetoggle",i),xt("toggle",i)),d.onScroll!=null&&xt("scroll",i),d.onScrollEnd!=null&&xt("scrollend",i),d.onClick!=null&&(i.onclick=er),i=!0):i=!1,i||Ua(r,!0)}function C0(r){for(Dn=r.return;Dn;)switch(Dn.tag){case 5:case 31:case 13:gr=!1;return;case 27:case 3:gr=!0;return;default:Dn=Dn.return}}function xa(r){if(r!==Dn)return!1;if(!yt)return C0(r),yt=!0,!1;var i=r.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=r.type,s=!(s!=="form"&&s!=="button")||em(r.type,r.memoizedProps)),s=!s),s&&Wt&&Ua(r),C0(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));Wt=g2(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));Wt=g2(r)}else i===27?(i=Wt,kl(r.type)?(r=im,im=null,Wt=r):Wt=i):Wt=Dn?ta(r.stateNode.nextSibling):null;return!0}function bi(){Wt=Dn=null,yt=!1}function fs(){var r=qa;return r!==null&&(br===null?br=r:br.push.apply(br,r),qa=null),r}function hs(r){qa===null?qa=[r]:qa.push(r)}var Uu=_(null),Dr=null,ba=null;function Wn(r,i,s){O(Uu,i._currentValue),i._currentValue=s}function Rr(r){r._currentValue=Uu.current,te(Uu)}function xo(r,i,s){for(;r!==null;){var d=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,d!==null&&(d.childLanes|=i)):d!==null&&(d.childLanes&i)!==i&&(d.childLanes|=i),r===s)break;r=r.return}}function bo(r,i,s,d){var p=r.child;for(p!==null&&(p.return=r);p!==null;){var y=p.dependencies;if(y!==null){var j=p.child;y=y.firstContext;e:for(;y!==null;){var R=y;y=p;for(var V=0;V<i.length;V++)if(R.context===i[V]){y.lanes|=s,R=y.alternate,R!==null&&(R.lanes|=s),xo(y.return,s,r),d||(j=null);break e}y=R.next}}else if(p.tag===18){if(j=p.return,j===null)throw Error(a(341));j.lanes|=s,y=j.alternate,y!==null&&(y.lanes|=s),xo(j,s,r),j=null}else j=p.child;if(j!==null)j.return=p;else for(j=p;j!==null;){if(j===r){j=null;break}if(p=j.sibling,p!==null){p.return=j.return,j=p;break}j=j.return}p=j}}function Ha(r,i,s,d){r=null;for(var p=i,y=!1;p!==null;){if(!y){if((p.flags&524288)!==0)y=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var j=p.alternate;if(j===null)throw Error(a(387));if(j=j.memoizedProps,j!==null){var R=p.type;tr(p.pendingProps.value,j.value)||(r!==null?r.push(R):r=[R])}}else if(p===we.current){if(j=p.alternate,j===null)throw Error(a(387));j.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(mc):r=[mc])}p=p.return}r!==null&&bo(i,r,s,d),i.flags|=262144}function $a(r){for(r=r.firstContext;r!==null;){if(!tr(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function wi(r){Dr=r,ba=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function Rn(r){return cl(Dr,r)}function wo(r,i){return Dr===null&&wi(r),cl(r,i)}function cl(r,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},ba===null){if(r===null)throw Error(a(308));ba=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else ba=ba.next=i;return s}var Gf=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(s,d){r.push(d)}};this.abort=function(){i.aborted=!0,r.forEach(function(s){return s()})}},T0=e.unstable_scheduleCallback,Vf=e.unstable_NormalPriority,Jt={$$typeof:B,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ki(){return{controller:new Gf,data:new Map,refCount:0}}function wa(r){r.refCount--,r.refCount===0&&T0(Vf,function(){r.controller.abort()})}var ms=null,Hu=0,dl=0,Et=null;function Fa(r,i){if(ms===null){var s=ms=[];Hu=0,dl=Gh(),Et={status:"pending",value:void 0,then:function(d){s.push(d)}}}return Hu++,i.then(A0,A0),i}function A0(){if(--Hu===0&&ms!==null){Et!==null&&(Et.status="fulfilled");var r=ms;ms=null,dl=0,Et=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function Or(r,i){var s=[],d={status:"pending",value:null,reason:null,then:function(p){s.push(p)}};return r.then(function(){d.status="fulfilled",d.value=i;for(var p=0;p<s.length;p++)(0,s[p])(i)},function(p){for(d.status="rejected",d.reason=p,p=0;p<s.length;p++)(0,s[p])(void 0)}),d}var E0=J.S;J.S=function(r,i){zg=ht(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&Fa(r,i),E0!==null&&E0(r,i)};var $n=_(null);function $u(){var r=$n.current;return r!==null?r:Kt.pooledCache}function ps(r,i){i===null?O($n,$n.current):O($n,i.pool)}function N0(){var r=$u();return r===null?null:{parent:Jt._currentValue,pool:r}}var Pa=Error(a(460)),Fu=Error(a(474)),ko=Error(a(542)),So={then:function(){}};function Pu(r){return r=r.status,r==="fulfilled"||r==="rejected"}function Gu(r,i,s){switch(s=r[s],s===void 0?r.push(i):s!==i&&(i.then(er,er),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,C(r),r;default:if(typeof i.status=="string")i.then(er,er);else{if(r=Kt,r!==null&&100<r.shellSuspendCounter)throw Error(a(482));r=i,r.status="pending",r.then(function(d){if(i.status==="pending"){var p=i;p.status="fulfilled",p.value=d}},function(d){if(i.status==="pending"){var p=i;p.status="rejected",p.reason=d}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,C(r),r}throw Va=i,Pa}}function Ga(r){try{var i=r._init;return i(r._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Va=s,Pa):s}}var Va=null;function x(){if(Va===null)throw Error(a(459));var r=Va;return Va=null,r}function C(r){if(r===Pa||r===ko)throw Error(a(483))}var N=null,$=0;function W(r){var i=$;return $+=1,N===null&&(N=[]),Gu(N,r,i)}function oe(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function je(r,i){throw i.$$typeof===k?Error(a(525)):(r=Object.prototype.toString.call(i),Error(a(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r)))}function Ve(r){function i(ae,X){if(r){var le=ae.deletions;le===null?(ae.deletions=[X],ae.flags|=16):le.push(X)}}function s(ae,X){if(!r)return null;for(;X!==null;)i(ae,X),X=X.sibling;return null}function d(ae){for(var X=new Map;ae!==null;)ae.key!==null?X.set(ae.key,ae):X.set(ae.index,ae),ae=ae.sibling;return X}function p(ae,X){return ae=ya(ae,X),ae.index=0,ae.sibling=null,ae}function y(ae,X,le){return ae.index=le,r?(le=ae.alternate,le!==null?(le=le.index,le<X?(ae.flags|=67108866,X):le):(ae.flags|=67108866,X)):(ae.flags|=1048576,X)}function j(ae){return r&&ae.alternate===null&&(ae.flags|=67108866),ae}function R(ae,X,le,ve){return X===null||X.tag!==6?(X=Ou(le,ae.mode,ve),X.return=ae,X):(X=p(X,le),X.return=ae,X)}function V(ae,X,le,ve){var Qe=le.type;return Qe===A?ye(ae,X,le.props.children,ve,le.key):X!==null&&(X.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===ie&&Ga(Qe)===X.type)?(X=p(X,le.props),oe(X,le),X.return=ae,X):(X=go(le.type,le.key,le.props,null,ae.mode,ve),oe(X,le),X.return=ae,X)}function se(ae,X,le,ve){return X===null||X.tag!==4||X.stateNode.containerInfo!==le.containerInfo||X.stateNode.implementation!==le.implementation?(X=Iu(le,ae.mode,ve),X.return=ae,X):(X=p(X,le.children||[]),X.return=ae,X)}function ye(ae,X,le,ve,Qe){return X===null||X.tag!==7?(X=Ba(le,ae.mode,ve,Qe),X.return=ae,X):(X=p(X,le),X.return=ae,X)}function xe(ae,X,le){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return X=Ou(""+X,ae.mode,le),X.return=ae,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case b:return le=go(X.type,X.key,X.props,null,ae.mode,le),oe(le,X),le.return=ae,le;case T:return X=Iu(X,ae.mode,le),X.return=ae,X;case ie:return X=Ga(X),xe(ae,X,le)}if(pe(X)||ce(X))return X=Ba(X,ae.mode,le,null),X.return=ae,X;if(typeof X.then=="function")return xe(ae,W(X),le);if(X.$$typeof===B)return xe(ae,wo(ae,X),le);je(ae,X)}return null}function ue(ae,X,le,ve){var Qe=X!==null?X.key:null;if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return Qe!==null?null:R(ae,X,""+le,ve);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case b:return le.key===Qe?V(ae,X,le,ve):null;case T:return le.key===Qe?se(ae,X,le,ve):null;case ie:return le=Ga(le),ue(ae,X,le,ve)}if(pe(le)||ce(le))return Qe!==null?null:ye(ae,X,le,ve,null);if(typeof le.then=="function")return ue(ae,X,W(le),ve);if(le.$$typeof===B)return ue(ae,X,wo(ae,le),ve);je(ae,le)}return null}function de(ae,X,le,ve,Qe){if(typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint")return ae=ae.get(le)||null,R(X,ae,""+ve,Qe);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case b:return ae=ae.get(ve.key===null?le:ve.key)||null,V(X,ae,ve,Qe);case T:return ae=ae.get(ve.key===null?le:ve.key)||null,se(X,ae,ve,Qe);case ie:return ve=Ga(ve),de(ae,X,le,ve,Qe)}if(pe(ve)||ce(ve))return ae=ae.get(le)||null,ye(X,ae,ve,Qe,null);if(typeof ve.then=="function")return de(ae,X,le,W(ve),Qe);if(ve.$$typeof===B)return de(ae,X,le,wo(X,ve),Qe);je(X,ve)}return null}function Ge(ae,X,le,ve){for(var Qe=null,zt=null,Ye=X,dt=X=0,jt=null;Ye!==null&&dt<le.length;dt++){Ye.index>dt?(jt=Ye,Ye=null):jt=Ye.sibling;var Dt=ue(ae,Ye,le[dt],ve);if(Dt===null){Ye===null&&(Ye=jt);break}r&&Ye&&Dt.alternate===null&&i(ae,Ye),X=y(Dt,X,dt),zt===null?Qe=Dt:zt.sibling=Dt,zt=Dt,Ye=jt}if(dt===le.length)return s(ae,Ye),yt&&Jr(ae,dt),Qe;if(Ye===null){for(;dt<le.length;dt++)Ye=xe(ae,le[dt],ve),Ye!==null&&(X=y(Ye,X,dt),zt===null?Qe=Ye:zt.sibling=Ye,zt=Ye);return yt&&Jr(ae,dt),Qe}for(Ye=d(Ye);dt<le.length;dt++)jt=de(Ye,ae,dt,le[dt],ve),jt!==null&&(r&&jt.alternate!==null&&Ye.delete(jt.key===null?dt:jt.key),X=y(jt,X,dt),zt===null?Qe=jt:zt.sibling=jt,zt=jt);return r&&Ye.forEach(function(Al){return i(ae,Al)}),yt&&Jr(ae,dt),Qe}function rt(ae,X,le,ve){if(le==null)throw Error(a(151));for(var Qe=null,zt=null,Ye=X,dt=X=0,jt=null,Dt=le.next();Ye!==null&&!Dt.done;dt++,Dt=le.next()){Ye.index>dt?(jt=Ye,Ye=null):jt=Ye.sibling;var Al=ue(ae,Ye,Dt.value,ve);if(Al===null){Ye===null&&(Ye=jt);break}r&&Ye&&Al.alternate===null&&i(ae,Ye),X=y(Al,X,dt),zt===null?Qe=Al:zt.sibling=Al,zt=Al,Ye=jt}if(Dt.done)return s(ae,Ye),yt&&Jr(ae,dt),Qe;if(Ye===null){for(;!Dt.done;dt++,Dt=le.next())Dt=xe(ae,Dt.value,ve),Dt!==null&&(X=y(Dt,X,dt),zt===null?Qe=Dt:zt.sibling=Dt,zt=Dt);return yt&&Jr(ae,dt),Qe}for(Ye=d(Ye);!Dt.done;dt++,Dt=le.next())Dt=de(Ye,ae,dt,Dt.value,ve),Dt!==null&&(r&&Dt.alternate!==null&&Ye.delete(Dt.key===null?dt:Dt.key),X=y(Dt,X,dt),zt===null?Qe=Dt:zt.sibling=Dt,zt=Dt);return r&&Ye.forEach(function(cb){return i(ae,cb)}),yt&&Jr(ae,dt),Qe}function Vt(ae,X,le,ve){if(typeof le=="object"&&le!==null&&le.type===A&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case b:e:{for(var Qe=le.key;X!==null;){if(X.key===Qe){if(Qe=le.type,Qe===A){if(X.tag===7){s(ae,X.sibling),ve=p(X,le.props.children),ve.return=ae,ae=ve;break e}}else if(X.elementType===Qe||typeof Qe=="object"&&Qe!==null&&Qe.$$typeof===ie&&Ga(Qe)===X.type){s(ae,X.sibling),ve=p(X,le.props),oe(ve,le),ve.return=ae,ae=ve;break e}s(ae,X);break}else i(ae,X);X=X.sibling}le.type===A?(ve=Ba(le.props.children,ae.mode,ve,le.key),ve.return=ae,ae=ve):(ve=go(le.type,le.key,le.props,null,ae.mode,ve),oe(ve,le),ve.return=ae,ae=ve)}return j(ae);case T:e:{for(Qe=le.key;X!==null;){if(X.key===Qe)if(X.tag===4&&X.stateNode.containerInfo===le.containerInfo&&X.stateNode.implementation===le.implementation){s(ae,X.sibling),ve=p(X,le.children||[]),ve.return=ae,ae=ve;break e}else{s(ae,X);break}else i(ae,X);X=X.sibling}ve=Iu(le,ae.mode,ve),ve.return=ae,ae=ve}return j(ae);case ie:return le=Ga(le),Vt(ae,X,le,ve)}if(pe(le))return Ge(ae,X,le,ve);if(ce(le)){if(Qe=ce(le),typeof Qe!="function")throw Error(a(150));return le=Qe.call(le),rt(ae,X,le,ve)}if(typeof le.then=="function")return Vt(ae,X,W(le),ve);if(le.$$typeof===B)return Vt(ae,X,wo(ae,le),ve);je(ae,le)}return typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint"?(le=""+le,X!==null&&X.tag===6?(s(ae,X.sibling),ve=p(X,le),ve.return=ae,ae=ve):(s(ae,X),ve=Ou(le,ae.mode,ve),ve.return=ae,ae=ve),j(ae)):s(ae,X)}return function(ae,X,le,ve){try{$=0;var Qe=Vt(ae,X,le,ve);return N=null,Qe}catch(Ye){if(Ye===Pa||Ye===ko)throw Ye;var zt=tn(29,Ye,null,ae.mode);return zt.lanes=ve,zt.return=ae,zt}finally{}}}var De=Ve(!0),Be=Ve(!1),Mt=!1;function qt(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Bn(r,i){r=r.updateQueue,i.updateQueue===r&&(i.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function ka(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function fl(r,i,s){var d=r.updateQueue;if(d===null)return null;if(d=d.shared,(Rt&2)!==0){var p=d.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),d.pending=i,i=mo(r),x0(r,null,s),i}return ho(r,d,i,s),mo(r)}function Vu(r,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var d=i.lanes;d&=r.pendingLanes,s|=d,i.lanes=s,uu(r,s)}}function Yf(r,i){var s=r.updateQueue,d=r.alternate;if(d!==null&&(d=d.updateQueue,s===d)){var p=null,y=null;if(s=s.firstBaseUpdate,s!==null){do{var j={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};y===null?p=y=j:y=y.next=j,s=s.next}while(s!==null);y===null?p=y=i:y=y.next=i}else p=y=i;s={baseState:d.baseState,firstBaseUpdate:p,lastBaseUpdate:y,shared:d.shared,callbacks:d.callbacks},r.updateQueue=s;return}r=s.lastBaseUpdate,r===null?s.firstBaseUpdate=i:r.next=i,s.lastBaseUpdate=i}var Wf=!1;function Yu(){if(Wf){var r=Et;if(r!==null)throw r}}function Wu(r,i,s,d){Wf=!1;var p=r.updateQueue;Mt=!1;var y=p.firstBaseUpdate,j=p.lastBaseUpdate,R=p.shared.pending;if(R!==null){p.shared.pending=null;var V=R,se=V.next;V.next=null,j===null?y=se:j.next=se,j=V;var ye=r.alternate;ye!==null&&(ye=ye.updateQueue,R=ye.lastBaseUpdate,R!==j&&(R===null?ye.firstBaseUpdate=se:R.next=se,ye.lastBaseUpdate=V))}if(y!==null){var xe=p.baseState;j=0,ye=se=V=null,R=y;do{var ue=R.lane&-536870913,de=ue!==R.lane;if(de?(St&ue)===ue:(d&ue)===ue){ue!==0&&ue===dl&&(Wf=!0),ye!==null&&(ye=ye.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var Ge=r,rt=R;ue=i;var Vt=s;switch(rt.tag){case 1:if(Ge=rt.payload,typeof Ge=="function"){xe=Ge.call(Vt,xe,ue);break e}xe=Ge;break e;case 3:Ge.flags=Ge.flags&-65537|128;case 0:if(Ge=rt.payload,ue=typeof Ge=="function"?Ge.call(Vt,xe,ue):Ge,ue==null)break e;xe=v({},xe,ue);break e;case 2:Mt=!0}}ue=R.callback,ue!==null&&(r.flags|=64,de&&(r.flags|=8192),de=p.callbacks,de===null?p.callbacks=[ue]:de.push(ue))}else de={lane:ue,tag:R.tag,payload:R.payload,callback:R.callback,next:null},ye===null?(se=ye=de,V=xe):ye=ye.next=de,j|=ue;if(R=R.next,R===null){if(R=p.shared.pending,R===null)break;de=R,R=de.next,de.next=null,p.lastBaseUpdate=de,p.shared.pending=null}}while(!0);ye===null&&(V=xe),p.baseState=V,p.firstBaseUpdate=se,p.lastBaseUpdate=ye,y===null&&(p.shared.lanes=0),yl|=j,r.lanes=j,r.memoizedState=xe}}function n4(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function r4(r,i){var s=r.callbacks;if(s!==null)for(r.callbacks=null,r=0;r<s.length;r++)n4(s[r],i)}var jo=_(null),M0=_(0);function a4(r,i){r=zi,O(M0,r),O(jo,i),zi=r|i.baseLanes}function Kf(){O(M0,zi),O(jo,jo.current)}function Xf(){zi=M0.current,te(jo),te(M0)}var Ir=_(null),ea=null;function hl(r){var i=r.alternate;O(xn,xn.current&1),O(Ir,r),ea===null&&(i===null||jo.current!==null||i.memoizedState!==null)&&(ea=r)}function Zf(r){O(xn,xn.current),O(Ir,r),ea===null&&(ea=r)}function i4(r){r.tag===22?(O(xn,xn.current),O(Ir,r),ea===null&&(ea=r)):ml()}function ml(){O(xn,xn.current),O(Ir,Ir.current)}function _r(r){te(Ir),ea===r&&(ea=null),te(xn)}var xn=_(0);function z0(r){for(var i=r;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||rm(s)||am(s)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var Si=0,ut=null,Pt=null,jn=null,D0=!1,Co=!1,gs=!1,R0=0,Ku=0,To=null,e7=0;function fn(){throw Error(a(321))}function Qf(r,i){if(i===null)return!1;for(var s=0;s<i.length&&s<r.length;s++)if(!tr(r[s],i[s]))return!1;return!0}function Jf(r,i,s,d,p,y){return Si=y,ut=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,J.H=r===null||r.memoizedState===null?$4:mh,gs=!1,y=s(d,p),gs=!1,Co&&(y=s4(i,s,d,p)),l4(r),y}function l4(r){J.H=Qu;var i=Pt!==null&&Pt.next!==null;if(Si=0,jn=Pt=ut=null,D0=!1,Ku=0,To=null,i)throw Error(a(300));r===null||Cn||(r=r.dependencies,r!==null&&$a(r)&&(Cn=!0))}function s4(r,i,s,d){ut=r;var p=0;do{if(Co&&(To=null),Ku=0,Co=!1,25<=p)throw Error(a(301));if(p+=1,jn=Pt=null,r.updateQueue!=null){var y=r.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}J.H=F4,y=i(s,d)}while(Co);return y}function t7(){var r=J.H,i=r.useState()[0];return i=typeof i.then=="function"?Xu(i):i,r=r.useState()[0],(Pt!==null?Pt.memoizedState:null)!==r&&(ut.flags|=1024),i}function eh(){var r=R0!==0;return R0=0,r}function th(r,i,s){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~s}function nh(r){if(D0){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}D0=!1}Si=0,jn=Pt=ut=null,Co=!1,Ku=R0=0,To=null}function rr(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jn===null?ut.memoizedState=jn=r:jn=jn.next=r,jn}function bn(){if(Pt===null){var r=ut.alternate;r=r!==null?r.memoizedState:null}else r=Pt.next;var i=jn===null?ut.memoizedState:jn.next;if(i!==null)jn=i,Pt=r;else{if(r===null)throw ut.alternate===null?Error(a(467)):Error(a(310));Pt=r,r={memoizedState:Pt.memoizedState,baseState:Pt.baseState,baseQueue:Pt.baseQueue,queue:Pt.queue,next:null},jn===null?ut.memoizedState=jn=r:jn=jn.next=r}return jn}function O0(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Xu(r){var i=Ku;return Ku+=1,To===null&&(To=[]),r=Gu(To,r,i),i=ut,(jn===null?i.memoizedState:jn.next)===null&&(i=i.alternate,J.H=i===null||i.memoizedState===null?$4:mh),r}function I0(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Xu(r);if(r.$$typeof===B)return Rn(r)}throw Error(a(438,String(r)))}function rh(r){var i=null,s=ut.updateQueue;if(s!==null&&(i=s.memoCache),i==null){var d=ut.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(i={data:d.data.map(function(p){return p.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),s===null&&(s=O0(),ut.updateQueue=s),s.memoCache=i,s=i.data[i.index],s===void 0)for(s=i.data[i.index]=Array(r),d=0;d<r;d++)s[d]=F;return i.index++,s}function ji(r,i){return typeof i=="function"?i(r):i}function _0(r){var i=bn();return ah(i,Pt,r)}function ah(r,i,s){var d=r.queue;if(d===null)throw Error(a(311));d.lastRenderedReducer=s;var p=r.baseQueue,y=d.pending;if(y!==null){if(p!==null){var j=p.next;p.next=y.next,y.next=j}i.baseQueue=p=y,d.pending=null}if(y=r.baseState,p===null)r.memoizedState=y;else{i=p.next;var R=j=null,V=null,se=i,ye=!1;do{var xe=se.lane&-536870913;if(xe!==se.lane?(St&xe)===xe:(Si&xe)===xe){var ue=se.revertLane;if(ue===0)V!==null&&(V=V.next={lane:0,revertLane:0,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),xe===dl&&(ye=!0);else if((Si&ue)===ue){se=se.next,ue===dl&&(ye=!0);continue}else xe={lane:0,revertLane:se.revertLane,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},V===null?(R=V=xe,j=y):V=V.next=xe,ut.lanes|=ue,yl|=ue;xe=se.action,gs&&s(y,xe),y=se.hasEagerState?se.eagerState:s(y,xe)}else ue={lane:xe,revertLane:se.revertLane,gesture:se.gesture,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},V===null?(R=V=ue,j=y):V=V.next=ue,ut.lanes|=xe,yl|=xe;se=se.next}while(se!==null&&se!==i);if(V===null?j=y:V.next=R,!tr(y,r.memoizedState)&&(Cn=!0,ye&&(s=Et,s!==null)))throw s;r.memoizedState=y,r.baseState=j,r.baseQueue=V,d.lastRenderedState=y}return p===null&&(d.lanes=0),[r.memoizedState,d.dispatch]}function ih(r){var i=bn(),s=i.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=r;var d=s.dispatch,p=s.pending,y=i.memoizedState;if(p!==null){s.pending=null;var j=p=p.next;do y=r(y,j.action),j=j.next;while(j!==p);tr(y,i.memoizedState)||(Cn=!0),i.memoizedState=y,i.baseQueue===null&&(i.baseState=y),s.lastRenderedState=y}return[y,d]}function o4(r,i,s){var d=ut,p=bn(),y=yt;if(y){if(s===void 0)throw Error(a(407));s=s()}else s=i();var j=!tr((Pt||p).memoizedState,s);if(j&&(p.memoizedState=s,Cn=!0),p=p.queue,oh(d4.bind(null,d,p,r),[r]),p.getSnapshot!==i||j||jn!==null&&jn.memoizedState.tag&1){if(d.flags|=2048,Ao(9,{destroy:void 0},c4.bind(null,d,p,s,i),null),Kt===null)throw Error(a(349));y||(Si&127)!==0||u4(d,i,s)}return s}function u4(r,i,s){r.flags|=16384,r={getSnapshot:i,value:s},i=ut.updateQueue,i===null?(i=O0(),ut.updateQueue=i,i.stores=[r]):(s=i.stores,s===null?i.stores=[r]:s.push(r))}function c4(r,i,s,d){i.value=s,i.getSnapshot=d,f4(i)&&h4(r)}function d4(r,i,s){return s(function(){f4(i)&&h4(r)})}function f4(r){var i=r.getSnapshot;r=r.value;try{var s=i();return!tr(r,s)}catch{return!0}}function h4(r){var i=xi(r,2);i!==null&&wr(i,r,2)}function lh(r){var i=rr();if(typeof r=="function"){var s=r;if(r=s(),gs){Gn(!0);try{s()}finally{Gn(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ji,lastRenderedState:r},i}function m4(r,i,s,d){return r.baseState=s,ah(r,Pt,typeof d=="function"?d:ji)}function n7(r,i,s,d,p){if(q0(r))throw Error(a(485));if(r=i.action,r!==null){var y={payload:p,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(j){y.listeners.push(j)}};J.T!==null?s(!0):y.isTransition=!1,d(y),s=i.pending,s===null?(y.next=i.pending=y,p4(i,y)):(y.next=s.next,i.pending=s.next=y)}}function p4(r,i){var s=i.action,d=i.payload,p=r.state;if(i.isTransition){var y=J.T,j={};J.T=j;try{var R=s(p,d),V=J.S;V!==null&&V(j,R),g4(r,i,R)}catch(se){sh(r,i,se)}finally{y!==null&&j.types!==null&&(y.types=j.types),J.T=y}}else try{y=s(p,d),g4(r,i,y)}catch(se){sh(r,i,se)}}function g4(r,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(d){y4(r,i,d)},function(d){return sh(r,i,d)}):y4(r,i,s)}function y4(r,i,s){i.status="fulfilled",i.value=s,v4(i),r.state=s,i=r.pending,i!==null&&(s=i.next,s===i?r.pending=null:(s=s.next,i.next=s,p4(r,s)))}function sh(r,i,s){var d=r.pending;if(r.pending=null,d!==null){d=d.next;do i.status="rejected",i.reason=s,v4(i),i=i.next;while(i!==d)}r.action=null}function v4(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function x4(r,i){return i}function b4(r,i){if(yt){var s=Kt.formState;if(s!==null){e:{var d=ut;if(yt){if(Wt){t:{for(var p=Wt,y=gr;p.nodeType!==8;){if(!y){p=null;break t}if(p=ta(p.nextSibling),p===null){p=null;break t}}y=p.data,p=y==="F!"||y==="F"?p:null}if(p){Wt=ta(p.nextSibling),d=p.data==="F!";break e}}Ua(d)}d=!1}d&&(i=s[0])}}return s=rr(),s.memoizedState=s.baseState=i,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:x4,lastRenderedState:i},s.queue=d,s=q4.bind(null,ut,d),d.dispatch=s,d=lh(!1),y=hh.bind(null,ut,!1,d.queue),d=rr(),p={state:i,dispatch:null,action:r,pending:null},d.queue=p,s=n7.bind(null,ut,p,y,s),p.dispatch=s,d.memoizedState=r,[i,s,!1]}function w4(r){var i=bn();return k4(i,Pt,r)}function k4(r,i,s){if(i=ah(r,i,x4)[0],r=_0(ji)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var d=Xu(i)}catch(j){throw j===Pa?ko:j}else d=i;i=bn();var p=i.queue,y=p.dispatch;return s!==i.memoizedState&&(ut.flags|=2048,Ao(9,{destroy:void 0},r7.bind(null,p,s),null)),[d,y,r]}function r7(r,i){r.action=i}function S4(r){var i=bn(),s=Pt;if(s!==null)return k4(i,s,r);bn(),i=i.memoizedState,s=bn();var d=s.queue.dispatch;return s.memoizedState=r,[i,d,!1]}function Ao(r,i,s,d){return r={tag:r,create:s,deps:d,inst:i,next:null},i=ut.updateQueue,i===null&&(i=O0(),ut.updateQueue=i),s=i.lastEffect,s===null?i.lastEffect=r.next=r:(d=s.next,s.next=r,r.next=d,i.lastEffect=r),r}function j4(){return bn().memoizedState}function L0(r,i,s,d){var p=rr();ut.flags|=r,p.memoizedState=Ao(1|i,{destroy:void 0},s,d===void 0?null:d)}function B0(r,i,s,d){var p=bn();d=d===void 0?null:d;var y=p.memoizedState.inst;Pt!==null&&d!==null&&Qf(d,Pt.memoizedState.deps)?p.memoizedState=Ao(i,y,s,d):(ut.flags|=r,p.memoizedState=Ao(1|i,y,s,d))}function C4(r,i){L0(8390656,8,r,i)}function oh(r,i){B0(2048,8,r,i)}function a7(r){ut.flags|=4;var i=ut.updateQueue;if(i===null)i=O0(),ut.updateQueue=i,i.events=[r];else{var s=i.events;s===null?i.events=[r]:s.push(r)}}function T4(r){var i=bn().memoizedState;return a7({ref:i,nextImpl:r}),function(){if((Rt&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function A4(r,i){return B0(4,2,r,i)}function E4(r,i){return B0(4,4,r,i)}function N4(r,i){if(typeof i=="function"){r=r();var s=i(r);return function(){typeof s=="function"?s():i(null)}}if(i!=null)return r=r(),i.current=r,function(){i.current=null}}function M4(r,i,s){s=s!=null?s.concat([r]):null,B0(4,4,N4.bind(null,i,r),s)}function uh(){}function z4(r,i){var s=bn();i=i===void 0?null:i;var d=s.memoizedState;return i!==null&&Qf(i,d[1])?d[0]:(s.memoizedState=[r,i],r)}function D4(r,i){var s=bn();i=i===void 0?null:i;var d=s.memoizedState;if(i!==null&&Qf(i,d[1]))return d[0];if(d=r(),gs){Gn(!0);try{r()}finally{Gn(!1)}}return s.memoizedState=[d,i],d}function ch(r,i,s){return s===void 0||(Si&1073741824)!==0&&(St&261930)===0?r.memoizedState=i:(r.memoizedState=s,r=Rg(),ut.lanes|=r,yl|=r,s)}function R4(r,i,s,d){return tr(s,i)?s:jo.current!==null?(r=ch(r,s,d),tr(r,i)||(Cn=!0),r):(Si&42)===0||(Si&1073741824)!==0&&(St&261930)===0?(Cn=!0,r.memoizedState=s):(r=Rg(),ut.lanes|=r,yl|=r,i)}function O4(r,i,s,d,p){var y=Y.p;Y.p=y!==0&&8>y?y:8;var j=J.T,R={};J.T=R,hh(r,!1,i,s);try{var V=p(),se=J.S;if(se!==null&&se(R,V),V!==null&&typeof V=="object"&&typeof V.then=="function"){var ye=Or(V,d);Zu(r,i,ye,qr(r))}else Zu(r,i,d,qr(r))}catch(xe){Zu(r,i,{then:function(){},status:"rejected",reason:xe},qr())}finally{Y.p=y,j!==null&&R.types!==null&&(j.types=R.types),J.T=j}}function i7(){}function dh(r,i,s,d){if(r.tag!==5)throw Error(a(476));var p=I4(r).queue;O4(r,p,i,ge,s===null?i7:function(){return _4(r),s(d)})}function I4(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:ge,baseState:ge,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ji,lastRenderedState:ge},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ji,lastRenderedState:s},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function _4(r){var i=I4(r);i.next===null&&(i=r.alternate.memoizedState),Zu(r,i.next.queue,{},qr())}function fh(){return Rn(mc)}function L4(){return bn().memoizedState}function B4(){return bn().memoizedState}function l7(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var s=qr();r=ka(s);var d=fl(i,r,s);d!==null&&(wr(d,i,s),Vu(d,i,s)),i={cache:ki()},r.payload=i;return}i=i.return}}function s7(r,i,s){var d=qr();s={lane:d,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},q0(r)?U4(i,s):(s=Ru(r,i,s,d),s!==null&&(wr(s,r,d),H4(s,i,d)))}function q4(r,i,s){var d=qr();Zu(r,i,s,d)}function Zu(r,i,s,d){var p={lane:d,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(q0(r))U4(i,p);else{var y=r.alternate;if(r.lanes===0&&(y===null||y.lanes===0)&&(y=i.lastRenderedReducer,y!==null))try{var j=i.lastRenderedState,R=y(j,s);if(p.hasEagerState=!0,p.eagerState=R,tr(R,j))return ho(r,i,p,0),Kt===null&&fo(),!1}catch{}finally{}if(s=Ru(r,i,p,d),s!==null)return wr(s,r,d),H4(s,i,d),!0}return!1}function hh(r,i,s,d){if(d={lane:2,revertLane:Gh(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},q0(r)){if(i)throw Error(a(479))}else i=Ru(r,s,d,2),i!==null&&wr(i,r,2)}function q0(r){var i=r.alternate;return r===ut||i!==null&&i===ut}function U4(r,i){Co=D0=!0;var s=r.pending;s===null?i.next=i:(i.next=s.next,s.next=i),r.pending=i}function H4(r,i,s){if((s&4194048)!==0){var d=i.lanes;d&=r.pendingLanes,s|=d,i.lanes=s,uu(r,s)}}var Qu={readContext:Rn,use:I0,useCallback:fn,useContext:fn,useEffect:fn,useImperativeHandle:fn,useLayoutEffect:fn,useInsertionEffect:fn,useMemo:fn,useReducer:fn,useRef:fn,useState:fn,useDebugValue:fn,useDeferredValue:fn,useTransition:fn,useSyncExternalStore:fn,useId:fn,useHostTransitionStatus:fn,useFormState:fn,useActionState:fn,useOptimistic:fn,useMemoCache:fn,useCacheRefresh:fn};Qu.useEffectEvent=fn;var $4={readContext:Rn,use:I0,useCallback:function(r,i){return rr().memoizedState=[r,i===void 0?null:i],r},useContext:Rn,useEffect:C4,useImperativeHandle:function(r,i,s){s=s!=null?s.concat([r]):null,L0(4194308,4,N4.bind(null,i,r),s)},useLayoutEffect:function(r,i){return L0(4194308,4,r,i)},useInsertionEffect:function(r,i){L0(4,2,r,i)},useMemo:function(r,i){var s=rr();i=i===void 0?null:i;var d=r();if(gs){Gn(!0);try{r()}finally{Gn(!1)}}return s.memoizedState=[d,i],d},useReducer:function(r,i,s){var d=rr();if(s!==void 0){var p=s(i);if(gs){Gn(!0);try{s(i)}finally{Gn(!1)}}}else p=i;return d.memoizedState=d.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},d.queue=r,r=r.dispatch=s7.bind(null,ut,r),[d.memoizedState,r]},useRef:function(r){var i=rr();return r={current:r},i.memoizedState=r},useState:function(r){r=lh(r);var i=r.queue,s=q4.bind(null,ut,i);return i.dispatch=s,[r.memoizedState,s]},useDebugValue:uh,useDeferredValue:function(r,i){var s=rr();return ch(s,r,i)},useTransition:function(){var r=lh(!1);return r=O4.bind(null,ut,r.queue,!0,!1),rr().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,s){var d=ut,p=rr();if(yt){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),Kt===null)throw Error(a(349));(St&127)!==0||u4(d,i,s)}p.memoizedState=s;var y={value:s,getSnapshot:i};return p.queue=y,C4(d4.bind(null,d,y,r),[r]),d.flags|=2048,Ao(9,{destroy:void 0},c4.bind(null,d,y,s,i),null),s},useId:function(){var r=rr(),i=Kt.identifierPrefix;if(yt){var s=Qr,d=zr;s=(d&~(1<<32-_t(d)-1)).toString(32)+s,i="_"+i+"R_"+s,s=R0++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=e7++,i="_"+i+"r_"+s.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:fh,useFormState:b4,useActionState:b4,useOptimistic:function(r){var i=rr();i.memoizedState=i.baseState=r;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=hh.bind(null,ut,!0,s),s.dispatch=i,[r,i]},useMemoCache:rh,useCacheRefresh:function(){return rr().memoizedState=l7.bind(null,ut)},useEffectEvent:function(r){var i=rr(),s={impl:r};return i.memoizedState=s,function(){if((Rt&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},mh={readContext:Rn,use:I0,useCallback:z4,useContext:Rn,useEffect:oh,useImperativeHandle:M4,useInsertionEffect:A4,useLayoutEffect:E4,useMemo:D4,useReducer:_0,useRef:j4,useState:function(){return _0(ji)},useDebugValue:uh,useDeferredValue:function(r,i){var s=bn();return R4(s,Pt.memoizedState,r,i)},useTransition:function(){var r=_0(ji)[0],i=bn().memoizedState;return[typeof r=="boolean"?r:Xu(r),i]},useSyncExternalStore:o4,useId:L4,useHostTransitionStatus:fh,useFormState:w4,useActionState:w4,useOptimistic:function(r,i){var s=bn();return m4(s,Pt,r,i)},useMemoCache:rh,useCacheRefresh:B4};mh.useEffectEvent=T4;var F4={readContext:Rn,use:I0,useCallback:z4,useContext:Rn,useEffect:oh,useImperativeHandle:M4,useInsertionEffect:A4,useLayoutEffect:E4,useMemo:D4,useReducer:ih,useRef:j4,useState:function(){return ih(ji)},useDebugValue:uh,useDeferredValue:function(r,i){var s=bn();return Pt===null?ch(s,r,i):R4(s,Pt.memoizedState,r,i)},useTransition:function(){var r=ih(ji)[0],i=bn().memoizedState;return[typeof r=="boolean"?r:Xu(r),i]},useSyncExternalStore:o4,useId:L4,useHostTransitionStatus:fh,useFormState:S4,useActionState:S4,useOptimistic:function(r,i){var s=bn();return Pt!==null?m4(s,Pt,r,i):(s.baseState=r,[r,s.queue.dispatch])},useMemoCache:rh,useCacheRefresh:B4};F4.useEffectEvent=T4;function ph(r,i,s,d){i=r.memoizedState,s=s(d,i),s=s==null?i:v({},i,s),r.memoizedState=s,r.lanes===0&&(r.updateQueue.baseState=s)}var gh={enqueueSetState:function(r,i,s){r=r._reactInternals;var d=qr(),p=ka(d);p.payload=i,s!=null&&(p.callback=s),i=fl(r,p,d),i!==null&&(wr(i,r,d),Vu(i,r,d))},enqueueReplaceState:function(r,i,s){r=r._reactInternals;var d=qr(),p=ka(d);p.tag=1,p.payload=i,s!=null&&(p.callback=s),i=fl(r,p,d),i!==null&&(wr(i,r,d),Vu(i,r,d))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var s=qr(),d=ka(s);d.tag=2,i!=null&&(d.callback=i),i=fl(r,d,s),i!==null&&(wr(i,r,s),Vu(i,r,s))}};function P4(r,i,s,d,p,y,j){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(d,y,j):i.prototype&&i.prototype.isPureReactComponent?!os(s,d)||!os(p,y):!0}function G4(r,i,s,d){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(s,d),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(s,d),i.state!==r&&gh.enqueueReplaceState(i,i.state,null)}function ys(r,i){var s=i;if("ref"in i){s={};for(var d in i)d!=="ref"&&(s[d]=i[d])}if(r=r.defaultProps){s===i&&(s=v({},s));for(var p in r)s[p]===void 0&&(s[p]=r[p])}return s}function V4(r){co(r)}function Y4(r){console.error(r)}function W4(r){co(r)}function U0(r,i){try{var s=r.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(d){setTimeout(function(){throw d})}}function K4(r,i,s){try{var d=r.onCaughtError;d(s.value,{componentStack:s.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function yh(r,i,s){return s=ka(s),s.tag=3,s.payload={element:null},s.callback=function(){U0(r,i)},s}function X4(r){return r=ka(r),r.tag=3,r}function Z4(r,i,s,d){var p=s.type.getDerivedStateFromError;if(typeof p=="function"){var y=d.value;r.payload=function(){return p(y)},r.callback=function(){K4(i,s,d)}}var j=s.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(r.callback=function(){K4(i,s,d),typeof p!="function"&&(vl===null?vl=new Set([this]):vl.add(this));var R=d.stack;this.componentDidCatch(d.value,{componentStack:R!==null?R:""})})}function o7(r,i,s,d,p){if(s.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(i=s.alternate,i!==null&&Ha(i,s,p,!0),s=Ir.current,s!==null){switch(s.tag){case 31:case 13:return ea===null?Q0():s.alternate===null&&hn===0&&(hn=3),s.flags&=-257,s.flags|=65536,s.lanes=p,d===So?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([d]):i.add(d),$h(r,d,p)),!1;case 22:return s.flags|=65536,d===So?s.flags|=16384:(i=s.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([d])},s.updateQueue=i):(s=i.retryQueue,s===null?i.retryQueue=new Set([d]):s.add(d)),$h(r,d,p)),!1}throw Error(a(435,s.tag))}return $h(r,d,p),Q0(),!1}if(yt)return i=Ir.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=p,d!==qu&&(r=Error(a(422),{cause:d}),hs(nr(r,s)))):(d!==qu&&(i=Error(a(423),{cause:d}),hs(nr(i,s))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,d=nr(d,s),p=yh(r.stateNode,d,p),Yf(r,p),hn!==4&&(hn=2)),!1;var y=Error(a(520),{cause:d});if(y=nr(y,s),lc===null?lc=[y]:lc.push(y),hn!==4&&(hn=2),i===null)return!0;d=nr(d,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,r=p&-p,s.lanes|=r,r=yh(s.stateNode,d,r),Yf(s,r),!1;case 1:if(i=s.type,y=s.stateNode,(s.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(vl===null||!vl.has(y))))return s.flags|=65536,p&=-p,s.lanes|=p,p=X4(p),Z4(p,r,s,d),Yf(s,p),!1}s=s.return}while(s!==null);return!1}var vh=Error(a(461)),Cn=!1;function Fn(r,i,s,d){i.child=r===null?Be(i,null,s,d):De(i,r.child,s,d)}function Q4(r,i,s,d,p){s=s.render;var y=i.ref;if("ref"in d){var j={};for(var R in d)R!=="ref"&&(j[R]=d[R])}else j=d;return wi(i),d=Jf(r,i,s,j,y,p),R=eh(),r!==null&&!Cn?(th(r,i,p),Ci(r,i,p)):(yt&&R&&Lu(i),i.flags|=1,Fn(r,i,d,p),i.child)}function J4(r,i,s,d,p){if(r===null){var y=s.type;return typeof y=="function"&&!po(y)&&y.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=y,eg(r,i,y,d,p)):(r=go(s.type,null,d,i,i.mode,p),r.ref=i.ref,r.return=i,i.child=r)}if(y=r.child,!Th(r,p)){var j=y.memoizedProps;if(s=s.compare,s=s!==null?s:os,s(j,d)&&r.ref===i.ref)return Ci(r,i,p)}return i.flags|=1,r=ya(y,d),r.ref=i.ref,r.return=i,i.child=r}function eg(r,i,s,d,p){if(r!==null){var y=r.memoizedProps;if(os(y,d)&&r.ref===i.ref)if(Cn=!1,i.pendingProps=d=y,Th(r,p))(r.flags&131072)!==0&&(Cn=!0);else return i.lanes=r.lanes,Ci(r,i,p)}return xh(r,i,s,d,p)}function tg(r,i,s,d){var p=d.children,y=r!==null?r.memoizedState:null;if(r===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((i.flags&128)!==0){if(y=y!==null?y.baseLanes|s:s,r!==null){for(d=i.child=r.child,p=0;d!==null;)p=p|d.lanes|d.childLanes,d=d.sibling;d=p&~y}else d=0,i.child=null;return ng(r,i,y,s,d)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&ps(i,y!==null?y.cachePool:null),y!==null?a4(i,y):Kf(),i4(i);else return d=i.lanes=536870912,ng(r,i,y!==null?y.baseLanes|s:s,s,d)}else y!==null?(ps(i,y.cachePool),a4(i,y),ml(),i.memoizedState=null):(r!==null&&ps(i,null),Kf(),ml());return Fn(r,i,p,s),i.child}function Ju(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function ng(r,i,s,d,p){var y=$u();return y=y===null?null:{parent:Jt._currentValue,pool:y},i.memoizedState={baseLanes:s,cachePool:y},r!==null&&ps(i,null),Kf(),i4(i),r!==null&&Ha(r,i,d,!0),i.childLanes=p,null}function H0(r,i){return i=F0({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function rg(r,i,s){return De(i,r.child,null,s),r=H0(i,i.pendingProps),r.flags|=2,_r(i),i.memoizedState=null,r}function u7(r,i,s){var d=i.pendingProps,p=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(yt){if(d.mode==="hidden")return r=H0(i,d),i.lanes=536870912,Ju(null,r);if(Zf(i),(r=Wt)?(r=p2(r,gr),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:va!==null?{id:zr,overflow:Qr}:null,retryLane:536870912,hydrationErrors:null},s=yo(r),s.return=i,i.child=s,Dn=i,Wt=null)):r=null,r===null)throw Ua(i);return i.lanes=536870912,null}return H0(i,d)}var y=r.memoizedState;if(y!==null){var j=y.dehydrated;if(Zf(i),p)if(i.flags&256)i.flags&=-257,i=rg(r,i,s);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(a(558));else if(Cn||Ha(r,i,s,!1),p=(s&r.childLanes)!==0,Cn||p){if(d=Kt,d!==null&&(j=r0(d,s),j!==0&&j!==y.retryLane))throw y.retryLane=j,xi(r,j),wr(d,r,j),vh;Q0(),i=rg(r,i,s)}else r=y.treeContext,Wt=ta(j.nextSibling),Dn=i,yt=!0,qa=null,gr=!1,r!==null&&S0(i,r),i=H0(i,d),i.flags|=4096;return i}return r=ya(r.child,{mode:d.mode,children:d.children}),r.ref=i.ref,i.child=r,r.return=i,r}function $0(r,i){var s=i.ref;if(s===null)r!==null&&r.ref!==null&&(i.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(a(284));(r===null||r.ref!==s)&&(i.flags|=4194816)}}function xh(r,i,s,d,p){return wi(i),s=Jf(r,i,s,d,void 0,p),d=eh(),r!==null&&!Cn?(th(r,i,p),Ci(r,i,p)):(yt&&d&&Lu(i),i.flags|=1,Fn(r,i,s,p),i.child)}function ag(r,i,s,d,p,y){return wi(i),i.updateQueue=null,s=s4(i,d,s,p),l4(r),d=eh(),r!==null&&!Cn?(th(r,i,y),Ci(r,i,y)):(yt&&d&&Lu(i),i.flags|=1,Fn(r,i,s,y),i.child)}function ig(r,i,s,d,p){if(wi(i),i.stateNode===null){var y=sl,j=s.contextType;typeof j=="object"&&j!==null&&(y=Rn(j)),y=new s(d,y),i.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=gh,i.stateNode=y,y._reactInternals=i,y=i.stateNode,y.props=d,y.state=i.memoizedState,y.refs={},qt(i),j=s.contextType,y.context=typeof j=="object"&&j!==null?Rn(j):sl,y.state=i.memoizedState,j=s.getDerivedStateFromProps,typeof j=="function"&&(ph(i,s,j,d),y.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(j=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),j!==y.state&&gh.enqueueReplaceState(y,y.state,null),Wu(i,d,y,p),Yu(),y.state=i.memoizedState),typeof y.componentDidMount=="function"&&(i.flags|=4194308),d=!0}else if(r===null){y=i.stateNode;var R=i.memoizedProps,V=ys(s,R);y.props=V;var se=y.context,ye=s.contextType;j=sl,typeof ye=="object"&&ye!==null&&(j=Rn(ye));var xe=s.getDerivedStateFromProps;ye=typeof xe=="function"||typeof y.getSnapshotBeforeUpdate=="function",R=i.pendingProps!==R,ye||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(R||se!==j)&&G4(i,y,d,j),Mt=!1;var ue=i.memoizedState;y.state=ue,Wu(i,d,y,p),Yu(),se=i.memoizedState,R||ue!==se||Mt?(typeof xe=="function"&&(ph(i,s,xe,d),se=i.memoizedState),(V=Mt||P4(i,s,V,d,ue,se,j))?(ye||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(i.flags|=4194308)):(typeof y.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=d,i.memoizedState=se),y.props=d,y.state=se,y.context=j,d=V):(typeof y.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{y=i.stateNode,Bn(r,i),j=i.memoizedProps,ye=ys(s,j),y.props=ye,xe=i.pendingProps,ue=y.context,se=s.contextType,V=sl,typeof se=="object"&&se!==null&&(V=Rn(se)),R=s.getDerivedStateFromProps,(se=typeof R=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(j!==xe||ue!==V)&&G4(i,y,d,V),Mt=!1,ue=i.memoizedState,y.state=ue,Wu(i,d,y,p),Yu();var de=i.memoizedState;j!==xe||ue!==de||Mt||r!==null&&r.dependencies!==null&&$a(r.dependencies)?(typeof R=="function"&&(ph(i,s,R,d),de=i.memoizedState),(ye=Mt||P4(i,s,ye,d,ue,de,V)||r!==null&&r.dependencies!==null&&$a(r.dependencies))?(se||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(d,de,V),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(d,de,V)),typeof y.componentDidUpdate=="function"&&(i.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof y.componentDidUpdate!="function"||j===r.memoizedProps&&ue===r.memoizedState||(i.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||j===r.memoizedProps&&ue===r.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=de),y.props=d,y.state=de,y.context=V,d=ye):(typeof y.componentDidUpdate!="function"||j===r.memoizedProps&&ue===r.memoizedState||(i.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||j===r.memoizedProps&&ue===r.memoizedState||(i.flags|=1024),d=!1)}return y=d,$0(r,i),d=(i.flags&128)!==0,y||d?(y=i.stateNode,s=d&&typeof s.getDerivedStateFromError!="function"?null:y.render(),i.flags|=1,r!==null&&d?(i.child=De(i,r.child,null,p),i.child=De(i,null,s,p)):Fn(r,i,s,p),i.memoizedState=y.state,r=i.child):r=Ci(r,i,p),r}function lg(r,i,s,d){return bi(),i.flags|=256,Fn(r,i,s,d),i.child}var bh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function wh(r){return{baseLanes:r,cachePool:N0()}}function kh(r,i,s){return r=r!==null?r.childLanes&~s:0,i&&(r|=Br),r}function sg(r,i,s){var d=i.pendingProps,p=!1,y=(i.flags&128)!==0,j;if((j=y)||(j=r!==null&&r.memoizedState===null?!1:(xn.current&2)!==0),j&&(p=!0,i.flags&=-129),j=(i.flags&32)!==0,i.flags&=-33,r===null){if(yt){if(p?hl(i):ml(),(r=Wt)?(r=p2(r,gr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:va!==null?{id:zr,overflow:Qr}:null,retryLane:536870912,hydrationErrors:null},s=yo(r),s.return=i,i.child=s,Dn=i,Wt=null)):r=null,r===null)throw Ua(i);return am(r)?i.lanes=32:i.lanes=536870912,null}var R=d.children;return d=d.fallback,p?(ml(),p=i.mode,R=F0({mode:"hidden",children:R},p),d=Ba(d,p,s,null),R.return=i,d.return=i,R.sibling=d,i.child=R,d=i.child,d.memoizedState=wh(s),d.childLanes=kh(r,j,s),i.memoizedState=bh,Ju(null,d)):(hl(i),Sh(i,R))}var V=r.memoizedState;if(V!==null&&(R=V.dehydrated,R!==null)){if(y)i.flags&256?(hl(i),i.flags&=-257,i=jh(r,i,s)):i.memoizedState!==null?(ml(),i.child=r.child,i.flags|=128,i=null):(ml(),R=d.fallback,p=i.mode,d=F0({mode:"visible",children:d.children},p),R=Ba(R,p,s,null),R.flags|=2,d.return=i,R.return=i,d.sibling=R,i.child=d,De(i,r.child,null,s),d=i.child,d.memoizedState=wh(s),d.childLanes=kh(r,j,s),i.memoizedState=bh,i=Ju(null,d));else if(hl(i),am(R)){if(j=R.nextSibling&&R.nextSibling.dataset,j)var se=j.dgst;j=se,d=Error(a(419)),d.stack="",d.digest=j,hs({value:d,source:null,stack:null}),i=jh(r,i,s)}else if(Cn||Ha(r,i,s,!1),j=(s&r.childLanes)!==0,Cn||j){if(j=Kt,j!==null&&(d=r0(j,s),d!==0&&d!==V.retryLane))throw V.retryLane=d,xi(r,d),wr(j,r,d),vh;rm(R)||Q0(),i=jh(r,i,s)}else rm(R)?(i.flags|=192,i.child=r.child,i=null):(r=V.treeContext,Wt=ta(R.nextSibling),Dn=i,yt=!0,qa=null,gr=!1,r!==null&&S0(i,r),i=Sh(i,d.children),i.flags|=4096);return i}return p?(ml(),R=d.fallback,p=i.mode,V=r.child,se=V.sibling,d=ya(V,{mode:"hidden",children:d.children}),d.subtreeFlags=V.subtreeFlags&65011712,se!==null?R=ya(se,R):(R=Ba(R,p,s,null),R.flags|=2),R.return=i,d.return=i,d.sibling=R,i.child=d,Ju(null,d),d=i.child,R=r.child.memoizedState,R===null?R=wh(s):(p=R.cachePool,p!==null?(V=Jt._currentValue,p=p.parent!==V?{parent:V,pool:V}:p):p=N0(),R={baseLanes:R.baseLanes|s,cachePool:p}),d.memoizedState=R,d.childLanes=kh(r,j,s),i.memoizedState=bh,Ju(r.child,d)):(hl(i),s=r.child,r=s.sibling,s=ya(s,{mode:"visible",children:d.children}),s.return=i,s.sibling=null,r!==null&&(j=i.deletions,j===null?(i.deletions=[r],i.flags|=16):j.push(r)),i.child=s,i.memoizedState=null,s)}function Sh(r,i){return i=F0({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function F0(r,i){return r=tn(22,r,null,i),r.lanes=0,r}function jh(r,i,s){return De(i,r.child,null,s),r=Sh(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function og(r,i,s){r.lanes|=i;var d=r.alternate;d!==null&&(d.lanes|=i),xo(r.return,i,s)}function Ch(r,i,s,d,p,y){var j=r.memoizedState;j===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:d,tail:s,tailMode:p,treeForkCount:y}:(j.isBackwards=i,j.rendering=null,j.renderingStartTime=0,j.last=d,j.tail=s,j.tailMode=p,j.treeForkCount=y)}function ug(r,i,s){var d=i.pendingProps,p=d.revealOrder,y=d.tail;d=d.children;var j=xn.current,R=(j&2)!==0;if(R?(j=j&1|2,i.flags|=128):j&=1,O(xn,j),Fn(r,i,d,s),d=yt?Zr:0,!R&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&og(r,s,i);else if(r.tag===19)og(r,s,i);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(p){case"forwards":for(s=i.child,p=null;s!==null;)r=s.alternate,r!==null&&z0(r)===null&&(p=s),s=s.sibling;s=p,s===null?(p=i.child,i.child=null):(p=s.sibling,s.sibling=null),Ch(i,!1,p,s,y,d);break;case"backwards":case"unstable_legacy-backwards":for(s=null,p=i.child,i.child=null;p!==null;){if(r=p.alternate,r!==null&&z0(r)===null){i.child=p;break}r=p.sibling,p.sibling=s,s=p,p=r}Ch(i,!0,s,null,y,d);break;case"together":Ch(i,!1,null,null,void 0,d);break;default:i.memoizedState=null}return i.child}function Ci(r,i,s){if(r!==null&&(i.dependencies=r.dependencies),yl|=i.lanes,(s&i.childLanes)===0)if(r!==null){if(Ha(r,i,s,!1),(s&i.childLanes)===0)return null}else return null;if(r!==null&&i.child!==r.child)throw Error(a(153));if(i.child!==null){for(r=i.child,s=ya(r,r.pendingProps),i.child=s,s.return=i;r.sibling!==null;)r=r.sibling,s=s.sibling=ya(r,r.pendingProps),s.return=i;s.sibling=null}return i.child}function Th(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&$a(r)))}function c7(r,i,s){switch(i.tag){case 3:_e(i,i.stateNode.containerInfo),Wn(i,Jt,r.memoizedState.cache),bi();break;case 27:case 5:wt(i);break;case 4:_e(i,i.stateNode.containerInfo);break;case 10:Wn(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Zf(i),null;break;case 13:var d=i.memoizedState;if(d!==null)return d.dehydrated!==null?(hl(i),i.flags|=128,null):(s&i.child.childLanes)!==0?sg(r,i,s):(hl(i),r=Ci(r,i,s),r!==null?r.sibling:null);hl(i);break;case 19:var p=(r.flags&128)!==0;if(d=(s&i.childLanes)!==0,d||(Ha(r,i,s,!1),d=(s&i.childLanes)!==0),p){if(d)return ug(r,i,s);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),O(xn,xn.current),d)break;return null;case 22:return i.lanes=0,tg(r,i,s,i.pendingProps);case 24:Wn(i,Jt,r.memoizedState.cache)}return Ci(r,i,s)}function cg(r,i,s){if(r!==null)if(r.memoizedProps!==i.pendingProps)Cn=!0;else{if(!Th(r,s)&&(i.flags&128)===0)return Cn=!1,c7(r,i,s);Cn=(r.flags&131072)!==0}else Cn=!1,yt&&(i.flags&1048576)!==0&&k0(i,Zr,i.index);switch(i.lanes=0,i.tag){case 16:e:{var d=i.pendingProps;if(r=Ga(i.elementType),i.type=r,typeof r=="function")po(r)?(d=ys(r,d),i.tag=1,i=ig(null,i,r,d,s)):(i.tag=0,i=xh(null,i,r,d,s));else{if(r!=null){var p=r.$$typeof;if(p===U){i.tag=11,i=Q4(null,i,r,d,s);break e}else if(p===K){i.tag=14,i=J4(null,i,r,d,s);break e}}throw i=be(r)||r,Error(a(306,i,""))}}return i;case 0:return xh(r,i,i.type,i.pendingProps,s);case 1:return d=i.type,p=ys(d,i.pendingProps),ig(r,i,d,p,s);case 3:e:{if(_e(i,i.stateNode.containerInfo),r===null)throw Error(a(387));d=i.pendingProps;var y=i.memoizedState;p=y.element,Bn(r,i),Wu(i,d,null,s);var j=i.memoizedState;if(d=j.cache,Wn(i,Jt,d),d!==y.cache&&bo(i,[Jt],s,!0),Yu(),d=j.element,y.isDehydrated)if(y={element:d,isDehydrated:!1,cache:j.cache},i.updateQueue.baseState=y,i.memoizedState=y,i.flags&256){i=lg(r,i,d,s);break e}else if(d!==p){p=nr(Error(a(424)),i),hs(p),i=lg(r,i,d,s);break e}else{switch(r=i.stateNode.containerInfo,r.nodeType){case 9:r=r.body;break;default:r=r.nodeName==="HTML"?r.ownerDocument.body:r}for(Wt=ta(r.firstChild),Dn=i,yt=!0,qa=null,gr=!0,s=Be(i,null,d,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(bi(),d===p){i=Ci(r,i,s);break e}Fn(r,i,d,s)}i=i.child}return i;case 26:return $0(r,i),r===null?(s=w2(i.type,null,i.pendingProps,null))?i.memoizedState=s:yt||(s=i.type,r=i.pendingProps,d=id(re.current).createElement(s),d[rn]=i,d[gn]=r,Pn(d,s,r),yn(d),i.stateNode=d):i.memoizedState=w2(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return wt(i),r===null&&yt&&(d=i.stateNode=v2(i.type,i.pendingProps,re.current),Dn=i,gr=!0,p=Wt,kl(i.type)?(im=p,Wt=ta(d.firstChild)):Wt=p),Fn(r,i,i.pendingProps.children,s),$0(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&yt&&((p=d=Wt)&&(d=U7(d,i.type,i.pendingProps,gr),d!==null?(i.stateNode=d,Dn=i,Wt=ta(d.firstChild),gr=!1,p=!0):p=!1),p||Ua(i)),wt(i),p=i.type,y=i.pendingProps,j=r!==null?r.memoizedProps:null,d=y.children,em(p,y)?d=null:j!==null&&em(p,j)&&(i.flags|=32),i.memoizedState!==null&&(p=Jf(r,i,t7,null,null,s),mc._currentValue=p),$0(r,i),Fn(r,i,d,s),i.child;case 6:return r===null&&yt&&((r=s=Wt)&&(s=H7(s,i.pendingProps,gr),s!==null?(i.stateNode=s,Dn=i,Wt=null,r=!0):r=!1),r||Ua(i)),null;case 13:return sg(r,i,s);case 4:return _e(i,i.stateNode.containerInfo),d=i.pendingProps,r===null?i.child=De(i,null,d,s):Fn(r,i,d,s),i.child;case 11:return Q4(r,i,i.type,i.pendingProps,s);case 7:return Fn(r,i,i.pendingProps,s),i.child;case 8:return Fn(r,i,i.pendingProps.children,s),i.child;case 12:return Fn(r,i,i.pendingProps.children,s),i.child;case 10:return d=i.pendingProps,Wn(i,i.type,d.value),Fn(r,i,d.children,s),i.child;case 9:return p=i.type._context,d=i.pendingProps.children,wi(i),p=Rn(p),d=d(p),i.flags|=1,Fn(r,i,d,s),i.child;case 14:return J4(r,i,i.type,i.pendingProps,s);case 15:return eg(r,i,i.type,i.pendingProps,s);case 19:return ug(r,i,s);case 31:return u7(r,i,s);case 22:return tg(r,i,s,i.pendingProps);case 24:return wi(i),d=Rn(Jt),r===null?(p=$u(),p===null&&(p=Kt,y=ki(),p.pooledCache=y,y.refCount++,y!==null&&(p.pooledCacheLanes|=s),p=y),i.memoizedState={parent:d,cache:p},qt(i),Wn(i,Jt,p)):((r.lanes&s)!==0&&(Bn(r,i),Wu(i,null,null,s),Yu()),p=r.memoizedState,y=i.memoizedState,p.parent!==d?(p={parent:d,cache:d},i.memoizedState=p,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=p),Wn(i,Jt,d)):(d=y.cache,Wn(i,Jt,d),d!==p.cache&&bo(i,[Jt],s,!0))),Fn(r,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function Ti(r){r.flags|=4}function Ah(r,i,s,d,p){if((i=(r.mode&32)!==0)&&(i=!1),i){if(r.flags|=16777216,(p&335544128)===p)if(r.stateNode.complete)r.flags|=8192;else if(Lg())r.flags|=8192;else throw Va=So,Fu}else r.flags&=-16777217}function dg(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!T2(i))if(Lg())r.flags|=8192;else throw Va=So,Fu}function P0(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?ou():536870912,r.lanes|=i,zo|=i)}function ec(r,i){if(!yt)switch(r.tailMode){case"hidden":i=r.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?r.tail=null:s.sibling=null;break;case"collapsed":s=r.tail;for(var d=null;s!==null;)s.alternate!==null&&(d=s),s=s.sibling;d===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:d.sibling=null}}function nn(r){var i=r.alternate!==null&&r.alternate.child===r.child,s=0,d=0;if(i)for(var p=r.child;p!==null;)s|=p.lanes|p.childLanes,d|=p.subtreeFlags&65011712,d|=p.flags&65011712,p.return=r,p=p.sibling;else for(p=r.child;p!==null;)s|=p.lanes|p.childLanes,d|=p.subtreeFlags,d|=p.flags,p.return=r,p=p.sibling;return r.subtreeFlags|=d,r.childLanes=s,i}function d7(r,i,s){var d=i.pendingProps;switch(Bu(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return nn(i),null;case 1:return nn(i),null;case 3:return s=i.stateNode,d=null,r!==null&&(d=r.memoizedState.cache),i.memoizedState.cache!==d&&(i.flags|=2048),Rr(Jt),He(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(r===null||r.child===null)&&(xa(i)?Ti(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,fs())),nn(i),null;case 26:var p=i.type,y=i.memoizedState;return r===null?(Ti(i),y!==null?(nn(i),dg(i,y)):(nn(i),Ah(i,p,null,d,s))):y?y!==r.memoizedState?(Ti(i),nn(i),dg(i,y)):(nn(i),i.flags&=-16777217):(r=r.memoizedProps,r!==d&&Ti(i),nn(i),Ah(i,p,r,d,s)),null;case 27:if(et(i),s=re.current,p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==d&&Ti(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return nn(i),null}r=ee.current,xa(i)?j0(i):(r=v2(p,d,s),i.stateNode=r,Ti(i))}return nn(i),null;case 5:if(et(i),p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==d&&Ti(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return nn(i),null}if(y=ee.current,xa(i))j0(i);else{var j=id(re.current);switch(y){case 1:y=j.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:y=j.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":y=j.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":y=j.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":y=j.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof d.is=="string"?j.createElement("select",{is:d.is}):j.createElement("select"),d.multiple?y.multiple=!0:d.size&&(y.size=d.size);break;default:y=typeof d.is=="string"?j.createElement(p,{is:d.is}):j.createElement(p)}}y[rn]=i,y[gn]=d;e:for(j=i.child;j!==null;){if(j.tag===5||j.tag===6)y.appendChild(j.stateNode);else if(j.tag!==4&&j.tag!==27&&j.child!==null){j.child.return=j,j=j.child;continue}if(j===i)break e;for(;j.sibling===null;){if(j.return===null||j.return===i)break e;j=j.return}j.sibling.return=j.return,j=j.sibling}i.stateNode=y;e:switch(Pn(y,p,d),p){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&Ti(i)}}return nn(i),Ah(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,s),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==d&&Ti(i);else{if(typeof d!="string"&&i.stateNode===null)throw Error(a(166));if(r=re.current,xa(i)){if(r=i.stateNode,s=i.memoizedProps,d=null,p=Dn,p!==null)switch(p.tag){case 27:case 5:d=p.memoizedProps}r[rn]=i,r=!!(r.nodeValue===s||d!==null&&d.suppressHydrationWarning===!0||s2(r.nodeValue,s)),r||Ua(i,!0)}else r=id(r).createTextNode(d),r[rn]=i,i.stateNode=r}return nn(i),null;case 31:if(s=i.memoizedState,r===null||r.memoizedState!==null){if(d=xa(i),s!==null){if(r===null){if(!d)throw Error(a(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));r[rn]=i}else bi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;nn(i),r=!1}else s=fs(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=s),r=!0;if(!r)return i.flags&256?(_r(i),i):(_r(i),null);if((i.flags&128)!==0)throw Error(a(558))}return nn(i),null;case 13:if(d=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=xa(i),d!==null&&d.dehydrated!==null){if(r===null){if(!p)throw Error(a(318));if(p=i.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(a(317));p[rn]=i}else bi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;nn(i),p=!1}else p=fs(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return i.flags&256?(_r(i),i):(_r(i),null)}return _r(i),(i.flags&128)!==0?(i.lanes=s,i):(s=d!==null,r=r!==null&&r.memoizedState!==null,s&&(d=i.child,p=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(p=d.alternate.memoizedState.cachePool.pool),y=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(y=d.memoizedState.cachePool.pool),y!==p&&(d.flags|=2048)),s!==r&&s&&(i.child.flags|=8192),P0(i,i.updateQueue),nn(i),null);case 4:return He(),r===null&&Kh(i.stateNode.containerInfo),nn(i),null;case 10:return Rr(i.type),nn(i),null;case 19:if(te(xn),d=i.memoizedState,d===null)return nn(i),null;if(p=(i.flags&128)!==0,y=d.rendering,y===null)if(p)ec(d,!1);else{if(hn!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(y=z0(r),y!==null){for(i.flags|=128,ec(d,!1),r=y.updateQueue,i.updateQueue=r,P0(i,r),i.subtreeFlags=0,r=s,s=i.child;s!==null;)w0(s,r),s=s.sibling;return O(xn,xn.current&1|2),yt&&Jr(i,d.treeForkCount),i.child}r=r.sibling}d.tail!==null&&ht()>K0&&(i.flags|=128,p=!0,ec(d,!1),i.lanes=4194304)}else{if(!p)if(r=z0(y),r!==null){if(i.flags|=128,p=!0,r=r.updateQueue,i.updateQueue=r,P0(i,r),ec(d,!0),d.tail===null&&d.tailMode==="hidden"&&!y.alternate&&!yt)return nn(i),null}else 2*ht()-d.renderingStartTime>K0&&s!==536870912&&(i.flags|=128,p=!0,ec(d,!1),i.lanes=4194304);d.isBackwards?(y.sibling=i.child,i.child=y):(r=d.last,r!==null?r.sibling=y:i.child=y,d.last=y)}return d.tail!==null?(r=d.tail,d.rendering=r,d.tail=r.sibling,d.renderingStartTime=ht(),r.sibling=null,s=xn.current,O(xn,p?s&1|2:s&1),yt&&Jr(i,d.treeForkCount),r):(nn(i),null);case 22:case 23:return _r(i),Xf(),d=i.memoizedState!==null,r!==null?r.memoizedState!==null!==d&&(i.flags|=8192):d&&(i.flags|=8192),d?(s&536870912)!==0&&(i.flags&128)===0&&(nn(i),i.subtreeFlags&6&&(i.flags|=8192)):nn(i),s=i.updateQueue,s!==null&&P0(i,s.retryQueue),s=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),d=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),d!==s&&(i.flags|=2048),r!==null&&te($n),null;case 24:return s=null,r!==null&&(s=r.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),Rr(Jt),nn(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function f7(r,i){switch(Bu(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return Rr(Jt),He(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return et(i),null;case 31:if(i.memoizedState!==null){if(_r(i),i.alternate===null)throw Error(a(340));bi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(_r(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));bi()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return te(xn),null;case 4:return He(),null;case 10:return Rr(i.type),null;case 22:case 23:return _r(i),Xf(),r!==null&&te($n),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return Rr(Jt),null;case 25:return null;default:return null}}function fg(r,i){switch(Bu(i),i.tag){case 3:Rr(Jt),He();break;case 26:case 27:case 5:et(i);break;case 4:He();break;case 31:i.memoizedState!==null&&_r(i);break;case 13:_r(i);break;case 19:te(xn);break;case 10:Rr(i.type);break;case 22:case 23:_r(i),Xf(),r!==null&&te($n);break;case 24:Rr(Jt)}}function tc(r,i){try{var s=i.updateQueue,d=s!==null?s.lastEffect:null;if(d!==null){var p=d.next;s=p;do{if((s.tag&r)===r){d=void 0;var y=s.create,j=s.inst;d=y(),j.destroy=d}s=s.next}while(s!==p)}}catch(R){Ht(i,i.return,R)}}function pl(r,i,s){try{var d=i.updateQueue,p=d!==null?d.lastEffect:null;if(p!==null){var y=p.next;d=y;do{if((d.tag&r)===r){var j=d.inst,R=j.destroy;if(R!==void 0){j.destroy=void 0,p=i;var V=s,se=R;try{se()}catch(ye){Ht(p,V,ye)}}}d=d.next}while(d!==y)}}catch(ye){Ht(i,i.return,ye)}}function hg(r){var i=r.updateQueue;if(i!==null){var s=r.stateNode;try{r4(i,s)}catch(d){Ht(r,r.return,d)}}}function mg(r,i,s){s.props=ys(r.type,r.memoizedProps),s.state=r.memoizedState;try{s.componentWillUnmount()}catch(d){Ht(r,i,d)}}function nc(r,i){try{var s=r.ref;if(s!==null){switch(r.tag){case 26:case 27:case 5:var d=r.stateNode;break;case 30:d=r.stateNode;break;default:d=r.stateNode}typeof s=="function"?r.refCleanup=s(d):s.current=d}}catch(p){Ht(r,i,p)}}function Ya(r,i){var s=r.ref,d=r.refCleanup;if(s!==null)if(typeof d=="function")try{d()}catch(p){Ht(r,i,p)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(p){Ht(r,i,p)}else s.current=null}function pg(r){var i=r.type,s=r.memoizedProps,d=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":s.autoFocus&&d.focus();break e;case"img":s.src?d.src=s.src:s.srcSet&&(d.srcset=s.srcSet)}}catch(p){Ht(r,r.return,p)}}function Eh(r,i,s){try{var d=r.stateNode;O7(d,r.type,s,i),d[gn]=i}catch(p){Ht(r,r.return,p)}}function gg(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&kl(r.type)||r.tag===4}function Nh(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||gg(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&kl(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Mh(r,i,s){var d=r.tag;if(d===5||d===6)r=r.stateNode,i?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(r,i):(i=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,i.appendChild(r),s=s._reactRootContainer,s!=null||i.onclick!==null||(i.onclick=er));else if(d!==4&&(d===27&&kl(r.type)&&(s=r.stateNode,i=null),r=r.child,r!==null))for(Mh(r,i,s),r=r.sibling;r!==null;)Mh(r,i,s),r=r.sibling}function G0(r,i,s){var d=r.tag;if(d===5||d===6)r=r.stateNode,i?s.insertBefore(r,i):s.appendChild(r);else if(d!==4&&(d===27&&kl(r.type)&&(s=r.stateNode),r=r.child,r!==null))for(G0(r,i,s),r=r.sibling;r!==null;)G0(r,i,s),r=r.sibling}function yg(r){var i=r.stateNode,s=r.memoizedProps;try{for(var d=r.type,p=i.attributes;p.length;)i.removeAttributeNode(p[0]);Pn(i,d,s),i[rn]=r,i[gn]=s}catch(y){Ht(r,r.return,y)}}var Ai=!1,Tn=!1,zh=!1,vg=typeof WeakSet=="function"?WeakSet:Set,qn=null;function h7(r,i){if(r=r.containerInfo,Qh=fd,r=oo(r),Au(r)){if("selectionStart"in r)var s={start:r.selectionStart,end:r.selectionEnd};else e:{s=(s=r.ownerDocument)&&s.defaultView||window;var d=s.getSelection&&s.getSelection();if(d&&d.rangeCount!==0){s=d.anchorNode;var p=d.anchorOffset,y=d.focusNode;d=d.focusOffset;try{s.nodeType,y.nodeType}catch{s=null;break e}var j=0,R=-1,V=-1,se=0,ye=0,xe=r,ue=null;t:for(;;){for(var de;xe!==s||p!==0&&xe.nodeType!==3||(R=j+p),xe!==y||d!==0&&xe.nodeType!==3||(V=j+d),xe.nodeType===3&&(j+=xe.nodeValue.length),(de=xe.firstChild)!==null;)ue=xe,xe=de;for(;;){if(xe===r)break t;if(ue===s&&++se===p&&(R=j),ue===y&&++ye===d&&(V=j),(de=xe.nextSibling)!==null)break;xe=ue,ue=xe.parentNode}xe=de}s=R===-1||V===-1?null:{start:R,end:V}}else s=null}s=s||{start:0,end:0}}else s=null;for(Jh={focusedElem:r,selectionRange:s},fd=!1,qn=i;qn!==null;)if(i=qn,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,qn=r;else for(;qn!==null;){switch(i=qn,y=i.alternate,r=i.flags,i.tag){case 0:if((r&4)!==0&&(r=i.updateQueue,r=r!==null?r.events:null,r!==null))for(s=0;s<r.length;s++)p=r[s],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&y!==null){r=void 0,s=i,p=y.memoizedProps,y=y.memoizedState,d=s.stateNode;try{var Ge=ys(s.type,p);r=d.getSnapshotBeforeUpdate(Ge,y),d.__reactInternalSnapshotBeforeUpdate=r}catch(rt){Ht(s,s.return,rt)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,s=r.nodeType,s===9)nm(r);else if(s===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":nm(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(a(163))}if(r=i.sibling,r!==null){r.return=i.return,qn=r;break}qn=i.return}}function xg(r,i,s){var d=s.flags;switch(s.tag){case 0:case 11:case 15:Ni(r,s),d&4&&tc(5,s);break;case 1:if(Ni(r,s),d&4)if(r=s.stateNode,i===null)try{r.componentDidMount()}catch(j){Ht(s,s.return,j)}else{var p=ys(s.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(p,i,r.__reactInternalSnapshotBeforeUpdate)}catch(j){Ht(s,s.return,j)}}d&64&&hg(s),d&512&&nc(s,s.return);break;case 3:if(Ni(r,s),d&64&&(r=s.updateQueue,r!==null)){if(i=null,s.child!==null)switch(s.child.tag){case 27:case 5:i=s.child.stateNode;break;case 1:i=s.child.stateNode}try{r4(r,i)}catch(j){Ht(s,s.return,j)}}break;case 27:i===null&&d&4&&yg(s);case 26:case 5:Ni(r,s),i===null&&d&4&&pg(s),d&512&&nc(s,s.return);break;case 12:Ni(r,s);break;case 31:Ni(r,s),d&4&&kg(r,s);break;case 13:Ni(r,s),d&4&&Sg(r,s),d&64&&(r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(s=k7.bind(null,s),$7(r,s))));break;case 22:if(d=s.memoizedState!==null||Ai,!d){i=i!==null&&i.memoizedState!==null||Tn,p=Ai;var y=Tn;Ai=d,(Tn=i)&&!y?Mi(r,s,(s.subtreeFlags&8772)!==0):Ni(r,s),Ai=p,Tn=y}break;case 30:break;default:Ni(r,s)}}function bg(r){var i=r.alternate;i!==null&&(r.alternate=null,bg(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&Vl(i)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var an=null,yr=!1;function Ei(r,i,s){for(s=s.child;s!==null;)wg(r,i,s),s=s.sibling}function wg(r,i,s){if(dn&&typeof dn.onCommitFiberUnmount=="function")try{dn.onCommitFiberUnmount(Bt,s)}catch{}switch(s.tag){case 26:Tn||Ya(s,i),Ei(r,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Tn||Ya(s,i);var d=an,p=yr;kl(s.type)&&(an=s.stateNode,yr=!1),Ei(r,i,s),dc(s.stateNode),an=d,yr=p;break;case 5:Tn||Ya(s,i);case 6:if(d=an,p=yr,an=null,Ei(r,i,s),an=d,yr=p,an!==null)if(yr)try{(an.nodeType===9?an.body:an.nodeName==="HTML"?an.ownerDocument.body:an).removeChild(s.stateNode)}catch(y){Ht(s,i,y)}else try{an.removeChild(s.stateNode)}catch(y){Ht(s,i,y)}break;case 18:an!==null&&(yr?(r=an,h2(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,s.stateNode),qo(r)):h2(an,s.stateNode));break;case 4:d=an,p=yr,an=s.stateNode.containerInfo,yr=!0,Ei(r,i,s),an=d,yr=p;break;case 0:case 11:case 14:case 15:pl(2,s,i),Tn||pl(4,s,i),Ei(r,i,s);break;case 1:Tn||(Ya(s,i),d=s.stateNode,typeof d.componentWillUnmount=="function"&&mg(s,i,d)),Ei(r,i,s);break;case 21:Ei(r,i,s);break;case 22:Tn=(d=Tn)||s.memoizedState!==null,Ei(r,i,s),Tn=d;break;default:Ei(r,i,s)}}function kg(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{qo(r)}catch(s){Ht(i,i.return,s)}}}function Sg(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{qo(r)}catch(s){Ht(i,i.return,s)}}function m7(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new vg),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new vg),i;default:throw Error(a(435,r.tag))}}function V0(r,i){var s=m7(r);i.forEach(function(d){if(!s.has(d)){s.add(d);var p=S7.bind(null,r,d);d.then(p,p)}})}function vr(r,i){var s=i.deletions;if(s!==null)for(var d=0;d<s.length;d++){var p=s[d],y=r,j=i,R=j;e:for(;R!==null;){switch(R.tag){case 27:if(kl(R.type)){an=R.stateNode,yr=!1;break e}break;case 5:an=R.stateNode,yr=!1;break e;case 3:case 4:an=R.stateNode.containerInfo,yr=!0;break e}R=R.return}if(an===null)throw Error(a(160));wg(y,j,p),an=null,yr=!1,y=p.alternate,y!==null&&(y.return=null),p.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)jg(i,r),i=i.sibling}var Sa=null;function jg(r,i){var s=r.alternate,d=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:vr(i,r),xr(r),d&4&&(pl(3,r,r.return),tc(3,r),pl(5,r,r.return));break;case 1:vr(i,r),xr(r),d&512&&(Tn||s===null||Ya(s,s.return)),d&64&&Ai&&(r=r.updateQueue,r!==null&&(d=r.callbacks,d!==null&&(s=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=s===null?d:s.concat(d))));break;case 26:var p=Sa;if(vr(i,r),xr(r),d&512&&(Tn||s===null||Ya(s,s.return)),d&4){var y=s!==null?s.memoizedState:null;if(d=r.memoizedState,s===null)if(d===null)if(r.stateNode===null){e:{d=r.type,s=r.memoizedProps,p=p.ownerDocument||p;t:switch(d){case"title":y=p.getElementsByTagName("title")[0],(!y||y[oa]||y[rn]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=p.createElement(d),p.head.insertBefore(y,p.querySelector("head > title"))),Pn(y,d,s),y[rn]=r,yn(y),d=y;break e;case"link":var j=j2("link","href",p).get(d+(s.href||""));if(j){for(var R=0;R<j.length;R++)if(y=j[R],y.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&y.getAttribute("rel")===(s.rel==null?null:s.rel)&&y.getAttribute("title")===(s.title==null?null:s.title)&&y.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){j.splice(R,1);break t}}y=p.createElement(d),Pn(y,d,s),p.head.appendChild(y);break;case"meta":if(j=j2("meta","content",p).get(d+(s.content||""))){for(R=0;R<j.length;R++)if(y=j[R],y.getAttribute("content")===(s.content==null?null:""+s.content)&&y.getAttribute("name")===(s.name==null?null:s.name)&&y.getAttribute("property")===(s.property==null?null:s.property)&&y.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&y.getAttribute("charset")===(s.charSet==null?null:s.charSet)){j.splice(R,1);break t}}y=p.createElement(d),Pn(y,d,s),p.head.appendChild(y);break;default:throw Error(a(468,d))}y[rn]=r,yn(y),d=y}r.stateNode=d}else C2(p,r.type,r.stateNode);else r.stateNode=S2(p,d,r.memoizedProps);else y!==d?(y===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):y.count--,d===null?C2(p,r.type,r.stateNode):S2(p,d,r.memoizedProps)):d===null&&r.stateNode!==null&&Eh(r,r.memoizedProps,s.memoizedProps)}break;case 27:vr(i,r),xr(r),d&512&&(Tn||s===null||Ya(s,s.return)),s!==null&&d&4&&Eh(r,r.memoizedProps,s.memoizedProps);break;case 5:if(vr(i,r),xr(r),d&512&&(Tn||s===null||Ya(s,s.return)),r.flags&32){p=r.stateNode;try{Er(p,"")}catch(Ge){Ht(r,r.return,Ge)}}d&4&&r.stateNode!=null&&(p=r.memoizedProps,Eh(r,p,s!==null?s.memoizedProps:p)),d&1024&&(zh=!0);break;case 6:if(vr(i,r),xr(r),d&4){if(r.stateNode===null)throw Error(a(162));d=r.memoizedProps,s=r.stateNode;try{s.nodeValue=d}catch(Ge){Ht(r,r.return,Ge)}}break;case 3:if(od=null,p=Sa,Sa=ld(i.containerInfo),vr(i,r),Sa=p,xr(r),d&4&&s!==null&&s.memoizedState.isDehydrated)try{qo(i.containerInfo)}catch(Ge){Ht(r,r.return,Ge)}zh&&(zh=!1,Cg(r));break;case 4:d=Sa,Sa=ld(r.stateNode.containerInfo),vr(i,r),xr(r),Sa=d;break;case 12:vr(i,r),xr(r);break;case 31:vr(i,r),xr(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,V0(r,d)));break;case 13:vr(i,r),xr(r),r.child.flags&8192&&r.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(W0=ht()),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,V0(r,d)));break;case 22:p=r.memoizedState!==null;var V=s!==null&&s.memoizedState!==null,se=Ai,ye=Tn;if(Ai=se||p,Tn=ye||V,vr(i,r),Tn=ye,Ai=se,xr(r),d&8192)e:for(i=r.stateNode,i._visibility=p?i._visibility&-2:i._visibility|1,p&&(s===null||V||Ai||Tn||vs(r)),s=null,i=r;;){if(i.tag===5||i.tag===26){if(s===null){V=s=i;try{if(y=V.stateNode,p)j=y.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none";else{R=V.stateNode;var xe=V.memoizedProps.style,ue=xe!=null&&xe.hasOwnProperty("display")?xe.display:null;R.style.display=ue==null||typeof ue=="boolean"?"":(""+ue).trim()}}catch(Ge){Ht(V,V.return,Ge)}}}else if(i.tag===6){if(s===null){V=i;try{V.stateNode.nodeValue=p?"":V.memoizedProps}catch(Ge){Ht(V,V.return,Ge)}}}else if(i.tag===18){if(s===null){V=i;try{var de=V.stateNode;p?m2(de,!0):m2(V.stateNode,!1)}catch(Ge){Ht(V,V.return,Ge)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===r)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;s===i&&(s=null),i=i.return}s===i&&(s=null),i.sibling.return=i.return,i=i.sibling}d&4&&(d=r.updateQueue,d!==null&&(s=d.retryQueue,s!==null&&(d.retryQueue=null,V0(r,s))));break;case 19:vr(i,r),xr(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,V0(r,d)));break;case 30:break;case 21:break;default:vr(i,r),xr(r)}}function xr(r){var i=r.flags;if(i&2){try{for(var s,d=r.return;d!==null;){if(gg(d)){s=d;break}d=d.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var p=s.stateNode,y=Nh(r);G0(r,y,p);break;case 5:var j=s.stateNode;s.flags&32&&(Er(j,""),s.flags&=-33);var R=Nh(r);G0(r,R,j);break;case 3:case 4:var V=s.stateNode.containerInfo,se=Nh(r);Mh(r,se,V);break;default:throw Error(a(161))}}catch(ye){Ht(r,r.return,ye)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function Cg(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;Cg(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function Ni(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)xg(r,i.alternate,i),i=i.sibling}function vs(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:pl(4,i,i.return),vs(i);break;case 1:Ya(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&mg(i,i.return,s),vs(i);break;case 27:dc(i.stateNode);case 26:case 5:Ya(i,i.return),vs(i);break;case 22:i.memoizedState===null&&vs(i);break;case 30:vs(i);break;default:vs(i)}r=r.sibling}}function Mi(r,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var d=i.alternate,p=r,y=i,j=y.flags;switch(y.tag){case 0:case 11:case 15:Mi(p,y,s),tc(4,y);break;case 1:if(Mi(p,y,s),d=y,p=d.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(se){Ht(d,d.return,se)}if(d=y,p=d.updateQueue,p!==null){var R=d.stateNode;try{var V=p.shared.hiddenCallbacks;if(V!==null)for(p.shared.hiddenCallbacks=null,p=0;p<V.length;p++)n4(V[p],R)}catch(se){Ht(d,d.return,se)}}s&&j&64&&hg(y),nc(y,y.return);break;case 27:yg(y);case 26:case 5:Mi(p,y,s),s&&d===null&&j&4&&pg(y),nc(y,y.return);break;case 12:Mi(p,y,s);break;case 31:Mi(p,y,s),s&&j&4&&kg(p,y);break;case 13:Mi(p,y,s),s&&j&4&&Sg(p,y);break;case 22:y.memoizedState===null&&Mi(p,y,s),nc(y,y.return);break;case 30:break;default:Mi(p,y,s)}i=i.sibling}}function Dh(r,i){var s=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==s&&(r!=null&&r.refCount++,s!=null&&wa(s))}function Rh(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&wa(r))}function ja(r,i,s,d){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Tg(r,i,s,d),i=i.sibling}function Tg(r,i,s,d){var p=i.flags;switch(i.tag){case 0:case 11:case 15:ja(r,i,s,d),p&2048&&tc(9,i);break;case 1:ja(r,i,s,d);break;case 3:ja(r,i,s,d),p&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&wa(r)));break;case 12:if(p&2048){ja(r,i,s,d),r=i.stateNode;try{var y=i.memoizedProps,j=y.id,R=y.onPostCommit;typeof R=="function"&&R(j,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(V){Ht(i,i.return,V)}}else ja(r,i,s,d);break;case 31:ja(r,i,s,d);break;case 13:ja(r,i,s,d);break;case 23:break;case 22:y=i.stateNode,j=i.alternate,i.memoizedState!==null?y._visibility&2?ja(r,i,s,d):rc(r,i):y._visibility&2?ja(r,i,s,d):(y._visibility|=2,Eo(r,i,s,d,(i.subtreeFlags&10256)!==0||!1)),p&2048&&Dh(j,i);break;case 24:ja(r,i,s,d),p&2048&&Rh(i.alternate,i);break;default:ja(r,i,s,d)}}function Eo(r,i,s,d,p){for(p=p&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var y=r,j=i,R=s,V=d,se=j.flags;switch(j.tag){case 0:case 11:case 15:Eo(y,j,R,V,p),tc(8,j);break;case 23:break;case 22:var ye=j.stateNode;j.memoizedState!==null?ye._visibility&2?Eo(y,j,R,V,p):rc(y,j):(ye._visibility|=2,Eo(y,j,R,V,p)),p&&se&2048&&Dh(j.alternate,j);break;case 24:Eo(y,j,R,V,p),p&&se&2048&&Rh(j.alternate,j);break;default:Eo(y,j,R,V,p)}i=i.sibling}}function rc(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var s=r,d=i,p=d.flags;switch(d.tag){case 22:rc(s,d),p&2048&&Dh(d.alternate,d);break;case 24:rc(s,d),p&2048&&Rh(d.alternate,d);break;default:rc(s,d)}i=i.sibling}}var ac=8192;function No(r,i,s){if(r.subtreeFlags&ac)for(r=r.child;r!==null;)Ag(r,i,s),r=r.sibling}function Ag(r,i,s){switch(r.tag){case 26:No(r,i,s),r.flags&ac&&r.memoizedState!==null&&eb(s,Sa,r.memoizedState,r.memoizedProps);break;case 5:No(r,i,s);break;case 3:case 4:var d=Sa;Sa=ld(r.stateNode.containerInfo),No(r,i,s),Sa=d;break;case 22:r.memoizedState===null&&(d=r.alternate,d!==null&&d.memoizedState!==null?(d=ac,ac=16777216,No(r,i,s),ac=d):No(r,i,s));break;default:No(r,i,s)}}function Eg(r){var i=r.alternate;if(i!==null&&(r=i.child,r!==null)){i.child=null;do i=r.sibling,r.sibling=null,r=i;while(r!==null)}}function ic(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var d=i[s];qn=d,Mg(d,r)}Eg(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Ng(r),r=r.sibling}function Ng(r){switch(r.tag){case 0:case 11:case 15:ic(r),r.flags&2048&&pl(9,r,r.return);break;case 3:ic(r);break;case 12:ic(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,Y0(r)):ic(r);break;default:ic(r)}}function Y0(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var d=i[s];qn=d,Mg(d,r)}Eg(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:pl(8,i,i.return),Y0(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,Y0(i));break;default:Y0(i)}r=r.sibling}}function Mg(r,i){for(;qn!==null;){var s=qn;switch(s.tag){case 0:case 11:case 15:pl(8,s,i);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var d=s.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:wa(s.memoizedState.cache)}if(d=s.child,d!==null)d.return=s,qn=d;else e:for(s=r;qn!==null;){d=qn;var p=d.sibling,y=d.return;if(bg(d),d===s){qn=null;break e}if(p!==null){p.return=y,qn=p;break e}qn=y}}}var p7={getCacheForType:function(r){var i=Rn(Jt),s=i.data.get(r);return s===void 0&&(s=r(),i.data.set(r,s)),s},cacheSignal:function(){return Rn(Jt).controller.signal}},g7=typeof WeakMap=="function"?WeakMap:Map,Rt=0,Kt=null,vt=null,St=0,Ut=0,Lr=null,gl=!1,Mo=!1,Oh=!1,zi=0,hn=0,yl=0,xs=0,Ih=0,Br=0,zo=0,lc=null,br=null,_h=!1,W0=0,zg=0,K0=1/0,X0=null,vl=null,On=0,xl=null,Do=null,Di=0,Lh=0,Bh=null,Dg=null,sc=0,qh=null;function qr(){return(Rt&2)!==0&&St!==0?St&-St:J.T!==null?Gh():Us()}function Rg(){if(Br===0)if((St&536870912)===0||yt){var r=Fl;Fl<<=1,(Fl&3932160)===0&&(Fl=262144),Br=r}else Br=536870912;return r=Ir.current,r!==null&&(r.flags|=32),Br}function wr(r,i,s){(r===Kt&&(Ut===2||Ut===9)||r.cancelPendingCommit!==null)&&(Ro(r,0),bl(r,St,Br,!1)),Fi(r,s),((Rt&2)===0||r!==Kt)&&(r===Kt&&((Rt&2)===0&&(xs|=s),hn===4&&bl(r,St,Br,!1)),Wa(r))}function Og(r,i,s){if((Rt&6)!==0)throw Error(a(327));var d=!s&&(i&127)===0&&(i&r.expiredLanes)===0||Ft(r,i),p=d?x7(r,i):Hh(r,i,!0),y=d;do{if(p===0){Mo&&!d&&bl(r,i,0,!1);break}else{if(s=r.current.alternate,y&&!y7(s)){p=Hh(r,i,!1),y=!1;continue}if(p===2){if(y=i,r.errorRecoveryDisabledLanes&y)var j=0;else j=r.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){i=j;e:{var R=r;p=lc;var V=R.current.memoizedState.isDehydrated;if(V&&(Ro(R,j).flags|=256),j=Hh(R,j,!1),j!==2){if(Oh&&!V){R.errorRecoveryDisabledLanes|=y,xs|=y,p=4;break e}y=br,br=p,y!==null&&(br===null?br=y:br.push.apply(br,y))}p=j}if(y=!1,p!==2)continue}}if(p===1){Ro(r,0),bl(r,i,0,!0);break}e:{switch(d=r,y=p,y){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:bl(d,i,Br,!gl);break e;case 2:br=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(p=W0+300-ht(),10<p)){if(bl(d,i,Br,!gl),sa(d,0,!0)!==0)break e;Di=i,d.timeoutHandle=d2(Ig.bind(null,d,s,br,X0,_h,i,Br,xs,zo,gl,y,"Throttled",-0,0),p);break e}Ig(d,s,br,X0,_h,i,Br,xs,zo,gl,y,null,-0,0)}}break}while(!0);Wa(r)}function Ig(r,i,s,d,p,y,j,R,V,se,ye,xe,ue,de){if(r.timeoutHandle=-1,xe=i.subtreeFlags,xe&8192||(xe&16785408)===16785408){xe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:er},Ag(i,y,xe);var Ge=(y&62914560)===y?W0-ht():(y&4194048)===y?zg-ht():0;if(Ge=tb(xe,Ge),Ge!==null){Di=y,r.cancelPendingCommit=Ge(Fg.bind(null,r,i,y,s,d,p,j,R,V,ye,xe,null,ue,de)),bl(r,y,j,!se);return}}Fg(r,i,y,s,d,p,j,R,V)}function y7(r){for(var i=r;;){var s=i.tag;if((s===0||s===11||s===15)&&i.flags&16384&&(s=i.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var d=0;d<s.length;d++){var p=s[d],y=p.getSnapshot;p=p.value;try{if(!tr(y(),p))return!1}catch{return!1}}if(s=i.child,i.subtreeFlags&16384&&s!==null)s.return=i,i=s;else{if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function bl(r,i,s,d){i&=~Ih,i&=~xs,r.suspendedLanes|=i,r.pingedLanes&=~i,d&&(r.warmLanes|=i),d=r.expirationTimes;for(var p=i;0<p;){var y=31-_t(p),j=1<<y;d[y]=-1,p&=~j}s!==0&&n0(r,s,i)}function Z0(){return(Rt&6)===0?(oc(0),!1):!0}function Uh(){if(vt!==null){if(Ut===0)var r=vt.return;else r=vt,ba=Dr=null,nh(r),N=null,$=0,r=vt;for(;r!==null;)fg(r.alternate,r),r=r.return;vt=null}}function Ro(r,i){var s=r.timeoutHandle;s!==-1&&(r.timeoutHandle=-1,L7(s)),s=r.cancelPendingCommit,s!==null&&(r.cancelPendingCommit=null,s()),Di=0,Uh(),Kt=r,vt=s=ya(r.current,null),St=i,Ut=0,Lr=null,gl=!1,Mo=Ft(r,i),Oh=!1,zo=Br=Ih=xs=yl=hn=0,br=lc=null,_h=!1,(i&8)!==0&&(i|=i&32);var d=r.entangledLanes;if(d!==0)for(r=r.entanglements,d&=i;0<d;){var p=31-_t(d),y=1<<p;i|=r[p],d&=~y}return zi=i,fo(),s}function _g(r,i){ut=null,J.H=Qu,i===Pa||i===ko?(i=x(),Ut=3):i===Fu?(i=x(),Ut=4):Ut=i===vh?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Lr=i,vt===null&&(hn=1,U0(r,nr(i,r.current)))}function Lg(){var r=Ir.current;return r===null?!0:(St&4194048)===St?ea===null:(St&62914560)===St||(St&536870912)!==0?r===ea:!1}function Bg(){var r=J.H;return J.H=Qu,r===null?Qu:r}function qg(){var r=J.A;return J.A=p7,r}function Q0(){hn=4,gl||(St&4194048)!==St&&Ir.current!==null||(Mo=!0),(yl&134217727)===0&&(xs&134217727)===0||Kt===null||bl(Kt,St,Br,!1)}function Hh(r,i,s){var d=Rt;Rt|=2;var p=Bg(),y=qg();(Kt!==r||St!==i)&&(X0=null,Ro(r,i)),i=!1;var j=hn;e:do try{if(Ut!==0&&vt!==null){var R=vt,V=Lr;switch(Ut){case 8:Uh(),j=6;break e;case 3:case 2:case 9:case 6:Ir.current===null&&(i=!0);var se=Ut;if(Ut=0,Lr=null,Oo(r,R,V,se),s&&Mo){j=0;break e}break;default:se=Ut,Ut=0,Lr=null,Oo(r,R,V,se)}}v7(),j=hn;break}catch(ye){_g(r,ye)}while(!0);return i&&r.shellSuspendCounter++,ba=Dr=null,Rt=d,J.H=p,J.A=y,vt===null&&(Kt=null,St=0,fo()),j}function v7(){for(;vt!==null;)Ug(vt)}function x7(r,i){var s=Rt;Rt|=2;var d=Bg(),p=qg();Kt!==r||St!==i?(X0=null,K0=ht()+500,Ro(r,i)):Mo=Ft(r,i);e:do try{if(Ut!==0&&vt!==null){i=vt;var y=Lr;t:switch(Ut){case 1:Ut=0,Lr=null,Oo(r,i,y,1);break;case 2:case 9:if(Pu(y)){Ut=0,Lr=null,Hg(i);break}i=function(){Ut!==2&&Ut!==9||Kt!==r||(Ut=7),Wa(r)},y.then(i,i);break e;case 3:Ut=7;break e;case 4:Ut=5;break e;case 7:Pu(y)?(Ut=0,Lr=null,Hg(i)):(Ut=0,Lr=null,Oo(r,i,y,7));break;case 5:var j=null;switch(vt.tag){case 26:j=vt.memoizedState;case 5:case 27:var R=vt;if(j?T2(j):R.stateNode.complete){Ut=0,Lr=null;var V=R.sibling;if(V!==null)vt=V;else{var se=R.return;se!==null?(vt=se,J0(se)):vt=null}break t}}Ut=0,Lr=null,Oo(r,i,y,5);break;case 6:Ut=0,Lr=null,Oo(r,i,y,6);break;case 8:Uh(),hn=6;break e;default:throw Error(a(462))}}b7();break}catch(ye){_g(r,ye)}while(!0);return ba=Dr=null,J.H=d,J.A=p,Rt=s,vt!==null?0:(Kt=null,St=0,fo(),hn)}function b7(){for(;vt!==null&&!pn();)Ug(vt)}function Ug(r){var i=cg(r.alternate,r,zi);r.memoizedProps=r.pendingProps,i===null?J0(r):vt=i}function Hg(r){var i=r,s=i.alternate;switch(i.tag){case 15:case 0:i=ag(s,i,i.pendingProps,i.type,void 0,St);break;case 11:i=ag(s,i,i.pendingProps,i.type.render,i.ref,St);break;case 5:nh(i);default:fg(s,i),i=vt=w0(i,zi),i=cg(s,i,zi)}r.memoizedProps=r.pendingProps,i===null?J0(r):vt=i}function Oo(r,i,s,d){ba=Dr=null,nh(i),N=null,$=0;var p=i.return;try{if(o7(r,p,i,s,St)){hn=1,U0(r,nr(s,r.current)),vt=null;return}}catch(y){if(p!==null)throw vt=p,y;hn=1,U0(r,nr(s,r.current)),vt=null;return}i.flags&32768?(yt||d===1?r=!0:Mo||(St&536870912)!==0?r=!1:(gl=r=!0,(d===2||d===9||d===3||d===6)&&(d=Ir.current,d!==null&&d.tag===13&&(d.flags|=16384))),$g(i,r)):J0(i)}function J0(r){var i=r;do{if((i.flags&32768)!==0){$g(i,gl);return}r=i.return;var s=d7(i.alternate,i,zi);if(s!==null){vt=s;return}if(i=i.sibling,i!==null){vt=i;return}vt=i=r}while(i!==null);hn===0&&(hn=5)}function $g(r,i){do{var s=f7(r.alternate,r);if(s!==null){s.flags&=32767,vt=s;return}if(s=r.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(r=r.sibling,r!==null)){vt=r;return}vt=r=s}while(r!==null);hn=6,vt=null}function Fg(r,i,s,d,p,y,j,R,V){r.cancelPendingCommit=null;do ed();while(On!==0);if((Rt&6)!==0)throw Error(a(327));if(i!==null){if(i===r.current)throw Error(a(177));if(y=i.lanes|i.childLanes,y|=Du,Gl(r,s,y,j,R,V),r===Kt&&(vt=Kt=null,St=0),Do=i,xl=r,Di=s,Lh=y,Bh=p,Dg=d,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,j7($e,function(){return Wg(),null})):(r.callbackNode=null,r.callbackPriority=0),d=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||d){d=J.T,J.T=null,p=Y.p,Y.p=2,j=Rt,Rt|=4;try{h7(r,i,s)}finally{Rt=j,Y.p=p,J.T=d}}On=1,Pg(),Gg(),Vg()}}function Pg(){if(On===1){On=0;var r=xl,i=Do,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=J.T,J.T=null;var d=Y.p;Y.p=2;var p=Rt;Rt|=4;try{jg(i,r);var y=Jh,j=oo(r.containerInfo),R=y.focusedElem,V=y.selectionRange;if(j!==R&&R&&R.ownerDocument&&Tu(R.ownerDocument.documentElement,R)){if(V!==null&&Au(R)){var se=V.start,ye=V.end;if(ye===void 0&&(ye=se),"selectionStart"in R)R.selectionStart=se,R.selectionEnd=Math.min(ye,R.value.length);else{var xe=R.ownerDocument||document,ue=xe&&xe.defaultView||window;if(ue.getSelection){var de=ue.getSelection(),Ge=R.textContent.length,rt=Math.min(V.start,Ge),Vt=V.end===void 0?rt:Math.min(V.end,Ge);!de.extend&&rt>Vt&&(j=Vt,Vt=rt,rt=j);var ae=m0(R,rt),X=m0(R,Vt);if(ae&&X&&(de.rangeCount!==1||de.anchorNode!==ae.node||de.anchorOffset!==ae.offset||de.focusNode!==X.node||de.focusOffset!==X.offset)){var le=xe.createRange();le.setStart(ae.node,ae.offset),de.removeAllRanges(),rt>Vt?(de.addRange(le),de.extend(X.node,X.offset)):(le.setEnd(X.node,X.offset),de.addRange(le))}}}}for(xe=[],de=R;de=de.parentNode;)de.nodeType===1&&xe.push({element:de,left:de.scrollLeft,top:de.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<xe.length;R++){var ve=xe[R];ve.element.scrollLeft=ve.left,ve.element.scrollTop=ve.top}}fd=!!Qh,Jh=Qh=null}finally{Rt=p,Y.p=d,J.T=s}}r.current=i,On=2}}function Gg(){if(On===2){On=0;var r=xl,i=Do,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=J.T,J.T=null;var d=Y.p;Y.p=2;var p=Rt;Rt|=4;try{xg(r,i.alternate,i)}finally{Rt=p,Y.p=d,J.T=s}}On=3}}function Vg(){if(On===4||On===3){On=0,en();var r=xl,i=Do,s=Di,d=Dg;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?On=5:(On=0,Do=xl=null,Yg(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(vl=null),cu(s),i=i.stateNode,dn&&typeof dn.onCommitFiberRoot=="function")try{dn.onCommitFiberRoot(Bt,i,void 0,(i.current.flags&128)===128)}catch{}if(d!==null){i=J.T,p=Y.p,Y.p=2,J.T=null;try{for(var y=r.onRecoverableError,j=0;j<d.length;j++){var R=d[j];y(R.value,{componentStack:R.stack})}}finally{J.T=i,Y.p=p}}(Di&3)!==0&&ed(),Wa(r),p=r.pendingLanes,(s&261930)!==0&&(p&42)!==0?r===qh?sc++:(sc=0,qh=r):sc=0,oc(0)}}function Yg(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,wa(i)))}function ed(){return Pg(),Gg(),Vg(),Wg()}function Wg(){if(On!==5)return!1;var r=xl,i=Lh;Lh=0;var s=cu(Di),d=J.T,p=Y.p;try{Y.p=32>s?32:s,J.T=null,s=Bh,Bh=null;var y=xl,j=Di;if(On=0,Do=xl=null,Di=0,(Rt&6)!==0)throw Error(a(331));var R=Rt;if(Rt|=4,Ng(y.current),Tg(y,y.current,j,s),Rt=R,oc(0,!1),dn&&typeof dn.onPostCommitFiberRoot=="function")try{dn.onPostCommitFiberRoot(Bt,y)}catch{}return!0}finally{Y.p=p,J.T=d,Yg(r,i)}}function Kg(r,i,s){i=nr(s,i),i=yh(r.stateNode,i,2),r=fl(r,i,2),r!==null&&(Fi(r,2),Wa(r))}function Ht(r,i,s){if(r.tag===3)Kg(r,r,s);else for(;i!==null;){if(i.tag===3){Kg(i,r,s);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(vl===null||!vl.has(d))){r=nr(s,r),s=X4(2),d=fl(i,s,2),d!==null&&(Z4(s,d,i,r),Fi(d,2),Wa(d));break}}i=i.return}}function $h(r,i,s){var d=r.pingCache;if(d===null){d=r.pingCache=new g7;var p=new Set;d.set(i,p)}else p=d.get(i),p===void 0&&(p=new Set,d.set(i,p));p.has(s)||(Oh=!0,p.add(s),r=w7.bind(null,r,i,s),i.then(r,r))}function w7(r,i,s){var d=r.pingCache;d!==null&&d.delete(i),r.pingedLanes|=r.suspendedLanes&s,r.warmLanes&=~s,Kt===r&&(St&s)===s&&(hn===4||hn===3&&(St&62914560)===St&&300>ht()-W0?(Rt&2)===0&&Ro(r,0):Ih|=s,zo===St&&(zo=0)),Wa(r)}function Xg(r,i){i===0&&(i=ou()),r=xi(r,i),r!==null&&(Fi(r,i),Wa(r))}function k7(r){var i=r.memoizedState,s=0;i!==null&&(s=i.retryLane),Xg(r,s)}function S7(r,i){var s=0;switch(r.tag){case 31:case 13:var d=r.stateNode,p=r.memoizedState;p!==null&&(s=p.retryLane);break;case 19:d=r.stateNode;break;case 22:d=r.stateNode._retryCache;break;default:throw Error(a(314))}d!==null&&d.delete(i),Xg(r,s)}function j7(r,i){return mt(r,i)}var td=null,Io=null,Fh=!1,nd=!1,Ph=!1,wl=0;function Wa(r){r!==Io&&r.next===null&&(Io===null?td=Io=r:Io=Io.next=r),nd=!0,Fh||(Fh=!0,T7())}function oc(r,i){if(!Ph&&nd){Ph=!0;do for(var s=!1,d=td;d!==null;){if(r!==0){var p=d.pendingLanes;if(p===0)var y=0;else{var j=d.suspendedLanes,R=d.pingedLanes;y=(1<<31-_t(42|r)+1)-1,y&=p&~(j&~R),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(s=!0,e2(d,y))}else y=St,y=sa(d,d===Kt?y:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(y&3)===0||Ft(d,y)||(s=!0,e2(d,y));d=d.next}while(s);Ph=!1}}function C7(){Zg()}function Zg(){nd=Fh=!1;var r=0;wl!==0&&_7()&&(r=wl);for(var i=ht(),s=null,d=td;d!==null;){var p=d.next,y=Qg(d,i);y===0?(d.next=null,s===null?td=p:s.next=p,p===null&&(Io=s)):(s=d,(r!==0||(y&3)!==0)&&(nd=!0)),d=p}On!==0&&On!==5||oc(r),wl!==0&&(wl=0)}function Qg(r,i){for(var s=r.suspendedLanes,d=r.pingedLanes,p=r.expirationTimes,y=r.pendingLanes&-62914561;0<y;){var j=31-_t(y),R=1<<j,V=p[j];V===-1?((R&s)===0||(R&d)!==0)&&(p[j]=Pl(R,i)):V<=i&&(r.expiredLanes|=R),y&=~R}if(i=Kt,s=St,s=sa(r,r===i?s:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d=r.callbackNode,s===0||r===i&&(Ut===2||Ut===9)||r.cancelPendingCommit!==null)return d!==null&&d!==null&&At(d),r.callbackNode=null,r.callbackPriority=0;if((s&3)===0||Ft(r,s)){if(i=s&-s,i===r.callbackPriority)return i;switch(d!==null&&At(d),cu(s)){case 2:case 8:s=Se;break;case 32:s=$e;break;case 268435456:s=kt;break;default:s=$e}return d=Jg.bind(null,r),s=mt(s,d),r.callbackPriority=i,r.callbackNode=s,i}return d!==null&&d!==null&&At(d),r.callbackPriority=2,r.callbackNode=null,2}function Jg(r,i){if(On!==0&&On!==5)return r.callbackNode=null,r.callbackPriority=0,null;var s=r.callbackNode;if(ed()&&r.callbackNode!==s)return null;var d=St;return d=sa(r,r===Kt?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d===0?null:(Og(r,d,i),Qg(r,ht()),r.callbackNode!=null&&r.callbackNode===s?Jg.bind(null,r):null)}function e2(r,i){if(ed())return null;Og(r,i,!0)}function T7(){B7(function(){(Rt&6)!==0?mt(me,C7):Zg()})}function Gh(){if(wl===0){var r=dl;r===0&&(r=$l,$l<<=1,($l&261888)===0&&($l=256)),wl=r}return wl}function t2(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:Wi(""+r)}function n2(r,i){var s=i.ownerDocument.createElement("input");return s.name=i.name,s.value=i.value,r.id&&s.setAttribute("form",r.id),i.parentNode.insertBefore(s,i),r=new FormData(r),s.parentNode.removeChild(s),r}function A7(r,i,s,d,p){if(i==="submit"&&s&&s.stateNode===p){var y=t2((p[gn]||null).action),j=d.submitter;j&&(i=(i=j[gn]||null)?t2(i.formAction):j.getAttribute("formAction"),i!==null&&(y=i,j=null));var R=new Xi("action","action",null,d,p);r.push({event:R,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(wl!==0){var V=j?n2(p,j):new FormData(p);dh(s,{pending:!0,data:V,method:p.method,action:y},null,V)}}else typeof y=="function"&&(R.preventDefault(),V=j?n2(p,j):new FormData(p),dh(s,{pending:!0,data:V,method:p.method,action:y},y,V))},currentTarget:p}]})}}for(var Vh=0;Vh<zu.length;Vh++){var Yh=zu[Vh],E7=Yh.toLowerCase(),N7=Yh[0].toUpperCase()+Yh.slice(1);Mr(E7,"on"+N7)}Mr(p0,"onAnimationEnd"),Mr(Mu,"onAnimationIteration"),Mr(g0,"onAnimationStart"),Mr("dblclick","onDoubleClick"),Mr("focusin","onFocus"),Mr("focusout","onBlur"),Mr($f,"onTransitionRun"),Mr(Ff,"onTransitionStart"),Mr(Pf,"onTransitionCancel"),Mr(y0,"onTransitionEnd"),Gi("onMouseEnter",["mouseout","mouseover"]),Gi("onMouseLeave",["mouseout","mouseover"]),Gi("onPointerEnter",["pointerout","pointerover"]),Gi("onPointerLeave",["pointerout","pointerover"]),Ma("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ma("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ma("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ma("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ma("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ma("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var uc="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(" "),M7=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(uc));function r2(r,i){i=(i&4)!==0;for(var s=0;s<r.length;s++){var d=r[s],p=d.event;d=d.listeners;e:{var y=void 0;if(i)for(var j=d.length-1;0<=j;j--){var R=d[j],V=R.instance,se=R.currentTarget;if(R=R.listener,V!==y&&p.isPropagationStopped())break e;y=R,p.currentTarget=se;try{y(p)}catch(ye){co(ye)}p.currentTarget=null,y=V}else for(j=0;j<d.length;j++){if(R=d[j],V=R.instance,se=R.currentTarget,R=R.listener,V!==y&&p.isPropagationStopped())break e;y=R,p.currentTarget=se;try{y(p)}catch(ye){co(ye)}p.currentTarget=null,y=V}}}}function xt(r,i){var s=i[Aa];s===void 0&&(s=i[Aa]=new Set);var d=r+"__bubble";s.has(d)||(a2(i,r,2,!1),s.add(d))}function Wh(r,i,s){var d=0;i&&(d|=4),a2(s,r,d,i)}var rd="_reactListening"+Math.random().toString(36).slice(2);function Kh(r){if(!r[rd]){r[rd]=!0,ua.forEach(function(s){s!=="selectionchange"&&(M7.has(s)||Wh(s,!1,r),Wh(s,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[rd]||(i[rd]=!0,Wh("selectionchange",!1,i))}}function a2(r,i,s,d){switch(R2(i)){case 2:var p=ab;break;case 8:p=ib;break;default:p=cm}s=p.bind(null,i,s,r),p=void 0,!yu||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(p=!0),d?p!==void 0?r.addEventListener(i,s,{capture:!0,passive:p}):r.addEventListener(i,s,!0):p!==void 0?r.addEventListener(i,s,{passive:p}):r.addEventListener(i,s,!1)}function Xh(r,i,s,d,p){var y=d;if((i&1)===0&&(i&2)===0&&d!==null)e:for(;;){if(d===null)return;var j=d.tag;if(j===3||j===4){var R=d.stateNode.containerInfo;if(R===p)break;if(j===4)for(j=d.return;j!==null;){var V=j.tag;if((V===3||V===4)&&j.stateNode.containerInfo===p)return;j=j.return}for(;R!==null;){if(j=Ea(R),j===null)return;if(V=j.tag,V===5||V===6||V===26||V===27){d=y=j;continue e}R=R.parentNode}}d=d.return}gu(function(){var se=y,ye=Xl(s),xe=[];e:{var ue=v0.get(r);if(ue!==void 0){var de=Xi,Ge=r;switch(r){case"keypress":if(Ki(s)===0)break e;case"keydown":case"keyup":de=eo;break;case"focusin":Ge="focus",de=Ia;break;case"focusout":Ge="blur",de=Ia;break;case"beforeblur":case"afterblur":de=Ia;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":de=Qi;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":de=Ks;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":de=vn;break;case p0:case Mu:case g0:de=_a;break;case y0:de=di;break;case"scroll":case"scrollend":de=xu;break;case"wheel":de=Nt;break;case"copy":case"cut":case"paste":de=hr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":de=wu;break;case"toggle":case"beforetoggle":de=no}var rt=(i&4)!==0,Vt=!rt&&(r==="scroll"||r==="scrollend"),ae=rt?ue!==null?ue+"Capture":null:ue;rt=[];for(var X=se,le;X!==null;){var ve=X;if(le=ve.stateNode,ve=ve.tag,ve!==5&&ve!==26&&ve!==27||le===null||ae===null||(ve=Ql(X,ae),ve!=null&&rt.push(cc(X,ve,le))),Vt)break;X=X.return}0<rt.length&&(ue=new de(ue,Ge,null,s,ye),xe.push({event:ue,listeners:rt}))}}if((i&7)===0){e:{if(ue=r==="mouseover"||r==="pointerover",de=r==="mouseout"||r==="pointerout",ue&&s!==oi&&(Ge=s.relatedTarget||s.fromElement)&&(Ea(Ge)||Ge[Ar]))break e;if((de||ue)&&(ue=ye.window===ye?ye:(ue=ye.ownerDocument)?ue.defaultView||ue.parentWindow:window,de?(Ge=s.relatedTarget||s.toElement,de=se,Ge=Ge?Ea(Ge):null,Ge!==null&&(Vt=o(Ge),rt=Ge.tag,Ge!==Vt||rt!==5&&rt!==27&&rt!==6)&&(Ge=null)):(de=null,Ge=se),de!==Ge)){if(rt=Qi,ve="onMouseLeave",ae="onMouseEnter",X="mouse",(r==="pointerout"||r==="pointerover")&&(rt=wu,ve="onPointerLeave",ae="onPointerEnter",X="pointer"),Vt=de==null?ue:ii(de),le=Ge==null?ue:ii(Ge),ue=new rt(ve,X+"leave",de,s,ye),ue.target=Vt,ue.relatedTarget=le,ve=null,Ea(ye)===se&&(rt=new rt(ae,X+"enter",Ge,s,ye),rt.target=le,rt.relatedTarget=Vt,ve=rt),Vt=ve,de&&Ge)t:{for(rt=z7,ae=de,X=Ge,le=0,ve=ae;ve;ve=rt(ve))le++;ve=0;for(var Qe=X;Qe;Qe=rt(Qe))ve++;for(;0<le-ve;)ae=rt(ae),le--;for(;0<ve-le;)X=rt(X),ve--;for(;le--;){if(ae===X||X!==null&&ae===X.alternate){rt=ae;break t}ae=rt(ae),X=rt(X)}rt=null}else rt=null;de!==null&&i2(xe,ue,de,rt,!1),Ge!==null&&Vt!==null&&i2(xe,Vt,Ge,rt,!0)}}e:{if(ue=se?ii(se):window,de=ue.nodeName&&ue.nodeName.toLowerCase(),de==="select"||de==="input"&&ue.type==="file")var zt=f0;else if(io(ue))if(so)zt=Uf;else{zt=ju;var Ye=h0}else de=ue.nodeName,!de||de.toLowerCase()!=="input"||ue.type!=="checkbox"&&ue.type!=="radio"?se&&si(se.elementType)&&(zt=f0):zt=Cu;if(zt&&(zt=zt(r,se))){is(xe,zt,s,ye);break e}Ye&&Ye(r,ue,se),r==="focusout"&&se&&ue.type==="number"&&se.memoizedProps.value!=null&&Vs(ue,"number",ue.value)}switch(Ye=se?ii(se):window,r){case"focusin":(io(Ye)||Ye.contentEditable==="true")&&(ga=Ye,cs=se,gi=null);break;case"focusout":gi=cs=ga=null;break;case"mousedown":Eu=!0;break;case"contextmenu":case"mouseup":case"dragend":Eu=!1,uo(xe,s,ye);break;case"selectionchange":if(Hf)break;case"keydown":case"keyup":uo(xe,s,ye)}var dt;if(fi)e:{switch(r){case"compositionstart":var jt="onCompositionStart";break e;case"compositionend":jt="onCompositionEnd";break e;case"compositionupdate":jt="onCompositionUpdate";break e}jt=void 0}else La?Su(r,s)&&(jt="onCompositionEnd"):r==="keydown"&&s.keyCode===229&&(jt="onCompositionStart");jt&&(u0&&s.locale!=="ko"&&(La||jt!=="onCompositionStart"?jt==="onCompositionEnd"&&La&&(dt=vu()):(Da=ye,Ys="value"in Da?Da.value:Da.textContent,La=!0)),Ye=ad(se,jt),0<Ye.length&&(jt=new tl(jt,r,null,s,ye),xe.push({event:jt,listeners:Ye}),dt?jt.data=dt:(dt=ro(s),dt!==null&&(jt.data=dt)))),(dt=mi?ao(r,s):Bf(r,s))&&(jt=ad(se,"onBeforeInput"),0<jt.length&&(Ye=new tl("onBeforeInput","beforeinput",null,s,ye),xe.push({event:Ye,listeners:jt}),Ye.data=dt)),A7(xe,r,se,s,ye)}r2(xe,i)})}function cc(r,i,s){return{instance:r,listener:i,currentTarget:s}}function ad(r,i){for(var s=i+"Capture",d=[];r!==null;){var p=r,y=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||y===null||(p=Ql(r,s),p!=null&&d.unshift(cc(r,p,y)),p=Ql(r,i),p!=null&&d.push(cc(r,p,y))),r.tag===3)return d;r=r.return}return[]}function z7(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function i2(r,i,s,d,p){for(var y=i._reactName,j=[];s!==null&&s!==d;){var R=s,V=R.alternate,se=R.stateNode;if(R=R.tag,V!==null&&V===d)break;R!==5&&R!==26&&R!==27||se===null||(V=se,p?(se=Ql(s,y),se!=null&&j.unshift(cc(s,se,V))):p||(se=Ql(s,y),se!=null&&j.push(cc(s,se,V)))),s=s.return}j.length!==0&&r.push({event:i,listeners:j})}var D7=/\r\n?/g,R7=/\u0000|\uFFFD/g;function l2(r){return(typeof r=="string"?r:""+r).replace(D7,`
|
|
50
|
+
`).replace(R7,"")}function s2(r,i){return i=l2(i),l2(r)===i}function Gt(r,i,s,d,p,y){switch(s){case"children":typeof d=="string"?i==="body"||i==="textarea"&&d===""||Er(r,d):(typeof d=="number"||typeof d=="bigint")&&i!=="body"&&Er(r,""+d);break;case"className":Wl(r,"class",d);break;case"tabIndex":Wl(r,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":Wl(r,s,d);break;case"style":pu(r,d,y);break;case"data":if(i!=="object"){Wl(r,"data",d);break}case"src":case"href":if(d===""&&(i!=="a"||s!=="href")){r.removeAttribute(s);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(s);break}d=Wi(""+d),r.setAttribute(s,d);break;case"action":case"formAction":if(typeof d=="function"){r.setAttribute(s,"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 y=="function"&&(s==="formAction"?(i!=="input"&&Gt(r,i,"name",p.name,p,null),Gt(r,i,"formEncType",p.formEncType,p,null),Gt(r,i,"formMethod",p.formMethod,p,null),Gt(r,i,"formTarget",p.formTarget,p,null)):(Gt(r,i,"encType",p.encType,p,null),Gt(r,i,"method",p.method,p,null),Gt(r,i,"target",p.target,p,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(s);break}d=Wi(""+d),r.setAttribute(s,d);break;case"onClick":d!=null&&(r.onclick=er);break;case"onScroll":d!=null&&xt("scroll",r);break;case"onScrollEnd":d!=null&&xt("scrollend",r);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(s=d.__html,s!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=s}}break;case"multiple":r.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":r.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){r.removeAttribute("xlink:href");break}s=Wi(""+d),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(s,""+d):r.removeAttribute(s);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":d&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(s,""):r.removeAttribute(s);break;case"capture":case"download":d===!0?r.setAttribute(s,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(s,d):r.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?r.setAttribute(s,d):r.removeAttribute(s);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?r.removeAttribute(s):r.setAttribute(s,d);break;case"popover":xt("beforetoggle",r),xt("toggle",r),Ps(r,"popover",d);break;case"xlinkActuate":Ln(r,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":Ln(r,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":Ln(r,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":Ln(r,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":Ln(r,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":Ln(r,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":Ln(r,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":Ln(r,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":Ln(r,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":Ps(r,"is",d);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=Wr.get(s)||s,Ps(r,s,d))}}function Zh(r,i,s,d,p,y){switch(s){case"style":pu(r,d,y);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(s=d.__html,s!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=s}}break;case"children":typeof d=="string"?Er(r,d):(typeof d=="number"||typeof d=="bigint")&&Er(r,""+d);break;case"onScroll":d!=null&&xt("scroll",r);break;case"onScrollEnd":d!=null&&xt("scrollend",r);break;case"onClick":d!=null&&(r.onclick=er);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!$s.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(p=s.endsWith("Capture"),i=s.slice(2,p?s.length-7:void 0),y=r[gn]||null,y=y!=null?y[s]:null,typeof y=="function"&&r.removeEventListener(i,y,p),typeof d=="function")){typeof y!="function"&&y!==null&&(s in r?r[s]=null:r.hasAttribute(s)&&r.removeAttribute(s)),r.addEventListener(i,d,p);break e}s in r?r[s]=d:d===!0?r.setAttribute(s,""):Ps(r,s,d)}}}function Pn(r,i,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":xt("error",r),xt("load",r);var d=!1,p=!1,y;for(y in s)if(s.hasOwnProperty(y)){var j=s[y];if(j!=null)switch(y){case"src":d=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Gt(r,i,y,j,s,null)}}p&&Gt(r,i,"srcSet",s.srcSet,s,null),d&&Gt(r,i,"src",s.src,s,null);return;case"input":xt("invalid",r);var R=y=j=p=null,V=null,se=null;for(d in s)if(s.hasOwnProperty(d)){var ye=s[d];if(ye!=null)switch(d){case"name":p=ye;break;case"type":j=ye;break;case"checked":V=ye;break;case"defaultChecked":se=ye;break;case"value":y=ye;break;case"defaultValue":R=ye;break;case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(a(137,i));break;default:Gt(r,i,d,ye,s,null)}}Vi(r,y,R,V,se,j,p,!1);return;case"select":xt("invalid",r),d=j=y=null;for(p in s)if(s.hasOwnProperty(p)&&(R=s[p],R!=null))switch(p){case"value":y=R;break;case"defaultValue":j=R;break;case"multiple":d=R;default:Gt(r,i,p,R,s,null)}i=y,s=j,r.multiple=!!d,i!=null?da(r,!!d,i,!1):s!=null&&da(r,!!d,s,!0);return;case"textarea":xt("invalid",r),y=p=d=null;for(j in s)if(s.hasOwnProperty(j)&&(R=s[j],R!=null))switch(j){case"value":d=R;break;case"defaultValue":p=R;break;case"children":y=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(a(91));break;default:Gt(r,i,j,R,s,null)}Yi(r,d,p,y);return;case"option":for(V in s)if(s.hasOwnProperty(V)&&(d=s[V],d!=null))switch(V){case"selected":r.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:Gt(r,i,V,d,s,null)}return;case"dialog":xt("beforetoggle",r),xt("toggle",r),xt("cancel",r),xt("close",r);break;case"iframe":case"object":xt("load",r);break;case"video":case"audio":for(d=0;d<uc.length;d++)xt(uc[d],r);break;case"image":xt("error",r),xt("load",r);break;case"details":xt("toggle",r);break;case"embed":case"source":case"link":xt("error",r),xt("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(se in s)if(s.hasOwnProperty(se)&&(d=s[se],d!=null))switch(se){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Gt(r,i,se,d,s,null)}return;default:if(si(i)){for(ye in s)s.hasOwnProperty(ye)&&(d=s[ye],d!==void 0&&Zh(r,i,ye,d,s,void 0));return}}for(R in s)s.hasOwnProperty(R)&&(d=s[R],d!=null&&Gt(r,i,R,d,s,null))}function O7(r,i,s,d){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,y=null,j=null,R=null,V=null,se=null,ye=null;for(de in s){var xe=s[de];if(s.hasOwnProperty(de)&&xe!=null)switch(de){case"checked":break;case"value":break;case"defaultValue":V=xe;default:d.hasOwnProperty(de)||Gt(r,i,de,null,d,xe)}}for(var ue in d){var de=d[ue];if(xe=s[ue],d.hasOwnProperty(ue)&&(de!=null||xe!=null))switch(ue){case"type":y=de;break;case"name":p=de;break;case"checked":se=de;break;case"defaultChecked":ye=de;break;case"value":j=de;break;case"defaultValue":R=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(a(137,i));break;default:de!==xe&&Gt(r,i,ue,de,d,xe)}}Gs(r,j,R,V,se,ye,y,p);return;case"select":de=j=R=ue=null;for(y in s)if(V=s[y],s.hasOwnProperty(y)&&V!=null)switch(y){case"value":break;case"multiple":de=V;default:d.hasOwnProperty(y)||Gt(r,i,y,null,d,V)}for(p in d)if(y=d[p],V=s[p],d.hasOwnProperty(p)&&(y!=null||V!=null))switch(p){case"value":ue=y;break;case"defaultValue":R=y;break;case"multiple":j=y;default:y!==V&&Gt(r,i,p,y,d,V)}i=R,s=j,d=de,ue!=null?da(r,!!s,ue,!1):!!d!=!!s&&(i!=null?da(r,!!s,i,!0):da(r,!!s,s?[]:"",!1));return;case"textarea":de=ue=null;for(R in s)if(p=s[R],s.hasOwnProperty(R)&&p!=null&&!d.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:Gt(r,i,R,null,d,p)}for(j in d)if(p=d[j],y=s[j],d.hasOwnProperty(j)&&(p!=null||y!=null))switch(j){case"value":ue=p;break;case"defaultValue":de=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==y&&Gt(r,i,j,p,d,y)}s0(r,ue,de);return;case"option":for(var Ge in s)if(ue=s[Ge],s.hasOwnProperty(Ge)&&ue!=null&&!d.hasOwnProperty(Ge))switch(Ge){case"selected":r.selected=!1;break;default:Gt(r,i,Ge,null,d,ue)}for(V in d)if(ue=d[V],de=s[V],d.hasOwnProperty(V)&&ue!==de&&(ue!=null||de!=null))switch(V){case"selected":r.selected=ue&&typeof ue!="function"&&typeof ue!="symbol";break;default:Gt(r,i,V,ue,d,de)}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 rt in s)ue=s[rt],s.hasOwnProperty(rt)&&ue!=null&&!d.hasOwnProperty(rt)&&Gt(r,i,rt,null,d,ue);for(se in d)if(ue=d[se],de=s[se],d.hasOwnProperty(se)&&ue!==de&&(ue!=null||de!=null))switch(se){case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(a(137,i));break;default:Gt(r,i,se,ue,d,de)}return;default:if(si(i)){for(var Vt in s)ue=s[Vt],s.hasOwnProperty(Vt)&&ue!==void 0&&!d.hasOwnProperty(Vt)&&Zh(r,i,Vt,void 0,d,ue);for(ye in d)ue=d[ye],de=s[ye],!d.hasOwnProperty(ye)||ue===de||ue===void 0&&de===void 0||Zh(r,i,ye,ue,d,de);return}}for(var ae in s)ue=s[ae],s.hasOwnProperty(ae)&&ue!=null&&!d.hasOwnProperty(ae)&&Gt(r,i,ae,null,d,ue);for(xe in d)ue=d[xe],de=s[xe],!d.hasOwnProperty(xe)||ue===de||ue==null&&de==null||Gt(r,i,xe,ue,d,de)}function o2(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function I7(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,s=performance.getEntriesByType("resource"),d=0;d<s.length;d++){var p=s[d],y=p.transferSize,j=p.initiatorType,R=p.duration;if(y&&R&&o2(j)){for(j=0,R=p.responseEnd,d+=1;d<s.length;d++){var V=s[d],se=V.startTime;if(se>R)break;var ye=V.transferSize,xe=V.initiatorType;ye&&o2(xe)&&(V=V.responseEnd,j+=ye*(V<R?1:(R-se)/(V-se)))}if(--d,i+=8*(y+j)/(p.duration/1e3),r++,10<r)break}}if(0<r)return i/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var Qh=null,Jh=null;function id(r){return r.nodeType===9?r:r.ownerDocument}function u2(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function c2(r,i){if(r===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&i==="foreignObject"?0:r}function em(r,i){return r==="textarea"||r==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var tm=null;function _7(){var r=window.event;return r&&r.type==="popstate"?r===tm?!1:(tm=r,!0):(tm=null,!1)}var d2=typeof setTimeout=="function"?setTimeout:void 0,L7=typeof clearTimeout=="function"?clearTimeout:void 0,f2=typeof Promise=="function"?Promise:void 0,B7=typeof queueMicrotask=="function"?queueMicrotask:typeof f2<"u"?function(r){return f2.resolve(null).then(r).catch(q7)}:d2;function q7(r){setTimeout(function(){throw r})}function kl(r){return r==="head"}function h2(r,i){var s=i,d=0;do{var p=s.nextSibling;if(r.removeChild(s),p&&p.nodeType===8)if(s=p.data,s==="/$"||s==="/&"){if(d===0){r.removeChild(p),qo(i);return}d--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")d++;else if(s==="html")dc(r.ownerDocument.documentElement);else if(s==="head"){s=r.ownerDocument.head,dc(s);for(var y=s.firstChild;y;){var j=y.nextSibling,R=y.nodeName;y[oa]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&y.rel.toLowerCase()==="stylesheet"||s.removeChild(y),y=j}}else s==="body"&&dc(r.ownerDocument.body);s=p}while(s);qo(i)}function m2(r,i){var s=r;r=0;do{var d=s.nextSibling;if(s.nodeType===1?i?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(i?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),d&&d.nodeType===8)if(s=d.data,s==="/$"){if(r===0)break;r--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||r++;s=d}while(s)}function nm(r){var i=r.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var s=i;switch(i=i.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":nm(s),Vl(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}r.removeChild(s)}}function U7(r,i,s,d){for(;r.nodeType===1;){var p=s;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!d&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(d){if(!r[oa])switch(i){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(y=r.getAttribute("rel"),y==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(y!==p.rel||r.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||r.getAttribute("title")!==(p.title==null?null:p.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(y=r.getAttribute("src"),(y!==(p.src==null?null:p.src)||r.getAttribute("type")!==(p.type==null?null:p.type)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&y&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(i==="input"&&r.type==="hidden"){var y=p.name==null?null:""+p.name;if(p.type==="hidden"&&r.getAttribute("name")===y)return r}else return r;if(r=ta(r.nextSibling),r===null)break}return null}function H7(r,i,s){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!s||(r=ta(r.nextSibling),r===null))return null;return r}function p2(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=ta(r.nextSibling),r===null))return null;return r}function rm(r){return r.data==="$?"||r.data==="$~"}function am(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function $7(r,i){var s=r.ownerDocument;if(r.data==="$~")r._reactRetry=i;else if(r.data!=="$?"||s.readyState!=="loading")i();else{var d=function(){i(),s.removeEventListener("DOMContentLoaded",d)};s.addEventListener("DOMContentLoaded",d),r._reactRetry=d}}function ta(r){for(;r!=null;r=r.nextSibling){var i=r.nodeType;if(i===1||i===3)break;if(i===8){if(i=r.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return r}var im=null;function g2(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var s=r.data;if(s==="/$"||s==="/&"){if(i===0)return ta(r.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}r=r.nextSibling}return null}function y2(r){r=r.previousSibling;for(var i=0;r;){if(r.nodeType===8){var s=r.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(i===0)return r;i--}else s!=="/$"&&s!=="/&"||i++}r=r.previousSibling}return null}function v2(r,i,s){switch(i=id(s),r){case"html":if(r=i.documentElement,!r)throw Error(a(452));return r;case"head":if(r=i.head,!r)throw Error(a(453));return r;case"body":if(r=i.body,!r)throw Error(a(454));return r;default:throw Error(a(451))}}function dc(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);Vl(r)}var na=new Map,x2=new Set;function ld(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var Ri=Y.d;Y.d={f:F7,r:P7,D:G7,C:V7,L:Y7,m:W7,X:X7,S:K7,M:Z7};function F7(){var r=Ri.f(),i=Z0();return r||i}function P7(r){var i=Na(r);i!==null&&i.tag===5&&i.type==="form"?_4(i):Ri.r(r)}var _o=typeof document>"u"?null:document;function b2(r,i,s){var d=_o;if(d&&typeof i=="string"&&i){var p=Sn(i);p='link[rel="'+r+'"][href="'+p+'"]',typeof s=="string"&&(p+='[crossorigin="'+s+'"]'),x2.has(p)||(x2.add(p),r={rel:r,crossOrigin:s,href:i},d.querySelector(p)===null&&(i=d.createElement("link"),Pn(i,"link",r),yn(i),d.head.appendChild(i)))}}function G7(r){Ri.D(r),b2("dns-prefetch",r,null)}function V7(r,i){Ri.C(r,i),b2("preconnect",r,i)}function Y7(r,i,s){Ri.L(r,i,s);var d=_o;if(d&&r&&i){var p='link[rel="preload"][as="'+Sn(i)+'"]';i==="image"&&s&&s.imageSrcSet?(p+='[imagesrcset="'+Sn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(p+='[imagesizes="'+Sn(s.imageSizes)+'"]')):p+='[href="'+Sn(r)+'"]';var y=p;switch(i){case"style":y=Lo(r);break;case"script":y=Bo(r)}na.has(y)||(r=v({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:r,as:i},s),na.set(y,r),d.querySelector(p)!==null||i==="style"&&d.querySelector(fc(y))||i==="script"&&d.querySelector(hc(y))||(i=d.createElement("link"),Pn(i,"link",r),yn(i),d.head.appendChild(i)))}}function W7(r,i){Ri.m(r,i);var s=_o;if(s&&r){var d=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+Sn(d)+'"][href="'+Sn(r)+'"]',y=p;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=Bo(r)}if(!na.has(y)&&(r=v({rel:"modulepreload",href:r},i),na.set(y,r),s.querySelector(p)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(hc(y)))return}d=s.createElement("link"),Pn(d,"link",r),yn(d),s.head.appendChild(d)}}}function K7(r,i,s){Ri.S(r,i,s);var d=_o;if(d&&r){var p=Pi(d).hoistableStyles,y=Lo(r);i=i||"default";var j=p.get(y);if(!j){var R={loading:0,preload:null};if(j=d.querySelector(fc(y)))R.loading=5;else{r=v({rel:"stylesheet",href:r,"data-precedence":i},s),(s=na.get(y))&&lm(r,s);var V=j=d.createElement("link");yn(V),Pn(V,"link",r),V._p=new Promise(function(se,ye){V.onload=se,V.onerror=ye}),V.addEventListener("load",function(){R.loading|=1}),V.addEventListener("error",function(){R.loading|=2}),R.loading|=4,sd(j,i,d)}j={type:"stylesheet",instance:j,count:1,state:R},p.set(y,j)}}}function X7(r,i){Ri.X(r,i);var s=_o;if(s&&r){var d=Pi(s).hoistableScripts,p=Bo(r),y=d.get(p);y||(y=s.querySelector(hc(p)),y||(r=v({src:r,async:!0},i),(i=na.get(p))&&sm(r,i),y=s.createElement("script"),yn(y),Pn(y,"link",r),s.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},d.set(p,y))}}function Z7(r,i){Ri.M(r,i);var s=_o;if(s&&r){var d=Pi(s).hoistableScripts,p=Bo(r),y=d.get(p);y||(y=s.querySelector(hc(p)),y||(r=v({src:r,async:!0,type:"module"},i),(i=na.get(p))&&sm(r,i),y=s.createElement("script"),yn(y),Pn(y,"link",r),s.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},d.set(p,y))}}function w2(r,i,s,d){var p=(p=re.current)?ld(p):null;if(!p)throw Error(a(446));switch(r){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(i=Lo(s.href),s=Pi(p).hoistableStyles,d=s.get(i),d||(d={type:"style",instance:null,count:0,state:null},s.set(i,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){r=Lo(s.href);var y=Pi(p).hoistableStyles,j=y.get(r);if(j||(p=p.ownerDocument||p,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(r,j),(y=p.querySelector(fc(r)))&&!y._p&&(j.instance=y,j.state.loading=5),na.has(r)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},na.set(r,s),y||Q7(p,r,s,j.state))),i&&d===null)throw Error(a(528,""));return j}if(i&&d!==null)throw Error(a(529,""));return null;case"script":return i=s.async,s=s.src,typeof s=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=Bo(s),s=Pi(p).hoistableScripts,d=s.get(i),d||(d={type:"script",instance:null,count:0,state:null},s.set(i,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function Lo(r){return'href="'+Sn(r)+'"'}function fc(r){return'link[rel="stylesheet"]['+r+"]"}function k2(r){return v({},r,{"data-precedence":r.precedence,precedence:null})}function Q7(r,i,s,d){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?d.loading=1:(i=r.createElement("link"),d.preload=i,i.addEventListener("load",function(){return d.loading|=1}),i.addEventListener("error",function(){return d.loading|=2}),Pn(i,"link",s),yn(i),r.head.appendChild(i))}function Bo(r){return'[src="'+Sn(r)+'"]'}function hc(r){return"script[async]"+r}function S2(r,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var d=r.querySelector('style[data-href~="'+Sn(s.href)+'"]');if(d)return i.instance=d,yn(d),d;var p=v({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return d=(r.ownerDocument||r).createElement("style"),yn(d),Pn(d,"style",p),sd(d,s.precedence,r),i.instance=d;case"stylesheet":p=Lo(s.href);var y=r.querySelector(fc(p));if(y)return i.state.loading|=4,i.instance=y,yn(y),y;d=k2(s),(p=na.get(p))&&lm(d,p),y=(r.ownerDocument||r).createElement("link"),yn(y);var j=y;return j._p=new Promise(function(R,V){j.onload=R,j.onerror=V}),Pn(y,"link",d),i.state.loading|=4,sd(y,s.precedence,r),i.instance=y;case"script":return y=Bo(s.src),(p=r.querySelector(hc(y)))?(i.instance=p,yn(p),p):(d=s,(p=na.get(y))&&(d=v({},s),sm(d,p)),r=r.ownerDocument||r,p=r.createElement("script"),yn(p),Pn(p,"link",d),r.head.appendChild(p),i.instance=p);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(d=i.instance,i.state.loading|=4,sd(d,s.precedence,r));return i.instance}function sd(r,i,s){for(var d=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=d.length?d[d.length-1]:null,y=p,j=0;j<d.length;j++){var R=d[j];if(R.dataset.precedence===i)y=R;else if(y!==p)break}y?y.parentNode.insertBefore(r,y.nextSibling):(i=s.nodeType===9?s.head:s,i.insertBefore(r,i.firstChild))}function lm(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function sm(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var od=null;function j2(r,i,s){if(od===null){var d=new Map,p=od=new Map;p.set(s,d)}else p=od,d=p.get(s),d||(d=new Map,p.set(s,d));if(d.has(r))return d;for(d.set(r,null),s=s.getElementsByTagName(r),p=0;p<s.length;p++){var y=s[p];if(!(y[oa]||y[rn]||r==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var j=y.getAttribute(i)||"";j=r+j;var R=d.get(j);R?R.push(y):d.set(j,[y])}}return d}function C2(r,i,s){r=r.ownerDocument||r,r.head.insertBefore(s,i==="title"?r.querySelector("head > title"):null)}function J7(r,i,s){if(s===1||i.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return r=i.disabled,typeof i.precedence=="string"&&r==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function T2(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function eb(r,i,s,d){if(s.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var p=Lo(d.href),y=i.querySelector(fc(p));if(y){i=y._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=ud.bind(r),i.then(r,r)),s.state.loading|=4,s.instance=y,yn(y);return}y=i.ownerDocument||i,d=k2(d),(p=na.get(p))&&lm(d,p),y=y.createElement("link"),yn(y);var j=y;j._p=new Promise(function(R,V){j.onload=R,j.onerror=V}),Pn(y,"link",d),s.instance=y}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(s,i),(i=s.state.preload)&&(s.state.loading&3)===0&&(r.count++,s=ud.bind(r),i.addEventListener("load",s),i.addEventListener("error",s))}}var om=0;function tb(r,i){return r.stylesheets&&r.count===0&&dd(r,r.stylesheets),0<r.count||0<r.imgCount?function(s){var d=setTimeout(function(){if(r.stylesheets&&dd(r,r.stylesheets),r.unsuspend){var y=r.unsuspend;r.unsuspend=null,y()}},6e4+i);0<r.imgBytes&&om===0&&(om=62500*I7());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&dd(r,r.stylesheets),r.unsuspend)){var y=r.unsuspend;r.unsuspend=null,y()}},(r.imgBytes>om?50:800)+i);return r.unsuspend=s,function(){r.unsuspend=null,clearTimeout(d),clearTimeout(p)}}:null}function ud(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)dd(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var cd=null;function dd(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,cd=new Map,i.forEach(nb,r),cd=null,ud.call(r))}function nb(r,i){if(!(i.state.loading&4)){var s=cd.get(r);if(s)var d=s.get(null);else{s=new Map,cd.set(r,s);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<p.length;y++){var j=p[y];(j.nodeName==="LINK"||j.getAttribute("media")!=="not all")&&(s.set(j.dataset.precedence,j),d=j)}d&&s.set(null,d)}p=i.instance,j=p.getAttribute("data-precedence"),y=s.get(j)||d,y===d&&s.set(null,p),s.set(j,p),this.count++,d=ud.bind(this),p.addEventListener("load",d),p.addEventListener("error",d),y?y.parentNode.insertBefore(p,y.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(p,r.firstChild)),i.state.loading|=4}}var mc={$$typeof:B,Provider:null,Consumer:null,_currentValue:ge,_currentValue2:ge,_threadCount:0};function rb(r,i,s,d,p,y,j,R,V){this.tag=1,this.containerInfo=r,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=ai(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ai(0),this.hiddenUpdates=ai(null),this.identifierPrefix=d,this.onUncaughtError=p,this.onCaughtError=y,this.onRecoverableError=j,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=V,this.incompleteTransitions=new Map}function A2(r,i,s,d,p,y,j,R,V,se,ye,xe){return r=new rb(r,i,s,j,V,se,ye,xe,R),i=1,y===!0&&(i|=24),y=tn(3,null,null,i),r.current=y,y.stateNode=r,i=ki(),i.refCount++,r.pooledCache=i,i.refCount++,y.memoizedState={element:d,isDehydrated:s,cache:i},qt(y),r}function E2(r){return r?(r=sl,r):sl}function N2(r,i,s,d,p,y){p=E2(p),d.context===null?d.context=p:d.pendingContext=p,d=ka(i),d.payload={element:s},y=y===void 0?null:y,y!==null&&(d.callback=y),s=fl(r,d,i),s!==null&&(wr(s,r,i),Vu(s,r,i))}function M2(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var s=r.retryLane;r.retryLane=s!==0&&s<i?s:i}}function um(r,i){M2(r,i),(r=r.alternate)&&M2(r,i)}function z2(r){if(r.tag===13||r.tag===31){var i=xi(r,67108864);i!==null&&wr(i,r,67108864),um(r,67108864)}}function D2(r){if(r.tag===13||r.tag===31){var i=qr();i=qs(i);var s=xi(r,i);s!==null&&wr(s,r,i),um(r,i)}}var fd=!0;function ab(r,i,s,d){var p=J.T;J.T=null;var y=Y.p;try{Y.p=2,cm(r,i,s,d)}finally{Y.p=y,J.T=p}}function ib(r,i,s,d){var p=J.T;J.T=null;var y=Y.p;try{Y.p=8,cm(r,i,s,d)}finally{Y.p=y,J.T=p}}function cm(r,i,s,d){if(fd){var p=dm(d);if(p===null)Xh(r,i,d,hd,s),O2(r,d);else if(sb(p,r,i,s,d))d.stopPropagation();else if(O2(r,d),i&4&&-1<lb.indexOf(r)){for(;p!==null;){var y=Na(p);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var j=zn(y.pendingLanes);if(j!==0){var R=y;for(R.pendingLanes|=2,R.entangledLanes|=2;j;){var V=1<<31-_t(j);R.entanglements[1]|=V,j&=~V}Wa(y),(Rt&6)===0&&(K0=ht()+500,oc(0))}}break;case 31:case 13:R=xi(y,2),R!==null&&wr(R,y,2),Z0(),um(y,2)}if(y=dm(d),y===null&&Xh(r,i,d,hd,s),y===p)break;p=y}p!==null&&d.stopPropagation()}else Xh(r,i,d,null,s)}}function dm(r){return r=Xl(r),fm(r)}var hd=null;function fm(r){if(hd=null,r=Ea(r),r!==null){var i=o(r);if(i===null)r=null;else{var s=i.tag;if(s===13){if(r=c(i),r!==null)return r;r=null}else if(s===31){if(r=f(i),r!==null)return r;r=null}else if(s===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null)}}return hd=r,null}function R2(r){switch(r){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(ur()){case me:return 2;case Se:return 8;case $e:case at:return 32;case kt:return 268435456;default:return 32}default:return 32}}var hm=!1,Sl=null,jl=null,Cl=null,pc=new Map,gc=new Map,Tl=[],lb="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 O2(r,i){switch(r){case"focusin":case"focusout":Sl=null;break;case"dragenter":case"dragleave":jl=null;break;case"mouseover":case"mouseout":Cl=null;break;case"pointerover":case"pointerout":pc.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":gc.delete(i.pointerId)}}function yc(r,i,s,d,p,y){return r===null||r.nativeEvent!==y?(r={blockedOn:i,domEventName:s,eventSystemFlags:d,nativeEvent:y,targetContainers:[p]},i!==null&&(i=Na(i),i!==null&&z2(i)),r):(r.eventSystemFlags|=d,i=r.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),r)}function sb(r,i,s,d,p){switch(i){case"focusin":return Sl=yc(Sl,r,i,s,d,p),!0;case"dragenter":return jl=yc(jl,r,i,s,d,p),!0;case"mouseover":return Cl=yc(Cl,r,i,s,d,p),!0;case"pointerover":var y=p.pointerId;return pc.set(y,yc(pc.get(y)||null,r,i,s,d,p)),!0;case"gotpointercapture":return y=p.pointerId,gc.set(y,yc(gc.get(y)||null,r,i,s,d,p)),!0}return!1}function I2(r){var i=Ea(r.target);if(i!==null){var s=o(i);if(s!==null){if(i=s.tag,i===13){if(i=c(s),i!==null){r.blockedOn=i,a0(r.priority,function(){D2(s)});return}}else if(i===31){if(i=f(s),i!==null){r.blockedOn=i,a0(r.priority,function(){D2(s)});return}}else if(i===3&&s.stateNode.current.memoizedState.isDehydrated){r.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}r.blockedOn=null}function md(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var s=dm(r.nativeEvent);if(s===null){s=r.nativeEvent;var d=new s.constructor(s.type,s);oi=d,s.target.dispatchEvent(d),oi=null}else return i=Na(s),i!==null&&z2(i),r.blockedOn=s,!1;i.shift()}return!0}function _2(r,i,s){md(r)&&s.delete(i)}function ob(){hm=!1,Sl!==null&&md(Sl)&&(Sl=null),jl!==null&&md(jl)&&(jl=null),Cl!==null&&md(Cl)&&(Cl=null),pc.forEach(_2),gc.forEach(_2)}function pd(r,i){r.blockedOn===i&&(r.blockedOn=null,hm||(hm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,ob)))}var gd=null;function L2(r){gd!==r&&(gd=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){gd===r&&(gd=null);for(var i=0;i<r.length;i+=3){var s=r[i],d=r[i+1],p=r[i+2];if(typeof d!="function"){if(fm(d||s)===null)continue;break}var y=Na(s);y!==null&&(r.splice(i,3),i-=3,dh(y,{pending:!0,data:p,method:s.method,action:d},d,p))}}))}function qo(r){function i(V){return pd(V,r)}Sl!==null&&pd(Sl,r),jl!==null&&pd(jl,r),Cl!==null&&pd(Cl,r),pc.forEach(i),gc.forEach(i);for(var s=0;s<Tl.length;s++){var d=Tl[s];d.blockedOn===r&&(d.blockedOn=null)}for(;0<Tl.length&&(s=Tl[0],s.blockedOn===null);)I2(s),s.blockedOn===null&&Tl.shift();if(s=(r.ownerDocument||r).$$reactFormReplay,s!=null)for(d=0;d<s.length;d+=3){var p=s[d],y=s[d+1],j=p[gn]||null;if(typeof y=="function")j||L2(s);else if(j){var R=null;if(y&&y.hasAttribute("formAction")){if(p=y,j=y[gn]||null)R=j.formAction;else if(fm(p)!==null)continue}else R=j.action;typeof R=="function"?s[d+1]=R:(s.splice(d,3),d-=3),L2(s)}}}function B2(){function r(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(j){return p=j})},focusReset:"manual",scroll:"manual"})}function i(){p!==null&&(p(),p=null),d||setTimeout(s,20)}function s(){if(!d&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,p=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(s,100),function(){d=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),p!==null&&(p(),p=null)}}}function mm(r){this._internalRoot=r}yd.prototype.render=mm.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,d=qr();N2(s,d,r,i,null,null)},yd.prototype.unmount=mm.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;N2(r.current,2,null,r,null,null),Z0(),i[Ar]=null}};function yd(r){this._internalRoot=r}yd.prototype.unstable_scheduleHydration=function(r){if(r){var i=Us();r={blockedOn:null,target:r,priority:i};for(var s=0;s<Tl.length&&i!==0&&i<Tl[s].priority;s++);Tl.splice(s,0,r),s===0&&I2(r)}};var q2=t.version;if(q2!=="19.2.7")throw Error(a(527,q2,"19.2.7"));Y.findDOMNode=function(r){var i=r._reactInternals;if(i===void 0)throw typeof r.render=="function"?Error(a(188)):(r=Object.keys(r).join(","),Error(a(268,r)));return r=m(i),r=r!==null?g(r):null,r=r===null?null:r.stateNode,r};var ub={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:J,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vd.isDisabled&&vd.supportsFiber)try{Bt=vd.inject(ub),dn=vd}catch{}}return xc.createRoot=function(r,i){if(!l(r))throw Error(a(299));var s=!1,d="",p=V4,y=Y4,j=W4;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onUncaughtError!==void 0&&(p=i.onUncaughtError),i.onCaughtError!==void 0&&(y=i.onCaughtError),i.onRecoverableError!==void 0&&(j=i.onRecoverableError)),i=A2(r,1,!1,null,null,s,d,null,p,y,j,B2),r[Ar]=i.current,Kh(r),new mm(i)},xc.hydrateRoot=function(r,i,s){if(!l(r))throw Error(a(299));var d=!1,p="",y=V4,j=Y4,R=W4,V=null;return s!=null&&(s.unstable_strictMode===!0&&(d=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onUncaughtError!==void 0&&(y=s.onUncaughtError),s.onCaughtError!==void 0&&(j=s.onCaughtError),s.onRecoverableError!==void 0&&(R=s.onRecoverableError),s.formState!==void 0&&(V=s.formState)),i=A2(r,1,!0,i,s??null,d,p,V,y,j,R,B2),i.context=E2(null),s=i.current,d=qr(),d=qs(d),p=ka(d),p.callback=null,fl(s,p,d),s=d,i.current.lanes=s,Fi(i,s),Wa(i),r[Ar]=i.current,Kh(r),new yd(i)},xc.version="19.2.7",xc}var X2;function Sb(){if(X2)return ym.exports;X2=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),ym.exports=kb(),ym.exports}var jb=Sb();function Z2(e){const t=[],n=String(e||"");let a=n.indexOf(","),l=0,o=!1;for(;!o;){a===-1&&(a=n.length,o=!0);const c=n.slice(l,a).trim();(c||!o)&&t.push(c),l=a+1,a=n.indexOf(",",l)}return t}function Cb(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Tb=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ab=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Eb={};function Q2(e,t){return(Eb.jsx?Ab:Tb).test(e)}const Nb=/[ \t\n\f\r]/g;function Mb(e){return typeof e=="object"?e.type==="text"?J2(e.value):!1:J2(e)}function J2(e){return e.replace(Nb,"")===""}class Xc{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}Xc.prototype.normal={};Xc.prototype.property={};Xc.prototype.space=void 0;function R5(e,t){const n={},a={};for(const l of e)Object.assign(n,l.property),Object.assign(a,l.normal);return new Xc(n,a,t)}function Fc(e){return e.toLowerCase()}class Cr{constructor(t,n){this.attribute=n,this.property=t}}Cr.prototype.attribute="";Cr.prototype.booleanish=!1;Cr.prototype.boolean=!1;Cr.prototype.commaOrSpaceSeparated=!1;Cr.prototype.commaSeparated=!1;Cr.prototype.defined=!1;Cr.prototype.mustUseProperty=!1;Cr.prototype.number=!1;Cr.prototype.overloadedBoolean=!1;Cr.prototype.property="";Cr.prototype.spaceSeparated=!1;Cr.prototype.space=void 0;let zb=0;const lt=Is(),An=Is(),vp=Is(),Ne=Is(),Xt=Is(),Ms=Is(),Ur=Is();function Is(){return 2**++zb}const xp=Object.freeze(Object.defineProperty({__proto__:null,boolean:lt,booleanish:An,commaOrSpaceSeparated:Ur,commaSeparated:Ms,number:Ne,overloadedBoolean:vp,spaceSeparated:Xt},Symbol.toStringTag,{value:"Module"})),wm=Object.keys(xp);class u1 extends Cr{constructor(t,n,a,l){let o=-1;if(super(t,n),ey(this,"space",l),typeof a=="number")for(;++o<wm.length;){const c=wm[o];ey(this,wm[o],(a&xp[c])===xp[c])}}}u1.prototype.defined=!0;function ey(e,t,n){n&&(e[t]=n)}function nu(e){const t={},n={};for(const[a,l]of Object.entries(e.properties)){const o=new u1(a,e.transform(e.attributes||{},a),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(o.mustUseProperty=!0),t[a]=o,n[Fc(a)]=a,n[Fc(o.attribute)]=a}return new Xc(t,n,e.space)}const O5=nu({properties:{ariaActiveDescendant:null,ariaAtomic:An,ariaAutoComplete:null,ariaBusy:An,ariaChecked:An,ariaColCount:Ne,ariaColIndex:Ne,ariaColSpan:Ne,ariaControls:Xt,ariaCurrent:null,ariaDescribedBy:Xt,ariaDetails:null,ariaDisabled:An,ariaDropEffect:Xt,ariaErrorMessage:null,ariaExpanded:An,ariaFlowTo:Xt,ariaGrabbed:An,ariaHasPopup:null,ariaHidden:An,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Xt,ariaLevel:Ne,ariaLive:null,ariaModal:An,ariaMultiLine:An,ariaMultiSelectable:An,ariaOrientation:null,ariaOwns:Xt,ariaPlaceholder:null,ariaPosInSet:Ne,ariaPressed:An,ariaReadOnly:An,ariaRelevant:null,ariaRequired:An,ariaRoleDescription:Xt,ariaRowCount:Ne,ariaRowIndex:Ne,ariaRowSpan:Ne,ariaSelected:An,ariaSetSize:Ne,ariaSort:null,ariaValueMax:Ne,ariaValueMin:Ne,ariaValueNow:Ne,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function I5(e,t){return t in e?e[t]:t}function _5(e,t){return I5(e,t.toLowerCase())}const Db=nu({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ms,acceptCharset:Xt,accessKey:Xt,action:null,allow:null,allowFullScreen:lt,allowPaymentRequest:lt,allowUserMedia:lt,alpha:lt,alt:null,as:null,async:lt,autoCapitalize:null,autoComplete:Xt,autoFocus:lt,autoPlay:lt,blocking:Xt,capture:null,charSet:null,checked:lt,cite:null,className:Xt,closedBy:null,colorSpace:null,cols:Ne,colSpan:Ne,command:null,commandFor:null,content:null,contentEditable:An,controls:lt,controlsList:Xt,coords:Ne|Ms,crossOrigin:null,data:null,dateTime:null,decoding:null,default:lt,defer:lt,dir:null,dirName:null,disabled:lt,download:vp,draggable:An,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:lt,formTarget:null,headers:Xt,height:Ne,hidden:vp,high:Ne,href:null,hrefLang:null,htmlFor:Xt,httpEquiv:Xt,id:null,imageSizes:null,imageSrcSet:null,inert:lt,inputMode:null,integrity:null,is:null,isMap:lt,itemId:null,itemProp:Xt,itemRef:Xt,itemScope:lt,itemType:Xt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:lt,low:Ne,manifest:null,max:null,maxLength:Ne,media:null,method:null,min:null,minLength:Ne,multiple:lt,muted:lt,name:null,nonce:null,noModule:lt,noValidate:lt,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:lt,optimum:Ne,pattern:null,ping:Xt,placeholder:null,playsInline:lt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:lt,referrerPolicy:null,rel:Xt,required:lt,reversed:lt,rows:Ne,rowSpan:Ne,sandbox:Xt,scope:null,scoped:lt,seamless:lt,selected:lt,shadowRootClonable:lt,shadowRootCustomElementRegistry:lt,shadowRootDelegatesFocus:lt,shadowRootMode:null,shadowRootSerializable:lt,shape:null,size:Ne,sizes:null,slot:null,span:Ne,spellCheck:An,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ne,step:null,style:null,tabIndex:Ne,target:null,title:null,translate:null,type:null,typeMustMatch:lt,useMap:null,value:An,width:Ne,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Xt,axis:null,background:null,bgColor:null,border:Ne,borderColor:null,bottomMargin:Ne,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:lt,declare:lt,event:null,face:null,frame:null,frameBorder:null,hSpace:Ne,leftMargin:Ne,link:null,longDesc:null,lowSrc:null,marginHeight:Ne,marginWidth:Ne,noResize:lt,noHref:lt,noShade:lt,noWrap:lt,object:null,profile:null,prompt:null,rev:null,rightMargin:Ne,rules:null,scheme:null,scrolling:An,standby:null,summary:null,text:null,topMargin:Ne,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ne,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:lt,disablePictureInPicture:lt,disableRemotePlayback:lt,exportParts:Ms,part:Xt,prefix:null,property:null,results:Ne,security:null,unselectable:null},space:"html",transform:_5}),Rb=nu({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",maskType:"mask-type",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:Ur,accentHeight:Ne,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ne,amplitude:Ne,arabicForm:null,ascent:Ne,attributeName:null,attributeType:null,azimuth:Ne,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ne,by:null,calcMode:null,capHeight:Ne,className:Xt,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:Ne,diffuseConstant:Ne,direction:null,display:null,dur:null,divisor:Ne,dominantBaseline:null,download:lt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ne,enableBackground:null,end:null,event:null,exponent:Ne,externalResourcesRequired:null,fill:null,fillOpacity:Ne,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:Ms,g2:Ms,glyphName:Ms,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ne,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ne,horizOriginX:Ne,horizOriginY:Ne,id:null,ideographic:Ne,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ne,k:Ne,k1:Ne,k2:Ne,k3:Ne,k4:Ne,kernelMatrix:Ur,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ne,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ne,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:Ne,overlineThickness:Ne,paintOrder:null,panose1:null,path:null,pathLength:Ne,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Xt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ne,pointsAtY:Ne,pointsAtZ:Ne,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ur,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ur,rev:Ur,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ur,requiredFeatures:Ur,requiredFonts:Ur,requiredFormats:Ur,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:Ne,specularExponent:Ne,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ne,strikethroughThickness:Ne,string:null,stroke:null,strokeDashArray:Ur,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ne,strokeOpacity:Ne,strokeWidth:null,style:null,surfaceScale:Ne,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ur,tabIndex:Ne,tableValues:null,target:null,targetX:Ne,targetY:Ne,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ur,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ne,underlineThickness:Ne,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ne,values:null,vAlphabetic:Ne,vMathematical:Ne,vectorEffect:null,vHanging:Ne,vIdeographic:Ne,version:null,vertAdvY:Ne,vertOriginX:Ne,vertOriginY:Ne,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ne,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:I5}),L5=nu({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()}}),B5=nu({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:_5}),q5=nu({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Ob={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"},Ib=/[A-Z]/g,ty=/-[a-z]/g,_b=/^data[-\w.:]+$/i;function U5(e,t){const n=Fc(t);let a=t,l=Cr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&_b.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(ty,Bb);a="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!ty.test(o)){let c=o.replace(Ib,Lb);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}l=u1}return new l(a,t)}function Lb(e){return"-"+e.toLowerCase()}function Bb(e){return e.charAt(1).toUpperCase()}const H5=R5([O5,Db,L5,B5,q5],"html"),mf=R5([O5,Rb,L5,B5,q5],"svg");function ny(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function qb(e){return e.join(" ").trim()}var Uo={},km,ry;function Ub(){if(ry)return km;ry=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
|
|
51
|
+
`,m="/",g="*",v="",k="comment",b="declaration";function T(q,z){if(typeof q!="string")throw new TypeError("First argument must be a string");if(!q)return[];z=z||{};var M=1,B=1;function U(be){var pe=be.match(t);pe&&(M+=pe.length);var J=be.lastIndexOf(h);B=~J?be.length-J:B+be.length}function ne(){var be={line:M,column:B};return function(pe){return pe.position=new L(be),Q(),pe}}function L(be){this.start=be,this.end={line:M,column:B},this.source=z.source}L.prototype.content=q;function K(be){var pe=new Error(z.source+":"+M+":"+B+": "+be);if(pe.reason=be,pe.filename=z.source,pe.line=M,pe.column=B,pe.source=q,!z.silent)throw pe}function ie(be){var pe=be.exec(q);if(pe){var J=pe[0];return U(J),q=q.slice(J.length),pe}}function Q(){ie(n)}function F(be){var pe;for(be=be||[];pe=he();)pe!==!1&&be.push(pe);return be}function he(){var be=ne();if(!(m!=q.charAt(0)||g!=q.charAt(1))){for(var pe=2;v!=q.charAt(pe)&&(g!=q.charAt(pe)||m!=q.charAt(pe+1));)++pe;if(pe+=2,v===q.charAt(pe-1))return K("End of comment missing");var J=q.slice(2,pe-2);return B+=2,U(J),q=q.slice(pe),B+=2,be({type:k,comment:J})}}function ce(){var be=ne(),pe=ie(a);if(pe){if(he(),!ie(l))return K("property missing ':'");var J=ie(o),Y=be({type:b,property:A(pe[0].replace(e,v)),value:J?A(J[0].replace(e,v)):v});return ie(c),Y}}function Ie(){var be=[];F(be);for(var pe;pe=ce();)pe!==!1&&(be.push(pe),F(be));return be}return Q(),Ie()}function A(q){return q?q.replace(f,v):v}return km=T,km}var ay;function Hb(){if(ay)return Uo;ay=1;var e=Uo&&Uo.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Uo,"__esModule",{value:!0}),Uo.default=n;const t=e(Ub());function n(a,l){let o=null;if(!a||typeof a!="string")return o;const c=(0,t.default)(a),f=typeof l=="function";return c.forEach(h=>{if(h.type!=="declaration")return;const{property:m,value:g}=h;f?l(m,g,h):g&&(o=o||{},o[m]=g)}),o}return Uo}var bc={},iy;function $b(){if(iy)return bc;iy=1,Object.defineProperty(bc,"__esModule",{value:!0}),bc.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,o=function(m){return!m||n.test(m)||e.test(m)},c=function(m,g){return g.toUpperCase()},f=function(m,g){return"".concat(g,"-")},h=function(m,g){return g===void 0&&(g={}),o(m)?m:(m=m.toLowerCase(),g.reactCompat?m=m.replace(l,f):m=m.replace(a,f),m.replace(t,c))};return bc.camelCase=h,bc}var wc,ly;function Fb(){if(ly)return wc;ly=1;var e=wc&&wc.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(Hb()),n=$b();function a(l,o){var c={};return!l||typeof l!="string"||(0,t.default)(l,function(f,h){f&&h&&(c[(0,n.camelCase)(f,o)]=h)}),c}return a.default=a,wc=a,wc}var Pb=Fb();const Gb=D5(Pb),$5=F5("end"),c1=F5("start");function F5(e){return t;function t(n){const a=n&&n.position&&n.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function Vb(e){const t=c1(e),n=$5(e);if(t&&n)return{start:t,end:n}}function Oc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?sy(e.position):"start"in e||"end"in e?sy(e):"line"in e||"column"in e?bp(e):""}function bp(e){return oy(e&&e.line)+":"+oy(e&&e.column)}function sy(e){return bp(e&&e.start)+"-"+bp(e&&e.end)}function oy(e){return e&&typeof e=="number"?e:1}class Jn extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let l="",o={},c=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?l=t:!o.cause&&t&&(c=!0,l=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof a=="string"){const h=a.indexOf(":");h===-1?o.ruleId=a:(o.source=a.slice(0,h),o.ruleId=a.slice(h+1))}if(!o.place&&o.ancestors&&o.ancestors){const h=o.ancestors[o.ancestors.length-1];h&&(o.place=h.position)}const f=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=f?f.line:void 0,this.name=Oc(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=c&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Jn.prototype.file="";Jn.prototype.name="";Jn.prototype.reason="";Jn.prototype.message="";Jn.prototype.stack="";Jn.prototype.column=void 0;Jn.prototype.line=void 0;Jn.prototype.ancestors=void 0;Jn.prototype.cause=void 0;Jn.prototype.fatal=void 0;Jn.prototype.place=void 0;Jn.prototype.ruleId=void 0;Jn.prototype.source=void 0;const d1={}.hasOwnProperty,Yb=new Map,Wb=/[A-Z]/g,Kb=new Set(["table","tbody","thead","tfoot","tr"]),Xb=new Set(["td","th"]),P5="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Zb(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let a;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=i8(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=a8(n,t.jsx,t.jsxs)}const l={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,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"?mf:H5,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=G5(l,e,void 0);return o&&typeof o!="string"?o:l.create(e,l.Fragment,{children:o||void 0},void 0)}function G5(e,t,n){if(t.type==="element")return Qb(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Jb(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return t8(e,t,n);if(t.type==="mdxjsEsm")return e8(e,t);if(t.type==="root")return n8(e,t,n);if(t.type==="text")return r8(e,t)}function Qb(e,t,n){const a=e.schema;let l=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(l=mf,e.schema=l),e.ancestors.push(t);const o=Y5(e,t.tagName,!1),c=l8(e,t);let f=h1(e,t);return Kb.has(t.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!Mb(h):!0})),V5(e,c,o,t),f1(c,f),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function Jb(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}Pc(e,t.position)}function e8(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Pc(e,t.position)}function t8(e,t,n){const a=e.schema;let l=a;t.name==="svg"&&a.space==="html"&&(l=mf,e.schema=l),e.ancestors.push(t);const o=t.name===null?e.Fragment:Y5(e,t.name,!0),c=s8(e,t),f=h1(e,t);return V5(e,c,o,t),f1(c,f),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function n8(e,t,n){const a={};return f1(a,h1(e,t)),e.create(t,e.Fragment,a,n)}function r8(e,t){return t.value}function V5(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function f1(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function a8(e,t,n){return a;function a(l,o,c,f){const m=Array.isArray(c.children)?n:t;return f?m(o,c,f):m(o,c)}}function i8(e,t){return n;function n(a,l,o,c){const f=Array.isArray(o.children),h=c1(a);return t(l,o,c,f,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function l8(e,t){const n={};let a,l;for(l in t.properties)if(l!=="children"&&d1.call(t.properties,l)){const o=o8(e,l,t.properties[l]);if(o){const[c,f]=o;e.tableCellAlignToStyle&&c==="align"&&typeof f=="string"&&Xb.has(t.tagName)?a=f:n[c]=f}}if(a){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function s8(e,t){const n={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const o=a.data.estree.body[0];o.type;const c=o.expression;c.type;const f=c.properties[0];f.type,Object.assign(n,e.evaluater.evaluateExpression(f.argument))}else Pc(e,t.position);else{const l=a.name;let o;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const f=a.value.data.estree.body[0];f.type,o=e.evaluater.evaluateExpression(f.expression)}else Pc(e,t.position);else o=a.value===null?!0:a.value;n[l]=o}return n}function h1(e,t){const n=[];let a=-1;const l=e.passKeys?new Map:Yb;for(;++a<t.children.length;){const o=t.children[a];let c;if(e.passKeys){const h=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(h){const m=l.get(h)||0;c=h+"-"+m,l.set(h,m+1)}}const f=G5(e,o,c);f!==void 0&&n.push(f)}return n}function o8(e,t,n){const a=U5(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?Cb(n):qb(n)),a.property==="style"){let l=typeof n=="object"?n:u8(e,String(n));return e.stylePropertyNameCase==="css"&&(l=c8(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&a.space?Ob[a.property]||a.property:a.attribute,n]}}function u8(e,t){try{return Gb(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,l=new Jn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=P5+"#cannot-parse-style-attribute",l}}function Y5(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const l=t.split(".");let o=-1,c;for(;++o<l.length;){const f=Q2(l[o])?{type:"Identifier",name:l[o]}:{type:"Literal",value:l[o]};c=c?{type:"MemberExpression",object:c,property:f,computed:!!(o&&f.type==="Literal"),optional:!1}:f}a=c}else a=Q2(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const l=a.value;return d1.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(a);Pc(e)}function Pc(e,t){const n=new Jn("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=P5+"#cannot-handle-mdx-estrees-without-createevaluater",n}function c8(e){const t={};let n;for(n in e)d1.call(e,n)&&(t[d8(n)]=e[n]);return t}function d8(e){let t=e.replace(Wb,f8);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function f8(e){return"-"+e.toLowerCase()}const Sm={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"]},h8={};function m1(e,t){const n=h8,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,l=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return W5(e,a,l)}function W5(e,t,n){if(m8(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 uy(e.children,t,n)}return Array.isArray(e)?uy(e,t,n):""}function uy(e,t,n){const a=[];let l=-1;for(;++l<e.length;)a[l]=W5(e[l],t,n);return a.join("")}function m8(e){return!!(e&&typeof e=="object")}const cy=document.createElement("i");function p1(e){const t="&"+e+";";cy.innerHTML=t;const n=cy.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Hr(e,t,n,a){const l=e.length;let o=0,c;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,n=n>0?n:0,a.length<1e4)c=Array.from(a),c.unshift(t,n),e.splice(...c);else for(n&&e.splice(t,n);o<a.length;)c=a.slice(o,o+1e4),c.unshift(t,0),e.splice(...c),o+=1e4,t+=1e4}function ra(e,t){return e.length>0?(Hr(e,e.length,0,t),e):t}const dy={}.hasOwnProperty;function K5(e){const t={};let n=-1;for(;++n<e.length;)p8(t,e[n]);return t}function p8(e,t){let n;for(n in t){const l=(dy.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let c;if(o)for(c in o){dy.call(l,c)||(l[c]=[]);const f=o[c];g8(l[c],Array.isArray(f)?f:f?[f]:[])}}}function g8(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);Hr(e,0,0,a)}function X5(e,t){const 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 Ca(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const lr=Ul(/[A-Za-z]/),Zn=Ul(/[\dA-Za-z]/),y8=Ul(/[#-'*+\--9=?A-Z^-~]/);function Qd(e){return e!==null&&(e<32||e===127)}const wp=Ul(/\d/),v8=Ul(/[\dA-Fa-f]/),x8=Ul(/[!-/:-@[-`{-~]/);function Ke(e){return e!==null&&e<-2}function Zt(e){return e!==null&&(e<0||e===32)}function bt(e){return e===-2||e===-1||e===32}const pf=Ul(new RegExp("\\p{P}|\\p{S}","u")),zs=Ul(/\s/);function Ul(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ru(e){const t=[];let n=-1,a=0,l=0;for(;++n<e.length;){const o=e.charCodeAt(n);let c="";if(o===37&&Zn(e.charCodeAt(n+1))&&Zn(e.charCodeAt(n+2)))l=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(c=String.fromCharCode(o));else if(o>55295&&o<57344){const f=e.charCodeAt(n+1);o<56320&&f>56319&&f<57344?(c=String.fromCharCode(o,f),l=1):c="�"}else c=String.fromCharCode(o);c&&(t.push(e.slice(a,n),encodeURIComponent(c)),a=n+l+1,c=""),l&&(n+=l,l=0)}return t.join("")+e.slice(a)}function gt(e,t,n,a){const l=a?a-1:Number.POSITIVE_INFINITY;let o=0;return c;function c(h){return bt(h)?(e.enter(n),f(h)):t(h)}function f(h){return bt(h)&&o++<l?(e.consume(h),f):(e.exit(n),t(h))}}const b8={tokenize:w8};function w8(e){const t=e.attempt(this.parser.constructs.contentInitial,a,l);let n;return t;function a(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),gt(e,t,"linePrefix")}function l(f){return e.enter("paragraph"),o(f)}function o(f){const h=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=h),n=h,c(f)}function c(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Ke(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),c)}}const k8={tokenize:S8},fy={tokenize:j8};function S8(e){const t=this,n=[];let a=0,l,o,c;return f;function f(B){if(a<n.length){const U=n[a];return t.containerState=U[1],e.attempt(U[0].continuation,h,m)(B)}return m(B)}function h(B){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&M();const U=t.events.length;let ne=U,L;for(;ne--;)if(t.events[ne][0]==="exit"&&t.events[ne][1].type==="chunkFlow"){L=t.events[ne][1].end;break}z(a);let K=U;for(;K<t.events.length;)t.events[K][1].end={...L},K++;return Hr(t.events,ne+1,0,t.events.slice(U)),t.events.length=K,m(B)}return f(B)}function m(B){if(a===n.length){if(!l)return k(B);if(l.currentConstruct&&l.currentConstruct.concrete)return T(B);t.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(fy,g,v)(B)}function g(B){return l&&M(),z(a),k(B)}function v(B){return t.parser.lazy[t.now().line]=a!==n.length,c=t.now().offset,T(B)}function k(B){return t.containerState={},e.attempt(fy,b,T)(B)}function b(B){return a++,n.push([t.currentConstruct,t.containerState]),k(B)}function T(B){if(B===null){l&&M(),z(0),e.consume(B);return}return l=l||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:o}),A(B)}function A(B){if(B===null){q(e.exit("chunkFlow"),!0),z(0),e.consume(B);return}return Ke(B)?(e.consume(B),q(e.exit("chunkFlow")),a=0,t.interrupt=void 0,f):(e.consume(B),A)}function q(B,U){const ne=t.sliceStream(B);if(U&&ne.push(null),B.previous=o,o&&(o.next=B),o=B,l.defineSkip(B.start),l.write(ne),t.parser.lazy[B.start.line]){let L=l.events.length;for(;L--;)if(l.events[L][1].start.offset<c&&(!l.events[L][1].end||l.events[L][1].end.offset>c))return;const K=t.events.length;let ie=K,Q,F;for(;ie--;)if(t.events[ie][0]==="exit"&&t.events[ie][1].type==="chunkFlow"){if(Q){F=t.events[ie][1].end;break}Q=!0}for(z(a),L=K;L<t.events.length;)t.events[L][1].end={...F},L++;Hr(t.events,ie+1,0,t.events.slice(K)),t.events.length=L}}function z(B){let U=n.length;for(;U-- >B;){const ne=n[U];t.containerState=ne[1],ne[0].exit.call(t,e)}n.length=B}function M(){l.write([null]),o=void 0,l=void 0,t.containerState._closeFlow=void 0}}function j8(e,t,n){return gt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Zo(e){if(e===null||Zt(e)||zs(e))return 1;if(pf(e))return 2}function gf(e,t,n){const a=[];let l=-1;for(;++l<e.length;){const o=e[l].resolveAll;o&&!a.includes(o)&&(t=o(t,n),a.push(o))}return t}const kp={name:"attention",resolveAll:C8,tokenize:T8};function C8(e,t){let n=-1,a,l,o,c,f,h,m,g;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(a=n;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&t.sliceSerialize(e[a][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[a][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;h=e[a][1].end.offset-e[a][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const v={...e[a][1].end},k={...e[n][1].start};hy(v,-h),hy(k,h),c={type:h>1?"strongSequence":"emphasisSequence",start:v,end:{...e[a][1].end}},f={type:h>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:k},o={type:h>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},l={type:h>1?"strong":"emphasis",start:{...c.start},end:{...f.end}},e[a][1].end={...c.start},e[n][1].start={...f.end},m=[],e[a][1].end.offset-e[a][1].start.offset&&(m=ra(m,[["enter",e[a][1],t],["exit",e[a][1],t]])),m=ra(m,[["enter",l,t],["enter",c,t],["exit",c,t],["enter",o,t]]),m=ra(m,gf(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),m=ra(m,[["exit",o,t],["enter",f,t],["exit",f,t],["exit",l,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,m=ra(m,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,Hr(e,a-1,n-a+3,m),n=a+m.length-g-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function T8(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,l=Zo(a);let o;return c;function c(h){return o=h,e.enter("attentionSequence"),f(h)}function f(h){if(h===o)return e.consume(h),f;const m=e.exit("attentionSequence"),g=Zo(h),v=!g||g===2&&l||n.includes(h),k=!l||l===2&&g||n.includes(a);return m._open=!!(o===42?v:v&&(l||!k)),m._close=!!(o===42?k:k&&(g||!v)),t(h)}}function hy(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const A8={name:"autolink",tokenize:E8};function E8(e,t,n){let a=0;return l;function l(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(b){return lr(b)?(e.consume(b),c):b===64?n(b):m(b)}function c(b){return b===43||b===45||b===46||Zn(b)?(a=1,f(b)):m(b)}function f(b){return b===58?(e.consume(b),a=0,h):(b===43||b===45||b===46||Zn(b))&&a++<32?(e.consume(b),f):(a=0,m(b))}function h(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||Qd(b)?n(b):(e.consume(b),h)}function m(b){return b===64?(e.consume(b),g):y8(b)?(e.consume(b),m):n(b)}function g(b){return Zn(b)?v(b):n(b)}function v(b){return b===46?(e.consume(b),a=0,g):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):k(b)}function k(b){if((b===45||Zn(b))&&a++<63){const T=b===45?k:v;return e.consume(b),T}return n(b)}}const Zc={partial:!0,tokenize:N8};function N8(e,t,n){return a;function a(o){return bt(o)?gt(e,l,"linePrefix")(o):l(o)}function l(o){return o===null||Ke(o)?t(o):n(o)}}const Z5={continuation:{tokenize:z8},exit:D8,name:"blockQuote",tokenize:M8};function M8(e,t,n){const a=this;return l;function l(c){if(c===62){const f=a.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),o}return n(c)}function o(c){return bt(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function z8(e,t,n){const a=this;return l;function l(c){return bt(c)?gt(e,o,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):o(c)}function o(c){return e.attempt(Z5,t,n)(c)}}function D8(e){e.exit("blockQuote")}const Q5={name:"characterEscape",tokenize:R8};function R8(e,t,n){return a;function a(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),l}function l(o){return x8(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const J5={name:"characterReference",tokenize:O8};function O8(e,t,n){const a=this;let l=0,o,c;return f;function f(v){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(v),e.exit("characterReferenceMarker"),h}function h(v){return v===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(v),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),o=31,c=Zn,g(v))}function m(v){return v===88||v===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(v),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,c=v8,g):(e.enter("characterReferenceValue"),o=7,c=wp,g(v))}function g(v){if(v===59&&l){const k=e.exit("characterReferenceValue");return c===Zn&&!p1(a.sliceSerialize(k))?n(v):(e.enter("characterReferenceMarker"),e.consume(v),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(v)&&l++<o?(e.consume(v),g):n(v)}}const my={partial:!0,tokenize:_8},py={concrete:!0,name:"codeFenced",tokenize:I8};function I8(e,t,n){const a=this,l={partial:!0,tokenize:ne};let o=0,c=0,f;return h;function h(L){return m(L)}function m(L){const K=a.events[a.events.length-1];return o=K&&K[1].type==="linePrefix"?K[2].sliceSerialize(K[1],!0).length:0,f=L,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(L)}function g(L){return L===f?(c++,e.consume(L),g):c<3?n(L):(e.exit("codeFencedFenceSequence"),bt(L)?gt(e,v,"whitespace")(L):v(L))}function v(L){return L===null||Ke(L)?(e.exit("codeFencedFence"),a.interrupt?t(L):e.check(my,A,U)(L)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),k(L))}function k(L){return L===null||Ke(L)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),v(L)):bt(L)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),gt(e,b,"whitespace")(L)):L===96&&L===f?n(L):(e.consume(L),k)}function b(L){return L===null||Ke(L)?v(L):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),T(L))}function T(L){return L===null||Ke(L)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),v(L)):L===96&&L===f?n(L):(e.consume(L),T)}function A(L){return e.attempt(l,U,q)(L)}function q(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),z}function z(L){return o>0&&bt(L)?gt(e,M,"linePrefix",o+1)(L):M(L)}function M(L){return L===null||Ke(L)?e.check(my,A,U)(L):(e.enter("codeFlowValue"),B(L))}function B(L){return L===null||Ke(L)?(e.exit("codeFlowValue"),M(L)):(e.consume(L),B)}function U(L){return e.exit("codeFenced"),t(L)}function ne(L,K,ie){let Q=0;return F;function F(pe){return L.enter("lineEnding"),L.consume(pe),L.exit("lineEnding"),he}function he(pe){return L.enter("codeFencedFence"),bt(pe)?gt(L,ce,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(pe):ce(pe)}function ce(pe){return pe===f?(L.enter("codeFencedFenceSequence"),Ie(pe)):ie(pe)}function Ie(pe){return pe===f?(Q++,L.consume(pe),Ie):Q>=c?(L.exit("codeFencedFenceSequence"),bt(pe)?gt(L,be,"whitespace")(pe):be(pe)):ie(pe)}function be(pe){return pe===null||Ke(pe)?(L.exit("codeFencedFence"),K(pe)):ie(pe)}}}function _8(e,t,n){const a=this;return l;function l(c){return c===null?n(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}const jm={name:"codeIndented",tokenize:B8},L8={partial:!0,tokenize:q8};function B8(e,t,n){const a=this;return l;function l(m){return e.enter("codeIndented"),gt(e,o,"linePrefix",5)(m)}function o(m){const g=a.events[a.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?c(m):n(m)}function c(m){return m===null?h(m):Ke(m)?e.attempt(L8,c,h)(m):(e.enter("codeFlowValue"),f(m))}function f(m){return m===null||Ke(m)?(e.exit("codeFlowValue"),c(m)):(e.consume(m),f)}function h(m){return e.exit("codeIndented"),t(m)}}function q8(e,t,n){const a=this;return l;function l(c){return a.parser.lazy[a.now().line]?n(c):Ke(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):gt(e,o,"linePrefix",5)(c)}function o(c){const f=a.events[a.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):Ke(c)?l(c):n(c)}}const U8={name:"codeText",previous:$8,resolve:H8,tokenize:F8};function H8(e){let t=e.length-4,n=3,a,l;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=n;++a<t;)if(e[a][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(a=n-1,t++;++a<=t;)l===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(l=a):(a===t||e[a][1].type==="lineEnding")&&(e[l][1].type="codeTextData",a!==l+2&&(e[l][1].end=e[a-1][1].end,e.splice(l+2,a-l-2),t-=a-l-2,a=l+2),l=void 0);return e}function $8(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function F8(e,t,n){let a=0,l,o;return c;function c(v){return e.enter("codeText"),e.enter("codeTextSequence"),f(v)}function f(v){return v===96?(e.consume(v),a++,f):(e.exit("codeTextSequence"),h(v))}function h(v){return v===null?n(v):v===32?(e.enter("space"),e.consume(v),e.exit("space"),h):v===96?(o=e.enter("codeTextSequence"),l=0,g(v)):Ke(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),h):(e.enter("codeTextData"),m(v))}function m(v){return v===null||v===32||v===96||Ke(v)?(e.exit("codeTextData"),h(v)):(e.consume(v),m)}function g(v){return v===96?(e.consume(v),l++,g):l===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(v)):(o.type="codeTextData",m(v))}}class P8{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const a=n??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(t,a):t>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(t,n,a){const l=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return a&&kc(this.left,a),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),kc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),kc(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);kc(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);kc(this.left,n.reverse())}}}function kc(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 ev(e){const t={};let n=-1,a,l,o,c,f,h,m;const g=new P8(e);for(;++n<g.length;){for(;n in t;)n=t[n];if(a=g.get(n),n&&a[1].type==="chunkFlow"&&g.get(n-1)[1].type==="listItemPrefix"&&(h=a[1]._tokenizer.events,o=0,o<h.length&&h[o][1].type==="lineEndingBlank"&&(o+=2),o<h.length&&h[o][1].type==="content"))for(;++o<h.length&&h[o][1].type!=="content";)h[o][1].type==="chunkText"&&(h[o][1]._isInFirstContentOfListItem=!0,o++);if(a[0]==="enter")a[1].contentType&&(Object.assign(t,G8(g,n)),n=t[n],m=!0);else if(a[1]._container){for(o=n,l=void 0;o--;)if(c=g.get(o),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(l&&(g.get(l)[1].type="lineEndingBlank"),c[1].type="lineEnding",l=o);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;l&&(a[1].end={...g.get(l)[1].start},f=g.slice(l,n),f.unshift(a),g.splice(l,n-l+1,f))}}return Hr(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!m}function G8(e,t){const n=e.get(t)[1],a=e.get(t)[2];let l=t-1;const o=[];let c=n._tokenizer;c||(c=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const f=c.events,h=[],m={};let g,v,k=-1,b=n,T=0,A=0;const q=[A];for(;b;){for(;e.get(++l)[1]!==b;);o.push(l),b._tokenizer||(g=a.sliceStream(b),b.next||g.push(null),v&&c.defineSkip(b.start),b._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(g),b._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),v=b,b=b.next}for(b=n;++k<f.length;)f[k][0]==="exit"&&f[k-1][0]==="enter"&&f[k][1].type===f[k-1][1].type&&f[k][1].start.line!==f[k][1].end.line&&(A=k+1,q.push(A),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(c.events=[],b?(b._tokenizer=void 0,b.previous=void 0):q.pop(),k=q.length;k--;){const z=f.slice(q[k],q[k+1]),M=o.pop();h.push([M,M+z.length-1]),e.splice(M,2,z)}for(h.reverse(),k=-1;++k<h.length;)m[T+h[k][0]]=T+h[k][1],T+=h[k][1]-h[k][0]-1;return m}const V8={resolve:W8,tokenize:K8},Y8={partial:!0,tokenize:X8};function W8(e){return ev(e),e}function K8(e,t){let n;return a;function a(f){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),l(f)}function l(f){return f===null?o(f):Ke(f)?e.check(Y8,c,o)(f):(e.consume(f),l)}function o(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function c(f){return e.consume(f),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,l}}function X8(e,t,n){const a=this;return l;function l(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),gt(e,o,"linePrefix")}function o(c){if(c===null||Ke(c))return n(c);const f=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):e.interrupt(a.parser.constructs.flow,n,t)(c)}}function tv(e,t,n,a,l,o,c,f,h){const m=h||Number.POSITIVE_INFINITY;let g=0;return v;function v(z){return z===60?(e.enter(a),e.enter(l),e.enter(o),e.consume(z),e.exit(o),k):z===null||z===32||z===41||Qd(z)?n(z):(e.enter(a),e.enter(c),e.enter(f),e.enter("chunkString",{contentType:"string"}),A(z))}function k(z){return z===62?(e.enter(o),e.consume(z),e.exit(o),e.exit(l),e.exit(a),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),b(z))}function b(z){return z===62?(e.exit("chunkString"),e.exit(f),k(z)):z===null||z===60||Ke(z)?n(z):(e.consume(z),z===92?T:b)}function T(z){return z===60||z===62||z===92?(e.consume(z),b):b(z)}function A(z){return!g&&(z===null||z===41||Zt(z))?(e.exit("chunkString"),e.exit(f),e.exit(c),e.exit(a),t(z)):g<m&&z===40?(e.consume(z),g++,A):z===41?(e.consume(z),g--,A):z===null||z===32||z===40||Qd(z)?n(z):(e.consume(z),z===92?q:A)}function q(z){return z===40||z===41||z===92?(e.consume(z),A):A(z)}}function nv(e,t,n,a,l,o){const c=this;let f=0,h;return m;function m(b){return e.enter(a),e.enter(l),e.consume(b),e.exit(l),e.enter(o),g}function g(b){return f>999||b===null||b===91||b===93&&!h||b===94&&!f&&"_hiddenFootnoteSupport"in c.parser.constructs?n(b):b===93?(e.exit(o),e.enter(l),e.consume(b),e.exit(l),e.exit(a),t):Ke(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),v(b))}function v(b){return b===null||b===91||b===93||Ke(b)||f++>999?(e.exit("chunkString"),g(b)):(e.consume(b),h||(h=!bt(b)),b===92?k:v)}function k(b){return b===91||b===92||b===93?(e.consume(b),f++,v):v(b)}}function rv(e,t,n,a,l,o){let c;return f;function f(k){return k===34||k===39||k===40?(e.enter(a),e.enter(l),e.consume(k),e.exit(l),c=k===40?41:k,h):n(k)}function h(k){return k===c?(e.enter(l),e.consume(k),e.exit(l),e.exit(a),t):(e.enter(o),m(k))}function m(k){return k===c?(e.exit(o),h(c)):k===null?n(k):Ke(k)?(e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),gt(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(k))}function g(k){return k===c||k===null||Ke(k)?(e.exit("chunkString"),m(k)):(e.consume(k),k===92?v:g)}function v(k){return k===c||k===92?(e.consume(k),g):g(k)}}function Ic(e,t){let n;return a;function a(l){return Ke(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,a):bt(l)?gt(e,a,n?"linePrefix":"lineSuffix")(l):t(l)}}const Z8={name:"definition",tokenize:J8},Q8={partial:!0,tokenize:e9};function J8(e,t,n){const a=this;let l;return o;function o(b){return e.enter("definition"),c(b)}function c(b){return nv.call(a,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function f(b){return l=Ca(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),h):n(b)}function h(b){return Zt(b)?Ic(e,m)(b):m(b)}function m(b){return tv(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function g(b){return e.attempt(Q8,v,v)(b)}function v(b){return bt(b)?gt(e,k,"whitespace")(b):k(b)}function k(b){return b===null||Ke(b)?(e.exit("definition"),a.parser.defined.push(l),t(b)):n(b)}}function e9(e,t,n){return a;function a(f){return Zt(f)?Ic(e,l)(f):n(f)}function l(f){return rv(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return bt(f)?gt(e,c,"whitespace")(f):c(f)}function c(f){return f===null||Ke(f)?t(f):n(f)}}const t9={name:"hardBreakEscape",tokenize:n9};function n9(e,t,n){return a;function a(o){return e.enter("hardBreakEscape"),e.consume(o),l}function l(o){return Ke(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const r9={name:"headingAtx",resolve:a9,tokenize:i9};function a9(e,t){let n=e.length-2,a=3,l,o;return e[a][1].type==="whitespace"&&(a+=2),n-2>a&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(a===n-1||n-4>a&&e[n-2][1].type==="whitespace")&&(n-=a+1===n?2:4),n>a&&(l={type:"atxHeadingText",start:e[a][1].start,end:e[n][1].end},o={type:"chunkText",start:e[a][1].start,end:e[n][1].end,contentType:"text"},Hr(e,a,n-a+1,[["enter",l,t],["enter",o,t],["exit",o,t],["exit",l,t]])),e}function i9(e,t,n){let a=0;return l;function l(g){return e.enter("atxHeading"),o(g)}function o(g){return e.enter("atxHeadingSequence"),c(g)}function c(g){return g===35&&a++<6?(e.consume(g),c):g===null||Zt(g)?(e.exit("atxHeadingSequence"),f(g)):n(g)}function f(g){return g===35?(e.enter("atxHeadingSequence"),h(g)):g===null||Ke(g)?(e.exit("atxHeading"),t(g)):bt(g)?gt(e,f,"whitespace")(g):(e.enter("atxHeadingText"),m(g))}function h(g){return g===35?(e.consume(g),h):(e.exit("atxHeadingSequence"),f(g))}function m(g){return g===null||g===35||Zt(g)?(e.exit("atxHeadingText"),f(g)):(e.consume(g),m)}}const l9=["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"],gy=["pre","script","style","textarea"],s9={concrete:!0,name:"htmlFlow",resolveTo:c9,tokenize:d9},o9={partial:!0,tokenize:h9},u9={partial:!0,tokenize:f9};function c9(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 d9(e,t,n){const a=this;let l,o,c,f,h;return m;function m(O){return g(O)}function g(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),v}function v(O){return O===33?(e.consume(O),k):O===47?(e.consume(O),o=!0,A):O===63?(e.consume(O),l=3,a.interrupt?t:H):lr(O)?(e.consume(O),c=String.fromCharCode(O),q):n(O)}function k(O){return O===45?(e.consume(O),l=2,b):O===91?(e.consume(O),l=5,f=0,T):lr(O)?(e.consume(O),l=4,a.interrupt?t:H):n(O)}function b(O){return O===45?(e.consume(O),a.interrupt?t:H):n(O)}function T(O){const ee="CDATA[";return O===ee.charCodeAt(f++)?(e.consume(O),f===ee.length?a.interrupt?t:ce:T):n(O)}function A(O){return lr(O)?(e.consume(O),c=String.fromCharCode(O),q):n(O)}function q(O){if(O===null||O===47||O===62||Zt(O)){const ee=O===47,Ae=c.toLowerCase();return!ee&&!o&&gy.includes(Ae)?(l=1,a.interrupt?t(O):ce(O)):l9.includes(c.toLowerCase())?(l=6,ee?(e.consume(O),z):a.interrupt?t(O):ce(O)):(l=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(O):o?M(O):B(O))}return O===45||Zn(O)?(e.consume(O),c+=String.fromCharCode(O),q):n(O)}function z(O){return O===62?(e.consume(O),a.interrupt?t:ce):n(O)}function M(O){return bt(O)?(e.consume(O),M):F(O)}function B(O){return O===47?(e.consume(O),F):O===58||O===95||lr(O)?(e.consume(O),U):bt(O)?(e.consume(O),B):F(O)}function U(O){return O===45||O===46||O===58||O===95||Zn(O)?(e.consume(O),U):ne(O)}function ne(O){return O===61?(e.consume(O),L):bt(O)?(e.consume(O),ne):B(O)}function L(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),h=O,K):bt(O)?(e.consume(O),L):ie(O)}function K(O){return O===h?(e.consume(O),h=null,Q):O===null||Ke(O)?n(O):(e.consume(O),K)}function ie(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||Zt(O)?ne(O):(e.consume(O),ie)}function Q(O){return O===47||O===62||bt(O)?B(O):n(O)}function F(O){return O===62?(e.consume(O),he):n(O)}function he(O){return O===null||Ke(O)?ce(O):bt(O)?(e.consume(O),he):n(O)}function ce(O){return O===45&&l===2?(e.consume(O),J):O===60&&l===1?(e.consume(O),Y):O===62&&l===4?(e.consume(O),_):O===63&&l===3?(e.consume(O),H):O===93&&l===5?(e.consume(O),Te):Ke(O)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(o9,te,Ie)(O)):O===null||Ke(O)?(e.exit("htmlFlowData"),Ie(O)):(e.consume(O),ce)}function Ie(O){return e.check(u9,be,te)(O)}function be(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),pe}function pe(O){return O===null||Ke(O)?Ie(O):(e.enter("htmlFlowData"),ce(O))}function J(O){return O===45?(e.consume(O),H):ce(O)}function Y(O){return O===47?(e.consume(O),c="",ge):ce(O)}function ge(O){if(O===62){const ee=c.toLowerCase();return gy.includes(ee)?(e.consume(O),_):ce(O)}return lr(O)&&c.length<8?(e.consume(O),c+=String.fromCharCode(O),ge):ce(O)}function Te(O){return O===93?(e.consume(O),H):ce(O)}function H(O){return O===62?(e.consume(O),_):O===45&&l===2?(e.consume(O),H):ce(O)}function _(O){return O===null||Ke(O)?(e.exit("htmlFlowData"),te(O)):(e.consume(O),_)}function te(O){return e.exit("htmlFlow"),t(O)}}function f9(e,t,n){const a=this;return l;function l(c){return Ke(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o):n(c)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}function h9(e,t,n){return a;function a(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(Zc,t,n)}}const m9={name:"htmlText",tokenize:p9};function p9(e,t,n){const a=this;let l,o,c;return f;function f(H){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(H),h}function h(H){return H===33?(e.consume(H),m):H===47?(e.consume(H),ne):H===63?(e.consume(H),B):lr(H)?(e.consume(H),ie):n(H)}function m(H){return H===45?(e.consume(H),g):H===91?(e.consume(H),o=0,T):lr(H)?(e.consume(H),M):n(H)}function g(H){return H===45?(e.consume(H),b):n(H)}function v(H){return H===null?n(H):H===45?(e.consume(H),k):Ke(H)?(c=v,Y(H)):(e.consume(H),v)}function k(H){return H===45?(e.consume(H),b):v(H)}function b(H){return H===62?J(H):H===45?k(H):v(H)}function T(H){const _="CDATA[";return H===_.charCodeAt(o++)?(e.consume(H),o===_.length?A:T):n(H)}function A(H){return H===null?n(H):H===93?(e.consume(H),q):Ke(H)?(c=A,Y(H)):(e.consume(H),A)}function q(H){return H===93?(e.consume(H),z):A(H)}function z(H){return H===62?J(H):H===93?(e.consume(H),z):A(H)}function M(H){return H===null||H===62?J(H):Ke(H)?(c=M,Y(H)):(e.consume(H),M)}function B(H){return H===null?n(H):H===63?(e.consume(H),U):Ke(H)?(c=B,Y(H)):(e.consume(H),B)}function U(H){return H===62?J(H):B(H)}function ne(H){return lr(H)?(e.consume(H),L):n(H)}function L(H){return H===45||Zn(H)?(e.consume(H),L):K(H)}function K(H){return Ke(H)?(c=K,Y(H)):bt(H)?(e.consume(H),K):J(H)}function ie(H){return H===45||Zn(H)?(e.consume(H),ie):H===47||H===62||Zt(H)?Q(H):n(H)}function Q(H){return H===47?(e.consume(H),J):H===58||H===95||lr(H)?(e.consume(H),F):Ke(H)?(c=Q,Y(H)):bt(H)?(e.consume(H),Q):J(H)}function F(H){return H===45||H===46||H===58||H===95||Zn(H)?(e.consume(H),F):he(H)}function he(H){return H===61?(e.consume(H),ce):Ke(H)?(c=he,Y(H)):bt(H)?(e.consume(H),he):Q(H)}function ce(H){return H===null||H===60||H===61||H===62||H===96?n(H):H===34||H===39?(e.consume(H),l=H,Ie):Ke(H)?(c=ce,Y(H)):bt(H)?(e.consume(H),ce):(e.consume(H),be)}function Ie(H){return H===l?(e.consume(H),l=void 0,pe):H===null?n(H):Ke(H)?(c=Ie,Y(H)):(e.consume(H),Ie)}function be(H){return H===null||H===34||H===39||H===60||H===61||H===96?n(H):H===47||H===62||Zt(H)?Q(H):(e.consume(H),be)}function pe(H){return H===47||H===62||Zt(H)?Q(H):n(H)}function J(H){return H===62?(e.consume(H),e.exit("htmlTextData"),e.exit("htmlText"),t):n(H)}function Y(H){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(H),e.exit("lineEnding"),ge}function ge(H){return bt(H)?gt(e,Te,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):Te(H)}function Te(H){return e.enter("htmlTextData"),c(H)}}const g1={name:"labelEnd",resolveAll:x9,resolveTo:b9,tokenize:w9},g9={tokenize:k9},y9={tokenize:S9},v9={tokenize:j9};function x9(e){let t=-1;const n=[];for(;++t<e.length;){const a=e[t][1];if(n.push(e[t]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const l=a.type==="labelImage"?4:2;a.type="data",t+=l}}return e.length!==n.length&&Hr(e,0,e.length,n),e}function b9(e,t){let n=e.length,a=0,l,o,c,f;for(;n--;)if(l=e[n][1],o){if(l.type==="link"||l.type==="labelLink"&&l._inactive)break;e[n][0]==="enter"&&l.type==="labelLink"&&(l._inactive=!0)}else if(c){if(e[n][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(o=n,l.type!=="labelLink")){a=2;break}}else l.type==="labelEnd"&&(c=n);const h={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[o][1].start},end:{...e[c][1].end}},g={type:"labelText",start:{...e[o+a+2][1].end},end:{...e[c-2][1].start}};return f=[["enter",h,t],["enter",m,t]],f=ra(f,e.slice(o+1,o+a+3)),f=ra(f,[["enter",g,t]]),f=ra(f,gf(t.parser.constructs.insideSpan.null,e.slice(o+a+4,c-3),t)),f=ra(f,[["exit",g,t],e[c-2],e[c-1],["exit",m,t]]),f=ra(f,e.slice(c+1)),f=ra(f,[["exit",h,t]]),Hr(e,o,e.length,f),e}function w9(e,t,n){const a=this;let l=a.events.length,o,c;for(;l--;)if((a.events[l][1].type==="labelImage"||a.events[l][1].type==="labelLink")&&!a.events[l][1]._balanced){o=a.events[l][1];break}return f;function f(k){return o?o._inactive?v(k):(c=a.parser.defined.includes(Ca(a.sliceSerialize({start:o.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(k),e.exit("labelMarker"),e.exit("labelEnd"),h):n(k)}function h(k){return k===40?e.attempt(g9,g,c?g:v)(k):k===91?e.attempt(y9,g,c?m:v)(k):c?g(k):v(k)}function m(k){return e.attempt(v9,g,v)(k)}function g(k){return t(k)}function v(k){return o._balanced=!0,n(k)}}function k9(e,t,n){return a;function a(v){return e.enter("resource"),e.enter("resourceMarker"),e.consume(v),e.exit("resourceMarker"),l}function l(v){return Zt(v)?Ic(e,o)(v):o(v)}function o(v){return v===41?g(v):tv(e,c,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(v)}function c(v){return Zt(v)?Ic(e,h)(v):g(v)}function f(v){return n(v)}function h(v){return v===34||v===39||v===40?rv(e,m,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(v):g(v)}function m(v){return Zt(v)?Ic(e,g)(v):g(v)}function g(v){return v===41?(e.enter("resourceMarker"),e.consume(v),e.exit("resourceMarker"),e.exit("resource"),t):n(v)}}function S9(e,t,n){const a=this;return l;function l(f){return nv.call(a,e,o,c,"reference","referenceMarker","referenceString")(f)}function o(f){return a.parser.defined.includes(Ca(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function c(f){return n(f)}}function j9(e,t,n){return a;function a(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),l}function l(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const C9={name:"labelStartImage",resolveAll:g1.resolveAll,tokenize:T9};function T9(e,t,n){const a=this;return l;function l(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),o}function o(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),c):n(f)}function c(f){return f===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):t(f)}}const A9={name:"labelStartLink",resolveAll:g1.resolveAll,tokenize:E9};function E9(e,t,n){const a=this;return l;function l(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),o}function o(c){return c===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(c):t(c)}}const Cm={name:"lineEnding",tokenize:N9};function N9(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),gt(e,t,"linePrefix")}}const Hd={name:"thematicBreak",tokenize:M9};function M9(e,t,n){let a=0,l;return o;function o(m){return e.enter("thematicBreak"),c(m)}function c(m){return l=m,f(m)}function f(m){return m===l?(e.enter("thematicBreakSequence"),h(m)):a>=3&&(m===null||Ke(m))?(e.exit("thematicBreak"),t(m)):n(m)}function h(m){return m===l?(e.consume(m),a++,h):(e.exit("thematicBreakSequence"),bt(m)?gt(e,f,"whitespace")(m):f(m))}}const kr={continuation:{tokenize:O9},exit:_9,name:"list",tokenize:R9},z9={partial:!0,tokenize:L9},D9={partial:!0,tokenize:I9};function R9(e,t,n){const a=this,l=a.events[a.events.length-1];let o=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,c=0;return f;function f(b){const T=a.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(T==="listUnordered"?!a.containerState.marker||b===a.containerState.marker:wp(b)){if(a.containerState.type||(a.containerState.type=T,e.enter(T,{_container:!0})),T==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(Hd,n,m)(b):m(b);if(!a.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(b)}return n(b)}function h(b){return wp(b)&&++c<10?(e.consume(b),h):(!a.interrupt||c<2)&&(a.containerState.marker?b===a.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),m(b)):n(b)}function m(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||b,e.check(Zc,a.interrupt?n:g,e.attempt(z9,k,v))}function g(b){return a.containerState.initialBlankLine=!0,o++,k(b)}function v(b){return bt(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),k):n(b)}function k(b){return a.containerState.size=o+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function O9(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(Zc,l,o);function l(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,gt(e,t,"listItemIndent",a.containerState.size+1)(f)}function o(f){return a.containerState.furtherBlankLines||!bt(f)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,c(f)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(D9,t,c)(f))}function c(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,gt(e,e.attempt(kr,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function I9(e,t,n){const a=this;return gt(e,l,"listItemIndent",a.containerState.size+1);function l(o){const c=a.events[a.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===a.containerState.size?t(o):n(o)}}function _9(e){e.exit(this.containerState.type)}function L9(e,t,n){const a=this;return gt(e,l,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(o){const c=a.events[a.events.length-1];return!bt(o)&&c&&c[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const yy={name:"setextUnderline",resolveTo:B9,tokenize:q9};function B9(e,t){let n=e.length,a,l,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){a=n;break}e[n][1].type==="paragraph"&&(l=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const c={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",o?(e.splice(l,0,["enter",c,t]),e.splice(o+1,0,["exit",e[a][1],t]),e[a][1].end={...e[o][1].end}):e[a][1]=c,e.push(["exit",c,t]),e}function q9(e,t,n){const a=this;let l;return o;function o(m){let g=a.events.length,v;for(;g--;)if(a.events[g][1].type!=="lineEnding"&&a.events[g][1].type!=="linePrefix"&&a.events[g][1].type!=="content"){v=a.events[g][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||v)?(e.enter("setextHeadingLine"),l=m,c(m)):n(m)}function c(m){return e.enter("setextHeadingLineSequence"),f(m)}function f(m){return m===l?(e.consume(m),f):(e.exit("setextHeadingLineSequence"),bt(m)?gt(e,h,"lineSuffix")(m):h(m))}function h(m){return m===null||Ke(m)?(e.exit("setextHeadingLine"),t(m)):n(m)}}const U9={tokenize:H9};function H9(e){const t=this,n=e.attempt(Zc,a,e.attempt(this.parser.constructs.flowInitial,l,gt(e,e.attempt(this.parser.constructs.flow,l,e.attempt(V8,l)),"linePrefix")));return n;function a(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function l(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const $9={resolveAll:iv()},F9=av("string"),P9=av("text");function av(e){return{resolveAll:iv(e==="text"?G9:void 0),tokenize:t};function t(n){const a=this,l=this.parser.constructs[e],o=n.attempt(l,c,f);return c;function c(g){return m(g)?o(g):f(g)}function f(g){if(g===null){n.consume(g);return}return n.enter("data"),n.consume(g),h}function h(g){return m(g)?(n.exit("data"),o(g)):(n.consume(g),h)}function m(g){if(g===null)return!0;const v=l[g];let k=-1;if(v)for(;++k<v.length;){const b=v[k];if(!b.previous||b.previous.call(a,a.previous))return!0}return!1}}}function iv(e){return t;function t(n,a){let l=-1,o;for(;++l<=n.length;)o===void 0?n[l]&&n[l][1].type==="data"&&(o=l,l++):(!n[l]||n[l][1].type!=="data")&&(l!==o+2&&(n[o][1].end=n[l-1][1].end,n.splice(o+2,l-o-2),l=o+2),o=void 0);return e?e(n,a):n}}function G9(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const a=e[n-1][1],l=t.sliceStream(a);let o=l.length,c=-1,f=0,h;for(;o--;){const m=l[o];if(typeof m=="string"){for(c=m.length;m.charCodeAt(c-1)===32;)f++,c--;if(c)break;c=-1}else if(m===-2)h=!0,f++;else if(m!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(f=0),f){const m={type:n===e.length||h||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?c:a.start._bufferIndex+c,_index:a.start._index+o,line:a.end.line,column:a.end.column-f,offset:a.end.offset-f},end:{...a.end}};a.end={...m.start},a.start.offset===a.end.offset?Object.assign(a,m):(e.splice(n,0,["enter",m,t],["exit",m,t]),n+=2)}n++}return e}const V9={42:kr,43:kr,45:kr,48:kr,49:kr,50:kr,51:kr,52:kr,53:kr,54:kr,55:kr,56:kr,57:kr,62:Z5},Y9={91:Z8},W9={[-2]:jm,[-1]:jm,32:jm},K9={35:r9,42:Hd,45:[yy,Hd],60:s9,61:yy,95:Hd,96:py,126:py},X9={38:J5,92:Q5},Z9={[-5]:Cm,[-4]:Cm,[-3]:Cm,33:C9,38:J5,42:kp,60:[A8,m9],91:A9,92:[t9,Q5],93:g1,95:kp,96:U8},Q9={null:[kp,$9]},J9={null:[42,95]},ew={null:[]},tw=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:J9,contentInitial:Y9,disable:ew,document:V9,flow:K9,flowInitial:W9,insideSpan:Q9,string:X9,text:Z9},Symbol.toStringTag,{value:"Module"}));function nw(e,t,n){let a={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const l={},o=[];let c=[],f=[];const h={attempt:K(ne),check:K(L),consume:M,enter:B,exit:U,interrupt:K(L,{interrupt:!0})},m={code:null,containerState:{},defineSkip:A,events:[],now:T,parser:e,previous:null,sliceSerialize:k,sliceStream:b,write:v};let g=t.tokenize.call(m,h);return t.resolveAll&&o.push(t),m;function v(he){return c=ra(c,he),q(),c[c.length-1]!==null?[]:(ie(t,0),m.events=gf(o,m.events,m),m.events)}function k(he,ce){return aw(b(he),ce)}function b(he){return rw(c,he)}function T(){const{_bufferIndex:he,_index:ce,line:Ie,column:be,offset:pe}=a;return{_bufferIndex:he,_index:ce,line:Ie,column:be,offset:pe}}function A(he){l[he.line]=he.column,F()}function q(){let he;for(;a._index<c.length;){const ce=c[a._index];if(typeof ce=="string")for(he=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===he&&a._bufferIndex<ce.length;)z(ce.charCodeAt(a._bufferIndex));else z(ce)}}function z(he){g=g(he)}function M(he){Ke(he)?(a.line++,a.column=1,a.offset+=he===-3?2:1,F()):he!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===c[a._index].length&&(a._bufferIndex=-1,a._index++)),m.previous=he}function B(he,ce){const Ie=ce||{};return Ie.type=he,Ie.start=T(),m.events.push(["enter",Ie,m]),f.push(Ie),Ie}function U(he){const ce=f.pop();return ce.end=T(),m.events.push(["exit",ce,m]),ce}function ne(he,ce){ie(he,ce.from)}function L(he,ce){ce.restore()}function K(he,ce){return Ie;function Ie(be,pe,J){let Y,ge,Te,H;return Array.isArray(be)?te(be):"tokenize"in be?te([be]):_(be);function _(re){return we;function we(_e){const He=_e!==null&&re[_e],wt=_e!==null&&re.null,et=[...Array.isArray(He)?He:He?[He]:[],...Array.isArray(wt)?wt:wt?[wt]:[]];return te(et)(_e)}}function te(re){return Y=re,ge=0,re.length===0?J:O(re[ge])}function O(re){return we;function we(_e){return H=Q(),Te=re,re.partial||(m.currentConstruct=re),re.name&&m.parser.constructs.disable.null.includes(re.name)?Ae():re.tokenize.call(ce?Object.assign(Object.create(m),ce):m,h,ee,Ae)(_e)}}function ee(re){return he(Te,H),pe}function Ae(re){return H.restore(),++ge<Y.length?O(Y[ge]):J}}}function ie(he,ce){he.resolveAll&&!o.includes(he)&&o.push(he),he.resolve&&Hr(m.events,ce,m.events.length-ce,he.resolve(m.events.slice(ce),m)),he.resolveTo&&(m.events=he.resolveTo(m.events,m))}function Q(){const he=T(),ce=m.previous,Ie=m.currentConstruct,be=m.events.length,pe=Array.from(f);return{from:be,restore:J};function J(){a=he,m.previous=ce,m.currentConstruct=Ie,m.events.length=be,f=pe,F()}}function F(){a.line in l&&a.column<2&&(a.column=l[a.line],a.offset+=l[a.line]-1)}}function rw(e,t){const n=t.start._index,a=t.start._bufferIndex,l=t.end._index,o=t.end._bufferIndex;let c;if(n===l)c=[e[n].slice(a,o)];else{if(c=e.slice(n,l),a>-1){const f=c[0];typeof f=="string"?c[0]=f.slice(a):c.shift()}o>0&&c.push(e[l].slice(0,o))}return c}function aw(e,t){let n=-1;const a=[];let l;for(;++n<e.length;){const o=e[n];let c;if(typeof o=="string")c=o;else switch(o){case-5:{c="\r";break}case-4:{c=`
|
|
52
52
|
`;break}case-3:{c=`\r
|
|
53
|
-
`;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&l)continue;c=" ";break}default:c=String.fromCharCode(o)}l=o===-2,a.push(c)}return a.join("")}function iw(e){const a={constructs:K5([tw,...(e||{}).extensions||[]]),content:l(b8),defined:[],document:l(k8),flow:l(U9),lazy:{},string:l(F9),text:l(P9)};return a;function l(o){return c;function c(f){return nw(a,o,f)}}}function lw(e){for(;!ev(e););return e}const vy=/[\0\t\n\r]/g;function sw(){let e=1,t="",n=!0,a;return l;function l(o,c,f){const h=[];let m,g,v,k,b;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(c||void 0).decode(o)),v=0,t="",n&&(o.charCodeAt(0)===65279&&v++,n=void 0);v<o.length;){if(vy.lastIndex=v,m=vy.exec(o),k=m&&m.index!==void 0?m.index:o.length,b=o.charCodeAt(k),!m){t=o.slice(v);break}if(b===10&&v===k&&a)h.push(-3),a=void 0;else switch(a&&(h.push(-5),a=void 0),v<k&&(h.push(o.slice(v,k)),e+=k-v),b){case 0:{h.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,h.push(-2);e++<g;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:a=!0,e=1}v=k+1}return f&&(a&&h.push(-5),t&&h.push(t),h.push(null)),h}}const ow=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function uw(e){return e.replace(ow,cw)}function cw(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const l=n.charCodeAt(1),o=l===120||l===88;return X5(n.slice(o?2:1),o?16:10)}return p1(n)||e}const lv={}.hasOwnProperty;function dw(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),fw(n)(lw(iw(n).document().write(sw()(e,t,!0))))}function fw(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Tt),autolinkProtocol:Q,autolinkEmail:Q,atxHeading:o(qe),blockQuote:o(wt),characterEscape:Q,characterReference:Q,codeFenced:o(et),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:o(et,c),codeText:o($t,c),codeTextData:Q,data:Q,codeFlowValue:Q,definition:o(tt),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:o(fe),hardBreakEscape:o(Je),hardBreakTrailing:o(Je),htmlFlow:o(Xe,c),htmlFlowData:Q,htmlText:o(Xe,c),htmlTextData:Q,image:o(Lt),label:c,link:o(Tt),listItem:o(At),listItemValue:k,listOrdered:o(mt,v),listUnordered:o(mt),paragraph:o(pn),reference:O,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:o(qe),strong:o(en),thematicBreak:o(ur)},exit:{atxHeading:h(),atxHeadingSequence:ae,autolink:h(),autolinkEmail:He,autolinkProtocol:_e,blockQuote:h(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:Ae,characterReferenceMarkerNumeric:Ae,characterReferenceValue:ne,characterReference:we,codeFenced:h(q),codeFencedFence:A,codeFencedFenceInfo:b,codeFencedFenceMeta:T,codeFlowValue:F,codeIndented:h(z),codeText:h(pe),codeTextData:F,data:F,definition:h(),definitionDestinationString:U,definitionLabelString:M,definitionTitleString:B,emphasis:h(),hardBreakEscape:h(ce),hardBreakTrailing:h(ce),htmlFlow:h(Ie),htmlFlowData:F,htmlText:h(be),htmlTextData:F,image:h(Y),label:Te,labelText:ge,lineEnding:he,link:h(J),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:ee,resourceDestinationString:H,resourceTitleString:_,resource:te,setextHeading:h(ie),setextHeadingLineSequence:K,setextHeadingText:L,strong:h(),thematicBreak:h()}};sv(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(me){let Se={type:"root",children:[]};const $e={stack:[Se],tokenStack:[],config:t,enter:f,exit:m,buffer:c,resume:g,data:n},at=[];let kt=-1;for(;++kt<me.length;)if(me[kt][1].type==="listOrdered"||me[kt][1].type==="listUnordered")if(me[kt][0]==="enter")at.push(kt);else{const wn=at.pop();kt=l(me,wn,kt)}for(kt=-1;++kt<me.length;){const wn=t[me[kt][0]];lv.call(wn,me[kt][1].type)&&wn[me[kt][1].type].call(Object.assign({sliceSerialize:me[kt][2].sliceSerialize},$e),me[kt][1])}if($e.tokenStack.length>0){const wn=$e.tokenStack[$e.tokenStack.length-1];(wn[1]||xy).call($e,void 0,wn[0])}for(Se.position={start:El(me.length>0?me[0][1].start:{line:1,column:1,offset:0}),end:El(me.length>0?me[me.length-2][1].end:{line:1,column:1,offset:0})},kt=-1;++kt<t.transforms.length;)Se=t.transforms[kt](Se)||Se;return Se}function l(me,Se,$e){let at=Se-1,kt=-1,wn=!1,Yr,Bt,dn,Gn;for(;++at<=$e;){const _t=me[at];switch(_t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{_t[0]==="enter"?kt++:kt--,Gn=void 0;break}case"lineEndingBlank":{_t[0]==="enter"&&(Yr&&!Gn&&!kt&&!dn&&(dn=at),Gn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Gn=void 0}if(!kt&&_t[0]==="enter"&&_t[1].type==="listItemPrefix"||kt===-1&&_t[0]==="exit"&&(_t[1].type==="listUnordered"||_t[1].type==="listOrdered")){if(Yr){let Ta=at;for(Bt=void 0;Ta--;){const Tr=me[Ta];if(Tr[1].type==="lineEnding"||Tr[1].type==="lineEndingBlank"){if(Tr[0]==="exit")continue;Bt&&(me[Bt][1].type="lineEndingBlank",wn=!0),Tr[1].type="lineEnding",Bt=Ta}else if(!(Tr[1].type==="linePrefix"||Tr[1].type==="blockQuotePrefix"||Tr[1].type==="blockQuotePrefixWhitespace"||Tr[1].type==="blockQuoteMarker"||Tr[1].type==="listItemIndent"))break}dn&&(!Bt||dn<Bt)&&(Yr._spread=!0),Yr.end=Object.assign({},Bt?me[Bt][1].start:_t[1].end),me.splice(Bt||at,0,["exit",Yr,_t[2]]),at++,$e++}if(_t[1].type==="listItemPrefix"){const Ta={type:"listItem",_spread:!1,start:Object.assign({},_t[1].start),end:void 0};Yr=Ta,me.splice(at,0,["enter",Ta,_t[2]]),at++,$e++,dn=void 0,Gn=!0}}}return me[Se][1]._spread=wn,$e}function o(me,Se){return $e;function $e(at){f.call(this,me(at),at),Se&&Se.call(this,at)}}function c(){this.stack.push({type:"fragment",children:[]})}function f(me,Se,$e){this.stack[this.stack.length-1].children.push(me),this.stack.push(me),this.tokenStack.push([Se,$e||void 0]),me.position={start:El(Se.start),end:void 0}}function h(me){return Se;function Se($e){me&&me.call(this,$e),m.call(this,$e)}}function m(me,Se){const $e=this.stack.pop(),at=this.tokenStack.pop();if(at)at[0].type!==me.type&&(Se?Se.call(this,me,at[0]):(at[1]||xy).call(this,me,at[0]));else throw new Error("Cannot close `"+me.type+"` ("+Oc({start:me.start,end:me.end})+"): it’s not open");$e.position.end=El(me.end)}function g(){return m1(this.stack.pop())}function v(){this.data.expectingFirstListItemValue=!0}function k(me){if(this.data.expectingFirstListItemValue){const Se=this.stack[this.stack.length-2];Se.start=Number.parseInt(this.sliceSerialize(me),10),this.data.expectingFirstListItemValue=void 0}}function b(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.lang=me}function T(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.meta=me}function A(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function q(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.value=me.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function z(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.value=me.replace(/(\r?\n|\r)$/g,"")}function M(me){const Se=this.resume(),$e=this.stack[this.stack.length-1];$e.label=Se,$e.identifier=Ca(this.sliceSerialize(me)).toLowerCase()}function B(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.title=me}function U(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.url=me}function ae(me){const Se=this.stack[this.stack.length-1];if(!Se.depth){const $e=this.sliceSerialize(me).length;Se.depth=$e}}function L(){this.data.setextHeadingSlurpLineEnding=!0}function K(me){const Se=this.stack[this.stack.length-1];Se.depth=this.sliceSerialize(me).codePointAt(0)===61?1:2}function ie(){this.data.setextHeadingSlurpLineEnding=void 0}function Q(me){const $e=this.stack[this.stack.length-1].children;let at=$e[$e.length-1];(!at||at.type!=="text")&&(at=ht(),at.position={start:El(me.start),end:void 0},$e.push(at)),this.stack.push(at)}function F(me){const Se=this.stack.pop();Se.value+=this.sliceSerialize(me),Se.position.end=El(me.end)}function he(me){const Se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const $e=Se.children[Se.children.length-1];$e.position.end=El(me.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Se.type)&&(Q.call(this,me),F.call(this,me))}function ce(){this.data.atHardBreak=!0}function Ie(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.value=me}function be(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.value=me}function pe(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.value=me}function J(){const me=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";me.type+="Reference",me.referenceType=Se,delete me.url,delete me.title}else delete me.identifier,delete me.label;this.data.referenceType=void 0}function Y(){const me=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";me.type+="Reference",me.referenceType=Se,delete me.url,delete me.title}else delete me.identifier,delete me.label;this.data.referenceType=void 0}function ge(me){const Se=this.sliceSerialize(me),$e=this.stack[this.stack.length-2];$e.label=uw(Se),$e.identifier=Ca(Se).toLowerCase()}function Te(){const me=this.stack[this.stack.length-1],Se=this.resume(),$e=this.stack[this.stack.length-1];if(this.data.inReference=!0,$e.type==="link"){const at=me.children;$e.children=at}else $e.alt=Se}function H(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.url=me}function _(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.title=me}function te(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function ee(me){const Se=this.resume(),$e=this.stack[this.stack.length-1];$e.label=Se,$e.identifier=Ca(this.sliceSerialize(me)).toLowerCase(),this.data.referenceType="full"}function Ae(me){this.data.characterReferenceType=me.type}function ne(me){const Se=this.sliceSerialize(me),$e=this.data.characterReferenceType;let at;$e?(at=X5(Se,$e==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):at=p1(Se);const kt=this.stack[this.stack.length-1];kt.value+=at}function we(me){const Se=this.stack.pop();Se.position.end=El(me.end)}function _e(me){F.call(this,me);const Se=this.stack[this.stack.length-1];Se.url=this.sliceSerialize(me)}function He(me){F.call(this,me);const Se=this.stack[this.stack.length-1];Se.url="mailto:"+this.sliceSerialize(me)}function wt(){return{type:"blockquote",children:[]}}function et(){return{type:"code",lang:null,meta:null,value:""}}function $t(){return{type:"inlineCode",value:""}}function tt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function fe(){return{type:"emphasis",children:[]}}function qe(){return{type:"heading",depth:0,children:[]}}function Je(){return{type:"break"}}function Xe(){return{type:"html",value:""}}function Lt(){return{type:"image",title:null,url:"",alt:null}}function Tt(){return{type:"link",title:null,url:"",children:[]}}function mt(me){return{type:"list",ordered:me.type==="listOrdered",start:null,spread:me._spread,children:[]}}function At(me){return{type:"listItem",spread:me._spread,checked:null,children:[]}}function pn(){return{type:"paragraph",children:[]}}function en(){return{type:"strong",children:[]}}function ht(){return{type:"text",value:""}}function ur(){return{type:"thematicBreak"}}}function El(e){return{line:e.line,column:e.column,offset:e.offset}}function sv(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?sv(e,a):hw(e,a)}}function hw(e,t){let n;for(n in t)if(lv.call(t,n))switch(n){case"canContainEols":{const a=t[n];a&&e[n].push(...a);break}case"transforms":{const a=t[n];a&&e[n].push(...a);break}case"enter":case"exit":{const a=t[n];a&&Object.assign(e[n],a);break}}}function xy(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Oc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Oc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Oc({start:t.start,end:t.end})+") is still open")}function mw(e){const t=this;t.parser=n;function n(a){return dw(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function pw(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function gw(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
53
|
+
`;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&l)continue;c=" ";break}default:c=String.fromCharCode(o)}l=o===-2,a.push(c)}return a.join("")}function iw(e){const a={constructs:K5([tw,...(e||{}).extensions||[]]),content:l(b8),defined:[],document:l(k8),flow:l(U9),lazy:{},string:l(F9),text:l(P9)};return a;function l(o){return c;function c(f){return nw(a,o,f)}}}function lw(e){for(;!ev(e););return e}const vy=/[\0\t\n\r]/g;function sw(){let e=1,t="",n=!0,a;return l;function l(o,c,f){const h=[];let m,g,v,k,b;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(c||void 0).decode(o)),v=0,t="",n&&(o.charCodeAt(0)===65279&&v++,n=void 0);v<o.length;){if(vy.lastIndex=v,m=vy.exec(o),k=m&&m.index!==void 0?m.index:o.length,b=o.charCodeAt(k),!m){t=o.slice(v);break}if(b===10&&v===k&&a)h.push(-3),a=void 0;else switch(a&&(h.push(-5),a=void 0),v<k&&(h.push(o.slice(v,k)),e+=k-v),b){case 0:{h.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,h.push(-2);e++<g;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:a=!0,e=1}v=k+1}return f&&(a&&h.push(-5),t&&h.push(t),h.push(null)),h}}const ow=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function uw(e){return e.replace(ow,cw)}function cw(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const l=n.charCodeAt(1),o=l===120||l===88;return X5(n.slice(o?2:1),o?16:10)}return p1(n)||e}const lv={}.hasOwnProperty;function dw(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),fw(n)(lw(iw(n).document().write(sw()(e,t,!0))))}function fw(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Tt),autolinkProtocol:Q,autolinkEmail:Q,atxHeading:o(qe),blockQuote:o(wt),characterEscape:Q,characterReference:Q,codeFenced:o(et),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:o(et,c),codeText:o($t,c),codeTextData:Q,data:Q,codeFlowValue:Q,definition:o(tt),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:o(fe),hardBreakEscape:o(Je),hardBreakTrailing:o(Je),htmlFlow:o(Xe,c),htmlFlowData:Q,htmlText:o(Xe,c),htmlTextData:Q,image:o(Lt),label:c,link:o(Tt),listItem:o(At),listItemValue:k,listOrdered:o(mt,v),listUnordered:o(mt),paragraph:o(pn),reference:O,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:o(qe),strong:o(en),thematicBreak:o(ur)},exit:{atxHeading:h(),atxHeadingSequence:ne,autolink:h(),autolinkEmail:He,autolinkProtocol:_e,blockQuote:h(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:Ae,characterReferenceMarkerNumeric:Ae,characterReferenceValue:re,characterReference:we,codeFenced:h(q),codeFencedFence:A,codeFencedFenceInfo:b,codeFencedFenceMeta:T,codeFlowValue:F,codeIndented:h(z),codeText:h(pe),codeTextData:F,data:F,definition:h(),definitionDestinationString:U,definitionLabelString:M,definitionTitleString:B,emphasis:h(),hardBreakEscape:h(ce),hardBreakTrailing:h(ce),htmlFlow:h(Ie),htmlFlowData:F,htmlText:h(be),htmlTextData:F,image:h(Y),label:Te,labelText:ge,lineEnding:he,link:h(J),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:ee,resourceDestinationString:H,resourceTitleString:_,resource:te,setextHeading:h(ie),setextHeadingLineSequence:K,setextHeadingText:L,strong:h(),thematicBreak:h()}};sv(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(me){let Se={type:"root",children:[]};const $e={stack:[Se],tokenStack:[],config:t,enter:f,exit:m,buffer:c,resume:g,data:n},at=[];let kt=-1;for(;++kt<me.length;)if(me[kt][1].type==="listOrdered"||me[kt][1].type==="listUnordered")if(me[kt][0]==="enter")at.push(kt);else{const wn=at.pop();kt=l(me,wn,kt)}for(kt=-1;++kt<me.length;){const wn=t[me[kt][0]];lv.call(wn,me[kt][1].type)&&wn[me[kt][1].type].call(Object.assign({sliceSerialize:me[kt][2].sliceSerialize},$e),me[kt][1])}if($e.tokenStack.length>0){const wn=$e.tokenStack[$e.tokenStack.length-1];(wn[1]||xy).call($e,void 0,wn[0])}for(Se.position={start:El(me.length>0?me[0][1].start:{line:1,column:1,offset:0}),end:El(me.length>0?me[me.length-2][1].end:{line:1,column:1,offset:0})},kt=-1;++kt<t.transforms.length;)Se=t.transforms[kt](Se)||Se;return Se}function l(me,Se,$e){let at=Se-1,kt=-1,wn=!1,Yr,Bt,dn,Gn;for(;++at<=$e;){const _t=me[at];switch(_t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{_t[0]==="enter"?kt++:kt--,Gn=void 0;break}case"lineEndingBlank":{_t[0]==="enter"&&(Yr&&!Gn&&!kt&&!dn&&(dn=at),Gn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Gn=void 0}if(!kt&&_t[0]==="enter"&&_t[1].type==="listItemPrefix"||kt===-1&&_t[0]==="exit"&&(_t[1].type==="listUnordered"||_t[1].type==="listOrdered")){if(Yr){let Ta=at;for(Bt=void 0;Ta--;){const Tr=me[Ta];if(Tr[1].type==="lineEnding"||Tr[1].type==="lineEndingBlank"){if(Tr[0]==="exit")continue;Bt&&(me[Bt][1].type="lineEndingBlank",wn=!0),Tr[1].type="lineEnding",Bt=Ta}else if(!(Tr[1].type==="linePrefix"||Tr[1].type==="blockQuotePrefix"||Tr[1].type==="blockQuotePrefixWhitespace"||Tr[1].type==="blockQuoteMarker"||Tr[1].type==="listItemIndent"))break}dn&&(!Bt||dn<Bt)&&(Yr._spread=!0),Yr.end=Object.assign({},Bt?me[Bt][1].start:_t[1].end),me.splice(Bt||at,0,["exit",Yr,_t[2]]),at++,$e++}if(_t[1].type==="listItemPrefix"){const Ta={type:"listItem",_spread:!1,start:Object.assign({},_t[1].start),end:void 0};Yr=Ta,me.splice(at,0,["enter",Ta,_t[2]]),at++,$e++,dn=void 0,Gn=!0}}}return me[Se][1]._spread=wn,$e}function o(me,Se){return $e;function $e(at){f.call(this,me(at),at),Se&&Se.call(this,at)}}function c(){this.stack.push({type:"fragment",children:[]})}function f(me,Se,$e){this.stack[this.stack.length-1].children.push(me),this.stack.push(me),this.tokenStack.push([Se,$e||void 0]),me.position={start:El(Se.start),end:void 0}}function h(me){return Se;function Se($e){me&&me.call(this,$e),m.call(this,$e)}}function m(me,Se){const $e=this.stack.pop(),at=this.tokenStack.pop();if(at)at[0].type!==me.type&&(Se?Se.call(this,me,at[0]):(at[1]||xy).call(this,me,at[0]));else throw new Error("Cannot close `"+me.type+"` ("+Oc({start:me.start,end:me.end})+"): it’s not open");$e.position.end=El(me.end)}function g(){return m1(this.stack.pop())}function v(){this.data.expectingFirstListItemValue=!0}function k(me){if(this.data.expectingFirstListItemValue){const Se=this.stack[this.stack.length-2];Se.start=Number.parseInt(this.sliceSerialize(me),10),this.data.expectingFirstListItemValue=void 0}}function b(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.lang=me}function T(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.meta=me}function A(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function q(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.value=me.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function z(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.value=me.replace(/(\r?\n|\r)$/g,"")}function M(me){const Se=this.resume(),$e=this.stack[this.stack.length-1];$e.label=Se,$e.identifier=Ca(this.sliceSerialize(me)).toLowerCase()}function B(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.title=me}function U(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.url=me}function ne(me){const Se=this.stack[this.stack.length-1];if(!Se.depth){const $e=this.sliceSerialize(me).length;Se.depth=$e}}function L(){this.data.setextHeadingSlurpLineEnding=!0}function K(me){const Se=this.stack[this.stack.length-1];Se.depth=this.sliceSerialize(me).codePointAt(0)===61?1:2}function ie(){this.data.setextHeadingSlurpLineEnding=void 0}function Q(me){const $e=this.stack[this.stack.length-1].children;let at=$e[$e.length-1];(!at||at.type!=="text")&&(at=ht(),at.position={start:El(me.start),end:void 0},$e.push(at)),this.stack.push(at)}function F(me){const Se=this.stack.pop();Se.value+=this.sliceSerialize(me),Se.position.end=El(me.end)}function he(me){const Se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const $e=Se.children[Se.children.length-1];$e.position.end=El(me.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Se.type)&&(Q.call(this,me),F.call(this,me))}function ce(){this.data.atHardBreak=!0}function Ie(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.value=me}function be(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.value=me}function pe(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.value=me}function J(){const me=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";me.type+="Reference",me.referenceType=Se,delete me.url,delete me.title}else delete me.identifier,delete me.label;this.data.referenceType=void 0}function Y(){const me=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";me.type+="Reference",me.referenceType=Se,delete me.url,delete me.title}else delete me.identifier,delete me.label;this.data.referenceType=void 0}function ge(me){const Se=this.sliceSerialize(me),$e=this.stack[this.stack.length-2];$e.label=uw(Se),$e.identifier=Ca(Se).toLowerCase()}function Te(){const me=this.stack[this.stack.length-1],Se=this.resume(),$e=this.stack[this.stack.length-1];if(this.data.inReference=!0,$e.type==="link"){const at=me.children;$e.children=at}else $e.alt=Se}function H(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.url=me}function _(){const me=this.resume(),Se=this.stack[this.stack.length-1];Se.title=me}function te(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function ee(me){const Se=this.resume(),$e=this.stack[this.stack.length-1];$e.label=Se,$e.identifier=Ca(this.sliceSerialize(me)).toLowerCase(),this.data.referenceType="full"}function Ae(me){this.data.characterReferenceType=me.type}function re(me){const Se=this.sliceSerialize(me),$e=this.data.characterReferenceType;let at;$e?(at=X5(Se,$e==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):at=p1(Se);const kt=this.stack[this.stack.length-1];kt.value+=at}function we(me){const Se=this.stack.pop();Se.position.end=El(me.end)}function _e(me){F.call(this,me);const Se=this.stack[this.stack.length-1];Se.url=this.sliceSerialize(me)}function He(me){F.call(this,me);const Se=this.stack[this.stack.length-1];Se.url="mailto:"+this.sliceSerialize(me)}function wt(){return{type:"blockquote",children:[]}}function et(){return{type:"code",lang:null,meta:null,value:""}}function $t(){return{type:"inlineCode",value:""}}function tt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function fe(){return{type:"emphasis",children:[]}}function qe(){return{type:"heading",depth:0,children:[]}}function Je(){return{type:"break"}}function Xe(){return{type:"html",value:""}}function Lt(){return{type:"image",title:null,url:"",alt:null}}function Tt(){return{type:"link",title:null,url:"",children:[]}}function mt(me){return{type:"list",ordered:me.type==="listOrdered",start:null,spread:me._spread,children:[]}}function At(me){return{type:"listItem",spread:me._spread,checked:null,children:[]}}function pn(){return{type:"paragraph",children:[]}}function en(){return{type:"strong",children:[]}}function ht(){return{type:"text",value:""}}function ur(){return{type:"thematicBreak"}}}function El(e){return{line:e.line,column:e.column,offset:e.offset}}function sv(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?sv(e,a):hw(e,a)}}function hw(e,t){let n;for(n in t)if(lv.call(t,n))switch(n){case"canContainEols":{const a=t[n];a&&e[n].push(...a);break}case"transforms":{const a=t[n];a&&e[n].push(...a);break}case"enter":case"exit":{const a=t[n];a&&Object.assign(e[n],a);break}}}function xy(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Oc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Oc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Oc({start:t.start,end:t.end})+") is still open")}function mw(e){const t=this;t.parser=n;function n(a){return dw(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function pw(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function gw(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
54
54
|
`}]}function yw(e,t){const n=t.value?t.value+`
|
|
55
55
|
`:"",a={},l=t.lang?t.lang.split(/\s+/):[];l.length>0&&(a.className=["language-"+l[0]]);let o={type:"element",tagName:"code",properties:a,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function vw(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function xw(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bw(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),l=ru(a.toLowerCase()),o=e.footnoteOrder.indexOf(a);let c,f=e.footnoteCounts.get(a);f===void 0?(f=0,e.footnoteOrder.push(a),c=e.footnoteOrder.length):c=o+1,f+=1,e.footnoteCounts.set(a,f);const h={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+l,id:n+"fnref-"+l+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(t,h);const m={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,m),e.applyData(t,m)}function ww(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kw(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function ov(e,t){const n=t.referenceType;let a="]";if(n==="collapsed"?a+="[]":n==="full"&&(a+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+a}];const l=e.all(t),o=l[0];o&&o.type==="text"?o.value="["+o.value:l.unshift({type:"text",value:"["});const c=l[l.length-1];return c&&c.type==="text"?c.value+=a:l.push({type:"text",value:a}),l}function Sw(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return ov(e,t);const l={src:ru(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(l.title=a.title);const o={type:"element",tagName:"img",properties:l,children:[]};return e.patch(t,o),e.applyData(t,o)}function jw(e,t){const n={src:ru(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,a),e.applyData(t,a)}function Cw(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const a={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,a),e.applyData(t,a)}function Tw(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return ov(e,t);const l={href:ru(a.url||"")};a.title!==null&&a.title!==void 0&&(l.title=a.title);const o={type:"element",tagName:"a",properties:l,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function Aw(e,t){const n={href:ru(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Ew(e,t,n){const a=e.all(t),l=n?Nw(n):uv(t),o={},c=[];if(typeof t.checked=="boolean"){const g=a[0];let v;g&&g.type==="element"&&g.tagName==="p"?v=g:(v={type:"element",tagName:"p",properties:{},children:[]},a.unshift(v)),v.children.length>0&&v.children.unshift({type:"text",value:" "}),v.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let f=-1;for(;++f<a.length;){const g=a[f];(l||f!==0||g.type!=="element"||g.tagName!=="p")&&c.push({type:"text",value:`
|
|
56
56
|
`}),g.type==="element"&&g.tagName==="p"&&!l?c.push(...g.children):c.push(g)}const h=a[a.length-1];h&&(l||h.type!=="element"||h.tagName!=="p")&&c.push({type:"text",value:`
|
|
@@ -60,8 +60,8 @@ Error generating stack: `+d.message+`
|
|
|
60
60
|
`});++a<e.length;)a&&n.push({type:"text",value:`
|
|
61
61
|
`}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
62
62
|
`}),n}function Ty(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Ay(e,t){const n=rk(e,t),a=n.one(e,void 0),l=Ww(n),o=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return l&&o.children.push({type:"text",value:`
|
|
63
|
-
`},l),o}function ok(e,t){return e&&"run"in e?async function(n,a){const l=Ay(n,{file:a,...t});await e.run(l,a)}:function(n,a){return Ay(n,{file:a,...e||t})}}function Ey(e){if(e)throw e}var Tm,Ny;function uk(){if(Ny)return Tm;Ny=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l=function(m){return typeof Array.isArray=="function"?Array.isArray(m):t.call(m)==="[object Array]"},o=function(m){if(!m||t.call(m)!=="[object Object]")return!1;var g=e.call(m,"constructor"),v=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!g&&!v)return!1;var k;for(k in m);return typeof k>"u"||e.call(m,k)},c=function(m,g){n&&g.name==="__proto__"?n(m,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):m[g.name]=g.newValue},f=function(m,g){if(g==="__proto__")if(e.call(m,g)){if(a)return a(m,g).value}else return;return m[g]};return Tm=function h(){var m,g,v,k,b,T,A=arguments[0],q=1,z=arguments.length,M=!1;for(typeof A=="boolean"&&(M=A,A=arguments[1]||{},q=2),(A==null||typeof A!="object"&&typeof A!="function")&&(A={});q<z;++q)if(m=arguments[q],m!=null)for(g in m)v=f(A,g),k=f(m,g),A!==k&&(M&&k&&(o(k)||(b=l(k)))?(b?(b=!1,T=v&&l(v)?v:[]):T=v&&o(v)?v:{},c(A,{name:g,newValue:h(M,T,k)})):typeof k<"u"&&c(A,{name:g,newValue:k}));return A},Tm}var ck=uk();const Am=D5(ck);function Cp(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function dk(){const e=[],t={run:n,use:a};return t;function n(...l){let o=-1;const c=l.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);f(null,...l);function f(h,...m){const g=e[++o];let v=-1;if(h){c(h);return}for(;++v<l.length;)(m[v]===null||m[v]===void 0)&&(m[v]=l[v]);l=m,g?fk(g,f)(...m):c(null,...m)}}function a(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),t}}function fk(e,t){let n;return a;function a(...c){const f=e.length>c.length;let h;f&&c.push(l);try{h=e.apply(this,c)}catch(m){const g=m;if(f&&n)throw g;return l(g)}f||(h&&h.then&&typeof h.then=="function"?h.then(o,l):h instanceof Error?l(h):o(h))}function l(c,...f){n||(n=!0,t(c,...f))}function o(c){l(null,c)}}const Ka={basename:hk,dirname:mk,extname:pk,join:gk,sep:"/"};function hk(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Jc(e);let n=0,a=-1,l=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else a<0&&(o=!0,a=l+1);return a<0?"":e.slice(n,a)}if(t===e)return"";let c=-1,f=t.length-1;for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else c<0&&(o=!0,c=l+1),f>-1&&(e.codePointAt(l)===t.codePointAt(f--)?f<0&&(a=l):(f=-1,a=c));return n===a?a=c:a<0&&(a=e.length),e.slice(n,a)}function mk(e){if(Jc(e),e.length===0)return".";let t=-1,n=e.length,a;for(;--n;)if(e.codePointAt(n)===47){if(a){t=n;break}}else a||(a=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function pk(e){Jc(e);let t=e.length,n=-1,a=0,l=-1,o=0,c;for(;t--;){const f=e.codePointAt(t);if(f===47){if(c){a=t+1;break}continue}n<0&&(c=!0,n=t+1),f===46?l<0?l=t:o!==1&&(o=1):l>-1&&(o=-1)}return l<0||n<0||o===0||o===1&&l===n-1&&l===a+1?"":e.slice(l,n)}function gk(...e){let t=-1,n;for(;++t<e.length;)Jc(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":yk(n)}function yk(e){Jc(e);const t=e.codePointAt(0)===47;let n=vk(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function vk(e,t){let n="",a=0,l=-1,o=0,c=-1,f,h;for(;++c<=e.length;){if(c<e.length)f=e.codePointAt(c);else{if(f===47)break;f=47}if(f===47){if(!(l===c-1||o===1))if(l!==c-1&&o===2){if(n.length<2||a!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(h=n.lastIndexOf("/"),h!==n.length-1){h<0?(n="",a=0):(n=n.slice(0,h),a=n.length-1-n.lastIndexOf("/")),l=c,o=0;continue}}else if(n.length>0){n="",a=0,l=c,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(l+1,c):n=e.slice(l+1,c),a=c-l-1;l=c,o=0}else f===46&&o>-1?o++:o=-1}return n}function Jc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const xk={cwd:bk};function bk(){return"/"}function Tp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function wk(e){if(typeof e=="string")e=new URL(e);else if(!Tp(e)){const t=new 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:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return kk(e)}function kk(e){if(e.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const a=t.codePointAt(n+2);if(a===70||a===102){const l=new TypeError("File URL path must not include encoded / characters");throw l.code="ERR_INVALID_FILE_URL_PATH",l}}return decodeURIComponent(t)}const Em=["history","path","basename","stem","extname","dirname"];class pv{constructor(t){let n;t?Tp(t)?n={path:t}:typeof t=="string"||Sk(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":xk.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<Em.length;){const o=Em[a];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let l;for(l in n)Em.includes(l)||(this[l]=n[l])}get basename(){return typeof this.path=="string"?Ka.basename(this.path):void 0}set basename(t){Mm(t,"basename"),Nm(t,"basename"),this.path=Ka.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ka.dirname(this.path):void 0}set dirname(t){My(this.basename,"dirname"),this.path=Ka.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ka.extname(this.path):void 0}set extname(t){if(Nm(t,"extname"),My(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ka.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Tp(t)&&(t=wk(t)),Mm(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ka.basename(this.path,this.extname):void 0}set stem(t){Mm(t,"stem"),Nm(t,"stem"),this.path=Ka.join(this.dirname||"",t+(this.extname||""))}fail(t,n,a){const l=this.message(t,n,a);throw l.fatal=!0,l}info(t,n,a){const l=this.message(t,n,a);return l.fatal=void 0,l}message(t,n,a){const l=new Jn(t,n,a);return this.path&&(l.name=this.path+":"+l.name,l.file=this.path),l.fatal=!1,this.messages.push(l),l}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Nm(e,t){if(e&&e.includes(Ka.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ka.sep+"`")}function Mm(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function My(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Sk(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const jk=(function(e){const a=this.constructor.prototype,l=a[e],o=function(){return l.apply(o,arguments)};return Object.setPrototypeOf(o,a),o}),Ck={}.hasOwnProperty;class S1 extends jk{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=dk()}copy(){const t=new S1;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(Am(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Rm("data",this.frozen),this.namespace[t]=n,this):Ck.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Rm("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const l=n.call(t,...a);typeof l=="function"&&this.transformers.use(l)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=kd(t),a=this.parser||this.Parser;return zm("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),zm("process",this.parser||this.Parser),Dm("process",this.compiler||this.Compiler),n?l(void 0,n):new Promise(l);function l(o,c){const f=kd(t),h=a.parse(f);a.run(h,f,function(g,v,k){if(g||!v||!k)return m(g);const b=v,T=a.stringify(b,k);Ek(T)?k.value=T:k.result=T,m(g,k)});function m(g,v){g||!v?c(g):o?o(v):n(void 0,v)}}}processSync(t){let n=!1,a;return this.freeze(),zm("processSync",this.parser||this.Parser),Dm("processSync",this.compiler||this.Compiler),this.process(t,l),Dy("processSync","process",n),a;function l(o,c){n=!0,Ey(o),a=c}}run(t,n,a){zy(t),this.freeze();const l=this.transformers;return!a&&typeof n=="function"&&(a=n,n=void 0),a?o(void 0,a):new Promise(o);function o(c,f){const h=kd(n);l.run(t,h,m);function m(g,v,k){const b=v||t;g?f(g):c?c(b):a(void 0,b,k)}}}runSync(t,n){let a=!1,l;return this.run(t,n,o),Dy("runSync","run",a),l;function o(c,f){Ey(c),l=f,a=!0}}stringify(t,n){this.freeze();const a=kd(n),l=this.compiler||this.Compiler;return Dm("stringify",l),zy(t),l(t,a)}use(t,...n){const a=this.attachers,l=this.namespace;if(Rm("use",this.frozen),t!=null)if(typeof t=="function")h(t,n);else if(typeof t=="object")Array.isArray(t)?f(t):c(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(m){if(typeof m=="function")h(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[g,...v]=m;h(g,v)}else c(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function c(m){if(!("plugins"in m)&&!("settings"in m))throw new 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");f(m.plugins),m.settings&&(l.settings=Am(!0,l.settings,m.settings))}function f(m){let g=-1;if(m!=null)if(Array.isArray(m))for(;++g<m.length;){const v=m[g];o(v)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function h(m,g){let v=-1,k=-1;for(;++v<a.length;)if(a[v][0]===m){k=v;break}if(k===-1)a.push([m,...g]);else if(g.length>0){let[b,...T]=g;const A=a[k][1];Cp(A)&&Cp(b)&&(b=Am(!0,A,b)),a[k]=[m,b,...T]}}}}const Tk=new S1().freeze();function zm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Dm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Rm(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function zy(e){if(!Cp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Dy(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function kd(e){return Ak(e)?e:new pv(e)}function Ak(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Ek(e){return typeof e=="string"||Nk(e)}function Nk(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Mk="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ry=[],Oy={allowDangerousHtml:!0},zk=/^(https?|ircs?|mailto|xmpp)$/i,Dk=[{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 Rk(e){const t=Ok(e),n=Ik(e);return _k(t.runSync(t.parse(n),n),e)}function Ok(e){const t=e.rehypePlugins||Ry,n=e.remarkPlugins||Ry,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Oy}:Oy;return Tk().use(mw).use(n).use(ok,a).use(t)}function Ik(e){const t=e.children||"",n=new pv;return typeof t=="string"&&(n.value=t),n}function _k(e,t){const n=t.allowedElements,a=t.allowElement,l=t.components,o=t.disallowedElements,c=t.skipHtml,f=t.unwrapDisallowed,h=t.urlTransform||gv;for(const g of Dk)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+Mk+g.id,void 0);return k1(e,m),Zb(e,{Fragment:u.Fragment,components:l,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function m(g,v,k){if(g.type==="raw"&&k&&typeof v=="number")return c?k.children.splice(v,1):k.children[v]={type:"text",value:g.value},v;if(g.type==="element"){let b;for(b in Sm)if(Object.hasOwn(Sm,b)&&Object.hasOwn(g.properties,b)){const T=g.properties[b],A=Sm[b];(A===null||A.includes(g.tagName))&&(g.properties[b]=h(String(T||""),b,g))}}if(g.type==="element"){let b=n?!n.includes(g.tagName):o?o.includes(g.tagName):!1;if(!b&&a&&typeof v=="number"&&(b=!a(g,v,k)),b&&k&&typeof v=="number")return f&&g.children?k.children.splice(v,1,...g.children):k.children.splice(v,1),v}}}function gv(e){const t=e.indexOf(":"),n=e.indexOf("?"),a=e.indexOf("#"),l=e.indexOf("/");return t===-1||l!==-1&&t>l||n!==-1&&t>n||a!==-1&&t>a||zk.test(e.slice(0,t))?e:""}function Iy(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let a=0,l=n.indexOf(t);for(;l!==-1;)a++,l=n.indexOf(t,l+t.length);return a}function Lk(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Bk(e,t,n){const l=Qc((n||{}).ignore||[]),o=qk(t);let c=-1;for(;++c<o.length;)w1(e,"text",f);function f(m,g){let v=-1,k;for(;++v<g.length;){const b=g[v],T=k?k.children:void 0;if(l(b,T?T.indexOf(b):void 0,k))return;k=b}if(k)return h(m,g)}function h(m,g){const v=g[g.length-1],k=o[c][0],b=o[c][1];let T=0;const q=v.children.indexOf(m);let z=!1,M=[];k.lastIndex=0;let B=k.exec(m.value);for(;B;){const U=B.index,ae={index:B.index,input:B.input,stack:[...g,m]};let L=b(...B,ae);if(typeof L=="string"&&(L=L.length>0?{type:"text",value:L}:void 0),L===!1?k.lastIndex=U+1:(T!==U&&M.push({type:"text",value:m.value.slice(T,U)}),Array.isArray(L)?M.push(...L):L&&M.push(L),T=U+B[0].length,z=!0),!k.global)break;B=k.exec(m.value)}return z?(T<m.value.length&&M.push({type:"text",value:m.value.slice(T)}),v.children.splice(q,1,...M)):M=[m],q+M.length}}function qk(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let a=-1;for(;++a<n.length;){const l=n[a];t.push([Uk(l[0]),Hk(l[1])])}return t}function Uk(e){return typeof e=="string"?new RegExp(Lk(e),"g"):e}function Hk(e){return typeof e=="function"?e:function(){return e}}const Om="phrasing",Im=["autolink","link","image","label"];function $k(){return{transforms:[Kk],enter:{literalAutolink:Pk,literalAutolinkEmail:_m,literalAutolinkHttp:_m,literalAutolinkWww:_m},exit:{literalAutolink:Wk,literalAutolinkEmail:Yk,literalAutolinkHttp:Gk,literalAutolinkWww:Vk}}}function Fk(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Om,notInConstruct:Im},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Om,notInConstruct:Im},{character:":",before:"[ps]",after:"\\/",inConstruct:Om,notInConstruct:Im}]}}function Pk(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function _m(e){this.config.enter.autolinkProtocol.call(this,e)}function Gk(e){this.config.exit.autolinkProtocol.call(this,e)}function Vk(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function Yk(e){this.config.exit.autolinkEmail.call(this,e)}function Wk(e){this.exit(e)}function Kk(e){Bk(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Xk],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Zk]],{ignore:["link","linkReference"]})}function Xk(e,t,n,a,l){let o="";if(!yv(l)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!Qk(n)))return!1;const c=Jk(n+a);if(!c[0])return!1;const f={type:"link",title:null,url:o+t+c[0],children:[{type:"text",value:t+c[0]}]};return c[1]?[f,{type:"text",value:c[1]}]:f}function Zk(e,t,n,a){return!yv(a,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Qk(e){const 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 Jk(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],a=n.indexOf(")");const l=Iy(e,"(");let o=Iy(e,")");for(;a!==-1&&l>o;)e+=n.slice(0,a+1),n=n.slice(a+1),a=n.indexOf(")"),o++;return[e,n]}function yv(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||zs(n)||pf(n))&&(!t||n!==47)}vv.peek=oS;function eS(){this.buffer()}function tS(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function nS(){this.buffer()}function rS(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function aS(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ca(this.sliceSerialize(e)).toLowerCase(),n.label=t}function iS(e){this.exit(e)}function lS(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ca(this.sliceSerialize(e)).toLowerCase(),n.label=t}function sS(e){this.exit(e)}function oS(){return"["}function vv(e,t,n,a){const l=n.createTracker(a);let o=l.move("[^");const c=n.enter("footnoteReference"),f=n.enter("reference");return o+=l.move(n.safe(n.associationId(e),{after:"]",before:o})),f(),c(),o+=l.move("]"),o}function uS(){return{enter:{gfmFootnoteCallString:eS,gfmFootnoteCall:tS,gfmFootnoteDefinitionLabelString:nS,gfmFootnoteDefinition:rS},exit:{gfmFootnoteCallString:aS,gfmFootnoteCall:iS,gfmFootnoteDefinitionLabelString:lS,gfmFootnoteDefinition:sS}}}function cS(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:vv},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(a,l,o,c){const f=o.createTracker(c);let h=f.move("[^");const m=o.enter("footnoteDefinition"),g=o.enter("label");return h+=f.move(o.safe(o.associationId(a),{before:h,after:"]"})),g(),h+=f.move("]:"),a.children&&a.children.length>0&&(f.shift(4),h+=f.move((t?`
|
|
64
|
-
`:" ")+o.indentLines(o.containerFlow(a,f.current()),t?xv:dS))),m(),h}}function dS(e,t,n){return t===0?e:xv(e,t,n)}function xv(e,t,n){return(n?"":" ")+e}const fS=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];bv.peek=yS;function hS(){return{canContainEols:["delete"],enter:{strikethrough:pS},exit:{strikethrough:gS}}}function mS(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:fS}],handlers:{delete:bv}}}function pS(e){this.enter({type:"delete",children:[]},e)}function gS(e){this.exit(e)}function bv(e,t,n,a){const l=n.createTracker(a),o=n.enter("strikethrough");let c=l.move("~~");return c+=n.containerPhrasing(e,{...l.current(),before:c,after:"~"}),c+=l.move("~~"),o(),c}function yS(){return"~"}function vS(e){return e.length}function xS(e,t){const n=t||{},a=(n.align||[]).concat(),l=n.stringLength||vS,o=[],c=[],f=[],h=[];let m=0,g=-1;for(;++g<e.length;){const A=[],q=[];let z=-1;for(e[g].length>m&&(m=e[g].length);++z<e[g].length;){const M=bS(e[g][z]);if(n.alignDelimiters!==!1){const B=l(M);q[z]=B,(h[z]===void 0||B>h[z])&&(h[z]=B)}A.push(M)}c[g]=A,f[g]=q}let v=-1;if(typeof a=="object"&&"length"in a)for(;++v<m;)o[v]=_y(a[v]);else{const A=_y(a);for(;++v<m;)o[v]=A}v=-1;const k=[],b=[];for(;++v<m;){const A=o[v];let q="",z="";A===99?(q=":",z=":"):A===108?q=":":A===114&&(z=":");let M=n.alignDelimiters===!1?1:Math.max(1,h[v]-q.length-z.length);const B=q+"-".repeat(M)+z;n.alignDelimiters!==!1&&(M=q.length+M+z.length,M>h[v]&&(h[v]=M),b[v]=M),k[v]=B}c.splice(1,0,k),f.splice(1,0,b),g=-1;const T=[];for(;++g<c.length;){const A=c[g],q=f[g];v=-1;const z=[];for(;++v<m;){const M=A[v]||"";let B="",U="";if(n.alignDelimiters!==!1){const
|
|
63
|
+
`},l),o}function ok(e,t){return e&&"run"in e?async function(n,a){const l=Ay(n,{file:a,...t});await e.run(l,a)}:function(n,a){return Ay(n,{file:a,...e||t})}}function Ey(e){if(e)throw e}var Tm,Ny;function uk(){if(Ny)return Tm;Ny=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l=function(m){return typeof Array.isArray=="function"?Array.isArray(m):t.call(m)==="[object Array]"},o=function(m){if(!m||t.call(m)!=="[object Object]")return!1;var g=e.call(m,"constructor"),v=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!g&&!v)return!1;var k;for(k in m);return typeof k>"u"||e.call(m,k)},c=function(m,g){n&&g.name==="__proto__"?n(m,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):m[g.name]=g.newValue},f=function(m,g){if(g==="__proto__")if(e.call(m,g)){if(a)return a(m,g).value}else return;return m[g]};return Tm=function h(){var m,g,v,k,b,T,A=arguments[0],q=1,z=arguments.length,M=!1;for(typeof A=="boolean"&&(M=A,A=arguments[1]||{},q=2),(A==null||typeof A!="object"&&typeof A!="function")&&(A={});q<z;++q)if(m=arguments[q],m!=null)for(g in m)v=f(A,g),k=f(m,g),A!==k&&(M&&k&&(o(k)||(b=l(k)))?(b?(b=!1,T=v&&l(v)?v:[]):T=v&&o(v)?v:{},c(A,{name:g,newValue:h(M,T,k)})):typeof k<"u"&&c(A,{name:g,newValue:k}));return A},Tm}var ck=uk();const Am=D5(ck);function Cp(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function dk(){const e=[],t={run:n,use:a};return t;function n(...l){let o=-1;const c=l.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);f(null,...l);function f(h,...m){const g=e[++o];let v=-1;if(h){c(h);return}for(;++v<l.length;)(m[v]===null||m[v]===void 0)&&(m[v]=l[v]);l=m,g?fk(g,f)(...m):c(null,...m)}}function a(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),t}}function fk(e,t){let n;return a;function a(...c){const f=e.length>c.length;let h;f&&c.push(l);try{h=e.apply(this,c)}catch(m){const g=m;if(f&&n)throw g;return l(g)}f||(h&&h.then&&typeof h.then=="function"?h.then(o,l):h instanceof Error?l(h):o(h))}function l(c,...f){n||(n=!0,t(c,...f))}function o(c){l(null,c)}}const Ka={basename:hk,dirname:mk,extname:pk,join:gk,sep:"/"};function hk(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Jc(e);let n=0,a=-1,l=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else a<0&&(o=!0,a=l+1);return a<0?"":e.slice(n,a)}if(t===e)return"";let c=-1,f=t.length-1;for(;l--;)if(e.codePointAt(l)===47){if(o){n=l+1;break}}else c<0&&(o=!0,c=l+1),f>-1&&(e.codePointAt(l)===t.codePointAt(f--)?f<0&&(a=l):(f=-1,a=c));return n===a?a=c:a<0&&(a=e.length),e.slice(n,a)}function mk(e){if(Jc(e),e.length===0)return".";let t=-1,n=e.length,a;for(;--n;)if(e.codePointAt(n)===47){if(a){t=n;break}}else a||(a=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function pk(e){Jc(e);let t=e.length,n=-1,a=0,l=-1,o=0,c;for(;t--;){const f=e.codePointAt(t);if(f===47){if(c){a=t+1;break}continue}n<0&&(c=!0,n=t+1),f===46?l<0?l=t:o!==1&&(o=1):l>-1&&(o=-1)}return l<0||n<0||o===0||o===1&&l===n-1&&l===a+1?"":e.slice(l,n)}function gk(...e){let t=-1,n;for(;++t<e.length;)Jc(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":yk(n)}function yk(e){Jc(e);const t=e.codePointAt(0)===47;let n=vk(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function vk(e,t){let n="",a=0,l=-1,o=0,c=-1,f,h;for(;++c<=e.length;){if(c<e.length)f=e.codePointAt(c);else{if(f===47)break;f=47}if(f===47){if(!(l===c-1||o===1))if(l!==c-1&&o===2){if(n.length<2||a!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(h=n.lastIndexOf("/"),h!==n.length-1){h<0?(n="",a=0):(n=n.slice(0,h),a=n.length-1-n.lastIndexOf("/")),l=c,o=0;continue}}else if(n.length>0){n="",a=0,l=c,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(l+1,c):n=e.slice(l+1,c),a=c-l-1;l=c,o=0}else f===46&&o>-1?o++:o=-1}return n}function Jc(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const xk={cwd:bk};function bk(){return"/"}function Tp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function wk(e){if(typeof e=="string")e=new URL(e);else if(!Tp(e)){const t=new 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:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return kk(e)}function kk(e){if(e.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const a=t.codePointAt(n+2);if(a===70||a===102){const l=new TypeError("File URL path must not include encoded / characters");throw l.code="ERR_INVALID_FILE_URL_PATH",l}}return decodeURIComponent(t)}const Em=["history","path","basename","stem","extname","dirname"];class pv{constructor(t){let n;t?Tp(t)?n={path:t}:typeof t=="string"||Sk(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":xk.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<Em.length;){const o=Em[a];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let l;for(l in n)Em.includes(l)||(this[l]=n[l])}get basename(){return typeof this.path=="string"?Ka.basename(this.path):void 0}set basename(t){Mm(t,"basename"),Nm(t,"basename"),this.path=Ka.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ka.dirname(this.path):void 0}set dirname(t){My(this.basename,"dirname"),this.path=Ka.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ka.extname(this.path):void 0}set extname(t){if(Nm(t,"extname"),My(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ka.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Tp(t)&&(t=wk(t)),Mm(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ka.basename(this.path,this.extname):void 0}set stem(t){Mm(t,"stem"),Nm(t,"stem"),this.path=Ka.join(this.dirname||"",t+(this.extname||""))}fail(t,n,a){const l=this.message(t,n,a);throw l.fatal=!0,l}info(t,n,a){const l=this.message(t,n,a);return l.fatal=void 0,l}message(t,n,a){const l=new Jn(t,n,a);return this.path&&(l.name=this.path+":"+l.name,l.file=this.path),l.fatal=!1,this.messages.push(l),l}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Nm(e,t){if(e&&e.includes(Ka.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ka.sep+"`")}function Mm(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function My(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Sk(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const jk=(function(e){const a=this.constructor.prototype,l=a[e],o=function(){return l.apply(o,arguments)};return Object.setPrototypeOf(o,a),o}),Ck={}.hasOwnProperty;class S1 extends jk{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=dk()}copy(){const t=new S1;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(Am(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Rm("data",this.frozen),this.namespace[t]=n,this):Ck.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Rm("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const l=n.call(t,...a);typeof l=="function"&&this.transformers.use(l)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=kd(t),a=this.parser||this.Parser;return zm("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),zm("process",this.parser||this.Parser),Dm("process",this.compiler||this.Compiler),n?l(void 0,n):new Promise(l);function l(o,c){const f=kd(t),h=a.parse(f);a.run(h,f,function(g,v,k){if(g||!v||!k)return m(g);const b=v,T=a.stringify(b,k);Ek(T)?k.value=T:k.result=T,m(g,k)});function m(g,v){g||!v?c(g):o?o(v):n(void 0,v)}}}processSync(t){let n=!1,a;return this.freeze(),zm("processSync",this.parser||this.Parser),Dm("processSync",this.compiler||this.Compiler),this.process(t,l),Dy("processSync","process",n),a;function l(o,c){n=!0,Ey(o),a=c}}run(t,n,a){zy(t),this.freeze();const l=this.transformers;return!a&&typeof n=="function"&&(a=n,n=void 0),a?o(void 0,a):new Promise(o);function o(c,f){const h=kd(n);l.run(t,h,m);function m(g,v,k){const b=v||t;g?f(g):c?c(b):a(void 0,b,k)}}}runSync(t,n){let a=!1,l;return this.run(t,n,o),Dy("runSync","run",a),l;function o(c,f){Ey(c),l=f,a=!0}}stringify(t,n){this.freeze();const a=kd(n),l=this.compiler||this.Compiler;return Dm("stringify",l),zy(t),l(t,a)}use(t,...n){const a=this.attachers,l=this.namespace;if(Rm("use",this.frozen),t!=null)if(typeof t=="function")h(t,n);else if(typeof t=="object")Array.isArray(t)?f(t):c(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(m){if(typeof m=="function")h(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[g,...v]=m;h(g,v)}else c(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function c(m){if(!("plugins"in m)&&!("settings"in m))throw new 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");f(m.plugins),m.settings&&(l.settings=Am(!0,l.settings,m.settings))}function f(m){let g=-1;if(m!=null)if(Array.isArray(m))for(;++g<m.length;){const v=m[g];o(v)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function h(m,g){let v=-1,k=-1;for(;++v<a.length;)if(a[v][0]===m){k=v;break}if(k===-1)a.push([m,...g]);else if(g.length>0){let[b,...T]=g;const A=a[k][1];Cp(A)&&Cp(b)&&(b=Am(!0,A,b)),a[k]=[m,b,...T]}}}}const Tk=new S1().freeze();function zm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Dm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Rm(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function zy(e){if(!Cp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Dy(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function kd(e){return Ak(e)?e:new pv(e)}function Ak(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Ek(e){return typeof e=="string"||Nk(e)}function Nk(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Mk="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ry=[],Oy={allowDangerousHtml:!0},zk=/^(https?|ircs?|mailto|xmpp)$/i,Dk=[{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 Rk(e){const t=Ok(e),n=Ik(e);return _k(t.runSync(t.parse(n),n),e)}function Ok(e){const t=e.rehypePlugins||Ry,n=e.remarkPlugins||Ry,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Oy}:Oy;return Tk().use(mw).use(n).use(ok,a).use(t)}function Ik(e){const t=e.children||"",n=new pv;return typeof t=="string"&&(n.value=t),n}function _k(e,t){const n=t.allowedElements,a=t.allowElement,l=t.components,o=t.disallowedElements,c=t.skipHtml,f=t.unwrapDisallowed,h=t.urlTransform||gv;for(const g of Dk)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+Mk+g.id,void 0);return k1(e,m),Zb(e,{Fragment:u.Fragment,components:l,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function m(g,v,k){if(g.type==="raw"&&k&&typeof v=="number")return c?k.children.splice(v,1):k.children[v]={type:"text",value:g.value},v;if(g.type==="element"){let b;for(b in Sm)if(Object.hasOwn(Sm,b)&&Object.hasOwn(g.properties,b)){const T=g.properties[b],A=Sm[b];(A===null||A.includes(g.tagName))&&(g.properties[b]=h(String(T||""),b,g))}}if(g.type==="element"){let b=n?!n.includes(g.tagName):o?o.includes(g.tagName):!1;if(!b&&a&&typeof v=="number"&&(b=!a(g,v,k)),b&&k&&typeof v=="number")return f&&g.children?k.children.splice(v,1,...g.children):k.children.splice(v,1),v}}}function gv(e){const t=e.indexOf(":"),n=e.indexOf("?"),a=e.indexOf("#"),l=e.indexOf("/");return t===-1||l!==-1&&t>l||n!==-1&&t>n||a!==-1&&t>a||zk.test(e.slice(0,t))?e:""}function Iy(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let a=0,l=n.indexOf(t);for(;l!==-1;)a++,l=n.indexOf(t,l+t.length);return a}function Lk(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Bk(e,t,n){const l=Qc((n||{}).ignore||[]),o=qk(t);let c=-1;for(;++c<o.length;)w1(e,"text",f);function f(m,g){let v=-1,k;for(;++v<g.length;){const b=g[v],T=k?k.children:void 0;if(l(b,T?T.indexOf(b):void 0,k))return;k=b}if(k)return h(m,g)}function h(m,g){const v=g[g.length-1],k=o[c][0],b=o[c][1];let T=0;const q=v.children.indexOf(m);let z=!1,M=[];k.lastIndex=0;let B=k.exec(m.value);for(;B;){const U=B.index,ne={index:B.index,input:B.input,stack:[...g,m]};let L=b(...B,ne);if(typeof L=="string"&&(L=L.length>0?{type:"text",value:L}:void 0),L===!1?k.lastIndex=U+1:(T!==U&&M.push({type:"text",value:m.value.slice(T,U)}),Array.isArray(L)?M.push(...L):L&&M.push(L),T=U+B[0].length,z=!0),!k.global)break;B=k.exec(m.value)}return z?(T<m.value.length&&M.push({type:"text",value:m.value.slice(T)}),v.children.splice(q,1,...M)):M=[m],q+M.length}}function qk(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let a=-1;for(;++a<n.length;){const l=n[a];t.push([Uk(l[0]),Hk(l[1])])}return t}function Uk(e){return typeof e=="string"?new RegExp(Lk(e),"g"):e}function Hk(e){return typeof e=="function"?e:function(){return e}}const Om="phrasing",Im=["autolink","link","image","label"];function $k(){return{transforms:[Kk],enter:{literalAutolink:Pk,literalAutolinkEmail:_m,literalAutolinkHttp:_m,literalAutolinkWww:_m},exit:{literalAutolink:Wk,literalAutolinkEmail:Yk,literalAutolinkHttp:Gk,literalAutolinkWww:Vk}}}function Fk(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Om,notInConstruct:Im},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Om,notInConstruct:Im},{character:":",before:"[ps]",after:"\\/",inConstruct:Om,notInConstruct:Im}]}}function Pk(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function _m(e){this.config.enter.autolinkProtocol.call(this,e)}function Gk(e){this.config.exit.autolinkProtocol.call(this,e)}function Vk(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function Yk(e){this.config.exit.autolinkEmail.call(this,e)}function Wk(e){this.exit(e)}function Kk(e){Bk(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Xk],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Zk]],{ignore:["link","linkReference"]})}function Xk(e,t,n,a,l){let o="";if(!yv(l)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!Qk(n)))return!1;const c=Jk(n+a);if(!c[0])return!1;const f={type:"link",title:null,url:o+t+c[0],children:[{type:"text",value:t+c[0]}]};return c[1]?[f,{type:"text",value:c[1]}]:f}function Zk(e,t,n,a){return!yv(a,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Qk(e){const 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 Jk(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],a=n.indexOf(")");const l=Iy(e,"(");let o=Iy(e,")");for(;a!==-1&&l>o;)e+=n.slice(0,a+1),n=n.slice(a+1),a=n.indexOf(")"),o++;return[e,n]}function yv(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||zs(n)||pf(n))&&(!t||n!==47)}vv.peek=oS;function eS(){this.buffer()}function tS(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function nS(){this.buffer()}function rS(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function aS(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ca(this.sliceSerialize(e)).toLowerCase(),n.label=t}function iS(e){this.exit(e)}function lS(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ca(this.sliceSerialize(e)).toLowerCase(),n.label=t}function sS(e){this.exit(e)}function oS(){return"["}function vv(e,t,n,a){const l=n.createTracker(a);let o=l.move("[^");const c=n.enter("footnoteReference"),f=n.enter("reference");return o+=l.move(n.safe(n.associationId(e),{after:"]",before:o})),f(),c(),o+=l.move("]"),o}function uS(){return{enter:{gfmFootnoteCallString:eS,gfmFootnoteCall:tS,gfmFootnoteDefinitionLabelString:nS,gfmFootnoteDefinition:rS},exit:{gfmFootnoteCallString:aS,gfmFootnoteCall:iS,gfmFootnoteDefinitionLabelString:lS,gfmFootnoteDefinition:sS}}}function cS(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:vv},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(a,l,o,c){const f=o.createTracker(c);let h=f.move("[^");const m=o.enter("footnoteDefinition"),g=o.enter("label");return h+=f.move(o.safe(o.associationId(a),{before:h,after:"]"})),g(),h+=f.move("]:"),a.children&&a.children.length>0&&(f.shift(4),h+=f.move((t?`
|
|
64
|
+
`:" ")+o.indentLines(o.containerFlow(a,f.current()),t?xv:dS))),m(),h}}function dS(e,t,n){return t===0?e:xv(e,t,n)}function xv(e,t,n){return(n?"":" ")+e}const fS=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];bv.peek=yS;function hS(){return{canContainEols:["delete"],enter:{strikethrough:pS},exit:{strikethrough:gS}}}function mS(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:fS}],handlers:{delete:bv}}}function pS(e){this.enter({type:"delete",children:[]},e)}function gS(e){this.exit(e)}function bv(e,t,n,a){const l=n.createTracker(a),o=n.enter("strikethrough");let c=l.move("~~");return c+=n.containerPhrasing(e,{...l.current(),before:c,after:"~"}),c+=l.move("~~"),o(),c}function yS(){return"~"}function vS(e){return e.length}function xS(e,t){const n=t||{},a=(n.align||[]).concat(),l=n.stringLength||vS,o=[],c=[],f=[],h=[];let m=0,g=-1;for(;++g<e.length;){const A=[],q=[];let z=-1;for(e[g].length>m&&(m=e[g].length);++z<e[g].length;){const M=bS(e[g][z]);if(n.alignDelimiters!==!1){const B=l(M);q[z]=B,(h[z]===void 0||B>h[z])&&(h[z]=B)}A.push(M)}c[g]=A,f[g]=q}let v=-1;if(typeof a=="object"&&"length"in a)for(;++v<m;)o[v]=_y(a[v]);else{const A=_y(a);for(;++v<m;)o[v]=A}v=-1;const k=[],b=[];for(;++v<m;){const A=o[v];let q="",z="";A===99?(q=":",z=":"):A===108?q=":":A===114&&(z=":");let M=n.alignDelimiters===!1?1:Math.max(1,h[v]-q.length-z.length);const B=q+"-".repeat(M)+z;n.alignDelimiters!==!1&&(M=q.length+M+z.length,M>h[v]&&(h[v]=M),b[v]=M),k[v]=B}c.splice(1,0,k),f.splice(1,0,b),g=-1;const T=[];for(;++g<c.length;){const A=c[g],q=f[g];v=-1;const z=[];for(;++v<m;){const M=A[v]||"";let B="",U="";if(n.alignDelimiters!==!1){const ne=h[v]-(q[v]||0),L=o[v];L===114?B=" ".repeat(ne):L===99?ne%2?(B=" ".repeat(ne/2+.5),U=" ".repeat(ne/2-.5)):(B=" ".repeat(ne/2),U=B):U=" ".repeat(ne)}n.delimiterStart!==!1&&!v&&z.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&M==="")&&(n.delimiterStart!==!1||v)&&z.push(" "),n.alignDelimiters!==!1&&z.push(B),z.push(M),n.alignDelimiters!==!1&&z.push(U),n.padding!==!1&&z.push(" "),(n.delimiterEnd!==!1||v!==m-1)&&z.push("|")}T.push(n.delimiterEnd===!1?z.join("").replace(/ +$/,""):z.join(""))}return T.join(`
|
|
65
65
|
`)}function bS(e){return e==null?"":String(e)}function _y(e){const 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 wS(e,t,n,a){const l=n.enter("blockquote"),o=n.createTracker(a);o.move("> "),o.shift(2);const c=n.indentLines(n.containerFlow(e,o.current()),kS);return l(),c}function kS(e,t,n){return">"+(n?"":" ")+e}function SS(e,t){return Ly(e,t.inConstruct,!0)&&!Ly(e,t.notInConstruct,!1)}function Ly(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let a=-1;for(;++a<t.length;)if(e.includes(t[a]))return!0;return!1}function By(e,t,n,a){let l=-1;for(;++l<n.unsafe.length;)if(n.unsafe[l].character===`
|
|
66
66
|
`&&SS(n.stack,n.unsafe[l]))return/[ \t]/.test(a.before)?"":" ";return`\\
|
|
67
67
|
`}function wv(e,t){const n=String(e);let a=n.indexOf(t),l=a,o=0,c=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===l?++o>c&&(c=o):o=1,l=a+t.length,a=n.indexOf(t,l);return c}function jS(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 CS(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function TS(e,t,n,a){const l=CS(n),o=e.value||"",c=l==="`"?"GraveAccent":"Tilde";if(jS(e,n)){const v=n.enter("codeIndented"),k=n.indentLines(o,AS);return v(),k}const f=n.createTracker(a),h=l.repeat(Math.max(wv(o,l)+1,3)),m=n.enter("codeFenced");let g=f.move(h);if(e.lang){const v=n.enter(`codeFencedLang${c}`);g+=f.move(n.safe(e.lang,{before:g,after:" ",encode:["`"],...f.current()})),v()}if(e.lang&&e.meta){const v=n.enter(`codeFencedMeta${c}`);g+=f.move(" "),g+=f.move(n.safe(e.meta,{before:g,after:`
|
|
@@ -75,11 +75,11 @@ Error generating stack: `+d.message+`
|
|
|
75
75
|
`))+1))}const c="#".repeat(l),f=n.enter("headingAtx"),h=n.enter("phrasing");o.move(c+" ");let m=n.containerPhrasing(e,{before:"# ",after:`
|
|
76
76
|
`,...o.current()});return/^[\t ]/.test(m)&&(m=Gc(m.charCodeAt(0))+m.slice(1)),m=m?c+" "+m:c,n.options.closeAtx&&(m+=" "+c),h(),f(),m}Sv.peek=RS;function Sv(e){return e.value||""}function RS(){return"<"}jv.peek=OS;function jv(e,t,n,a){const l=j1(n),o=l==='"'?"Quote":"Apostrophe",c=n.enter("image");let f=n.enter("label");const h=n.createTracker(a);let m=h.move("![");return m+=h.move(n.safe(e.alt,{before:m,after:"]",...h.current()})),m+=h.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),m+=h.move("<"),m+=h.move(n.safe(e.url,{before:m,after:">",...h.current()})),m+=h.move(">")):(f=n.enter("destinationRaw"),m+=h.move(n.safe(e.url,{before:m,after:e.title?" ":")",...h.current()}))),f(),e.title&&(f=n.enter(`title${o}`),m+=h.move(" "+l),m+=h.move(n.safe(e.title,{before:m,after:l,...h.current()})),m+=h.move(l),f()),m+=h.move(")"),c(),m}function OS(){return"!"}Cv.peek=IS;function Cv(e,t,n,a){const l=e.referenceType,o=n.enter("imageReference");let c=n.enter("label");const f=n.createTracker(a);let h=f.move("![");const m=n.safe(e.alt,{before:h,after:"]",...f.current()});h+=f.move(m+"]["),c();const g=n.stack;n.stack=[],c=n.enter("reference");const v=n.safe(n.associationId(e),{before:h,after:"]",...f.current()});return c(),n.stack=g,o(),l==="full"||!m||m!==v?h+=f.move(v+"]"):l==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function IS(){return"!"}Tv.peek=_S;function Tv(e,t,n){let a=e.value||"",l="`",o=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(a);)l+="`";for(/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++o<n.unsafe.length;){const c=n.unsafe[o],f=n.compilePattern(c);let h;if(c.atBreak)for(;h=f.exec(a);){let m=h.index;a.charCodeAt(m)===10&&a.charCodeAt(m-1)===13&&m--,a=a.slice(0,m)+" "+a.slice(h.index+1)}}return l+a+l}function _S(){return"`"}function Av(e,t){const n=m1(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))}Ev.peek=LS;function Ev(e,t,n,a){const l=j1(n),o=l==='"'?"Quote":"Apostrophe",c=n.createTracker(a);let f,h;if(Av(e,n)){const g=n.stack;n.stack=[],f=n.enter("autolink");let v=c.move("<");return v+=c.move(n.containerPhrasing(e,{before:v,after:">",...c.current()})),v+=c.move(">"),f(),n.stack=g,v}f=n.enter("link"),h=n.enter("label");let m=c.move("[");return m+=c.move(n.containerPhrasing(e,{before:m,after:"](",...c.current()})),m+=c.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=n.enter("destinationLiteral"),m+=c.move("<"),m+=c.move(n.safe(e.url,{before:m,after:">",...c.current()})),m+=c.move(">")):(h=n.enter("destinationRaw"),m+=c.move(n.safe(e.url,{before:m,after:e.title?" ":")",...c.current()}))),h(),e.title&&(h=n.enter(`title${o}`),m+=c.move(" "+l),m+=c.move(n.safe(e.title,{before:m,after:l,...c.current()})),m+=c.move(l),h()),m+=c.move(")"),f(),m}function LS(e,t,n){return Av(e,n)?"<":"["}Nv.peek=BS;function Nv(e,t,n,a){const l=e.referenceType,o=n.enter("linkReference");let c=n.enter("label");const f=n.createTracker(a);let h=f.move("[");const m=n.containerPhrasing(e,{before:h,after:"]",...f.current()});h+=f.move(m+"]["),c();const g=n.stack;n.stack=[],c=n.enter("reference");const v=n.safe(n.associationId(e),{before:h,after:"]",...f.current()});return c(),n.stack=g,o(),l==="full"||!m||m!==v?h+=f.move(v+"]"):l==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function BS(){return"["}function C1(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function qS(e){const t=C1(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function US(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Mv(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function HS(e,t,n,a){const l=n.enter("list"),o=n.bulletCurrent;let c=e.ordered?US(n):C1(n);const f=e.ordered?c==="."?")":".":qS(n);let h=t&&n.bulletLastUsed?c===n.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((c==="*"||c==="-")&&g&&(!g.children||!g.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&&(h=!0),Mv(n)===c&&g){let v=-1;for(;++v<e.children.length;){const k=e.children[v];if(k&&k.type==="listItem"&&k.children&&k.children[0]&&k.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(c=f),n.bulletCurrent=c;const m=n.containerFlow(e,a);return n.bulletLastUsed=c,n.bulletCurrent=o,l(),m}function $S(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function FS(e,t,n,a){const l=$S(n);let o=n.bulletCurrent||C1(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let c=o.length+1;(l==="tab"||l==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(c=Math.ceil(c/4)*4);const f=n.createTracker(a);f.move(o+" ".repeat(c-o.length)),f.shift(c);const h=n.enter("listItem"),m=n.indentLines(n.containerFlow(e,f.current()),g);return h(),m;function g(v,k,b){return k?(b?"":" ".repeat(c))+v:(b?o:o+" ".repeat(c-o.length))+v}}function PS(e,t,n,a){const l=n.enter("paragraph"),o=n.enter("phrasing"),c=n.containerPhrasing(e,a);return o(),l(),c}const GS=Qc(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function VS(e,t,n,a){return(e.children.some(function(c){return GS(c)})?n.containerPhrasing:n.containerFlow).call(n,e,a)}function YS(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}zv.peek=WS;function zv(e,t,n,a){const l=YS(n),o=n.enter("strong"),c=n.createTracker(a),f=c.move(l+l);let h=c.move(n.containerPhrasing(e,{after:l,before:f,...c.current()}));const m=h.charCodeAt(0),g=tf(a.before.charCodeAt(a.before.length-1),m,l);g.inside&&(h=Gc(m)+h.slice(1));const v=h.charCodeAt(h.length-1),k=tf(a.after.charCodeAt(0),v,l);k.inside&&(h=h.slice(0,-1)+Gc(v));const b=c.move(l+l);return o(),n.attentionEncodeSurroundingInfo={after:k.outside,before:g.outside},f+h+b}function WS(e,t,n){return n.options.strong||"*"}function KS(e,t,n,a){return n.safe(e.value,a)}function XS(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function ZS(e,t,n){const a=(Mv(n)+(n.options.ruleSpaces?" ":"")).repeat(XS(n));return n.options.ruleSpaces?a.slice(0,-1):a}const Dv={blockquote:wS,break:By,code:TS,definition:ES,emphasis:kv,hardBreak:By,heading:DS,html:Sv,image:jv,imageReference:Cv,inlineCode:Tv,link:Ev,linkReference:Nv,list:HS,listItem:FS,paragraph:PS,root:VS,strong:zv,text:KS,thematicBreak:ZS};function QS(){return{enter:{table:JS,tableData:qy,tableHeader:qy,tableRow:tj},exit:{codeText:nj,table:ej,tableData:Lm,tableHeader:Lm,tableRow:Lm}}}function JS(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function ej(e){this.exit(e),this.data.inTable=void 0}function tj(e){this.enter({type:"tableRow",children:[]},e)}function Lm(e){this.exit(e)}function qy(e){this.enter({type:"tableCell",children:[]},e)}function nj(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,rj));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function rj(e,t){return t==="|"?t:e}function aj(e){const t=e||{},n=t.tableCellPadding,a=t.tablePipeAlign,l=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
77
77
|
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:k,table:c,tableCell:h,tableRow:f}};function c(b,T,A,q){return m(g(b,A,q),b.align)}function f(b,T,A,q){const z=v(b,A,q),M=m([z]);return M.slice(0,M.indexOf(`
|
|
78
|
-
`))}function h(b,T,A,q){const z=A.enter("tableCell"),M=A.enter("phrasing"),B=A.containerPhrasing(b,{...q,before:o,after:o});return M(),z(),B}function m(b,T){return xS(b,{align:T,alignDelimiters:a,padding:n,stringLength:l})}function g(b,T,A){const q=b.children;let z=-1;const M=[],B=T.enter("table");for(;++z<q.length;)M[z]=v(q[z],T,A);return B(),M}function v(b,T,A){const q=b.children;let z=-1;const M=[],B=T.enter("tableRow");for(;++z<q.length;)M[z]=h(q[z],b,T,A);return B(),M}function k(b,T,A){let q=Dv.inlineCode(b,T,A);return A.stack.includes("tableCell")&&(q=q.replace(/\|/g,"\\$&")),q}}function ij(){return{exit:{taskListCheckValueChecked:Uy,taskListCheckValueUnchecked:Uy,paragraph:sj}}}function lj(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:oj}}}function Uy(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function sj(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const a=n.children[0];if(a&&a.type==="text"){const l=t.children;let o=-1,c;for(;++o<l.length;){const f=l[o];if(f.type==="paragraph"){c=f;break}}c===n&&(a.value=a.value.slice(1),a.value.length===0?n.children.shift():n.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,n.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function oj(e,t,n,a){const l=e.children[0],o=typeof e.checked=="boolean"&&l&&l.type==="paragraph",c="["+(e.checked?"x":" ")+"] ",f=n.createTracker(a);o&&f.move(c);let h=Dv.listItem(e,t,n,{...a,...f.current()});return o&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),h;function m(g){return g+c}}function uj(){return[$k(),uS(),hS(),QS(),ij()]}function cj(e){return{extensions:[Fk(),cS(e),mS(),aj(e),lj()]}}const dj={tokenize:yj,partial:!0},Rv={tokenize:vj,partial:!0},Ov={tokenize:xj,partial:!0},Iv={tokenize:bj,partial:!0},fj={tokenize:wj,partial:!0},_v={name:"wwwAutolink",tokenize:pj,previous:Bv},Lv={name:"protocolAutolink",tokenize:gj,previous:qv},Bi={name:"emailAutolink",tokenize:mj,previous:Uv},ei={};function hj(){return{text:ei}}let bs=48;for(;bs<123;)ei[bs]=Bi,bs++,bs===58?bs=65:bs===91&&(bs=97);ei[43]=Bi;ei[45]=Bi;ei[46]=Bi;ei[95]=Bi;ei[72]=[Bi,Lv];ei[104]=[Bi,Lv];ei[87]=[Bi,_v];ei[119]=[Bi,_v];function mj(e,t,n){const a=this;let l,o;return c;function c(v){return!Ap(v)||!Uv.call(a,a.previous)||T1(a.events)?n(v):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(v))}function f(v){return Ap(v)?(e.consume(v),f):v===64?(e.consume(v),h):n(v)}function h(v){return v===46?e.check(fj,g,m)(v):v===45||v===95||Zn(v)?(o=!0,e.consume(v),h):g(v)}function m(v){return e.consume(v),l=!0,h}function g(v){return o&&l&&lr(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(v)):n(v)}}function pj(e,t,n){const a=this;return l;function l(c){return c!==87&&c!==119||!Bv.call(a,a.previous)||T1(a.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(dj,e.attempt(Rv,e.attempt(Ov,o),n),n)(c))}function o(c){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(c)}}function gj(e,t,n){const a=this;let l="",o=!1;return c;function c(v){return(v===72||v===104)&&qv.call(a,a.previous)&&!T1(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(v),e.consume(v),f):n(v)}function f(v){if(lr(v)&&l.length<5)return l+=String.fromCodePoint(v),e.consume(v),f;if(v===58){const k=l.toLowerCase();if(k==="http"||k==="https")return e.consume(v),h}return n(v)}function h(v){return v===47?(e.consume(v),o?m:(o=!0,h)):n(v)}function m(v){return v===null||Qd(v)||Zt(v)||zs(v)||pf(v)?n(v):e.attempt(Rv,e.attempt(Ov,g),n)(v)}function g(v){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(v)}}function yj(e,t,n){let a=0;return l;function l(c){return(c===87||c===119)&&a<3?(a++,e.consume(c),l):c===46&&a===3?(e.consume(c),o):n(c)}function o(c){return c===null?n(c):t(c)}}function vj(e,t,n){let a,l,o;return c;function c(m){return m===46||m===95?e.check(Iv,h,f)(m):m===null||Zt(m)||zs(m)||m!==45&&pf(m)?h(m):(o=!0,e.consume(m),c)}function f(m){return m===95?a=!0:(l=a,a=void 0),e.consume(m),c}function h(m){return l||a||!o?n(m):t(m)}}function xj(e,t){let n=0,a=0;return l;function l(c){return c===40?(n++,e.consume(c),l):c===41&&a<n?o(c):c===33||c===34||c===38||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===60||c===63||c===93||c===95||c===126?e.check(Iv,t,o)(c):c===null||Zt(c)||zs(c)?t(c):(e.consume(c),l)}function o(c){return c===41&&a++,e.consume(c),l}}function bj(e,t,n){return a;function a(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),a):f===38?(e.consume(f),o):f===93?(e.consume(f),l):f===60||f===null||Zt(f)||zs(f)?t(f):n(f)}function l(f){return f===null||f===40||f===91||Zt(f)||zs(f)?t(f):a(f)}function o(f){return lr(f)?c(f):n(f)}function c(f){return f===59?(e.consume(f),a):lr(f)?(e.consume(f),c):n(f)}}function wj(e,t,n){return a;function a(o){return e.consume(o),l}function l(o){return Zn(o)?n(o):t(o)}}function Bv(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Zt(e)}function qv(e){return!lr(e)}function Uv(e){return!(e===47||Ap(e))}function Ap(e){return e===43||e===45||e===46||e===95||Zn(e)}function T1(e){let t=e.length,n=!1;for(;t--;){const a=e[t][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){n=!0;break}if(a._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const kj={tokenize:Mj,partial:!0};function Sj(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Aj,continuation:{tokenize:Ej},exit:Nj}},text:{91:{name:"gfmFootnoteCall",tokenize:Tj},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:jj,resolveTo:Cj}}}}function jj(e,t,n){const a=this;let l=a.events.length;const o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let c;for(;l--;){const h=a.events[l][1];if(h.type==="labelImage"){c=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return f;function f(h){if(!c||!c._balanced)return n(h);const m=Ca(a.sliceSerialize({start:c.end,end:a.now()}));return m.codePointAt(0)!==94||!o.includes(m.slice(1))?n(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),t(h))}}function Cj(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";const a={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},c={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},f=[e[n+1],e[n+2],["enter",a,t],e[n+3],e[n+4],["enter",l,t],["exit",l,t],["enter",o,t],["enter",c,t],["exit",c,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",a,t]];return e.splice(n,e.length-n+1,...f),e}function Tj(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o=0,c;return f;function f(v){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(v),e.exit("gfmFootnoteCallLabelMarker"),h}function h(v){return v!==94?n(v):(e.enter("gfmFootnoteCallMarker"),e.consume(v),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",m)}function m(v){if(o>999||v===93&&!c||v===null||v===91||Zt(v))return n(v);if(v===93){e.exit("chunkString");const k=e.exit("gfmFootnoteCallString");return l.includes(Ca(a.sliceSerialize(k)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(v),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(v)}return Zt(v)||(c=!0),o++,e.consume(v),v===92?g:m}function g(v){return v===91||v===92||v===93?(e.consume(v),o++,m):m(v)}}function Aj(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o,c=0,f;return h;function h(T){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(T),e.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(T){return T===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(T),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):n(T)}function g(T){if(c>999||T===93&&!f||T===null||T===91||Zt(T))return n(T);if(T===93){e.exit("chunkString");const A=e.exit("gfmFootnoteDefinitionLabelString");return o=Ca(a.sliceSerialize(A)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(T),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),k}return Zt(T)||(f=!0),c++,e.consume(T),T===92?v:g}function v(T){return T===91||T===92||T===93?(e.consume(T),c++,g):g(T)}function k(T){return T===58?(e.enter("definitionMarker"),e.consume(T),e.exit("definitionMarker"),l.includes(o)||l.push(o),gt(e,b,"gfmFootnoteDefinitionWhitespace")):n(T)}function b(T){return t(T)}}function Ej(e,t,n){return e.check(Zc,t,e.attempt(kj,t,n))}function Nj(e){e.exit("gfmFootnoteDefinition")}function Mj(e,t,n){const a=this;return gt(e,l,"gfmFootnoteDefinitionIndent",5);function l(o){const c=a.events[a.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?t(o):n(o)}}function zj(e){let n=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:o,resolveAll:l};return n==null&&(n=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function l(c,f){let h=-1;for(;++h<c.length;)if(c[h][0]==="enter"&&c[h][1].type==="strikethroughSequenceTemporary"&&c[h][1]._close){let m=h;for(;m--;)if(c[m][0]==="exit"&&c[m][1].type==="strikethroughSequenceTemporary"&&c[m][1]._open&&c[h][1].end.offset-c[h][1].start.offset===c[m][1].end.offset-c[m][1].start.offset){c[h][1].type="strikethroughSequence",c[m][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},c[m][1].start),end:Object.assign({},c[h][1].end)},v={type:"strikethroughText",start:Object.assign({},c[m][1].end),end:Object.assign({},c[h][1].start)},k=[["enter",g,f],["enter",c[m][1],f],["exit",c[m][1],f],["enter",v,f]],b=f.parser.constructs.insideSpan.null;b&&Hr(k,k.length,0,gf(b,c.slice(m+1,h),f)),Hr(k,k.length,0,[["exit",v,f],["enter",c[h][1],f],["exit",c[h][1],f],["exit",g,f]]),Hr(c,m-1,h-m+3,k),h=m+k.length-2;break}}for(h=-1;++h<c.length;)c[h][1].type==="strikethroughSequenceTemporary"&&(c[h][1].type="data");return c}function o(c,f,h){const m=this.previous,g=this.events;let v=0;return k;function k(T){return m===126&&g[g.length-1][1].type!=="characterEscape"?h(T):(c.enter("strikethroughSequenceTemporary"),b(T))}function b(T){const A=Zo(m);if(T===126)return v>1?h(T):(c.consume(T),v++,b);if(v<2&&!n)return h(T);const q=c.exit("strikethroughSequenceTemporary"),z=Zo(T);return q._open=!z||z===2&&!!A,q._close=!A||A===2&&!!z,f(T)}}}class Dj{constructor(){this.map=[]}add(t,n,a){Rj(this,t,n,a)}consume(t){if(this.map.sort(function(o,c){return o[0]-c[0]}),this.map.length===0)return;let n=this.map.length;const a=[];for(;n>0;)n-=1,a.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];a.push(t.slice()),t.length=0;let l=a.pop();for(;l;){for(const o of l)t.push(o);l=a.pop()}this.map.length=0}}function Rj(e,t,n,a){let l=0;if(!(n===0&&a.length===0)){for(;l<e.map.length;){if(e.map[l][0]===t){e.map[l][1]+=n,e.map[l][2].push(...a);return}l+=1}e.map.push([t,n,a])}}function Oj(e,t){let n=!1;const a=[];for(;t<e.length;){const l=e[t];if(n){if(l[0]==="enter")l[1].type==="tableContent"&&a.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=a.length-1;a[o]=a[o]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return a}function Ij(){return{flow:{null:{name:"table",tokenize:_j,resolveAll:Lj}}}}function _j(e,t,n){const a=this;let l=0,o=0,c;return f;function f(F){let he=a.events.length-1;for(;he>-1;){const be=a.events[he][1].type;if(be==="lineEnding"||be==="linePrefix")he--;else break}const ce=he>-1?a.events[he][1].type:null,Ie=ce==="tableHead"||ce==="tableRow"?L:h;return Ie===L&&a.parser.lazy[a.now().line]?n(F):Ie(F)}function h(F){return e.enter("tableHead"),e.enter("tableRow"),m(F)}function m(F){return F===124||(c=!0,o+=1),g(F)}function g(F){return F===null?n(F):Ke(F)?o>1?(o=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),b):n(F):bt(F)?gt(e,g,"whitespace")(F):(o+=1,c&&(c=!1,l+=1),F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),c=!0,g):(e.enter("data"),v(F)))}function v(F){return F===null||F===124||Zt(F)?(e.exit("data"),g(F)):(e.consume(F),F===92?k:v)}function k(F){return F===92||F===124?(e.consume(F),v):v(F)}function b(F){return a.interrupt=!1,a.parser.lazy[a.now().line]?n(F):(e.enter("tableDelimiterRow"),c=!1,bt(F)?gt(e,T,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):T(F))}function T(F){return F===45||F===58?q(F):F===124?(c=!0,e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),A):ae(F)}function A(F){return bt(F)?gt(e,q,"whitespace")(F):q(F)}function q(F){return F===58?(o+=1,c=!0,e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),z):F===45?(o+=1,z(F)):F===null||Ke(F)?U(F):ae(F)}function z(F){return F===45?(e.enter("tableDelimiterFiller"),M(F)):ae(F)}function M(F){return F===45?(e.consume(F),M):F===58?(c=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),B):(e.exit("tableDelimiterFiller"),B(F))}function B(F){return bt(F)?gt(e,U,"whitespace")(F):U(F)}function U(F){return F===124?T(F):F===null||Ke(F)?!c||l!==o?ae(F):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(F)):ae(F)}function ae(F){return n(F)}function L(F){return e.enter("tableRow"),K(F)}function K(F){return F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),K):F===null||Ke(F)?(e.exit("tableRow"),t(F)):bt(F)?gt(e,K,"whitespace")(F):(e.enter("data"),ie(F))}function ie(F){return F===null||F===124||Zt(F)?(e.exit("data"),K(F)):(e.consume(F),F===92?Q:ie)}function Q(F){return F===92||F===124?(e.consume(F),ie):ie(F)}}function Lj(e,t){let n=-1,a=!0,l=0,o=[0,0,0,0],c=[0,0,0,0],f=!1,h=0,m,g,v;const k=new Dj;for(;++n<e.length;){const b=e[n],T=b[1];b[0]==="enter"?T.type==="tableHead"?(f=!1,h!==0&&(Hy(k,t,h,m,g),g=void 0,h=0),m={type:"table",start:Object.assign({},T.start),end:Object.assign({},T.end)},k.add(n,0,[["enter",m,t]])):T.type==="tableRow"||T.type==="tableDelimiterRow"?(a=!0,v=void 0,o=[0,0,0,0],c=[0,n+1,0,0],f&&(f=!1,g={type:"tableBody",start:Object.assign({},T.start),end:Object.assign({},T.end)},k.add(n,0,[["enter",g,t]])),l=T.type==="tableDelimiterRow"?2:g?3:1):l&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")?(a=!1,c[2]===0&&(o[1]!==0&&(c[0]=c[1],v=Sd(k,t,o,l,void 0,v),o=[0,0,0,0]),c[2]=n)):T.type==="tableCellDivider"&&(a?a=!1:(o[1]!==0&&(c[0]=c[1],v=Sd(k,t,o,l,void 0,v)),o=c,c=[o[1],n,0,0])):T.type==="tableHead"?(f=!0,h=n):T.type==="tableRow"||T.type==="tableDelimiterRow"?(h=n,o[1]!==0?(c[0]=c[1],v=Sd(k,t,o,l,n,v)):c[1]!==0&&(v=Sd(k,t,c,l,n,v)),l=0):l&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")&&(c[3]=n)}for(h!==0&&Hy(k,t,h,m,g),k.consume(t.events),n=-1;++n<t.events.length;){const b=t.events[n];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=Oj(t.events,n))}return e}function Sd(e,t,n,a,l,o){const c=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",f="tableContent";n[0]!==0&&(o.end=Object.assign({},$o(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const h=$o(t.events,n[1]);if(o={type:c,start:Object.assign({},h),end:Object.assign({},h)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const m=$o(t.events,n[2]),g=$o(t.events,n[3]),v={type:f,start:Object.assign({},m),end:Object.assign({},g)};if(e.add(n[2],0,[["enter",v,t]]),a!==2){const k=t.events[n[2]],b=t.events[n[3]];if(k[1].end=Object.assign({},b[1].end),k[1].type="chunkText",k[1].contentType="text",n[3]>n[2]+1){const T=n[2]+1,A=n[3]-n[2]-1;e.add(T,A,[])}}e.add(n[3]+1,0,[["exit",v,t]])}return l!==void 0&&(o.end=Object.assign({},$o(t.events,l)),e.add(l,0,[["exit",o,t]]),o=void 0),o}function Hy(e,t,n,a,l){const o=[],c=$o(t.events,n);l&&(l.end=Object.assign({},c),o.push(["exit",l,t])),a.end=Object.assign({},c),o.push(["exit",a,t]),e.add(n+1,0,o)}function $o(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const Bj={name:"tasklistCheck",tokenize:Uj};function qj(){return{text:{91:Bj}}}function Uj(e,t,n){const a=this;return l;function l(h){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?n(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),o)}function o(h){return Zt(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),c):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),c):n(h)}function c(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):n(h)}function f(h){return Ke(h)?t(h):bt(h)?e.check({tokenize:Hj},t,n)(h):n(h)}}function Hj(e,t,n){return gt(e,a,"whitespace");function a(l){return l===null?n(l):t(l)}}function $j(e){return K5([hj(),Sj(),zj(e),Ij(),qj()])}const Fj={};function Pj(e){const t=this,n=e||Fj,a=t.data(),l=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),c=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);l.push($j(n)),o.push(uj()),c.push(cj(n))}function Gj(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:l,mathFlowFence:a,mathFlowFenceMeta:n,mathFlowValue:f,mathText:c,mathTextData:f}};function e(h){const m={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[m]}},h)}function t(){this.buffer()}function n(){const h=this.resume(),m=this.stack[this.stack.length-1];m.type,m.meta=h}function a(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function l(h){const m=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),g=this.stack[this.stack.length-1];g.type,this.exit(h),g.value=m;const v=g.data.hChildren[0];v.type,v.tagName,v.children.push({type:"text",value:m}),this.data.mathFlowInside=void 0}function o(h){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},h),this.buffer()}function c(h){const m=this.resume(),g=this.stack[this.stack.length-1];g.type,this.exit(h),g.value=m,g.data.hChildren.push({type:"text",value:m})}function f(h){this.config.enter.data.call(this,h),this.config.exit.data.call(this,h)}}function Vj(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),a.peek=l,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
|
|
78
|
+
`))}function h(b,T,A,q){const z=A.enter("tableCell"),M=A.enter("phrasing"),B=A.containerPhrasing(b,{...q,before:o,after:o});return M(),z(),B}function m(b,T){return xS(b,{align:T,alignDelimiters:a,padding:n,stringLength:l})}function g(b,T,A){const q=b.children;let z=-1;const M=[],B=T.enter("table");for(;++z<q.length;)M[z]=v(q[z],T,A);return B(),M}function v(b,T,A){const q=b.children;let z=-1;const M=[],B=T.enter("tableRow");for(;++z<q.length;)M[z]=h(q[z],b,T,A);return B(),M}function k(b,T,A){let q=Dv.inlineCode(b,T,A);return A.stack.includes("tableCell")&&(q=q.replace(/\|/g,"\\$&")),q}}function ij(){return{exit:{taskListCheckValueChecked:Uy,taskListCheckValueUnchecked:Uy,paragraph:sj}}}function lj(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:oj}}}function Uy(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function sj(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const a=n.children[0];if(a&&a.type==="text"){const l=t.children;let o=-1,c;for(;++o<l.length;){const f=l[o];if(f.type==="paragraph"){c=f;break}}c===n&&(a.value=a.value.slice(1),a.value.length===0?n.children.shift():n.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,n.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function oj(e,t,n,a){const l=e.children[0],o=typeof e.checked=="boolean"&&l&&l.type==="paragraph",c="["+(e.checked?"x":" ")+"] ",f=n.createTracker(a);o&&f.move(c);let h=Dv.listItem(e,t,n,{...a,...f.current()});return o&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),h;function m(g){return g+c}}function uj(){return[$k(),uS(),hS(),QS(),ij()]}function cj(e){return{extensions:[Fk(),cS(e),mS(),aj(e),lj()]}}const dj={tokenize:yj,partial:!0},Rv={tokenize:vj,partial:!0},Ov={tokenize:xj,partial:!0},Iv={tokenize:bj,partial:!0},fj={tokenize:wj,partial:!0},_v={name:"wwwAutolink",tokenize:pj,previous:Bv},Lv={name:"protocolAutolink",tokenize:gj,previous:qv},Bi={name:"emailAutolink",tokenize:mj,previous:Uv},ei={};function hj(){return{text:ei}}let bs=48;for(;bs<123;)ei[bs]=Bi,bs++,bs===58?bs=65:bs===91&&(bs=97);ei[43]=Bi;ei[45]=Bi;ei[46]=Bi;ei[95]=Bi;ei[72]=[Bi,Lv];ei[104]=[Bi,Lv];ei[87]=[Bi,_v];ei[119]=[Bi,_v];function mj(e,t,n){const a=this;let l,o;return c;function c(v){return!Ap(v)||!Uv.call(a,a.previous)||T1(a.events)?n(v):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(v))}function f(v){return Ap(v)?(e.consume(v),f):v===64?(e.consume(v),h):n(v)}function h(v){return v===46?e.check(fj,g,m)(v):v===45||v===95||Zn(v)?(o=!0,e.consume(v),h):g(v)}function m(v){return e.consume(v),l=!0,h}function g(v){return o&&l&&lr(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(v)):n(v)}}function pj(e,t,n){const a=this;return l;function l(c){return c!==87&&c!==119||!Bv.call(a,a.previous)||T1(a.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(dj,e.attempt(Rv,e.attempt(Ov,o),n),n)(c))}function o(c){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(c)}}function gj(e,t,n){const a=this;let l="",o=!1;return c;function c(v){return(v===72||v===104)&&qv.call(a,a.previous)&&!T1(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(v),e.consume(v),f):n(v)}function f(v){if(lr(v)&&l.length<5)return l+=String.fromCodePoint(v),e.consume(v),f;if(v===58){const k=l.toLowerCase();if(k==="http"||k==="https")return e.consume(v),h}return n(v)}function h(v){return v===47?(e.consume(v),o?m:(o=!0,h)):n(v)}function m(v){return v===null||Qd(v)||Zt(v)||zs(v)||pf(v)?n(v):e.attempt(Rv,e.attempt(Ov,g),n)(v)}function g(v){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(v)}}function yj(e,t,n){let a=0;return l;function l(c){return(c===87||c===119)&&a<3?(a++,e.consume(c),l):c===46&&a===3?(e.consume(c),o):n(c)}function o(c){return c===null?n(c):t(c)}}function vj(e,t,n){let a,l,o;return c;function c(m){return m===46||m===95?e.check(Iv,h,f)(m):m===null||Zt(m)||zs(m)||m!==45&&pf(m)?h(m):(o=!0,e.consume(m),c)}function f(m){return m===95?a=!0:(l=a,a=void 0),e.consume(m),c}function h(m){return l||a||!o?n(m):t(m)}}function xj(e,t){let n=0,a=0;return l;function l(c){return c===40?(n++,e.consume(c),l):c===41&&a<n?o(c):c===33||c===34||c===38||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===60||c===63||c===93||c===95||c===126?e.check(Iv,t,o)(c):c===null||Zt(c)||zs(c)?t(c):(e.consume(c),l)}function o(c){return c===41&&a++,e.consume(c),l}}function bj(e,t,n){return a;function a(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),a):f===38?(e.consume(f),o):f===93?(e.consume(f),l):f===60||f===null||Zt(f)||zs(f)?t(f):n(f)}function l(f){return f===null||f===40||f===91||Zt(f)||zs(f)?t(f):a(f)}function o(f){return lr(f)?c(f):n(f)}function c(f){return f===59?(e.consume(f),a):lr(f)?(e.consume(f),c):n(f)}}function wj(e,t,n){return a;function a(o){return e.consume(o),l}function l(o){return Zn(o)?n(o):t(o)}}function Bv(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Zt(e)}function qv(e){return!lr(e)}function Uv(e){return!(e===47||Ap(e))}function Ap(e){return e===43||e===45||e===46||e===95||Zn(e)}function T1(e){let t=e.length,n=!1;for(;t--;){const a=e[t][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){n=!0;break}if(a._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const kj={tokenize:Mj,partial:!0};function Sj(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Aj,continuation:{tokenize:Ej},exit:Nj}},text:{91:{name:"gfmFootnoteCall",tokenize:Tj},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:jj,resolveTo:Cj}}}}function jj(e,t,n){const a=this;let l=a.events.length;const o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let c;for(;l--;){const h=a.events[l][1];if(h.type==="labelImage"){c=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return f;function f(h){if(!c||!c._balanced)return n(h);const m=Ca(a.sliceSerialize({start:c.end,end:a.now()}));return m.codePointAt(0)!==94||!o.includes(m.slice(1))?n(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),t(h))}}function Cj(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";const a={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},c={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},f=[e[n+1],e[n+2],["enter",a,t],e[n+3],e[n+4],["enter",l,t],["exit",l,t],["enter",o,t],["enter",c,t],["exit",c,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",a,t]];return e.splice(n,e.length-n+1,...f),e}function Tj(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o=0,c;return f;function f(v){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(v),e.exit("gfmFootnoteCallLabelMarker"),h}function h(v){return v!==94?n(v):(e.enter("gfmFootnoteCallMarker"),e.consume(v),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",m)}function m(v){if(o>999||v===93&&!c||v===null||v===91||Zt(v))return n(v);if(v===93){e.exit("chunkString");const k=e.exit("gfmFootnoteCallString");return l.includes(Ca(a.sliceSerialize(k)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(v),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(v)}return Zt(v)||(c=!0),o++,e.consume(v),v===92?g:m}function g(v){return v===91||v===92||v===93?(e.consume(v),o++,m):m(v)}}function Aj(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o,c=0,f;return h;function h(T){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(T),e.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(T){return T===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(T),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):n(T)}function g(T){if(c>999||T===93&&!f||T===null||T===91||Zt(T))return n(T);if(T===93){e.exit("chunkString");const A=e.exit("gfmFootnoteDefinitionLabelString");return o=Ca(a.sliceSerialize(A)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(T),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),k}return Zt(T)||(f=!0),c++,e.consume(T),T===92?v:g}function v(T){return T===91||T===92||T===93?(e.consume(T),c++,g):g(T)}function k(T){return T===58?(e.enter("definitionMarker"),e.consume(T),e.exit("definitionMarker"),l.includes(o)||l.push(o),gt(e,b,"gfmFootnoteDefinitionWhitespace")):n(T)}function b(T){return t(T)}}function Ej(e,t,n){return e.check(Zc,t,e.attempt(kj,t,n))}function Nj(e){e.exit("gfmFootnoteDefinition")}function Mj(e,t,n){const a=this;return gt(e,l,"gfmFootnoteDefinitionIndent",5);function l(o){const c=a.events[a.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?t(o):n(o)}}function zj(e){let n=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:o,resolveAll:l};return n==null&&(n=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function l(c,f){let h=-1;for(;++h<c.length;)if(c[h][0]==="enter"&&c[h][1].type==="strikethroughSequenceTemporary"&&c[h][1]._close){let m=h;for(;m--;)if(c[m][0]==="exit"&&c[m][1].type==="strikethroughSequenceTemporary"&&c[m][1]._open&&c[h][1].end.offset-c[h][1].start.offset===c[m][1].end.offset-c[m][1].start.offset){c[h][1].type="strikethroughSequence",c[m][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},c[m][1].start),end:Object.assign({},c[h][1].end)},v={type:"strikethroughText",start:Object.assign({},c[m][1].end),end:Object.assign({},c[h][1].start)},k=[["enter",g,f],["enter",c[m][1],f],["exit",c[m][1],f],["enter",v,f]],b=f.parser.constructs.insideSpan.null;b&&Hr(k,k.length,0,gf(b,c.slice(m+1,h),f)),Hr(k,k.length,0,[["exit",v,f],["enter",c[h][1],f],["exit",c[h][1],f],["exit",g,f]]),Hr(c,m-1,h-m+3,k),h=m+k.length-2;break}}for(h=-1;++h<c.length;)c[h][1].type==="strikethroughSequenceTemporary"&&(c[h][1].type="data");return c}function o(c,f,h){const m=this.previous,g=this.events;let v=0;return k;function k(T){return m===126&&g[g.length-1][1].type!=="characterEscape"?h(T):(c.enter("strikethroughSequenceTemporary"),b(T))}function b(T){const A=Zo(m);if(T===126)return v>1?h(T):(c.consume(T),v++,b);if(v<2&&!n)return h(T);const q=c.exit("strikethroughSequenceTemporary"),z=Zo(T);return q._open=!z||z===2&&!!A,q._close=!A||A===2&&!!z,f(T)}}}class Dj{constructor(){this.map=[]}add(t,n,a){Rj(this,t,n,a)}consume(t){if(this.map.sort(function(o,c){return o[0]-c[0]}),this.map.length===0)return;let n=this.map.length;const a=[];for(;n>0;)n-=1,a.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];a.push(t.slice()),t.length=0;let l=a.pop();for(;l;){for(const o of l)t.push(o);l=a.pop()}this.map.length=0}}function Rj(e,t,n,a){let l=0;if(!(n===0&&a.length===0)){for(;l<e.map.length;){if(e.map[l][0]===t){e.map[l][1]+=n,e.map[l][2].push(...a);return}l+=1}e.map.push([t,n,a])}}function Oj(e,t){let n=!1;const a=[];for(;t<e.length;){const l=e[t];if(n){if(l[0]==="enter")l[1].type==="tableContent"&&a.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=a.length-1;a[o]=a[o]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return a}function Ij(){return{flow:{null:{name:"table",tokenize:_j,resolveAll:Lj}}}}function _j(e,t,n){const a=this;let l=0,o=0,c;return f;function f(F){let he=a.events.length-1;for(;he>-1;){const be=a.events[he][1].type;if(be==="lineEnding"||be==="linePrefix")he--;else break}const ce=he>-1?a.events[he][1].type:null,Ie=ce==="tableHead"||ce==="tableRow"?L:h;return Ie===L&&a.parser.lazy[a.now().line]?n(F):Ie(F)}function h(F){return e.enter("tableHead"),e.enter("tableRow"),m(F)}function m(F){return F===124||(c=!0,o+=1),g(F)}function g(F){return F===null?n(F):Ke(F)?o>1?(o=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),b):n(F):bt(F)?gt(e,g,"whitespace")(F):(o+=1,c&&(c=!1,l+=1),F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),c=!0,g):(e.enter("data"),v(F)))}function v(F){return F===null||F===124||Zt(F)?(e.exit("data"),g(F)):(e.consume(F),F===92?k:v)}function k(F){return F===92||F===124?(e.consume(F),v):v(F)}function b(F){return a.interrupt=!1,a.parser.lazy[a.now().line]?n(F):(e.enter("tableDelimiterRow"),c=!1,bt(F)?gt(e,T,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):T(F))}function T(F){return F===45||F===58?q(F):F===124?(c=!0,e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),A):ne(F)}function A(F){return bt(F)?gt(e,q,"whitespace")(F):q(F)}function q(F){return F===58?(o+=1,c=!0,e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),z):F===45?(o+=1,z(F)):F===null||Ke(F)?U(F):ne(F)}function z(F){return F===45?(e.enter("tableDelimiterFiller"),M(F)):ne(F)}function M(F){return F===45?(e.consume(F),M):F===58?(c=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),B):(e.exit("tableDelimiterFiller"),B(F))}function B(F){return bt(F)?gt(e,U,"whitespace")(F):U(F)}function U(F){return F===124?T(F):F===null||Ke(F)?!c||l!==o?ne(F):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(F)):ne(F)}function ne(F){return n(F)}function L(F){return e.enter("tableRow"),K(F)}function K(F){return F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),K):F===null||Ke(F)?(e.exit("tableRow"),t(F)):bt(F)?gt(e,K,"whitespace")(F):(e.enter("data"),ie(F))}function ie(F){return F===null||F===124||Zt(F)?(e.exit("data"),K(F)):(e.consume(F),F===92?Q:ie)}function Q(F){return F===92||F===124?(e.consume(F),ie):ie(F)}}function Lj(e,t){let n=-1,a=!0,l=0,o=[0,0,0,0],c=[0,0,0,0],f=!1,h=0,m,g,v;const k=new Dj;for(;++n<e.length;){const b=e[n],T=b[1];b[0]==="enter"?T.type==="tableHead"?(f=!1,h!==0&&(Hy(k,t,h,m,g),g=void 0,h=0),m={type:"table",start:Object.assign({},T.start),end:Object.assign({},T.end)},k.add(n,0,[["enter",m,t]])):T.type==="tableRow"||T.type==="tableDelimiterRow"?(a=!0,v=void 0,o=[0,0,0,0],c=[0,n+1,0,0],f&&(f=!1,g={type:"tableBody",start:Object.assign({},T.start),end:Object.assign({},T.end)},k.add(n,0,[["enter",g,t]])),l=T.type==="tableDelimiterRow"?2:g?3:1):l&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")?(a=!1,c[2]===0&&(o[1]!==0&&(c[0]=c[1],v=Sd(k,t,o,l,void 0,v),o=[0,0,0,0]),c[2]=n)):T.type==="tableCellDivider"&&(a?a=!1:(o[1]!==0&&(c[0]=c[1],v=Sd(k,t,o,l,void 0,v)),o=c,c=[o[1],n,0,0])):T.type==="tableHead"?(f=!0,h=n):T.type==="tableRow"||T.type==="tableDelimiterRow"?(h=n,o[1]!==0?(c[0]=c[1],v=Sd(k,t,o,l,n,v)):c[1]!==0&&(v=Sd(k,t,c,l,n,v)),l=0):l&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")&&(c[3]=n)}for(h!==0&&Hy(k,t,h,m,g),k.consume(t.events),n=-1;++n<t.events.length;){const b=t.events[n];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=Oj(t.events,n))}return e}function Sd(e,t,n,a,l,o){const c=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",f="tableContent";n[0]!==0&&(o.end=Object.assign({},$o(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const h=$o(t.events,n[1]);if(o={type:c,start:Object.assign({},h),end:Object.assign({},h)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const m=$o(t.events,n[2]),g=$o(t.events,n[3]),v={type:f,start:Object.assign({},m),end:Object.assign({},g)};if(e.add(n[2],0,[["enter",v,t]]),a!==2){const k=t.events[n[2]],b=t.events[n[3]];if(k[1].end=Object.assign({},b[1].end),k[1].type="chunkText",k[1].contentType="text",n[3]>n[2]+1){const T=n[2]+1,A=n[3]-n[2]-1;e.add(T,A,[])}}e.add(n[3]+1,0,[["exit",v,t]])}return l!==void 0&&(o.end=Object.assign({},$o(t.events,l)),e.add(l,0,[["exit",o,t]]),o=void 0),o}function Hy(e,t,n,a,l){const o=[],c=$o(t.events,n);l&&(l.end=Object.assign({},c),o.push(["exit",l,t])),a.end=Object.assign({},c),o.push(["exit",a,t]),e.add(n+1,0,o)}function $o(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const Bj={name:"tasklistCheck",tokenize:Uj};function qj(){return{text:{91:Bj}}}function Uj(e,t,n){const a=this;return l;function l(h){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?n(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),o)}function o(h){return Zt(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),c):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),c):n(h)}function c(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):n(h)}function f(h){return Ke(h)?t(h):bt(h)?e.check({tokenize:Hj},t,n)(h):n(h)}}function Hj(e,t,n){return gt(e,a,"whitespace");function a(l){return l===null?n(l):t(l)}}function $j(e){return K5([hj(),Sj(),zj(e),Ij(),qj()])}const Fj={};function Pj(e){const t=this,n=e||Fj,a=t.data(),l=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),c=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);l.push($j(n)),o.push(uj()),c.push(cj(n))}function Gj(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:l,mathFlowFence:a,mathFlowFenceMeta:n,mathFlowValue:f,mathText:c,mathTextData:f}};function e(h){const m={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[m]}},h)}function t(){this.buffer()}function n(){const h=this.resume(),m=this.stack[this.stack.length-1];m.type,m.meta=h}function a(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function l(h){const m=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),g=this.stack[this.stack.length-1];g.type,this.exit(h),g.value=m;const v=g.data.hChildren[0];v.type,v.tagName,v.children.push({type:"text",value:m}),this.data.mathFlowInside=void 0}function o(h){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},h),this.buffer()}function c(h){const m=this.resume(),g=this.stack[this.stack.length-1];g.type,this.exit(h),g.value=m,g.data.hChildren.push({type:"text",value:m})}function f(h){this.config.enter.data.call(this,h),this.config.exit.data.call(this,h)}}function Vj(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),a.peek=l,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
|
|
79
79
|
`,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:a}};function n(o,c,f,h){const m=o.value||"",g=f.createTracker(h),v="$".repeat(Math.max(wv(m,"$")+1,2)),k=f.enter("mathFlow");let b=g.move(v);if(o.meta){const T=f.enter("mathFlowMeta");b+=g.move(f.safe(o.meta,{after:`
|
|
80
80
|
`,before:b,encode:["$"],...g.current()})),T()}return b+=g.move(`
|
|
81
81
|
`),m&&(b+=g.move(m+`
|
|
82
|
-
`)),b+=g.move(v),k(),b}function a(o,c,f){let h=o.value||"",m=1;for(t||m++;new RegExp("(^|[^$])"+"\\$".repeat(m)+"([^$]|$)").test(h);)m++;const g="$".repeat(m);/[^ \r\n]/.test(h)&&(/^[ \r\n]/.test(h)&&/[ \r\n]$/.test(h)||/^\$|\$$/.test(h))&&(h=" "+h+" ");let v=-1;for(;++v<f.unsafe.length;){const k=f.unsafe[v];if(!k.atBreak)continue;const b=f.compilePattern(k);let T;for(;T=b.exec(h);){let A=T.index;h.codePointAt(A)===10&&h.codePointAt(A-1)===13&&A--,h=h.slice(0,A)+" "+h.slice(T.index+1)}}return g+h+g}function l(){return"$"}}const Yj={tokenize:Wj,concrete:!0,name:"mathFlow"},$y={tokenize:Kj,partial:!0};function Wj(e,t,n){const a=this,l=a.events[a.events.length-1],o=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0;let c=0;return f;function f(M){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),h(M)}function h(M){return M===36?(e.consume(M),c++,h):c<2?n(M):(e.exit("mathFlowFenceSequence"),gt(e,m,"whitespace")(M))}function m(M){return M===null||Ke(M)?v(M):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(M))}function g(M){return M===null||Ke(M)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),v(M)):M===36?n(M):(e.consume(M),g)}function v(M){return e.exit("mathFlowFence"),a.interrupt?t(M):e.attempt($y,k,q)(M)}function k(M){return e.attempt({tokenize:z,partial:!0},q,b)(M)}function b(M){return(o?gt(e,T,"linePrefix",o+1):T)(M)}function T(M){return M===null?q(M):Ke(M)?e.attempt($y,k,q)(M):(e.enter("mathFlowValue"),A(M))}function A(M){return M===null||Ke(M)?(e.exit("mathFlowValue"),T(M)):(e.consume(M),A)}function q(M){return e.exit("mathFlow"),t(M)}function z(M,B,U){let ae=0;return gt(M,L,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function L(Q){return M.enter("mathFlowFence"),M.enter("mathFlowFenceSequence"),K(Q)}function K(Q){return Q===36?(ae++,M.consume(Q),K):ae<c?U(Q):(M.exit("mathFlowFenceSequence"),gt(M,ie,"whitespace")(Q))}function ie(Q){return Q===null||Ke(Q)?(M.exit("mathFlowFence"),B(Q)):U(Q)}}}function Kj(e,t,n){const a=this;return l;function l(c){return c===null?t(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}function Xj(e){let n=(e||{}).singleDollarTextMath;return n==null&&(n=!0),{tokenize:a,resolve:Zj,previous:Qj,name:"mathText"};function a(l,o,c){let f=0,h,m;return g;function g(A){return l.enter("mathText"),l.enter("mathTextSequence"),v(A)}function v(A){return A===36?(l.consume(A),f++,v):f<2&&!n?c(A):(l.exit("mathTextSequence"),k(A))}function k(A){return A===null?c(A):A===36?(m=l.enter("mathTextSequence"),h=0,T(A)):A===32?(l.enter("space"),l.consume(A),l.exit("space"),k):Ke(A)?(l.enter("lineEnding"),l.consume(A),l.exit("lineEnding"),k):(l.enter("mathTextData"),b(A))}function b(A){return A===null||A===32||A===36||Ke(A)?(l.exit("mathTextData"),k(A)):(l.consume(A),b)}function T(A){return A===36?(l.consume(A),h++,T):h===f?(l.exit("mathTextSequence"),l.exit("mathText"),o(A)):(m.type="mathTextData",b(A))}}}function Zj(e){let t=e.length-4,n=3,a,l;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=n;++a<t;)if(e[a][1].type==="mathTextData"){e[t][1].type="mathTextPadding",e[n][1].type="mathTextPadding",n+=2,t-=2;break}}for(a=n-1,t++;++a<=t;)l===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(l=a):(a===t||e[a][1].type==="lineEnding")&&(e[l][1].type="mathTextData",a!==l+2&&(e[l][1].end=e[a-1][1].end,e.splice(l+2,a-l-2),t-=a-l-2,a=l+2),l=void 0);return e}function Qj(e){return e!==36||this.events[this.events.length-1][1].type==="characterEscape"}function Jj(e){return{flow:{36:Yj},text:{36:Xj(e)}}}class Ee extends Error{constructor(t,n){var a="KaTeX parse error: "+t,l,o,c=n&&n.loc;if(c&&c.start<=c.end){var f=c.lexer.input;l=c.start,o=c.end,l===f.length?a+=" at end of input: ":a+=" at position "+(l+1)+": ";var h=f.slice(l,o).replace(/[^]/g,"$&̲"),m;l>15?m="…"+f.slice(l-15,l):m=f.slice(0,l);var g;o+15<f.length?g=f.slice(o,o+15)+"…":g=f.slice(o),a+=m+h+g}super(a),this.name="ParseError",this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,Ee.prototype),this.position=l,l!=null&&o!=null&&(this.length=o-l),this.rawMessage=t}}var eC=/([A-Z])/g,tC=e=>e.replace(eC,"-$1").toLowerCase(),nC={"&":"&",">":">","<":"<",'"':""","'":"'"},rC=/[&><"']/g,Qn=e=>String(e).replace(rC,t=>nC[t]),$d=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?$d(e.body[0]):e:e.type==="font"?$d(e.body):e,aC=new Set(["mathord","textord","atom"]),qi=e=>aC.has($d(e).type),iC=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?t[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():"_relative"},nf={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 lC(e){if(typeof e!="string")return e.enum[0];switch(e){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function sC(e){if(e.default!==void 0)return e.default;var t=Array.isArray(e.type)?e.type[0]:e.type;return lC(t)}function oC(e,t,n,a){var l=n[t];e[t]=l!==void 0?a.processor?a.processor(l):l:sC(a)}class A1{constructor(t){t===void 0&&(t={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,t=t||{};for(var n of Object.keys(nf)){var a=nf[n];a&&oC(this,n,t,a)}}reportNonstrict(t,n,a){var l=this.strict;if(typeof l=="function"&&(l=l(t,n,a)),!(!l||l==="ignore")){if(l===!0||l==="error")throw new Ee("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+t+"]"),a);l==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+l+"': "+n+" ["+t+"]"))}}useStrictBehavior(t,n,a){var l=this.strict;if(typeof l=="function")try{l=l(t,n,a)}catch{l="error"}return!l||l==="ignore"?!1:l===!0||l==="error"?!0:l==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+l+"': "+n+" ["+t+"]")),!1)}isTrusted(t){if("url"in t&&t.url&&!t.protocol){var n=iC(t.url);if(n==null)return!1;t.protocol=n}var a=typeof this.trust=="function"?this.trust(t):this.trust;return!!a}}class Nl{constructor(t,n,a){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=t,this.size=n,this.cramped=a}sup(){return Xa[uC[this.id]]}sub(){return Xa[cC[this.id]]}fracNum(){return Xa[dC[this.id]]}fracDen(){return Xa[fC[this.id]]}cramp(){return Xa[hC[this.id]]}text(){return Xa[mC[this.id]]}isTight(){return this.size>=2}}var E1=0,rf=1,Yo=2,_i=3,Vc=4,ia=5,Qo=6,sr=7,Xa=[new Nl(E1,0,!1),new Nl(rf,0,!0),new Nl(Yo,1,!1),new Nl(_i,1,!0),new Nl(Vc,2,!1),new Nl(ia,2,!0),new Nl(Qo,3,!1),new Nl(sr,3,!0)],uC=[Vc,ia,Vc,ia,Qo,sr,Qo,sr],cC=[ia,ia,ia,ia,sr,sr,sr,sr],dC=[Yo,_i,Vc,ia,Qo,sr,Qo,sr],fC=[_i,_i,ia,ia,sr,sr,sr,sr],hC=[rf,rf,_i,_i,ia,ia,sr,sr],mC=[E1,rf,Yo,_i,Yo,_i,Yo,_i],st={DISPLAY:Xa[E1],TEXT:Xa[Yo],SCRIPT:Xa[Vc],SCRIPTSCRIPT:Xa[Qo]},Ep=[{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 pC(e){for(var t=0;t<Ep.length;t++)for(var n=Ep[t],a=0;a<n.blocks.length;a++){var l=n.blocks[a];if(e>=l[0]&&e<=l[1])return n.name}return null}var Fd=[];Ep.forEach(e=>e.blocks.forEach(t=>Fd.push(...t)));function Hv(e){for(var t=0;t<Fd.length;t+=2)if(e>=Fd[t]&&e<=Fd[t+1])return!0;return!1}var In=e=>e+" "+e,Ho=80,gC=function(t,n){return"M95,"+(622+t+n)+`
|
|
82
|
+
`)),b+=g.move(v),k(),b}function a(o,c,f){let h=o.value||"",m=1;for(t||m++;new RegExp("(^|[^$])"+"\\$".repeat(m)+"([^$]|$)").test(h);)m++;const g="$".repeat(m);/[^ \r\n]/.test(h)&&(/^[ \r\n]/.test(h)&&/[ \r\n]$/.test(h)||/^\$|\$$/.test(h))&&(h=" "+h+" ");let v=-1;for(;++v<f.unsafe.length;){const k=f.unsafe[v];if(!k.atBreak)continue;const b=f.compilePattern(k);let T;for(;T=b.exec(h);){let A=T.index;h.codePointAt(A)===10&&h.codePointAt(A-1)===13&&A--,h=h.slice(0,A)+" "+h.slice(T.index+1)}}return g+h+g}function l(){return"$"}}const Yj={tokenize:Wj,concrete:!0,name:"mathFlow"},$y={tokenize:Kj,partial:!0};function Wj(e,t,n){const a=this,l=a.events[a.events.length-1],o=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0;let c=0;return f;function f(M){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),h(M)}function h(M){return M===36?(e.consume(M),c++,h):c<2?n(M):(e.exit("mathFlowFenceSequence"),gt(e,m,"whitespace")(M))}function m(M){return M===null||Ke(M)?v(M):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(M))}function g(M){return M===null||Ke(M)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),v(M)):M===36?n(M):(e.consume(M),g)}function v(M){return e.exit("mathFlowFence"),a.interrupt?t(M):e.attempt($y,k,q)(M)}function k(M){return e.attempt({tokenize:z,partial:!0},q,b)(M)}function b(M){return(o?gt(e,T,"linePrefix",o+1):T)(M)}function T(M){return M===null?q(M):Ke(M)?e.attempt($y,k,q)(M):(e.enter("mathFlowValue"),A(M))}function A(M){return M===null||Ke(M)?(e.exit("mathFlowValue"),T(M)):(e.consume(M),A)}function q(M){return e.exit("mathFlow"),t(M)}function z(M,B,U){let ne=0;return gt(M,L,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function L(Q){return M.enter("mathFlowFence"),M.enter("mathFlowFenceSequence"),K(Q)}function K(Q){return Q===36?(ne++,M.consume(Q),K):ne<c?U(Q):(M.exit("mathFlowFenceSequence"),gt(M,ie,"whitespace")(Q))}function ie(Q){return Q===null||Ke(Q)?(M.exit("mathFlowFence"),B(Q)):U(Q)}}}function Kj(e,t,n){const a=this;return l;function l(c){return c===null?t(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),o)}function o(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}function Xj(e){let n=(e||{}).singleDollarTextMath;return n==null&&(n=!0),{tokenize:a,resolve:Zj,previous:Qj,name:"mathText"};function a(l,o,c){let f=0,h,m;return g;function g(A){return l.enter("mathText"),l.enter("mathTextSequence"),v(A)}function v(A){return A===36?(l.consume(A),f++,v):f<2&&!n?c(A):(l.exit("mathTextSequence"),k(A))}function k(A){return A===null?c(A):A===36?(m=l.enter("mathTextSequence"),h=0,T(A)):A===32?(l.enter("space"),l.consume(A),l.exit("space"),k):Ke(A)?(l.enter("lineEnding"),l.consume(A),l.exit("lineEnding"),k):(l.enter("mathTextData"),b(A))}function b(A){return A===null||A===32||A===36||Ke(A)?(l.exit("mathTextData"),k(A)):(l.consume(A),b)}function T(A){return A===36?(l.consume(A),h++,T):h===f?(l.exit("mathTextSequence"),l.exit("mathText"),o(A)):(m.type="mathTextData",b(A))}}}function Zj(e){let t=e.length-4,n=3,a,l;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=n;++a<t;)if(e[a][1].type==="mathTextData"){e[t][1].type="mathTextPadding",e[n][1].type="mathTextPadding",n+=2,t-=2;break}}for(a=n-1,t++;++a<=t;)l===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(l=a):(a===t||e[a][1].type==="lineEnding")&&(e[l][1].type="mathTextData",a!==l+2&&(e[l][1].end=e[a-1][1].end,e.splice(l+2,a-l-2),t-=a-l-2,a=l+2),l=void 0);return e}function Qj(e){return e!==36||this.events[this.events.length-1][1].type==="characterEscape"}function Jj(e){return{flow:{36:Yj},text:{36:Xj(e)}}}class Ee extends Error{constructor(t,n){var a="KaTeX parse error: "+t,l,o,c=n&&n.loc;if(c&&c.start<=c.end){var f=c.lexer.input;l=c.start,o=c.end,l===f.length?a+=" at end of input: ":a+=" at position "+(l+1)+": ";var h=f.slice(l,o).replace(/[^]/g,"$&̲"),m;l>15?m="…"+f.slice(l-15,l):m=f.slice(0,l);var g;o+15<f.length?g=f.slice(o,o+15)+"…":g=f.slice(o),a+=m+h+g}super(a),this.name="ParseError",this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,Ee.prototype),this.position=l,l!=null&&o!=null&&(this.length=o-l),this.rawMessage=t}}var eC=/([A-Z])/g,tC=e=>e.replace(eC,"-$1").toLowerCase(),nC={"&":"&",">":">","<":"<",'"':""","'":"'"},rC=/[&><"']/g,Qn=e=>String(e).replace(rC,t=>nC[t]),$d=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?$d(e.body[0]):e:e.type==="font"?$d(e.body):e,aC=new Set(["mathord","textord","atom"]),qi=e=>aC.has($d(e).type),iC=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?t[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():"_relative"},nf={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 lC(e){if(typeof e!="string")return e.enum[0];switch(e){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function sC(e){if(e.default!==void 0)return e.default;var t=Array.isArray(e.type)?e.type[0]:e.type;return lC(t)}function oC(e,t,n,a){var l=n[t];e[t]=l!==void 0?a.processor?a.processor(l):l:sC(a)}class A1{constructor(t){t===void 0&&(t={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,t=t||{};for(var n of Object.keys(nf)){var a=nf[n];a&&oC(this,n,t,a)}}reportNonstrict(t,n,a){var l=this.strict;if(typeof l=="function"&&(l=l(t,n,a)),!(!l||l==="ignore")){if(l===!0||l==="error")throw new Ee("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+t+"]"),a);l==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+l+"': "+n+" ["+t+"]"))}}useStrictBehavior(t,n,a){var l=this.strict;if(typeof l=="function")try{l=l(t,n,a)}catch{l="error"}return!l||l==="ignore"?!1:l===!0||l==="error"?!0:l==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+l+"': "+n+" ["+t+"]")),!1)}isTrusted(t){if("url"in t&&t.url&&!t.protocol){var n=iC(t.url);if(n==null)return!1;t.protocol=n}var a=typeof this.trust=="function"?this.trust(t):this.trust;return!!a}}class Nl{constructor(t,n,a){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=t,this.size=n,this.cramped=a}sup(){return Xa[uC[this.id]]}sub(){return Xa[cC[this.id]]}fracNum(){return Xa[dC[this.id]]}fracDen(){return Xa[fC[this.id]]}cramp(){return Xa[hC[this.id]]}text(){return Xa[mC[this.id]]}isTight(){return this.size>=2}}var E1=0,rf=1,Yo=2,_i=3,Vc=4,ia=5,Qo=6,sr=7,Xa=[new Nl(E1,0,!1),new Nl(rf,0,!0),new Nl(Yo,1,!1),new Nl(_i,1,!0),new Nl(Vc,2,!1),new Nl(ia,2,!0),new Nl(Qo,3,!1),new Nl(sr,3,!0)],uC=[Vc,ia,Vc,ia,Qo,sr,Qo,sr],cC=[ia,ia,ia,ia,sr,sr,sr,sr],dC=[Yo,_i,Vc,ia,Qo,sr,Qo,sr],fC=[_i,_i,ia,ia,sr,sr,sr,sr],hC=[rf,rf,_i,_i,ia,ia,sr,sr],mC=[E1,rf,Yo,_i,Yo,_i,Yo,_i],st={DISPLAY:Xa[E1],TEXT:Xa[Yo],SCRIPT:Xa[Vc],SCRIPTSCRIPT:Xa[Qo]},Ep=[{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 pC(e){for(var t=0;t<Ep.length;t++)for(var n=Ep[t],a=0;a<n.blocks.length;a++){var l=n.blocks[a];if(e>=l[0]&&e<=l[1])return n.name}return null}var Fd=[];Ep.forEach(e=>e.blocks.forEach(t=>Fd.push(...t)));function Hv(e){for(var t=0;t<Fd.length;t+=2)if(e>=Fd[t]&&e<=Fd[t+1])return!0;return!1}var In=e=>e+" "+e,Ho=80,gC=function(t,n){return"M95,"+(622+t+n)+`
|
|
83
83
|
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
|
84
84
|
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
|
|
85
85
|
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
|
|
@@ -329,8 +329,8 @@ 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
|
|
|
329
329
|
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
|
|
330
330
|
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
|
|
331
331
|
l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
|
|
332
|
-
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function TC(e){return"toText"in e}class au{constructor(t){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=t,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(t){return this.classes.includes(t)}toNode(){for(var t=document.createDocumentFragment(),n=0;n<this.children.length;n++)t.appendChild(this.children[n].toNode());return t}toMarkup(){for(var t="",n=0;n<this.children.length;n++)t+=this.children[n].toMarkup();return t}toText(){return this.children.map(t=>{if(TC(t))return t.toText();throw new Error("Expected MathDomNode with toText, got "+t.constructor.name)}).join("")}}var Np={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},AC={ex:!0,em:!0,mu:!0},$v=function(t){return typeof t!="string"&&(t=t.unit),t in Np||t in AC||t==="ex"},cn=function(t,n){var a;if(t.unit in Np)a=Np[t.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(t.unit==="mu")a=n.fontMetrics().cssEmPerMu;else{var l;if(n.style.isTight()?l=n.havingStyle(n.style.text()):l=n,t.unit==="ex")a=l.fontMetrics().xHeight;else if(t.unit==="em")a=l.fontMetrics().quad;else throw new Ee("Invalid unit: '"+t.unit+"'");l!==n&&(a*=l.sizeMultiplier/n.sizeMultiplier)}return Math.min(t.number*a,n.maxSize)},Re=function(t){return+t.toFixed(4)+"em"},Ol=function(t){return t.filter(n=>n).join(" ")},N1=function(t){var n="";for(var a of Object.keys(t)){var l=t[a];l!==void 0&&(n+=tC(a)+":"+l+";")}return n},Fv=function(t,n,a){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=a||{},n){n.style.isTight()&&this.classes.push("mtight");var l=n.getColor();l&&(this.style.color=l)}},Pv=function(t){var n=document.createElement(t);n.className=Ol(this.classes),Object.assign(n.style,this.style);for(var a of Object.keys(this.attributes))n.setAttribute(a,this.attributes[a]);for(var l=0;l<this.children.length;l++)n.appendChild(this.children[l].toNode());return n},EC=/[\s"'>/=\x00-\x1f]/,Gv=function(t){var n="<"+t;this.classes.length&&(n+=' class="'+Qn(Ol(this.classes))+'"');var a=N1(this.style);a&&(n+=' style="'+Qn(a)+'"');for(var l of Object.keys(this.attributes)){if(EC.test(l))throw new Ee("Invalid attribute name '"+l+"'");n+=" "+l+'="'+Qn(this.attributes[l])+'"'}n+=">";for(var o=0;o<this.children.length;o++)n+=this.children[o].toMarkup();return n+="</"+t+">",n};class iu{constructor(t,n,a,l){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,Fv.call(this,t,a,l),this.children=n||[]}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return Pv.call(this,"span")}toMarkup(){return Gv.call(this,"span")}}class xf{constructor(t,n,a,l){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,Fv.call(this,n,l),this.children=a||[],this.setAttribute("href",t)}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return Pv.call(this,"a")}toMarkup(){return Gv.call(this,"a")}}class NC{constructor(t,n,a){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=n,this.src=t,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=a}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createElement("img");return t.src=this.src,t.alt=this.alt,t.className="mord",Object.assign(t.style,this.style),t}toMarkup(){var t='<img src="'+Qn(this.src)+'"'+(' alt="'+Qn(this.alt)+'"'),n=N1(this.style);return n&&(t+=' style="'+Qn(n)+'"'),t+="'/>",t}}var MC={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class Fr{constructor(t,n,a,l,o,c,f,h){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=t,this.height=n||0,this.depth=a||0,this.italic=l||0,this.skew=o||0,this.width=c||0,this.classes=f||[],this.style=h||{},this.maxFontSize=0;var m=pC(this.text.charCodeAt(0));m&&this.classes.push(m+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=MC[this.text])}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createTextNode(this.text),n=null;return this.italic>0&&(n=document.createElement("span"),n.style.marginRight=Re(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=Ol(this.classes)),Object.keys(this.style).length>0&&(n=n||document.createElement("span"),Object.assign(n.style,this.style)),n?(n.appendChild(t),n):t}toMarkup(){var t=!1,n="<span";this.classes.length&&(t=!0,n+=' class="',n+=Qn(Ol(this.classes)),n+='"');var a="";this.italic>0&&(a+="margin-right:"+Re(this.italic)+";"),a+=N1(this.style),a&&(t=!0,n+=' style="'+Qn(a)+'"');var l=Qn(this.text);return t?(n+=">",n+=l,n+="</span>",n):l}}class Li{constructor(t,n){this.children=void 0,this.attributes=void 0,this.children=t||[],this.attributes=n||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");for(var a of Object.keys(this.attributes))n.setAttribute(a,this.attributes[a]);for(var l=0;l<this.children.length;l++)n.appendChild(this.children[l].toNode());return n}toMarkup(){var t='<svg xmlns="http://www.w3.org/2000/svg"';for(var n of Object.keys(this.attributes))t+=" "+n+'="'+Qn(this.attributes[n])+'"';t+=">";for(var a=0;a<this.children.length;a++)t+=this.children[a].toMarkup();return t+="</svg>",t}}class Il{constructor(t,n){this.pathName=void 0,this.alternate=void 0,this.pathName=t,this.alternate=n}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"path");return this.alternate?n.setAttribute("d",this.alternate):n.setAttribute("d",Fy[this.pathName]),n}toMarkup(){return this.alternate?'<path d="'+Qn(this.alternate)+'"/>':'<path d="'+Qn(Fy[this.pathName])+'"/>'}}class Mp{constructor(t){this.attributes=void 0,this.attributes=t||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"line");for(var a of Object.keys(this.attributes))n.setAttribute(a,this.attributes[a]);return n}toMarkup(){var t="<line";for(var n of Object.keys(this.attributes))t+=" "+n+'="'+Qn(this.attributes[n])+'"';return t+="/>",t}}function zC(e){if(e instanceof Fr)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}function DC(e){if(e instanceof iu)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}var RC=e=>e instanceof iu||e instanceof xf||e instanceof au,Za={"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]}},jd={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]},Py={Å:"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 Vv(e,t){Za[e]=t}function M1(e,t,n){if(!Za[t])throw new Error("Font metrics not found for font: "+t+".");var a=e.charCodeAt(0),l=Za[t][a];if(!l&&e[0]in Py&&(a=Py[e[0]].charCodeAt(0),l=Za[t][a]),!l&&n==="text"&&Hv(a)&&(l=Za[t][77]),l)return{depth:l[0],height:l[1],italic:l[2],skew:l[3],width:l[4]}}var Bm={};function OC(e){var t;if(e>=5?t=0:e>=3?t=1:t=2,!Bm[t]){var n=Bm[t]={cssEmPerMu:jd.quad[t]/18};for(var a in jd)jd.hasOwnProperty(a)&&(n[a]=jd[a][t])}return Bm[t]}var ln={math:{},text:{}};function w(e,t,n,a,l,o){ln[e][l]={font:t,group:n,replace:a},o&&a&&(ln[e][a]=ln[e][l])}var S="math",ke="text",E="main",P="ams",sn="accent-token",Ue="bin",or="close",lu="inner",nt="mathord",Mn="op-token",Pr="open",e0="punct",G="rel",Ui="spacing",Z="textord";w(S,E,G,"≡","\\equiv",!0);w(S,E,G,"≺","\\prec",!0);w(S,E,G,"≻","\\succ",!0);w(S,E,G,"∼","\\sim",!0);w(S,E,G,"⊥","\\perp");w(S,E,G,"⪯","\\preceq",!0);w(S,E,G,"⪰","\\succeq",!0);w(S,E,G,"≃","\\simeq",!0);w(S,E,G,"∣","\\mid",!0);w(S,E,G,"≪","\\ll",!0);w(S,E,G,"≫","\\gg",!0);w(S,E,G,"≍","\\asymp",!0);w(S,E,G,"∥","\\parallel");w(S,E,G,"⋈","\\bowtie",!0);w(S,E,G,"⌣","\\smile",!0);w(S,E,G,"⊑","\\sqsubseteq",!0);w(S,E,G,"⊒","\\sqsupseteq",!0);w(S,E,G,"≐","\\doteq",!0);w(S,E,G,"⌢","\\frown",!0);w(S,E,G,"∋","\\ni",!0);w(S,E,G,"∝","\\propto",!0);w(S,E,G,"⊢","\\vdash",!0);w(S,E,G,"⊣","\\dashv",!0);w(S,E,G,"∋","\\owns");w(S,E,e0,".","\\ldotp");w(S,E,e0,"⋅","\\cdotp");w(S,E,e0,"⋅","·");w(ke,E,Z,"⋅","·");w(S,E,Z,"#","\\#");w(ke,E,Z,"#","\\#");w(S,E,Z,"&","\\&");w(ke,E,Z,"&","\\&");w(S,E,Z,"ℵ","\\aleph",!0);w(S,E,Z,"∀","\\forall",!0);w(S,E,Z,"ℏ","\\hbar",!0);w(S,E,Z,"∃","\\exists",!0);w(S,E,Z,"∇","\\nabla",!0);w(S,E,Z,"♭","\\flat",!0);w(S,E,Z,"ℓ","\\ell",!0);w(S,E,Z,"♮","\\natural",!0);w(S,E,Z,"♣","\\clubsuit",!0);w(S,E,Z,"℘","\\wp",!0);w(S,E,Z,"♯","\\sharp",!0);w(S,E,Z,"♢","\\diamondsuit",!0);w(S,E,Z,"ℜ","\\Re",!0);w(S,E,Z,"♡","\\heartsuit",!0);w(S,E,Z,"ℑ","\\Im",!0);w(S,E,Z,"♠","\\spadesuit",!0);w(S,E,Z,"§","\\S",!0);w(ke,E,Z,"§","\\S");w(S,E,Z,"¶","\\P",!0);w(ke,E,Z,"¶","\\P");w(S,E,Z,"†","\\dag");w(ke,E,Z,"†","\\dag");w(ke,E,Z,"†","\\textdagger");w(S,E,Z,"‡","\\ddag");w(ke,E,Z,"‡","\\ddag");w(ke,E,Z,"‡","\\textdaggerdbl");w(S,E,or,"⎱","\\rmoustache",!0);w(S,E,Pr,"⎰","\\lmoustache",!0);w(S,E,or,"⟯","\\rgroup",!0);w(S,E,Pr,"⟮","\\lgroup",!0);w(S,E,Ue,"∓","\\mp",!0);w(S,E,Ue,"⊖","\\ominus",!0);w(S,E,Ue,"⊎","\\uplus",!0);w(S,E,Ue,"⊓","\\sqcap",!0);w(S,E,Ue,"∗","\\ast");w(S,E,Ue,"⊔","\\sqcup",!0);w(S,E,Ue,"◯","\\bigcirc",!0);w(S,E,Ue,"∙","\\bullet",!0);w(S,E,Ue,"‡","\\ddagger");w(S,E,Ue,"≀","\\wr",!0);w(S,E,Ue,"⨿","\\amalg");w(S,E,Ue,"&","\\And");w(S,E,G,"⟵","\\longleftarrow",!0);w(S,E,G,"⇐","\\Leftarrow",!0);w(S,E,G,"⟸","\\Longleftarrow",!0);w(S,E,G,"⟶","\\longrightarrow",!0);w(S,E,G,"⇒","\\Rightarrow",!0);w(S,E,G,"⟹","\\Longrightarrow",!0);w(S,E,G,"↔","\\leftrightarrow",!0);w(S,E,G,"⟷","\\longleftrightarrow",!0);w(S,E,G,"⇔","\\Leftrightarrow",!0);w(S,E,G,"⟺","\\Longleftrightarrow",!0);w(S,E,G,"↦","\\mapsto",!0);w(S,E,G,"⟼","\\longmapsto",!0);w(S,E,G,"↗","\\nearrow",!0);w(S,E,G,"↩","\\hookleftarrow",!0);w(S,E,G,"↪","\\hookrightarrow",!0);w(S,E,G,"↘","\\searrow",!0);w(S,E,G,"↼","\\leftharpoonup",!0);w(S,E,G,"⇀","\\rightharpoonup",!0);w(S,E,G,"↙","\\swarrow",!0);w(S,E,G,"↽","\\leftharpoondown",!0);w(S,E,G,"⇁","\\rightharpoondown",!0);w(S,E,G,"↖","\\nwarrow",!0);w(S,E,G,"⇌","\\rightleftharpoons",!0);w(S,P,G,"≮","\\nless",!0);w(S,P,G,"","\\@nleqslant");w(S,P,G,"","\\@nleqq");w(S,P,G,"⪇","\\lneq",!0);w(S,P,G,"≨","\\lneqq",!0);w(S,P,G,"","\\@lvertneqq");w(S,P,G,"⋦","\\lnsim",!0);w(S,P,G,"⪉","\\lnapprox",!0);w(S,P,G,"⊀","\\nprec",!0);w(S,P,G,"⋠","\\npreceq",!0);w(S,P,G,"⋨","\\precnsim",!0);w(S,P,G,"⪹","\\precnapprox",!0);w(S,P,G,"≁","\\nsim",!0);w(S,P,G,"","\\@nshortmid");w(S,P,G,"∤","\\nmid",!0);w(S,P,G,"⊬","\\nvdash",!0);w(S,P,G,"⊭","\\nvDash",!0);w(S,P,G,"⋪","\\ntriangleleft");w(S,P,G,"⋬","\\ntrianglelefteq",!0);w(S,P,G,"⊊","\\subsetneq",!0);w(S,P,G,"","\\@varsubsetneq");w(S,P,G,"⫋","\\subsetneqq",!0);w(S,P,G,"","\\@varsubsetneqq");w(S,P,G,"≯","\\ngtr",!0);w(S,P,G,"","\\@ngeqslant");w(S,P,G,"","\\@ngeqq");w(S,P,G,"⪈","\\gneq",!0);w(S,P,G,"≩","\\gneqq",!0);w(S,P,G,"","\\@gvertneqq");w(S,P,G,"⋧","\\gnsim",!0);w(S,P,G,"⪊","\\gnapprox",!0);w(S,P,G,"⊁","\\nsucc",!0);w(S,P,G,"⋡","\\nsucceq",!0);w(S,P,G,"⋩","\\succnsim",!0);w(S,P,G,"⪺","\\succnapprox",!0);w(S,P,G,"≆","\\ncong",!0);w(S,P,G,"","\\@nshortparallel");w(S,P,G,"∦","\\nparallel",!0);w(S,P,G,"⊯","\\nVDash",!0);w(S,P,G,"⋫","\\ntriangleright");w(S,P,G,"⋭","\\ntrianglerighteq",!0);w(S,P,G,"","\\@nsupseteqq");w(S,P,G,"⊋","\\supsetneq",!0);w(S,P,G,"","\\@varsupsetneq");w(S,P,G,"⫌","\\supsetneqq",!0);w(S,P,G,"","\\@varsupsetneqq");w(S,P,G,"⊮","\\nVdash",!0);w(S,P,G,"⪵","\\precneqq",!0);w(S,P,G,"⪶","\\succneqq",!0);w(S,P,G,"","\\@nsubseteqq");w(S,P,Ue,"⊴","\\unlhd");w(S,P,Ue,"⊵","\\unrhd");w(S,P,G,"↚","\\nleftarrow",!0);w(S,P,G,"↛","\\nrightarrow",!0);w(S,P,G,"⇍","\\nLeftarrow",!0);w(S,P,G,"⇏","\\nRightarrow",!0);w(S,P,G,"↮","\\nleftrightarrow",!0);w(S,P,G,"⇎","\\nLeftrightarrow",!0);w(S,P,G,"△","\\vartriangle");w(S,P,Z,"ℏ","\\hslash");w(S,P,Z,"▽","\\triangledown");w(S,P,Z,"◊","\\lozenge");w(S,P,Z,"Ⓢ","\\circledS");w(S,P,Z,"®","\\circledR");w(ke,P,Z,"®","\\circledR");w(S,P,Z,"∡","\\measuredangle",!0);w(S,P,Z,"∄","\\nexists");w(S,P,Z,"℧","\\mho");w(S,P,Z,"Ⅎ","\\Finv",!0);w(S,P,Z,"⅁","\\Game",!0);w(S,P,Z,"‵","\\backprime");w(S,P,Z,"▲","\\blacktriangle");w(S,P,Z,"▼","\\blacktriangledown");w(S,P,Z,"■","\\blacksquare");w(S,P,Z,"⧫","\\blacklozenge");w(S,P,Z,"★","\\bigstar");w(S,P,Z,"∢","\\sphericalangle",!0);w(S,P,Z,"∁","\\complement",!0);w(S,P,Z,"ð","\\eth",!0);w(ke,E,Z,"ð","ð");w(S,P,Z,"╱","\\diagup");w(S,P,Z,"╲","\\diagdown");w(S,P,Z,"□","\\square");w(S,P,Z,"□","\\Box");w(S,P,Z,"◊","\\Diamond");w(S,P,Z,"¥","\\yen",!0);w(ke,P,Z,"¥","\\yen",!0);w(S,P,Z,"✓","\\checkmark",!0);w(ke,P,Z,"✓","\\checkmark");w(S,P,Z,"ℶ","\\beth",!0);w(S,P,Z,"ℸ","\\daleth",!0);w(S,P,Z,"ℷ","\\gimel",!0);w(S,P,Z,"ϝ","\\digamma",!0);w(S,P,Z,"ϰ","\\varkappa");w(S,P,Pr,"┌","\\@ulcorner",!0);w(S,P,or,"┐","\\@urcorner",!0);w(S,P,Pr,"└","\\@llcorner",!0);w(S,P,or,"┘","\\@lrcorner",!0);w(S,P,G,"≦","\\leqq",!0);w(S,P,G,"⩽","\\leqslant",!0);w(S,P,G,"⪕","\\eqslantless",!0);w(S,P,G,"≲","\\lesssim",!0);w(S,P,G,"⪅","\\lessapprox",!0);w(S,P,G,"≊","\\approxeq",!0);w(S,P,Ue,"⋖","\\lessdot");w(S,P,G,"⋘","\\lll",!0);w(S,P,G,"≶","\\lessgtr",!0);w(S,P,G,"⋚","\\lesseqgtr",!0);w(S,P,G,"⪋","\\lesseqqgtr",!0);w(S,P,G,"≑","\\doteqdot");w(S,P,G,"≓","\\risingdotseq",!0);w(S,P,G,"≒","\\fallingdotseq",!0);w(S,P,G,"∽","\\backsim",!0);w(S,P,G,"⋍","\\backsimeq",!0);w(S,P,G,"⫅","\\subseteqq",!0);w(S,P,G,"⋐","\\Subset",!0);w(S,P,G,"⊏","\\sqsubset",!0);w(S,P,G,"≼","\\preccurlyeq",!0);w(S,P,G,"⋞","\\curlyeqprec",!0);w(S,P,G,"≾","\\precsim",!0);w(S,P,G,"⪷","\\precapprox",!0);w(S,P,G,"⊲","\\vartriangleleft");w(S,P,G,"⊴","\\trianglelefteq");w(S,P,G,"⊨","\\vDash",!0);w(S,P,G,"⊪","\\Vvdash",!0);w(S,P,G,"⌣","\\smallsmile");w(S,P,G,"⌢","\\smallfrown");w(S,P,G,"≏","\\bumpeq",!0);w(S,P,G,"≎","\\Bumpeq",!0);w(S,P,G,"≧","\\geqq",!0);w(S,P,G,"⩾","\\geqslant",!0);w(S,P,G,"⪖","\\eqslantgtr",!0);w(S,P,G,"≳","\\gtrsim",!0);w(S,P,G,"⪆","\\gtrapprox",!0);w(S,P,Ue,"⋗","\\gtrdot");w(S,P,G,"⋙","\\ggg",!0);w(S,P,G,"≷","\\gtrless",!0);w(S,P,G,"⋛","\\gtreqless",!0);w(S,P,G,"⪌","\\gtreqqless",!0);w(S,P,G,"≖","\\eqcirc",!0);w(S,P,G,"≗","\\circeq",!0);w(S,P,G,"≜","\\triangleq",!0);w(S,P,G,"∼","\\thicksim");w(S,P,G,"≈","\\thickapprox");w(S,P,G,"⫆","\\supseteqq",!0);w(S,P,G,"⋑","\\Supset",!0);w(S,P,G,"⊐","\\sqsupset",!0);w(S,P,G,"≽","\\succcurlyeq",!0);w(S,P,G,"⋟","\\curlyeqsucc",!0);w(S,P,G,"≿","\\succsim",!0);w(S,P,G,"⪸","\\succapprox",!0);w(S,P,G,"⊳","\\vartriangleright");w(S,P,G,"⊵","\\trianglerighteq");w(S,P,G,"⊩","\\Vdash",!0);w(S,P,G,"∣","\\shortmid");w(S,P,G,"∥","\\shortparallel");w(S,P,G,"≬","\\between",!0);w(S,P,G,"⋔","\\pitchfork",!0);w(S,P,G,"∝","\\varpropto");w(S,P,G,"◀","\\blacktriangleleft");w(S,P,G,"∴","\\therefore",!0);w(S,P,G,"∍","\\backepsilon");w(S,P,G,"▶","\\blacktriangleright");w(S,P,G,"∵","\\because",!0);w(S,P,G,"⋘","\\llless");w(S,P,G,"⋙","\\gggtr");w(S,P,Ue,"⊲","\\lhd");w(S,P,Ue,"⊳","\\rhd");w(S,P,G,"≂","\\eqsim",!0);w(S,E,G,"⋈","\\Join");w(S,P,G,"≑","\\Doteq",!0);w(S,P,Ue,"∔","\\dotplus",!0);w(S,P,Ue,"∖","\\smallsetminus");w(S,P,Ue,"⋒","\\Cap",!0);w(S,P,Ue,"⋓","\\Cup",!0);w(S,P,Ue,"⩞","\\doublebarwedge",!0);w(S,P,Ue,"⊟","\\boxminus",!0);w(S,P,Ue,"⊞","\\boxplus",!0);w(S,P,Ue,"⋇","\\divideontimes",!0);w(S,P,Ue,"⋉","\\ltimes",!0);w(S,P,Ue,"⋊","\\rtimes",!0);w(S,P,Ue,"⋋","\\leftthreetimes",!0);w(S,P,Ue,"⋌","\\rightthreetimes",!0);w(S,P,Ue,"⋏","\\curlywedge",!0);w(S,P,Ue,"⋎","\\curlyvee",!0);w(S,P,Ue,"⊝","\\circleddash",!0);w(S,P,Ue,"⊛","\\circledast",!0);w(S,P,Ue,"⋅","\\centerdot");w(S,P,Ue,"⊺","\\intercal",!0);w(S,P,Ue,"⋒","\\doublecap");w(S,P,Ue,"⋓","\\doublecup");w(S,P,Ue,"⊠","\\boxtimes",!0);w(S,P,G,"⇢","\\dashrightarrow",!0);w(S,P,G,"⇠","\\dashleftarrow",!0);w(S,P,G,"⇇","\\leftleftarrows",!0);w(S,P,G,"⇆","\\leftrightarrows",!0);w(S,P,G,"⇚","\\Lleftarrow",!0);w(S,P,G,"↞","\\twoheadleftarrow",!0);w(S,P,G,"↢","\\leftarrowtail",!0);w(S,P,G,"↫","\\looparrowleft",!0);w(S,P,G,"⇋","\\leftrightharpoons",!0);w(S,P,G,"↶","\\curvearrowleft",!0);w(S,P,G,"↺","\\circlearrowleft",!0);w(S,P,G,"↰","\\Lsh",!0);w(S,P,G,"⇈","\\upuparrows",!0);w(S,P,G,"↿","\\upharpoonleft",!0);w(S,P,G,"⇃","\\downharpoonleft",!0);w(S,E,G,"⊶","\\origof",!0);w(S,E,G,"⊷","\\imageof",!0);w(S,P,G,"⊸","\\multimap",!0);w(S,P,G,"↭","\\leftrightsquigarrow",!0);w(S,P,G,"⇉","\\rightrightarrows",!0);w(S,P,G,"⇄","\\rightleftarrows",!0);w(S,P,G,"↠","\\twoheadrightarrow",!0);w(S,P,G,"↣","\\rightarrowtail",!0);w(S,P,G,"↬","\\looparrowright",!0);w(S,P,G,"↷","\\curvearrowright",!0);w(S,P,G,"↻","\\circlearrowright",!0);w(S,P,G,"↱","\\Rsh",!0);w(S,P,G,"⇊","\\downdownarrows",!0);w(S,P,G,"↾","\\upharpoonright",!0);w(S,P,G,"⇂","\\downharpoonright",!0);w(S,P,G,"⇝","\\rightsquigarrow",!0);w(S,P,G,"⇝","\\leadsto");w(S,P,G,"⇛","\\Rrightarrow",!0);w(S,P,G,"↾","\\restriction");w(S,E,Z,"‘","`");w(S,E,Z,"$","\\$");w(ke,E,Z,"$","\\$");w(ke,E,Z,"$","\\textdollar");w(S,E,Z,"%","\\%");w(ke,E,Z,"%","\\%");w(S,E,Z,"_","\\_");w(ke,E,Z,"_","\\_");w(ke,E,Z,"_","\\textunderscore");w(S,E,Z,"∠","\\angle",!0);w(S,E,Z,"∞","\\infty",!0);w(S,E,Z,"′","\\prime");w(S,E,Z,"△","\\triangle");w(S,E,Z,"Γ","\\Gamma",!0);w(S,E,Z,"Δ","\\Delta",!0);w(S,E,Z,"Θ","\\Theta",!0);w(S,E,Z,"Λ","\\Lambda",!0);w(S,E,Z,"Ξ","\\Xi",!0);w(S,E,Z,"Π","\\Pi",!0);w(S,E,Z,"Σ","\\Sigma",!0);w(S,E,Z,"Υ","\\Upsilon",!0);w(S,E,Z,"Φ","\\Phi",!0);w(S,E,Z,"Ψ","\\Psi",!0);w(S,E,Z,"Ω","\\Omega",!0);w(S,E,Z,"A","Α");w(S,E,Z,"B","Β");w(S,E,Z,"E","Ε");w(S,E,Z,"Z","Ζ");w(S,E,Z,"H","Η");w(S,E,Z,"I","Ι");w(S,E,Z,"K","Κ");w(S,E,Z,"M","Μ");w(S,E,Z,"N","Ν");w(S,E,Z,"O","Ο");w(S,E,Z,"P","Ρ");w(S,E,Z,"T","Τ");w(S,E,Z,"X","Χ");w(S,E,Z,"¬","\\neg",!0);w(S,E,Z,"¬","\\lnot");w(S,E,Z,"⊤","\\top");w(S,E,Z,"⊥","\\bot");w(S,E,Z,"∅","\\emptyset");w(S,P,Z,"∅","\\varnothing");w(S,E,nt,"α","\\alpha",!0);w(S,E,nt,"β","\\beta",!0);w(S,E,nt,"γ","\\gamma",!0);w(S,E,nt,"δ","\\delta",!0);w(S,E,nt,"ϵ","\\epsilon",!0);w(S,E,nt,"ζ","\\zeta",!0);w(S,E,nt,"η","\\eta",!0);w(S,E,nt,"θ","\\theta",!0);w(S,E,nt,"ι","\\iota",!0);w(S,E,nt,"κ","\\kappa",!0);w(S,E,nt,"λ","\\lambda",!0);w(S,E,nt,"μ","\\mu",!0);w(S,E,nt,"ν","\\nu",!0);w(S,E,nt,"ξ","\\xi",!0);w(S,E,nt,"ο","\\omicron",!0);w(S,E,nt,"π","\\pi",!0);w(S,E,nt,"ρ","\\rho",!0);w(S,E,nt,"σ","\\sigma",!0);w(S,E,nt,"τ","\\tau",!0);w(S,E,nt,"υ","\\upsilon",!0);w(S,E,nt,"ϕ","\\phi",!0);w(S,E,nt,"χ","\\chi",!0);w(S,E,nt,"ψ","\\psi",!0);w(S,E,nt,"ω","\\omega",!0);w(S,E,nt,"ε","\\varepsilon",!0);w(S,E,nt,"ϑ","\\vartheta",!0);w(S,E,nt,"ϖ","\\varpi",!0);w(S,E,nt,"ϱ","\\varrho",!0);w(S,E,nt,"ς","\\varsigma",!0);w(S,E,nt,"φ","\\varphi",!0);w(S,E,Ue,"∗","*",!0);w(S,E,Ue,"+","+");w(S,E,Ue,"−","-",!0);w(S,E,Ue,"⋅","\\cdot",!0);w(S,E,Ue,"∘","\\circ",!0);w(S,E,Ue,"÷","\\div",!0);w(S,E,Ue,"±","\\pm",!0);w(S,E,Ue,"×","\\times",!0);w(S,E,Ue,"∩","\\cap",!0);w(S,E,Ue,"∪","\\cup",!0);w(S,E,Ue,"∖","\\setminus",!0);w(S,E,Ue,"∧","\\land");w(S,E,Ue,"∨","\\lor");w(S,E,Ue,"∧","\\wedge",!0);w(S,E,Ue,"∨","\\vee",!0);w(S,E,Z,"√","\\surd");w(S,E,Pr,"⟨","\\langle",!0);w(S,E,Pr,"∣","\\lvert");w(S,E,Pr,"∥","\\lVert");w(S,E,or,"?","?");w(S,E,or,"!","!");w(S,E,or,"⟩","\\rangle",!0);w(S,E,or,"∣","\\rvert");w(S,E,or,"∥","\\rVert");w(S,E,G,"=","=");w(S,E,G,":",":");w(S,E,G,"≈","\\approx",!0);w(S,E,G,"≅","\\cong",!0);w(S,E,G,"≥","\\ge");w(S,E,G,"≥","\\geq",!0);w(S,E,G,"←","\\gets");w(S,E,G,">","\\gt",!0);w(S,E,G,"∈","\\in",!0);w(S,E,G,"","\\@not");w(S,E,G,"⊂","\\subset",!0);w(S,E,G,"⊃","\\supset",!0);w(S,E,G,"⊆","\\subseteq",!0);w(S,E,G,"⊇","\\supseteq",!0);w(S,P,G,"⊈","\\nsubseteq",!0);w(S,P,G,"⊉","\\nsupseteq",!0);w(S,E,G,"⊨","\\models");w(S,E,G,"←","\\leftarrow",!0);w(S,E,G,"≤","\\le");w(S,E,G,"≤","\\leq",!0);w(S,E,G,"<","\\lt",!0);w(S,E,G,"→","\\rightarrow",!0);w(S,E,G,"→","\\to");w(S,P,G,"≱","\\ngeq",!0);w(S,P,G,"≰","\\nleq",!0);w(S,E,Ui," ","\\ ");w(S,E,Ui," ","\\space");w(S,E,Ui," ","\\nobreakspace");w(ke,E,Ui," ","\\ ");w(ke,E,Ui," "," ");w(ke,E,Ui," ","\\space");w(ke,E,Ui," ","\\nobreakspace");w(S,E,Ui,"","\\nobreak");w(S,E,Ui,"","\\allowbreak");w(S,E,e0,",",",");w(S,E,e0,";",";");w(S,P,Ue,"⊼","\\barwedge",!0);w(S,P,Ue,"⊻","\\veebar",!0);w(S,E,Ue,"⊙","\\odot",!0);w(S,E,Ue,"⊕","\\oplus",!0);w(S,E,Ue,"⊗","\\otimes",!0);w(S,E,Z,"∂","\\partial",!0);w(S,E,Ue,"⊘","\\oslash",!0);w(S,P,Ue,"⊚","\\circledcirc",!0);w(S,P,Ue,"⊡","\\boxdot",!0);w(S,E,Ue,"△","\\bigtriangleup");w(S,E,Ue,"▽","\\bigtriangledown");w(S,E,Ue,"†","\\dagger");w(S,E,Ue,"⋄","\\diamond");w(S,E,Ue,"⋆","\\star");w(S,E,Ue,"◃","\\triangleleft");w(S,E,Ue,"▹","\\triangleright");w(S,E,Pr,"{","\\{");w(ke,E,Z,"{","\\{");w(ke,E,Z,"{","\\textbraceleft");w(S,E,or,"}","\\}");w(ke,E,Z,"}","\\}");w(ke,E,Z,"}","\\textbraceright");w(S,E,Pr,"{","\\lbrace");w(S,E,or,"}","\\rbrace");w(S,E,Pr,"[","\\lbrack",!0);w(ke,E,Z,"[","\\lbrack",!0);w(S,E,or,"]","\\rbrack",!0);w(ke,E,Z,"]","\\rbrack",!0);w(S,E,Pr,"(","\\lparen",!0);w(S,E,or,")","\\rparen",!0);w(ke,E,Z,"<","\\textless",!0);w(ke,E,Z,">","\\textgreater",!0);w(S,E,Pr,"⌊","\\lfloor",!0);w(S,E,or,"⌋","\\rfloor",!0);w(S,E,Pr,"⌈","\\lceil",!0);w(S,E,or,"⌉","\\rceil",!0);w(S,E,Z,"\\","\\backslash");w(S,E,Z,"∣","|");w(S,E,Z,"∣","\\vert");w(ke,E,Z,"|","\\textbar",!0);w(S,E,Z,"∥","\\|");w(S,E,Z,"∥","\\Vert");w(ke,E,Z,"∥","\\textbardbl");w(ke,E,Z,"~","\\textasciitilde");w(ke,E,Z,"\\","\\textbackslash");w(ke,E,Z,"^","\\textasciicircum");w(S,E,G,"↑","\\uparrow",!0);w(S,E,G,"⇑","\\Uparrow",!0);w(S,E,G,"↓","\\downarrow",!0);w(S,E,G,"⇓","\\Downarrow",!0);w(S,E,G,"↕","\\updownarrow",!0);w(S,E,G,"⇕","\\Updownarrow",!0);w(S,E,Mn,"∐","\\coprod");w(S,E,Mn,"⋁","\\bigvee");w(S,E,Mn,"⋀","\\bigwedge");w(S,E,Mn,"⨄","\\biguplus");w(S,E,Mn,"⋂","\\bigcap");w(S,E,Mn,"⋃","\\bigcup");w(S,E,Mn,"∫","\\int");w(S,E,Mn,"∫","\\intop");w(S,E,Mn,"∬","\\iint");w(S,E,Mn,"∭","\\iiint");w(S,E,Mn,"∏","\\prod");w(S,E,Mn,"∑","\\sum");w(S,E,Mn,"⨂","\\bigotimes");w(S,E,Mn,"⨁","\\bigoplus");w(S,E,Mn,"⨀","\\bigodot");w(S,E,Mn,"∮","\\oint");w(S,E,Mn,"∯","\\oiint");w(S,E,Mn,"∰","\\oiiint");w(S,E,Mn,"⨆","\\bigsqcup");w(S,E,Mn,"∫","\\smallint");w(ke,E,lu,"…","\\textellipsis");w(S,E,lu,"…","\\mathellipsis");w(ke,E,lu,"…","\\ldots",!0);w(S,E,lu,"…","\\ldots",!0);w(S,E,lu,"⋯","\\@cdots",!0);w(S,E,lu,"⋱","\\ddots",!0);w(S,E,Z,"⋮","\\varvdots");w(ke,E,Z,"⋮","\\varvdots");w(S,E,sn,"ˊ","\\acute");w(S,E,sn,"ˋ","\\grave");w(S,E,sn,"¨","\\ddot");w(S,E,sn,"~","\\tilde");w(S,E,sn,"ˉ","\\bar");w(S,E,sn,"˘","\\breve");w(S,E,sn,"ˇ","\\check");w(S,E,sn,"^","\\hat");w(S,E,sn,"⃗","\\vec");w(S,E,sn,"˙","\\dot");w(S,E,sn,"˚","\\mathring");w(S,E,nt,"","\\@imath");w(S,E,nt,"","\\@jmath");w(S,E,Z,"ı","ı");w(S,E,Z,"ȷ","ȷ");w(ke,E,Z,"ı","\\i",!0);w(ke,E,Z,"ȷ","\\j",!0);w(ke,E,Z,"ß","\\ss",!0);w(ke,E,Z,"æ","\\ae",!0);w(ke,E,Z,"œ","\\oe",!0);w(ke,E,Z,"ø","\\o",!0);w(ke,E,Z,"Æ","\\AE",!0);w(ke,E,Z,"Œ","\\OE",!0);w(ke,E,Z,"Ø","\\O",!0);w(ke,E,sn,"ˊ","\\'");w(ke,E,sn,"ˋ","\\`");w(ke,E,sn,"ˆ","\\^");w(ke,E,sn,"˜","\\~");w(ke,E,sn,"ˉ","\\=");w(ke,E,sn,"˘","\\u");w(ke,E,sn,"˙","\\.");w(ke,E,sn,"¸","\\c");w(ke,E,sn,"˚","\\r");w(ke,E,sn,"ˇ","\\v");w(ke,E,sn,"¨",'\\"');w(ke,E,sn,"˝","\\H");w(ke,E,sn,"◯","\\textcircled");var Yv={"--":!0,"---":!0,"``":!0,"''":!0};w(ke,E,Z,"–","--",!0);w(ke,E,Z,"–","\\textendash");w(ke,E,Z,"—","---",!0);w(ke,E,Z,"—","\\textemdash");w(ke,E,Z,"‘","`",!0);w(ke,E,Z,"‘","\\textquoteleft");w(ke,E,Z,"’","'",!0);w(ke,E,Z,"’","\\textquoteright");w(ke,E,Z,"“","``",!0);w(ke,E,Z,"“","\\textquotedblleft");w(ke,E,Z,"”","''",!0);w(ke,E,Z,"”","\\textquotedblright");w(S,E,Z,"°","\\degree",!0);w(ke,E,Z,"°","\\degree");w(ke,E,Z,"°","\\textdegree",!0);w(S,E,Z,"£","\\pounds");w(S,E,Z,"£","\\mathsterling",!0);w(ke,E,Z,"£","\\pounds");w(ke,E,Z,"£","\\textsterling",!0);w(S,P,Z,"✠","\\maltese");w(ke,P,Z,"✠","\\maltese");var Gy='0123456789/@."';for(var qm=0;qm<Gy.length;qm++){var Vy=Gy.charAt(qm);w(S,E,Z,Vy,Vy)}var Yy='0123456789!@*()-=+";:?/.,';for(var Um=0;Um<Yy.length;Um++){var Wy=Yy.charAt(Um);w(ke,E,Z,Wy,Wy)}var af="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(var Hm=0;Hm<af.length;Hm++){var Cd=af.charAt(Hm);w(S,E,nt,Cd,Cd),w(ke,E,Z,Cd,Cd)}w(S,P,Z,"C","ℂ");w(ke,P,Z,"C","ℂ");w(S,P,Z,"H","ℍ");w(ke,P,Z,"H","ℍ");w(S,P,Z,"N","ℕ");w(ke,P,Z,"N","ℕ");w(S,P,Z,"P","ℙ");w(ke,P,Z,"P","ℙ");w(S,P,Z,"Q","ℚ");w(ke,P,Z,"Q","ℚ");w(S,P,Z,"R","ℝ");w(ke,P,Z,"R","ℝ");w(S,P,Z,"Z","ℤ");w(ke,P,Z,"Z","ℤ");w(S,E,nt,"h","ℎ");w(ke,E,nt,"h","ℎ");var it;for(var ar=0;ar<af.length;ar++){var mn=af.charAt(ar);it=String.fromCharCode(55349,56320+ar),w(S,E,nt,mn,it),w(ke,E,Z,mn,it),it=String.fromCharCode(55349,56372+ar),w(S,E,nt,mn,it),w(ke,E,Z,mn,it),it=String.fromCharCode(55349,56424+ar),w(S,E,nt,mn,it),w(ke,E,Z,mn,it),it=String.fromCharCode(55349,56580+ar),w(S,E,nt,mn,it),w(ke,E,Z,mn,it),it=String.fromCharCode(55349,56684+ar),w(S,E,nt,mn,it),w(ke,E,Z,mn,it),it=String.fromCharCode(55349,56736+ar),w(S,E,nt,mn,it),w(ke,E,Z,mn,it),it=String.fromCharCode(55349,56788+ar),w(S,E,nt,mn,it),w(ke,E,Z,mn,it),it=String.fromCharCode(55349,56840+ar),w(S,E,nt,mn,it),w(ke,E,Z,mn,it),it=String.fromCharCode(55349,56944+ar),w(S,E,nt,mn,it),w(ke,E,Z,mn,it),ar<26&&(it=String.fromCharCode(55349,56632+ar),w(S,E,nt,mn,it),w(ke,E,Z,mn,it),it=String.fromCharCode(55349,56476+ar),w(S,E,nt,mn,it),w(ke,E,Z,mn,it))}it="𝕜";w(S,E,nt,"k",it);w(ke,E,Z,"k",it);for(var ws=0;ws<10;ws++){var Ml=ws.toString();it=String.fromCharCode(55349,57294+ws),w(S,E,nt,Ml,it),w(ke,E,Z,Ml,it),it=String.fromCharCode(55349,57314+ws),w(S,E,nt,Ml,it),w(ke,E,Z,Ml,it),it=String.fromCharCode(55349,57324+ws),w(S,E,nt,Ml,it),w(ke,E,Z,Ml,it),it=String.fromCharCode(55349,57334+ws),w(S,E,nt,Ml,it),w(ke,E,Z,Ml,it)}var zp="ÐÞþ";for(var $m=0;$m<zp.length;$m++){var Td=zp.charAt($m);w(S,E,nt,Td,Td),w(ke,E,Z,Td,Td)}var Dp={mathClass:"mathbf",textClass:"textbf",font:"Main-Bold"},Ky={mathClass:"mathnormal",textClass:"textit",font:"Math-Italic"},Xy={mathClass:"boldsymbol",textClass:"boldsymbol",font:"Main-BoldItalic"},IC={mathClass:"mathscr",textClass:"textscr",font:"Script-Regular"},Cs={mathClass:"",textClass:"",font:""},Zy={mathClass:"mathfrak",textClass:"textfrak",font:"Fraktur-Regular"},Qy={mathClass:"mathbb",textClass:"textbb",font:"AMS-Regular"},Jy={mathClass:"mathboldfrak",textClass:"textboldfrak",font:"Fraktur-Regular"},Rp={mathClass:"mathsf",textClass:"textsf",font:"SansSerif-Regular"},Op={mathClass:"mathboldsf",textClass:"textboldsf",font:"SansSerif-Bold"},e3={mathClass:"mathitsf",textClass:"textitsf",font:"SansSerif-Italic"},Ip={mathClass:"mathtt",textClass:"texttt",font:"Typewriter-Regular"},t3=[Dp,Dp,Ky,Ky,Xy,Xy,IC,Cs,Cs,Cs,Zy,Zy,Qy,Qy,Jy,Jy,Rp,Rp,Op,Op,e3,e3,Cs,Cs,Ip,Ip],_C=[Dp,Cs,Rp,Op,Ip],LC=e=>{var t=e.charCodeAt(0),n=e.charCodeAt(1),a=(t-55296)*1024+(n-56320)+65536;if(119808<=a&&a<120484){var l=Math.floor((a-119808)/26);return t3[l]}else if(120782<=a&&a<=120831){var o=Math.floor((a-120782)/10);return _C[o]}else{if(a===120485||a===120486)return t3[0];if(120486<a&&a<120782)return Cs;throw new Ee("Unsupported character: "+e)}},bf=function(t,n,a){if(ln[a][t]){var l=ln[a][t].replace;l&&(t=l)}return{value:t,metrics:M1(t,n,a)}},ir=function(t,n,a,l,o){var c=bf(t,n,a),f=c.metrics;t=c.value;var h;if(f){var m=f.italic;(a==="text"||l&&l.font==="mathit")&&(m=0),h=new Fr(t,f.height,f.depth,m,f.skew,f.width,o)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+t+"' in style '"+n+"' and mode '"+a+"'")),h=new Fr(t,0,0,0,0,0,o);if(l){h.maxFontSize=l.sizeMultiplier,l.style.isTight()&&h.classes.push("mtight");var g=l.getColor();g&&(h.style.color=g)}return h},z1=function(t,n,a,l){return l===void 0&&(l=[]),a.font==="boldsymbol"&&bf(t,"Main-Bold",n).metrics?ir(t,"Main-Bold",n,a,l.concat(["mathbf"])):t==="\\"||ln[n][t].font==="main"?ir(t,"Main-Regular",n,a,l):ir(t,"AMS-Regular",n,a,l.concat(["amsrm"]))},BC=function(t,n,a){return a!=="textord"&&bf(t,"Math-BoldItalic",n).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},wf=function(t,n,a){var l=t.mode,o=t.text,c=["mord"],{font:f,fontFamily:h,fontWeight:m,fontShape:g}=n,v=l==="math"||l==="text"&&!!f,k=v?f:h,b="",T="";if(o.charCodeAt(0)===55349){var A=LC(o);b=A.font,T=A[l+"Class"]}if(b)return ir(o,b,l,n,c.concat(T));if(k){var q,z;if(k==="boldsymbol"){var M=BC(o,l,a);q=M.fontName,z=[M.fontClass]}else v?(q=_p[f].fontName,z=[f]):(q=Ad(h,m,g),z=[h,m,g]);if(bf(o,q,l).metrics)return ir(o,q,l,n,c.concat(z));if(Yv.hasOwnProperty(o)&&q.slice(0,10)==="Typewriter"){for(var B=[],U=0;U<o.length;U++)B.push(ir(o[U],q,l,n,c.concat(z)));return Hi(B)}}if(a==="mathord")return ir(o,"Math-Italic",l,n,c.concat(["mathnormal"]));if(a==="textord"){var ae=ln[l][o]&&ln[l][o].font;if(ae==="ams"){var L=Ad("amsrm",m,g);return ir(o,L,l,n,c.concat("amsrm",m,g))}else if(ae==="main"||!ae){var K=Ad("textrm",m,g);return ir(o,K,l,n,c.concat(m,g))}else{var ie=Ad(ae,m,g);return ir(o,ie,l,n,c.concat(ie,m,g))}}else throw new Error("unexpected type: "+a+" in makeOrd")},qC=(e,t)=>{if(Ol(e.classes)!==Ol(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 a of Object.keys(e.style))if(e.style[a]!==t.style[a])return!1;for(var l of Object.keys(t.style))if(e.style[l]!==t.style[l])return!1;return!0},Wv=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],a=e[t+1];n instanceof Fr&&a instanceof Fr&&qC(n,a)&&(n.text+=a.text,n.height=Math.max(n.height,a.height),n.depth=Math.max(n.depth,a.depth),n.italic=a.italic,e.splice(t+1,1),t--)}return e},D1=function(t){for(var n=0,a=0,l=0,o=0;o<t.children.length;o++){var c=t.children[o];c.height>n&&(n=c.height),c.depth>a&&(a=c.depth),c.maxFontSize>l&&(l=c.maxFontSize)}t.height=n,t.depth=a,t.maxFontSize=l},Ce=function(t,n,a,l){var o=new iu(t,n,a,l);return D1(o),o},_l=(e,t,n,a)=>new iu(e,t,n,a),Jo=function(t,n,a){var l=Ce([t],[],n);return l.height=Math.max(a||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),l.style.borderBottomWidth=Re(l.height),l.maxFontSize=1,l},UC=function(t,n,a,l){var o=new xf(t,n,a,l);return D1(o),o},Hi=function(t){var n=new au(t);return D1(n),n},eu=function(t,n){return t instanceof au?Ce([],[t],n):t},HC=function(t){if(t.positionType==="individualShift"){for(var n=t.children,a=[n[0]],l=-n[0].shift-n[0].elem.depth,o=l,c=1;c<n.length;c++){var f=-n[c].shift-o-n[c].elem.depth,h=f-(n[c-1].elem.height+n[c-1].elem.depth);o=o+f,a.push({type:"kern",size:h}),a.push(n[c])}return{children:a,depth:l}}var m;if(t.positionType==="top"){for(var g=t.positionData,v=0;v<t.children.length;v++){var k=t.children[v];g-=k.type==="kern"?k.size:k.elem.height+k.elem.depth}m=g}else if(t.positionType==="bottom")m=-t.positionData;else{var b=t.children[0];if(b.type!=="elem")throw new Error('First child must have type "elem".');if(t.positionType==="shift")m=-b.elem.depth-t.positionData;else if(t.positionType==="firstBaseline")m=-b.elem.depth;else throw new Error("Invalid positionType "+t.positionType+".")}return{children:t.children,depth:m}},Ot=function(t,n){for(var{children:a,depth:l}=HC(t),o=0,c=0;c<a.length;c++){var f=a[c];if(f.type==="elem"){var h=f.elem;o=Math.max(o,h.maxFontSize,h.height)}}o+=2;var m=Ce(["pstrut"],[]);m.style.height=Re(o);for(var g=[],v=l,k=l,b=l,T=0;T<a.length;T++){var A=a[T];if(A.type==="kern")b+=A.size;else{var q=A.elem,z=A.wrapperClasses||[],M=A.wrapperStyle||{},B=Ce(z,[m,q],void 0,M);B.style.top=Re(-o-b-q.depth),A.marginLeft&&(B.style.marginLeft=A.marginLeft),A.marginRight&&(B.style.marginRight=A.marginRight),g.push(B),b+=q.height+q.depth}v=Math.min(v,b),k=Math.max(k,b)}var U=Ce(["vlist"],g);U.style.height=Re(k);var ae;if(v<0){var L=Ce([],[]),K=Ce(["vlist"],[L]);K.style.height=Re(-v);var ie=Ce(["vlist-s"],[new Fr("")]);ae=[Ce(["vlist-r"],[U,ie]),Ce(["vlist-r"],[K])]}else ae=[Ce(["vlist-r"],[U])];var Q=Ce(["vlist-t"],ae);return ae.length===2&&Q.classes.push("vlist-t2"),Q.height=k,Q.depth=-v,Q},Kv=(e,t)=>{var n=Ce(["mspace"],[],t),a=cn(e,t);return n.style.marginRight=Re(a),n},Ad=(e,t,n)=>{var a,l;switch(e){case"amsrm":a="AMS";break;case"textrm":a="Main";break;case"textsf":a="SansSerif";break;case"texttt":a="Typewriter";break;default:a=e}return t==="textbf"&&n==="textit"?l="BoldItalic":t==="textbf"?l="Bold":n==="textit"?l="Italic":l="Regular",a+"-"+l},_p={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"}},Xv={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Zv=function(t,n){var[a,l,o]=Xv[t],c=new Il(a),f=new Li([c],{width:Re(l),height:Re(o),style:"width:"+Re(l),viewBox:"0 0 "+1e3*l+" "+1e3*o,preserveAspectRatio:"xMinYMin"}),h=_l(["overlay"],[f],n);return h.height=o,h.style.height=Re(o),h.style.width=Re(l),h},un={number:3,unit:"mu"},ks={number:4,unit:"mu"},Oi={number:5,unit:"mu"},$C={mord:{mop:un,mbin:ks,mrel:Oi,minner:un},mop:{mord:un,mop:un,mrel:Oi,minner:un},mbin:{mord:ks,mop:ks,mopen:ks,minner:ks},mrel:{mord:Oi,mop:Oi,mopen:Oi,minner:Oi},mopen:{},mclose:{mop:un,mbin:ks,mrel:Oi,minner:un},mpunct:{mord:un,mop:un,mrel:Oi,mopen:un,mclose:un,mpunct:un,minner:un},minner:{mord:un,mop:un,mbin:ks,mrel:Oi,mopen:un,mpunct:un,minner:un}},FC={mord:{mop:un},mop:{mord:un,mop:un},mbin:{},mrel:{},mopen:{},mclose:{mop:un},mpunct:{},minner:{mop:un}},Qv={},lf={},sf={};function Le(e){for(var{type:t,names:n,props:a,handler:l,htmlBuilder:o,mathmlBuilder:c}=e,f={type:t,numArgs:a.numArgs,argTypes:a.argTypes,allowedInArgument:!!a.allowedInArgument,allowedInText:!!a.allowedInText,allowedInMath:a.allowedInMath===void 0?!0:a.allowedInMath,numOptionalArgs:a.numOptionalArgs||0,infix:!!a.infix,primitive:!!a.primitive,handler:l},h=0;h<n.length;++h)Qv[n[h]]=f;t&&(o&&(lf[t]=o),c&&(sf[t]=c))}function _s(e){var{type:t,htmlBuilder:n,mathmlBuilder:a}=e;Le({type:t,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:a})}var of=function(t){return t.type==="ordgroup"&&t.body.length===1?t.body[0]:t},En=function(t){return t.type==="ordgroup"?t.body:[t]},PC=new Set(["leftmost","mbin","mopen","mrel","mop","mpunct"]),GC=new Set(["rightmost","mrel","mclose","mpunct"]),VC={display:st.DISPLAY,text:st.TEXT,script:st.SCRIPT,scriptscript:st.SCRIPTSCRIPT},YC={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},_n=function(t,n,a,l){l===void 0&&(l=[null,null]);for(var o=[],c=0;c<t.length;c++){var f=It(t[c],n);if(f instanceof au){var h=f.children;o.push(...h)}else o.push(f)}if(Wv(o),!a)return o;var m=n;if(t.length===1){var g=t[0];g.type==="sizing"?m=n.havingSize(g.size):g.type==="styling"&&(m=n.havingStyle(VC[g.style]))}var v=Ce([l[0]||"leftmost"],[],n),k=Ce([l[1]||"rightmost"],[],n),b=a==="root";return Lp(o,(T,A)=>{var q=A.classes[0],z=T.classes[0];q==="mbin"&&GC.has(z)?A.classes[0]="mord":z==="mbin"&&PC.has(q)&&(T.classes[0]="mord")},{node:v},k,b),Lp(o,(T,A)=>{var q,z,M=qp(A),B=qp(T),U=M&&B?T.hasClass("mtight")?(q=FC[M])==null?void 0:q[B]:(z=$C[M])==null?void 0:z[B]:null;if(U)return Kv(U,m)},{node:v},k,b),o},Lp=function(t,n,a,l,o){l&&t.push(l);for(var c=0;c<t.length;c++){var f=t[c],h=Jv(f);if(h){Lp(h.children,n,a,null,o);continue}var m=!f.hasClass("mspace");if(m){var g=n(f,a.node);g&&(a.insertAfter?a.insertAfter(g):(t.unshift(g),c++))}m?a.node=f:o&&f.hasClass("newline")&&(a.node=Ce(["leftmost"])),a.insertAfter=(v=>k=>{t.splice(v+1,0,k),c++})(c)}l&&t.pop()},Jv=function(t){return t instanceof au||t instanceof xf||t instanceof iu&&t.hasClass("enclosing")?t:null},Bp=function(t,n){var a=Jv(t);if(a){var l=a.children;if(l.length){if(n==="right")return Bp(l[l.length-1],"right");if(n==="left")return Bp(l[0],"left")}}return t},qp=function(t,n){if(!t)return null;n&&(t=Bp(t,n));var a=t.classes[0];return YC[a]||null},Yc=function(t,n){var a=["nulldelimiter"].concat(t.baseSizingClasses());return Ce(n.concat(a))},It=function(t,n,a){if(!t)return Ce();if(lf[t.type]){var l=lf[t.type](t,n);if(a&&n.size!==a.size){l=Ce(n.sizingClasses(a),[l],n);var o=n.sizeMultiplier/a.sizeMultiplier;l.height*=o,l.depth*=o}return l}else throw new Ee("Got group of unknown type: '"+t.type+"'")};function Ed(e,t){var n=Ce(["base"],e,t),a=Ce(["strut"]);return a.style.height=Re(n.height+n.depth),n.depth&&(a.style.verticalAlign=Re(-n.depth)),n.children.unshift(a),n}function Up(e,t){var n=null;e.length===1&&e[0].type==="tag"&&(n=e[0].tag,e=e[0].body);var a=_n(e,t,"root"),l;a.length===2&&a[1].hasClass("tag")&&(l=a.pop());for(var o=[],c=[],f=0;f<a.length;f++)if(c.push(a[f]),a[f].hasClass("mbin")||a[f].hasClass("mrel")||a[f].hasClass("allowbreak")){for(var h=!1;f<a.length-1&&a[f+1].hasClass("mspace")&&!a[f+1].hasClass("newline");)f++,c.push(a[f]),a[f].hasClass("nobreak")&&(h=!0);h||(o.push(Ed(c,t)),c=[])}else a[f].hasClass("newline")&&(c.pop(),c.length>0&&(o.push(Ed(c,t)),c=[]),o.push(a[f]));c.length>0&&o.push(Ed(c,t));var m;n?(m=Ed(_n(n,t,!0),t),m.classes=["tag"],o.push(m)):l&&o.push(l);var g=Ce(["katex-html"],o);if(g.setAttribute("aria-hidden","true"),m){var v=m.children[0];v.style.height=Re(g.height+g.depth),g.depth&&(v.style.verticalAlign=Re(-g.depth))}return g}function e6(e){return new au(e)}class Me{constructor(t,n,a){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=t,this.attributes={},this.children=n||[],this.classes=a||[]}setAttribute(t,n){this.attributes[t]=n}getAttribute(t){return this.attributes[t]}toNode(){var t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);this.classes.length>0&&(t.className=Ol(this.classes));for(var a=0;a<this.children.length;a++)if(this.children[a]instanceof Nn&&this.children[a+1]instanceof Nn){for(var l=this.children[a].toText()+this.children[++a].toText();this.children[a+1]instanceof Nn;)l+=this.children[++a].toText();t.appendChild(new Nn(l).toNode())}else t.appendChild(this.children[a].toNode());return t}toMarkup(){var t="<"+this.type;for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(t+=" "+n+'="',t+=Qn(this.attributes[n]),t+='"');this.classes.length>0&&(t+=' class ="'+Qn(Ol(this.classes))+'"'),t+=">";for(var a=0;a<this.children.length;a++)t+=this.children[a].toMarkup();return t+="</"+this.type+">",t}toText(){return this.children.map(t=>t.toText()).join("")}}class Nn{constructor(t){this.text=void 0,this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return Qn(this.toText())}toText(){return this.text}}class t6{constructor(t){this.width=void 0,this.character=void 0,this.width=t,t>=.05555&&t<=.05556?this.character=" ":t>=.1666&&t<=.1667?this.character=" ":t>=.2222&&t<=.2223?this.character=" ":t>=.2777&&t<=.2778?this.character=" ":t>=-.05556&&t<=-.05555?this.character=" ":t>=-.1667&&t<=-.1666?this.character=" ":t>=-.2223&&t<=-.2222?this.character=" ":t>=-.2778&&t<=-.2777?this.character=" ":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var t=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return t.setAttribute("width",Re(this.width)),t}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+Re(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var WC=new Set(["\\imath","\\jmath"]),KC=new Set(["mrow","mtable"]),la=function(t,n,a){return ln[n][t]&&ln[n][t].replace&&t.charCodeAt(0)!==55349&&!(Yv.hasOwnProperty(t)&&a&&(a.fontFamily&&a.fontFamily.slice(4,6)==="tt"||a.font&&a.font.slice(4,6)==="tt"))&&(t=ln[n][t].replace),new Nn(t)},R1=function(t){return t.length===1?t[0]:new Me("mrow",t)},XC={mathit:"italic",boldsymbol:e=>e.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},O1=(e,t)=>{if(e.mode==="text"){if(t.fontFamily==="texttt")return"monospace";if(t.fontFamily==="textsf")return t.fontShape==="textit"&&t.fontWeight==="textbf"?"sans-serif-bold-italic":t.fontShape==="textit"?"sans-serif-italic":t.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";if(t.fontShape==="textit")return"italic";if(t.fontWeight==="textbf")return"bold"}var n=t.font;if(!n||n==="mathnormal")return null;var a=e.mode,l=XC[n];if(l)return typeof l=="function"?l(e):l;var o=e.text;if(WC.has(o))return null;if(ln[a][o]){var c=ln[a][o].replace;c&&(o=c)}var f=_p[n].fontName;return M1(o,f,a)?_p[n].variant:null};function Fm(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var t=e.children[0];return t instanceof Nn&&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 Nn&&n.text===","}else return!1}var Gr=function(t,n,a){if(t.length===1){var l=Qt(t[0],n);return a&&l instanceof Me&&l.type==="mo"&&(l.setAttribute("lspace","0em"),l.setAttribute("rspace","0em")),[l]}for(var o=[],c,f=0;f<t.length;f++){var h=Qt(t[f],n);if(h instanceof Me&&c instanceof Me){if(h.type==="mtext"&&c.type==="mtext"&&h.getAttribute("mathvariant")===c.getAttribute("mathvariant")){c.children.push(...h.children);continue}else if(h.type==="mn"&&c.type==="mn"){c.children.push(...h.children);continue}else if(Fm(h)&&c.type==="mn"){c.children.push(...h.children);continue}else if(h.type==="mn"&&Fm(c))h.children=[...c.children,...h.children],o.pop();else if((h.type==="msup"||h.type==="msub")&&h.children.length>=1&&(c.type==="mn"||Fm(c))){var m=h.children[0];m instanceof Me&&m.type==="mn"&&(m.children=[...c.children,...m.children],o.pop())}else if(c.type==="mi"&&c.children.length===1){var g=c.children[0];if(g instanceof Nn&&g.text==="̸"&&(h.type==="mo"||h.type==="mi"||h.type==="mn")){var v=h.children[0];v instanceof Nn&&v.text.length>0&&(v.text=v.text.slice(0,1)+"̸"+v.text.slice(1),o.pop())}}}o.push(h),c=h}return o},Ll=function(t,n,a){return R1(Gr(t,n,a))},Qt=function(t,n){if(!t)return new Me("mrow");if(sf[t.type])return sf[t.type](t,n);throw new Ee("Got group of unknown type: '"+t.type+"'")};function n3(e,t,n,a,l){var o=Gr(e,n),c;o.length===1&&o[0]instanceof Me&&KC.has(o[0].type)?c=o[0]:c=new Me("mrow",o);var f=new Me("annotation",[new Nn(t)]);f.setAttribute("encoding","application/x-tex");var h=new Me("semantics",[c,f]),m=new Me("math",[h]);m.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),a&&m.setAttribute("display","block");var g=l?"katex":"katex-mathml";return Ce([g],[m])}var ZC=[[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]],r3=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],a3=function(t,n){return n.size<2?t:ZC[t-1][n.size-1]};class Ii{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||Ii.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=r3[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 Ii(n)}havingStyle(t){return this.style===t?this:this.extend({style:t,size:a3(this.textSize,t)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(t){return this.size===t&&this.textSize===t?this:this.extend({style:this.style.text(),size:t,textSize:t,sizeMultiplier:r3[t-1]})}havingBaseStyle(t){t=t||this.style.text();var n=a3(Ii.BASESIZE,t);return this.size===n&&this.textSize===Ii.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var t;switch(this.style.id){case 4:case 5:t=3;break;case 6:case 7:t=1;break;default:t=6}return this.extend({style:this.style.text(),size:t})}withColor(t){return this.extend({color:t})}withPhantom(){return this.extend({phantom:!0})}withFont(t){return this.extend({font:t})}withTextFontFamily(t){return this.extend({fontFamily:t,font:""})}withTextFontWeight(t){return this.extend({fontWeight:t,font:""})}withTextFontShape(t){return this.extend({fontShape:t,font:""})}sizingClasses(t){return t.size!==this.size?["sizing","reset-size"+t.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Ii.BASESIZE?["sizing","reset-size"+this.size,"size"+Ii.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=OC(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Ii.BASESIZE=6;var n6=function(t){return new Ii({style:t.displayMode?st.DISPLAY:st.TEXT,maxSize:t.maxSize,minRuleThickness:t.minRuleThickness})},r6=function(t,n){if(n.displayMode){var a=["katex-display"];n.leqno&&a.push("leqno"),n.fleqn&&a.push("fleqn"),t=Ce(a,[t])}return t},QC=function(t,n,a){var l=n6(a),o;if(a.output==="mathml")return n3(t,n,l,a.displayMode,!0);if(a.output==="html"){var c=Up(t,l);o=Ce(["katex"],[c])}else{var f=n3(t,n,l,a.displayMode,!1),h=Up(t,l);o=Ce(["katex"],[f,h])}return r6(o,a)},JC=function(t,n,a){var l=n6(a),o=Up(t,l),c=Ce(["katex"],[o]);return r6(c,a)},eT={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":"="},kf=function(t){var n=new Me("mo",[new Nn(eT[t.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},tT={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]},nT=new Set(["widehat","widecheck","widetilde","utilde"]),Sf=function(t,n){function a(){var f=4e5,h=t.label.slice(1);if(nT.has(h)&&"base"in t){var m=t.base.type==="ordgroup"?t.base.body.length:1,g,v,k;if(m>5)h==="widehat"||h==="widecheck"?(g=420,f=2364,k=.42,v=h+"4"):(g=312,f=2340,k=.34,v="tilde4");else{var b=[1,1,2,2,3,3][m];h==="widehat"||h==="widecheck"?(f=[0,1062,2364,2364,2364][b],g=[0,239,300,360,420][b],k=[0,.24,.3,.3,.36,.42][b],v=h+b):(f=[0,600,1033,2339,2340][b],g=[0,260,286,306,312][b],k=[0,.26,.286,.3,.306,.34][b],v="tilde"+b)}var T=new Il(v),A=new Li([T],{width:"100%",height:Re(k),viewBox:"0 0 "+f+" "+g,preserveAspectRatio:"none"});return{span:_l([],[A],n),minWidth:0,height:k}}else{var q=[],z=tT[h];if(!z)throw new Error('No SVG data for "'+h+'".');var[M,B,U]=z,ae=U/1e3,L=M.length,K,ie;if(L===1){if(z.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+h+'".');K=["hide-tail"],ie=[z[3]]}else if(L===2)K=["halfarrow-left","halfarrow-right"],ie=["xMinYMin","xMaxYMin"];else if(L===3)K=["brace-left","brace-center","brace-right"],ie=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
|
|
333
|
-
`+L+" children.");for(var Q=0;Q<L;Q++){var F=new Il(M[Q]),he=new Li([F],{width:"400em",height:Re(ae),viewBox:"0 0 "+f+" "+U,preserveAspectRatio:ie[Q]+" slice"}),ce=_l([K[Q]],[he],n);if(L===1)return{span:ce,minWidth:B,height:ae};ce.style.height=Re(ae),q.push(ce)}return{span:Ce(["stretchy"],q,n),minWidth:B,height:ae}}}var{span:l,minWidth:o,height:c}=a();return l.height=c,l.style.height=Re(c),o>0&&(l.style.minWidth=Re(o)),l},rT=function(t,n,a,l,o){var c,f=t.height+t.depth+a+l;if(/fbox|color|angl/.test(n)){if(c=Ce(["stretchy",n],[],o),n==="fbox"){var h=o.color&&o.getColor();h&&(c.style.borderColor=h)}}else{var m=[];/^[bx]cancel$/.test(n)&&m.push(new Mp({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&m.push(new Mp({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var g=new Li(m,{width:"100%",height:Re(f)});c=_l([],[g],o)}return c.height=f,c.style.height=Re(f),c},aT={bin:1,close:1,inner:1,open:1,punct:1,rel:1},iT={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function lT(e){return e in aT}function ft(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function jf(e){var t=Cf(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function Cf(e){return e&&(e.type==="atom"||iT.hasOwnProperty(e.type))?e:null}var a6=e=>{if(e instanceof Fr)return e;if(RC(e)&&e.children.length===1)return a6(e.children[0])},I1=(e,t)=>{var n,a,l;e&&e.type==="supsub"?(a=ft(e.base,"accent"),n=a.base,e.base=n,l=DC(It(e,t)),e.base=a):(a=ft(e,"accent"),n=a.base);var o=It(n,t.havingCrampedStyle()),c=a.isShifty&&qi(n),f=0;if(c){var h,m;f=(h=(m=a6(o))==null?void 0:m.skew)!=null?h:0}var g=a.label==="\\c",v=g?o.height+o.depth:Math.min(o.height,t.fontMetrics().xHeight),k;if(a.isStretchy)k=Sf(a,t),k=Ot({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"elem",elem:k,wrapperClasses:["svg-align"],wrapperStyle:f>0?{width:"calc(100% - "+Re(2*f)+")",marginLeft:Re(2*f)}:void 0}]});else{var b,T;a.label==="\\vec"?(b=Zv("vec",t),T=Xv.vec[1]):(b=wf({mode:a.mode,text:a.label},t,"textord"),b=zC(b),b.italic=0,T=b.width,g&&(v+=b.depth)),k=Ce(["accent-body"],[b]);var A=a.label==="\\textcircled";A&&(k.classes.push("accent-full"),v=o.height);var q=f;A||(q-=T/2),k.style.left=Re(q),a.label==="\\textcircled"&&(k.style.top=".2em"),k=Ot({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:-v},{type:"elem",elem:k}]})}var z=Ce(["mord","accent"],[k],t);return l?(l.children[0]=z,l.height=Math.max(z.height,l.height),l.classes[0]="mord",l):z},i6=(e,t)=>{var n=e.isStretchy?kf(e.label):new Me("mo",[la(e.label,e.mode)]),a=new Me("mover",[Qt(e.base,t),n]);return a.setAttribute("accent","true"),a},sT=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));Le({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=of(t[0]),a=!sT.test(e.funcName),l=!a||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:a,isShifty:l,base:n}},htmlBuilder:I1,mathmlBuilder:i6});Le({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],a=e.parser.mode;return a==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),a="text"),{type:"accent",mode:a,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:I1,mathmlBuilder:i6});Le({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=t[0];return{type:"accentUnder",mode:n.mode,label:a,base:l}},htmlBuilder:(e,t)=>{var n=It(e.base,t),a=Sf(e,t),l=e.label==="\\utilde"?.12:0,o=Ot({positionType:"top",positionData:n.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:l},{type:"elem",elem:n}]});return Ce(["mord","accentunder"],[o],t)},mathmlBuilder:(e,t)=>{var n=kf(e.label),a=new Me("munder",[Qt(e.base,t),n]);return a.setAttribute("accentunder","true"),a}});var Nd=e=>{var t=new Me("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};Le({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:a,funcName:l}=e;return{type:"xArrow",mode:a.mode,label:l,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,a=t.havingStyle(n.sup()),l=eu(It(e.body,a,t),t),o=e.label.slice(0,2)==="\\x"?"x":"cd";l.classes.push(o+"-arrow-pad");var c;e.below&&(a=t.havingStyle(n.sub()),c=eu(It(e.below,a,t),t),c.classes.push(o+"-arrow-pad"));var f=Sf(e,t),h=-t.fontMetrics().axisHeight+.5*f.height,m=-t.fontMetrics().axisHeight-.5*f.height-.111;(l.depth>.25||e.label==="\\xleftequilibrium")&&(m-=l.depth);var g;if(c){var v=-t.fontMetrics().axisHeight+c.height+.5*f.height+.111;g=Ot({positionType:"individualShift",children:[{type:"elem",elem:l,shift:m},{type:"elem",elem:f,shift:h,wrapperClasses:["svg-align"]},{type:"elem",elem:c,shift:v}]})}else g=Ot({positionType:"individualShift",children:[{type:"elem",elem:l,shift:m},{type:"elem",elem:f,shift:h,wrapperClasses:["svg-align"]}]});return Ce(["mrel","x-arrow"],[g],t)},mathmlBuilder(e,t){var n=kf(e.label);n.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var a;if(e.body){var l=Nd(Qt(e.body,t));if(e.below){var o=Nd(Qt(e.below,t));a=new Me("munderover",[n,o,l])}else a=new Me("mover",[n,l])}else if(e.below){var c=Nd(Qt(e.below,t));a=new Me("munder",[n,c])}else a=Nd(),a=new Me("mover",[n,a]);return a}});function l6(e,t){var n=_n(e.body,t,!0);return Ce([e.mclass],n,t)}function s6(e,t){var n,a=Gr(e.body,t);return e.mclass==="minner"?n=new Me("mpadded",a):e.mclass==="mord"?e.isCharacterBox?(n=a[0],n.type="mi"):n=new Me("mi",a):(e.isCharacterBox?(n=a[0],n.type="mo"):n=new Me("mo",a),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}Le({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:a}=e,l=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+a.slice(5),body:En(l),isCharacterBox:qi(l)}},htmlBuilder:l6,mathmlBuilder:s6});var Tf=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"};Le({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:Tf(t[0]),body:En(t[1]),isCharacterBox:qi(t[1])}}});Le({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var{parser:n,funcName:a}=e,l=t[1],o=t[0],c;a!=="\\stackrel"?c=Tf(l):c="mrel";var f={type:"op",mode:l.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:a!=="\\stackrel",body:En(l)},h={type:"supsub",mode:o.mode,base:f,sup:a==="\\underset"?null:o,sub:a==="\\underset"?o:null};return{type:"mclass",mode:n.mode,mclass:c,body:[h],isCharacterBox:qi(h)}},htmlBuilder:l6,mathmlBuilder:s6});Le({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:Tf(t[0]),body:En(t[0])}},htmlBuilder(e,t){var n=_n(e.body,t,!0),a=Ce([e.mclass],n,t);return a.style.textShadow="0.02em 0.01em 0.04px",a},mathmlBuilder(e,t){var n=Gr(e.body,t),a=new Me("mstyle",n);return a.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),a}});var oT={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},i3=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),l3=e=>e.type==="textord"&&e.text==="@",uT=(e,t)=>(e.type==="mathord"||e.type==="atom")&&e.text===t;function cT(e,t,n){var a=oT[e];switch(a){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(a,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{var l=n.callFunction("\\\\cdleft",[t[0]],[]),o={type:"atom",text:a,mode:"math",family:"rel"},c=n.callFunction("\\Big",[o],[]),f=n.callFunction("\\\\cdright",[t[1]],[]),h={type:"ordgroup",mode:"math",body:[l,c,f]};return n.callFunction("\\\\cdparent",[h],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var m={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[m],[])}default:return{type:"textord",text:" ",mode:"math"}}}function dT(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 Ee("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var a=[],l=[a],o=0;o<t.length;o++){for(var c=t[o],f=i3(),h=0;h<c.length;h++)if(!l3(c[h]))f.body.push(c[h]);else{a.push(f),h+=1;var m=jf(c[h]).text,g=new Array(2);if(g[0]={type:"ordgroup",mode:"math",body:[]},g[1]={type:"ordgroup",mode:"math",body:[]},!"=|.".includes(m))if("<>AV".includes(m))for(var v=0;v<2;v++){for(var k=!0,b=h+1;b<c.length;b++){if(uT(c[b],m)){k=!1,h=b;break}if(l3(c[b]))throw new Ee("Missing a "+m+" character to complete a CD arrow.",c[b]);g[v].body.push(c[b])}if(k)throw new Ee("Missing a "+m+" character to complete a CD arrow.",c[h])}else throw new Ee('Expected one of "<>AV=|." after @',c[h]);var T=cT(m,g,e),A={type:"styling",body:[T],mode:"math",style:"display",resetFont:!0};a.push(A),f=i3()}o%2===0?a.push(f):a.shift(),a=[],l.push(a)}e.gullet.endGroup(),e.gullet.endGroup();var q=new Array(l[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:l,arraystretch:1,addJot:!0,rowGaps:[null],cols:q,colSeparationType:"CD",hLinesBeforeRow:new Array(l.length+1).fill([])}}Le({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:a}=e;return{type:"cdlabel",mode:n.mode,side:a.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),a=eu(It(e.label,n,t),t);return a.classes.push("cd-label-"+e.side),a.style.bottom=Re(.8-a.depth),a.height=0,a.depth=0,a},mathmlBuilder(e,t){var n=new Me("mrow",[Qt(e.label,t)]);return n=new Me("mpadded",[n]),n.setAttribute("width","0"),e.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new Me("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});Le({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=eu(It(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(e,t){return new Me("mrow",[Qt(e.fragment,t)])}});Le({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,a=ft(t[0],"ordgroup"),l=a.body,o="",c=0;c<l.length;c++){var f=ft(l[c],"textord");o+=f.text}var h=parseInt(o),m;if(isNaN(h))throw new Ee("\\@char has non-numeric argument "+o);if(h<0||h>=1114111)throw new Ee("\\@char with invalid code point "+o);return h<=65535?m=String.fromCharCode(h):(h-=65536,m=String.fromCharCode((h>>10)+55296,(h&1023)+56320)),{type:"textord",mode:n.mode,text:m}}});var o6=(e,t)=>{var n=_n(e.body,t.withColor(e.color),!1);return Hi(n)},u6=(e,t)=>{var n=Gr(e.body,t.withColor(e.color)),a=new Me("mstyle",n);return a.setAttribute("mathcolor",e.color),a};Le({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,a=ft(t[0],"color-token").color,l=t[1];return{type:"color",mode:n.mode,color:a,body:En(l)}},htmlBuilder:o6,mathmlBuilder:u6});Le({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:a}=e,l=ft(t[0],"color-token").color;n.gullet.macros.set("\\current@color",l);var o=n.parseExpression(!0,a);return{type:"color",mode:n.mode,color:l,body:o}},htmlBuilder:o6,mathmlBuilder:u6});Le({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:a}=e,l=a.gullet.future().text==="["?a.parseSizeGroup(!0):null,o=!a.settings.displayMode||!a.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:a.mode,newLine:o,size:l&&ft(l,"size").value}},htmlBuilder(e,t){var n=Ce(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=Re(cn(e.size,t)))),n},mathmlBuilder(e,t){var n=new Me("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",Re(cn(e.size,t)))),n}});var Hp={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},c6=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new Ee("Expected a control sequence",e);return t},fT=e=>{var t=e.gullet.popToken();return t.text==="="&&(t=e.gullet.popToken(),t.text===" "&&(t=e.gullet.popToken())),t},d6=(e,t,n,a)=>{var l=e.gullet.macros.get(n.text);l==null&&(n.noexpand=!0,l={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,l,a)};Le({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var a=t.fetch();if(Hp[a.text])return(n==="\\global"||n==="\\\\globallong")&&(a.text=Hp[a.text]),ft(t.parseFunction(),"internal");throw new Ee("Invalid token after macro prefix",a)}});Le({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,a=t.gullet.popToken(),l=a.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(l))throw new Ee("Expected a control sequence",a);for(var o=0,c,f=[[]];t.gullet.future().text!=="{";)if(a=t.gullet.popToken(),a.text==="#"){if(t.gullet.future().text==="{"){c=t.gullet.future(),f[o].push("{");break}if(a=t.gullet.popToken(),!/^[1-9]$/.test(a.text))throw new Ee('Invalid argument number "'+a.text+'"');if(parseInt(a.text)!==o+1)throw new Ee('Argument number "'+a.text+'" out of order');o++,f.push([])}else{if(a.text==="EOF")throw new Ee("Expected a macro definition");f[o].push(a.text)}var{tokens:h}=t.gullet.consumeArg();return c&&h.unshift(c),(n==="\\edef"||n==="\\xdef")&&(h=t.gullet.expandTokens(h),h.reverse()),t.gullet.macros.set(l,{tokens:h,numArgs:o,delimiters:f},n===Hp[n]),{type:"internal",mode:t.mode}}});Le({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,a=c6(t.gullet.popToken());t.gullet.consumeSpaces();var l=fT(t);return d6(t,a,l,n==="\\\\globallet"),{type:"internal",mode:t.mode}}});Le({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,a=c6(t.gullet.popToken()),l=t.gullet.popToken(),o=t.gullet.popToken();return d6(t,a,o,n==="\\\\globalfuture"),t.gullet.pushToken(o),t.gullet.pushToken(l),{type:"internal",mode:t.mode}}});var Mc=function(t,n,a){var l=ln.math[t]&&ln.math[t].replace,o=M1(l||t,n,a);if(!o)throw new Error("Unsupported symbol "+t+" and font size "+n+".");return o},_1=function(t,n,a,l){var o=a.havingBaseStyle(n),c=Ce(l.concat(o.sizingClasses(a)),[t],a),f=o.sizeMultiplier/a.sizeMultiplier;return c.height*=f,c.depth*=f,c.maxFontSize=o.sizeMultiplier,c},f6=function(t,n,a){var l=n.havingBaseStyle(a),o=(1-n.sizeMultiplier/l.sizeMultiplier)*n.fontMetrics().axisHeight;t.classes.push("delimcenter"),t.style.top=Re(o),t.height-=o,t.depth+=o},hT=function(t,n,a,l,o,c){var f=ir(t,"Main-Regular",o,l),h=_1(f,n,l,c);return f6(h,l,n),h},mT=function(t,n,a,l){return ir(t,"Size"+n+"-Regular",a,l)},h6=function(t,n,a,l,o,c){var f=mT(t,n,o,l),h=_1(Ce(["delimsizing","size"+n],[f],l),st.TEXT,l,c);return a&&f6(h,l,st.TEXT),h},Pm=function(t,n,a){var l;n==="Size1-Regular"?l="delim-size1":l="delim-size4";var o=Ce(["delimsizinginner",l],[Ce([],[ir(t,n,a)])]);return{type:"elem",elem:o}},Gm=function(t,n,a){var l=Za["Size4-Regular"][t.charCodeAt(0)]?Za["Size4-Regular"][t.charCodeAt(0)][4]:Za["Size1-Regular"][t.charCodeAt(0)][4],o=new Il("inner",jC(t,Math.round(1e3*n))),c=new Li([o],{width:Re(l),height:Re(n),style:"width:"+Re(l),viewBox:"0 0 "+1e3*l+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),f=_l([],[c],a);return f.height=n,f.style.height=Re(n),f.style.width=Re(l),{type:"elem",elem:f}},$p=.008,Md={type:"kern",size:-1*$p},pT=new Set(["|","\\lvert","\\rvert","\\vert"]),gT=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),m6=function(t,n,a,l,o,c){var f,h,m,g,v="",k=0;f=m=g=t,h=null;var b="Size1-Regular";t==="\\uparrow"?m=g="⏐":t==="\\Uparrow"?m=g="‖":t==="\\downarrow"?f=m="⏐":t==="\\Downarrow"?f=m="‖":t==="\\updownarrow"?(f="\\uparrow",m="⏐",g="\\downarrow"):t==="\\Updownarrow"?(f="\\Uparrow",m="‖",g="\\Downarrow"):pT.has(t)?(m="∣",v="vert",k=333):gT.has(t)?(m="∥",v="doublevert",k=556):t==="["||t==="\\lbrack"?(f="⎡",m="⎢",g="⎣",b="Size4-Regular",v="lbrack",k=667):t==="]"||t==="\\rbrack"?(f="⎤",m="⎥",g="⎦",b="Size4-Regular",v="rbrack",k=667):t==="\\lfloor"||t==="⌊"?(m=f="⎢",g="⎣",b="Size4-Regular",v="lfloor",k=667):t==="\\lceil"||t==="⌈"?(f="⎡",m=g="⎢",b="Size4-Regular",v="lceil",k=667):t==="\\rfloor"||t==="⌋"?(m=f="⎥",g="⎦",b="Size4-Regular",v="rfloor",k=667):t==="\\rceil"||t==="⌉"?(f="⎤",m=g="⎥",b="Size4-Regular",v="rceil",k=667):t==="("||t==="\\lparen"?(f="⎛",m="⎜",g="⎝",b="Size4-Regular",v="lparen",k=875):t===")"||t==="\\rparen"?(f="⎞",m="⎟",g="⎠",b="Size4-Regular",v="rparen",k=875):t==="\\{"||t==="\\lbrace"?(f="⎧",h="⎨",g="⎩",m="⎪",b="Size4-Regular"):t==="\\}"||t==="\\rbrace"?(f="⎫",h="⎬",g="⎭",m="⎪",b="Size4-Regular"):t==="\\lgroup"||t==="⟮"?(f="⎧",g="⎩",m="⎪",b="Size4-Regular"):t==="\\rgroup"||t==="⟯"?(f="⎫",g="⎭",m="⎪",b="Size4-Regular"):t==="\\lmoustache"||t==="⎰"?(f="⎧",g="⎭",m="⎪",b="Size4-Regular"):(t==="\\rmoustache"||t==="⎱")&&(f="⎫",g="⎩",m="⎪",b="Size4-Regular");var T=Mc(f,b,o),A=T.height+T.depth,q=Mc(m,b,o),z=q.height+q.depth,M=Mc(g,b,o),B=M.height+M.depth,U=0,ae=1;if(h!==null){var L=Mc(h,b,o);U=L.height+L.depth,ae=2}var K=A+B+U,ie=Math.max(0,Math.ceil((n-K)/(ae*z))),Q=K+ie*ae*z,F=l.fontMetrics().axisHeight;a&&(F*=l.sizeMultiplier);var he=Q/2-F,ce=[];if(v.length>0){var Ie=Q-A-B,be=Math.round(Q*1e3),pe=CC(v,Math.round(Ie*1e3)),J=new Il(v,pe),Y=Re(k/1e3),ge=Re(be/1e3),Te=new Li([J],{width:Y,height:ge,viewBox:"0 0 "+k+" "+be}),H=_l([],[Te],l);H.height=be/1e3,H.style.width=Y,H.style.height=ge,ce.push({type:"elem",elem:H})}else{if(ce.push(Pm(g,b,o)),ce.push(Md),h===null){var _=Q-A-B+2*$p;ce.push(Gm(m,_,l))}else{var te=(Q-A-B-U)/2+2*$p;ce.push(Gm(m,te,l)),ce.push(Md),ce.push(Pm(h,b,o)),ce.push(Md),ce.push(Gm(m,te,l))}ce.push(Md),ce.push(Pm(f,b,o))}var O=l.havingBaseStyle(st.TEXT),ee=Ot({positionType:"bottom",positionData:he,children:ce});return _1(Ce(["delimsizing","mult"],[ee],O),st.TEXT,l,c)},Vm=80,Ym=.08,Wm=function(t,n,a,l,o){var c=SC(t,l,a),f=new Il(t,c),h=new Li([f],{width:"400em",height:Re(n),viewBox:"0 0 400000 "+a,preserveAspectRatio:"xMinYMin slice"});return _l(["hide-tail"],[h],o)},yT=function(t,n){var a=n.havingBaseSizing(),l=x6("\\surd",t*a.sizeMultiplier,v6,a),o=a.sizeMultiplier,c=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),f,h,m,g,v;return l.type==="small"?(g=1e3+1e3*c+Vm,t<1?o=1:t<1.4&&(o=.7),h=(1+c+Ym)/o,m=(1+c)/o,f=Wm("sqrtMain",h,g,c,n),f.style.minWidth="0.853em",v=.833/o):l.type==="large"?(g=(1e3+Vm)*Lc[l.size],m=(Lc[l.size]+c)/o,h=(Lc[l.size]+c+Ym)/o,f=Wm("sqrtSize"+l.size,h,g,c,n),f.style.minWidth="1.02em",v=1/o):(h=t+c+Ym,m=t+c,g=Math.floor(1e3*t+c)+Vm,f=Wm("sqrtTall",h,g,c,n),f.style.minWidth="0.742em",v=1.056),f.height=m,f.style.height=Re(h),{span:f,advanceWidth:v,ruleWidth:(n.fontMetrics().sqrtRuleThickness+c)*o}},p6=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),vT=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),g6=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),Lc=[0,1.2,1.8,2.4,3],y6=function(t,n,a,l,o){if(t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle"),p6.has(t)||g6.has(t))return h6(t,n,!1,a,l,o);if(vT.has(t))return m6(t,Lc[n],!1,a,l,o);throw new Ee("Illegal delimiter: '"+t+"'")},xT=[{type:"small",style:st.SCRIPTSCRIPT},{type:"small",style:st.SCRIPT},{type:"small",style:st.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],bT=[{type:"small",style:st.SCRIPTSCRIPT},{type:"small",style:st.SCRIPT},{type:"small",style:st.TEXT},{type:"stack"}],v6=[{type:"small",style:st.SCRIPTSCRIPT},{type:"small",style:st.SCRIPT},{type:"small",style:st.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],wT=function(t){if(t.type==="small")return"Main-Regular";if(t.type==="large")return"Size"+t.size+"-Regular";if(t.type==="stack")return"Size4-Regular";var n=t.type;throw new Error("Add support for delim type '"+n+"' here.")},x6=function(t,n,a,l){for(var o=Math.min(2,3-l.style.size),c=o;c<a.length;c++){var f=a[c];if(f.type==="stack")break;var h=Mc(t,wT(f),"math"),m=h.height+h.depth;if(f.type==="small"){var g=l.havingBaseStyle(f.style);m*=g.sizeMultiplier}if(m>n)return f}return a[a.length-1]},Fp=function(t,n,a,l,o,c){t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle");var f;g6.has(t)?f=xT:p6.has(t)?f=v6:f=bT;var h=x6(t,n,f,l);return h.type==="small"?hT(t,h.style,a,l,o,c):h.type==="large"?h6(t,h.size,a,l,o,c):m6(t,n,a,l,o,c)},Km=function(t,n,a,l,o,c){var f=l.fontMetrics().axisHeight*l.sizeMultiplier,h=901,m=5/l.fontMetrics().ptPerEm,g=Math.max(n-f,a+f),v=Math.max(g/500*h,2*g-m);return Fp(t,v,!0,l,o,c)},s3={"\\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}},kT=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","."]);function o3(e){return"isMiddle"in e}function Af(e,t){var n=Cf(e);if(n&&kT.has(n.text))return n;throw n?new Ee("Invalid delimiter '"+n.text+"' after '"+t.funcName+"'",e):new Ee("Invalid delimiter type '"+e.type+"'",e)}Le({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=Af(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:s3[e.funcName].size,mclass:s3[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim==="."?Ce([e.mclass]):y6(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!=="."&&t.push(la(e.delim,e.mode));var n=new Me("mo",t);e.mclass==="mopen"||e.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var a=Re(Lc[e.size]);return n.setAttribute("minsize",a),n.setAttribute("maxsize",a),n}});function u3(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Le({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 Ee("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Af(t[0],e).text,color:n}}});Le({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Af(t[0],e),a=e.parser;++a.leftrightDepth;var l=a.parseExpression(!1);--a.leftrightDepth,a.expect("\\right",!1);var o=ft(a.parseFunction(),"leftright-right");return{type:"leftright",mode:a.mode,body:l,left:n.text,right:o.delim,rightColor:o.color}},htmlBuilder:(e,t)=>{u3(e);for(var n=_n(e.body,t,!0,["mopen","mclose"]),a=0,l=0,o=!1,c=0;c<n.length;c++){var f=n[c];o3(f)?o=!0:(a=Math.max(n[c].height,a),l=Math.max(n[c].depth,l))}a*=t.sizeMultiplier,l*=t.sizeMultiplier;var h;if(e.left==="."?h=Yc(t,["mopen"]):h=Km(e.left,a,l,t,e.mode,["mopen"]),n.unshift(h),o)for(var m=1;m<n.length;m++){var g=n[m];if(o3(g)){var v=g.isMiddle;n[m]=Km(v.delim,a,l,v.options,e.mode,[])}}var k;if(e.right===".")k=Yc(t,["mclose"]);else{var b=e.rightColor?t.withColor(e.rightColor):t;k=Km(e.right,a,l,b,e.mode,["mclose"])}return n.push(k),Ce(["minner"],n,t)},mathmlBuilder:(e,t)=>{u3(e);var n=Gr(e.body,t);if(e.left!=="."){var a=new Me("mo",[la(e.left,e.mode)]);a.setAttribute("fence","true"),n.unshift(a)}if(e.right!=="."){var l=new Me("mo",[la(e.right,e.mode)]);l.setAttribute("fence","true"),e.rightColor&&l.setAttribute("mathcolor",e.rightColor),n.push(l)}return R1(n)}});Le({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Af(t[0],e);if(!e.parser.leftrightDepth)throw new Ee("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim==="."?n=Yc(t,[]):(n=y6(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t}),n},mathmlBuilder:(e,t)=>{var n=e.delim==="\\vert"||e.delim==="|"?la("|","text"):la(e.delim,e.mode),a=new Me("mo",[n]);return a.setAttribute("fence","true"),a.setAttribute("lspace","0.05em"),a.setAttribute("rspace","0.05em"),a}});var Ef=(e,t)=>{var n=eu(It(e.body,t),t),a=e.label.slice(1),l=t.sizeMultiplier,o,c,f=qi(e.body);if(a==="sout")o=Ce(["stretchy","sout"]),o.height=t.fontMetrics().defaultRuleThickness/l,c=-.5*t.fontMetrics().xHeight;else if(a==="phase"){var h=cn({number:.6,unit:"pt"},t),m=cn({number:.35,unit:"ex"},t),g=t.havingBaseSizing();l=l/g.sizeMultiplier;var v=n.height+n.depth+h+m;n.style.paddingLeft=Re(v/2+h);var k=Math.floor(1e3*v*l),b=wC(k),T=new Li([new Il("phase",b)],{width:"400em",height:Re(k/1e3),viewBox:"0 0 400000 "+k,preserveAspectRatio:"xMinYMin slice"});o=_l(["hide-tail"],[T],t),o.style.height=Re(v),c=n.depth+h+m}else{/cancel/.test(a)?f||n.classes.push("cancel-pad"):a==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var A,q,z=0;/box/.test(a)?(z=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),A=t.fontMetrics().fboxsep+(a==="colorbox"?0:z),q=A):a==="angl"?(z=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),A=4*z,q=Math.max(0,.25-n.depth)):(A=f?.2:0,q=A),o=rT(n,a,A,q,t),/fbox|boxed|fcolorbox/.test(a)?(o.style.borderStyle="solid",o.style.borderWidth=Re(z)):a==="angl"&&z!==.049&&(o.style.borderTopWidth=Re(z),o.style.borderRightWidth=Re(z)),c=n.depth+q,e.backgroundColor&&(o.style.backgroundColor=e.backgroundColor,e.borderColor&&(o.style.borderColor=e.borderColor))}var M;if(e.backgroundColor)M=Ot({positionType:"individualShift",children:[{type:"elem",elem:o,shift:c},{type:"elem",elem:n,shift:0}]});else{var B=/cancel|phase/.test(a)?["svg-align"]:[];M=Ot({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:o,shift:c,wrapperClasses:B}]})}return/cancel/.test(a)&&(M.height=n.height,M.depth=n.depth),/cancel/.test(a)&&!f?Ce(["mord","cancel-lap"],[M],t):Ce(["mord"],[M],t)},Nf=(e,t)=>{var n,a=new Me(e.label.includes("colorbox")?"mpadded":"menclose",[Qt(e.body,t)]);switch(e.label){case"\\cancel":a.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":a.setAttribute("notation","downdiagonalstrike");break;case"\\phase":a.setAttribute("notation","phasorangle");break;case"\\sout":a.setAttribute("notation","horizontalstrike");break;case"\\fbox":a.setAttribute("notation","box");break;case"\\angl":a.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,a.setAttribute("width","+"+2*n+"pt"),a.setAttribute("height","+"+2*n+"pt"),a.setAttribute("lspace",n+"pt"),a.setAttribute("voffset",n+"pt"),e.label==="\\fcolorbox"){var l=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);a.setAttribute("style","border: "+Re(l)+" solid "+e.borderColor)}break;case"\\xcancel":a.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&a.setAttribute("mathbackground",e.backgroundColor),a};Le({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,t,n){var{parser:a,funcName:l}=e,o=ft(t[0],"color-token").color,c=t[1];return{type:"enclose",mode:a.mode,label:l,backgroundColor:o,body:c}},htmlBuilder:Ef,mathmlBuilder:Nf});Le({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,t,n){var{parser:a,funcName:l}=e,o=ft(t[0],"color-token").color,c=ft(t[1],"color-token").color,f=t[2];return{type:"enclose",mode:a.mode,label:l,backgroundColor:c,borderColor:o,body:f}},htmlBuilder:Ef,mathmlBuilder:Nf});Le({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]}}});Le({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:a}=e,l=t[0];return{type:"enclose",mode:n.mode,label:a,body:l}},htmlBuilder:Ef,mathmlBuilder:Nf});Le({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n,funcName:a}=e;n.mode==="math"&&n.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var l=t[0];return{type:"enclose",mode:n.mode,label:a,body:l}},htmlBuilder:Ef,mathmlBuilder:Nf});Le({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 b6={};function ti(e){for(var{type:t,names:n,props:a,handler:l,htmlBuilder:o,mathmlBuilder:c}=e,f={type:t,numArgs:a.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:l},h=0;h<n.length;++h)b6[n[h]]=f;o&&(lf[t]=o),c&&(sf[t]=c)}var w6={};function I(e,t){w6[e]=t}class Sr{constructor(t,n,a){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=t,this.start=n,this.end=a}static range(t,n){return n?!t||!t.loc||!n.loc||t.loc.lexer!==n.loc.lexer?null:new Sr(t.loc.lexer,t.loc.start,n.loc.end):t&&t.loc}}class $r{constructor(t,n){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=t,this.loc=n}range(t,n){return new $r(n,Sr.range(this,t))}}function c3(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 Mf=e=>{var t=e.parser.settings;if(!t.displayMode)throw new Ee("{"+e.envName+"} can be used only in display mode.")},ST=new Set(["gather","gather*"]);function L1(e){if(!e.includes("ed"))return!e.includes("*")}function Hl(e,t,n){var{hskipBeforeAndAfter:a,addJot:l,cols:o,arraystretch:c,colSeparationType:f,autoTag:h,singleRow:m,emptySingleRow:g,maxNumCols:v,leqno:k}=t;if(e.gullet.beginGroup(),m||e.gullet.macros.set("\\cr","\\\\\\relax"),!c){var b=e.gullet.expandMacroAsText("\\arraystretch");if(b==null)c=1;else if(c=parseFloat(b),!c||c<0)throw new Ee("Invalid \\arraystretch: "+b)}e.gullet.beginGroup();var T=[],A=[T],q=[],z=[],M=h!=null?[]:void 0;function B(){h&&e.gullet.macros.set("\\@eqnsw","1",!0)}function U(){M&&(e.gullet.macros.get("\\df@tag")?(M.push(e.subparse([new $r("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):M.push(!!h&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(B(),z.push(c3(e));;){var ae=e.parseExpression(!1,m?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var L={type:"ordgroup",mode:e.mode,body:ae};n&&(L={type:"styling",mode:e.mode,style:n,resetFont:!0,body:[L]}),T.push(L);var K=e.fetch().text;if(K==="&"){if(v&&T.length===v){if(m||f)throw new Ee("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(K==="\\end"){U(),T.length===1&&L.type==="styling"&&L.body.length===1&&L.body[0].type==="ordgroup"&&L.body[0].body.length===0&&(A.length>1||!g)&&A.pop(),z.length<A.length+1&&z.push([]);break}else if(K==="\\\\"){e.consume();var ie=void 0;e.gullet.future().text!==" "&&(ie=e.parseSizeGroup(!0)),q.push(ie?ie.value:null),U(),z.push(c3(e)),T=[],A.push(T),B()}else throw new Ee("Expected & or \\\\ or \\cr or \\end",e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:l,arraystretch:c,body:A,cols:o,rowGaps:q,hskipBeforeAndAfter:a,hLinesBeforeRow:z,colSeparationType:f,tags:M,leqno:k}}function B1(e){return e.slice(0,1)==="d"?"display":"text"}var ni=function(t,n){var a,l,o=t.body.length,c=t.hLinesBeforeRow,f=0,h=new Array(o),m=[],g=Math.max(n.fontMetrics().arrayRuleWidth,n.minRuleThickness),v=1/n.fontMetrics().ptPerEm,k=5*v;if(t.colSeparationType&&t.colSeparationType==="small"){var b=n.havingStyle(st.SCRIPT).sizeMultiplier;k=.2778*(b/n.sizeMultiplier)}var T=t.colSeparationType==="CD"?cn({number:3,unit:"ex"},n):12*v,A=3*v,q=t.arraystretch*T,z=.7*q,M=.3*q,B=0;function U($e){for(var at=0;at<$e.length;++at)at>0&&(B+=.25),m.push({pos:B,isDashed:$e[at]})}for(U(c[0]),a=0;a<t.body.length;++a){var ae=t.body[a],L=z,K=M;f<ae.length&&(f=ae.length);var ie={cells:new Array(ae.length),height:0,depth:0,pos:0};for(l=0;l<ae.length;++l){var Q=It(ae[l],n);K<Q.depth&&(K=Q.depth),L<Q.height&&(L=Q.height),ie.cells[l]=Q}var F=t.rowGaps[a],he=0;F&&(he=cn(F,n),he>0&&(he+=M,K<he&&(K=he),he=0)),t.addJot&&a<t.body.length-1&&(K+=A),ie.height=L,ie.depth=K,B+=L,ie.pos=B,B+=K+he,h[a]=ie,U(c[a+1])}var ce=B/2+n.fontMetrics().axisHeight,Ie=t.cols||[],be=[],pe,J,Y=[];if(t.tags&&t.tags.some($e=>$e))for(a=0;a<o;++a){var ge=h[a],Te=ge.pos-ce,H=t.tags[a],_=void 0;H===!0?_=Ce(["eqn-num"],[],n):H===!1?_=Ce([],[],n):_=Ce([],_n(H,n,!0),n),_.depth=ge.depth,_.height=ge.height,Y.push({type:"elem",elem:_,shift:Te})}for(l=0,J=0;l<f||J<Ie.length;++l,++J){for(var te,O=Ie[J],ee=!0;((Ae=O)==null?void 0:Ae.type)==="separator";){var Ae;if(ee||(pe=Ce(["arraycolsep"],[]),pe.style.width=Re(n.fontMetrics().doubleRuleSep),be.push(pe)),O.separator==="|"||O.separator===":"){var ne=O.separator==="|"?"solid":"dashed",we=Ce(["vertical-separator"],[],n);we.style.height=Re(B),we.style.borderRightWidth=Re(g),we.style.borderRightStyle=ne,we.style.margin="0 "+Re(-g/2);var _e=B-ce;_e&&(we.style.verticalAlign=Re(-_e)),be.push(we)}else throw new Ee("Invalid separator type: "+O.separator);J++,O=Ie[J],ee=!1}if(!(l>=f)){var He=void 0;if(l>0||t.hskipBeforeAndAfter){var wt,et;He=(wt=(et=O)==null?void 0:et.pregap)!=null?wt:k,He!==0&&(pe=Ce(["arraycolsep"],[]),pe.style.width=Re(He),be.push(pe))}var $t=[];for(a=0;a<o;++a){var tt=h[a],fe=tt.cells[l];if(fe){var qe=tt.pos-ce;fe.depth=tt.depth,fe.height=tt.height,$t.push({type:"elem",elem:fe,shift:qe})}}var Je=Ot({positionType:"individualShift",children:$t}),Xe=Ce(["col-align-"+(((te=O)==null?void 0:te.align)||"c")],[Je]);if(be.push(Xe),l<f-1||t.hskipBeforeAndAfter){var Lt,Tt;He=(Lt=(Tt=O)==null?void 0:Tt.postgap)!=null?Lt:k,He!==0&&(pe=Ce(["arraycolsep"],[]),pe.style.width=Re(He),be.push(pe))}}}var mt=Ce(["mtable"],be);if(m.length>0){for(var At=Jo("hline",n,g),pn=Jo("hdashline",n,g),en=[{type:"elem",elem:mt,shift:0}];m.length>0;){var ht=m.pop(),ur=ht.pos-ce;ht.isDashed?en.push({type:"elem",elem:pn,shift:ur}):en.push({type:"elem",elem:At,shift:ur})}mt=Ot({positionType:"individualShift",children:en})}if(Y.length===0)return Ce(["mord"],[mt],n);var me=Ot({positionType:"individualShift",children:Y}),Se=Ce(["tag"],[me],n);return Hi([mt,Se])},jT={c:"center ",l:"left ",r:"right "},ri=function(t,n){for(var a=[],l=new Me("mtd",[],["mtr-glue"]),o=new Me("mtd",[],["mml-eqn-num"]),c=0;c<t.body.length;c++){for(var f=t.body[c],h=[],m=0;m<f.length;m++)h.push(new Me("mtd",[Qt(f[m],n)]));t.tags&&t.tags[c]&&(h.unshift(l),h.push(l),t.leqno?h.unshift(o):h.push(o)),a.push(new Me("mtr",h))}var g=new Me("mtable",a),v=t.arraystretch===.5?.1:.16+t.arraystretch-1+(t.addJot?.09:0);g.setAttribute("rowspacing",Re(v));var k="",b="";if(t.cols&&t.cols.length>0){var T=t.cols,A="",q=!1,z=0,M=T.length;T[0].type==="separator"&&(k+="top ",z=1),T[T.length-1].type==="separator"&&(k+="bottom ",M-=1);for(var B=z;B<M;B++){var U=T[B];U.type==="align"?(b+=jT[U.align],q&&(A+="none "),q=!0):U.type==="separator"&&q&&(A+=U.separator==="|"?"solid ":"dashed ",q=!1)}g.setAttribute("columnalign",b.trim()),/[sd]/.test(A)&&g.setAttribute("columnlines",A.trim())}if(t.colSeparationType==="align"){for(var ae=t.cols||[],L="",K=1;K<ae.length;K++)L+=K%2?"0em ":"1em ";g.setAttribute("columnspacing",L.trim())}else t.colSeparationType==="alignat"||t.colSeparationType==="gather"?g.setAttribute("columnspacing","0em"):t.colSeparationType==="small"?g.setAttribute("columnspacing","0.2778em"):t.colSeparationType==="CD"?g.setAttribute("columnspacing","0.5em"):g.setAttribute("columnspacing","1em");var ie="",Q=t.hLinesBeforeRow;k+=Q[0].length>0?"left ":"",k+=Q[Q.length-1].length>0?"right ":"";for(var F=1;F<Q.length-1;F++)ie+=Q[F].length===0?"none ":Q[F][0]?"dashed ":"solid ";return/[sd]/.test(ie)&&g.setAttribute("rowlines",ie.trim()),k!==""&&(g=new Me("menclose",[g]),g.setAttribute("notation",k.trim())),t.arraystretch&&t.arraystretch<1&&(g=new Me("mstyle",[g]),g.setAttribute("scriptlevel","1")),g},k6=function(t,n){t.envName.includes("ed")||Mf(t);var a=[],l=t.envName.includes("at")?"alignat":"align",o=t.envName==="split",c=Hl(t.parser,{cols:a,addJot:!0,autoTag:o?void 0:L1(t.envName),emptySingleRow:!0,colSeparationType:l,maxNumCols:o?2:void 0,leqno:t.parser.settings.leqno},"display"),f=0,h=0,m={type:"ordgroup",mode:t.mode,body:[]};if(n[0]&&n[0].type==="ordgroup"){for(var g="",v=0;v<n[0].body.length;v++){var k=ft(n[0].body[v],"textord");g+=k.text}f=Number(g),h=f*2}var b=!h;c.body.forEach(function(z){for(var M=1;M<z.length;M+=2){var B=ft(z[M],"styling"),U=ft(B.body[0],"ordgroup");U.body.unshift(m)}if(b)h<z.length&&(h=z.length);else{var ae=z.length/2;if(f<ae)throw new Ee("Too many math in a row: "+("expected "+f+", but got "+ae),z[0])}});for(var T=0;T<h;++T){var A="r",q=0;T%2===1?A="l":T>0&&b&&(q=1),a[T]={type:"align",align:A,pregap:q,postgap:0}}return c.colSeparationType=b?"align":"alignat",c};ti({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=Cf(t[0]),a=n?[t[0]]:ft(t[0],"ordgroup").body,l=a.map(function(c){var f=jf(c),h=f.text;if("lcr".includes(h))return{type:"align",align:h};if(h==="|")return{type:"separator",separator:"|"};if(h===":")return{type:"separator",separator:":"};throw new Ee("Unknown column alignment: "+h,c)}),o={cols:l,hskipBeforeAndAfter:!0,maxNumCols:l.length};return Hl(e.parser,o,B1(e.envName))},htmlBuilder:ni,mathmlBuilder:ri});ti({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",a={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(e.envName.charAt(e.envName.length-1)==="*"){var l=e.parser;if(l.consumeSpaces(),l.fetch().text==="["){if(l.consume(),l.consumeSpaces(),n=l.fetch().text,!"lcr".includes(n))throw new Ee("Expected l or c or r",l.nextToken);l.consume(),l.consumeSpaces(),l.expect("]"),l.consume(),a.cols=[{type:"align",align:n}]}}var o=Hl(e.parser,a,B1(e.envName)),c=Math.max(0,...o.body.map(f=>f.length));return o.cols=new Array(c).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[o],left:t[0],right:t[1],rightColor:void 0}:o},htmlBuilder:ni,mathmlBuilder:ri});ti({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t={arraystretch:.5},n=Hl(e.parser,t,"script");return n.colSeparationType="small",n},htmlBuilder:ni,mathmlBuilder:ri});ti({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=Cf(t[0]),a=n?[t[0]]:ft(t[0],"ordgroup").body,l=a.map(function(f){var h=jf(f),m=h.text;if("lc".includes(m))return{type:"align",align:m};throw new Ee("Unknown column alignment: "+m,f)});if(l.length>1)throw new Ee("{subarray} can contain only one column");var o={cols:l,hskipBeforeAndAfter:!1,arraystretch:.5},c=Hl(e.parser,o,"script");if(c.body.length>0&&c.body[0].length>1)throw new Ee("{subarray} can contain only one column");return c},htmlBuilder:ni,mathmlBuilder:ri});ti({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=Hl(e.parser,t,B1(e.envName));return{type:"leftright",mode:e.mode,body:[n],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:ni,mathmlBuilder:ri});ti({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:k6,htmlBuilder:ni,mathmlBuilder:ri});ti({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){ST.has(e.envName)&&Mf(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:L1(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Hl(e.parser,t,"display")},htmlBuilder:ni,mathmlBuilder:ri});ti({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:k6,htmlBuilder:ni,mathmlBuilder:ri});ti({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Mf(e);var t={autoTag:L1(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Hl(e.parser,t,"display")},htmlBuilder:ni,mathmlBuilder:ri});ti({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Mf(e),dT(e.parser)},htmlBuilder:ni,mathmlBuilder:ri});I("\\nonumber","\\gdef\\@eqnsw{0}");I("\\notag","\\nonumber");Le({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new Ee(e.funcName+" valid only within array environment")}});var d3=b6;Le({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:n,funcName:a}=e,l=t[0];if(l.type!=="ordgroup")throw new Ee("Invalid environment name",l);for(var o="",c=0;c<l.body.length;++c)o+=ft(l.body[c],"textord").text;if(a==="\\begin"){if(!d3.hasOwnProperty(o))throw new Ee("No such environment: "+o,l);var f=d3[o],{args:h,optArgs:m}=n.parseArguments("\\begin{"+o+"}",f),g={mode:n.mode,envName:o,parser:n},v=f.handler(g,h,m);n.expect("\\end",!1);var k=n.nextToken,b=ft(n.parseFunction(),"environment");if(b.name!==o)throw new Ee("Mismatch: \\begin{"+o+"} matched by \\end{"+b.name+"}",k);return v}return{type:"environment",mode:n.mode,name:o,nameGroup:l}}});var S6=(e,t)=>{var n=e.font,a=t.withFont(n);return It(e.body,a)},j6=(e,t)=>{var n=e.font,a=t.withFont(n);return Qt(e.body,a)},f3={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};Le({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:a}=e,l=of(t[0]),o=a;return o in f3&&(o=f3[o]),{type:"font",mode:n.mode,font:o.slice(1),body:l}},htmlBuilder:S6,mathmlBuilder:j6});Le({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"mclass",mode:n.mode,mclass:Tf(a),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:a}],isCharacterBox:qi(a)}}});Le({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:a,breakOnTokenText:l}=e,{mode:o}=n,c=n.parseExpression(!0,l);return{type:"font",mode:o,font:"math"+a.slice(1),body:{type:"ordgroup",mode:n.mode,body:c}}},htmlBuilder:S6,mathmlBuilder:j6});var CT=(e,t)=>{var n=t.style,a=n.fracNum(),l=n.fracDen(),o;o=t.havingStyle(a);var c=It(e.numer,o,t);if(e.continued){var f=8.5/t.fontMetrics().ptPerEm,h=3.5/t.fontMetrics().ptPerEm;c.height=c.height<f?f:c.height,c.depth=c.depth<h?h:c.depth}o=t.havingStyle(l);var m=It(e.denom,o,t),g,v,k;e.hasBarLine?(e.barSize?(v=cn(e.barSize,t),g=Jo("frac-line",t,v)):g=Jo("frac-line",t),v=g.height,k=g.height):(g=null,v=0,k=t.fontMetrics().defaultRuleThickness);var b,T,A;n.size===st.DISPLAY.size?(b=t.fontMetrics().num1,v>0?T=3*k:T=7*k,A=t.fontMetrics().denom1):(v>0?(b=t.fontMetrics().num2,T=k):(b=t.fontMetrics().num3,T=3*k),A=t.fontMetrics().denom2);var q;if(g){var M=t.fontMetrics().axisHeight;b-c.depth-(M+.5*v)<T&&(b+=T-(b-c.depth-(M+.5*v))),M-.5*v-(m.height-A)<T&&(A+=T-(M-.5*v-(m.height-A)));var B=-(M-.5*v);q=Ot({positionType:"individualShift",children:[{type:"elem",elem:m,shift:A},{type:"elem",elem:g,shift:B},{type:"elem",elem:c,shift:-b}]})}else{var z=b-c.depth-(m.height-A);z<T&&(b+=.5*(T-z),A+=.5*(T-z)),q=Ot({positionType:"individualShift",children:[{type:"elem",elem:m,shift:A},{type:"elem",elem:c,shift:-b}]})}o=t.havingStyle(n),q.height*=o.sizeMultiplier/t.sizeMultiplier,q.depth*=o.sizeMultiplier/t.sizeMultiplier;var U;n.size===st.DISPLAY.size?U=t.fontMetrics().delim1:n.size===st.SCRIPTSCRIPT.size?U=t.havingStyle(st.SCRIPT).fontMetrics().delim2:U=t.fontMetrics().delim2;var ae,L;return e.leftDelim==null?ae=Yc(t,["mopen"]):ae=Fp(e.leftDelim,U,!0,t.havingStyle(n),e.mode,["mopen"]),e.continued?L=Ce([]):e.rightDelim==null?L=Yc(t,["mclose"]):L=Fp(e.rightDelim,U,!0,t.havingStyle(n),e.mode,["mclose"]),Ce(["mord"].concat(o.sizingClasses(t)),[ae,Ce(["mfrac"],[q]),L],t)},TT=(e,t)=>{var n=new Me("mfrac",[Qt(e.numer,t),Qt(e.denom,t)]);if(!e.hasBarLine)n.setAttribute("linethickness","0px");else if(e.barSize){var a=cn(e.barSize,t);n.setAttribute("linethickness",Re(a))}if(e.leftDelim!=null||e.rightDelim!=null){var l=[];if(e.leftDelim!=null){var o=new Me("mo",[new Nn(e.leftDelim.replace("\\",""))]);o.setAttribute("fence","true"),l.push(o)}if(l.push(n),e.rightDelim!=null){var c=new Me("mo",[new Nn(e.rightDelim.replace("\\",""))]);c.setAttribute("fence","true"),l.push(c)}return R1(l)}return n},C6=(e,t)=>{if(!t)return e;var n={type:"styling",mode:e.mode,style:t,body:[e]};return n};Le({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:a}=e,l=t[0],o=t[1],c,f=null,h=null;switch(a){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":c=!0;break;case"\\\\atopfrac":c=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":c=!1,f="(",h=")";break;case"\\\\bracefrac":c=!1,f="\\{",h="\\}";break;case"\\\\brackfrac":c=!1,f="[",h="]";break;default:throw new Error("Unrecognized genfrac command")}var m=a==="\\cfrac",g=null;return m||a.startsWith("\\d")?g="display":a.startsWith("\\t")&&(g="text"),C6({type:"genfrac",mode:n.mode,numer:l,denom:o,continued:m,hasBarLine:c,leftDelim:f,rightDelim:h,barSize:null},g)},htmlBuilder:CT,mathmlBuilder:TT});Le({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:n,token:a}=e,l;switch(n){case"\\over":l="\\frac";break;case"\\choose":l="\\binom";break;case"\\atop":l="\\\\atopfrac";break;case"\\brace":l="\\\\bracefrac";break;case"\\brack":l="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:t.mode,replaceWith:l,token:a}}});var h3=["display","text","script","scriptscript"],m3=function(t){var n=null;return t.length>0&&(n=t,n=n==="."?null:n),n};Le({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var{parser:n}=e,a=t[4],l=t[5],o=of(t[0]),c=o.type==="atom"&&o.family==="open"?m3(o.text):null,f=of(t[1]),h=f.type==="atom"&&f.family==="close"?m3(f.text):null,m=ft(t[2],"size"),g,v=null;m.isBlank?g=!0:(v=m.value,g=v.number>0);var k=null,b=t[3];if(b.type==="ordgroup"){if(b.body.length>0){var T=ft(b.body[0],"textord");k=h3[Number(T.text)]}}else b=ft(b,"textord"),k=h3[Number(b.text)];return C6({type:"genfrac",mode:n.mode,numer:a,denom:l,continued:!1,hasBarLine:g,barSize:v,leftDelim:c,rightDelim:h},k)}});Le({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:a,token:l}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:ft(t[0],"size").value,token:l}}});Le({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=t[0],o=ft(t[1],"infix").size;if(!o)throw new Error("\\\\abovefrac expected size, but got "+String(o));var c=t[2],f=o.number>0;return{type:"genfrac",mode:n.mode,numer:l,denom:c,continued:!1,hasBarLine:f,barSize:o,leftDelim:null,rightDelim:null}}});var T6=(e,t)=>{var n=t.style,a,l;e.type==="supsub"?(a=e.sup?It(e.sup,t.havingStyle(n.sup()),t):It(e.sub,t.havingStyle(n.sub()),t),l=ft(e.base,"horizBrace")):l=ft(e,"horizBrace");var o=It(l.base,t.havingBaseStyle(st.DISPLAY)),c=Sf(l,t),f;if(l.isOver?f=Ot({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:c,wrapperClasses:["svg-align"]}]}):f=Ot({positionType:"bottom",positionData:o.depth+.1+c.height,children:[{type:"elem",elem:c,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:o}]}),a){var h=Ce(["minner",l.isOver?"mover":"munder"],[f],t);l.isOver?f=Ot({positionType:"firstBaseline",children:[{type:"elem",elem:h},{type:"kern",size:.2},{type:"elem",elem:a}]}):f=Ot({positionType:"bottom",positionData:h.depth+.2+a.height+a.depth,children:[{type:"elem",elem:a},{type:"kern",size:.2},{type:"elem",elem:h}]})}return Ce(["minner",l.isOver?"mover":"munder"],[f],t)},AT=(e,t)=>{var n=kf(e.label);return new Me(e.isOver?"mover":"munder",[Qt(e.base,t),n])};Le({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:a}=e;return{type:"horizBrace",mode:n.mode,label:a,isOver:a.includes("\\over"),base:t[0]}},htmlBuilder:T6,mathmlBuilder:AT});Le({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=t[1],l=ft(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:l})?{type:"href",mode:n.mode,href:l,body:En(a)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=_n(e.body,t,!1);return UC(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=Ll(e.body,t);return n instanceof Me||(n=new Me("mrow",[n])),n.setAttribute("href",e.href),n}});Le({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=ft(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:a}))return n.formatUnsupportedCmd("\\url");for(var l=[],o=0;o<a.length;o++){var c=a[o];c==="~"&&(c="\\textasciitilde"),l.push({type:"textord",mode:"text",text:c})}var f={type:"text",mode:n.mode,font:"\\texttt",body:l};return{type:"href",mode:n.mode,href:a,body:En(f)}}});Le({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:En(t[0])}},htmlBuilder(e,t){var n=_n(e.body,t.withFont(""),!1);return Hi(n)},mathmlBuilder(e,t){return new Me("mrow",Gr(e.body,t.withFont("")))}});Le({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:a,token:l}=e,o=ft(t[0],"raw").string,c=t[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var f,h={};switch(a){case"\\htmlClass":h.class=o,f={command:"\\htmlClass",class:o};break;case"\\htmlId":h.id=o,f={command:"\\htmlId",id:o};break;case"\\htmlStyle":h.style=o,f={command:"\\htmlStyle",style:o};break;case"\\htmlData":{for(var m=o.split(","),g=0;g<m.length;g++){var v=m[g],k=v.indexOf("=");if(k<0)throw new Ee("\\htmlData key/value '"+v+"' missing equals sign");var b=v.slice(0,k),T=v.slice(k+1);h["data-"+b.trim()]=T}f={command:"\\htmlData",attributes:h};break}default:throw new Error("Unrecognized html command")}return n.settings.isTrusted(f)?{type:"html",mode:n.mode,attributes:h,body:En(c)}:n.formatUnsupportedCmd(a)},htmlBuilder:(e,t)=>{var n=_n(e.body,t,!1),a=["enclosing"];e.attributes.class&&a.push(...e.attributes.class.trim().split(/\s+/));var l=Ce(a,n,t);for(var o in e.attributes)o!=="class"&&e.attributes.hasOwnProperty(o)&&l.setAttribute(o,e.attributes[o]);return l},mathmlBuilder:(e,t)=>Ll(e.body,t)});Le({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:En(t[0]),mathml:En(t[1])}},htmlBuilder:(e,t)=>{var n=_n(e.html,t,!1);return Hi(n)},mathmlBuilder:(e,t)=>Ll(e.mathml,t)});var Xm=function(t){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t))return{number:+t,unit:"bp"};var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);if(!n)throw new Ee("Invalid size: '"+t+"' in \\includegraphics");var a={number:+(n[1]+n[2]),unit:n[3]};if(!$v(a))throw new Ee("Invalid unit: '"+a.unit+"' in \\includegraphics.");return a};Le({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:a}=e,l={number:0,unit:"em"},o={number:.9,unit:"em"},c={number:0,unit:"em"},f="";if(n[0])for(var h=ft(n[0],"raw").string,m=h.split(","),g=0;g<m.length;g++){var v=m[g].split("=");if(v.length===2){var k=v[1].trim();switch(v[0].trim()){case"alt":f=k;break;case"width":l=Xm(k);break;case"height":o=Xm(k);break;case"totalheight":c=Xm(k);break;default:throw new Ee("Invalid key: '"+v[0]+"' in \\includegraphics.")}}}var b=ft(t[0],"url").url;return f===""&&(f=b,f=f.replace(/^.*[\\/]/,""),f=f.substring(0,f.lastIndexOf("."))),a.settings.isTrusted({command:"\\includegraphics",url:b})?{type:"includegraphics",mode:a.mode,alt:f,width:l,height:o,totalheight:c,src:b}:a.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var n=cn(e.height,t),a=0;e.totalheight.number>0&&(a=cn(e.totalheight,t)-n);var l=0;e.width.number>0&&(l=cn(e.width,t));var o={height:Re(n+a)};l>0&&(o.width=Re(l)),a>0&&(o.verticalAlign=Re(-a));var c=new NC(e.src,e.alt,o);return c.height=n,c.depth=a,c},mathmlBuilder:(e,t)=>{var n=new Me("mglyph",[]);n.setAttribute("alt",e.alt);var a=cn(e.height,t),l=0;if(e.totalheight.number>0&&(l=cn(e.totalheight,t)-a,n.setAttribute("valign",Re(-l))),n.setAttribute("height",Re(a+l)),e.width.number>0){var o=cn(e.width,t);n.setAttribute("width",Re(o))}return n.setAttribute("src",e.src),n}});Le({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:a}=e,l=ft(t[0],"size");if(n.settings.strict){var o=a[1]==="m",c=l.value.unit==="mu";o?(c||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" supports only mu units, "+("not "+l.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" works only in math mode")):c&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:l.value}},htmlBuilder(e,t){return Kv(e.dimension,t)},mathmlBuilder(e,t){var n=cn(e.dimension,t);return new t6(n)}});Le({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=t[0];return{type:"lap",mode:n.mode,alignment:a.slice(5),body:l}},htmlBuilder:(e,t)=>{var n;e.alignment==="clap"?(n=Ce([],[It(e.body,t)]),n=Ce(["inner"],[n],t)):n=Ce(["inner"],[It(e.body,t)]);var a=Ce(["fix"],[]),l=Ce([e.alignment],[n,a],t),o=Ce(["strut"]);return o.style.height=Re(l.height+l.depth),l.depth&&(o.style.verticalAlign=Re(-l.depth)),l.children.unshift(o),l=Ce(["thinbox"],[l],t),Ce(["mord","vbox"],[l],t)},mathmlBuilder:(e,t)=>{var n=new Me("mpadded",[Qt(e.body,t)]);if(e.alignment!=="rlap"){var a=e.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",a+"width")}return n.setAttribute("width","0px"),n}});Le({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:a}=e,l=a.mode;a.switchMode("math");var o=n==="\\("?"\\)":"$",c=a.parseExpression(!1,o);return a.expect(o),a.switchMode(l),{type:"styling",mode:a.mode,style:"text",resetFont:!0,body:c}}});Le({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new Ee("Mismatched "+e.funcName)}});var p3=(e,t)=>{switch(t.style.size){case st.DISPLAY.size:return e.display;case st.TEXT.size:return e.text;case st.SCRIPT.size:return e.script;case st.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Le({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:En(t[0]),text:En(t[1]),script:En(t[2]),scriptscript:En(t[3])}},htmlBuilder:(e,t)=>{var n=p3(e,t),a=_n(n,t,!1);return Hi(a)},mathmlBuilder:(e,t)=>{var n=p3(e,t);return Ll(n,t)}});var A6=(e,t,n,a,l,o,c)=>{e=Ce([],[e]);var f=n&&qi(n),h,m;if(t){var g=It(t,a.havingStyle(l.sup()),a);m={elem:g,kern:Math.max(a.fontMetrics().bigOpSpacing1,a.fontMetrics().bigOpSpacing3-g.depth)}}if(n){var v=It(n,a.havingStyle(l.sub()),a);h={elem:v,kern:Math.max(a.fontMetrics().bigOpSpacing2,a.fontMetrics().bigOpSpacing4-v.height)}}var k;if(m&&h){var b=a.fontMetrics().bigOpSpacing5+h.elem.height+h.elem.depth+h.kern+e.depth+c;k=Ot({positionType:"bottom",positionData:b,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:h.elem,marginLeft:Re(-o)},{type:"kern",size:h.kern},{type:"elem",elem:e},{type:"kern",size:m.kern},{type:"elem",elem:m.elem,marginLeft:Re(o)},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]})}else if(h){var T=e.height-c;k=Ot({positionType:"top",positionData:T,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:h.elem,marginLeft:Re(-o)},{type:"kern",size:h.kern},{type:"elem",elem:e}]})}else if(m){var A=e.depth+c;k=Ot({positionType:"bottom",positionData:A,children:[{type:"elem",elem:e},{type:"kern",size:m.kern},{type:"elem",elem:m.elem,marginLeft:Re(o)},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]})}else return e;var q=[k];if(h&&o!==0&&!f){var z=Ce(["mspace"],[],a);z.style.marginRight=Re(o),q.unshift(z)}return Ce(["mop","op-limits"],q,a)},E6=new Set(["\\smallint"]),su=(e,t)=>{var n,a,l=!1,o;e.type==="supsub"?(n=e.sup,a=e.sub,o=ft(e.base,"op"),l=!0):o=ft(e,"op");var c=t.style,f=!1;c.size===st.DISPLAY.size&&o.symbol&&!E6.has(o.name)&&(f=!0);var h,m;if(o.symbol){var g=f?"Size2-Regular":"Size1-Regular",v="";if((o.name==="\\oiint"||o.name==="\\oiiint")&&(v=o.name.slice(1),o.name=v==="oiint"?"\\iint":"\\iiint"),h=ir(o.name,g,"math",t,["mop","op-symbol",f?"large-op":"small-op"]),m=h.italic,v.length>0){var k=Zv(v+"Size"+(f?"2":"1"),t);h=Ot({positionType:"individualShift",children:[{type:"elem",elem:h,shift:0},{type:"elem",elem:k,shift:f?.08:0}]}),o.name="\\"+v,h.classes.unshift("mop"),h.italic=m}}else if(o.body){var b=_n(o.body,t,!0);b.length===1&&b[0]instanceof Fr?(h=b[0],h.classes[0]="mop"):h=Ce(["mop"],b,t)}else{for(var T=[],A=1;A<o.name.length;A++)T.push(z1(o.name[A],o.mode,t));h=Ce(["mop"],T,t)}var q=0,z=0;if((h instanceof Fr||o.name==="\\oiint"||o.name==="\\oiiint")&&!o.suppressBaseShift){var M;q=(h.height-h.depth)/2-t.fontMetrics().axisHeight,z=(M=h.italic)!=null?M:0}return l?A6(h,n,a,t,c,z,q):(q&&(h.style.position="relative",h.style.top=Re(q)),h)},t0=(e,t)=>{var n;if(e.symbol)n=new Me("mo",[la(e.name,e.mode)]),E6.has(e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new Me("mo",Gr(e.body,t));else{n=new Me("mi",[new Nn(e.name.slice(1))]);var a=new Me("mo",[la("","text")]);e.parentIsSupSub?n=new Me("mrow",[n,a]):n=e6([n,a])}return n},ET={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Le({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=a;return l.length===1&&(l=ET[l]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:l}},htmlBuilder:su,mathmlBuilder:t0});Le({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:En(a)}},htmlBuilder:su,mathmlBuilder:t0});var NT={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Le({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"],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:su,mathmlBuilder:t0});Le({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:su,mathmlBuilder:t0});Le({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:t,funcName:n}=e,a=n;return a.length===1&&(a=NT[a]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:a}},htmlBuilder:su,mathmlBuilder:t0});var N6=(e,t)=>{var n,a,l=!1,o;e.type==="supsub"?(n=e.sup,a=e.sub,o=ft(e.base,"operatorname"),l=!0):o=ft(e,"operatorname");var c;if(o.body.length>0){for(var f=o.body.map(v=>{var k="text"in v?v.text:void 0;return typeof k=="string"?{type:"textord",mode:v.mode,text:k}:v}),h=_n(f,t.withFont("mathrm"),!0),m=0;m<h.length;m++){var g=h[m];g instanceof Fr&&(g.text=g.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}c=Ce(["mop"],h,t)}else c=Ce(["mop"],[],t);return l?A6(c,n,a,t,t.style,0,0):c},MT=(e,t)=>{for(var n=Gr(e.body,t.withFont("mathrm")),a=!0,l=0;l<n.length;l++){var o=n[l];if(!(o instanceof t6))if(o instanceof Me)switch(o.type){case"mi":case"mn":case"mspace":case"mtext":break;case"mo":{var c=o.children[0];o.children.length===1&&c instanceof Nn?c.text=c.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):a=!1;break}default:a=!1}else a=!1}if(a){var f=n.map(g=>g.toText()).join("");n=[new Nn(f)]}var h=new Me("mi",n);h.setAttribute("mathvariant","normal");var m=new Me("mo",[la("","text")]);return e.parentIsSupSub?new Me("mrow",[h,m]):e6([h,m])};Le({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=t[0];return{type:"operatorname",mode:n.mode,body:En(l),alwaysHandleSupSub:a==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:N6,mathmlBuilder:MT});I("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");_s({type:"ordgroup",htmlBuilder(e,t){return e.semisimple?Hi(_n(e.body,t,!1)):Ce(["mord"],_n(e.body,t,!0),t)},mathmlBuilder(e,t){return Ll(e.body,t,!0)}});Le({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,a=t[0];return{type:"overline",mode:n.mode,body:a}},htmlBuilder(e,t){var n=It(e.body,t.havingCrampedStyle()),a=Jo("overline-line",t),l=t.fontMetrics().defaultRuleThickness,o=Ot({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*l},{type:"elem",elem:a},{type:"kern",size:l}]});return Ce(["mord","overline"],[o],t)},mathmlBuilder(e,t){var n=new Me("mo",[new Nn("‾")]);n.setAttribute("stretchy","true");var a=new Me("mover",[Qt(e.body,t),n]);return a.setAttribute("accent","true"),a}});Le({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"phantom",mode:n.mode,body:En(a)}},htmlBuilder:(e,t)=>{var n=_n(e.body,t.withPhantom(),!1);return Hi(n)},mathmlBuilder:(e,t)=>{var n=Gr(e.body,t);return new Me("mphantom",n)}});I("\\hphantom","\\smash{\\phantom{#1}}");Le({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"vphantom",mode:n.mode,body:a}},htmlBuilder:(e,t)=>{var n=Ce(["inner"],[It(e.body,t.withPhantom())]),a=Ce(["fix"],[]);return Ce(["mord","rlap"],[n,a],t)},mathmlBuilder:(e,t)=>{var n=Gr(En(e.body),t),a=new Me("mphantom",n),l=new Me("mpadded",[a]);return l.setAttribute("width","0px"),l}});Le({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,a=ft(t[0],"size").value,l=t[1];return{type:"raisebox",mode:n.mode,dy:a,body:l}},htmlBuilder(e,t){var n=It(e.body,t),a=cn(e.dy,t);return Ot({positionType:"shift",positionData:-a,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new Me("mpadded",[Qt(e.body,t)]),a=e.dy.number+e.dy.unit;return n.setAttribute("voffset",a),n}});Le({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}});Le({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,n){var{parser:a}=e,l=n[0],o=ft(t[0],"size"),c=ft(t[1],"size");return{type:"rule",mode:a.mode,shift:l&&ft(l,"size").value,width:o.value,height:c.value}},htmlBuilder(e,t){var n=Ce(["mord","rule"],[],t),a=cn(e.width,t),l=cn(e.height,t),o=e.shift?cn(e.shift,t):0;return n.style.borderRightWidth=Re(a),n.style.borderTopWidth=Re(l),n.style.bottom=Re(o),n.width=a,n.height=l+o,n.depth=-o,n.maxFontSize=l*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=cn(e.width,t),a=cn(e.height,t),l=e.shift?cn(e.shift,t):0,o=t.color&&t.getColor()||"black",c=new Me("mspace");c.setAttribute("mathbackground",o),c.setAttribute("width",Re(n)),c.setAttribute("height",Re(a));var f=new Me("mpadded",[c]);return l>=0?f.setAttribute("height",Re(l)):(f.setAttribute("height",Re(l)),f.setAttribute("depth",Re(-l))),f.setAttribute("voffset",Re(l)),f}});function M6(e,t,n){for(var a=_n(e,t,!1),l=t.sizeMultiplier/n.sizeMultiplier,o=0;o<a.length;o++){var c=a[o].classes.indexOf("sizing");c<0?Array.prototype.push.apply(a[o].classes,t.sizingClasses(n)):a[o].classes[c+1]==="reset-size"+t.size&&(a[o].classes[c+1]="reset-size"+n.size),a[o].height*=l,a[o].depth*=l}return Hi(a)}var g3=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],zT=(e,t)=>{var n=t.havingSize(e.size);return M6(e.body,n,t)};Le({type:"sizing",names:g3,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:a,parser:l}=e,o=l.parseExpression(!1,n);return{type:"sizing",mode:l.mode,size:g3.indexOf(a)+1,body:o}},htmlBuilder:zT,mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),a=Gr(e.body,n),l=new Me("mstyle",a);return l.setAttribute("mathsize",Re(n.sizeMultiplier)),l}});Le({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:a}=e,l=!1,o=!1,c=n[0]&&ft(n[0],"ordgroup");if(c)for(var f,h=0;h<c.body.length;++h){var m=c.body[h];if(f=jf(m).text,f==="t")l=!0;else if(f==="b")o=!0;else{l=!1,o=!1;break}}else l=!0,o=!0;var g=t[0];return{type:"smash",mode:a.mode,body:g,smashHeight:l,smashDepth:o}},htmlBuilder:(e,t)=>{var n=Ce([],[It(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 Ce(["mord","smash"],[n],t);if(n.children)for(var a=0;a<n.children.length;a++)e.smashHeight&&(n.children[a].height=0),e.smashDepth&&(n.children[a].depth=0);var l=Ot({positionType:"firstBaseline",children:[{type:"elem",elem:n}]});return Ce(["mord"],[l],t)},mathmlBuilder:(e,t)=>{var n=new Me("mpadded",[Qt(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}});Le({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:a}=e,l=n[0],o=t[0];return{type:"sqrt",mode:a.mode,body:o,index:l}},htmlBuilder(e,t){var n=It(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=eu(n,t);var a=t.fontMetrics(),l=a.defaultRuleThickness,o=l;t.style.id<st.TEXT.id&&(o=t.fontMetrics().xHeight);var c=l+o/4,f=n.height+n.depth+c+l,{span:h,ruleWidth:m,advanceWidth:g}=yT(f,t),v=h.height-m;v>n.height+n.depth+c&&(c=(c+v-n.height-n.depth)/2);var k=h.height-n.height-c-m;n.style.paddingLeft=Re(g);var b=Ot({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+k)},{type:"elem",elem:h},{type:"kern",size:m}]});if(e.index){var T=t.havingStyle(st.SCRIPTSCRIPT),A=It(e.index,T,t),q=.6*(b.height-b.depth),z=Ot({positionType:"shift",positionData:-q,children:[{type:"elem",elem:A}]}),M=Ce(["root"],[z]);return Ce(["mord","sqrt"],[M,b],t)}else return Ce(["mord","sqrt"],[b],t)},mathmlBuilder(e,t){var{body:n,index:a}=e;return a?new Me("mroot",[Qt(n,t),Qt(a,t)]):new Me("msqrt",[Qt(n,t)])}});var Pp={display:st.DISPLAY,text:st.TEXT,script:st.SCRIPT,scriptscript:st.SCRIPTSCRIPT};function DT(e){return e in Pp}Le({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:a,parser:l}=e,o=l.parseExpression(!0,n),c=a.slice(1,a.length-5);if(!DT(c))throw new Error("Unknown style: "+c);return{type:"styling",mode:l.mode,style:c,body:o}},htmlBuilder(e,t){var n=Pp[e.style],a=t.havingStyle(n);return e.resetFont&&(a=a.withFont("")),M6(e.body,a,t)},mathmlBuilder(e,t){var n=Pp[e.style],a=t.havingStyle(n);e.resetFont&&(a=a.withFont(""));var l=Gr(e.body,a),o=new Me("mstyle",l),c={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},f=c[e.style];return o.setAttribute("scriptlevel",f[0]),o.setAttribute("displaystyle",f[1]),o}});var RT=function(t,n){var a=t.base;if(a)if(a.type==="op"){var l=a.limits&&(n.style.size===st.DISPLAY.size||a.alwaysHandleSupSub);return l?su:null}else if(a.type==="operatorname"){var o=a.alwaysHandleSupSub&&(n.style.size===st.DISPLAY.size||a.limits);return o?N6:null}else{if(a.type==="accent")return qi(a.base)?I1:null;if(a.type==="horizBrace"){var c=!t.sub;return c===a.isOver?T6:null}else return null}else return null};_s({type:"supsub",htmlBuilder(e,t){var n=RT(e,t);if(n)return n(e,t);var{base:a,sup:l,sub:o}=e,c=It(a,t),f,h,m=t.fontMetrics(),g=0,v=0,k=a&&qi(a);if(l){var b=t.havingStyle(t.style.sup());f=It(l,b,t),k||(g=c.height-b.fontMetrics().supDrop*b.sizeMultiplier/t.sizeMultiplier)}if(o){var T=t.havingStyle(t.style.sub());h=It(o,T,t),k||(v=c.depth+T.fontMetrics().subDrop*T.sizeMultiplier/t.sizeMultiplier)}var A;t.style===st.DISPLAY?A=m.sup1:t.style.cramped?A=m.sup3:A=m.sup2;var q=t.sizeMultiplier,z=Re(.5/m.ptPerEm/q),M=null;if(h){var B=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(c instanceof Fr||B){var U;M=Re(-((U=c.italic)!=null?U:0))}}var ae;if(f&&h){g=Math.max(g,A,f.depth+.25*m.xHeight),v=Math.max(v,m.sub2);var L=m.defaultRuleThickness,K=4*L;if(g-f.depth-(h.height-v)<K){v=K-(g-f.depth)+h.height;var ie=.8*m.xHeight-(g-f.depth);ie>0&&(g+=ie,v-=ie)}var Q=[{type:"elem",elem:h,shift:v,marginRight:z,marginLeft:M},{type:"elem",elem:f,shift:-g,marginRight:z}];ae=Ot({positionType:"individualShift",children:Q})}else if(h){v=Math.max(v,m.sub1,h.height-.8*m.xHeight);var F=[{type:"elem",elem:h,marginLeft:M,marginRight:z}];ae=Ot({positionType:"shift",positionData:v,children:F})}else if(f)g=Math.max(g,A,f.depth+.25*m.xHeight),ae=Ot({positionType:"shift",positionData:-g,children:[{type:"elem",elem:f,marginRight:z}]});else throw new Error("supsub must have either sup or sub.");var he=qp(c,"right")||"mord";return Ce([he],[c,Ce(["msupsub"],[ae])],t)},mathmlBuilder(e,t){var n=!1,a,l;e.base&&e.base.type==="horizBrace"&&(l=!!e.sup,l===e.base.isOver&&(n=!0,a=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var o=[Qt(e.base,t)];e.sub&&o.push(Qt(e.sub,t)),e.sup&&o.push(Qt(e.sup,t));var c;if(n)c=a?"mover":"munder";else if(e.sub)if(e.sup){var m=e.base;m&&m.type==="op"&&m.limits&&t.style===st.DISPLAY||m&&m.type==="operatorname"&&m.alwaysHandleSupSub&&(t.style===st.DISPLAY||m.limits)?c="munderover":c="msubsup"}else{var h=e.base;h&&h.type==="op"&&h.limits&&(t.style===st.DISPLAY||h.alwaysHandleSupSub)||h&&h.type==="operatorname"&&h.alwaysHandleSupSub&&(h.limits||t.style===st.DISPLAY)?c="munder":c="msub"}else{var f=e.base;f&&f.type==="op"&&f.limits&&(t.style===st.DISPLAY||f.alwaysHandleSupSub)||f&&f.type==="operatorname"&&f.alwaysHandleSupSub&&(f.limits||t.style===st.DISPLAY)?c="mover":c="msup"}return new Me(c,o)}});_s({type:"atom",htmlBuilder(e,t){return z1(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){var n=new Me("mo",[la(e.text,e.mode)]);if(e.family==="bin"){var a=O1(e,t);a==="bold-italic"&&n.setAttribute("mathvariant",a)}else e.family==="punct"?n.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&n.setAttribute("stretchy","false");return n}});var z6={mi:"italic",mn:"normal",mtext:"normal"};_s({type:"mathord",htmlBuilder(e,t){return wf(e,t,"mathord")},mathmlBuilder(e,t){var n=new Me("mi",[la(e.text,e.mode,t)]),a=O1(e,t)||"italic";return a!==z6[n.type]&&n.setAttribute("mathvariant",a),n}});_s({type:"textord",htmlBuilder(e,t){return wf(e,t,"textord")},mathmlBuilder(e,t){var n=la(e.text,e.mode,t),a=O1(e,t)||"normal",l;return e.mode==="text"?l=new Me("mtext",[n]):/[0-9]/.test(e.text)?l=new Me("mn",[n]):e.text==="\\prime"?l=new Me("mo",[n]):l=new Me("mi",[n]),a!==z6[l.type]&&l.setAttribute("mathvariant",a),l}});var Zm={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Qm={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};_s({type:"spacing",htmlBuilder(e,t){if(Qm.hasOwnProperty(e.text)){var n=Qm[e.text].className||"";if(e.mode==="text"){var a=wf(e,t,"textord");return a.classes.push(n),a}else return Ce(["mspace",n],[z1(e.text,e.mode,t)],t)}else{if(Zm.hasOwnProperty(e.text))return Ce(["mspace",Zm[e.text]],[],t);throw new Ee('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,t){var n;if(Qm.hasOwnProperty(e.text))n=new Me("mtext",[new Nn(" ")]);else{if(Zm.hasOwnProperty(e.text))return new Me("mspace");throw new Ee('Unknown type of space "'+e.text+'"')}return n}});var y3=()=>{var e=new Me("mtd",[]);return e.setAttribute("width","50%"),e};_s({type:"tag",mathmlBuilder(e,t){var n=new Me("mtable",[new Me("mtr",[y3(),new Me("mtd",[Ll(e.body,t)]),y3(),new Me("mtd",[Ll(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var v3={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},x3={"\\textbf":"textbf","\\textmd":"textmd"},OT={"\\textit":"textit","\\textup":"textup"},b3=(e,t)=>{var n=e.font;if(n){if(v3[n])return t.withTextFontFamily(v3[n]);if(x3[n])return t.withTextFontWeight(x3[n]);if(n==="\\emph")return t.fontShape==="textit"?t.withTextFontShape("textup"):t.withTextFontShape("textit")}else return t;return t.withTextFontShape(OT[n])};Le({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:a}=e,l=t[0];return{type:"text",mode:n.mode,body:En(l),font:a}},htmlBuilder(e,t){var n=b3(e,t),a=_n(e.body,n,!0);return Ce(["mord","text"],a,n)},mathmlBuilder(e,t){var n=b3(e,t);return Ll(e.body,n)}});Le({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=It(e.body,t),a=Jo("underline-line",t),l=t.fontMetrics().defaultRuleThickness,o=Ot({positionType:"top",positionData:n.height,children:[{type:"kern",size:l},{type:"elem",elem:a},{type:"kern",size:3*l},{type:"elem",elem:n}]});return Ce(["mord","underline"],[o],t)},mathmlBuilder(e,t){var n=new Me("mo",[new Nn("‾")]);n.setAttribute("stretchy","true");var a=new Me("munder",[Qt(e.body,t),n]);return a.setAttribute("accentunder","true"),a}});Le({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=It(e.body,t),a=t.fontMetrics().axisHeight,l=.5*(n.height-a-(n.depth+a));return Ot({positionType:"shift",positionData:l,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new Me("mpadded",[Qt(e.body,t)],["vcenter"]);return new Me("mrow",[n])}});Le({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new Ee("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=w3(e),a=[],l=t.havingStyle(t.style.text()),o=0;o<n.length;o++){var c=n[o];c==="~"&&(c="\\textasciitilde"),a.push(ir(c,"Typewriter-Regular",e.mode,l,["mord","texttt"]))}return Ce(["mord","text"].concat(l.sizingClasses(t)),Wv(a),l)},mathmlBuilder(e,t){var n=new Nn(w3(e)),a=new Me("mtext",[n]);return a.setAttribute("mathvariant","monospace"),a}});var w3=e=>e.body.replace(/ /g,e.star?"␣":" "),Rl=Qv,D6=`[ \r
|
|
332
|
+
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function TC(e){return"toText"in e}class au{constructor(t){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=t,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(t){return this.classes.includes(t)}toNode(){for(var t=document.createDocumentFragment(),n=0;n<this.children.length;n++)t.appendChild(this.children[n].toNode());return t}toMarkup(){for(var t="",n=0;n<this.children.length;n++)t+=this.children[n].toMarkup();return t}toText(){return this.children.map(t=>{if(TC(t))return t.toText();throw new Error("Expected MathDomNode with toText, got "+t.constructor.name)}).join("")}}var Np={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},AC={ex:!0,em:!0,mu:!0},$v=function(t){return typeof t!="string"&&(t=t.unit),t in Np||t in AC||t==="ex"},cn=function(t,n){var a;if(t.unit in Np)a=Np[t.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(t.unit==="mu")a=n.fontMetrics().cssEmPerMu;else{var l;if(n.style.isTight()?l=n.havingStyle(n.style.text()):l=n,t.unit==="ex")a=l.fontMetrics().xHeight;else if(t.unit==="em")a=l.fontMetrics().quad;else throw new Ee("Invalid unit: '"+t.unit+"'");l!==n&&(a*=l.sizeMultiplier/n.sizeMultiplier)}return Math.min(t.number*a,n.maxSize)},Re=function(t){return+t.toFixed(4)+"em"},Ol=function(t){return t.filter(n=>n).join(" ")},N1=function(t){var n="";for(var a of Object.keys(t)){var l=t[a];l!==void 0&&(n+=tC(a)+":"+l+";")}return n},Fv=function(t,n,a){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=a||{},n){n.style.isTight()&&this.classes.push("mtight");var l=n.getColor();l&&(this.style.color=l)}},Pv=function(t){var n=document.createElement(t);n.className=Ol(this.classes),Object.assign(n.style,this.style);for(var a of Object.keys(this.attributes))n.setAttribute(a,this.attributes[a]);for(var l=0;l<this.children.length;l++)n.appendChild(this.children[l].toNode());return n},EC=/[\s"'>/=\x00-\x1f]/,Gv=function(t){var n="<"+t;this.classes.length&&(n+=' class="'+Qn(Ol(this.classes))+'"');var a=N1(this.style);a&&(n+=' style="'+Qn(a)+'"');for(var l of Object.keys(this.attributes)){if(EC.test(l))throw new Ee("Invalid attribute name '"+l+"'");n+=" "+l+'="'+Qn(this.attributes[l])+'"'}n+=">";for(var o=0;o<this.children.length;o++)n+=this.children[o].toMarkup();return n+="</"+t+">",n};class iu{constructor(t,n,a,l){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,Fv.call(this,t,a,l),this.children=n||[]}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return Pv.call(this,"span")}toMarkup(){return Gv.call(this,"span")}}class xf{constructor(t,n,a,l){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,Fv.call(this,n,l),this.children=a||[],this.setAttribute("href",t)}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return Pv.call(this,"a")}toMarkup(){return Gv.call(this,"a")}}class NC{constructor(t,n,a){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=n,this.src=t,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=a}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createElement("img");return t.src=this.src,t.alt=this.alt,t.className="mord",Object.assign(t.style,this.style),t}toMarkup(){var t='<img src="'+Qn(this.src)+'"'+(' alt="'+Qn(this.alt)+'"'),n=N1(this.style);return n&&(t+=' style="'+Qn(n)+'"'),t+="'/>",t}}var MC={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class Fr{constructor(t,n,a,l,o,c,f,h){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=t,this.height=n||0,this.depth=a||0,this.italic=l||0,this.skew=o||0,this.width=c||0,this.classes=f||[],this.style=h||{},this.maxFontSize=0;var m=pC(this.text.charCodeAt(0));m&&this.classes.push(m+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=MC[this.text])}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createTextNode(this.text),n=null;return this.italic>0&&(n=document.createElement("span"),n.style.marginRight=Re(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=Ol(this.classes)),Object.keys(this.style).length>0&&(n=n||document.createElement("span"),Object.assign(n.style,this.style)),n?(n.appendChild(t),n):t}toMarkup(){var t=!1,n="<span";this.classes.length&&(t=!0,n+=' class="',n+=Qn(Ol(this.classes)),n+='"');var a="";this.italic>0&&(a+="margin-right:"+Re(this.italic)+";"),a+=N1(this.style),a&&(t=!0,n+=' style="'+Qn(a)+'"');var l=Qn(this.text);return t?(n+=">",n+=l,n+="</span>",n):l}}class Li{constructor(t,n){this.children=void 0,this.attributes=void 0,this.children=t||[],this.attributes=n||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");for(var a of Object.keys(this.attributes))n.setAttribute(a,this.attributes[a]);for(var l=0;l<this.children.length;l++)n.appendChild(this.children[l].toNode());return n}toMarkup(){var t='<svg xmlns="http://www.w3.org/2000/svg"';for(var n of Object.keys(this.attributes))t+=" "+n+'="'+Qn(this.attributes[n])+'"';t+=">";for(var a=0;a<this.children.length;a++)t+=this.children[a].toMarkup();return t+="</svg>",t}}class Il{constructor(t,n){this.pathName=void 0,this.alternate=void 0,this.pathName=t,this.alternate=n}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"path");return this.alternate?n.setAttribute("d",this.alternate):n.setAttribute("d",Fy[this.pathName]),n}toMarkup(){return this.alternate?'<path d="'+Qn(this.alternate)+'"/>':'<path d="'+Qn(Fy[this.pathName])+'"/>'}}class Mp{constructor(t){this.attributes=void 0,this.attributes=t||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"line");for(var a of Object.keys(this.attributes))n.setAttribute(a,this.attributes[a]);return n}toMarkup(){var t="<line";for(var n of Object.keys(this.attributes))t+=" "+n+'="'+Qn(this.attributes[n])+'"';return t+="/>",t}}function zC(e){if(e instanceof Fr)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}function DC(e){if(e instanceof iu)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}var RC=e=>e instanceof iu||e instanceof xf||e instanceof au,Za={"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]}},jd={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]},Py={Å:"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 Vv(e,t){Za[e]=t}function M1(e,t,n){if(!Za[t])throw new Error("Font metrics not found for font: "+t+".");var a=e.charCodeAt(0),l=Za[t][a];if(!l&&e[0]in Py&&(a=Py[e[0]].charCodeAt(0),l=Za[t][a]),!l&&n==="text"&&Hv(a)&&(l=Za[t][77]),l)return{depth:l[0],height:l[1],italic:l[2],skew:l[3],width:l[4]}}var Bm={};function OC(e){var t;if(e>=5?t=0:e>=3?t=1:t=2,!Bm[t]){var n=Bm[t]={cssEmPerMu:jd.quad[t]/18};for(var a in jd)jd.hasOwnProperty(a)&&(n[a]=jd[a][t])}return Bm[t]}var ln={math:{},text:{}};function w(e,t,n,a,l,o){ln[e][l]={font:t,group:n,replace:a},o&&a&&(ln[e][a]=ln[e][l])}var S="math",ke="text",E="main",P="ams",sn="accent-token",Ue="bin",or="close",lu="inner",nt="mathord",Mn="op-token",Pr="open",e0="punct",G="rel",Ui="spacing",Z="textord";w(S,E,G,"≡","\\equiv",!0);w(S,E,G,"≺","\\prec",!0);w(S,E,G,"≻","\\succ",!0);w(S,E,G,"∼","\\sim",!0);w(S,E,G,"⊥","\\perp");w(S,E,G,"⪯","\\preceq",!0);w(S,E,G,"⪰","\\succeq",!0);w(S,E,G,"≃","\\simeq",!0);w(S,E,G,"∣","\\mid",!0);w(S,E,G,"≪","\\ll",!0);w(S,E,G,"≫","\\gg",!0);w(S,E,G,"≍","\\asymp",!0);w(S,E,G,"∥","\\parallel");w(S,E,G,"⋈","\\bowtie",!0);w(S,E,G,"⌣","\\smile",!0);w(S,E,G,"⊑","\\sqsubseteq",!0);w(S,E,G,"⊒","\\sqsupseteq",!0);w(S,E,G,"≐","\\doteq",!0);w(S,E,G,"⌢","\\frown",!0);w(S,E,G,"∋","\\ni",!0);w(S,E,G,"∝","\\propto",!0);w(S,E,G,"⊢","\\vdash",!0);w(S,E,G,"⊣","\\dashv",!0);w(S,E,G,"∋","\\owns");w(S,E,e0,".","\\ldotp");w(S,E,e0,"⋅","\\cdotp");w(S,E,e0,"⋅","·");w(ke,E,Z,"⋅","·");w(S,E,Z,"#","\\#");w(ke,E,Z,"#","\\#");w(S,E,Z,"&","\\&");w(ke,E,Z,"&","\\&");w(S,E,Z,"ℵ","\\aleph",!0);w(S,E,Z,"∀","\\forall",!0);w(S,E,Z,"ℏ","\\hbar",!0);w(S,E,Z,"∃","\\exists",!0);w(S,E,Z,"∇","\\nabla",!0);w(S,E,Z,"♭","\\flat",!0);w(S,E,Z,"ℓ","\\ell",!0);w(S,E,Z,"♮","\\natural",!0);w(S,E,Z,"♣","\\clubsuit",!0);w(S,E,Z,"℘","\\wp",!0);w(S,E,Z,"♯","\\sharp",!0);w(S,E,Z,"♢","\\diamondsuit",!0);w(S,E,Z,"ℜ","\\Re",!0);w(S,E,Z,"♡","\\heartsuit",!0);w(S,E,Z,"ℑ","\\Im",!0);w(S,E,Z,"♠","\\spadesuit",!0);w(S,E,Z,"§","\\S",!0);w(ke,E,Z,"§","\\S");w(S,E,Z,"¶","\\P",!0);w(ke,E,Z,"¶","\\P");w(S,E,Z,"†","\\dag");w(ke,E,Z,"†","\\dag");w(ke,E,Z,"†","\\textdagger");w(S,E,Z,"‡","\\ddag");w(ke,E,Z,"‡","\\ddag");w(ke,E,Z,"‡","\\textdaggerdbl");w(S,E,or,"⎱","\\rmoustache",!0);w(S,E,Pr,"⎰","\\lmoustache",!0);w(S,E,or,"⟯","\\rgroup",!0);w(S,E,Pr,"⟮","\\lgroup",!0);w(S,E,Ue,"∓","\\mp",!0);w(S,E,Ue,"⊖","\\ominus",!0);w(S,E,Ue,"⊎","\\uplus",!0);w(S,E,Ue,"⊓","\\sqcap",!0);w(S,E,Ue,"∗","\\ast");w(S,E,Ue,"⊔","\\sqcup",!0);w(S,E,Ue,"◯","\\bigcirc",!0);w(S,E,Ue,"∙","\\bullet",!0);w(S,E,Ue,"‡","\\ddagger");w(S,E,Ue,"≀","\\wr",!0);w(S,E,Ue,"⨿","\\amalg");w(S,E,Ue,"&","\\And");w(S,E,G,"⟵","\\longleftarrow",!0);w(S,E,G,"⇐","\\Leftarrow",!0);w(S,E,G,"⟸","\\Longleftarrow",!0);w(S,E,G,"⟶","\\longrightarrow",!0);w(S,E,G,"⇒","\\Rightarrow",!0);w(S,E,G,"⟹","\\Longrightarrow",!0);w(S,E,G,"↔","\\leftrightarrow",!0);w(S,E,G,"⟷","\\longleftrightarrow",!0);w(S,E,G,"⇔","\\Leftrightarrow",!0);w(S,E,G,"⟺","\\Longleftrightarrow",!0);w(S,E,G,"↦","\\mapsto",!0);w(S,E,G,"⟼","\\longmapsto",!0);w(S,E,G,"↗","\\nearrow",!0);w(S,E,G,"↩","\\hookleftarrow",!0);w(S,E,G,"↪","\\hookrightarrow",!0);w(S,E,G,"↘","\\searrow",!0);w(S,E,G,"↼","\\leftharpoonup",!0);w(S,E,G,"⇀","\\rightharpoonup",!0);w(S,E,G,"↙","\\swarrow",!0);w(S,E,G,"↽","\\leftharpoondown",!0);w(S,E,G,"⇁","\\rightharpoondown",!0);w(S,E,G,"↖","\\nwarrow",!0);w(S,E,G,"⇌","\\rightleftharpoons",!0);w(S,P,G,"≮","\\nless",!0);w(S,P,G,"","\\@nleqslant");w(S,P,G,"","\\@nleqq");w(S,P,G,"⪇","\\lneq",!0);w(S,P,G,"≨","\\lneqq",!0);w(S,P,G,"","\\@lvertneqq");w(S,P,G,"⋦","\\lnsim",!0);w(S,P,G,"⪉","\\lnapprox",!0);w(S,P,G,"⊀","\\nprec",!0);w(S,P,G,"⋠","\\npreceq",!0);w(S,P,G,"⋨","\\precnsim",!0);w(S,P,G,"⪹","\\precnapprox",!0);w(S,P,G,"≁","\\nsim",!0);w(S,P,G,"","\\@nshortmid");w(S,P,G,"∤","\\nmid",!0);w(S,P,G,"⊬","\\nvdash",!0);w(S,P,G,"⊭","\\nvDash",!0);w(S,P,G,"⋪","\\ntriangleleft");w(S,P,G,"⋬","\\ntrianglelefteq",!0);w(S,P,G,"⊊","\\subsetneq",!0);w(S,P,G,"","\\@varsubsetneq");w(S,P,G,"⫋","\\subsetneqq",!0);w(S,P,G,"","\\@varsubsetneqq");w(S,P,G,"≯","\\ngtr",!0);w(S,P,G,"","\\@ngeqslant");w(S,P,G,"","\\@ngeqq");w(S,P,G,"⪈","\\gneq",!0);w(S,P,G,"≩","\\gneqq",!0);w(S,P,G,"","\\@gvertneqq");w(S,P,G,"⋧","\\gnsim",!0);w(S,P,G,"⪊","\\gnapprox",!0);w(S,P,G,"⊁","\\nsucc",!0);w(S,P,G,"⋡","\\nsucceq",!0);w(S,P,G,"⋩","\\succnsim",!0);w(S,P,G,"⪺","\\succnapprox",!0);w(S,P,G,"≆","\\ncong",!0);w(S,P,G,"","\\@nshortparallel");w(S,P,G,"∦","\\nparallel",!0);w(S,P,G,"⊯","\\nVDash",!0);w(S,P,G,"⋫","\\ntriangleright");w(S,P,G,"⋭","\\ntrianglerighteq",!0);w(S,P,G,"","\\@nsupseteqq");w(S,P,G,"⊋","\\supsetneq",!0);w(S,P,G,"","\\@varsupsetneq");w(S,P,G,"⫌","\\supsetneqq",!0);w(S,P,G,"","\\@varsupsetneqq");w(S,P,G,"⊮","\\nVdash",!0);w(S,P,G,"⪵","\\precneqq",!0);w(S,P,G,"⪶","\\succneqq",!0);w(S,P,G,"","\\@nsubseteqq");w(S,P,Ue,"⊴","\\unlhd");w(S,P,Ue,"⊵","\\unrhd");w(S,P,G,"↚","\\nleftarrow",!0);w(S,P,G,"↛","\\nrightarrow",!0);w(S,P,G,"⇍","\\nLeftarrow",!0);w(S,P,G,"⇏","\\nRightarrow",!0);w(S,P,G,"↮","\\nleftrightarrow",!0);w(S,P,G,"⇎","\\nLeftrightarrow",!0);w(S,P,G,"△","\\vartriangle");w(S,P,Z,"ℏ","\\hslash");w(S,P,Z,"▽","\\triangledown");w(S,P,Z,"◊","\\lozenge");w(S,P,Z,"Ⓢ","\\circledS");w(S,P,Z,"®","\\circledR");w(ke,P,Z,"®","\\circledR");w(S,P,Z,"∡","\\measuredangle",!0);w(S,P,Z,"∄","\\nexists");w(S,P,Z,"℧","\\mho");w(S,P,Z,"Ⅎ","\\Finv",!0);w(S,P,Z,"⅁","\\Game",!0);w(S,P,Z,"‵","\\backprime");w(S,P,Z,"▲","\\blacktriangle");w(S,P,Z,"▼","\\blacktriangledown");w(S,P,Z,"■","\\blacksquare");w(S,P,Z,"⧫","\\blacklozenge");w(S,P,Z,"★","\\bigstar");w(S,P,Z,"∢","\\sphericalangle",!0);w(S,P,Z,"∁","\\complement",!0);w(S,P,Z,"ð","\\eth",!0);w(ke,E,Z,"ð","ð");w(S,P,Z,"╱","\\diagup");w(S,P,Z,"╲","\\diagdown");w(S,P,Z,"□","\\square");w(S,P,Z,"□","\\Box");w(S,P,Z,"◊","\\Diamond");w(S,P,Z,"¥","\\yen",!0);w(ke,P,Z,"¥","\\yen",!0);w(S,P,Z,"✓","\\checkmark",!0);w(ke,P,Z,"✓","\\checkmark");w(S,P,Z,"ℶ","\\beth",!0);w(S,P,Z,"ℸ","\\daleth",!0);w(S,P,Z,"ℷ","\\gimel",!0);w(S,P,Z,"ϝ","\\digamma",!0);w(S,P,Z,"ϰ","\\varkappa");w(S,P,Pr,"┌","\\@ulcorner",!0);w(S,P,or,"┐","\\@urcorner",!0);w(S,P,Pr,"└","\\@llcorner",!0);w(S,P,or,"┘","\\@lrcorner",!0);w(S,P,G,"≦","\\leqq",!0);w(S,P,G,"⩽","\\leqslant",!0);w(S,P,G,"⪕","\\eqslantless",!0);w(S,P,G,"≲","\\lesssim",!0);w(S,P,G,"⪅","\\lessapprox",!0);w(S,P,G,"≊","\\approxeq",!0);w(S,P,Ue,"⋖","\\lessdot");w(S,P,G,"⋘","\\lll",!0);w(S,P,G,"≶","\\lessgtr",!0);w(S,P,G,"⋚","\\lesseqgtr",!0);w(S,P,G,"⪋","\\lesseqqgtr",!0);w(S,P,G,"≑","\\doteqdot");w(S,P,G,"≓","\\risingdotseq",!0);w(S,P,G,"≒","\\fallingdotseq",!0);w(S,P,G,"∽","\\backsim",!0);w(S,P,G,"⋍","\\backsimeq",!0);w(S,P,G,"⫅","\\subseteqq",!0);w(S,P,G,"⋐","\\Subset",!0);w(S,P,G,"⊏","\\sqsubset",!0);w(S,P,G,"≼","\\preccurlyeq",!0);w(S,P,G,"⋞","\\curlyeqprec",!0);w(S,P,G,"≾","\\precsim",!0);w(S,P,G,"⪷","\\precapprox",!0);w(S,P,G,"⊲","\\vartriangleleft");w(S,P,G,"⊴","\\trianglelefteq");w(S,P,G,"⊨","\\vDash",!0);w(S,P,G,"⊪","\\Vvdash",!0);w(S,P,G,"⌣","\\smallsmile");w(S,P,G,"⌢","\\smallfrown");w(S,P,G,"≏","\\bumpeq",!0);w(S,P,G,"≎","\\Bumpeq",!0);w(S,P,G,"≧","\\geqq",!0);w(S,P,G,"⩾","\\geqslant",!0);w(S,P,G,"⪖","\\eqslantgtr",!0);w(S,P,G,"≳","\\gtrsim",!0);w(S,P,G,"⪆","\\gtrapprox",!0);w(S,P,Ue,"⋗","\\gtrdot");w(S,P,G,"⋙","\\ggg",!0);w(S,P,G,"≷","\\gtrless",!0);w(S,P,G,"⋛","\\gtreqless",!0);w(S,P,G,"⪌","\\gtreqqless",!0);w(S,P,G,"≖","\\eqcirc",!0);w(S,P,G,"≗","\\circeq",!0);w(S,P,G,"≜","\\triangleq",!0);w(S,P,G,"∼","\\thicksim");w(S,P,G,"≈","\\thickapprox");w(S,P,G,"⫆","\\supseteqq",!0);w(S,P,G,"⋑","\\Supset",!0);w(S,P,G,"⊐","\\sqsupset",!0);w(S,P,G,"≽","\\succcurlyeq",!0);w(S,P,G,"⋟","\\curlyeqsucc",!0);w(S,P,G,"≿","\\succsim",!0);w(S,P,G,"⪸","\\succapprox",!0);w(S,P,G,"⊳","\\vartriangleright");w(S,P,G,"⊵","\\trianglerighteq");w(S,P,G,"⊩","\\Vdash",!0);w(S,P,G,"∣","\\shortmid");w(S,P,G,"∥","\\shortparallel");w(S,P,G,"≬","\\between",!0);w(S,P,G,"⋔","\\pitchfork",!0);w(S,P,G,"∝","\\varpropto");w(S,P,G,"◀","\\blacktriangleleft");w(S,P,G,"∴","\\therefore",!0);w(S,P,G,"∍","\\backepsilon");w(S,P,G,"▶","\\blacktriangleright");w(S,P,G,"∵","\\because",!0);w(S,P,G,"⋘","\\llless");w(S,P,G,"⋙","\\gggtr");w(S,P,Ue,"⊲","\\lhd");w(S,P,Ue,"⊳","\\rhd");w(S,P,G,"≂","\\eqsim",!0);w(S,E,G,"⋈","\\Join");w(S,P,G,"≑","\\Doteq",!0);w(S,P,Ue,"∔","\\dotplus",!0);w(S,P,Ue,"∖","\\smallsetminus");w(S,P,Ue,"⋒","\\Cap",!0);w(S,P,Ue,"⋓","\\Cup",!0);w(S,P,Ue,"⩞","\\doublebarwedge",!0);w(S,P,Ue,"⊟","\\boxminus",!0);w(S,P,Ue,"⊞","\\boxplus",!0);w(S,P,Ue,"⋇","\\divideontimes",!0);w(S,P,Ue,"⋉","\\ltimes",!0);w(S,P,Ue,"⋊","\\rtimes",!0);w(S,P,Ue,"⋋","\\leftthreetimes",!0);w(S,P,Ue,"⋌","\\rightthreetimes",!0);w(S,P,Ue,"⋏","\\curlywedge",!0);w(S,P,Ue,"⋎","\\curlyvee",!0);w(S,P,Ue,"⊝","\\circleddash",!0);w(S,P,Ue,"⊛","\\circledast",!0);w(S,P,Ue,"⋅","\\centerdot");w(S,P,Ue,"⊺","\\intercal",!0);w(S,P,Ue,"⋒","\\doublecap");w(S,P,Ue,"⋓","\\doublecup");w(S,P,Ue,"⊠","\\boxtimes",!0);w(S,P,G,"⇢","\\dashrightarrow",!0);w(S,P,G,"⇠","\\dashleftarrow",!0);w(S,P,G,"⇇","\\leftleftarrows",!0);w(S,P,G,"⇆","\\leftrightarrows",!0);w(S,P,G,"⇚","\\Lleftarrow",!0);w(S,P,G,"↞","\\twoheadleftarrow",!0);w(S,P,G,"↢","\\leftarrowtail",!0);w(S,P,G,"↫","\\looparrowleft",!0);w(S,P,G,"⇋","\\leftrightharpoons",!0);w(S,P,G,"↶","\\curvearrowleft",!0);w(S,P,G,"↺","\\circlearrowleft",!0);w(S,P,G,"↰","\\Lsh",!0);w(S,P,G,"⇈","\\upuparrows",!0);w(S,P,G,"↿","\\upharpoonleft",!0);w(S,P,G,"⇃","\\downharpoonleft",!0);w(S,E,G,"⊶","\\origof",!0);w(S,E,G,"⊷","\\imageof",!0);w(S,P,G,"⊸","\\multimap",!0);w(S,P,G,"↭","\\leftrightsquigarrow",!0);w(S,P,G,"⇉","\\rightrightarrows",!0);w(S,P,G,"⇄","\\rightleftarrows",!0);w(S,P,G,"↠","\\twoheadrightarrow",!0);w(S,P,G,"↣","\\rightarrowtail",!0);w(S,P,G,"↬","\\looparrowright",!0);w(S,P,G,"↷","\\curvearrowright",!0);w(S,P,G,"↻","\\circlearrowright",!0);w(S,P,G,"↱","\\Rsh",!0);w(S,P,G,"⇊","\\downdownarrows",!0);w(S,P,G,"↾","\\upharpoonright",!0);w(S,P,G,"⇂","\\downharpoonright",!0);w(S,P,G,"⇝","\\rightsquigarrow",!0);w(S,P,G,"⇝","\\leadsto");w(S,P,G,"⇛","\\Rrightarrow",!0);w(S,P,G,"↾","\\restriction");w(S,E,Z,"‘","`");w(S,E,Z,"$","\\$");w(ke,E,Z,"$","\\$");w(ke,E,Z,"$","\\textdollar");w(S,E,Z,"%","\\%");w(ke,E,Z,"%","\\%");w(S,E,Z,"_","\\_");w(ke,E,Z,"_","\\_");w(ke,E,Z,"_","\\textunderscore");w(S,E,Z,"∠","\\angle",!0);w(S,E,Z,"∞","\\infty",!0);w(S,E,Z,"′","\\prime");w(S,E,Z,"△","\\triangle");w(S,E,Z,"Γ","\\Gamma",!0);w(S,E,Z,"Δ","\\Delta",!0);w(S,E,Z,"Θ","\\Theta",!0);w(S,E,Z,"Λ","\\Lambda",!0);w(S,E,Z,"Ξ","\\Xi",!0);w(S,E,Z,"Π","\\Pi",!0);w(S,E,Z,"Σ","\\Sigma",!0);w(S,E,Z,"Υ","\\Upsilon",!0);w(S,E,Z,"Φ","\\Phi",!0);w(S,E,Z,"Ψ","\\Psi",!0);w(S,E,Z,"Ω","\\Omega",!0);w(S,E,Z,"A","Α");w(S,E,Z,"B","Β");w(S,E,Z,"E","Ε");w(S,E,Z,"Z","Ζ");w(S,E,Z,"H","Η");w(S,E,Z,"I","Ι");w(S,E,Z,"K","Κ");w(S,E,Z,"M","Μ");w(S,E,Z,"N","Ν");w(S,E,Z,"O","Ο");w(S,E,Z,"P","Ρ");w(S,E,Z,"T","Τ");w(S,E,Z,"X","Χ");w(S,E,Z,"¬","\\neg",!0);w(S,E,Z,"¬","\\lnot");w(S,E,Z,"⊤","\\top");w(S,E,Z,"⊥","\\bot");w(S,E,Z,"∅","\\emptyset");w(S,P,Z,"∅","\\varnothing");w(S,E,nt,"α","\\alpha",!0);w(S,E,nt,"β","\\beta",!0);w(S,E,nt,"γ","\\gamma",!0);w(S,E,nt,"δ","\\delta",!0);w(S,E,nt,"ϵ","\\epsilon",!0);w(S,E,nt,"ζ","\\zeta",!0);w(S,E,nt,"η","\\eta",!0);w(S,E,nt,"θ","\\theta",!0);w(S,E,nt,"ι","\\iota",!0);w(S,E,nt,"κ","\\kappa",!0);w(S,E,nt,"λ","\\lambda",!0);w(S,E,nt,"μ","\\mu",!0);w(S,E,nt,"ν","\\nu",!0);w(S,E,nt,"ξ","\\xi",!0);w(S,E,nt,"ο","\\omicron",!0);w(S,E,nt,"π","\\pi",!0);w(S,E,nt,"ρ","\\rho",!0);w(S,E,nt,"σ","\\sigma",!0);w(S,E,nt,"τ","\\tau",!0);w(S,E,nt,"υ","\\upsilon",!0);w(S,E,nt,"ϕ","\\phi",!0);w(S,E,nt,"χ","\\chi",!0);w(S,E,nt,"ψ","\\psi",!0);w(S,E,nt,"ω","\\omega",!0);w(S,E,nt,"ε","\\varepsilon",!0);w(S,E,nt,"ϑ","\\vartheta",!0);w(S,E,nt,"ϖ","\\varpi",!0);w(S,E,nt,"ϱ","\\varrho",!0);w(S,E,nt,"ς","\\varsigma",!0);w(S,E,nt,"φ","\\varphi",!0);w(S,E,Ue,"∗","*",!0);w(S,E,Ue,"+","+");w(S,E,Ue,"−","-",!0);w(S,E,Ue,"⋅","\\cdot",!0);w(S,E,Ue,"∘","\\circ",!0);w(S,E,Ue,"÷","\\div",!0);w(S,E,Ue,"±","\\pm",!0);w(S,E,Ue,"×","\\times",!0);w(S,E,Ue,"∩","\\cap",!0);w(S,E,Ue,"∪","\\cup",!0);w(S,E,Ue,"∖","\\setminus",!0);w(S,E,Ue,"∧","\\land");w(S,E,Ue,"∨","\\lor");w(S,E,Ue,"∧","\\wedge",!0);w(S,E,Ue,"∨","\\vee",!0);w(S,E,Z,"√","\\surd");w(S,E,Pr,"⟨","\\langle",!0);w(S,E,Pr,"∣","\\lvert");w(S,E,Pr,"∥","\\lVert");w(S,E,or,"?","?");w(S,E,or,"!","!");w(S,E,or,"⟩","\\rangle",!0);w(S,E,or,"∣","\\rvert");w(S,E,or,"∥","\\rVert");w(S,E,G,"=","=");w(S,E,G,":",":");w(S,E,G,"≈","\\approx",!0);w(S,E,G,"≅","\\cong",!0);w(S,E,G,"≥","\\ge");w(S,E,G,"≥","\\geq",!0);w(S,E,G,"←","\\gets");w(S,E,G,">","\\gt",!0);w(S,E,G,"∈","\\in",!0);w(S,E,G,"","\\@not");w(S,E,G,"⊂","\\subset",!0);w(S,E,G,"⊃","\\supset",!0);w(S,E,G,"⊆","\\subseteq",!0);w(S,E,G,"⊇","\\supseteq",!0);w(S,P,G,"⊈","\\nsubseteq",!0);w(S,P,G,"⊉","\\nsupseteq",!0);w(S,E,G,"⊨","\\models");w(S,E,G,"←","\\leftarrow",!0);w(S,E,G,"≤","\\le");w(S,E,G,"≤","\\leq",!0);w(S,E,G,"<","\\lt",!0);w(S,E,G,"→","\\rightarrow",!0);w(S,E,G,"→","\\to");w(S,P,G,"≱","\\ngeq",!0);w(S,P,G,"≰","\\nleq",!0);w(S,E,Ui," ","\\ ");w(S,E,Ui," ","\\space");w(S,E,Ui," ","\\nobreakspace");w(ke,E,Ui," ","\\ ");w(ke,E,Ui," "," ");w(ke,E,Ui," ","\\space");w(ke,E,Ui," ","\\nobreakspace");w(S,E,Ui,"","\\nobreak");w(S,E,Ui,"","\\allowbreak");w(S,E,e0,",",",");w(S,E,e0,";",";");w(S,P,Ue,"⊼","\\barwedge",!0);w(S,P,Ue,"⊻","\\veebar",!0);w(S,E,Ue,"⊙","\\odot",!0);w(S,E,Ue,"⊕","\\oplus",!0);w(S,E,Ue,"⊗","\\otimes",!0);w(S,E,Z,"∂","\\partial",!0);w(S,E,Ue,"⊘","\\oslash",!0);w(S,P,Ue,"⊚","\\circledcirc",!0);w(S,P,Ue,"⊡","\\boxdot",!0);w(S,E,Ue,"△","\\bigtriangleup");w(S,E,Ue,"▽","\\bigtriangledown");w(S,E,Ue,"†","\\dagger");w(S,E,Ue,"⋄","\\diamond");w(S,E,Ue,"⋆","\\star");w(S,E,Ue,"◃","\\triangleleft");w(S,E,Ue,"▹","\\triangleright");w(S,E,Pr,"{","\\{");w(ke,E,Z,"{","\\{");w(ke,E,Z,"{","\\textbraceleft");w(S,E,or,"}","\\}");w(ke,E,Z,"}","\\}");w(ke,E,Z,"}","\\textbraceright");w(S,E,Pr,"{","\\lbrace");w(S,E,or,"}","\\rbrace");w(S,E,Pr,"[","\\lbrack",!0);w(ke,E,Z,"[","\\lbrack",!0);w(S,E,or,"]","\\rbrack",!0);w(ke,E,Z,"]","\\rbrack",!0);w(S,E,Pr,"(","\\lparen",!0);w(S,E,or,")","\\rparen",!0);w(ke,E,Z,"<","\\textless",!0);w(ke,E,Z,">","\\textgreater",!0);w(S,E,Pr,"⌊","\\lfloor",!0);w(S,E,or,"⌋","\\rfloor",!0);w(S,E,Pr,"⌈","\\lceil",!0);w(S,E,or,"⌉","\\rceil",!0);w(S,E,Z,"\\","\\backslash");w(S,E,Z,"∣","|");w(S,E,Z,"∣","\\vert");w(ke,E,Z,"|","\\textbar",!0);w(S,E,Z,"∥","\\|");w(S,E,Z,"∥","\\Vert");w(ke,E,Z,"∥","\\textbardbl");w(ke,E,Z,"~","\\textasciitilde");w(ke,E,Z,"\\","\\textbackslash");w(ke,E,Z,"^","\\textasciicircum");w(S,E,G,"↑","\\uparrow",!0);w(S,E,G,"⇑","\\Uparrow",!0);w(S,E,G,"↓","\\downarrow",!0);w(S,E,G,"⇓","\\Downarrow",!0);w(S,E,G,"↕","\\updownarrow",!0);w(S,E,G,"⇕","\\Updownarrow",!0);w(S,E,Mn,"∐","\\coprod");w(S,E,Mn,"⋁","\\bigvee");w(S,E,Mn,"⋀","\\bigwedge");w(S,E,Mn,"⨄","\\biguplus");w(S,E,Mn,"⋂","\\bigcap");w(S,E,Mn,"⋃","\\bigcup");w(S,E,Mn,"∫","\\int");w(S,E,Mn,"∫","\\intop");w(S,E,Mn,"∬","\\iint");w(S,E,Mn,"∭","\\iiint");w(S,E,Mn,"∏","\\prod");w(S,E,Mn,"∑","\\sum");w(S,E,Mn,"⨂","\\bigotimes");w(S,E,Mn,"⨁","\\bigoplus");w(S,E,Mn,"⨀","\\bigodot");w(S,E,Mn,"∮","\\oint");w(S,E,Mn,"∯","\\oiint");w(S,E,Mn,"∰","\\oiiint");w(S,E,Mn,"⨆","\\bigsqcup");w(S,E,Mn,"∫","\\smallint");w(ke,E,lu,"…","\\textellipsis");w(S,E,lu,"…","\\mathellipsis");w(ke,E,lu,"…","\\ldots",!0);w(S,E,lu,"…","\\ldots",!0);w(S,E,lu,"⋯","\\@cdots",!0);w(S,E,lu,"⋱","\\ddots",!0);w(S,E,Z,"⋮","\\varvdots");w(ke,E,Z,"⋮","\\varvdots");w(S,E,sn,"ˊ","\\acute");w(S,E,sn,"ˋ","\\grave");w(S,E,sn,"¨","\\ddot");w(S,E,sn,"~","\\tilde");w(S,E,sn,"ˉ","\\bar");w(S,E,sn,"˘","\\breve");w(S,E,sn,"ˇ","\\check");w(S,E,sn,"^","\\hat");w(S,E,sn,"⃗","\\vec");w(S,E,sn,"˙","\\dot");w(S,E,sn,"˚","\\mathring");w(S,E,nt,"","\\@imath");w(S,E,nt,"","\\@jmath");w(S,E,Z,"ı","ı");w(S,E,Z,"ȷ","ȷ");w(ke,E,Z,"ı","\\i",!0);w(ke,E,Z,"ȷ","\\j",!0);w(ke,E,Z,"ß","\\ss",!0);w(ke,E,Z,"æ","\\ae",!0);w(ke,E,Z,"œ","\\oe",!0);w(ke,E,Z,"ø","\\o",!0);w(ke,E,Z,"Æ","\\AE",!0);w(ke,E,Z,"Œ","\\OE",!0);w(ke,E,Z,"Ø","\\O",!0);w(ke,E,sn,"ˊ","\\'");w(ke,E,sn,"ˋ","\\`");w(ke,E,sn,"ˆ","\\^");w(ke,E,sn,"˜","\\~");w(ke,E,sn,"ˉ","\\=");w(ke,E,sn,"˘","\\u");w(ke,E,sn,"˙","\\.");w(ke,E,sn,"¸","\\c");w(ke,E,sn,"˚","\\r");w(ke,E,sn,"ˇ","\\v");w(ke,E,sn,"¨",'\\"');w(ke,E,sn,"˝","\\H");w(ke,E,sn,"◯","\\textcircled");var Yv={"--":!0,"---":!0,"``":!0,"''":!0};w(ke,E,Z,"–","--",!0);w(ke,E,Z,"–","\\textendash");w(ke,E,Z,"—","---",!0);w(ke,E,Z,"—","\\textemdash");w(ke,E,Z,"‘","`",!0);w(ke,E,Z,"‘","\\textquoteleft");w(ke,E,Z,"’","'",!0);w(ke,E,Z,"’","\\textquoteright");w(ke,E,Z,"“","``",!0);w(ke,E,Z,"“","\\textquotedblleft");w(ke,E,Z,"”","''",!0);w(ke,E,Z,"”","\\textquotedblright");w(S,E,Z,"°","\\degree",!0);w(ke,E,Z,"°","\\degree");w(ke,E,Z,"°","\\textdegree",!0);w(S,E,Z,"£","\\pounds");w(S,E,Z,"£","\\mathsterling",!0);w(ke,E,Z,"£","\\pounds");w(ke,E,Z,"£","\\textsterling",!0);w(S,P,Z,"✠","\\maltese");w(ke,P,Z,"✠","\\maltese");var Gy='0123456789/@."';for(var qm=0;qm<Gy.length;qm++){var Vy=Gy.charAt(qm);w(S,E,Z,Vy,Vy)}var Yy='0123456789!@*()-=+";:?/.,';for(var Um=0;Um<Yy.length;Um++){var Wy=Yy.charAt(Um);w(ke,E,Z,Wy,Wy)}var af="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(var Hm=0;Hm<af.length;Hm++){var Cd=af.charAt(Hm);w(S,E,nt,Cd,Cd),w(ke,E,Z,Cd,Cd)}w(S,P,Z,"C","ℂ");w(ke,P,Z,"C","ℂ");w(S,P,Z,"H","ℍ");w(ke,P,Z,"H","ℍ");w(S,P,Z,"N","ℕ");w(ke,P,Z,"N","ℕ");w(S,P,Z,"P","ℙ");w(ke,P,Z,"P","ℙ");w(S,P,Z,"Q","ℚ");w(ke,P,Z,"Q","ℚ");w(S,P,Z,"R","ℝ");w(ke,P,Z,"R","ℝ");w(S,P,Z,"Z","ℤ");w(ke,P,Z,"Z","ℤ");w(S,E,nt,"h","ℎ");w(ke,E,nt,"h","ℎ");var it;for(var ar=0;ar<af.length;ar++){var mn=af.charAt(ar);it=String.fromCharCode(55349,56320+ar),w(S,E,nt,mn,it),w(ke,E,Z,mn,it),it=String.fromCharCode(55349,56372+ar),w(S,E,nt,mn,it),w(ke,E,Z,mn,it),it=String.fromCharCode(55349,56424+ar),w(S,E,nt,mn,it),w(ke,E,Z,mn,it),it=String.fromCharCode(55349,56580+ar),w(S,E,nt,mn,it),w(ke,E,Z,mn,it),it=String.fromCharCode(55349,56684+ar),w(S,E,nt,mn,it),w(ke,E,Z,mn,it),it=String.fromCharCode(55349,56736+ar),w(S,E,nt,mn,it),w(ke,E,Z,mn,it),it=String.fromCharCode(55349,56788+ar),w(S,E,nt,mn,it),w(ke,E,Z,mn,it),it=String.fromCharCode(55349,56840+ar),w(S,E,nt,mn,it),w(ke,E,Z,mn,it),it=String.fromCharCode(55349,56944+ar),w(S,E,nt,mn,it),w(ke,E,Z,mn,it),ar<26&&(it=String.fromCharCode(55349,56632+ar),w(S,E,nt,mn,it),w(ke,E,Z,mn,it),it=String.fromCharCode(55349,56476+ar),w(S,E,nt,mn,it),w(ke,E,Z,mn,it))}it="𝕜";w(S,E,nt,"k",it);w(ke,E,Z,"k",it);for(var ws=0;ws<10;ws++){var Ml=ws.toString();it=String.fromCharCode(55349,57294+ws),w(S,E,nt,Ml,it),w(ke,E,Z,Ml,it),it=String.fromCharCode(55349,57314+ws),w(S,E,nt,Ml,it),w(ke,E,Z,Ml,it),it=String.fromCharCode(55349,57324+ws),w(S,E,nt,Ml,it),w(ke,E,Z,Ml,it),it=String.fromCharCode(55349,57334+ws),w(S,E,nt,Ml,it),w(ke,E,Z,Ml,it)}var zp="ÐÞþ";for(var $m=0;$m<zp.length;$m++){var Td=zp.charAt($m);w(S,E,nt,Td,Td),w(ke,E,Z,Td,Td)}var Dp={mathClass:"mathbf",textClass:"textbf",font:"Main-Bold"},Ky={mathClass:"mathnormal",textClass:"textit",font:"Math-Italic"},Xy={mathClass:"boldsymbol",textClass:"boldsymbol",font:"Main-BoldItalic"},IC={mathClass:"mathscr",textClass:"textscr",font:"Script-Regular"},Cs={mathClass:"",textClass:"",font:""},Zy={mathClass:"mathfrak",textClass:"textfrak",font:"Fraktur-Regular"},Qy={mathClass:"mathbb",textClass:"textbb",font:"AMS-Regular"},Jy={mathClass:"mathboldfrak",textClass:"textboldfrak",font:"Fraktur-Regular"},Rp={mathClass:"mathsf",textClass:"textsf",font:"SansSerif-Regular"},Op={mathClass:"mathboldsf",textClass:"textboldsf",font:"SansSerif-Bold"},e3={mathClass:"mathitsf",textClass:"textitsf",font:"SansSerif-Italic"},Ip={mathClass:"mathtt",textClass:"texttt",font:"Typewriter-Regular"},t3=[Dp,Dp,Ky,Ky,Xy,Xy,IC,Cs,Cs,Cs,Zy,Zy,Qy,Qy,Jy,Jy,Rp,Rp,Op,Op,e3,e3,Cs,Cs,Ip,Ip],_C=[Dp,Cs,Rp,Op,Ip],LC=e=>{var t=e.charCodeAt(0),n=e.charCodeAt(1),a=(t-55296)*1024+(n-56320)+65536;if(119808<=a&&a<120484){var l=Math.floor((a-119808)/26);return t3[l]}else if(120782<=a&&a<=120831){var o=Math.floor((a-120782)/10);return _C[o]}else{if(a===120485||a===120486)return t3[0];if(120486<a&&a<120782)return Cs;throw new Ee("Unsupported character: "+e)}},bf=function(t,n,a){if(ln[a][t]){var l=ln[a][t].replace;l&&(t=l)}return{value:t,metrics:M1(t,n,a)}},ir=function(t,n,a,l,o){var c=bf(t,n,a),f=c.metrics;t=c.value;var h;if(f){var m=f.italic;(a==="text"||l&&l.font==="mathit")&&(m=0),h=new Fr(t,f.height,f.depth,m,f.skew,f.width,o)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+t+"' in style '"+n+"' and mode '"+a+"'")),h=new Fr(t,0,0,0,0,0,o);if(l){h.maxFontSize=l.sizeMultiplier,l.style.isTight()&&h.classes.push("mtight");var g=l.getColor();g&&(h.style.color=g)}return h},z1=function(t,n,a,l){return l===void 0&&(l=[]),a.font==="boldsymbol"&&bf(t,"Main-Bold",n).metrics?ir(t,"Main-Bold",n,a,l.concat(["mathbf"])):t==="\\"||ln[n][t].font==="main"?ir(t,"Main-Regular",n,a,l):ir(t,"AMS-Regular",n,a,l.concat(["amsrm"]))},BC=function(t,n,a){return a!=="textord"&&bf(t,"Math-BoldItalic",n).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},wf=function(t,n,a){var l=t.mode,o=t.text,c=["mord"],{font:f,fontFamily:h,fontWeight:m,fontShape:g}=n,v=l==="math"||l==="text"&&!!f,k=v?f:h,b="",T="";if(o.charCodeAt(0)===55349){var A=LC(o);b=A.font,T=A[l+"Class"]}if(b)return ir(o,b,l,n,c.concat(T));if(k){var q,z;if(k==="boldsymbol"){var M=BC(o,l,a);q=M.fontName,z=[M.fontClass]}else v?(q=_p[f].fontName,z=[f]):(q=Ad(h,m,g),z=[h,m,g]);if(bf(o,q,l).metrics)return ir(o,q,l,n,c.concat(z));if(Yv.hasOwnProperty(o)&&q.slice(0,10)==="Typewriter"){for(var B=[],U=0;U<o.length;U++)B.push(ir(o[U],q,l,n,c.concat(z)));return Hi(B)}}if(a==="mathord")return ir(o,"Math-Italic",l,n,c.concat(["mathnormal"]));if(a==="textord"){var ne=ln[l][o]&&ln[l][o].font;if(ne==="ams"){var L=Ad("amsrm",m,g);return ir(o,L,l,n,c.concat("amsrm",m,g))}else if(ne==="main"||!ne){var K=Ad("textrm",m,g);return ir(o,K,l,n,c.concat(m,g))}else{var ie=Ad(ne,m,g);return ir(o,ie,l,n,c.concat(ie,m,g))}}else throw new Error("unexpected type: "+a+" in makeOrd")},qC=(e,t)=>{if(Ol(e.classes)!==Ol(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 a of Object.keys(e.style))if(e.style[a]!==t.style[a])return!1;for(var l of Object.keys(t.style))if(e.style[l]!==t.style[l])return!1;return!0},Wv=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],a=e[t+1];n instanceof Fr&&a instanceof Fr&&qC(n,a)&&(n.text+=a.text,n.height=Math.max(n.height,a.height),n.depth=Math.max(n.depth,a.depth),n.italic=a.italic,e.splice(t+1,1),t--)}return e},D1=function(t){for(var n=0,a=0,l=0,o=0;o<t.children.length;o++){var c=t.children[o];c.height>n&&(n=c.height),c.depth>a&&(a=c.depth),c.maxFontSize>l&&(l=c.maxFontSize)}t.height=n,t.depth=a,t.maxFontSize=l},Ce=function(t,n,a,l){var o=new iu(t,n,a,l);return D1(o),o},_l=(e,t,n,a)=>new iu(e,t,n,a),Jo=function(t,n,a){var l=Ce([t],[],n);return l.height=Math.max(a||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),l.style.borderBottomWidth=Re(l.height),l.maxFontSize=1,l},UC=function(t,n,a,l){var o=new xf(t,n,a,l);return D1(o),o},Hi=function(t){var n=new au(t);return D1(n),n},eu=function(t,n){return t instanceof au?Ce([],[t],n):t},HC=function(t){if(t.positionType==="individualShift"){for(var n=t.children,a=[n[0]],l=-n[0].shift-n[0].elem.depth,o=l,c=1;c<n.length;c++){var f=-n[c].shift-o-n[c].elem.depth,h=f-(n[c-1].elem.height+n[c-1].elem.depth);o=o+f,a.push({type:"kern",size:h}),a.push(n[c])}return{children:a,depth:l}}var m;if(t.positionType==="top"){for(var g=t.positionData,v=0;v<t.children.length;v++){var k=t.children[v];g-=k.type==="kern"?k.size:k.elem.height+k.elem.depth}m=g}else if(t.positionType==="bottom")m=-t.positionData;else{var b=t.children[0];if(b.type!=="elem")throw new Error('First child must have type "elem".');if(t.positionType==="shift")m=-b.elem.depth-t.positionData;else if(t.positionType==="firstBaseline")m=-b.elem.depth;else throw new Error("Invalid positionType "+t.positionType+".")}return{children:t.children,depth:m}},Ot=function(t,n){for(var{children:a,depth:l}=HC(t),o=0,c=0;c<a.length;c++){var f=a[c];if(f.type==="elem"){var h=f.elem;o=Math.max(o,h.maxFontSize,h.height)}}o+=2;var m=Ce(["pstrut"],[]);m.style.height=Re(o);for(var g=[],v=l,k=l,b=l,T=0;T<a.length;T++){var A=a[T];if(A.type==="kern")b+=A.size;else{var q=A.elem,z=A.wrapperClasses||[],M=A.wrapperStyle||{},B=Ce(z,[m,q],void 0,M);B.style.top=Re(-o-b-q.depth),A.marginLeft&&(B.style.marginLeft=A.marginLeft),A.marginRight&&(B.style.marginRight=A.marginRight),g.push(B),b+=q.height+q.depth}v=Math.min(v,b),k=Math.max(k,b)}var U=Ce(["vlist"],g);U.style.height=Re(k);var ne;if(v<0){var L=Ce([],[]),K=Ce(["vlist"],[L]);K.style.height=Re(-v);var ie=Ce(["vlist-s"],[new Fr("")]);ne=[Ce(["vlist-r"],[U,ie]),Ce(["vlist-r"],[K])]}else ne=[Ce(["vlist-r"],[U])];var Q=Ce(["vlist-t"],ne);return ne.length===2&&Q.classes.push("vlist-t2"),Q.height=k,Q.depth=-v,Q},Kv=(e,t)=>{var n=Ce(["mspace"],[],t),a=cn(e,t);return n.style.marginRight=Re(a),n},Ad=(e,t,n)=>{var a,l;switch(e){case"amsrm":a="AMS";break;case"textrm":a="Main";break;case"textsf":a="SansSerif";break;case"texttt":a="Typewriter";break;default:a=e}return t==="textbf"&&n==="textit"?l="BoldItalic":t==="textbf"?l="Bold":n==="textit"?l="Italic":l="Regular",a+"-"+l},_p={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"}},Xv={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Zv=function(t,n){var[a,l,o]=Xv[t],c=new Il(a),f=new Li([c],{width:Re(l),height:Re(o),style:"width:"+Re(l),viewBox:"0 0 "+1e3*l+" "+1e3*o,preserveAspectRatio:"xMinYMin"}),h=_l(["overlay"],[f],n);return h.height=o,h.style.height=Re(o),h.style.width=Re(l),h},un={number:3,unit:"mu"},ks={number:4,unit:"mu"},Oi={number:5,unit:"mu"},$C={mord:{mop:un,mbin:ks,mrel:Oi,minner:un},mop:{mord:un,mop:un,mrel:Oi,minner:un},mbin:{mord:ks,mop:ks,mopen:ks,minner:ks},mrel:{mord:Oi,mop:Oi,mopen:Oi,minner:Oi},mopen:{},mclose:{mop:un,mbin:ks,mrel:Oi,minner:un},mpunct:{mord:un,mop:un,mrel:Oi,mopen:un,mclose:un,mpunct:un,minner:un},minner:{mord:un,mop:un,mbin:ks,mrel:Oi,mopen:un,mpunct:un,minner:un}},FC={mord:{mop:un},mop:{mord:un,mop:un},mbin:{},mrel:{},mopen:{},mclose:{mop:un},mpunct:{},minner:{mop:un}},Qv={},lf={},sf={};function Le(e){for(var{type:t,names:n,props:a,handler:l,htmlBuilder:o,mathmlBuilder:c}=e,f={type:t,numArgs:a.numArgs,argTypes:a.argTypes,allowedInArgument:!!a.allowedInArgument,allowedInText:!!a.allowedInText,allowedInMath:a.allowedInMath===void 0?!0:a.allowedInMath,numOptionalArgs:a.numOptionalArgs||0,infix:!!a.infix,primitive:!!a.primitive,handler:l},h=0;h<n.length;++h)Qv[n[h]]=f;t&&(o&&(lf[t]=o),c&&(sf[t]=c))}function _s(e){var{type:t,htmlBuilder:n,mathmlBuilder:a}=e;Le({type:t,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:a})}var of=function(t){return t.type==="ordgroup"&&t.body.length===1?t.body[0]:t},En=function(t){return t.type==="ordgroup"?t.body:[t]},PC=new Set(["leftmost","mbin","mopen","mrel","mop","mpunct"]),GC=new Set(["rightmost","mrel","mclose","mpunct"]),VC={display:st.DISPLAY,text:st.TEXT,script:st.SCRIPT,scriptscript:st.SCRIPTSCRIPT},YC={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},_n=function(t,n,a,l){l===void 0&&(l=[null,null]);for(var o=[],c=0;c<t.length;c++){var f=It(t[c],n);if(f instanceof au){var h=f.children;o.push(...h)}else o.push(f)}if(Wv(o),!a)return o;var m=n;if(t.length===1){var g=t[0];g.type==="sizing"?m=n.havingSize(g.size):g.type==="styling"&&(m=n.havingStyle(VC[g.style]))}var v=Ce([l[0]||"leftmost"],[],n),k=Ce([l[1]||"rightmost"],[],n),b=a==="root";return Lp(o,(T,A)=>{var q=A.classes[0],z=T.classes[0];q==="mbin"&&GC.has(z)?A.classes[0]="mord":z==="mbin"&&PC.has(q)&&(T.classes[0]="mord")},{node:v},k,b),Lp(o,(T,A)=>{var q,z,M=qp(A),B=qp(T),U=M&&B?T.hasClass("mtight")?(q=FC[M])==null?void 0:q[B]:(z=$C[M])==null?void 0:z[B]:null;if(U)return Kv(U,m)},{node:v},k,b),o},Lp=function(t,n,a,l,o){l&&t.push(l);for(var c=0;c<t.length;c++){var f=t[c],h=Jv(f);if(h){Lp(h.children,n,a,null,o);continue}var m=!f.hasClass("mspace");if(m){var g=n(f,a.node);g&&(a.insertAfter?a.insertAfter(g):(t.unshift(g),c++))}m?a.node=f:o&&f.hasClass("newline")&&(a.node=Ce(["leftmost"])),a.insertAfter=(v=>k=>{t.splice(v+1,0,k),c++})(c)}l&&t.pop()},Jv=function(t){return t instanceof au||t instanceof xf||t instanceof iu&&t.hasClass("enclosing")?t:null},Bp=function(t,n){var a=Jv(t);if(a){var l=a.children;if(l.length){if(n==="right")return Bp(l[l.length-1],"right");if(n==="left")return Bp(l[0],"left")}}return t},qp=function(t,n){if(!t)return null;n&&(t=Bp(t,n));var a=t.classes[0];return YC[a]||null},Yc=function(t,n){var a=["nulldelimiter"].concat(t.baseSizingClasses());return Ce(n.concat(a))},It=function(t,n,a){if(!t)return Ce();if(lf[t.type]){var l=lf[t.type](t,n);if(a&&n.size!==a.size){l=Ce(n.sizingClasses(a),[l],n);var o=n.sizeMultiplier/a.sizeMultiplier;l.height*=o,l.depth*=o}return l}else throw new Ee("Got group of unknown type: '"+t.type+"'")};function Ed(e,t){var n=Ce(["base"],e,t),a=Ce(["strut"]);return a.style.height=Re(n.height+n.depth),n.depth&&(a.style.verticalAlign=Re(-n.depth)),n.children.unshift(a),n}function Up(e,t){var n=null;e.length===1&&e[0].type==="tag"&&(n=e[0].tag,e=e[0].body);var a=_n(e,t,"root"),l;a.length===2&&a[1].hasClass("tag")&&(l=a.pop());for(var o=[],c=[],f=0;f<a.length;f++)if(c.push(a[f]),a[f].hasClass("mbin")||a[f].hasClass("mrel")||a[f].hasClass("allowbreak")){for(var h=!1;f<a.length-1&&a[f+1].hasClass("mspace")&&!a[f+1].hasClass("newline");)f++,c.push(a[f]),a[f].hasClass("nobreak")&&(h=!0);h||(o.push(Ed(c,t)),c=[])}else a[f].hasClass("newline")&&(c.pop(),c.length>0&&(o.push(Ed(c,t)),c=[]),o.push(a[f]));c.length>0&&o.push(Ed(c,t));var m;n?(m=Ed(_n(n,t,!0),t),m.classes=["tag"],o.push(m)):l&&o.push(l);var g=Ce(["katex-html"],o);if(g.setAttribute("aria-hidden","true"),m){var v=m.children[0];v.style.height=Re(g.height+g.depth),g.depth&&(v.style.verticalAlign=Re(-g.depth))}return g}function e6(e){return new au(e)}class Me{constructor(t,n,a){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=t,this.attributes={},this.children=n||[],this.classes=a||[]}setAttribute(t,n){this.attributes[t]=n}getAttribute(t){return this.attributes[t]}toNode(){var t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);this.classes.length>0&&(t.className=Ol(this.classes));for(var a=0;a<this.children.length;a++)if(this.children[a]instanceof Nn&&this.children[a+1]instanceof Nn){for(var l=this.children[a].toText()+this.children[++a].toText();this.children[a+1]instanceof Nn;)l+=this.children[++a].toText();t.appendChild(new Nn(l).toNode())}else t.appendChild(this.children[a].toNode());return t}toMarkup(){var t="<"+this.type;for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(t+=" "+n+'="',t+=Qn(this.attributes[n]),t+='"');this.classes.length>0&&(t+=' class ="'+Qn(Ol(this.classes))+'"'),t+=">";for(var a=0;a<this.children.length;a++)t+=this.children[a].toMarkup();return t+="</"+this.type+">",t}toText(){return this.children.map(t=>t.toText()).join("")}}class Nn{constructor(t){this.text=void 0,this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return Qn(this.toText())}toText(){return this.text}}class t6{constructor(t){this.width=void 0,this.character=void 0,this.width=t,t>=.05555&&t<=.05556?this.character=" ":t>=.1666&&t<=.1667?this.character=" ":t>=.2222&&t<=.2223?this.character=" ":t>=.2777&&t<=.2778?this.character=" ":t>=-.05556&&t<=-.05555?this.character=" ":t>=-.1667&&t<=-.1666?this.character=" ":t>=-.2223&&t<=-.2222?this.character=" ":t>=-.2778&&t<=-.2777?this.character=" ":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var t=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return t.setAttribute("width",Re(this.width)),t}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+Re(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var WC=new Set(["\\imath","\\jmath"]),KC=new Set(["mrow","mtable"]),la=function(t,n,a){return ln[n][t]&&ln[n][t].replace&&t.charCodeAt(0)!==55349&&!(Yv.hasOwnProperty(t)&&a&&(a.fontFamily&&a.fontFamily.slice(4,6)==="tt"||a.font&&a.font.slice(4,6)==="tt"))&&(t=ln[n][t].replace),new Nn(t)},R1=function(t){return t.length===1?t[0]:new Me("mrow",t)},XC={mathit:"italic",boldsymbol:e=>e.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},O1=(e,t)=>{if(e.mode==="text"){if(t.fontFamily==="texttt")return"monospace";if(t.fontFamily==="textsf")return t.fontShape==="textit"&&t.fontWeight==="textbf"?"sans-serif-bold-italic":t.fontShape==="textit"?"sans-serif-italic":t.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";if(t.fontShape==="textit")return"italic";if(t.fontWeight==="textbf")return"bold"}var n=t.font;if(!n||n==="mathnormal")return null;var a=e.mode,l=XC[n];if(l)return typeof l=="function"?l(e):l;var o=e.text;if(WC.has(o))return null;if(ln[a][o]){var c=ln[a][o].replace;c&&(o=c)}var f=_p[n].fontName;return M1(o,f,a)?_p[n].variant:null};function Fm(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var t=e.children[0];return t instanceof Nn&&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 Nn&&n.text===","}else return!1}var Gr=function(t,n,a){if(t.length===1){var l=Qt(t[0],n);return a&&l instanceof Me&&l.type==="mo"&&(l.setAttribute("lspace","0em"),l.setAttribute("rspace","0em")),[l]}for(var o=[],c,f=0;f<t.length;f++){var h=Qt(t[f],n);if(h instanceof Me&&c instanceof Me){if(h.type==="mtext"&&c.type==="mtext"&&h.getAttribute("mathvariant")===c.getAttribute("mathvariant")){c.children.push(...h.children);continue}else if(h.type==="mn"&&c.type==="mn"){c.children.push(...h.children);continue}else if(Fm(h)&&c.type==="mn"){c.children.push(...h.children);continue}else if(h.type==="mn"&&Fm(c))h.children=[...c.children,...h.children],o.pop();else if((h.type==="msup"||h.type==="msub")&&h.children.length>=1&&(c.type==="mn"||Fm(c))){var m=h.children[0];m instanceof Me&&m.type==="mn"&&(m.children=[...c.children,...m.children],o.pop())}else if(c.type==="mi"&&c.children.length===1){var g=c.children[0];if(g instanceof Nn&&g.text==="̸"&&(h.type==="mo"||h.type==="mi"||h.type==="mn")){var v=h.children[0];v instanceof Nn&&v.text.length>0&&(v.text=v.text.slice(0,1)+"̸"+v.text.slice(1),o.pop())}}}o.push(h),c=h}return o},Ll=function(t,n,a){return R1(Gr(t,n,a))},Qt=function(t,n){if(!t)return new Me("mrow");if(sf[t.type])return sf[t.type](t,n);throw new Ee("Got group of unknown type: '"+t.type+"'")};function n3(e,t,n,a,l){var o=Gr(e,n),c;o.length===1&&o[0]instanceof Me&&KC.has(o[0].type)?c=o[0]:c=new Me("mrow",o);var f=new Me("annotation",[new Nn(t)]);f.setAttribute("encoding","application/x-tex");var h=new Me("semantics",[c,f]),m=new Me("math",[h]);m.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),a&&m.setAttribute("display","block");var g=l?"katex":"katex-mathml";return Ce([g],[m])}var ZC=[[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]],r3=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],a3=function(t,n){return n.size<2?t:ZC[t-1][n.size-1]};class Ii{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||Ii.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=r3[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 Ii(n)}havingStyle(t){return this.style===t?this:this.extend({style:t,size:a3(this.textSize,t)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(t){return this.size===t&&this.textSize===t?this:this.extend({style:this.style.text(),size:t,textSize:t,sizeMultiplier:r3[t-1]})}havingBaseStyle(t){t=t||this.style.text();var n=a3(Ii.BASESIZE,t);return this.size===n&&this.textSize===Ii.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var t;switch(this.style.id){case 4:case 5:t=3;break;case 6:case 7:t=1;break;default:t=6}return this.extend({style:this.style.text(),size:t})}withColor(t){return this.extend({color:t})}withPhantom(){return this.extend({phantom:!0})}withFont(t){return this.extend({font:t})}withTextFontFamily(t){return this.extend({fontFamily:t,font:""})}withTextFontWeight(t){return this.extend({fontWeight:t,font:""})}withTextFontShape(t){return this.extend({fontShape:t,font:""})}sizingClasses(t){return t.size!==this.size?["sizing","reset-size"+t.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Ii.BASESIZE?["sizing","reset-size"+this.size,"size"+Ii.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=OC(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Ii.BASESIZE=6;var n6=function(t){return new Ii({style:t.displayMode?st.DISPLAY:st.TEXT,maxSize:t.maxSize,minRuleThickness:t.minRuleThickness})},r6=function(t,n){if(n.displayMode){var a=["katex-display"];n.leqno&&a.push("leqno"),n.fleqn&&a.push("fleqn"),t=Ce(a,[t])}return t},QC=function(t,n,a){var l=n6(a),o;if(a.output==="mathml")return n3(t,n,l,a.displayMode,!0);if(a.output==="html"){var c=Up(t,l);o=Ce(["katex"],[c])}else{var f=n3(t,n,l,a.displayMode,!1),h=Up(t,l);o=Ce(["katex"],[f,h])}return r6(o,a)},JC=function(t,n,a){var l=n6(a),o=Up(t,l),c=Ce(["katex"],[o]);return r6(c,a)},eT={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":"="},kf=function(t){var n=new Me("mo",[new Nn(eT[t.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},tT={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]},nT=new Set(["widehat","widecheck","widetilde","utilde"]),Sf=function(t,n){function a(){var f=4e5,h=t.label.slice(1);if(nT.has(h)&&"base"in t){var m=t.base.type==="ordgroup"?t.base.body.length:1,g,v,k;if(m>5)h==="widehat"||h==="widecheck"?(g=420,f=2364,k=.42,v=h+"4"):(g=312,f=2340,k=.34,v="tilde4");else{var b=[1,1,2,2,3,3][m];h==="widehat"||h==="widecheck"?(f=[0,1062,2364,2364,2364][b],g=[0,239,300,360,420][b],k=[0,.24,.3,.3,.36,.42][b],v=h+b):(f=[0,600,1033,2339,2340][b],g=[0,260,286,306,312][b],k=[0,.26,.286,.3,.306,.34][b],v="tilde"+b)}var T=new Il(v),A=new Li([T],{width:"100%",height:Re(k),viewBox:"0 0 "+f+" "+g,preserveAspectRatio:"none"});return{span:_l([],[A],n),minWidth:0,height:k}}else{var q=[],z=tT[h];if(!z)throw new Error('No SVG data for "'+h+'".');var[M,B,U]=z,ne=U/1e3,L=M.length,K,ie;if(L===1){if(z.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+h+'".');K=["hide-tail"],ie=[z[3]]}else if(L===2)K=["halfarrow-left","halfarrow-right"],ie=["xMinYMin","xMaxYMin"];else if(L===3)K=["brace-left","brace-center","brace-right"],ie=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
|
|
333
|
+
`+L+" children.");for(var Q=0;Q<L;Q++){var F=new Il(M[Q]),he=new Li([F],{width:"400em",height:Re(ne),viewBox:"0 0 "+f+" "+U,preserveAspectRatio:ie[Q]+" slice"}),ce=_l([K[Q]],[he],n);if(L===1)return{span:ce,minWidth:B,height:ne};ce.style.height=Re(ne),q.push(ce)}return{span:Ce(["stretchy"],q,n),minWidth:B,height:ne}}}var{span:l,minWidth:o,height:c}=a();return l.height=c,l.style.height=Re(c),o>0&&(l.style.minWidth=Re(o)),l},rT=function(t,n,a,l,o){var c,f=t.height+t.depth+a+l;if(/fbox|color|angl/.test(n)){if(c=Ce(["stretchy",n],[],o),n==="fbox"){var h=o.color&&o.getColor();h&&(c.style.borderColor=h)}}else{var m=[];/^[bx]cancel$/.test(n)&&m.push(new Mp({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&m.push(new Mp({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var g=new Li(m,{width:"100%",height:Re(f)});c=_l([],[g],o)}return c.height=f,c.style.height=Re(f),c},aT={bin:1,close:1,inner:1,open:1,punct:1,rel:1},iT={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function lT(e){return e in aT}function ft(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function jf(e){var t=Cf(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function Cf(e){return e&&(e.type==="atom"||iT.hasOwnProperty(e.type))?e:null}var a6=e=>{if(e instanceof Fr)return e;if(RC(e)&&e.children.length===1)return a6(e.children[0])},I1=(e,t)=>{var n,a,l;e&&e.type==="supsub"?(a=ft(e.base,"accent"),n=a.base,e.base=n,l=DC(It(e,t)),e.base=a):(a=ft(e,"accent"),n=a.base);var o=It(n,t.havingCrampedStyle()),c=a.isShifty&&qi(n),f=0;if(c){var h,m;f=(h=(m=a6(o))==null?void 0:m.skew)!=null?h:0}var g=a.label==="\\c",v=g?o.height+o.depth:Math.min(o.height,t.fontMetrics().xHeight),k;if(a.isStretchy)k=Sf(a,t),k=Ot({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"elem",elem:k,wrapperClasses:["svg-align"],wrapperStyle:f>0?{width:"calc(100% - "+Re(2*f)+")",marginLeft:Re(2*f)}:void 0}]});else{var b,T;a.label==="\\vec"?(b=Zv("vec",t),T=Xv.vec[1]):(b=wf({mode:a.mode,text:a.label},t,"textord"),b=zC(b),b.italic=0,T=b.width,g&&(v+=b.depth)),k=Ce(["accent-body"],[b]);var A=a.label==="\\textcircled";A&&(k.classes.push("accent-full"),v=o.height);var q=f;A||(q-=T/2),k.style.left=Re(q),a.label==="\\textcircled"&&(k.style.top=".2em"),k=Ot({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:-v},{type:"elem",elem:k}]})}var z=Ce(["mord","accent"],[k],t);return l?(l.children[0]=z,l.height=Math.max(z.height,l.height),l.classes[0]="mord",l):z},i6=(e,t)=>{var n=e.isStretchy?kf(e.label):new Me("mo",[la(e.label,e.mode)]),a=new Me("mover",[Qt(e.base,t),n]);return a.setAttribute("accent","true"),a},sT=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));Le({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=of(t[0]),a=!sT.test(e.funcName),l=!a||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:a,isShifty:l,base:n}},htmlBuilder:I1,mathmlBuilder:i6});Le({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],a=e.parser.mode;return a==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),a="text"),{type:"accent",mode:a,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:I1,mathmlBuilder:i6});Le({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=t[0];return{type:"accentUnder",mode:n.mode,label:a,base:l}},htmlBuilder:(e,t)=>{var n=It(e.base,t),a=Sf(e,t),l=e.label==="\\utilde"?.12:0,o=Ot({positionType:"top",positionData:n.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:l},{type:"elem",elem:n}]});return Ce(["mord","accentunder"],[o],t)},mathmlBuilder:(e,t)=>{var n=kf(e.label),a=new Me("munder",[Qt(e.base,t),n]);return a.setAttribute("accentunder","true"),a}});var Nd=e=>{var t=new Me("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};Le({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:a,funcName:l}=e;return{type:"xArrow",mode:a.mode,label:l,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,a=t.havingStyle(n.sup()),l=eu(It(e.body,a,t),t),o=e.label.slice(0,2)==="\\x"?"x":"cd";l.classes.push(o+"-arrow-pad");var c;e.below&&(a=t.havingStyle(n.sub()),c=eu(It(e.below,a,t),t),c.classes.push(o+"-arrow-pad"));var f=Sf(e,t),h=-t.fontMetrics().axisHeight+.5*f.height,m=-t.fontMetrics().axisHeight-.5*f.height-.111;(l.depth>.25||e.label==="\\xleftequilibrium")&&(m-=l.depth);var g;if(c){var v=-t.fontMetrics().axisHeight+c.height+.5*f.height+.111;g=Ot({positionType:"individualShift",children:[{type:"elem",elem:l,shift:m},{type:"elem",elem:f,shift:h,wrapperClasses:["svg-align"]},{type:"elem",elem:c,shift:v}]})}else g=Ot({positionType:"individualShift",children:[{type:"elem",elem:l,shift:m},{type:"elem",elem:f,shift:h,wrapperClasses:["svg-align"]}]});return Ce(["mrel","x-arrow"],[g],t)},mathmlBuilder(e,t){var n=kf(e.label);n.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var a;if(e.body){var l=Nd(Qt(e.body,t));if(e.below){var o=Nd(Qt(e.below,t));a=new Me("munderover",[n,o,l])}else a=new Me("mover",[n,l])}else if(e.below){var c=Nd(Qt(e.below,t));a=new Me("munder",[n,c])}else a=Nd(),a=new Me("mover",[n,a]);return a}});function l6(e,t){var n=_n(e.body,t,!0);return Ce([e.mclass],n,t)}function s6(e,t){var n,a=Gr(e.body,t);return e.mclass==="minner"?n=new Me("mpadded",a):e.mclass==="mord"?e.isCharacterBox?(n=a[0],n.type="mi"):n=new Me("mi",a):(e.isCharacterBox?(n=a[0],n.type="mo"):n=new Me("mo",a),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}Le({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:a}=e,l=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+a.slice(5),body:En(l),isCharacterBox:qi(l)}},htmlBuilder:l6,mathmlBuilder:s6});var Tf=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"};Le({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:Tf(t[0]),body:En(t[1]),isCharacterBox:qi(t[1])}}});Le({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var{parser:n,funcName:a}=e,l=t[1],o=t[0],c;a!=="\\stackrel"?c=Tf(l):c="mrel";var f={type:"op",mode:l.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:a!=="\\stackrel",body:En(l)},h={type:"supsub",mode:o.mode,base:f,sup:a==="\\underset"?null:o,sub:a==="\\underset"?o:null};return{type:"mclass",mode:n.mode,mclass:c,body:[h],isCharacterBox:qi(h)}},htmlBuilder:l6,mathmlBuilder:s6});Le({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:Tf(t[0]),body:En(t[0])}},htmlBuilder(e,t){var n=_n(e.body,t,!0),a=Ce([e.mclass],n,t);return a.style.textShadow="0.02em 0.01em 0.04px",a},mathmlBuilder(e,t){var n=Gr(e.body,t),a=new Me("mstyle",n);return a.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),a}});var oT={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},i3=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),l3=e=>e.type==="textord"&&e.text==="@",uT=(e,t)=>(e.type==="mathord"||e.type==="atom")&&e.text===t;function cT(e,t,n){var a=oT[e];switch(a){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(a,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{var l=n.callFunction("\\\\cdleft",[t[0]],[]),o={type:"atom",text:a,mode:"math",family:"rel"},c=n.callFunction("\\Big",[o],[]),f=n.callFunction("\\\\cdright",[t[1]],[]),h={type:"ordgroup",mode:"math",body:[l,c,f]};return n.callFunction("\\\\cdparent",[h],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var m={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[m],[])}default:return{type:"textord",text:" ",mode:"math"}}}function dT(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 Ee("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var a=[],l=[a],o=0;o<t.length;o++){for(var c=t[o],f=i3(),h=0;h<c.length;h++)if(!l3(c[h]))f.body.push(c[h]);else{a.push(f),h+=1;var m=jf(c[h]).text,g=new Array(2);if(g[0]={type:"ordgroup",mode:"math",body:[]},g[1]={type:"ordgroup",mode:"math",body:[]},!"=|.".includes(m))if("<>AV".includes(m))for(var v=0;v<2;v++){for(var k=!0,b=h+1;b<c.length;b++){if(uT(c[b],m)){k=!1,h=b;break}if(l3(c[b]))throw new Ee("Missing a "+m+" character to complete a CD arrow.",c[b]);g[v].body.push(c[b])}if(k)throw new Ee("Missing a "+m+" character to complete a CD arrow.",c[h])}else throw new Ee('Expected one of "<>AV=|." after @',c[h]);var T=cT(m,g,e),A={type:"styling",body:[T],mode:"math",style:"display",resetFont:!0};a.push(A),f=i3()}o%2===0?a.push(f):a.shift(),a=[],l.push(a)}e.gullet.endGroup(),e.gullet.endGroup();var q=new Array(l[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:l,arraystretch:1,addJot:!0,rowGaps:[null],cols:q,colSeparationType:"CD",hLinesBeforeRow:new Array(l.length+1).fill([])}}Le({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:a}=e;return{type:"cdlabel",mode:n.mode,side:a.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),a=eu(It(e.label,n,t),t);return a.classes.push("cd-label-"+e.side),a.style.bottom=Re(.8-a.depth),a.height=0,a.depth=0,a},mathmlBuilder(e,t){var n=new Me("mrow",[Qt(e.label,t)]);return n=new Me("mpadded",[n]),n.setAttribute("width","0"),e.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new Me("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});Le({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=eu(It(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(e,t){return new Me("mrow",[Qt(e.fragment,t)])}});Le({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,a=ft(t[0],"ordgroup"),l=a.body,o="",c=0;c<l.length;c++){var f=ft(l[c],"textord");o+=f.text}var h=parseInt(o),m;if(isNaN(h))throw new Ee("\\@char has non-numeric argument "+o);if(h<0||h>=1114111)throw new Ee("\\@char with invalid code point "+o);return h<=65535?m=String.fromCharCode(h):(h-=65536,m=String.fromCharCode((h>>10)+55296,(h&1023)+56320)),{type:"textord",mode:n.mode,text:m}}});var o6=(e,t)=>{var n=_n(e.body,t.withColor(e.color),!1);return Hi(n)},u6=(e,t)=>{var n=Gr(e.body,t.withColor(e.color)),a=new Me("mstyle",n);return a.setAttribute("mathcolor",e.color),a};Le({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,a=ft(t[0],"color-token").color,l=t[1];return{type:"color",mode:n.mode,color:a,body:En(l)}},htmlBuilder:o6,mathmlBuilder:u6});Le({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:a}=e,l=ft(t[0],"color-token").color;n.gullet.macros.set("\\current@color",l);var o=n.parseExpression(!0,a);return{type:"color",mode:n.mode,color:l,body:o}},htmlBuilder:o6,mathmlBuilder:u6});Le({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:a}=e,l=a.gullet.future().text==="["?a.parseSizeGroup(!0):null,o=!a.settings.displayMode||!a.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:a.mode,newLine:o,size:l&&ft(l,"size").value}},htmlBuilder(e,t){var n=Ce(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=Re(cn(e.size,t)))),n},mathmlBuilder(e,t){var n=new Me("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",Re(cn(e.size,t)))),n}});var Hp={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},c6=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new Ee("Expected a control sequence",e);return t},fT=e=>{var t=e.gullet.popToken();return t.text==="="&&(t=e.gullet.popToken(),t.text===" "&&(t=e.gullet.popToken())),t},d6=(e,t,n,a)=>{var l=e.gullet.macros.get(n.text);l==null&&(n.noexpand=!0,l={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,l,a)};Le({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var a=t.fetch();if(Hp[a.text])return(n==="\\global"||n==="\\\\globallong")&&(a.text=Hp[a.text]),ft(t.parseFunction(),"internal");throw new Ee("Invalid token after macro prefix",a)}});Le({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,a=t.gullet.popToken(),l=a.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(l))throw new Ee("Expected a control sequence",a);for(var o=0,c,f=[[]];t.gullet.future().text!=="{";)if(a=t.gullet.popToken(),a.text==="#"){if(t.gullet.future().text==="{"){c=t.gullet.future(),f[o].push("{");break}if(a=t.gullet.popToken(),!/^[1-9]$/.test(a.text))throw new Ee('Invalid argument number "'+a.text+'"');if(parseInt(a.text)!==o+1)throw new Ee('Argument number "'+a.text+'" out of order');o++,f.push([])}else{if(a.text==="EOF")throw new Ee("Expected a macro definition");f[o].push(a.text)}var{tokens:h}=t.gullet.consumeArg();return c&&h.unshift(c),(n==="\\edef"||n==="\\xdef")&&(h=t.gullet.expandTokens(h),h.reverse()),t.gullet.macros.set(l,{tokens:h,numArgs:o,delimiters:f},n===Hp[n]),{type:"internal",mode:t.mode}}});Le({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,a=c6(t.gullet.popToken());t.gullet.consumeSpaces();var l=fT(t);return d6(t,a,l,n==="\\\\globallet"),{type:"internal",mode:t.mode}}});Le({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,a=c6(t.gullet.popToken()),l=t.gullet.popToken(),o=t.gullet.popToken();return d6(t,a,o,n==="\\\\globalfuture"),t.gullet.pushToken(o),t.gullet.pushToken(l),{type:"internal",mode:t.mode}}});var Mc=function(t,n,a){var l=ln.math[t]&&ln.math[t].replace,o=M1(l||t,n,a);if(!o)throw new Error("Unsupported symbol "+t+" and font size "+n+".");return o},_1=function(t,n,a,l){var o=a.havingBaseStyle(n),c=Ce(l.concat(o.sizingClasses(a)),[t],a),f=o.sizeMultiplier/a.sizeMultiplier;return c.height*=f,c.depth*=f,c.maxFontSize=o.sizeMultiplier,c},f6=function(t,n,a){var l=n.havingBaseStyle(a),o=(1-n.sizeMultiplier/l.sizeMultiplier)*n.fontMetrics().axisHeight;t.classes.push("delimcenter"),t.style.top=Re(o),t.height-=o,t.depth+=o},hT=function(t,n,a,l,o,c){var f=ir(t,"Main-Regular",o,l),h=_1(f,n,l,c);return f6(h,l,n),h},mT=function(t,n,a,l){return ir(t,"Size"+n+"-Regular",a,l)},h6=function(t,n,a,l,o,c){var f=mT(t,n,o,l),h=_1(Ce(["delimsizing","size"+n],[f],l),st.TEXT,l,c);return a&&f6(h,l,st.TEXT),h},Pm=function(t,n,a){var l;n==="Size1-Regular"?l="delim-size1":l="delim-size4";var o=Ce(["delimsizinginner",l],[Ce([],[ir(t,n,a)])]);return{type:"elem",elem:o}},Gm=function(t,n,a){var l=Za["Size4-Regular"][t.charCodeAt(0)]?Za["Size4-Regular"][t.charCodeAt(0)][4]:Za["Size1-Regular"][t.charCodeAt(0)][4],o=new Il("inner",jC(t,Math.round(1e3*n))),c=new Li([o],{width:Re(l),height:Re(n),style:"width:"+Re(l),viewBox:"0 0 "+1e3*l+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),f=_l([],[c],a);return f.height=n,f.style.height=Re(n),f.style.width=Re(l),{type:"elem",elem:f}},$p=.008,Md={type:"kern",size:-1*$p},pT=new Set(["|","\\lvert","\\rvert","\\vert"]),gT=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),m6=function(t,n,a,l,o,c){var f,h,m,g,v="",k=0;f=m=g=t,h=null;var b="Size1-Regular";t==="\\uparrow"?m=g="⏐":t==="\\Uparrow"?m=g="‖":t==="\\downarrow"?f=m="⏐":t==="\\Downarrow"?f=m="‖":t==="\\updownarrow"?(f="\\uparrow",m="⏐",g="\\downarrow"):t==="\\Updownarrow"?(f="\\Uparrow",m="‖",g="\\Downarrow"):pT.has(t)?(m="∣",v="vert",k=333):gT.has(t)?(m="∥",v="doublevert",k=556):t==="["||t==="\\lbrack"?(f="⎡",m="⎢",g="⎣",b="Size4-Regular",v="lbrack",k=667):t==="]"||t==="\\rbrack"?(f="⎤",m="⎥",g="⎦",b="Size4-Regular",v="rbrack",k=667):t==="\\lfloor"||t==="⌊"?(m=f="⎢",g="⎣",b="Size4-Regular",v="lfloor",k=667):t==="\\lceil"||t==="⌈"?(f="⎡",m=g="⎢",b="Size4-Regular",v="lceil",k=667):t==="\\rfloor"||t==="⌋"?(m=f="⎥",g="⎦",b="Size4-Regular",v="rfloor",k=667):t==="\\rceil"||t==="⌉"?(f="⎤",m=g="⎥",b="Size4-Regular",v="rceil",k=667):t==="("||t==="\\lparen"?(f="⎛",m="⎜",g="⎝",b="Size4-Regular",v="lparen",k=875):t===")"||t==="\\rparen"?(f="⎞",m="⎟",g="⎠",b="Size4-Regular",v="rparen",k=875):t==="\\{"||t==="\\lbrace"?(f="⎧",h="⎨",g="⎩",m="⎪",b="Size4-Regular"):t==="\\}"||t==="\\rbrace"?(f="⎫",h="⎬",g="⎭",m="⎪",b="Size4-Regular"):t==="\\lgroup"||t==="⟮"?(f="⎧",g="⎩",m="⎪",b="Size4-Regular"):t==="\\rgroup"||t==="⟯"?(f="⎫",g="⎭",m="⎪",b="Size4-Regular"):t==="\\lmoustache"||t==="⎰"?(f="⎧",g="⎭",m="⎪",b="Size4-Regular"):(t==="\\rmoustache"||t==="⎱")&&(f="⎫",g="⎩",m="⎪",b="Size4-Regular");var T=Mc(f,b,o),A=T.height+T.depth,q=Mc(m,b,o),z=q.height+q.depth,M=Mc(g,b,o),B=M.height+M.depth,U=0,ne=1;if(h!==null){var L=Mc(h,b,o);U=L.height+L.depth,ne=2}var K=A+B+U,ie=Math.max(0,Math.ceil((n-K)/(ne*z))),Q=K+ie*ne*z,F=l.fontMetrics().axisHeight;a&&(F*=l.sizeMultiplier);var he=Q/2-F,ce=[];if(v.length>0){var Ie=Q-A-B,be=Math.round(Q*1e3),pe=CC(v,Math.round(Ie*1e3)),J=new Il(v,pe),Y=Re(k/1e3),ge=Re(be/1e3),Te=new Li([J],{width:Y,height:ge,viewBox:"0 0 "+k+" "+be}),H=_l([],[Te],l);H.height=be/1e3,H.style.width=Y,H.style.height=ge,ce.push({type:"elem",elem:H})}else{if(ce.push(Pm(g,b,o)),ce.push(Md),h===null){var _=Q-A-B+2*$p;ce.push(Gm(m,_,l))}else{var te=(Q-A-B-U)/2+2*$p;ce.push(Gm(m,te,l)),ce.push(Md),ce.push(Pm(h,b,o)),ce.push(Md),ce.push(Gm(m,te,l))}ce.push(Md),ce.push(Pm(f,b,o))}var O=l.havingBaseStyle(st.TEXT),ee=Ot({positionType:"bottom",positionData:he,children:ce});return _1(Ce(["delimsizing","mult"],[ee],O),st.TEXT,l,c)},Vm=80,Ym=.08,Wm=function(t,n,a,l,o){var c=SC(t,l,a),f=new Il(t,c),h=new Li([f],{width:"400em",height:Re(n),viewBox:"0 0 400000 "+a,preserveAspectRatio:"xMinYMin slice"});return _l(["hide-tail"],[h],o)},yT=function(t,n){var a=n.havingBaseSizing(),l=x6("\\surd",t*a.sizeMultiplier,v6,a),o=a.sizeMultiplier,c=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),f,h,m,g,v;return l.type==="small"?(g=1e3+1e3*c+Vm,t<1?o=1:t<1.4&&(o=.7),h=(1+c+Ym)/o,m=(1+c)/o,f=Wm("sqrtMain",h,g,c,n),f.style.minWidth="0.853em",v=.833/o):l.type==="large"?(g=(1e3+Vm)*Lc[l.size],m=(Lc[l.size]+c)/o,h=(Lc[l.size]+c+Ym)/o,f=Wm("sqrtSize"+l.size,h,g,c,n),f.style.minWidth="1.02em",v=1/o):(h=t+c+Ym,m=t+c,g=Math.floor(1e3*t+c)+Vm,f=Wm("sqrtTall",h,g,c,n),f.style.minWidth="0.742em",v=1.056),f.height=m,f.style.height=Re(h),{span:f,advanceWidth:v,ruleWidth:(n.fontMetrics().sqrtRuleThickness+c)*o}},p6=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),vT=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),g6=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),Lc=[0,1.2,1.8,2.4,3],y6=function(t,n,a,l,o){if(t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle"),p6.has(t)||g6.has(t))return h6(t,n,!1,a,l,o);if(vT.has(t))return m6(t,Lc[n],!1,a,l,o);throw new Ee("Illegal delimiter: '"+t+"'")},xT=[{type:"small",style:st.SCRIPTSCRIPT},{type:"small",style:st.SCRIPT},{type:"small",style:st.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],bT=[{type:"small",style:st.SCRIPTSCRIPT},{type:"small",style:st.SCRIPT},{type:"small",style:st.TEXT},{type:"stack"}],v6=[{type:"small",style:st.SCRIPTSCRIPT},{type:"small",style:st.SCRIPT},{type:"small",style:st.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],wT=function(t){if(t.type==="small")return"Main-Regular";if(t.type==="large")return"Size"+t.size+"-Regular";if(t.type==="stack")return"Size4-Regular";var n=t.type;throw new Error("Add support for delim type '"+n+"' here.")},x6=function(t,n,a,l){for(var o=Math.min(2,3-l.style.size),c=o;c<a.length;c++){var f=a[c];if(f.type==="stack")break;var h=Mc(t,wT(f),"math"),m=h.height+h.depth;if(f.type==="small"){var g=l.havingBaseStyle(f.style);m*=g.sizeMultiplier}if(m>n)return f}return a[a.length-1]},Fp=function(t,n,a,l,o,c){t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle");var f;g6.has(t)?f=xT:p6.has(t)?f=v6:f=bT;var h=x6(t,n,f,l);return h.type==="small"?hT(t,h.style,a,l,o,c):h.type==="large"?h6(t,h.size,a,l,o,c):m6(t,n,a,l,o,c)},Km=function(t,n,a,l,o,c){var f=l.fontMetrics().axisHeight*l.sizeMultiplier,h=901,m=5/l.fontMetrics().ptPerEm,g=Math.max(n-f,a+f),v=Math.max(g/500*h,2*g-m);return Fp(t,v,!0,l,o,c)},s3={"\\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}},kT=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","."]);function o3(e){return"isMiddle"in e}function Af(e,t){var n=Cf(e);if(n&&kT.has(n.text))return n;throw n?new Ee("Invalid delimiter '"+n.text+"' after '"+t.funcName+"'",e):new Ee("Invalid delimiter type '"+e.type+"'",e)}Le({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=Af(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:s3[e.funcName].size,mclass:s3[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim==="."?Ce([e.mclass]):y6(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!=="."&&t.push(la(e.delim,e.mode));var n=new Me("mo",t);e.mclass==="mopen"||e.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var a=Re(Lc[e.size]);return n.setAttribute("minsize",a),n.setAttribute("maxsize",a),n}});function u3(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Le({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 Ee("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Af(t[0],e).text,color:n}}});Le({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Af(t[0],e),a=e.parser;++a.leftrightDepth;var l=a.parseExpression(!1);--a.leftrightDepth,a.expect("\\right",!1);var o=ft(a.parseFunction(),"leftright-right");return{type:"leftright",mode:a.mode,body:l,left:n.text,right:o.delim,rightColor:o.color}},htmlBuilder:(e,t)=>{u3(e);for(var n=_n(e.body,t,!0,["mopen","mclose"]),a=0,l=0,o=!1,c=0;c<n.length;c++){var f=n[c];o3(f)?o=!0:(a=Math.max(n[c].height,a),l=Math.max(n[c].depth,l))}a*=t.sizeMultiplier,l*=t.sizeMultiplier;var h;if(e.left==="."?h=Yc(t,["mopen"]):h=Km(e.left,a,l,t,e.mode,["mopen"]),n.unshift(h),o)for(var m=1;m<n.length;m++){var g=n[m];if(o3(g)){var v=g.isMiddle;n[m]=Km(v.delim,a,l,v.options,e.mode,[])}}var k;if(e.right===".")k=Yc(t,["mclose"]);else{var b=e.rightColor?t.withColor(e.rightColor):t;k=Km(e.right,a,l,b,e.mode,["mclose"])}return n.push(k),Ce(["minner"],n,t)},mathmlBuilder:(e,t)=>{u3(e);var n=Gr(e.body,t);if(e.left!=="."){var a=new Me("mo",[la(e.left,e.mode)]);a.setAttribute("fence","true"),n.unshift(a)}if(e.right!=="."){var l=new Me("mo",[la(e.right,e.mode)]);l.setAttribute("fence","true"),e.rightColor&&l.setAttribute("mathcolor",e.rightColor),n.push(l)}return R1(n)}});Le({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Af(t[0],e);if(!e.parser.leftrightDepth)throw new Ee("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim==="."?n=Yc(t,[]):(n=y6(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t}),n},mathmlBuilder:(e,t)=>{var n=e.delim==="\\vert"||e.delim==="|"?la("|","text"):la(e.delim,e.mode),a=new Me("mo",[n]);return a.setAttribute("fence","true"),a.setAttribute("lspace","0.05em"),a.setAttribute("rspace","0.05em"),a}});var Ef=(e,t)=>{var n=eu(It(e.body,t),t),a=e.label.slice(1),l=t.sizeMultiplier,o,c,f=qi(e.body);if(a==="sout")o=Ce(["stretchy","sout"]),o.height=t.fontMetrics().defaultRuleThickness/l,c=-.5*t.fontMetrics().xHeight;else if(a==="phase"){var h=cn({number:.6,unit:"pt"},t),m=cn({number:.35,unit:"ex"},t),g=t.havingBaseSizing();l=l/g.sizeMultiplier;var v=n.height+n.depth+h+m;n.style.paddingLeft=Re(v/2+h);var k=Math.floor(1e3*v*l),b=wC(k),T=new Li([new Il("phase",b)],{width:"400em",height:Re(k/1e3),viewBox:"0 0 400000 "+k,preserveAspectRatio:"xMinYMin slice"});o=_l(["hide-tail"],[T],t),o.style.height=Re(v),c=n.depth+h+m}else{/cancel/.test(a)?f||n.classes.push("cancel-pad"):a==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var A,q,z=0;/box/.test(a)?(z=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),A=t.fontMetrics().fboxsep+(a==="colorbox"?0:z),q=A):a==="angl"?(z=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),A=4*z,q=Math.max(0,.25-n.depth)):(A=f?.2:0,q=A),o=rT(n,a,A,q,t),/fbox|boxed|fcolorbox/.test(a)?(o.style.borderStyle="solid",o.style.borderWidth=Re(z)):a==="angl"&&z!==.049&&(o.style.borderTopWidth=Re(z),o.style.borderRightWidth=Re(z)),c=n.depth+q,e.backgroundColor&&(o.style.backgroundColor=e.backgroundColor,e.borderColor&&(o.style.borderColor=e.borderColor))}var M;if(e.backgroundColor)M=Ot({positionType:"individualShift",children:[{type:"elem",elem:o,shift:c},{type:"elem",elem:n,shift:0}]});else{var B=/cancel|phase/.test(a)?["svg-align"]:[];M=Ot({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:o,shift:c,wrapperClasses:B}]})}return/cancel/.test(a)&&(M.height=n.height,M.depth=n.depth),/cancel/.test(a)&&!f?Ce(["mord","cancel-lap"],[M],t):Ce(["mord"],[M],t)},Nf=(e,t)=>{var n,a=new Me(e.label.includes("colorbox")?"mpadded":"menclose",[Qt(e.body,t)]);switch(e.label){case"\\cancel":a.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":a.setAttribute("notation","downdiagonalstrike");break;case"\\phase":a.setAttribute("notation","phasorangle");break;case"\\sout":a.setAttribute("notation","horizontalstrike");break;case"\\fbox":a.setAttribute("notation","box");break;case"\\angl":a.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,a.setAttribute("width","+"+2*n+"pt"),a.setAttribute("height","+"+2*n+"pt"),a.setAttribute("lspace",n+"pt"),a.setAttribute("voffset",n+"pt"),e.label==="\\fcolorbox"){var l=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);a.setAttribute("style","border: "+Re(l)+" solid "+e.borderColor)}break;case"\\xcancel":a.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&a.setAttribute("mathbackground",e.backgroundColor),a};Le({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,t,n){var{parser:a,funcName:l}=e,o=ft(t[0],"color-token").color,c=t[1];return{type:"enclose",mode:a.mode,label:l,backgroundColor:o,body:c}},htmlBuilder:Ef,mathmlBuilder:Nf});Le({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,t,n){var{parser:a,funcName:l}=e,o=ft(t[0],"color-token").color,c=ft(t[1],"color-token").color,f=t[2];return{type:"enclose",mode:a.mode,label:l,backgroundColor:c,borderColor:o,body:f}},htmlBuilder:Ef,mathmlBuilder:Nf});Le({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]}}});Le({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:a}=e,l=t[0];return{type:"enclose",mode:n.mode,label:a,body:l}},htmlBuilder:Ef,mathmlBuilder:Nf});Le({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n,funcName:a}=e;n.mode==="math"&&n.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var l=t[0];return{type:"enclose",mode:n.mode,label:a,body:l}},htmlBuilder:Ef,mathmlBuilder:Nf});Le({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 b6={};function ti(e){for(var{type:t,names:n,props:a,handler:l,htmlBuilder:o,mathmlBuilder:c}=e,f={type:t,numArgs:a.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:l},h=0;h<n.length;++h)b6[n[h]]=f;o&&(lf[t]=o),c&&(sf[t]=c)}var w6={};function I(e,t){w6[e]=t}class Sr{constructor(t,n,a){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=t,this.start=n,this.end=a}static range(t,n){return n?!t||!t.loc||!n.loc||t.loc.lexer!==n.loc.lexer?null:new Sr(t.loc.lexer,t.loc.start,n.loc.end):t&&t.loc}}class $r{constructor(t,n){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=t,this.loc=n}range(t,n){return new $r(n,Sr.range(this,t))}}function c3(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 Mf=e=>{var t=e.parser.settings;if(!t.displayMode)throw new Ee("{"+e.envName+"} can be used only in display mode.")},ST=new Set(["gather","gather*"]);function L1(e){if(!e.includes("ed"))return!e.includes("*")}function Hl(e,t,n){var{hskipBeforeAndAfter:a,addJot:l,cols:o,arraystretch:c,colSeparationType:f,autoTag:h,singleRow:m,emptySingleRow:g,maxNumCols:v,leqno:k}=t;if(e.gullet.beginGroup(),m||e.gullet.macros.set("\\cr","\\\\\\relax"),!c){var b=e.gullet.expandMacroAsText("\\arraystretch");if(b==null)c=1;else if(c=parseFloat(b),!c||c<0)throw new Ee("Invalid \\arraystretch: "+b)}e.gullet.beginGroup();var T=[],A=[T],q=[],z=[],M=h!=null?[]:void 0;function B(){h&&e.gullet.macros.set("\\@eqnsw","1",!0)}function U(){M&&(e.gullet.macros.get("\\df@tag")?(M.push(e.subparse([new $r("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):M.push(!!h&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(B(),z.push(c3(e));;){var ne=e.parseExpression(!1,m?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var L={type:"ordgroup",mode:e.mode,body:ne};n&&(L={type:"styling",mode:e.mode,style:n,resetFont:!0,body:[L]}),T.push(L);var K=e.fetch().text;if(K==="&"){if(v&&T.length===v){if(m||f)throw new Ee("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(K==="\\end"){U(),T.length===1&&L.type==="styling"&&L.body.length===1&&L.body[0].type==="ordgroup"&&L.body[0].body.length===0&&(A.length>1||!g)&&A.pop(),z.length<A.length+1&&z.push([]);break}else if(K==="\\\\"){e.consume();var ie=void 0;e.gullet.future().text!==" "&&(ie=e.parseSizeGroup(!0)),q.push(ie?ie.value:null),U(),z.push(c3(e)),T=[],A.push(T),B()}else throw new Ee("Expected & or \\\\ or \\cr or \\end",e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:l,arraystretch:c,body:A,cols:o,rowGaps:q,hskipBeforeAndAfter:a,hLinesBeforeRow:z,colSeparationType:f,tags:M,leqno:k}}function B1(e){return e.slice(0,1)==="d"?"display":"text"}var ni=function(t,n){var a,l,o=t.body.length,c=t.hLinesBeforeRow,f=0,h=new Array(o),m=[],g=Math.max(n.fontMetrics().arrayRuleWidth,n.minRuleThickness),v=1/n.fontMetrics().ptPerEm,k=5*v;if(t.colSeparationType&&t.colSeparationType==="small"){var b=n.havingStyle(st.SCRIPT).sizeMultiplier;k=.2778*(b/n.sizeMultiplier)}var T=t.colSeparationType==="CD"?cn({number:3,unit:"ex"},n):12*v,A=3*v,q=t.arraystretch*T,z=.7*q,M=.3*q,B=0;function U($e){for(var at=0;at<$e.length;++at)at>0&&(B+=.25),m.push({pos:B,isDashed:$e[at]})}for(U(c[0]),a=0;a<t.body.length;++a){var ne=t.body[a],L=z,K=M;f<ne.length&&(f=ne.length);var ie={cells:new Array(ne.length),height:0,depth:0,pos:0};for(l=0;l<ne.length;++l){var Q=It(ne[l],n);K<Q.depth&&(K=Q.depth),L<Q.height&&(L=Q.height),ie.cells[l]=Q}var F=t.rowGaps[a],he=0;F&&(he=cn(F,n),he>0&&(he+=M,K<he&&(K=he),he=0)),t.addJot&&a<t.body.length-1&&(K+=A),ie.height=L,ie.depth=K,B+=L,ie.pos=B,B+=K+he,h[a]=ie,U(c[a+1])}var ce=B/2+n.fontMetrics().axisHeight,Ie=t.cols||[],be=[],pe,J,Y=[];if(t.tags&&t.tags.some($e=>$e))for(a=0;a<o;++a){var ge=h[a],Te=ge.pos-ce,H=t.tags[a],_=void 0;H===!0?_=Ce(["eqn-num"],[],n):H===!1?_=Ce([],[],n):_=Ce([],_n(H,n,!0),n),_.depth=ge.depth,_.height=ge.height,Y.push({type:"elem",elem:_,shift:Te})}for(l=0,J=0;l<f||J<Ie.length;++l,++J){for(var te,O=Ie[J],ee=!0;((Ae=O)==null?void 0:Ae.type)==="separator";){var Ae;if(ee||(pe=Ce(["arraycolsep"],[]),pe.style.width=Re(n.fontMetrics().doubleRuleSep),be.push(pe)),O.separator==="|"||O.separator===":"){var re=O.separator==="|"?"solid":"dashed",we=Ce(["vertical-separator"],[],n);we.style.height=Re(B),we.style.borderRightWidth=Re(g),we.style.borderRightStyle=re,we.style.margin="0 "+Re(-g/2);var _e=B-ce;_e&&(we.style.verticalAlign=Re(-_e)),be.push(we)}else throw new Ee("Invalid separator type: "+O.separator);J++,O=Ie[J],ee=!1}if(!(l>=f)){var He=void 0;if(l>0||t.hskipBeforeAndAfter){var wt,et;He=(wt=(et=O)==null?void 0:et.pregap)!=null?wt:k,He!==0&&(pe=Ce(["arraycolsep"],[]),pe.style.width=Re(He),be.push(pe))}var $t=[];for(a=0;a<o;++a){var tt=h[a],fe=tt.cells[l];if(fe){var qe=tt.pos-ce;fe.depth=tt.depth,fe.height=tt.height,$t.push({type:"elem",elem:fe,shift:qe})}}var Je=Ot({positionType:"individualShift",children:$t}),Xe=Ce(["col-align-"+(((te=O)==null?void 0:te.align)||"c")],[Je]);if(be.push(Xe),l<f-1||t.hskipBeforeAndAfter){var Lt,Tt;He=(Lt=(Tt=O)==null?void 0:Tt.postgap)!=null?Lt:k,He!==0&&(pe=Ce(["arraycolsep"],[]),pe.style.width=Re(He),be.push(pe))}}}var mt=Ce(["mtable"],be);if(m.length>0){for(var At=Jo("hline",n,g),pn=Jo("hdashline",n,g),en=[{type:"elem",elem:mt,shift:0}];m.length>0;){var ht=m.pop(),ur=ht.pos-ce;ht.isDashed?en.push({type:"elem",elem:pn,shift:ur}):en.push({type:"elem",elem:At,shift:ur})}mt=Ot({positionType:"individualShift",children:en})}if(Y.length===0)return Ce(["mord"],[mt],n);var me=Ot({positionType:"individualShift",children:Y}),Se=Ce(["tag"],[me],n);return Hi([mt,Se])},jT={c:"center ",l:"left ",r:"right "},ri=function(t,n){for(var a=[],l=new Me("mtd",[],["mtr-glue"]),o=new Me("mtd",[],["mml-eqn-num"]),c=0;c<t.body.length;c++){for(var f=t.body[c],h=[],m=0;m<f.length;m++)h.push(new Me("mtd",[Qt(f[m],n)]));t.tags&&t.tags[c]&&(h.unshift(l),h.push(l),t.leqno?h.unshift(o):h.push(o)),a.push(new Me("mtr",h))}var g=new Me("mtable",a),v=t.arraystretch===.5?.1:.16+t.arraystretch-1+(t.addJot?.09:0);g.setAttribute("rowspacing",Re(v));var k="",b="";if(t.cols&&t.cols.length>0){var T=t.cols,A="",q=!1,z=0,M=T.length;T[0].type==="separator"&&(k+="top ",z=1),T[T.length-1].type==="separator"&&(k+="bottom ",M-=1);for(var B=z;B<M;B++){var U=T[B];U.type==="align"?(b+=jT[U.align],q&&(A+="none "),q=!0):U.type==="separator"&&q&&(A+=U.separator==="|"?"solid ":"dashed ",q=!1)}g.setAttribute("columnalign",b.trim()),/[sd]/.test(A)&&g.setAttribute("columnlines",A.trim())}if(t.colSeparationType==="align"){for(var ne=t.cols||[],L="",K=1;K<ne.length;K++)L+=K%2?"0em ":"1em ";g.setAttribute("columnspacing",L.trim())}else t.colSeparationType==="alignat"||t.colSeparationType==="gather"?g.setAttribute("columnspacing","0em"):t.colSeparationType==="small"?g.setAttribute("columnspacing","0.2778em"):t.colSeparationType==="CD"?g.setAttribute("columnspacing","0.5em"):g.setAttribute("columnspacing","1em");var ie="",Q=t.hLinesBeforeRow;k+=Q[0].length>0?"left ":"",k+=Q[Q.length-1].length>0?"right ":"";for(var F=1;F<Q.length-1;F++)ie+=Q[F].length===0?"none ":Q[F][0]?"dashed ":"solid ";return/[sd]/.test(ie)&&g.setAttribute("rowlines",ie.trim()),k!==""&&(g=new Me("menclose",[g]),g.setAttribute("notation",k.trim())),t.arraystretch&&t.arraystretch<1&&(g=new Me("mstyle",[g]),g.setAttribute("scriptlevel","1")),g},k6=function(t,n){t.envName.includes("ed")||Mf(t);var a=[],l=t.envName.includes("at")?"alignat":"align",o=t.envName==="split",c=Hl(t.parser,{cols:a,addJot:!0,autoTag:o?void 0:L1(t.envName),emptySingleRow:!0,colSeparationType:l,maxNumCols:o?2:void 0,leqno:t.parser.settings.leqno},"display"),f=0,h=0,m={type:"ordgroup",mode:t.mode,body:[]};if(n[0]&&n[0].type==="ordgroup"){for(var g="",v=0;v<n[0].body.length;v++){var k=ft(n[0].body[v],"textord");g+=k.text}f=Number(g),h=f*2}var b=!h;c.body.forEach(function(z){for(var M=1;M<z.length;M+=2){var B=ft(z[M],"styling"),U=ft(B.body[0],"ordgroup");U.body.unshift(m)}if(b)h<z.length&&(h=z.length);else{var ne=z.length/2;if(f<ne)throw new Ee("Too many math in a row: "+("expected "+f+", but got "+ne),z[0])}});for(var T=0;T<h;++T){var A="r",q=0;T%2===1?A="l":T>0&&b&&(q=1),a[T]={type:"align",align:A,pregap:q,postgap:0}}return c.colSeparationType=b?"align":"alignat",c};ti({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=Cf(t[0]),a=n?[t[0]]:ft(t[0],"ordgroup").body,l=a.map(function(c){var f=jf(c),h=f.text;if("lcr".includes(h))return{type:"align",align:h};if(h==="|")return{type:"separator",separator:"|"};if(h===":")return{type:"separator",separator:":"};throw new Ee("Unknown column alignment: "+h,c)}),o={cols:l,hskipBeforeAndAfter:!0,maxNumCols:l.length};return Hl(e.parser,o,B1(e.envName))},htmlBuilder:ni,mathmlBuilder:ri});ti({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",a={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(e.envName.charAt(e.envName.length-1)==="*"){var l=e.parser;if(l.consumeSpaces(),l.fetch().text==="["){if(l.consume(),l.consumeSpaces(),n=l.fetch().text,!"lcr".includes(n))throw new Ee("Expected l or c or r",l.nextToken);l.consume(),l.consumeSpaces(),l.expect("]"),l.consume(),a.cols=[{type:"align",align:n}]}}var o=Hl(e.parser,a,B1(e.envName)),c=Math.max(0,...o.body.map(f=>f.length));return o.cols=new Array(c).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[o],left:t[0],right:t[1],rightColor:void 0}:o},htmlBuilder:ni,mathmlBuilder:ri});ti({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t={arraystretch:.5},n=Hl(e.parser,t,"script");return n.colSeparationType="small",n},htmlBuilder:ni,mathmlBuilder:ri});ti({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=Cf(t[0]),a=n?[t[0]]:ft(t[0],"ordgroup").body,l=a.map(function(f){var h=jf(f),m=h.text;if("lc".includes(m))return{type:"align",align:m};throw new Ee("Unknown column alignment: "+m,f)});if(l.length>1)throw new Ee("{subarray} can contain only one column");var o={cols:l,hskipBeforeAndAfter:!1,arraystretch:.5},c=Hl(e.parser,o,"script");if(c.body.length>0&&c.body[0].length>1)throw new Ee("{subarray} can contain only one column");return c},htmlBuilder:ni,mathmlBuilder:ri});ti({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=Hl(e.parser,t,B1(e.envName));return{type:"leftright",mode:e.mode,body:[n],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:ni,mathmlBuilder:ri});ti({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:k6,htmlBuilder:ni,mathmlBuilder:ri});ti({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){ST.has(e.envName)&&Mf(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:L1(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Hl(e.parser,t,"display")},htmlBuilder:ni,mathmlBuilder:ri});ti({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:k6,htmlBuilder:ni,mathmlBuilder:ri});ti({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Mf(e);var t={autoTag:L1(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Hl(e.parser,t,"display")},htmlBuilder:ni,mathmlBuilder:ri});ti({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Mf(e),dT(e.parser)},htmlBuilder:ni,mathmlBuilder:ri});I("\\nonumber","\\gdef\\@eqnsw{0}");I("\\notag","\\nonumber");Le({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new Ee(e.funcName+" valid only within array environment")}});var d3=b6;Le({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:n,funcName:a}=e,l=t[0];if(l.type!=="ordgroup")throw new Ee("Invalid environment name",l);for(var o="",c=0;c<l.body.length;++c)o+=ft(l.body[c],"textord").text;if(a==="\\begin"){if(!d3.hasOwnProperty(o))throw new Ee("No such environment: "+o,l);var f=d3[o],{args:h,optArgs:m}=n.parseArguments("\\begin{"+o+"}",f),g={mode:n.mode,envName:o,parser:n},v=f.handler(g,h,m);n.expect("\\end",!1);var k=n.nextToken,b=ft(n.parseFunction(),"environment");if(b.name!==o)throw new Ee("Mismatch: \\begin{"+o+"} matched by \\end{"+b.name+"}",k);return v}return{type:"environment",mode:n.mode,name:o,nameGroup:l}}});var S6=(e,t)=>{var n=e.font,a=t.withFont(n);return It(e.body,a)},j6=(e,t)=>{var n=e.font,a=t.withFont(n);return Qt(e.body,a)},f3={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};Le({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:a}=e,l=of(t[0]),o=a;return o in f3&&(o=f3[o]),{type:"font",mode:n.mode,font:o.slice(1),body:l}},htmlBuilder:S6,mathmlBuilder:j6});Le({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"mclass",mode:n.mode,mclass:Tf(a),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:a}],isCharacterBox:qi(a)}}});Le({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:a,breakOnTokenText:l}=e,{mode:o}=n,c=n.parseExpression(!0,l);return{type:"font",mode:o,font:"math"+a.slice(1),body:{type:"ordgroup",mode:n.mode,body:c}}},htmlBuilder:S6,mathmlBuilder:j6});var CT=(e,t)=>{var n=t.style,a=n.fracNum(),l=n.fracDen(),o;o=t.havingStyle(a);var c=It(e.numer,o,t);if(e.continued){var f=8.5/t.fontMetrics().ptPerEm,h=3.5/t.fontMetrics().ptPerEm;c.height=c.height<f?f:c.height,c.depth=c.depth<h?h:c.depth}o=t.havingStyle(l);var m=It(e.denom,o,t),g,v,k;e.hasBarLine?(e.barSize?(v=cn(e.barSize,t),g=Jo("frac-line",t,v)):g=Jo("frac-line",t),v=g.height,k=g.height):(g=null,v=0,k=t.fontMetrics().defaultRuleThickness);var b,T,A;n.size===st.DISPLAY.size?(b=t.fontMetrics().num1,v>0?T=3*k:T=7*k,A=t.fontMetrics().denom1):(v>0?(b=t.fontMetrics().num2,T=k):(b=t.fontMetrics().num3,T=3*k),A=t.fontMetrics().denom2);var q;if(g){var M=t.fontMetrics().axisHeight;b-c.depth-(M+.5*v)<T&&(b+=T-(b-c.depth-(M+.5*v))),M-.5*v-(m.height-A)<T&&(A+=T-(M-.5*v-(m.height-A)));var B=-(M-.5*v);q=Ot({positionType:"individualShift",children:[{type:"elem",elem:m,shift:A},{type:"elem",elem:g,shift:B},{type:"elem",elem:c,shift:-b}]})}else{var z=b-c.depth-(m.height-A);z<T&&(b+=.5*(T-z),A+=.5*(T-z)),q=Ot({positionType:"individualShift",children:[{type:"elem",elem:m,shift:A},{type:"elem",elem:c,shift:-b}]})}o=t.havingStyle(n),q.height*=o.sizeMultiplier/t.sizeMultiplier,q.depth*=o.sizeMultiplier/t.sizeMultiplier;var U;n.size===st.DISPLAY.size?U=t.fontMetrics().delim1:n.size===st.SCRIPTSCRIPT.size?U=t.havingStyle(st.SCRIPT).fontMetrics().delim2:U=t.fontMetrics().delim2;var ne,L;return e.leftDelim==null?ne=Yc(t,["mopen"]):ne=Fp(e.leftDelim,U,!0,t.havingStyle(n),e.mode,["mopen"]),e.continued?L=Ce([]):e.rightDelim==null?L=Yc(t,["mclose"]):L=Fp(e.rightDelim,U,!0,t.havingStyle(n),e.mode,["mclose"]),Ce(["mord"].concat(o.sizingClasses(t)),[ne,Ce(["mfrac"],[q]),L],t)},TT=(e,t)=>{var n=new Me("mfrac",[Qt(e.numer,t),Qt(e.denom,t)]);if(!e.hasBarLine)n.setAttribute("linethickness","0px");else if(e.barSize){var a=cn(e.barSize,t);n.setAttribute("linethickness",Re(a))}if(e.leftDelim!=null||e.rightDelim!=null){var l=[];if(e.leftDelim!=null){var o=new Me("mo",[new Nn(e.leftDelim.replace("\\",""))]);o.setAttribute("fence","true"),l.push(o)}if(l.push(n),e.rightDelim!=null){var c=new Me("mo",[new Nn(e.rightDelim.replace("\\",""))]);c.setAttribute("fence","true"),l.push(c)}return R1(l)}return n},C6=(e,t)=>{if(!t)return e;var n={type:"styling",mode:e.mode,style:t,body:[e]};return n};Le({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:a}=e,l=t[0],o=t[1],c,f=null,h=null;switch(a){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":c=!0;break;case"\\\\atopfrac":c=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":c=!1,f="(",h=")";break;case"\\\\bracefrac":c=!1,f="\\{",h="\\}";break;case"\\\\brackfrac":c=!1,f="[",h="]";break;default:throw new Error("Unrecognized genfrac command")}var m=a==="\\cfrac",g=null;return m||a.startsWith("\\d")?g="display":a.startsWith("\\t")&&(g="text"),C6({type:"genfrac",mode:n.mode,numer:l,denom:o,continued:m,hasBarLine:c,leftDelim:f,rightDelim:h,barSize:null},g)},htmlBuilder:CT,mathmlBuilder:TT});Le({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:n,token:a}=e,l;switch(n){case"\\over":l="\\frac";break;case"\\choose":l="\\binom";break;case"\\atop":l="\\\\atopfrac";break;case"\\brace":l="\\\\bracefrac";break;case"\\brack":l="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:t.mode,replaceWith:l,token:a}}});var h3=["display","text","script","scriptscript"],m3=function(t){var n=null;return t.length>0&&(n=t,n=n==="."?null:n),n};Le({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var{parser:n}=e,a=t[4],l=t[5],o=of(t[0]),c=o.type==="atom"&&o.family==="open"?m3(o.text):null,f=of(t[1]),h=f.type==="atom"&&f.family==="close"?m3(f.text):null,m=ft(t[2],"size"),g,v=null;m.isBlank?g=!0:(v=m.value,g=v.number>0);var k=null,b=t[3];if(b.type==="ordgroup"){if(b.body.length>0){var T=ft(b.body[0],"textord");k=h3[Number(T.text)]}}else b=ft(b,"textord"),k=h3[Number(b.text)];return C6({type:"genfrac",mode:n.mode,numer:a,denom:l,continued:!1,hasBarLine:g,barSize:v,leftDelim:c,rightDelim:h},k)}});Le({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:a,token:l}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:ft(t[0],"size").value,token:l}}});Le({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=t[0],o=ft(t[1],"infix").size;if(!o)throw new Error("\\\\abovefrac expected size, but got "+String(o));var c=t[2],f=o.number>0;return{type:"genfrac",mode:n.mode,numer:l,denom:c,continued:!1,hasBarLine:f,barSize:o,leftDelim:null,rightDelim:null}}});var T6=(e,t)=>{var n=t.style,a,l;e.type==="supsub"?(a=e.sup?It(e.sup,t.havingStyle(n.sup()),t):It(e.sub,t.havingStyle(n.sub()),t),l=ft(e.base,"horizBrace")):l=ft(e,"horizBrace");var o=It(l.base,t.havingBaseStyle(st.DISPLAY)),c=Sf(l,t),f;if(l.isOver?f=Ot({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:c,wrapperClasses:["svg-align"]}]}):f=Ot({positionType:"bottom",positionData:o.depth+.1+c.height,children:[{type:"elem",elem:c,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:o}]}),a){var h=Ce(["minner",l.isOver?"mover":"munder"],[f],t);l.isOver?f=Ot({positionType:"firstBaseline",children:[{type:"elem",elem:h},{type:"kern",size:.2},{type:"elem",elem:a}]}):f=Ot({positionType:"bottom",positionData:h.depth+.2+a.height+a.depth,children:[{type:"elem",elem:a},{type:"kern",size:.2},{type:"elem",elem:h}]})}return Ce(["minner",l.isOver?"mover":"munder"],[f],t)},AT=(e,t)=>{var n=kf(e.label);return new Me(e.isOver?"mover":"munder",[Qt(e.base,t),n])};Le({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:a}=e;return{type:"horizBrace",mode:n.mode,label:a,isOver:a.includes("\\over"),base:t[0]}},htmlBuilder:T6,mathmlBuilder:AT});Le({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=t[1],l=ft(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:l})?{type:"href",mode:n.mode,href:l,body:En(a)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=_n(e.body,t,!1);return UC(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=Ll(e.body,t);return n instanceof Me||(n=new Me("mrow",[n])),n.setAttribute("href",e.href),n}});Le({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=ft(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:a}))return n.formatUnsupportedCmd("\\url");for(var l=[],o=0;o<a.length;o++){var c=a[o];c==="~"&&(c="\\textasciitilde"),l.push({type:"textord",mode:"text",text:c})}var f={type:"text",mode:n.mode,font:"\\texttt",body:l};return{type:"href",mode:n.mode,href:a,body:En(f)}}});Le({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:En(t[0])}},htmlBuilder(e,t){var n=_n(e.body,t.withFont(""),!1);return Hi(n)},mathmlBuilder(e,t){return new Me("mrow",Gr(e.body,t.withFont("")))}});Le({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:a,token:l}=e,o=ft(t[0],"raw").string,c=t[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var f,h={};switch(a){case"\\htmlClass":h.class=o,f={command:"\\htmlClass",class:o};break;case"\\htmlId":h.id=o,f={command:"\\htmlId",id:o};break;case"\\htmlStyle":h.style=o,f={command:"\\htmlStyle",style:o};break;case"\\htmlData":{for(var m=o.split(","),g=0;g<m.length;g++){var v=m[g],k=v.indexOf("=");if(k<0)throw new Ee("\\htmlData key/value '"+v+"' missing equals sign");var b=v.slice(0,k),T=v.slice(k+1);h["data-"+b.trim()]=T}f={command:"\\htmlData",attributes:h};break}default:throw new Error("Unrecognized html command")}return n.settings.isTrusted(f)?{type:"html",mode:n.mode,attributes:h,body:En(c)}:n.formatUnsupportedCmd(a)},htmlBuilder:(e,t)=>{var n=_n(e.body,t,!1),a=["enclosing"];e.attributes.class&&a.push(...e.attributes.class.trim().split(/\s+/));var l=Ce(a,n,t);for(var o in e.attributes)o!=="class"&&e.attributes.hasOwnProperty(o)&&l.setAttribute(o,e.attributes[o]);return l},mathmlBuilder:(e,t)=>Ll(e.body,t)});Le({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:En(t[0]),mathml:En(t[1])}},htmlBuilder:(e,t)=>{var n=_n(e.html,t,!1);return Hi(n)},mathmlBuilder:(e,t)=>Ll(e.mathml,t)});var Xm=function(t){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t))return{number:+t,unit:"bp"};var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);if(!n)throw new Ee("Invalid size: '"+t+"' in \\includegraphics");var a={number:+(n[1]+n[2]),unit:n[3]};if(!$v(a))throw new Ee("Invalid unit: '"+a.unit+"' in \\includegraphics.");return a};Le({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:a}=e,l={number:0,unit:"em"},o={number:.9,unit:"em"},c={number:0,unit:"em"},f="";if(n[0])for(var h=ft(n[0],"raw").string,m=h.split(","),g=0;g<m.length;g++){var v=m[g].split("=");if(v.length===2){var k=v[1].trim();switch(v[0].trim()){case"alt":f=k;break;case"width":l=Xm(k);break;case"height":o=Xm(k);break;case"totalheight":c=Xm(k);break;default:throw new Ee("Invalid key: '"+v[0]+"' in \\includegraphics.")}}}var b=ft(t[0],"url").url;return f===""&&(f=b,f=f.replace(/^.*[\\/]/,""),f=f.substring(0,f.lastIndexOf("."))),a.settings.isTrusted({command:"\\includegraphics",url:b})?{type:"includegraphics",mode:a.mode,alt:f,width:l,height:o,totalheight:c,src:b}:a.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var n=cn(e.height,t),a=0;e.totalheight.number>0&&(a=cn(e.totalheight,t)-n);var l=0;e.width.number>0&&(l=cn(e.width,t));var o={height:Re(n+a)};l>0&&(o.width=Re(l)),a>0&&(o.verticalAlign=Re(-a));var c=new NC(e.src,e.alt,o);return c.height=n,c.depth=a,c},mathmlBuilder:(e,t)=>{var n=new Me("mglyph",[]);n.setAttribute("alt",e.alt);var a=cn(e.height,t),l=0;if(e.totalheight.number>0&&(l=cn(e.totalheight,t)-a,n.setAttribute("valign",Re(-l))),n.setAttribute("height",Re(a+l)),e.width.number>0){var o=cn(e.width,t);n.setAttribute("width",Re(o))}return n.setAttribute("src",e.src),n}});Le({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:a}=e,l=ft(t[0],"size");if(n.settings.strict){var o=a[1]==="m",c=l.value.unit==="mu";o?(c||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" supports only mu units, "+("not "+l.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" works only in math mode")):c&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:l.value}},htmlBuilder(e,t){return Kv(e.dimension,t)},mathmlBuilder(e,t){var n=cn(e.dimension,t);return new t6(n)}});Le({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=t[0];return{type:"lap",mode:n.mode,alignment:a.slice(5),body:l}},htmlBuilder:(e,t)=>{var n;e.alignment==="clap"?(n=Ce([],[It(e.body,t)]),n=Ce(["inner"],[n],t)):n=Ce(["inner"],[It(e.body,t)]);var a=Ce(["fix"],[]),l=Ce([e.alignment],[n,a],t),o=Ce(["strut"]);return o.style.height=Re(l.height+l.depth),l.depth&&(o.style.verticalAlign=Re(-l.depth)),l.children.unshift(o),l=Ce(["thinbox"],[l],t),Ce(["mord","vbox"],[l],t)},mathmlBuilder:(e,t)=>{var n=new Me("mpadded",[Qt(e.body,t)]);if(e.alignment!=="rlap"){var a=e.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",a+"width")}return n.setAttribute("width","0px"),n}});Le({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:a}=e,l=a.mode;a.switchMode("math");var o=n==="\\("?"\\)":"$",c=a.parseExpression(!1,o);return a.expect(o),a.switchMode(l),{type:"styling",mode:a.mode,style:"text",resetFont:!0,body:c}}});Le({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new Ee("Mismatched "+e.funcName)}});var p3=(e,t)=>{switch(t.style.size){case st.DISPLAY.size:return e.display;case st.TEXT.size:return e.text;case st.SCRIPT.size:return e.script;case st.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Le({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:En(t[0]),text:En(t[1]),script:En(t[2]),scriptscript:En(t[3])}},htmlBuilder:(e,t)=>{var n=p3(e,t),a=_n(n,t,!1);return Hi(a)},mathmlBuilder:(e,t)=>{var n=p3(e,t);return Ll(n,t)}});var A6=(e,t,n,a,l,o,c)=>{e=Ce([],[e]);var f=n&&qi(n),h,m;if(t){var g=It(t,a.havingStyle(l.sup()),a);m={elem:g,kern:Math.max(a.fontMetrics().bigOpSpacing1,a.fontMetrics().bigOpSpacing3-g.depth)}}if(n){var v=It(n,a.havingStyle(l.sub()),a);h={elem:v,kern:Math.max(a.fontMetrics().bigOpSpacing2,a.fontMetrics().bigOpSpacing4-v.height)}}var k;if(m&&h){var b=a.fontMetrics().bigOpSpacing5+h.elem.height+h.elem.depth+h.kern+e.depth+c;k=Ot({positionType:"bottom",positionData:b,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:h.elem,marginLeft:Re(-o)},{type:"kern",size:h.kern},{type:"elem",elem:e},{type:"kern",size:m.kern},{type:"elem",elem:m.elem,marginLeft:Re(o)},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]})}else if(h){var T=e.height-c;k=Ot({positionType:"top",positionData:T,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:h.elem,marginLeft:Re(-o)},{type:"kern",size:h.kern},{type:"elem",elem:e}]})}else if(m){var A=e.depth+c;k=Ot({positionType:"bottom",positionData:A,children:[{type:"elem",elem:e},{type:"kern",size:m.kern},{type:"elem",elem:m.elem,marginLeft:Re(o)},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]})}else return e;var q=[k];if(h&&o!==0&&!f){var z=Ce(["mspace"],[],a);z.style.marginRight=Re(o),q.unshift(z)}return Ce(["mop","op-limits"],q,a)},E6=new Set(["\\smallint"]),su=(e,t)=>{var n,a,l=!1,o;e.type==="supsub"?(n=e.sup,a=e.sub,o=ft(e.base,"op"),l=!0):o=ft(e,"op");var c=t.style,f=!1;c.size===st.DISPLAY.size&&o.symbol&&!E6.has(o.name)&&(f=!0);var h,m;if(o.symbol){var g=f?"Size2-Regular":"Size1-Regular",v="";if((o.name==="\\oiint"||o.name==="\\oiiint")&&(v=o.name.slice(1),o.name=v==="oiint"?"\\iint":"\\iiint"),h=ir(o.name,g,"math",t,["mop","op-symbol",f?"large-op":"small-op"]),m=h.italic,v.length>0){var k=Zv(v+"Size"+(f?"2":"1"),t);h=Ot({positionType:"individualShift",children:[{type:"elem",elem:h,shift:0},{type:"elem",elem:k,shift:f?.08:0}]}),o.name="\\"+v,h.classes.unshift("mop"),h.italic=m}}else if(o.body){var b=_n(o.body,t,!0);b.length===1&&b[0]instanceof Fr?(h=b[0],h.classes[0]="mop"):h=Ce(["mop"],b,t)}else{for(var T=[],A=1;A<o.name.length;A++)T.push(z1(o.name[A],o.mode,t));h=Ce(["mop"],T,t)}var q=0,z=0;if((h instanceof Fr||o.name==="\\oiint"||o.name==="\\oiiint")&&!o.suppressBaseShift){var M;q=(h.height-h.depth)/2-t.fontMetrics().axisHeight,z=(M=h.italic)!=null?M:0}return l?A6(h,n,a,t,c,z,q):(q&&(h.style.position="relative",h.style.top=Re(q)),h)},t0=(e,t)=>{var n;if(e.symbol)n=new Me("mo",[la(e.name,e.mode)]),E6.has(e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new Me("mo",Gr(e.body,t));else{n=new Me("mi",[new Nn(e.name.slice(1))]);var a=new Me("mo",[la("","text")]);e.parentIsSupSub?n=new Me("mrow",[n,a]):n=e6([n,a])}return n},ET={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Le({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=a;return l.length===1&&(l=ET[l]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:l}},htmlBuilder:su,mathmlBuilder:t0});Le({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:En(a)}},htmlBuilder:su,mathmlBuilder:t0});var NT={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Le({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"],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:su,mathmlBuilder:t0});Le({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:su,mathmlBuilder:t0});Le({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:t,funcName:n}=e,a=n;return a.length===1&&(a=NT[a]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:a}},htmlBuilder:su,mathmlBuilder:t0});var N6=(e,t)=>{var n,a,l=!1,o;e.type==="supsub"?(n=e.sup,a=e.sub,o=ft(e.base,"operatorname"),l=!0):o=ft(e,"operatorname");var c;if(o.body.length>0){for(var f=o.body.map(v=>{var k="text"in v?v.text:void 0;return typeof k=="string"?{type:"textord",mode:v.mode,text:k}:v}),h=_n(f,t.withFont("mathrm"),!0),m=0;m<h.length;m++){var g=h[m];g instanceof Fr&&(g.text=g.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}c=Ce(["mop"],h,t)}else c=Ce(["mop"],[],t);return l?A6(c,n,a,t,t.style,0,0):c},MT=(e,t)=>{for(var n=Gr(e.body,t.withFont("mathrm")),a=!0,l=0;l<n.length;l++){var o=n[l];if(!(o instanceof t6))if(o instanceof Me)switch(o.type){case"mi":case"mn":case"mspace":case"mtext":break;case"mo":{var c=o.children[0];o.children.length===1&&c instanceof Nn?c.text=c.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):a=!1;break}default:a=!1}else a=!1}if(a){var f=n.map(g=>g.toText()).join("");n=[new Nn(f)]}var h=new Me("mi",n);h.setAttribute("mathvariant","normal");var m=new Me("mo",[la("","text")]);return e.parentIsSupSub?new Me("mrow",[h,m]):e6([h,m])};Le({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=t[0];return{type:"operatorname",mode:n.mode,body:En(l),alwaysHandleSupSub:a==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:N6,mathmlBuilder:MT});I("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");_s({type:"ordgroup",htmlBuilder(e,t){return e.semisimple?Hi(_n(e.body,t,!1)):Ce(["mord"],_n(e.body,t,!0),t)},mathmlBuilder(e,t){return Ll(e.body,t,!0)}});Le({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,a=t[0];return{type:"overline",mode:n.mode,body:a}},htmlBuilder(e,t){var n=It(e.body,t.havingCrampedStyle()),a=Jo("overline-line",t),l=t.fontMetrics().defaultRuleThickness,o=Ot({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*l},{type:"elem",elem:a},{type:"kern",size:l}]});return Ce(["mord","overline"],[o],t)},mathmlBuilder(e,t){var n=new Me("mo",[new Nn("‾")]);n.setAttribute("stretchy","true");var a=new Me("mover",[Qt(e.body,t),n]);return a.setAttribute("accent","true"),a}});Le({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"phantom",mode:n.mode,body:En(a)}},htmlBuilder:(e,t)=>{var n=_n(e.body,t.withPhantom(),!1);return Hi(n)},mathmlBuilder:(e,t)=>{var n=Gr(e.body,t);return new Me("mphantom",n)}});I("\\hphantom","\\smash{\\phantom{#1}}");Le({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"vphantom",mode:n.mode,body:a}},htmlBuilder:(e,t)=>{var n=Ce(["inner"],[It(e.body,t.withPhantom())]),a=Ce(["fix"],[]);return Ce(["mord","rlap"],[n,a],t)},mathmlBuilder:(e,t)=>{var n=Gr(En(e.body),t),a=new Me("mphantom",n),l=new Me("mpadded",[a]);return l.setAttribute("width","0px"),l}});Le({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,a=ft(t[0],"size").value,l=t[1];return{type:"raisebox",mode:n.mode,dy:a,body:l}},htmlBuilder(e,t){var n=It(e.body,t),a=cn(e.dy,t);return Ot({positionType:"shift",positionData:-a,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new Me("mpadded",[Qt(e.body,t)]),a=e.dy.number+e.dy.unit;return n.setAttribute("voffset",a),n}});Le({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}});Le({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,n){var{parser:a}=e,l=n[0],o=ft(t[0],"size"),c=ft(t[1],"size");return{type:"rule",mode:a.mode,shift:l&&ft(l,"size").value,width:o.value,height:c.value}},htmlBuilder(e,t){var n=Ce(["mord","rule"],[],t),a=cn(e.width,t),l=cn(e.height,t),o=e.shift?cn(e.shift,t):0;return n.style.borderRightWidth=Re(a),n.style.borderTopWidth=Re(l),n.style.bottom=Re(o),n.width=a,n.height=l+o,n.depth=-o,n.maxFontSize=l*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=cn(e.width,t),a=cn(e.height,t),l=e.shift?cn(e.shift,t):0,o=t.color&&t.getColor()||"black",c=new Me("mspace");c.setAttribute("mathbackground",o),c.setAttribute("width",Re(n)),c.setAttribute("height",Re(a));var f=new Me("mpadded",[c]);return l>=0?f.setAttribute("height",Re(l)):(f.setAttribute("height",Re(l)),f.setAttribute("depth",Re(-l))),f.setAttribute("voffset",Re(l)),f}});function M6(e,t,n){for(var a=_n(e,t,!1),l=t.sizeMultiplier/n.sizeMultiplier,o=0;o<a.length;o++){var c=a[o].classes.indexOf("sizing");c<0?Array.prototype.push.apply(a[o].classes,t.sizingClasses(n)):a[o].classes[c+1]==="reset-size"+t.size&&(a[o].classes[c+1]="reset-size"+n.size),a[o].height*=l,a[o].depth*=l}return Hi(a)}var g3=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],zT=(e,t)=>{var n=t.havingSize(e.size);return M6(e.body,n,t)};Le({type:"sizing",names:g3,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:a,parser:l}=e,o=l.parseExpression(!1,n);return{type:"sizing",mode:l.mode,size:g3.indexOf(a)+1,body:o}},htmlBuilder:zT,mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),a=Gr(e.body,n),l=new Me("mstyle",a);return l.setAttribute("mathsize",Re(n.sizeMultiplier)),l}});Le({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:a}=e,l=!1,o=!1,c=n[0]&&ft(n[0],"ordgroup");if(c)for(var f,h=0;h<c.body.length;++h){var m=c.body[h];if(f=jf(m).text,f==="t")l=!0;else if(f==="b")o=!0;else{l=!1,o=!1;break}}else l=!0,o=!0;var g=t[0];return{type:"smash",mode:a.mode,body:g,smashHeight:l,smashDepth:o}},htmlBuilder:(e,t)=>{var n=Ce([],[It(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 Ce(["mord","smash"],[n],t);if(n.children)for(var a=0;a<n.children.length;a++)e.smashHeight&&(n.children[a].height=0),e.smashDepth&&(n.children[a].depth=0);var l=Ot({positionType:"firstBaseline",children:[{type:"elem",elem:n}]});return Ce(["mord"],[l],t)},mathmlBuilder:(e,t)=>{var n=new Me("mpadded",[Qt(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}});Le({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:a}=e,l=n[0],o=t[0];return{type:"sqrt",mode:a.mode,body:o,index:l}},htmlBuilder(e,t){var n=It(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=eu(n,t);var a=t.fontMetrics(),l=a.defaultRuleThickness,o=l;t.style.id<st.TEXT.id&&(o=t.fontMetrics().xHeight);var c=l+o/4,f=n.height+n.depth+c+l,{span:h,ruleWidth:m,advanceWidth:g}=yT(f,t),v=h.height-m;v>n.height+n.depth+c&&(c=(c+v-n.height-n.depth)/2);var k=h.height-n.height-c-m;n.style.paddingLeft=Re(g);var b=Ot({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+k)},{type:"elem",elem:h},{type:"kern",size:m}]});if(e.index){var T=t.havingStyle(st.SCRIPTSCRIPT),A=It(e.index,T,t),q=.6*(b.height-b.depth),z=Ot({positionType:"shift",positionData:-q,children:[{type:"elem",elem:A}]}),M=Ce(["root"],[z]);return Ce(["mord","sqrt"],[M,b],t)}else return Ce(["mord","sqrt"],[b],t)},mathmlBuilder(e,t){var{body:n,index:a}=e;return a?new Me("mroot",[Qt(n,t),Qt(a,t)]):new Me("msqrt",[Qt(n,t)])}});var Pp={display:st.DISPLAY,text:st.TEXT,script:st.SCRIPT,scriptscript:st.SCRIPTSCRIPT};function DT(e){return e in Pp}Le({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:a,parser:l}=e,o=l.parseExpression(!0,n),c=a.slice(1,a.length-5);if(!DT(c))throw new Error("Unknown style: "+c);return{type:"styling",mode:l.mode,style:c,body:o}},htmlBuilder(e,t){var n=Pp[e.style],a=t.havingStyle(n);return e.resetFont&&(a=a.withFont("")),M6(e.body,a,t)},mathmlBuilder(e,t){var n=Pp[e.style],a=t.havingStyle(n);e.resetFont&&(a=a.withFont(""));var l=Gr(e.body,a),o=new Me("mstyle",l),c={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},f=c[e.style];return o.setAttribute("scriptlevel",f[0]),o.setAttribute("displaystyle",f[1]),o}});var RT=function(t,n){var a=t.base;if(a)if(a.type==="op"){var l=a.limits&&(n.style.size===st.DISPLAY.size||a.alwaysHandleSupSub);return l?su:null}else if(a.type==="operatorname"){var o=a.alwaysHandleSupSub&&(n.style.size===st.DISPLAY.size||a.limits);return o?N6:null}else{if(a.type==="accent")return qi(a.base)?I1:null;if(a.type==="horizBrace"){var c=!t.sub;return c===a.isOver?T6:null}else return null}else return null};_s({type:"supsub",htmlBuilder(e,t){var n=RT(e,t);if(n)return n(e,t);var{base:a,sup:l,sub:o}=e,c=It(a,t),f,h,m=t.fontMetrics(),g=0,v=0,k=a&&qi(a);if(l){var b=t.havingStyle(t.style.sup());f=It(l,b,t),k||(g=c.height-b.fontMetrics().supDrop*b.sizeMultiplier/t.sizeMultiplier)}if(o){var T=t.havingStyle(t.style.sub());h=It(o,T,t),k||(v=c.depth+T.fontMetrics().subDrop*T.sizeMultiplier/t.sizeMultiplier)}var A;t.style===st.DISPLAY?A=m.sup1:t.style.cramped?A=m.sup3:A=m.sup2;var q=t.sizeMultiplier,z=Re(.5/m.ptPerEm/q),M=null;if(h){var B=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(c instanceof Fr||B){var U;M=Re(-((U=c.italic)!=null?U:0))}}var ne;if(f&&h){g=Math.max(g,A,f.depth+.25*m.xHeight),v=Math.max(v,m.sub2);var L=m.defaultRuleThickness,K=4*L;if(g-f.depth-(h.height-v)<K){v=K-(g-f.depth)+h.height;var ie=.8*m.xHeight-(g-f.depth);ie>0&&(g+=ie,v-=ie)}var Q=[{type:"elem",elem:h,shift:v,marginRight:z,marginLeft:M},{type:"elem",elem:f,shift:-g,marginRight:z}];ne=Ot({positionType:"individualShift",children:Q})}else if(h){v=Math.max(v,m.sub1,h.height-.8*m.xHeight);var F=[{type:"elem",elem:h,marginLeft:M,marginRight:z}];ne=Ot({positionType:"shift",positionData:v,children:F})}else if(f)g=Math.max(g,A,f.depth+.25*m.xHeight),ne=Ot({positionType:"shift",positionData:-g,children:[{type:"elem",elem:f,marginRight:z}]});else throw new Error("supsub must have either sup or sub.");var he=qp(c,"right")||"mord";return Ce([he],[c,Ce(["msupsub"],[ne])],t)},mathmlBuilder(e,t){var n=!1,a,l;e.base&&e.base.type==="horizBrace"&&(l=!!e.sup,l===e.base.isOver&&(n=!0,a=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var o=[Qt(e.base,t)];e.sub&&o.push(Qt(e.sub,t)),e.sup&&o.push(Qt(e.sup,t));var c;if(n)c=a?"mover":"munder";else if(e.sub)if(e.sup){var m=e.base;m&&m.type==="op"&&m.limits&&t.style===st.DISPLAY||m&&m.type==="operatorname"&&m.alwaysHandleSupSub&&(t.style===st.DISPLAY||m.limits)?c="munderover":c="msubsup"}else{var h=e.base;h&&h.type==="op"&&h.limits&&(t.style===st.DISPLAY||h.alwaysHandleSupSub)||h&&h.type==="operatorname"&&h.alwaysHandleSupSub&&(h.limits||t.style===st.DISPLAY)?c="munder":c="msub"}else{var f=e.base;f&&f.type==="op"&&f.limits&&(t.style===st.DISPLAY||f.alwaysHandleSupSub)||f&&f.type==="operatorname"&&f.alwaysHandleSupSub&&(f.limits||t.style===st.DISPLAY)?c="mover":c="msup"}return new Me(c,o)}});_s({type:"atom",htmlBuilder(e,t){return z1(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){var n=new Me("mo",[la(e.text,e.mode)]);if(e.family==="bin"){var a=O1(e,t);a==="bold-italic"&&n.setAttribute("mathvariant",a)}else e.family==="punct"?n.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&n.setAttribute("stretchy","false");return n}});var z6={mi:"italic",mn:"normal",mtext:"normal"};_s({type:"mathord",htmlBuilder(e,t){return wf(e,t,"mathord")},mathmlBuilder(e,t){var n=new Me("mi",[la(e.text,e.mode,t)]),a=O1(e,t)||"italic";return a!==z6[n.type]&&n.setAttribute("mathvariant",a),n}});_s({type:"textord",htmlBuilder(e,t){return wf(e,t,"textord")},mathmlBuilder(e,t){var n=la(e.text,e.mode,t),a=O1(e,t)||"normal",l;return e.mode==="text"?l=new Me("mtext",[n]):/[0-9]/.test(e.text)?l=new Me("mn",[n]):e.text==="\\prime"?l=new Me("mo",[n]):l=new Me("mi",[n]),a!==z6[l.type]&&l.setAttribute("mathvariant",a),l}});var Zm={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Qm={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};_s({type:"spacing",htmlBuilder(e,t){if(Qm.hasOwnProperty(e.text)){var n=Qm[e.text].className||"";if(e.mode==="text"){var a=wf(e,t,"textord");return a.classes.push(n),a}else return Ce(["mspace",n],[z1(e.text,e.mode,t)],t)}else{if(Zm.hasOwnProperty(e.text))return Ce(["mspace",Zm[e.text]],[],t);throw new Ee('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,t){var n;if(Qm.hasOwnProperty(e.text))n=new Me("mtext",[new Nn(" ")]);else{if(Zm.hasOwnProperty(e.text))return new Me("mspace");throw new Ee('Unknown type of space "'+e.text+'"')}return n}});var y3=()=>{var e=new Me("mtd",[]);return e.setAttribute("width","50%"),e};_s({type:"tag",mathmlBuilder(e,t){var n=new Me("mtable",[new Me("mtr",[y3(),new Me("mtd",[Ll(e.body,t)]),y3(),new Me("mtd",[Ll(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var v3={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},x3={"\\textbf":"textbf","\\textmd":"textmd"},OT={"\\textit":"textit","\\textup":"textup"},b3=(e,t)=>{var n=e.font;if(n){if(v3[n])return t.withTextFontFamily(v3[n]);if(x3[n])return t.withTextFontWeight(x3[n]);if(n==="\\emph")return t.fontShape==="textit"?t.withTextFontShape("textup"):t.withTextFontShape("textit")}else return t;return t.withTextFontShape(OT[n])};Le({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:a}=e,l=t[0];return{type:"text",mode:n.mode,body:En(l),font:a}},htmlBuilder(e,t){var n=b3(e,t),a=_n(e.body,n,!0);return Ce(["mord","text"],a,n)},mathmlBuilder(e,t){var n=b3(e,t);return Ll(e.body,n)}});Le({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=It(e.body,t),a=Jo("underline-line",t),l=t.fontMetrics().defaultRuleThickness,o=Ot({positionType:"top",positionData:n.height,children:[{type:"kern",size:l},{type:"elem",elem:a},{type:"kern",size:3*l},{type:"elem",elem:n}]});return Ce(["mord","underline"],[o],t)},mathmlBuilder(e,t){var n=new Me("mo",[new Nn("‾")]);n.setAttribute("stretchy","true");var a=new Me("munder",[Qt(e.body,t),n]);return a.setAttribute("accentunder","true"),a}});Le({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=It(e.body,t),a=t.fontMetrics().axisHeight,l=.5*(n.height-a-(n.depth+a));return Ot({positionType:"shift",positionData:l,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new Me("mpadded",[Qt(e.body,t)],["vcenter"]);return new Me("mrow",[n])}});Le({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new Ee("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=w3(e),a=[],l=t.havingStyle(t.style.text()),o=0;o<n.length;o++){var c=n[o];c==="~"&&(c="\\textasciitilde"),a.push(ir(c,"Typewriter-Regular",e.mode,l,["mord","texttt"]))}return Ce(["mord","text"].concat(l.sizingClasses(t)),Wv(a),l)},mathmlBuilder(e,t){var n=new Nn(w3(e)),a=new Me("mtext",[n]);return a.setAttribute("mathvariant","monospace"),a}});var w3=e=>e.body.replace(/ /g,e.star?"␣":" "),Rl=Qv,D6=`[ \r
|
|
334
334
|
]`,IT="\\\\[a-zA-Z@]+",_T="\\\\[^\uD800-\uDFFF]",LT="("+IT+")"+D6+"*",BT=`\\\\(
|
|
335
335
|
|[ \r ]+
|
|
336
336
|
?)[ \r ]*`,Gp="[̀-ͯ]",qT=new RegExp(Gp+"+$"),UT="("+D6+"+)|"+(BT+"|")+"([!-\\[\\]-‧-豈-]"+(Gp+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Gp+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+LT)+("|"+_T+")");class k3{constructor(t,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=t,this.settings=n,this.tokenRegex=new RegExp(UT,"g"),this.catcodes={"%":14,"~":13}}setCatcode(t,n){this.catcodes[t]=n}lex(){var t=this.input,n=this.tokenRegex.lastIndex;if(n===t.length)return new $r("EOF",new Sr(this,n,n));var a=this.tokenRegex.exec(t);if(a===null||a.index!==n)throw new Ee("Unexpected character: '"+t[n]+"'",new $r(t[n],new Sr(this,n,n+1)));var l=a[6]||a[3]||(a[2]?"\\ ":" ");if(this.catcodes[l]===14){var o=t.indexOf(`
|
|
@@ -343,48 +343,48 @@ $$
|
|
|
343
343
|
|
|
344
344
|
`:t)}const A3=/[#.]/g;function WT(e,t){const n=e||"",a={};let l=0,o,c;for(;l<n.length;){A3.lastIndex=l;const f=A3.exec(n),h=n.slice(l,f?f.index:n.length);h&&(o?o==="#"?a.id=h:Array.isArray(a.className)?a.className.push(h):a.className=[h]:c=h,l+=h.length),f&&(o=f[0],l++)}return{type:"element",tagName:c||t||"div",properties:a,children:[]}}function $6(e,t,n){const a=n?QT(n):void 0;function l(o,c,...f){let h;if(o==null){h={type:"root",children:[]};const m=c;f.unshift(m)}else{h=WT(o,t);const m=h.tagName.toLowerCase(),g=a?a.get(m):void 0;if(h.tagName=g||m,KT(c))f.unshift(c);else for(const[v,k]of Object.entries(c))XT(e,h.properties,v,k)}for(const m of f)Yp(h.children,m);return h.type==="element"&&h.tagName==="template"&&(h.content={type:"root",children:h.children},h.children=[]),h}return l}function KT(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const a of n){const l=t[a];if(l&&typeof l=="object"){if(!Array.isArray(l))return!0;const o=l;for(const c of o)if(typeof c!="number"&&typeof c!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function XT(e,t,n,a){const l=U5(e,n);let o;if(a!=null){if(typeof a=="number"){if(Number.isNaN(a))return;o=a}else typeof a=="boolean"?o=a:typeof a=="string"?l.spaceSeparated?o=ny(a):l.commaSeparated?o=Z2(a):l.commaOrSpaceSeparated?o=ny(Z2(a).join(" ")):o=E3(l,l.property,a):Array.isArray(a)?o=[...a]:o=l.property==="style"?ZT(a):String(a);if(Array.isArray(o)){const c=[];for(const f of o)c.push(E3(l,l.property,f));o=c}l.property==="className"&&Array.isArray(t.className)&&(o=t.className.concat(o)),t[l.property]=o}}function Yp(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(const n of t)Yp(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?Yp(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function E3(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Fc(n)===Fc(t)))return!0}return n}function ZT(e){const t=[];for(const[n,a]of Object.entries(e))t.push([n,a].join(": "));return t.join("; ")}function QT(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const JT=["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"],eA=$6(H5,"div"),tA=$6(mf,"g",JT),ep={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function nA(e,t){return F6(e,{})||{type:"root",children:[]}}function F6(e,t){const n=rA(e,t);return n&&t.afterTransform&&t.afterTransform(e,n),n}function rA(e,t){switch(e.nodeType){case 1:return sA(e,t);case 3:return iA(e);case 8:return lA(e);case 9:return N3(e,t);case 10:return aA();case 11:return N3(e,t);default:return}}function N3(e,t){return{type:"root",children:P6(e,t)}}function aA(){return{type:"doctype"}}function iA(e){return{type:"text",value:e.nodeValue||""}}function lA(e){return{type:"comment",value:e.nodeValue||""}}function sA(e,t){const n=e.namespaceURI,a=n===ep.svg?tA:eA,l=n===ep.html?e.tagName.toLowerCase():e.tagName,o=n===ep.html&&l==="template"?e.content:e,c=e.getAttributeNames(),f={};let h=-1;for(;++h<c.length;)f[c[h]]=e.getAttribute(c[h])||"";return a(l,f,P6(o,t))}function P6(e,t){const n=e.childNodes,a=[];let l=-1;for(;++l<n.length;){const o=F6(n[l],t);o!==void 0&&a.push(o)}return a}new DOMParser;function oA(e,t){const n=uA(e);return nA(n)}function uA(e){const t=document.createElement("template");return t.innerHTML=e,t.content}const M3=(function(e,t,n){const a=Qc(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(a(e.children[t],t,e))return e.children[t]}),Ls=(function(e){if(e==null)return fA;if(typeof e=="string")return dA(e);if(typeof e=="object")return cA(e);if(typeof e=="function")return F1(e);throw new Error("Expected function, string, or array as `test`")});function cA(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Ls(e[n]);return F1(a);function a(...l){let o=-1;for(;++o<t.length;)if(t[o].apply(this,l))return!0;return!1}}function dA(e){return F1(t);function t(n){return n.tagName===e}}function F1(e){return t;function t(n,a,l){return!!(hA(n)&&e.call(this,n,typeof a=="number"?a:void 0,l||void 0))}}function fA(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function hA(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const z3=/\n/g,D3=/[\t ]+/g,Wp=Ls("br"),R3=Ls(wA),mA=Ls("p"),O3=Ls("tr"),pA=Ls(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",bA,kA]),G6=Ls(["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"]);function gA(e,t){const n=t||{},a="children"in e?e.children:[],l=G6(e),o=W6(e,{whitespace:n.whitespace||"normal"}),c=[];(e.type==="text"||e.type==="comment")&&c.push(...Y6(e,{breakBefore:!0,breakAfter:!0}));let f=-1;for(;++f<a.length;)c.push(...V6(a[f],e,{whitespace:o,breakBefore:f?void 0:l,breakAfter:f<a.length-1?Wp(a[f+1]):l}));const h=[];let m;for(f=-1;++f<c.length;){const g=c[f];typeof g=="number"?m!==void 0&&g>m&&(m=g):g&&(m!==void 0&&m>-1&&h.push(`
|
|
345
345
|
`.repeat(m)||" "),m=-1,h.push(g))}return h.join("")}function V6(e,t,n){return e.type==="element"?yA(e,t,n):e.type==="text"?n.whitespace==="normal"?Y6(e,n):vA(e):[]}function yA(e,t,n){const a=W6(e,n),l=e.children||[];let o=-1,c=[];if(pA(e))return c;let f,h;for(Wp(e)||O3(e)&&M3(t,e,O3)?h=`
|
|
346
|
-
`:mA(e)?(f=2,h=2):G6(e)&&(f=1,h=1);++o<l.length;)c=c.concat(V6(l[o],e,{whitespace:a,breakBefore:o?void 0:f,breakAfter:o<l.length-1?Wp(l[o+1]):h}));return R3(e)&&M3(t,e,R3)&&c.push(" "),f&&c.unshift(f),h&&c.push(h),c}function Y6(e,t){const n=String(e.value),a=[],l=[];let o=0;for(;o<=n.length;){z3.lastIndex=o;const h=z3.exec(n),m=h&&"index"in h?h.index:n.length;a.push(xA(n.slice(o,m).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),o===0?t.breakBefore:!0,m===n.length?t.breakAfter:!0)),o=m+1}let c=-1,f;for(;++c<a.length;)a[c].charCodeAt(a[c].length-1)===8203||c<a.length-1&&a[c+1].charCodeAt(0)===8203?(l.push(a[c]),f=void 0):a[c]?(typeof f=="number"&&l.push(f),l.push(a[c]),f=0):(c===0||c===a.length-1)&&l.push(0);return l}function vA(e){return[String(e.value)]}function xA(e,t,n){const a=[];let l=0,o;for(;l<e.length;){D3.lastIndex=l;const c=D3.exec(e);o=c?c.index:e.length,!l&&!o&&c&&!t&&a.push(""),l!==o&&a.push(e.slice(l,o)),l=c?o+c[0].length:o}return l!==o&&!n&&a.push(""),a.join(" ")}function W6(e,t){if(e.type==="element"){const 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"}}return t.whitespace}function bA(e){return!!(e.properties||{}).hidden}function wA(e){return e.tagName==="td"||e.tagName==="th"}function kA(e){return e.tagName==="dialog"&&!(e.properties||{}).open}const SA={},jA=[];function CA(e){const t=e||SA;return function(n,a){w1(n,"element",function(l,o){const c=Array.isArray(l.properties.className)?l.properties.className:jA,f=c.includes("language-math"),h=c.includes("math-display"),m=c.includes("math-inline");let g=h;if(!f&&!h&&!m)return;let v=o[o.length-1],k=l;if(l.tagName==="code"&&f&&v&&v.type==="element"&&v.tagName==="pre"&&(k=v,v=o[o.length-2],g=!0),!v)return;const b=gA(k,{whitespace:"pre"});let T;try{T=Vp.renderToString(b,{...t,displayMode:g,throwOnError:!0})}catch(q){const z=q,M=z.name.toLowerCase();a.message("Could not render math with KaTeX",{ancestors:[...o,l],cause:z,place:l.position,ruleId:M,source:"rehype-katex"});try{T=Vp.renderToString(b,{...t,displayMode:g,strict:"ignore",throwOnError:!1})}catch{T=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(t.errorColor||"#cc0000"),title:String(q)},children:[{type:"text",value:b}]}]}}typeof T=="string"&&(T=oA(T).children);const A=v.children.indexOf(k);return v.children.splice(A,1,...T),mv})}}function TA(e,t,n){return e?t?n==="delta"?e+t:t.startsWith(e)?t:e:e:t}const AA={pending:"Pending",completed:"Completed",blocked:"Blocked",cancelled:"Cancelled",running:"Running",accepted:"Accepted",failed:"Failed"},Wo=224,uf=100,jc=72,tp=100,np=48;function EA(e){const t=new Map(e.map(h=>[h.id,h])),n=new Set,a=[];for(;t.size;){const h=[...t.values()].filter(g=>g.dependencies.every(v=>n.has(v))),m=h.length?h:[...t.values()];a.push(m);for(const g of m)t.delete(g.id),n.add(g.id)}const l=Math.max(1,...a.map(h=>h.length))*(Wo+jc)-jc+np*2,o=new Map;a.forEach((h,m)=>{const g=h.length*(Wo+jc)-jc;h.forEach((v,k)=>o.set(v.id,{x:(l-g)/2+k*(Wo+jc),y:np+m*(uf+tp),rank:m}))});const c=e.flatMap(h=>h.dependencies.flatMap(m=>{const g=o.get(m),v=o.get(h.id);return!g||!v?[]:[{source:m,target:h.id,start:g,end:v}]})),f=c.filter(h=>h.end.rank-h.start.rank>1);return{positions:o,edges:c,longEdges:f,width:l+f.length*18,height:np*2+a.length*(uf+tp)-tp}}function NA({nodes:e,members:t,executions:n,selectedId:a,onSelect:l}){const o=D.useMemo(()=>EA(e),[e]),c=D.useRef(null),[f,h]=D.useState({width:900,height:560}),[m,g]=D.useState(null),v=D.useId().replace(/:/g,"");D.useEffect(()=>{if(!c.current)return;const A=new ResizeObserver(([q])=>h({width:q.contentRect.width,height:q.contentRect.height}));return A.observe(c.current),()=>A.disconnect()},[]);const k=Math.min(1,Math.max(.15,Math.min((f.width-32)/o.width,(f.height-32)/o.height))),b=m??k,T=new Map(e.map(A=>{const q=[...n].reverse().find(z=>z.nodeId===A.id);return[A.id,q&&["running","accepted","failed"].includes(q.status)&&A.status!=="completed"?q.status:A.status]}));return u.jsxs("section",{className:"cotask-graph","aria-label":"Task dependency graph",children:[u.jsxs("div",{className:"cotask-graph-toolbar",children:[u.jsxs("span",{children:["Arrows show dependencies ",u.jsxs("span",{className:"cotask-graph-count",children:["· ",e.length," nodes / ",o.edges.length," dependencies"]})]}),u.jsxs("div",{children:[u.jsx("button",{"aria-label":"Zoom out",onClick:()=>g(Math.max(.15,b-.15)),children:"−"}),u.jsxs("span",{children:[Math.round(b*100),"%"]}),u.jsx("button",{"aria-label":"Zoom in",onClick:()=>g(Math.min(2,b+.15)),children:"+"}),u.jsx("button",{onClick:()=>g(null),children:"Fit to view"})]})]}),u.jsx("div",{className:"cotask-graph-viewport",ref:c,children:u.jsx("div",{className:"cotask-graph-scroll",style:{width:Math.max(f.width,o.width*b),height:Math.max(f.height,o.height*b)},children:u.jsxs("div",{className:"cotask-graph-canvas",style:{width:o.width,height:o.height,transform:`scale(${b})`,left:Math.max(0,(f.width-o.width*b)/2),top:Math.max(0,(f.height-o.height*b)/2)},children:[u.jsxs("svg",{width:o.width,height:o.height,className:"cotask-graph-edges","aria-hidden":"true",children:[u.jsx("defs",{children:["default","complete","selected"].map(A=>u.jsx("marker",{id:`${v}-${A}`,markerWidth:"8",markerHeight:"8",refX:"7",refY:"4",orient:"auto",markerUnits:"userSpaceOnUse",children:u.jsx("path",{d:"M 1 1 L 7 4 L 1 7 Z",className:`cotask-arrow-${A}`})},A))}),o.edges.map(A=>{const q=A.start.x+Wo/2,z=A.start.y+uf+4,M=A.end.x+Wo/2,B=A.end.y-5,U=(z+B)/2,ae=o.width-20-o.longEdges.indexOf(A)*18,L=A.end.rank-A.start.rank>1?`M ${q} ${z} L ${q} ${z+30} L ${ae} ${z+30} L ${ae} ${B-30} L ${M} ${B-30} L ${M} ${B}`:`M ${q} ${z} C ${q} ${U}, ${M} ${U}, ${M} ${B}`,K=a&&[A.source,A.target].includes(a)?"selected":T.get(A.source)==="completed"?"complete":"default";return u.jsx("path",{d:L,className:`cotask-edge ${K}`,markerEnd:`url(#${v}-${K})`},`${A.source}:${A.target}`)})]}),e.map(A=>{var M;const q=o.positions.get(A.id),z=T.get(A.id);return u.jsxs("button",{className:`cotask-graph-node ${z}${a===A.id?" selected":""}`,style:{left:q.x,top:q.y,width:Wo,height:uf},"aria-pressed":a===A.id,onClick:()=>l(A),title:A.dependencies.length?`Depends on: ${A.dependencies.map(B=>{var U;return((U=e.find(ae=>ae.id===B))==null?void 0:U.name)??B}).join(", ")}`:"No dependencies",children:[A.dependencies.length>0&&u.jsx("i",{className:"cotask-node-port input"}),u.jsxs("span",{className:"cotask-graph-node-status",children:[u.jsx("i",{}),AA[z]??z]}),u.jsx("strong",{children:A.name}),u.jsx("span",{className:"cotask-graph-node-member",children:((M=t.find(B=>B.id===A.memberId))==null?void 0:M.name)??A.memberId}),o.edges.some(B=>B.source===A.id)&&u.jsx("i",{className:"cotask-node-port output"})]},A.id)})]})})}),u.jsxs("div",{className:"cotask-graph-legend",children:[u.jsxs("span",{children:[u.jsx("i",{className:"completed"}),"Completed"]}),u.jsxs("span",{children:[u.jsx("i",{className:"running"}),"Running"]}),u.jsxs("span",{children:[u.jsx("i",{className:"pending"}),"Pending"]}),u.jsxs("span",{children:[u.jsx("i",{className:"blocked"}),"Blocked / Failed"]}),u.jsx("span",{children:"Select a node to view context and reports"})]})]})}const rp=e=>({draft:"Draft",running:"Running",finished:"Finished",pending:"Pending",completed:"Completed",blocked:"Blocked",cancelled:"Cancelled",accepted:"Accepted",failed:"Failed"})[e]??e;function MA({ownerId:e,ownerName:t,request:n,onExpanded:a,renderMember:l}){const[o,c]=D.useState([]),[f,h]=D.useState(null),[m,g]=D.useState(null),[v,k]=D.useState("graph"),[b,T]=D.useState(null),[A,q]=D.useState(null),[z,M]=D.useState(null),[B,U]=D.useState([]),[ae,L]=D.useState(null),[K,ie]=D.useState(null),[Q,F]=D.useState([]),[he,ce]=D.useState(""),Ie=D.useRef(null),be=D.useRef(0),pe=D.useRef("");pe.current=`${f}:${m==null?void 0:m.task.revision}`;const J=D.useRef(b);J.current=b;const Y=`conversations/${encodeURIComponent(e)}/cotasks`;D.useEffect(()=>{let ne=!0;const we=async()=>{try{const He=await n(Y);ne&&c(He.tasks)}catch(He){ne&&ce(String(He))}};we();const _e=window.setInterval(()=>void we(),5e3);return()=>{ne=!1,window.clearInterval(_e)}},[Y,n]),D.useEffect(()=>(a(f!==null),()=>a(!1)),[f,a]),D.useEffect(()=>{if(!f)return;let ne=!0;const we=async()=>{try{const He=await n(`${Y}/${encodeURIComponent(f)}`);if(ne&&(g(He),ce("")),v==="operations"){const wt=await n(`${Y}/${encodeURIComponent(f)}`,{operations:!0});ne&&F(wt.operations)}}catch(He){ne&&ce(String(He))}};we();const _e=window.setInterval(()=>void we(),3e3);return()=>{ne=!1,window.clearInterval(_e)}},[f,Y,n,v]),D.useEffect(()=>{var ne;f&&((ne=Ie.current)==null||ne.focus())},[f]),D.useEffect(()=>{be.current++,L(null),ie(null),U([])},[m==null?void 0:m.task.revision]);const ge=JSON.stringify(m==null?void 0:m.reports.map(ne=>ne.id));D.useEffect(()=>{if(!f||!A||!m)return;let ne=!0;if(!m.nodes.some(we=>we.id===A)){q(null),M(null);return}return n(`${Y}/${encodeURIComponent(f)}`,{nodeIds:[A]}).then(we=>{ne&&M(we.nodes[0]??null)}).catch(we=>{ne&&ce(String(we))}),()=>{ne=!1}},[f,A,m==null?void 0:m.task.revision,ge,Y,n]);const Te=ne=>{q(null),be.current++,L(null),ie(null),F([]),ce(""),g(null),h(ne),k("graph"),T(null),M(null),U([])},H=()=>{be.current++,h(null)},_=o.find(ne=>ne.status==="running")??o.find(ne=>ne.status==="draft")??o[0];if(!f)return _?u.jsxs("div",{className:"cotask-launcher",children:[u.jsxs("button",{className:"cotask-launch-primary",onClick:()=>Te(_.id),children:[u.jsx("span",{children:"CoTask"}),u.jsx("strong",{children:_.name}),u.jsxs("small",{children:[rp(_.status)," · ",_.nodeCount," nodes ↗"]})]}),o.length>1&&u.jsxs("details",{className:"cotask-task-list",children:[u.jsxs("summary",{children:["Other tasks (",o.length-1,")"]}),o.filter(ne=>ne.id!==_.id).map(ne=>u.jsxs("button",{onClick:()=>Te(ne.id),children:[u.jsx("strong",{children:ne.name}),u.jsx("small",{children:rp(ne.status)})]},ne.id))]})]}):null;const te=ne=>{A!==ne.id&&(be.current++,ce(""),M(null),U([]),q(ne.id))},O=async ne=>{const we=++be.current;try{const _e=await n(`${Y}/${f}`,{reportIds:[ne.id]});we===be.current&&U(_e.reports)}catch(_e){ce(String(_e))}},ee=m==null?void 0:m.bindings.find(ne=>ne.memberId===b),Ae=m==null?void 0:m.members.find(ne=>ne.id===b);return u.jsx("div",{className:"context-panel-overlay settings-overlay cotask-overlay",children:u.jsxs("section",{className:"context-panel settings-panel cotask-frame",role:"dialog","aria-modal":"true","aria-label":"CoTask",tabIndex:-1,ref:Ie,onKeyDown:ne=>{var we;if(ne.stopPropagation(),ne.key==="Escape"&&H(),ne.key==="Tab"){const _e=(we=Ie.current)==null?void 0:we.querySelectorAll('button:not(:disabled),select,input,a[href],textarea,[tabindex="0"]');if(!(_e!=null&&_e.length))return;const He=_e[0],wt=_e[_e.length-1];ne.shiftKey&&(document.activeElement===He||document.activeElement===Ie.current)?(ne.preventDefault(),wt.focus()):!ne.shiftKey&&document.activeElement===wt&&(ne.preventDefault(),He.focus())}},children:[u.jsxs("header",{className:"cotask-header settings-panel-header",children:[u.jsxs("div",{children:[u.jsxs("p",{children:["CoTask · ",t]}),u.jsx("h1",{children:(m==null?void 0:m.task.name)??"Loading task…"})]}),u.jsx("span",{children:m&&rp(m.task.status)}),u.jsx("button",{className:"cotask-close",onClick:H,"aria-label":"Close CoTask",title:"Close CoTask",children:"×"})]}),u.jsxs("aside",{className:"cotask-nav",children:[u.jsxs("section",{className:"workspace-group","aria-label":"Task navigation",children:[u.jsx("h2",{className:"cotask-nav-group-title",children:"Task"}),u.jsx("nav",{className:"workspace-group-items",children:[["graph","Task graph"],["operations","Activity"],["settings","Settings"]].map(([ne,we])=>u.jsx("button",{className:`session-item${v===ne?" active":""}`,"aria-current":v===ne?"page":void 0,onClick:()=>{k(ne),T(null)},children:u.jsx("span",{className:"session-title",children:we})},ne))})]}),u.jsxs("section",{className:"workspace-group","aria-label":"Task members",children:[u.jsx("h2",{className:"cotask-nav-group-title",children:"Members"}),u.jsx("div",{className:"workspace-group-items cotask-member-list",children:m==null?void 0:m.members.map(ne=>{const we=m.executions.some(He=>He.memberId===ne.id&&["accepted","running"].includes(He.status)),_e=we?"Running":m.bindings.some(He=>He.memberId===ne.id&&He.workspaceId)?"Idle":"Not created";return u.jsx("button",{className:`session-item${v==="member"&&b===ne.id?" active":""}`,title:`${ne.name} · ${_e}`,"aria-label":`${ne.name} · ${_e}`,"aria-current":v==="member"&&b===ne.id?"page":void 0,onClick:()=>{T(ne.id),k("member")},children:u.jsxs("span",{className:"session-heading",children:[u.jsx("span",{className:`session-status${we?" running":""}`,"aria-hidden":"true"}),u.jsx("span",{className:"session-title",children:ne.name})]})},ne.id)})})]}),u.jsxs("button",{className:"cotask-return",onClick:H,children:["← Back to ",t]})]}),u.jsxs("section",{className:"cotask-main",children:[he&&u.jsx("div",{className:"cotask-error",role:"alert",children:he}),u.jsx("div",{className:"cotask-body",children:m?u.jsxs(u.Fragment,{children:[m.warnings.length>0&&u.jsx("div",{className:"cotask-warning",children:m.warnings.map((ne,we)=>u.jsxs("p",{children:[ne.id?`${ne.id}: `:"Common context: ","Context may exceed the injection limit. (estimated ",ne.estimatedTokens," tokens)"]},we))}),v==="graph"&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"cotask-section-heading",children:[u.jsx("h2",{children:"Task graph"}),u.jsxs("span",{children:[m.nodes.filter(ne=>ne.status==="completed").length," / ",m.nodes.length," Completed"]})]}),!m.nodes.length&&u.jsx("p",{children:"No nodes yet. Discuss the plan with the initiating agent to define the graph."}),u.jsxs("details",{className:"cotask-context",onToggle:ne=>{if(ne.currentTarget.open&&ae===null){const we=pe.current;n(`${Y}/${f}`,{view:"definition"}).then(_e=>{pe.current===we&&L(_e.definition.commonContext)}).catch(_e=>{pe.current===we&&ce(String(_e))})}},children:[u.jsx("summary",{children:"Common context"}),u.jsx("p",{className:"cotask-prewrap",children:ae??"Loading…"})]},m.task.revision),m.nodes.length>0&&u.jsx(NA,{nodes:m.nodes,members:m.members,executions:m.executions,selectedId:A??void 0,onSelect:ne=>void te(ne)}),z&&u.jsxs("section",{className:"cotask-node-detail",children:[u.jsx("h3",{children:z.definition.name}),u.jsx("p",{className:"cotask-prewrap",children:z.definition.context}),u.jsx("h4",{children:"Reports"}),z.reports.length?z.reports.map(ne=>u.jsxs("button",{onClick:()=>void O(ne),children:[ne.type," · ",ne.summary]},ne.id)):u.jsx("p",{children:"No reports yet."}),B.map(ne=>u.jsxs("article",{children:[u.jsx("h4",{children:ne.summary}),u.jsx("p",{className:"cotask-prewrap",children:ne.content})]},ne.id))]}),m.task.conclusion&&u.jsxs("section",{children:[u.jsx("h3",{children:"Conclusion"}),u.jsx("p",{className:"cotask-prewrap",children:m.task.conclusion})]})]}),v==="operations"&&u.jsxs(u.Fragment,{children:[u.jsx("h2",{children:"Activity"}),u.jsx("p",{children:"Changes are saved immediately and retained if a turn fails."}),Q.length?Q.map((ne,we)=>u.jsxs("details",{className:"cotask-operation",children:[u.jsxs("summary",{children:[String(ne.action)," · ",String(ne.status)," · Turn ",String(ne.turnStatus)]}),u.jsx("pre",{children:JSON.stringify(ne,null,2)})]},we)):u.jsx("p",{children:"No activity yet."})]}),v==="settings"&&u.jsx(zA,{task:m.task,path:`${Y}/${f}/settings`,request:n,onSaved:ne=>g({...m,task:ne})},f),v==="member"&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"cotask-section-heading",children:[u.jsx("h2",{children:Ae==null?void 0:Ae.name}),u.jsx("span",{children:"CoTask member"})]}),u.jsxs("details",{className:"cotask-context",onToggle:ne=>{if(ne.currentTarget.open&&b&&(K==null?void 0:K.id)!==b){const we=b,_e=pe.current;n(`${Y}/${f}`,{memberIds:[we]}).then(He=>{var wt;pe.current===_e&&J.current===we&&ie({id:we,context:((wt=He.members[0])==null?void 0:wt.context)??""})}).catch(He=>{pe.current===_e&&J.current===we&&ce(String(He))})}},children:[u.jsx("summary",{children:"Member context"}),u.jsx("p",{className:"cotask-prewrap",children:(K==null?void 0:K.id)===b?K==null?void 0:K.context:"Loading…"})]},`${b}:${m.task.revision}`),ee!=null&&ee.workspaceId?l(ee.workspaceId):u.jsx("p",{children:m.executions.some(ne=>ne.memberId===b)?"This member instance was removed. Execution history is retained.":"This member will be created when its first node is driven."})]})]}):u.jsx("p",{children:"Loading task…"})})]})]})})}function zA({task:e,path:t,request:n,onSaved:a}){var M,B;const[l,o]=D.useState(e.runtimeSettings),[c,f]=D.useState(e.revision),[h,m]=D.useState([]),[g,v]=D.useState([]),[k,b]=D.useState(!1),[T,A]=D.useState("");D.useEffect(()=>{let U=!0;return Promise.all([n("settings/runtime/models?refresh=0"),n("settings/model-providers/options")]).then(([ae,L])=>{U&&(m(ae.models),v(L.channels))}).catch(ae=>{U&&A(String(ae))}),()=>{U=!1}},[n]);const q=h.find(U=>U.model===l.model||U.id===l.model),z=((M=q==null?void 0:q.supportedReasoningEfforts)==null?void 0:M.map(U=>U.reasoningEffort))??["none","minimal","low","medium","high","xhigh","max"];return u.jsxs("section",{className:"cotask-settings",children:[u.jsx("h2",{children:"Settings"}),u.jsx("p",{children:"Settings apply to the whole CoTask and take effect on each member’s next turn."}),u.jsxs("label",{children:["Model source",u.jsxs("select",{value:l.modelSource.type==="codex"?"codex":l.modelSource.channelId,onChange:U=>o({...l,modelSource:U.target.value==="codex"?{type:"codex"}:{type:"custom",channelId:U.target.value}}),children:[u.jsx("option",{value:"codex",children:"Codex"}),l.modelSource.type==="custom"&&!g.some(U=>U.id===l.modelSource.channelId)&&u.jsx("option",{value:l.modelSource.channelId,children:"Current channel unavailable"}),g.map(U=>u.jsx("option",{value:U.id,children:U.name},U.id))]})]}),l.modelSource.type==="codex"?u.jsxs(u.Fragment,{children:[u.jsxs("label",{children:["Model",u.jsxs("select",{value:l.model,onChange:U=>o({...l,model:U.target.value}),children:[u.jsx("option",{value:"",children:"Default model"}),l.model&&!h.some(U=>U.model===l.model)&&u.jsx("option",{children:l.model}),h.map(U=>u.jsx("option",{value:U.model,children:U.displayName},U.id))]})]}),u.jsxs("label",{children:["Reasoning effort",u.jsxs("select",{value:l.reasoningEffort,onChange:U=>o({...l,reasoningEffort:U.target.value}),children:[u.jsx("option",{value:"",children:"Default"}),l.reasoningEffort&&!z.includes(l.reasoningEffort)&&u.jsx("option",{children:l.reasoningEffort}),z.map(U=>u.jsx("option",{children:U},U))]})]})]}):u.jsxs("p",{children:["Channel model: ",((B=g.find(U=>U.id===l.modelSource.channelId))==null?void 0:B.model)??"Channel unavailable",". Codex reasoning effort does not apply to custom channels."]}),u.jsx("button",{disabled:k,onClick:async()=>{b(!0),A("");try{const U=await n(t,{expectedRevision:c,runtimeSettings:l},"PUT");f(U.task.revision),a(U.task),A("Saved. Changes take effect on the next turn.")}catch(U){A(`${String(U)}. If the task changed, reopen Settings before saving.`)}finally{b(!1)}},children:k?"Saving…":"Save settings"}),T&&u.jsx("p",{role:"status",children:T})]})}function DA(e,t=new Date){if(e==null||!Number.isInteger(e)||e<1||e>31)return null;const n=new Date(t.getTime()+480*60*1e3),a=n.getUTCFullYear(),l=n.getUTCMonth(),o=Date.UTC(a,l,n.getUTCDate()),c=h=>Date.UTC(a,l+h,Math.min(e,new Date(Date.UTC(a,l+h+1,0)).getUTCDate()));let f=c(0);return f<o&&(f=c(1)),{date:new Date(f).toISOString().slice(0,10),days:(f-o)/864e5}}function RA({content:e,streaming:t}){const[n,a]=D.useState(!1),l=D.useId();return u.jsxs("section",{className:`message reasoning${t?" is-streaming":""}${n?" is-expanded":""}`,children:[u.jsxs("button",{className:"reasoning-toggle",type:"button","aria-expanded":n,"aria-controls":l,onClick:()=>a(o=>!o),children:[u.jsx("span",{className:"reasoning-indicator","aria-hidden":"true"}),u.jsx("span",{children:t?"思考中":"思考过程"}),u.jsx("span",{className:"reasoning-action",children:n?"收起":"展开"}),u.jsx("svg",{className:"reasoning-chevron",width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",children:u.jsx("path",{d:"m4 2 4 4-4 4",fill:"none",stroke:"currentColor",strokeWidth:"1.4"})})]}),u.jsx("div",{id:l,hidden:!n&&!t,className:`reasoning-content${n?"":" reasoning-preview"}`,children:u.jsx("div",{className:"message-body",children:n?e:e.slice(-600)})})]})}function OA(e,t){if(!t||typeof t!="object")return null;const{method:n,params:a}=t;if(!a)return null;if(n==="item/completed"){const m=a.item;if((m==null?void 0:m.type)!=="reasoning"||typeof m.id!="string")return null;const g=e.get(m.id)??{itemId:m.id,text:new Map,summary:new Map,completed:!1};for(const v of["text","summary"]){const k=m[v];Array.isArray(k)&&k.forEach((b,T)=>{typeof b=="string"&&b&&g[v].set(T,b)})}return g.completed=!0,e.set(m.id,g),g}const l=/^item\/reasoning\/(text|summaryText)(Delta|Snapshot)$/.exec(n??"");if(!l||typeof a.itemId!="string")return null;const o=l[1]==="text"?"text":"summary",c=a[o==="text"?"contentIndex":"summaryIndex"],f=a[l[2]==="Delta"?"delta":"text"];if(typeof c!="number"||!Number.isSafeInteger(c)||c<0||typeof f!="string")return null;const h=e.get(a.itemId)??{itemId:a.itemId,text:new Map,summary:new Map,completed:!1};return h[o].set(c,l[2]==="Snapshot"?f:(h[o].get(c)??"")+f),e.set(a.itemId,h),h}function IA(e){return[...e.text.size?e.text:e.summary].sort(([n],[a])=>n-a).map(([,n])=>n).join(`
|
|
346
|
+
`:mA(e)?(f=2,h=2):G6(e)&&(f=1,h=1);++o<l.length;)c=c.concat(V6(l[o],e,{whitespace:a,breakBefore:o?void 0:f,breakAfter:o<l.length-1?Wp(l[o+1]):h}));return R3(e)&&M3(t,e,R3)&&c.push(" "),f&&c.unshift(f),h&&c.push(h),c}function Y6(e,t){const n=String(e.value),a=[],l=[];let o=0;for(;o<=n.length;){z3.lastIndex=o;const h=z3.exec(n),m=h&&"index"in h?h.index:n.length;a.push(xA(n.slice(o,m).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),o===0?t.breakBefore:!0,m===n.length?t.breakAfter:!0)),o=m+1}let c=-1,f;for(;++c<a.length;)a[c].charCodeAt(a[c].length-1)===8203||c<a.length-1&&a[c+1].charCodeAt(0)===8203?(l.push(a[c]),f=void 0):a[c]?(typeof f=="number"&&l.push(f),l.push(a[c]),f=0):(c===0||c===a.length-1)&&l.push(0);return l}function vA(e){return[String(e.value)]}function xA(e,t,n){const a=[];let l=0,o;for(;l<e.length;){D3.lastIndex=l;const c=D3.exec(e);o=c?c.index:e.length,!l&&!o&&c&&!t&&a.push(""),l!==o&&a.push(e.slice(l,o)),l=c?o+c[0].length:o}return l!==o&&!n&&a.push(""),a.join(" ")}function W6(e,t){if(e.type==="element"){const 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"}}return t.whitespace}function bA(e){return!!(e.properties||{}).hidden}function wA(e){return e.tagName==="td"||e.tagName==="th"}function kA(e){return e.tagName==="dialog"&&!(e.properties||{}).open}const SA={},jA=[];function CA(e){const t=e||SA;return function(n,a){w1(n,"element",function(l,o){const c=Array.isArray(l.properties.className)?l.properties.className:jA,f=c.includes("language-math"),h=c.includes("math-display"),m=c.includes("math-inline");let g=h;if(!f&&!h&&!m)return;let v=o[o.length-1],k=l;if(l.tagName==="code"&&f&&v&&v.type==="element"&&v.tagName==="pre"&&(k=v,v=o[o.length-2],g=!0),!v)return;const b=gA(k,{whitespace:"pre"});let T;try{T=Vp.renderToString(b,{...t,displayMode:g,throwOnError:!0})}catch(q){const z=q,M=z.name.toLowerCase();a.message("Could not render math with KaTeX",{ancestors:[...o,l],cause:z,place:l.position,ruleId:M,source:"rehype-katex"});try{T=Vp.renderToString(b,{...t,displayMode:g,strict:"ignore",throwOnError:!1})}catch{T=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(t.errorColor||"#cc0000"),title:String(q)},children:[{type:"text",value:b}]}]}}typeof T=="string"&&(T=oA(T).children);const A=v.children.indexOf(k);return v.children.splice(A,1,...T),mv})}}function TA(e,t,n){return e?t?n==="delta"?e+t:t.startsWith(e)?t:e:e:t}const AA={pending:"Pending",completed:"Completed",blocked:"Blocked",cancelled:"Cancelled",running:"Running",accepted:"Accepted",failed:"Failed"},Wo=224,uf=100,jc=72,tp=100,np=48;function EA(e){const t=new Map(e.map(h=>[h.id,h])),n=new Set,a=[];for(;t.size;){const h=[...t.values()].filter(g=>g.dependencies.every(v=>n.has(v))),m=h.length?h:[...t.values()];a.push(m);for(const g of m)t.delete(g.id),n.add(g.id)}const l=Math.max(1,...a.map(h=>h.length))*(Wo+jc)-jc+np*2,o=new Map;a.forEach((h,m)=>{const g=h.length*(Wo+jc)-jc;h.forEach((v,k)=>o.set(v.id,{x:(l-g)/2+k*(Wo+jc),y:np+m*(uf+tp),rank:m}))});const c=e.flatMap(h=>h.dependencies.flatMap(m=>{const g=o.get(m),v=o.get(h.id);return!g||!v?[]:[{source:m,target:h.id,start:g,end:v}]})),f=c.filter(h=>h.end.rank-h.start.rank>1);return{positions:o,edges:c,longEdges:f,width:l+f.length*18,height:np*2+a.length*(uf+tp)-tp}}function NA({nodes:e,members:t,executions:n,selectedId:a,onSelect:l}){const o=D.useMemo(()=>EA(e),[e]),c=D.useRef(null),[f,h]=D.useState({width:900,height:560}),[m,g]=D.useState(null),v=D.useId().replace(/:/g,"");D.useEffect(()=>{if(!c.current)return;const A=new ResizeObserver(([q])=>h({width:q.contentRect.width,height:q.contentRect.height}));return A.observe(c.current),()=>A.disconnect()},[]);const k=Math.min(1,Math.max(.15,Math.min((f.width-32)/o.width,(f.height-32)/o.height))),b=m??k,T=new Map(e.map(A=>{const q=[...n].reverse().find(z=>z.nodeId===A.id);return[A.id,q&&["running","accepted","failed"].includes(q.status)&&A.status!=="completed"?q.status:A.status]}));return u.jsxs("section",{className:"cotask-graph","aria-label":"Task dependency graph",children:[u.jsxs("div",{className:"cotask-graph-toolbar",children:[u.jsxs("span",{children:["Arrows show dependencies ",u.jsxs("span",{className:"cotask-graph-count",children:["· ",e.length," nodes / ",o.edges.length," dependencies"]})]}),u.jsxs("div",{children:[u.jsx("button",{"aria-label":"Zoom out",onClick:()=>g(Math.max(.15,b-.15)),children:"−"}),u.jsxs("span",{children:[Math.round(b*100),"%"]}),u.jsx("button",{"aria-label":"Zoom in",onClick:()=>g(Math.min(2,b+.15)),children:"+"}),u.jsx("button",{onClick:()=>g(null),children:"Fit to view"})]})]}),u.jsx("div",{className:"cotask-graph-viewport",ref:c,children:u.jsx("div",{className:"cotask-graph-scroll",style:{width:Math.max(f.width,o.width*b),height:Math.max(f.height,o.height*b)},children:u.jsxs("div",{className:"cotask-graph-canvas",style:{width:o.width,height:o.height,transform:`scale(${b})`,left:Math.max(0,(f.width-o.width*b)/2),top:Math.max(0,(f.height-o.height*b)/2)},children:[u.jsxs("svg",{width:o.width,height:o.height,className:"cotask-graph-edges","aria-hidden":"true",children:[u.jsx("defs",{children:["default","complete","selected"].map(A=>u.jsx("marker",{id:`${v}-${A}`,markerWidth:"8",markerHeight:"8",refX:"7",refY:"4",orient:"auto",markerUnits:"userSpaceOnUse",children:u.jsx("path",{d:"M 1 1 L 7 4 L 1 7 Z",className:`cotask-arrow-${A}`})},A))}),o.edges.map(A=>{const q=A.start.x+Wo/2,z=A.start.y+uf+4,M=A.end.x+Wo/2,B=A.end.y-5,U=(z+B)/2,ne=o.width-20-o.longEdges.indexOf(A)*18,L=A.end.rank-A.start.rank>1?`M ${q} ${z} L ${q} ${z+30} L ${ne} ${z+30} L ${ne} ${B-30} L ${M} ${B-30} L ${M} ${B}`:`M ${q} ${z} C ${q} ${U}, ${M} ${U}, ${M} ${B}`,K=a&&[A.source,A.target].includes(a)?"selected":T.get(A.source)==="completed"?"complete":"default";return u.jsx("path",{d:L,className:`cotask-edge ${K}`,markerEnd:`url(#${v}-${K})`},`${A.source}:${A.target}`)})]}),e.map(A=>{var M;const q=o.positions.get(A.id),z=T.get(A.id);return u.jsxs("button",{className:`cotask-graph-node ${z}${a===A.id?" selected":""}`,style:{left:q.x,top:q.y,width:Wo,height:uf},"aria-pressed":a===A.id,onClick:()=>l(A),title:A.dependencies.length?`Depends on: ${A.dependencies.map(B=>{var U;return((U=e.find(ne=>ne.id===B))==null?void 0:U.name)??B}).join(", ")}`:"No dependencies",children:[A.dependencies.length>0&&u.jsx("i",{className:"cotask-node-port input"}),u.jsxs("span",{className:"cotask-graph-node-status",children:[u.jsx("i",{}),AA[z]??z]}),u.jsx("strong",{children:A.name}),u.jsx("span",{className:"cotask-graph-node-member",children:((M=t.find(B=>B.id===A.memberId))==null?void 0:M.name)??A.memberId}),o.edges.some(B=>B.source===A.id)&&u.jsx("i",{className:"cotask-node-port output"})]},A.id)})]})})}),u.jsxs("div",{className:"cotask-graph-legend",children:[u.jsxs("span",{children:[u.jsx("i",{className:"completed"}),"Completed"]}),u.jsxs("span",{children:[u.jsx("i",{className:"running"}),"Running"]}),u.jsxs("span",{children:[u.jsx("i",{className:"pending"}),"Pending"]}),u.jsxs("span",{children:[u.jsx("i",{className:"blocked"}),"Blocked / Failed"]}),u.jsx("span",{children:"Select a node to view context and reports"})]})]})}const rp=e=>({draft:"Draft",running:"Running",finished:"Finished",pending:"Pending",completed:"Completed",blocked:"Blocked",cancelled:"Cancelled",accepted:"Accepted",failed:"Failed"})[e]??e;function MA({ownerId:e,ownerName:t,request:n,onExpanded:a,renderMember:l}){const[o,c]=D.useState([]),[f,h]=D.useState(null),[m,g]=D.useState(null),[v,k]=D.useState("graph"),[b,T]=D.useState(null),[A,q]=D.useState(null),[z,M]=D.useState(null),[B,U]=D.useState([]),[ne,L]=D.useState(null),[K,ie]=D.useState(null),[Q,F]=D.useState([]),[he,ce]=D.useState(""),Ie=D.useRef(null),be=D.useRef(0),pe=D.useRef("");pe.current=`${f}:${m==null?void 0:m.task.revision}`;const J=D.useRef(b);J.current=b;const Y=`conversations/${encodeURIComponent(e)}/cotasks`;D.useEffect(()=>{let re=!0;const we=async()=>{try{const He=await n(Y);re&&c(He.tasks)}catch(He){re&&ce(String(He))}};we();const _e=window.setInterval(()=>void we(),5e3);return()=>{re=!1,window.clearInterval(_e)}},[Y,n]),D.useEffect(()=>(a(f!==null),()=>a(!1)),[f,a]),D.useEffect(()=>{if(!f)return;let re=!0;const we=async()=>{try{const He=await n(`${Y}/${encodeURIComponent(f)}`);if(re&&(g(He),ce("")),v==="operations"){const wt=await n(`${Y}/${encodeURIComponent(f)}`,{operations:!0});re&&F(wt.operations)}}catch(He){re&&ce(String(He))}};we();const _e=window.setInterval(()=>void we(),3e3);return()=>{re=!1,window.clearInterval(_e)}},[f,Y,n,v]),D.useEffect(()=>{var re;f&&((re=Ie.current)==null||re.focus())},[f]),D.useEffect(()=>{be.current++,L(null),ie(null),U([])},[m==null?void 0:m.task.revision]);const ge=JSON.stringify(m==null?void 0:m.reports.map(re=>re.id));D.useEffect(()=>{if(!f||!A||!m)return;let re=!0;if(!m.nodes.some(we=>we.id===A)){q(null),M(null);return}return n(`${Y}/${encodeURIComponent(f)}`,{nodeIds:[A]}).then(we=>{re&&M(we.nodes[0]??null)}).catch(we=>{re&&ce(String(we))}),()=>{re=!1}},[f,A,m==null?void 0:m.task.revision,ge,Y,n]);const Te=re=>{q(null),be.current++,L(null),ie(null),F([]),ce(""),g(null),h(re),k("graph"),T(null),M(null),U([])},H=()=>{be.current++,h(null)},_=o.find(re=>re.status==="running")??o.find(re=>re.status==="draft")??o[0];if(!f)return _?u.jsxs("div",{className:"cotask-launcher",children:[u.jsxs("button",{className:"cotask-launch-primary",onClick:()=>Te(_.id),children:[u.jsx("span",{children:"CoTask"}),u.jsx("strong",{children:_.name}),u.jsxs("small",{children:[rp(_.status)," · ",_.nodeCount," nodes ↗"]})]}),o.length>1&&u.jsxs("details",{className:"cotask-task-list",children:[u.jsxs("summary",{children:["Other tasks (",o.length-1,")"]}),o.filter(re=>re.id!==_.id).map(re=>u.jsxs("button",{onClick:()=>Te(re.id),children:[u.jsx("strong",{children:re.name}),u.jsx("small",{children:rp(re.status)})]},re.id))]})]}):null;const te=re=>{A!==re.id&&(be.current++,ce(""),M(null),U([]),q(re.id))},O=async re=>{const we=++be.current;try{const _e=await n(`${Y}/${f}`,{reportIds:[re.id]});we===be.current&&U(_e.reports)}catch(_e){ce(String(_e))}},ee=m==null?void 0:m.bindings.find(re=>re.memberId===b),Ae=m==null?void 0:m.members.find(re=>re.id===b);return u.jsx("div",{className:"context-panel-overlay settings-overlay cotask-overlay",children:u.jsxs("section",{className:"context-panel settings-panel cotask-frame",role:"dialog","aria-modal":"true","aria-label":"CoTask",tabIndex:-1,ref:Ie,onKeyDown:re=>{var we;if(re.stopPropagation(),re.key==="Escape"&&H(),re.key==="Tab"){const _e=(we=Ie.current)==null?void 0:we.querySelectorAll('button:not(:disabled),select,input,a[href],textarea,[tabindex="0"]');if(!(_e!=null&&_e.length))return;const He=_e[0],wt=_e[_e.length-1];re.shiftKey&&(document.activeElement===He||document.activeElement===Ie.current)?(re.preventDefault(),wt.focus()):!re.shiftKey&&document.activeElement===wt&&(re.preventDefault(),He.focus())}},children:[u.jsxs("header",{className:"cotask-header settings-panel-header",children:[u.jsxs("div",{children:[u.jsxs("p",{children:["CoTask · ",t]}),u.jsx("h1",{children:(m==null?void 0:m.task.name)??"Loading task…"})]}),u.jsx("span",{children:m&&rp(m.task.status)}),u.jsx("button",{className:"cotask-close",onClick:H,"aria-label":"Close CoTask",title:"Close CoTask",children:"×"})]}),u.jsxs("aside",{className:"cotask-nav",children:[u.jsxs("section",{className:"workspace-group","aria-label":"Task navigation",children:[u.jsx("h2",{className:"cotask-nav-group-title",children:"Task"}),u.jsx("nav",{className:"workspace-group-items",children:[["graph","Task graph"],["operations","Activity"],["settings","Settings"]].map(([re,we])=>u.jsx("button",{className:`session-item${v===re?" active":""}`,"aria-current":v===re?"page":void 0,onClick:()=>{k(re),T(null)},children:u.jsx("span",{className:"session-title",children:we})},re))})]}),u.jsxs("section",{className:"workspace-group","aria-label":"Task members",children:[u.jsx("h2",{className:"cotask-nav-group-title",children:"Members"}),u.jsx("div",{className:"workspace-group-items cotask-member-list",children:m==null?void 0:m.members.map(re=>{const we=m.executions.some(He=>He.memberId===re.id&&["accepted","running"].includes(He.status)),_e=we?"Running":m.bindings.some(He=>He.memberId===re.id&&He.workspaceId)?"Idle":"Not created";return u.jsx("button",{className:`session-item${v==="member"&&b===re.id?" active":""}`,title:`${re.name} · ${_e}`,"aria-label":`${re.name} · ${_e}`,"aria-current":v==="member"&&b===re.id?"page":void 0,onClick:()=>{T(re.id),k("member")},children:u.jsxs("span",{className:"session-heading",children:[u.jsx("span",{className:`session-status${we?" running":""}`,"aria-hidden":"true"}),u.jsx("span",{className:"session-title",children:re.name})]})},re.id)})})]}),u.jsxs("button",{className:"cotask-return",onClick:H,children:["← Back to ",t]})]}),u.jsxs("section",{className:"cotask-main",children:[he&&u.jsx("div",{className:"cotask-error",role:"alert",children:he}),u.jsx("div",{className:"cotask-body",children:m?u.jsxs(u.Fragment,{children:[m.warnings.length>0&&u.jsx("div",{className:"cotask-warning",children:m.warnings.map((re,we)=>u.jsxs("p",{children:[re.id?`${re.id}: `:"Common context: ","Context may exceed the injection limit. (estimated ",re.estimatedTokens," tokens)"]},we))}),v==="graph"&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"cotask-section-heading",children:[u.jsx("h2",{children:"Task graph"}),u.jsxs("span",{children:[m.nodes.filter(re=>re.status==="completed").length," / ",m.nodes.length," Completed"]})]}),!m.nodes.length&&u.jsx("p",{children:"No nodes yet. Discuss the plan with the initiating agent to define the graph."}),u.jsxs("details",{className:"cotask-context",onToggle:re=>{if(re.currentTarget.open&&ne===null){const we=pe.current;n(`${Y}/${f}`,{view:"definition"}).then(_e=>{pe.current===we&&L(_e.definition.commonContext)}).catch(_e=>{pe.current===we&&ce(String(_e))})}},children:[u.jsx("summary",{children:"Common context"}),u.jsx("p",{className:"cotask-prewrap",children:ne??"Loading…"})]},m.task.revision),m.nodes.length>0&&u.jsx(NA,{nodes:m.nodes,members:m.members,executions:m.executions,selectedId:A??void 0,onSelect:re=>void te(re)}),z&&u.jsxs("section",{className:"cotask-node-detail",children:[u.jsx("h3",{children:z.definition.name}),u.jsx("p",{className:"cotask-prewrap",children:z.definition.context}),u.jsx("h4",{children:"Reports"}),z.reports.length?z.reports.map(re=>u.jsxs("button",{onClick:()=>void O(re),children:[re.type," · ",re.summary]},re.id)):u.jsx("p",{children:"No reports yet."}),B.map(re=>u.jsxs("article",{children:[u.jsx("h4",{children:re.summary}),u.jsx("p",{className:"cotask-prewrap",children:re.content})]},re.id))]}),m.task.conclusion&&u.jsxs("section",{children:[u.jsx("h3",{children:"Conclusion"}),u.jsx("p",{className:"cotask-prewrap",children:m.task.conclusion})]})]}),v==="operations"&&u.jsxs(u.Fragment,{children:[u.jsx("h2",{children:"Activity"}),u.jsx("p",{children:"Changes are saved immediately and retained if a turn fails."}),Q.length?Q.map((re,we)=>u.jsxs("details",{className:"cotask-operation",children:[u.jsxs("summary",{children:[String(re.action)," · ",String(re.status)," · Turn ",String(re.turnStatus)]}),u.jsx("pre",{children:JSON.stringify(re,null,2)})]},we)):u.jsx("p",{children:"No activity yet."})]}),v==="settings"&&u.jsx(zA,{task:m.task,path:`${Y}/${f}/settings`,request:n,onSaved:re=>g({...m,task:re})},f),v==="member"&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"cotask-section-heading",children:[u.jsx("h2",{children:Ae==null?void 0:Ae.name}),u.jsx("span",{children:"CoTask member"})]}),u.jsxs("details",{className:"cotask-context",onToggle:re=>{if(re.currentTarget.open&&b&&(K==null?void 0:K.id)!==b){const we=b,_e=pe.current;n(`${Y}/${f}`,{memberIds:[we]}).then(He=>{var wt;pe.current===_e&&J.current===we&&ie({id:we,context:((wt=He.members[0])==null?void 0:wt.context)??""})}).catch(He=>{pe.current===_e&&J.current===we&&ce(String(He))})}},children:[u.jsx("summary",{children:"Member context"}),u.jsx("p",{className:"cotask-prewrap",children:(K==null?void 0:K.id)===b?K==null?void 0:K.context:"Loading…"})]},`${b}:${m.task.revision}`),ee!=null&&ee.workspaceId?l(ee.workspaceId):u.jsx("p",{children:m.executions.some(re=>re.memberId===b)?"This member instance was removed. Execution history is retained.":"This member will be created when its first node is driven."})]})]}):u.jsx("p",{children:"Loading task…"})})]})]})})}function zA({task:e,path:t,request:n,onSaved:a}){var M,B;const[l,o]=D.useState(e.runtimeSettings),[c,f]=D.useState(e.revision),[h,m]=D.useState([]),[g,v]=D.useState([]),[k,b]=D.useState(!1),[T,A]=D.useState("");D.useEffect(()=>{let U=!0;return Promise.all([n("settings/runtime/models?refresh=0"),n("settings/model-providers/options")]).then(([ne,L])=>{U&&(m(ne.models),v(L.channels))}).catch(ne=>{U&&A(String(ne))}),()=>{U=!1}},[n]);const q=h.find(U=>U.model===l.model||U.id===l.model),z=((M=q==null?void 0:q.supportedReasoningEfforts)==null?void 0:M.map(U=>U.reasoningEffort))??["none","minimal","low","medium","high","xhigh","max"];return u.jsxs("section",{className:"cotask-settings",children:[u.jsx("h2",{children:"Settings"}),u.jsx("p",{children:"Settings apply to the whole CoTask and take effect on each member’s next turn."}),u.jsxs("label",{children:["Model source",u.jsxs("select",{value:l.modelSource.type==="codex"?"codex":l.modelSource.channelId,onChange:U=>o({...l,modelSource:U.target.value==="codex"?{type:"codex"}:{type:"custom",channelId:U.target.value}}),children:[u.jsx("option",{value:"codex",children:"Codex"}),l.modelSource.type==="custom"&&!g.some(U=>U.id===l.modelSource.channelId)&&u.jsx("option",{value:l.modelSource.channelId,children:"Current channel unavailable"}),g.map(U=>u.jsx("option",{value:U.id,children:U.name},U.id))]})]}),l.modelSource.type==="codex"?u.jsxs(u.Fragment,{children:[u.jsxs("label",{children:["Model",u.jsxs("select",{value:l.model,onChange:U=>o({...l,model:U.target.value}),children:[u.jsx("option",{value:"",children:"Default model"}),l.model&&!h.some(U=>U.model===l.model)&&u.jsx("option",{children:l.model}),h.map(U=>u.jsx("option",{value:U.model,children:U.displayName},U.id))]})]}),u.jsxs("label",{children:["Reasoning effort",u.jsxs("select",{value:l.reasoningEffort,onChange:U=>o({...l,reasoningEffort:U.target.value}),children:[u.jsx("option",{value:"",children:"Default"}),l.reasoningEffort&&!z.includes(l.reasoningEffort)&&u.jsx("option",{children:l.reasoningEffort}),z.map(U=>u.jsx("option",{children:U},U))]})]})]}):u.jsxs("p",{children:["Channel model: ",((B=g.find(U=>U.id===l.modelSource.channelId))==null?void 0:B.model)??"Channel unavailable",". Codex reasoning effort does not apply to custom channels."]}),u.jsx("button",{disabled:k,onClick:async()=>{b(!0),A("");try{const U=await n(t,{expectedRevision:c,runtimeSettings:l},"PUT");f(U.task.revision),a(U.task),A("Saved. Changes take effect on the next turn.")}catch(U){A(`${String(U)}. If the task changed, reopen Settings before saving.`)}finally{b(!1)}},children:k?"Saving…":"Save settings"}),T&&u.jsx("p",{role:"status",children:T})]})}function DA(e,t=new Date){if(e==null||!Number.isInteger(e)||e<1||e>31)return null;const n=new Date(t.getTime()+480*60*1e3),a=n.getUTCFullYear(),l=n.getUTCMonth(),o=Date.UTC(a,l,n.getUTCDate()),c=h=>Date.UTC(a,l+h,Math.min(e,new Date(Date.UTC(a,l+h+1,0)).getUTCDate()));let f=c(0);return f<o&&(f=c(1)),{date:new Date(f).toISOString().slice(0,10),days:(f-o)/864e5}}function RA({content:e,streaming:t}){const[n,a]=D.useState(!1),l=D.useId();return u.jsxs("section",{className:`message reasoning${t?" is-streaming":""}${n?" is-expanded":""}`,children:[u.jsxs("button",{className:"reasoning-toggle",type:"button","aria-expanded":n,"aria-controls":l,onClick:()=>a(o=>!o),children:[u.jsx("span",{className:"reasoning-indicator","aria-hidden":"true"}),u.jsx("span",{children:t?"思考中":"思考过程"}),u.jsx("span",{className:"reasoning-action",children:n?"收起":"展开"}),u.jsx("svg",{className:"reasoning-chevron",width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",children:u.jsx("path",{d:"m4 2 4 4-4 4",fill:"none",stroke:"currentColor",strokeWidth:"1.4"})})]}),u.jsx("div",{id:l,hidden:!n&&!t,className:`reasoning-content${n?"":" reasoning-preview"}`,children:u.jsx("div",{className:"message-body",children:n?e:e.slice(-600)})})]})}function OA(e,t){if(!t||typeof t!="object")return null;const{method:n,params:a}=t;if(!a)return null;if(n==="item/completed"){const m=a.item;if((m==null?void 0:m.type)!=="reasoning"||typeof m.id!="string")return null;const g=e.get(m.id)??{itemId:m.id,text:new Map,summary:new Map,completed:!1};for(const v of["text","summary"]){const k=m[v];Array.isArray(k)&&k.forEach((b,T)=>{typeof b=="string"&&b&&g[v].set(T,b)})}return g.completed=!0,e.set(m.id,g),g}const l=/^item\/reasoning\/(text|summaryText)(Delta|Snapshot)$/.exec(n??"");if(!l||typeof a.itemId!="string")return null;const o=l[1]==="text"?"text":"summary",c=a[o==="text"?"contentIndex":"summaryIndex"],f=a[l[2]==="Delta"?"delta":"text"];if(typeof c!="number"||!Number.isSafeInteger(c)||c<0||typeof f!="string")return null;const h=e.get(a.itemId)??{itemId:a.itemId,text:new Map,summary:new Map,completed:!1};return h[o].set(c,l[2]==="Snapshot"?f:(h[o].get(c)??"")+f),e.set(a.itemId,h),h}function IA(e){return[...e.text.size?e.text:e.summary].sort(([n],[a])=>n-a).map(([,n])=>n).join(`
|
|
347
347
|
|
|
348
|
-
`)}function _A({id:e,baseUrl:t,query:n}){var g;const[a,l]=D.useState(null),[o,c]=D.useState(!1),[f,h]=D.useState(!1),m=async()=>{c(!0),h(!1);try{const v=await n(e);v.status==="ok"||v.status==="unsupported"?l(v):(h(!0),l(k=>(k==null?void 0:k.status)==="ok"?k:v))}catch{h(!0)}finally{c(!1)}};return D.useEffect(()=>{let v=!1;return c(!0),n(e).then(k=>{v||l(k)}).catch(()=>{v||h(!0)}).finally(()=>{v||c(!1)}),()=>{v=!0}},[e,n]),u.jsxs("div",{className:"channel-balance-inline",children:[u.jsx("span",{className:"channel-balance-total",title:"Available balance",children:(a==null?void 0:a.status)==="ok"&&a.balance?a.balance.balance_infos.map(v=>`${v.currency} ${v.total_balance}`).join(" / "):o?"Checking…":(a==null?void 0:a.status)==="unsupported"?"Balance —":"Balance unavailable"}),f?u.jsx("span",{className:"channel-balance-warning",title:"Refresh failed; the displayed amount may be stale",role:"status",children:"Stale"}):null,a!=null&&a.balance&&!a.balance.is_available?u.jsx("span",{className:"channel-balance-warning",children:"Insufficient"}):null,u.jsx("button",{type:"button","aria-label":"Refresh balance",title:"Refresh balance",disabled:o,onClick:()=>void m(),children:"↻"}),u.jsxs("details",{className:"channel-balance-details",children:[u.jsx("summary",{children:"Details"}),u.jsxs("div",{children:[u.jsxs("p",{className:"channel-endpoint",children:[t," · Responses API"]}),(g=a==null?void 0:a.balance)==null?void 0:g.balance_infos.map(v=>u.jsxs("p",{children:[v.currency," · Granted ",v.granted_balance," · Topped up ",v.topped_up_balance]},v.currency)),a?u.jsxs("small",{children:["Checked ",new Date(a.checkedAt).toLocaleString()]}):null,f?u.jsx("small",{children:"Refresh failed. Any amount shown is the last successful result."}):null,(a==null?void 0:a.status)==="unsupported"?u.jsx("small",{children:"This channel does not support balance queries."}):null,u.jsx("small",{children:"Uses saved credentials; unsaved edits are not queried."})]})]})]})}function K6(e,t){const n=e??{type:"codex"},a=t??{type:"codex"};return n.type===a.type&&(n.type!=="custom"||a.type==="custom"&&n.channelId===a.channelId)}function LA({load:e,save:t,queryBalance:n}){const[a,l]=D.useState(null),[o,c]=D.useState([]),[f,h]=D.useState(!1),[m,g]=D.useState(""),[v,k]=D.useState(!1),[b,T]=D.useState(null),A=JSON.stringify(o)!==JSON.stringify((a==null?void 0:a.channels.map(M=>({channel:M})))??[]);D.useEffect(()=>{let M=!1;return e().then(B=>{M||(l(B),c(B.channels.map(U=>({channel:U}))))}).catch(()=>{M||g("Unable to load channels. Reopen this panel to retry.")}),()=>{M=!0}},[e]);const q=(M,B)=>{k(!1),c(U=>U.map((ae,L)=>L===M?{...ae,channel:{...ae.channel,...B}}:ae))},z=async M=>{if(M.preventDefault(),!(!a||f)){h(!0),g(""),k(!1);try{const B=await t({expectedRevision:a.revision,channels:o.map(U=>({channel:U.channel,...U.apiKey?{apiKey:U.apiKey}:{}}))});l(B),c(B.channels.map(U=>({channel:U}))),k(!0),T(null)}catch{g("Channels were not saved. Check the fields. If another administrator changed them, reopen this panel to load the latest version.")}finally{h(!1)}}};return u.jsxs("section",{children:[u.jsx("header",{className:"settings-section-header",children:u.jsxs("div",{children:[u.jsx("h3",{children:"Custom model channels"}),u.jsx("p",{children:"Select a configured channel in Runtime."})]})}),u.jsxs("form",{className:"settings-form",onSubmit:M=>void z(M),children:[!a&&!m?u.jsx("p",{children:"Loading channels…"}):null,u.jsxs("div",{className:"settings-field-wide channel-summary-list",children:[o.map(M=>u.jsxs("article",{className:"channel-summary-card",children:[u.jsxs("div",{className:"channel-summary-identity",children:[u.jsx("h4",{children:M.channel.name||"New channel"}),u.jsx("p",{children:M.channel.model||"Model not configured"})]}),n&&(a!=null&&a.channels.some(B=>B.id===M.channel.id))?u.jsx(_A,{id:M.channel.id,baseUrl:a.channels.find(B=>B.id===M.channel.id).baseUrl,query:n},`${M.channel.id}:${a.revision}`):u.jsx("small",{children:"Not saved"}),u.jsx("button",{type:"button",disabled:f||b!==null&&b!==M.channel.id,onClick:()=>{T(M.channel.id),k(!1)},children:"Edit channel"})]},M.channel.id)),a&&o.length===0?u.jsx("p",{children:"No custom channels yet. Add a channel to get started."}):null]}),o.map((M,B)=>b===M.channel.id?u.jsxs("fieldset",{disabled:f,className:"settings-field-wide model-channel-card",children:[u.jsx("legend",{children:a!=null&&a.channels.some(U=>U.id===M.channel.id)?"Edit channel":"Add channel"}),u.jsxs("label",{className:"settings-field",children:[u.jsx("span",{children:"Name"}),u.jsx("input",{"aria-label":`Channel ${B+1} name`,required:!0,maxLength:128,value:M.channel.name,onChange:U=>q(B,{name:U.target.value})})]}),u.jsxs("label",{className:"settings-field",children:[u.jsx("span",{children:"Type"}),u.jsx("select",{"aria-label":`Channel ${B+1} type`,value:M.channel.kind,onChange:()=>{},children:u.jsx("option",{value:"responses",children:"Responses API"})})]}),u.jsxs("label",{className:"settings-field",children:[u.jsx("span",{children:"Base URL"}),u.jsx("input",{"aria-label":`Channel ${B+1} URL`,type:"url",required:!0,placeholder:"https://api.example.com/v1",value:M.channel.baseUrl,onChange:U=>q(B,{baseUrl:U.target.value})})]}),u.jsxs("label",{className:"settings-field",children:[u.jsx("span",{children:"Model ID"}),u.jsx("input",{"aria-label":`Channel ${B+1} model`,required:!0,maxLength:256,placeholder:"Model ID from your service",value:M.channel.model,onChange:U=>q(B,{model:U.target.value})})]}),u.jsxs("label",{className:"settings-field",children:[u.jsx("span",{children:"API key"}),u.jsx("input",{"aria-label":`Channel ${B+1} API key`,type:"password",autoComplete:"new-password",required:!(a!=null&&a.channels.some(U=>U.id===M.channel.id)),value:M.apiKey??"",placeholder:a!=null&&a.channels.some(U=>U.id===M.channel.id)?"Configured · leave blank to keep":"Enter API key",onChange:U=>{const ae=U.target.value;k(!1),c(L=>L.map((K,ie)=>ie===B?{...K,apiKey:ae}:K))}})]}),u.jsx("button",{type:"button",onClick:()=>{c(U=>U.filter((ae,L)=>L!==B)),k(!1),T(null)},children:"Remove channel on save"}),u.jsx("small",{children:"Changes take effect only after Save channels. Leave the API key blank to keep the saved key."})]},M.channel.id):null),m?u.jsx("p",{role:"alert",children:m}):null,v?u.jsx("p",{role:"status",children:"Channels saved. New executions use the updated configuration."}):null,u.jsxs("div",{className:"settings-form-actions",children:[u.jsx("button",{type:"button",disabled:!a||f||b!==null||o.length>=100,onClick:()=>{const M=crypto.randomUUID().replaceAll("-","");T(M),k(!1),c(B=>[...B,{channel:{id:M,name:"",kind:"responses",baseUrl:"",model:""}}])},children:"Add channel"}),b||JSON.stringify(o)!==JSON.stringify(a==null?void 0:a.channels.map(M=>({channel:M})))?u.jsx("button",{type:"button",disabled:f,onClick:()=>{c((a==null?void 0:a.channels.map(M=>({channel:M})))??[]),T(null),g("")},children:"Discard changes"}):null,b||A?u.jsx("button",{type:"submit",disabled:!a||f,children:f?"Saving…":"Save channels"}):null]})]})]})}function BA(e){const t=new Map;for(const n of e){if(!n.turnId)continue;if(n.event==="server.wakeup.started"){t.set(n.turnId,"wakeup");continue}if(n.event!=="server.turn")continue;const a=UA(n.data);t.set(n.turnId,typeof a.source=="string"?a.source:"web")}return t}function Bc(e,t){return!!(t&&e.includes(t))}function qA(e){var n;if((e==null?void 0:e.status)!=="failed")return null;const t=(n=e.error)==null?void 0:n.trim();return t?{turnId:e.id,content:t,createdAt:e.finishedAt??e.startedAt}:null}function UA(e){return e&&typeof e=="object"?e:{}}const HA=["summary","message","status","instruction","description","reason","error","text"],I3=96,$A=new Set(["codex.dynamic_tool_request","codex.process_exited","codex.protocol_error"]),FA=new Set(["server.item.snapshot","server.status","runtime.worker_stderr","codex.dynamic_tool_request"]),PA=new Set(["agentMessage","commandExecution","contextCompaction","fileChange","mcpToolCall","reasoning","userMessage","webSearch"]),X6=new Set(["item/commandExecution/terminalInteraction"]),GA=new Map([["server.wakeup.retry_scheduled","Wakeup retry scheduled"],["runtime.worker_exit","Runtime worker exited"]]);function VA(e){if(e.event!=="codex.notification")return!1;const t=Ja(e.data);return typeof t.method=="string"&&X6.has(t.method)}function YA(e){if(FA.has(e.event))return null;if(e.event.startsWith("server.")||e.event.startsWith("runtime.")||$A.has(e.event))return e.event;if(e.event!=="codex.notification")return null;const t=Ja(e.data),n=typeof t.method=="string"?t.method:"",a=Ja(t.params),l=Ja(a.item),o=typeof l.type=="string"?l.type:"";return!n.startsWith("item/")||X6.has(n)||/(?:\/delta|Delta)$/.test(n)||PA.has(o)?null:n}function Z6(e,t){const n=t.replace(/^input:/,""),a=(e==null?void 0:e.trim())??"";return!a||a===t||a===n?GA.get(n)??Q6(n):a}function Ds(e,t=[]){const n=Ja(e),l=[...t,...HA.map(o=>qc(n[o]))].map(o=>(o==null?void 0:o.replace(/\s+/g," ").trim())??"").find(Boolean);return l?l.length<=I3?l:`${l.slice(0,I3-3)}...`:"查看详情"}function Kp(e,t=new Map){const n=Ja(e),a=typeof n.unreadCount=="number"&&n.unreadCount>0?Math.floor(n.unreadCount):0,o=(Array.isArray(n.senderWorkspaceIds)?Array.from(new Set(n.senderWorkspaceIds.filter(h=>typeof h=="string").map(h=>h.trim()).filter(Boolean))):[]).map(h=>t.get(h)??h),c="Messages",f=[a>0?String(a):"",o.length>0?`from ${o.join(", ")}`:""].filter(Boolean).join(" ");return{title:c,detail:Ds({},[f])}}function WA(e){const t=Ja(e),n=Array.isArray(t.offers)?t.offers.map(Ja).filter(o=>Object.keys(o).length>0):[],a=n.map(o=>{var c;return(c=qc(o.previewText))==null?void 0:c.trim()}).filter(o=>!!o),l=n.length;return{title:l===1?"New input available":`${l} new inputs available`,detail:Ds({},a.slice(0,2)),meta:l===1?"preview":`${l} previews`}}function KA(e){const t=Ja(e),n=qc(t.actionType)??"",a=Ja(t.payload);return n==="seele_wakeup"||n==="seele_workspace_schedule_wakeup"?{title:(qc(a.action)??"schedule")==="cancel"?"Wakeup cancellation requested":"Wakeup requested",detail:Ds(a,[qc(a.instruction)]),meta:"after turn"}:{title:"Action requested",detail:Ds(a,[Q6(n||"agent action")]),meta:"after turn"}}function Q6(e){const n=(e.split(/[./]/).filter(Boolean).pop()??e).replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim();return n?n.charAt(0).toUpperCase()+n.slice(1):"System event"}function qc(e){if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e)}function Ja(e){return e&&typeof e=="object"?e:{}}function Xp(e){const t=Zp(e);return(Array.isArray(t.changes)?t.changes:[]).flatMap(a=>{const l=Zp(a);if(typeof l.path!="string"||!l.path.trim())return[];const o=JA(l.kind),c=typeof l.diff=="string"?l.diff:"",f=QA(c,o);return[{path:l.path,kind:o,additions:f.additions,deletions:f.deletions}]})}function J6(e,t){const n=L3(e),a=L3(t??"").replace(/\/+$/,"");return a&&(n===a||n.startsWith(`${a}/`))?n.slice(a.length+1)||".":n}function XA(e,t){if(e.length===0)return"File changed";const n=J6(e[0].path,t);return e.length===1?n:`${n} +${e.length-1}`}function ZA(e){return e.reduce((t,n)=>({additions:t.additions+n.additions,deletions:t.deletions+n.deletions}),{additions:0,deletions:0})}function QA(e,t){if(!e)return{additions:0,deletions:0};if(t==="add")return{additions:_3(e),deletions:0};if(t==="delete")return{additions:0,deletions:_3(e)};let n=0,a=0;for(const l of e.split(`
|
|
348
|
+
`)}function _A({id:e,baseUrl:t,query:n}){var g;const[a,l]=D.useState(null),[o,c]=D.useState(!1),[f,h]=D.useState(!1),m=async()=>{c(!0),h(!1);try{const v=await n(e);v.status==="ok"||v.status==="unsupported"?l(v):(h(!0),l(k=>(k==null?void 0:k.status)==="ok"?k:v))}catch{h(!0)}finally{c(!1)}};return D.useEffect(()=>{let v=!1;return c(!0),n(e).then(k=>{v||l(k)}).catch(()=>{v||h(!0)}).finally(()=>{v||c(!1)}),()=>{v=!0}},[e,n]),u.jsxs("div",{className:"channel-balance-inline",children:[u.jsx("span",{className:"channel-balance-total",title:"Available balance",children:(a==null?void 0:a.status)==="ok"&&a.balance?a.balance.balance_infos.map(v=>`${v.currency} ${v.total_balance}`).join(" / "):o?"Checking…":(a==null?void 0:a.status)==="unsupported"?"Balance —":"Balance unavailable"}),f?u.jsx("span",{className:"channel-balance-warning",title:"Refresh failed; the displayed amount may be stale",role:"status",children:"Stale"}):null,a!=null&&a.balance&&!a.balance.is_available?u.jsx("span",{className:"channel-balance-warning",children:"Insufficient"}):null,u.jsx("button",{type:"button","aria-label":"Refresh balance",title:"Refresh balance",disabled:o,onClick:()=>void m(),children:"↻"}),u.jsxs("details",{className:"channel-balance-details",children:[u.jsx("summary",{children:"Details"}),u.jsxs("div",{children:[u.jsxs("p",{className:"channel-endpoint",children:[t," · Responses API"]}),(g=a==null?void 0:a.balance)==null?void 0:g.balance_infos.map(v=>u.jsxs("p",{children:[v.currency," · Granted ",v.granted_balance," · Topped up ",v.topped_up_balance]},v.currency)),a?u.jsxs("small",{children:["Checked ",new Date(a.checkedAt).toLocaleString()]}):null,f?u.jsx("small",{children:"Refresh failed. Any amount shown is the last successful result."}):null,(a==null?void 0:a.status)==="unsupported"?u.jsx("small",{children:"This channel does not support balance queries."}):null,u.jsx("small",{children:"Uses saved credentials; unsaved edits are not queried."})]})]})]})}function K6(e,t){const n=e??{type:"codex"},a=t??{type:"codex"};return n.type===a.type&&(n.type!=="custom"||a.type==="custom"&&n.channelId===a.channelId)}function LA({load:e,save:t,queryBalance:n}){const[a,l]=D.useState(null),[o,c]=D.useState([]),[f,h]=D.useState(!1),[m,g]=D.useState(""),[v,k]=D.useState(!1),[b,T]=D.useState(null),A=JSON.stringify(o)!==JSON.stringify((a==null?void 0:a.channels.map(M=>({channel:M})))??[]);D.useEffect(()=>{let M=!1;return e().then(B=>{M||(l(B),c(B.channels.map(U=>({channel:U}))))}).catch(()=>{M||g("Unable to load channels. Reopen this panel to retry.")}),()=>{M=!0}},[e]);const q=(M,B)=>{k(!1),c(U=>U.map((ne,L)=>L===M?{...ne,channel:{...ne.channel,...B}}:ne))},z=async M=>{if(M.preventDefault(),!(!a||f)){h(!0),g(""),k(!1);try{const B=await t({expectedRevision:a.revision,channels:o.map(U=>({channel:U.channel,...U.apiKey?{apiKey:U.apiKey}:{}}))});l(B),c(B.channels.map(U=>({channel:U}))),k(!0),T(null)}catch{g("Channels were not saved. Check the fields. If another administrator changed them, reopen this panel to load the latest version.")}finally{h(!1)}}};return u.jsxs("section",{children:[u.jsx("header",{className:"settings-section-header",children:u.jsxs("div",{children:[u.jsx("h3",{children:"Custom model channels"}),u.jsx("p",{children:"Select a configured channel in Runtime."})]})}),u.jsxs("form",{className:"settings-form",onSubmit:M=>void z(M),children:[!a&&!m?u.jsx("p",{children:"Loading channels…"}):null,u.jsxs("div",{className:"settings-field-wide channel-summary-list",children:[o.map(M=>u.jsxs("article",{className:"channel-summary-card",children:[u.jsxs("div",{className:"channel-summary-identity",children:[u.jsx("h4",{children:M.channel.name||"New channel"}),u.jsx("p",{children:M.channel.model||"Model not configured"})]}),n&&(a!=null&&a.channels.some(B=>B.id===M.channel.id))?u.jsx(_A,{id:M.channel.id,baseUrl:a.channels.find(B=>B.id===M.channel.id).baseUrl,query:n},`${M.channel.id}:${a.revision}`):u.jsx("small",{children:"Not saved"}),u.jsx("button",{type:"button",disabled:f||b!==null&&b!==M.channel.id,onClick:()=>{T(M.channel.id),k(!1)},children:"Edit channel"})]},M.channel.id)),a&&o.length===0?u.jsx("p",{children:"No custom channels yet. Add a channel to get started."}):null]}),o.map((M,B)=>b===M.channel.id?u.jsxs("fieldset",{disabled:f,className:"settings-field-wide model-channel-card",children:[u.jsx("legend",{children:a!=null&&a.channels.some(U=>U.id===M.channel.id)?"Edit channel":"Add channel"}),u.jsxs("label",{className:"settings-field",children:[u.jsx("span",{children:"Name"}),u.jsx("input",{"aria-label":`Channel ${B+1} name`,required:!0,maxLength:128,value:M.channel.name,onChange:U=>q(B,{name:U.target.value})})]}),u.jsxs("label",{className:"settings-field",children:[u.jsx("span",{children:"Type"}),u.jsx("select",{"aria-label":`Channel ${B+1} type`,value:M.channel.kind,onChange:()=>{},children:u.jsx("option",{value:"responses",children:"Responses API"})})]}),u.jsxs("label",{className:"settings-field",children:[u.jsx("span",{children:"Base URL"}),u.jsx("input",{"aria-label":`Channel ${B+1} URL`,type:"url",required:!0,placeholder:"https://api.example.com/v1",value:M.channel.baseUrl,onChange:U=>q(B,{baseUrl:U.target.value})})]}),u.jsxs("label",{className:"settings-field",children:[u.jsx("span",{children:"Model ID"}),u.jsx("input",{"aria-label":`Channel ${B+1} model`,required:!0,maxLength:256,placeholder:"Model ID from your service",value:M.channel.model,onChange:U=>q(B,{model:U.target.value})})]}),u.jsxs("label",{className:"settings-field",children:[u.jsx("span",{children:"API key"}),u.jsx("input",{"aria-label":`Channel ${B+1} API key`,type:"password",autoComplete:"new-password",required:!(a!=null&&a.channels.some(U=>U.id===M.channel.id)),value:M.apiKey??"",placeholder:a!=null&&a.channels.some(U=>U.id===M.channel.id)?"Configured · leave blank to keep":"Enter API key",onChange:U=>{const ne=U.target.value;k(!1),c(L=>L.map((K,ie)=>ie===B?{...K,apiKey:ne}:K))}})]}),u.jsx("button",{type:"button",onClick:()=>{c(U=>U.filter((ne,L)=>L!==B)),k(!1),T(null)},children:"Remove channel on save"}),u.jsx("small",{children:"Changes take effect only after Save channels. Leave the API key blank to keep the saved key."})]},M.channel.id):null),m?u.jsx("p",{role:"alert",children:m}):null,v?u.jsx("p",{role:"status",children:"Channels saved. New executions use the updated configuration."}):null,u.jsxs("div",{className:"settings-form-actions",children:[u.jsx("button",{type:"button",disabled:!a||f||b!==null||o.length>=100,onClick:()=>{const M=crypto.randomUUID().replaceAll("-","");T(M),k(!1),c(B=>[...B,{channel:{id:M,name:"",kind:"responses",baseUrl:"",model:""}}])},children:"Add channel"}),b||JSON.stringify(o)!==JSON.stringify(a==null?void 0:a.channels.map(M=>({channel:M})))?u.jsx("button",{type:"button",disabled:f,onClick:()=>{c((a==null?void 0:a.channels.map(M=>({channel:M})))??[]),T(null),g("")},children:"Discard changes"}):null,b||A?u.jsx("button",{type:"submit",disabled:!a||f,children:f?"Saving…":"Save channels"}):null]})]})]})}function BA(e){const t=new Map;for(const n of e){if(!n.turnId)continue;if(n.event==="server.wakeup.started"){t.set(n.turnId,"wakeup");continue}if(n.event!=="server.turn")continue;const a=UA(n.data);t.set(n.turnId,typeof a.source=="string"?a.source:"web")}return t}function Bc(e,t){return!!(t&&e.includes(t))}function qA(e){var n;if((e==null?void 0:e.status)!=="failed")return null;const t=(n=e.error)==null?void 0:n.trim();return t?{turnId:e.id,content:t,createdAt:e.finishedAt??e.startedAt}:null}function UA(e){return e&&typeof e=="object"?e:{}}const HA=["summary","message","status","instruction","description","reason","error","text"],I3=96,$A=new Set(["codex.dynamic_tool_request","codex.process_exited","codex.protocol_error"]),FA=new Set(["server.item.snapshot","server.status","runtime.worker_stderr","codex.dynamic_tool_request"]),PA=new Set(["agentMessage","commandExecution","contextCompaction","fileChange","mcpToolCall","reasoning","userMessage","webSearch"]),X6=new Set(["item/commandExecution/terminalInteraction"]),GA=new Map([["server.wakeup.retry_scheduled","Wakeup retry scheduled"],["runtime.worker_exit","Runtime worker exited"]]);function VA(e){if(e.event!=="codex.notification")return!1;const t=Ja(e.data);return typeof t.method=="string"&&X6.has(t.method)}function YA(e){if(FA.has(e.event))return null;if(e.event.startsWith("server.")||e.event.startsWith("runtime.")||$A.has(e.event))return e.event;if(e.event!=="codex.notification")return null;const t=Ja(e.data),n=typeof t.method=="string"?t.method:"",a=Ja(t.params),l=Ja(a.item),o=typeof l.type=="string"?l.type:"";return!n.startsWith("item/")||X6.has(n)||/(?:\/delta|Delta)$/.test(n)||PA.has(o)?null:n}function Z6(e,t){const n=t.replace(/^input:/,""),a=(e==null?void 0:e.trim())??"";return!a||a===t||a===n?GA.get(n)??Q6(n):a}function Ds(e,t=[]){const n=Ja(e),l=[...t,...HA.map(o=>qc(n[o]))].map(o=>(o==null?void 0:o.replace(/\s+/g," ").trim())??"").find(Boolean);return l?l.length<=I3?l:`${l.slice(0,I3-3)}...`:"查看详情"}function Kp(e,t=new Map){const n=Ja(e),a=typeof n.unreadCount=="number"&&n.unreadCount>0?Math.floor(n.unreadCount):0,o=(Array.isArray(n.senderWorkspaceIds)?Array.from(new Set(n.senderWorkspaceIds.filter(h=>typeof h=="string").map(h=>h.trim()).filter(Boolean))):[]).map(h=>t.get(h)??h),c="Messages",f=[a>0?String(a):"",o.length>0?`from ${o.join(", ")}`:""].filter(Boolean).join(" ");return{title:c,detail:Ds({},[f])}}function WA(e){const t=Ja(e),n=Array.isArray(t.offers)?t.offers.map(Ja).filter(o=>Object.keys(o).length>0):[],a=n.map(o=>{var c;return(c=qc(o.previewText))==null?void 0:c.trim()}).filter(o=>!!o),l=n.length;return{title:l===1?"New input available":`${l} new inputs available`,detail:Ds({},a.slice(0,2)),meta:l===1?"preview":`${l} previews`}}function KA(e){const t=Ja(e),n=qc(t.actionType)??"",a=Ja(t.payload);return n==="seele_wakeup"||n==="seele_workspace_schedule_wakeup"?{title:(qc(a.action)??"schedule")==="cancel"?"Wakeup cancellation requested":"Wakeup requested",detail:Ds(a,[qc(a.instruction)]),meta:"after turn"}:{title:"Action requested",detail:Ds(a,[Q6(n||"agent action")]),meta:"after turn"}}function Q6(e){const n=(e.split(/[./]/).filter(Boolean).pop()??e).replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim();return n?n.charAt(0).toUpperCase()+n.slice(1):"System event"}function qc(e){if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e)}function Ja(e){return e&&typeof e=="object"?e:{}}function Xp(e){const t=Zp(e);return(Array.isArray(t.changes)?t.changes:[]).flatMap(a=>{const l=Zp(a);if(typeof l.path!="string"||!l.path.trim())return[];const o=JA(l.kind),c=typeof l.diff=="string"?l.diff:"",f=QA(c,o);return[{path:l.path,kind:o,additions:f.additions,deletions:f.deletions}]})}function J6(e,t){const n=L3(e),a=L3(t??"").replace(/\/+$/,"");return a&&(n===a||n.startsWith(`${a}/`))?n.slice(a.length+1)||".":n}function XA(e,t){if(e.length===0)return"File changed";const n=J6(e[0].path,t);return e.length===1?n:`${n} +${e.length-1}`}function ZA(e){return e.reduce((t,n)=>({additions:t.additions+n.additions,deletions:t.deletions+n.deletions}),{additions:0,deletions:0})}function QA(e,t){if(!e)return{additions:0,deletions:0};if(t==="add")return{additions:_3(e),deletions:0};if(t==="delete")return{additions:0,deletions:_3(e)};let n=0,a=0;for(const l of e.split(`
|
|
349
349
|
`))l.startsWith("+")&&!l.startsWith("+++")?n+=1:l.startsWith("-")&&!l.startsWith("---")&&(a+=1);return{additions:n,deletions:a}}function _3(e){const t=e.split(`
|
|
350
350
|
`).length;return e.endsWith(`
|
|
351
351
|
`)?Math.max(0,t-1):t}function JA(e){const t=Zp(e);return t.type==="add"?"add":t.type==="delete"?"delete":t.type==="move"||typeof t.move_path=="string"?"move":"update"}function L3(e){return e.replace(/\\/g,"/").replace(/\/+/g,"/")}function Zp(e){return e&&typeof e=="object"?e:{}}const eE=["low","medium","high","xhigh"];function As(e){const t=e.trim();return t?{minimal:"Minimal",none:"None",low:"Low",medium:"Medium",high:"High",xhigh:"Extra high",max:"Max",ultra:"Ultra"}[t]??t:"Use model default"}function B3(e,t){const n=Wc(e),a=Wc(t==null?void 0:t.defaultReasoningEffort);return n?n===a?`${As(n)} (model default)`:As(n):a?`Not configured (model default: ${As(a)})`:"Not configured (model default applies)"}function tE(e,t=""){const n=Wc(e==null?void 0:e.defaultReasoningEffort),a=[];if(t||a.push({value:"",label:"Not configured (model default applies)"}),!e){const c=t;return c&&a.push({value:c,label:`${As(c)} (configured)`}),a}const o=(ex(e)??eE).filter(c=>!Qp(c));n&&!Qp(n)&&!o.includes(n)&&o.unshift(n);for(const c of o)a.push({value:c,label:c===n?`${As(c)} (model default)`:As(c)});return t&&!a.some(c=>c.value===t)&&a.push({value:t,label:`${As(t)} (configured)`}),a}function nE(e,t){const n=Wc(e);if(!n)return null;if(Qp(n))return"The configured reasoning effort is not supported. Choose a supported value explicitly.";if(!t)return null;const a=ex(t);return a!==null?a.includes(n)?null:"The selected model does not support the configured reasoning effort. Your value has been preserved; choose a supported value before saving.":null}function rE(e,t,n){return n||e!==t?e:null}function ex(e){if(!Array.isArray(e==null?void 0:e.supportedReasoningEfforts))return null;const t=[];for(const n of e.supportedReasoningEfforts){const a=Wc(n==null?void 0:n.reasoningEffort);a&&!t.includes(a)&&t.push(a)}return t}function Wc(e){return typeof e=="string"?e.trim():""}function Qp(e){return e.toLowerCase()==="ultra"}function aE(e,t){return{textareaDisabled:!1,sendDisabled:t||!e.trim()}}function iE(e,t){return e.hasConversation?e.messageSubmitting?"blocked":e.hasActiveTurn||e.hasConfirmedCurrentTurn?t?"queue-turn":"steer-turn":"start-turn":"create-workspace"}function lE(e){return e.key!=="Enter"||!e.metaKey&&!e.ctrlKey||e.isComposing?null:{forceNewTurn:e.shiftKey}}function q3(e,t){return e.conversationId===t.conversationId&&e.version===t.version}function sE(e){return e.status!=="authorized"||!e.configurationReady}function oE(e,t,n){return e===401&&!n&&t==="authentication_required"?"reauthenticate":"ignore"}function ap(e,t){if(!e)return t;const n={...e.accountDetails};for(const a of e.accounts)Object.hasOwn(t.accountDetails,a.id)&&(n[a.id]=t.accountDetails[a.id]);return{...e,accountDetails:n}}const U3=15e3,H3=[1e3,2e3,5e3,1e4,15e3];function uE(e){return!e.workspaceRunning||e.streamLeaseActive||e.controllerActive?{kind:"none"}:e.currentTurnAbsent?e.retryAt!==null&&e.now>=e.retryAt?{kind:"probe",waitMs:U3}:{kind:"none"}:{kind:"probe",waitMs:U3}}function cE(e){const t=Math.min(Math.max(1,Math.floor(e))-1,H3.length-1);return H3[t]}function dE(e){const t=$3(e),n=$3(t.conversation),a=t.workspaceStatus??t.status??n.status;return a==="idle"||a==="error"||a==="done"||a==="initialization_failed"?a:"done"}function $3(e){return e&&typeof e=="object"?e:{}}function fE(e,t,n){return n?"running":e==="running"||e==="error"?e:t==="scheduled"?"waiting":e}function Vr(e,t){if(!e.deploymentId||!e.userId||!t)throw new Error("Browser storage requires deployment, user, and preference identities.");return["seele","v1",encodeURIComponent(e.deploymentId),encodeURIComponent(e.userId),encodeURIComponent(t)].join(":")}function P1(e,t){const n=[],a=new Set;for(const l of[...e,...t])a.has(l)||(a.add(l),n.push(l));return n}function F3(e,t,n){return P1([t,...e.filter(a=>a!==t)],n)}function hE(e,t){return e.filter(n=>n!==t)}function mE(e,t){const n=e.code==="ArrowUp"?-1:e.code==="ArrowDown"?1:null;return n!==null&&e.metaKey&&e.shiftKey&&e.leftShiftPressed&&!e.ctrlKey&&!e.altKey?{type:"move",direction:n}:t?e.key==="Escape"?{type:"cancel"}:e.code==="Space"&&!e.repeat?{type:"confirm"}:null:null}function Ts(e){return`${e.kind}:${e.id}`}function pE(e,t){return e.flatMap(n=>[{kind:"group",id:n.id},...t.has(n.id)?[]:n.conversations.map(a=>({kind:"workspace",id:a.id}))])}function gE(e,t,n,a){if(e.length===0)return null;const l=t?Ts(t):null;let o=l?e.findIndex(c=>Ts(c)===l):-1;return o<0&&n&&(o=e.findIndex(c=>c.kind==="workspace"&&c.id===n)),o<0?a>0?e[0]:e[e.length-1]:e[(o+a+e.length)%e.length]}function yE(e,t){return t??e}function vE(e,t){return e==="saved"||t==="accept"?"saved":"declined"}const xE=/^[a-z][a-z\d+.-]*:/i,bE=/^L([1-9]\d*)(?:C([1-9]\d*))?$/i;function tx(e){if(!e.startsWith("seele-public:/"))return null;const t=e.slice(13);return t.startsWith("//")||t.includes("\\")?null:t}function wE(e,t){const n=e.trim();if(!n||n.startsWith("#")||n.startsWith("?")||n.startsWith("/api/")||xE.test(n))return null;const a=n.indexOf("#"),l=a>=0?n.slice(0,a):n,o=a>=0?n.slice(a+1):"",c=l.indexOf("?"),f=c>=0?l.slice(0,c):l;let h;try{h=decodeURIComponent(f)}catch{return null}const m=kE(h);if(!m)return null;const g=o.match(bE);return{path:nx(m,t),...g?{line:Number(g[1])}:{},...g!=null&&g[2]?{column:Number(g[2])}:{}}}function nx(e,t){const n=e.replace(/\\/g,"/"),a=t.replace(/\\/g,"/").replace(/\/+$/,"");return n===a||!n.startsWith(`${a}/`)?n:n.slice(a.length+1)}function kE(e){const t=e.trim().replace(/^`+|`+$/g,"").replace(/^\.\//,"");return t||null}function P3(){const e=D.useRef(null),t=()=>{e.current&&(clearTimeout(e.current.timer),delete e.current.element.dataset.touchDrag),e.current=null};return D.useEffect(()=>{const n=o=>{e.current&&o.preventDefault()},a=o=>{o.touches.length!==1&&t()},l=o=>{const c=e.current;if(!c)return;if(o.touches.length!==1){t();return}if(c.armed){o.preventDefault();return}const f=o.touches[0];Math.hypot(f.clientX-c.x,f.clientY-c.y)>8&&t()};return document.addEventListener("touchmove",l,{passive:!1}),document.addEventListener("touchstart",a,{passive:!0}),document.addEventListener("contextmenu",n),document.addEventListener("touchend",t),document.addEventListener("touchcancel",t),()=>{t(),document.removeEventListener("touchmove",l),document.removeEventListener("touchstart",a),document.removeEventListener("contextmenu",n),document.removeEventListener("touchend",t),document.removeEventListener("touchcancel",t)}},[]),{begin(n,a){if(t(),n.pointerType!=="touch")return;const l=n.currentTarget;l.dataset.touchDrag="holding";const o={x:n.clientX,y:n.clientY,element:l,armed:!1,timer:setTimeout(()=>{e.current===o&&(o.armed=!0,l.dataset.touchDrag="ready",a())},2e3)};e.current=o},allows(n){var a;return n!=="touch"||((a=e.current)==null?void 0:a.armed)===!0},end:t}}const Jp="seele:authentication-required",e1="seele:deployment-status-required",rx=12,SE=3e3,ax="activeWorkspaceId",G1="workspaceOrder",ix="workspaceGroupOrder",lx="workspaceDrafts",sx="collapsedWorkspaceGroups",ox="sidebarWidth",G3=5,V3=275,jE=236,CE=420,Y3="default",W3=300,TE=3,AE=10,EE=2,NE=13,ME=1.65,zE=20,DE=900;class Rs extends Error{constructor(n,a,l,o){super(n);xd(this,"detail");xd(this,"status");xd(this,"body");this.name="DetailedHttpError",this.detail=a,this.status=l,this.body=o}}const RE=[{value:"workspace-write",label:"Workspace"},{value:"danger-full-access",label:"System"}],Cc={id:null,kind:"source",name:"",description:"",purpose:"",attention:"tracked",refreshPolicy:"manual",status:"draft",sourceCluesText:"",requiredEnvText:""};function V1(){var e;return((e=document.querySelector('meta[name="seele-public-base-path"]'))==null?void 0:e.content.replace(/\/?$/,"/"))??"/"}function ze(e){return`${V1()}api/${e.replace(/^\/+/,"")}`}async function Xn(e,t){const n=await e.text().catch(()=>""),a=`Request failed with ${e.status}`,l=[`${t.method??"GET"} ${t.url}`,`HTTP ${e.status} ${e.statusText||""}`.trim(),n?`Response: ${n}`:"Response: <empty>"].join(`
|
|
352
|
-
`);return new Rs(a,l,e.status,n)}function pt(e){return e instanceof Rs?{message:e.message,detail:e.detail}:e instanceof Error?{message:e.message}:{message:String(e)}}function Ss(e){const t=pt(e);return t.detail?{message:t.message,detail:t.detail}:t.message}async function Fe(e,t){if(!e.ok)throw await Xn(e,t)}function OE(e){return e instanceof Rs&&e.status===410&&e.body.includes('"turn_not_active"')}function IE(e){return e instanceof Rs&&e.status===409&&e.body.includes('"turn_not_running"')}function _E(e){return e instanceof Rs&&e.status===409&&e.body.includes('"thread_capability_upgrade_required"')}function K3(e){return{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e})}}async function LE(e){if(e.status!==409)return null;try{const t=await e.json();if(t.error==="turn_already_running"&&typeof t.turnId=="string")return t.turnId}catch{return null}return null}function Y1(e){return Math.max(jE,Math.min(CE,Math.round(e)))}function BE(e){try{const t=window.localStorage.getItem(Vr(e,ox)),n=t?Number.parseInt(t,10):Number.NaN;return Number.isFinite(n)?Y1(n):V3}catch{return V3}}function qE(e,t){try{window.localStorage.setItem(Vr(e,ox),String(Y1(t)))}catch{}}function ip(e){ux(e,()=>{e.scrollTop=Math.max(0,e.scrollHeight-e.clientHeight)})}function UE(e,t=48){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}function HE(e){if(!e)return;const t=window.getComputedStyle(e),n=parseFloat(t.lineHeight)||24,a=parseFloat(t.paddingTop)||0,l=parseFloat(t.paddingBottom)||0,o=n*TE+a+l,c=n*AE+a+l;e.style.height="auto";const f=Math.min(Math.max(e.scrollHeight,o),c);e.style.height=`${f}px`,e.style.overflowY=e.scrollHeight>c?"auto":"hidden"}function $E(e){const t=e.split(/\r\n|\r|\n/).length;return Math.min(EE,Math.max(1,t+1))}function FE(e){return Math.ceil($E(e)*NE*ME+zE)}function ux(e,t){const n=e.style.scrollBehavior;e.style.scrollBehavior="auto",t(),e.style.scrollBehavior=n}function PE(e){const t=e.getBoundingClientRect(),n=t.bottom-32,a=Array.from(e.querySelectorAll(".turn-group[data-turn-id]")),l=[...a].reverse().find(c=>{const f=c.getBoundingClientRect();return f.top<=n&&f.bottom>=t.top})??a[a.length-1]??null;if(!(l!=null&&l.dataset.turnId))return{anchorOffset:null,anchorTurnId:null};const o=l.getBoundingClientRect();return{anchorOffset:n-o.top,anchorTurnId:l.dataset.turnId}}function GE(e,t){return t?Array.from(e.querySelectorAll(".turn-group[data-turn-id]")).find(n=>n.dataset.turnId===t)??null:null}function X3(e,t){ux(e,()=>{const n=GE(e,t.anchorTurnId);if(n&&t.anchorOffset!==null){const l=e.getBoundingClientRect().bottom-32,c=n.getBoundingClientRect().top-(l-t.anchorOffset);Math.abs(c)>.5&&(e.scrollTop+=c);return}e.scrollTop=Math.max(0,e.scrollHeight-t.previousScrollHeight)})}function VE(e,t){let n=!1;const a=e.querySelector(".stream-inner")??e,l=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>{n||X3(e,t)});X3(e,t),l==null||l.observe(a);const o=window.setTimeout(c,1200);function c(){n||(n=!0,l==null||l.disconnect(),window.clearTimeout(o))}return c}function YE(e){try{return window.localStorage.getItem(Vr(e,ax))}catch{return null}}function lp(e,t){const n=Vr(e,ax);try{t?window.localStorage.setItem(n,t):window.localStorage.removeItem(n)}catch{}}function Fo(e){try{const t=window.localStorage.getItem(Vr(e,G1)),n=t?JSON.parse(t):[];return Array.isArray(n)?n.filter(a=>typeof a=="string"):[]}catch{return[]}}function cx(e){try{const t=window.localStorage.getItem(Vr(e,ix)),n=t?JSON.parse(t):[];return Array.isArray(n)?n.filter(a=>typeof a=="string"):[]}catch{return[]}}function dx(e,t){try{window.localStorage.setItem(Vr(e,ix),JSON.stringify(t))}catch{}}function zc(e,t){try{window.localStorage.setItem(Vr(e,G1),JSON.stringify(t))}catch{}}function fx(e){try{const t=window.localStorage.getItem(Vr(e,lx)),n=t?JSON.parse(t):{};return!n||typeof n!="object"||Array.isArray(n)?{}:Object.fromEntries(Object.entries(n).filter(a=>typeof a[0]=="string"&&typeof a[1]=="string"))}catch{return{}}}function WE(e,t){return t?fx(e)[t]??"":""}function sp(e,t,n){if(t)try{const a=fx(e);n?a[t]=n:delete a[t],window.localStorage.setItem(Vr(e,lx),JSON.stringify(a))}catch{}}function KE(e){try{const t=window.localStorage.getItem(Vr(e,sx)),n=t?JSON.parse(t):[];return new Set(Array.isArray(n)?n.filter(a=>typeof a=="string"):[])}catch{return new Set}}function op(e,t){try{window.localStorage.setItem(Vr(e,sx),JSON.stringify(Array.from(t)))}catch{}}function zl(e,t){const n=Fo(e);if(n.length===0)return t;const a=new Map(n.map((l,o)=>[l,o]));return[...t].sort((l,o)=>{const c=a.get(l.id),f=a.get(o.id);return c!==void 0&&f!==void 0?c-f:c!==void 0?-1:f!==void 0?1:0})}function Dd(e,t){const n=cx(e);if(n.length===0)return t;const a=new Map(n.map((l,o)=>[l,o]));return[...t].sort((l,o)=>{const c=a.get(l.id),f=a.get(o.id);return c!==void 0&&f!==void 0?c-f:c!==void 0?-1:f!==void 0?1:l.createdAt.localeCompare(o.createdAt)})}function Rd(e,t){const n=Fo(e),a=P1(n,t.map(l=>l.id));JSON.stringify(a)!==JSON.stringify(n)&&zc(e,a)}function up(e,t){const n=new Set(t.map(o=>o.id)),a=cx(e).filter(o=>n.has(o)),l=t.map(o=>o.id).filter(o=>!a.includes(o));dx(e,[...a,...l])}function XE(e,t){const n=e.getBoundingClientRect(),a=n.top+n.height/2;return t<a?"before":"after"}function ZE(e,t,n,a){if(t===n)return e;const l=e.findIndex(g=>g.id===t),o=e.findIndex(g=>g.id===n);if(l===-1||o===-1)return e;const c=[...e],[f]=c.splice(l,1),h=c.findIndex(g=>g.id===n),m=a==="before"?h:h+1;return c.splice(m,0,f),c}function QE(e,t,n){if(t===n)return e;const a=e.findIndex(h=>h.id===t),l=e.findIndex(h=>h.id===n);if(a===-1||l===-1)return e;const o=[...e],[c]=o.splice(a,1),f=o.findIndex(h=>h.id===n);return o.splice(f+1,0,c),o}function JE({authEnabled:e,currentUser:t,deploymentId:n,onLogout:a}){var Pu,Gu,Ga,Va;const l=D.useMemo(()=>({deploymentId:n,userId:t.id}),[n,t.id]),[o,c]=D.useState(""),[f,h]=D.useState(new Set),[m,g]=D.useState([]),[v,k]=D.useState([]),[b,T]=D.useState(null),[A,q]=D.useState(!1),[z,M]=D.useState(null),[B,U]=D.useState(null),[ae,L]=D.useState(!1),[K,ie]=D.useState(!1),[Q,F]=D.useState({}),[he,ce]=D.useState({}),[Ie,be]=D.useState(null),[pe,J]=D.useState([]),[Y,ge]=D.useState(null),[Te,H]=D.useState(!1),[_,te]=D.useState(null),[O,ee]=D.useState("checking"),[Ae,ne]=D.useState(null),[we,_e]=D.useState(!1),[He,wt]=D.useState(null),[et,$t]=D.useState(!1),[tt,fe]=D.useState(null),[qe,Je]=D.useState(!1),[Xe,Lt]=D.useState([]),[Tt,mt]=D.useState([]),[At,pn]=D.useState({model:"",reasoningEffort:"",fastMode:!1,sandbox:"workspace-write"}),[en,ht]=D.useState({profuseNotificationEnabled:!1,publicUrl:null}),[ur,me]=D.useState([]),[Se,$e]=D.useState(null),[at,kt]=D.useState(null),[wn,Yr]=D.useState(!1),[Bt,dn]=D.useState(null),[Gn,_t]=D.useState(!1),[Ta,Tr]=D.useState(null),[_f,$l]=D.useState(!1),[Fl,$i]=D.useState({model:"",reasoningEffort:"",fastMode:!1,sandbox:"workspace-write"}),[zn,sa]=D.useState("global"),[Ft,Pl]=D.useState(null),[ou,ai]=D.useState(null),[Fi,Gl]=D.useState({model:"",reasoningEffort:"",fastMode:!1,sandbox:"workspace-write"}),[n0,uu]=D.useState({memory:"",items:[]}),[r0,qs]=D.useState({memory:"",items:[]}),[cu,Us]=D.useState({memory:"",items:[]}),[a0,cr]=D.useState([]),[rn,gn]=D.useState(Cc),[Ar,Aa]=D.useState({description:"",key:"",value:""}),[du,Hs]=D.useState(null),[i0,oa]=D.useState(()=>new Set),[Vl,Ea]=D.useState(!1),[Na,ii]=D.useState(!1),[Pi,yn]=D.useState(!1),[ua,$s]=D.useState(null),[Ma,Gi]=D.useState(!0),[Lf,Yl]=D.useState(!1),[fu,Fs]=D.useState(!1),[Ps,Wl]=D.useState(!1),[Ln,kn]=D.useState(null),[l0,za]=D.useState(null),[li,hu]=D.useState(null),[dr,ca]=D.useState(null),[Sn,Gs]=D.useState(null),[Vi,Vs]=D.useState(null),[da,s0]=D.useState(()=>new Set),[Yi,Er]=D.useState(null),[mu,Kl]=D.useState(null),[pu,si]=D.useState(null),[Wr,fa]=D.useState(null),[Wi,er]=D.useState(null),[oi,Xl]=D.useState(()=>KE(l)),[Yt,Kr]=D.useState(null),[o0,Zl]=D.useState(()=>BE(l)),[gu,Ql]=D.useState(230),[Vn,yu]=D.useState(()=>Date.now()),[Jl,Da]=D.useState(0),Ys=D.useRef(null),ui=D.useRef(null),vu=D.useRef(null),Ki=D.useRef(null),ha=D.useRef(null),es=D.useRef(!0),Un=D.useRef(null),Nr=D.useRef(null),Xi=D.useRef(null),Ra=D.useRef(new Set),xu=D.useRef(!1),ts=D.useRef([]),ci=D.useRef(null),Zi=D.useRef(null),Oa=D.useRef(new Map),Qi=D.useRef(new Map),Ws=D.useRef(new Set),Ks=D.useRef(new Map),ns=D.useRef(new Map),Ia=D.useRef(new Map),Ji=D.useRef(new Set),_a=D.useRef(null),fr=D.useRef(new Map),hr=D.useRef(new Map),el=D.useRef(new Map),tl=D.useRef(new Set),Xs=P3(),Zs=P3(),Qs=D.useRef(null),Js=D.useRef(null),rs=D.useRef(!1),bu=D.useRef(!1),eo=D.useRef(!1),Ze=m.find(x=>x.id===b),wu=(Ze==null?void 0:Ze.unreadTurnCount)??0,Xr=m.find(x=>x.id===ua),vn=m.find(x=>x.id===Ft),ku=m.find(x=>x.id===Yi),di=D.useMemo(()=>{const C=Dd(l,v.length>0?v:[{id:"default",title:"Default",createdAt:"",updatedAt:""}]).map(W=>({id:W.id,title:W.title,conversations:[]})),N=new Map(C.map(W=>[W.id,W])),$=C[0];for(const W of m)(N.get(W.groupId)??$).conversations.push(W);return C.filter(W=>W.conversations.length>0||W.id!=="default")},[m,v]),to=D.useMemo(()=>pE(di,oi),[oi,di]),Nt=b!==null?Q[b]:null,nl=(Nt==null?void 0:Nt.messages)??[],no=(Nt==null?void 0:Nt.events)??[],as=pD(mD(no),b?he[b]:null),fi=Yx(as),hi=(Nt==null?void 0:Nt.status)??(Ze==null?void 0:Ze.status)??"idle",mi=s1(Ze,hi),u0=ua!==null?((Pu=Q[ua])==null?void 0:Pu.status)??(Xr==null?void 0:Xr.status)??"idle":"idle",c0=s1(Xr,u0),rl=b?hr.current.get(b)??null:null,Su=D.useMemo(()=>new Map(m.map(x=>[x.id,x.title])),[m]),ro=D.useMemo(()=>yx(nl,no,(Nt==null?void 0:Nt.turns)??[],(Nt==null?void 0:Nt.timelineNodes)??[],rl,Su),[rl,Nt==null?void 0:Nt.timelineNodes,Nt==null?void 0:Nt.turns,no,nl,Su]),La=D.useMemo(()=>new Set(nl.filter(x=>x.origin==="clone"&&x.turnId).map(x=>x.turnId)),[nl]),ao=b!==null&&da.has(b),Bf=b!==null&&f.has(b),d0=aE(o,Bf),io=rl?(Gu=ro.find(x=>Bc(x.turnIds,rl)))==null?void 0:Gu.activity:null,is=mi==="running"||mi==="initializing"||ao?io&&!tD(io)?io:{title:mi==="initializing"?"Initializing clone":"Thinking",createdAt:new Date().toISOString(),tone:"running"}:null,ls=!is&&mi==="waiting"&&(Ze!=null&&Ze.nextWakeup)?{title:"Scheduled wakeup",detail:hf(Ze.nextWakeup,Vn),createdAt:Ze.nextWakeup.wakeAt,tone:"waiting"}:null,ma=is??ls,qf=D.useMemo(()=>hD(Object.values(Q)),[Q]),lo=C5(_,qf);D.useEffect(()=>{Uf(),os()},[]),D.useEffect(()=>()=>{ha.current!==null&&window.clearTimeout(ha.current)},[]),D.useEffect(()=>{us(!1),us(!0);const x=window.setInterval(()=>{us(!0)},300*1e3);return()=>window.clearInterval(x)},[]),D.useEffect(()=>{const x=window.setInterval(()=>yu(Date.now()),1e3);return()=>window.clearInterval(x)},[]),D.useEffect(()=>{tl.current=da},[da]),D.useEffect(()=>{ci.current=b},[b]),D.useLayoutEffect(()=>{const x=Zi.current;if(Zi.current=b,!b||x===b)return;const C=window.requestAnimationFrame(()=>{const N=Ki.current;N&&!N.disabled&&!document.querySelector('[aria-modal="true"]')&&N.focus({preventScroll:!0})});return()=>window.cancelAnimationFrame(C)},[b]),D.useEffect(()=>{ts.current=m},[m]),D.useEffect(()=>{const x=Vr(l,G1),C=N=>{N.key===x&&g($=>zl(l,$))};return window.addEventListener("storage",C),()=>window.removeEventListener("storage",C)},[l]),D.useEffect(()=>{b&&lp(l,b)},[b,l]),D.useLayoutEffect(()=>{if(!b||wu<=0)return;let x=!1;const C=async()=>{if(document.visibilityState==="visible"){g($=>$.map(W=>W.id===b?{...W,unreadTurnCount:0}:W));try{await JM(b)}catch($){x||console.error($)}}},N=()=>void C();return C(),document.addEventListener("visibilitychange",N),()=>{x=!0,document.removeEventListener("visibilitychange",N)}},[b,wu]),D.useEffect(()=>{b&&tn(b)},[b]),D.useEffect(()=>{const x=window.setInterval(()=>void tr(),SE);return()=>window.clearInterval(x)},[]),D.useEffect(()=>{c(WE(l,b))},[b]),D.useEffect(()=>{if(!b)return;const x=uE({workspaceRunning:hi==="running",streamLeaseActive:ao,controllerActive:fr.current.has(b),currentTurnAbsent:Ws.current.has(b),retryAt:ns.current.get(b)??null,now:Date.now()});x.kind==="probe"&&Ha(b,{waitMs:x.waitMs})},[b,ao,Jl,hi]),D.useEffect(()=>()=>{for(const x of Ia.current.values())window.clearTimeout(x);Ia.current.clear()},[]),D.useEffect(()=>{if(!b)return;let x=!1;return Nz(b).then(C=>{x||ce(N=>({...N,[b]:C}))}).catch(C=>console.error(C)),()=>{x=!0}},[b]),D.useEffect(()=>{!b&&zn==="workspace"&&sa("global")},[b,zn]),D.useEffect(()=>{var x;if(qe){if(!Ft&&b){Pl(b);return}Ft&&!m.some(C=>C.id===Ft)&&Pl(b??((x=m[0])==null?void 0:x.id)??null)}},[b,m,qe,Ft]),D.useEffect(()=>{if(!qe||t.role!=="admin")return;const x=window.setInterval(()=>void ds(),5e3);return()=>window.clearInterval(x)},[t.role,qe]),D.useEffect(()=>{!qe||zn!=="workspace"||Us({memory:(vn==null?void 0:vn.memory)??"",items:(vn==null?void 0:vn.memoryItems)??[]})},[zn,qe,vn==null?void 0:vn.id,vn==null?void 0:vn.memory,vn==null?void 0:vn.memoryItems]),D.useEffect(()=>{if(!Vl)return;b&&oo(b);const x=C=>{C.key==="Escape"&&Ea(!1)};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[b,Vl]),D.useEffect(()=>{if(!qe)return;const x=C=>{C.key==="Escape"&&Je(!1)};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[qe]),D.useEffect(()=>{var C;if(!Na)return;if(ua&&!m.some(N=>N.id===ua)){$s(b??((C=m[0])==null?void 0:C.id)??null);return}const x=N=>{N.key==="Escape"&&(Ln?kn(null):ii(!1))};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[b,Na,Ln,ua,m]),D.useEffect(()=>{if(!dr)return;Gs(null);const x=C=>{C.key==="Escape"&&ca(null)};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[dr]),D.useEffect(()=>{const x=W=>{if(W.code==="ShiftLeft"){eo.current=!0;return}const oe=mE({code:W.code,key:W.key,metaKey:W.metaKey,shiftKey:W.shiftKey,ctrlKey:W.ctrlKey,altKey:W.altKey,leftShiftPressed:eo.current,repeat:W.repeat},Yt!==null);if((oe==null?void 0:oe.type)==="move"){W.preventDefault(),ie(!0),Kr(je=>gE(to,je,ci.current,oe.direction));return}if((oe==null?void 0:oe.type)==="cancel"){Kr(null);return}if(!((oe==null?void 0:oe.type)!=="confirm"||!Yt||va(W.target))){if(W.preventDefault(),Yt.kind==="group"){ps(Yt.id);return}yo(Yt.id),Kr(null),ie(!1)}},C=W=>{W.code==="ShiftLeft"&&(eo.current=!1)},N=()=>{eo.current=!1},$=()=>Kr(null);return window.addEventListener("keydown",x,!0),window.addEventListener("keyup",C,!0),window.addEventListener("blur",N),window.addEventListener("pointerdown",$),()=>{window.removeEventListener("keydown",x,!0),window.removeEventListener("keyup",C,!0),window.removeEventListener("blur",N),window.removeEventListener("pointerdown",$)}},[Yt,to]),D.useEffect(()=>{Yt&&!to.some(x=>Ts(x)===Ts(Yt))&&Kr(null)},[Yt,to]),D.useLayoutEffect(()=>{if(!Yt)return;const x=Ts(Yt),C=document.querySelector(`[data-keyboard-focus-key="${CSS.escape(x)}"]`);C==null||C.focus({preventScroll:!0}),C==null||C.scrollIntoView({block:"nearest"})},[Yt]),D.useLayoutEffect(()=>{HE(Ki.current)},[o]),D.useLayoutEffect(()=>{const x=vu.current;if(!x)return;const C=()=>{const $=x.getBoundingClientRect();Ql(Math.ceil($.height+44))};C();const N=typeof ResizeObserver>"u"?null:new ResizeObserver(C);return N==null||N.observe(x),window.addEventListener("resize",C),()=>{N==null||N.disconnect(),window.removeEventListener("resize",C)}},[]),D.useLayoutEffect(()=>{var oe,je;const x=ui.current;if(!x)return;const C=Un.current!==b;Un.current=b,C&&((oe=_a.current)==null||oe.call(_a),_a.current=null);const N=Nr.current;if(N&&N.conversationId===b){(je=_a.current)==null||je.call(_a),_a.current=VE(x,N),Nr.current=null,es.current=!1;return}if(!C&&!es.current)return;es.current=!0,ip(x);const $=requestAnimationFrame(()=>ip(x)),W=window.setTimeout(()=>ip(x),120);return()=>{cancelAnimationFrame($),window.clearTimeout(W)}},[b,no.length,nl.length]);async function f0(){var C;const x=ui.current;x&&(es.current=UE(x),!(!b||!((C=Nt==null?void 0:Nt.history)!=null&&C.hasMoreBefore))&&(Nt.loadingOlder||Ra.current.has(b)||x.scrollTop>96||await Ba(b)))}function so(x){var N,$;if(x.history)return x.history;const C=((N=x.timelineNodes)==null?void 0:N.filter(W=>W.parentId===null).reduce((W,oe)=>W===null||oe.timelineAt<W.timelineAt||oe.timelineAt===W.timelineAt&&oe.sequence<W.sequence?oe:W,null))??null;return{hasMoreBefore:!1,oldestMessageCreatedAt:(($=x.messages[0])==null?void 0:$.createdAt)??null,oldestTimelineAt:(C==null?void 0:C.timelineAt)??null,oldestTimelineSequence:(C==null?void 0:C.sequence)??null,messageTotal:x.messages.length,eventTotal:x.events.length,loadedMessageCount:x.messages.length,loadedEventCount:x.events.length}}async function pa(x){const C=new URL(x.url,window.location.href).toString();await navigator.clipboard.writeText(C),Gs(x.url)}async function pi(x,C){await navigator.clipboard.writeText(C),Vs(x),ha.current!==null&&window.clearTimeout(ha.current),ha.current=window.setTimeout(()=>{Vs(null),ha.current=null},1800)}function Pe(x,C,N){const $=Date.now();hu({id:$,tone:x,text:C,detail:N}),window.setTimeout(()=>{hu(W=>(W==null?void 0:W.id)===$?null:W)},N?8e3:2400)}function ss(x){const C=Ia.current.get(x);C!==void 0&&(window.clearTimeout(C),Ia.current.delete(x))}function al(x){Ws.current.delete(x),Ks.current.delete(x),ns.current.delete(x),Ji.current.delete(x),ss(x)}function h0(x){Ws.current.add(x),Ks.current.delete(x),ns.current.delete(x),Ji.current.delete(x),ss(x)}function ju(x){Ws.current.add(x),Ji.current.delete(x);const C=(Ks.current.get(x)??0)+1;Ks.current.set(x,C);const N=cE(C);ns.current.set(x,Date.now()+N),ss(x);const $=window.setTimeout(()=>{Ia.current.delete(x),Da(W=>W+1)},N);Ia.current.set(x,$)}function Cu(x,C){C!=="running"&&al(x)}async function Uf(){try{const[x,C]=await Promise.all([g5(),v5()]);ee("connected");const N=Dd(l,C);if(k(N),up(l,N),x.length>0){const $=zl(l,x),W=YE(l),oe=$.find(je=>je.id===W)??$[0];g($),Rd(l,$),T(oe.id);return}g([]),lp(l,null),T(null)}catch(x){console.error(x),ee("error")}}async function Yn(){const[x,C]=await Promise.all([g5(),v5()]);for(const W of x)Cu(W.id,W.status);const N=zl(l,x),$=Dd(l,C);k($),up(l,$),g(N),Rd(l,N)}async function tr(){if(!xu.current){xu.current=!0;try{const x=await KM(),C=ts.current,N=new Set(C.map(De=>De.id)),$=new Set(x.map(De=>De.id));if(N.size!==$.size||[...N].some(De=>!$.has(De))){await Yn(),ee("connected");return}const W=ci.current;for(const De of x)Cu(De.id,De.status);const oe=new Map(x.map(De=>[De.id,De])),je=W?oe.get(W)??null:null,Ve=zl(l,C.map(De=>{const Be=oe.get(De.id);return Be?{...De,status:Be.status,statusError:Be.statusError,nextWakeup:Be.nextWakeup,unreadTurnCount:Be.unreadTurnCount,updatedAt:Be.updatedAt}:De}));g(Ve),Rd(l,Ve),ee("connected"),je&&!tl.current.has(je.id)&&Et(je.id,De=>({...De,status:je.status}))}catch(x){console.error(x),ee("error")}finally{xu.current=!1}}}async function os(){try{const x=await Kz();ee("connected"),be(x.version)}catch(x){console.error(x),ee("error")}}async function us(x){try{const C=await Xz(x);C&&te(N=>C5(N,C))}catch(C){console.error("runtime rate-limit refresh failed",C)}}async function m0(){try{const x=await rz();Lt(x),ee("connected")}catch(x){console.error(x),ee("error")}}async function Tu(x){try{const C=await az(x);mt(C),ee("connected")}catch(C){console.error(C),mt([]),ee("error")}}async function oo(x){try{const C=await iz(x);cr(C),ee("connected")}catch(C){console.error(C),cr([]),ee("error")}}async function Au(x){try{const C=await cz();pn(C),$i(C),x||(ai(null),Gl(C)),ee("connected")}catch(C){console.error(C),ee("error")}}async function Hf(){if(t.role==="admin")try{ht(await dz()),ee("connected")}catch(x){console.error(x),ee("error")}}async function ga(x=!0){try{const C=await bz(x);me(C.models),ee("connected"),C.refreshing&&window.setTimeout(()=>void ga(!1),1e3)}catch(C){console.error(C),me([]),ee("error")}}async function cs(){try{const x=await hz();$e(x.codexVersion),kt(x.codexReleasedAt),ee("connected")}catch(x){console.error(x),$e(null),kt(null),ee("error")}}async function gi(x=!1){x&&$l(!0);try{const C=await wz(x);dn(C.job),Tr(C.latest),ee("connected"),C.job&&C.job.status!=="running"&&Xi.current===C.job.id&&(Xi.current=null,C.job.status==="succeeded"?(await Promise.all([ga(),cs()]),Pe("success",`Codex CLI updated to ${If(C.job.currentVersion)}`)):Pe("error","Codex CLI update failed",C.job.error??void 0))}catch(C){console.error(C),ee("error")}finally{x&&$l(!1)}}async function Eu(){_t(!0);try{const x=await kz();Xi.current=x.id,dn(x),ee("connected")}catch(x){console.error(x);const C=pt(x);Pe("error","Unable to start Codex CLI update",C.detail??C.message)}finally{_t(!1)}}D.useEffect(()=>{if(!wn||(Bt==null?void 0:Bt.status)!=="running")return;const x=window.setInterval(()=>void gi(),1e3);return()=>window.clearInterval(x)},[wn,Bt==null?void 0:Bt.id,Bt==null?void 0:Bt.status]);async function uo(x){try{const C=await Sz(x);ai(C),Gl(C.effective),ee("connected")}catch(C){console.error(C),ai(null),ee("error")}}async function yi(){try{const x=await jz();uu(x),qs(x),ee("connected")}catch(x){console.error(x),ee("error")}}async function il(){if(t.role!=="admin"){J([]);return}try{J(await qD()),ee("connected")}catch(x){console.error(x),ee("error")}}async function ds(){if(t.role!=="admin"){ge(null);return}H(!0);try{ge(await fz()),ee("connected")}catch(x){console.error(x),ee("error")}finally{H(!1)}}async function Nu(x=Ft){const C=[m0(),Au(x),cs(),ga(),yi()];t.role==="admin"&&(C.push(il()),C.push(ds()),C.push(Hf())),x&&(C.push(tn(x)),C.push(uo(x)),C.push(Tu(x)),C.push(oo(x))),await Promise.all(C)}function vi(){var C;const x=b??((C=m[0])==null?void 0:C.id)??null;ie(!1),Pl(x),sa(t.role==="admin"?"global":x?"workspace":"global"),Je(!0),Nu(x)}function p0(){var C;const x=b??((C=m[0])==null?void 0:C.id)??null;Pl(x),sa(x?"workspace":"global"),Je(!0),Nu(x)}function Mu(){var C;ie(!1);const x=b??((C=m[0])==null?void 0:C.id)??null;$s(x),za(null),kn(null),ii(!0),x&&g0(x)}async function g0(x){try{const C=await Dx(x);if(!C||C.status!=="running")return;Yl(!0);const N=await Rx(x,C);za(N),await tn(x),await Yn(),N.warmupTurnId&&$a(x,N.warmupTurnId),Pe("success","Full-history runtime reset completed")}catch(C){const N=pt(C);Pe("error","Full-history runtime reset failed",N.message)}finally{Yl(!1)}}function $f(x){Pl(x),sa("workspace"),tn(x),uo(x),Tu(x),oo(x),gn(Cc)}async function Ff(x){x.preventDefault();try{if(zn==="workspace"&&Ft){const C=(vn==null?void 0:vn.status)==="running",N=await b5(Ft,Dz(Fi,At,ou));ai(N.settings),Gl(N.settings.effective),Or(N.conversation),Pe("success","Workspace settings saved",C?"The current turn keeps its existing settings. Changes apply from the next turn.":void 0)}else{const C=await Cz(Fl);pn(C),$i(C),Ft&&await uo(Ft),Pe("success","Global settings saved")}ee("connected")}catch(C){console.error(C),ee("error");const N=pt(C);Pe("error","Failed to save runtime settings",N.detail??N.message)}}async function Pf(x){try{const C=await Tz(x);ht(C),ee("connected"),Pe("success","Deployment settings saved")}catch(C){console.error(C),ee("error");const N=pt(C);throw Pe("error","Failed to save deployment settings",N.detail??N.message),C}}async function y0(){var N;const x=Xr;if(!x){Pe("error","No workspace selected");return}const C=((N=Q[x.id])==null?void 0:N.status)??x.status;if(C==="running"||C==="initializing"){Pe("error","Stop the running turn before resetting runtime");return}Wl(!0),za(null);try{const $=await k5(x.id);kn($),ee("connected")}catch($){console.error($),ee("error");const W=pt($);Pe("error","Failed to preview runtime reset",W.detail??W.message)}finally{Wl(!1)}}async function v0(x){const C=Xr,N=Ln;if(!C||!N||N.conversationId!==C.id){Pe("error","Reset preview is required");return}Fs(!0),za(null);try{const $=await w5(C.id,{warmup:Ma,previewFingerprint:N.fingerprint,selectedEntryIds:x});za($),kn(null),ee("connected"),await tn(C.id),await Yn(),$.warmupTurnId&&$a(C.id,$.warmupTurnId),Pe("success","Runtime thread reset")}catch($){console.error($),ee("error");const W=pt($);Pe("error","Failed to reset runtime thread",W.detail??W.message)}finally{Fs(!1)}}async function zu(){var $;const x=Xr;if(!x){Pe("error","No workspace selected");return}const C=(($=Q[x.id])==null?void 0:$.status)??x.status;if(C==="running"||C==="initializing"){Pe("error","Stop the running turn before clearing context");return}if(window.confirm(`Start "${x.title}" from a blank context?
|
|
352
|
+
`);return new Rs(a,l,e.status,n)}function pt(e){return e instanceof Rs?{message:e.message,detail:e.detail}:e instanceof Error?{message:e.message}:{message:String(e)}}function Ss(e){const t=pt(e);return t.detail?{message:t.message,detail:t.detail}:t.message}async function Fe(e,t){if(!e.ok)throw await Xn(e,t)}function OE(e){return e instanceof Rs&&e.status===410&&e.body.includes('"turn_not_active"')}function IE(e){return e instanceof Rs&&e.status===409&&e.body.includes('"turn_not_running"')}function _E(e){return e instanceof Rs&&e.status===409&&e.body.includes('"thread_capability_upgrade_required"')}function K3(e){return{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e})}}async function LE(e){if(e.status!==409)return null;try{const t=await e.json();if(t.error==="turn_already_running"&&typeof t.turnId=="string")return t.turnId}catch{return null}return null}function Y1(e){return Math.max(jE,Math.min(CE,Math.round(e)))}function BE(e){try{const t=window.localStorage.getItem(Vr(e,ox)),n=t?Number.parseInt(t,10):Number.NaN;return Number.isFinite(n)?Y1(n):V3}catch{return V3}}function qE(e,t){try{window.localStorage.setItem(Vr(e,ox),String(Y1(t)))}catch{}}function ip(e){ux(e,()=>{e.scrollTop=Math.max(0,e.scrollHeight-e.clientHeight)})}function UE(e,t=48){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}function HE(e){if(!e)return;const t=window.getComputedStyle(e),n=parseFloat(t.lineHeight)||24,a=parseFloat(t.paddingTop)||0,l=parseFloat(t.paddingBottom)||0,o=n*TE+a+l,c=n*AE+a+l;e.style.height="auto";const f=Math.min(Math.max(e.scrollHeight,o),c);e.style.height=`${f}px`,e.style.overflowY=e.scrollHeight>c?"auto":"hidden"}function $E(e){const t=e.split(/\r\n|\r|\n/).length;return Math.min(EE,Math.max(1,t+1))}function FE(e){return Math.ceil($E(e)*NE*ME+zE)}function ux(e,t){const n=e.style.scrollBehavior;e.style.scrollBehavior="auto",t(),e.style.scrollBehavior=n}function PE(e){const t=e.getBoundingClientRect(),n=t.bottom-32,a=Array.from(e.querySelectorAll(".turn-group[data-turn-id]")),l=[...a].reverse().find(c=>{const f=c.getBoundingClientRect();return f.top<=n&&f.bottom>=t.top})??a[a.length-1]??null;if(!(l!=null&&l.dataset.turnId))return{anchorOffset:null,anchorTurnId:null};const o=l.getBoundingClientRect();return{anchorOffset:n-o.top,anchorTurnId:l.dataset.turnId}}function GE(e,t){return t?Array.from(e.querySelectorAll(".turn-group[data-turn-id]")).find(n=>n.dataset.turnId===t)??null:null}function X3(e,t){ux(e,()=>{const n=GE(e,t.anchorTurnId);if(n&&t.anchorOffset!==null){const l=e.getBoundingClientRect().bottom-32,c=n.getBoundingClientRect().top-(l-t.anchorOffset);Math.abs(c)>.5&&(e.scrollTop+=c);return}e.scrollTop=Math.max(0,e.scrollHeight-t.previousScrollHeight)})}function VE(e,t){let n=!1;const a=e.querySelector(".stream-inner")??e,l=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>{n||X3(e,t)});X3(e,t),l==null||l.observe(a);const o=window.setTimeout(c,1200);function c(){n||(n=!0,l==null||l.disconnect(),window.clearTimeout(o))}return c}function YE(e){try{return window.localStorage.getItem(Vr(e,ax))}catch{return null}}function lp(e,t){const n=Vr(e,ax);try{t?window.localStorage.setItem(n,t):window.localStorage.removeItem(n)}catch{}}function Fo(e){try{const t=window.localStorage.getItem(Vr(e,G1)),n=t?JSON.parse(t):[];return Array.isArray(n)?n.filter(a=>typeof a=="string"):[]}catch{return[]}}function cx(e){try{const t=window.localStorage.getItem(Vr(e,ix)),n=t?JSON.parse(t):[];return Array.isArray(n)?n.filter(a=>typeof a=="string"):[]}catch{return[]}}function dx(e,t){try{window.localStorage.setItem(Vr(e,ix),JSON.stringify(t))}catch{}}function zc(e,t){try{window.localStorage.setItem(Vr(e,G1),JSON.stringify(t))}catch{}}function fx(e){try{const t=window.localStorage.getItem(Vr(e,lx)),n=t?JSON.parse(t):{};return!n||typeof n!="object"||Array.isArray(n)?{}:Object.fromEntries(Object.entries(n).filter(a=>typeof a[0]=="string"&&typeof a[1]=="string"))}catch{return{}}}function WE(e,t){return t?fx(e)[t]??"":""}function sp(e,t,n){if(t)try{const a=fx(e);n?a[t]=n:delete a[t],window.localStorage.setItem(Vr(e,lx),JSON.stringify(a))}catch{}}function KE(e){try{const t=window.localStorage.getItem(Vr(e,sx)),n=t?JSON.parse(t):[];return new Set(Array.isArray(n)?n.filter(a=>typeof a=="string"):[])}catch{return new Set}}function op(e,t){try{window.localStorage.setItem(Vr(e,sx),JSON.stringify(Array.from(t)))}catch{}}function zl(e,t){const n=Fo(e);if(n.length===0)return t;const a=new Map(n.map((l,o)=>[l,o]));return[...t].sort((l,o)=>{const c=a.get(l.id),f=a.get(o.id);return c!==void 0&&f!==void 0?c-f:c!==void 0?-1:f!==void 0?1:0})}function Dd(e,t){const n=cx(e);if(n.length===0)return t;const a=new Map(n.map((l,o)=>[l,o]));return[...t].sort((l,o)=>{const c=a.get(l.id),f=a.get(o.id);return c!==void 0&&f!==void 0?c-f:c!==void 0?-1:f!==void 0?1:l.createdAt.localeCompare(o.createdAt)})}function Rd(e,t){const n=Fo(e),a=P1(n,t.map(l=>l.id));JSON.stringify(a)!==JSON.stringify(n)&&zc(e,a)}function up(e,t){const n=new Set(t.map(o=>o.id)),a=cx(e).filter(o=>n.has(o)),l=t.map(o=>o.id).filter(o=>!a.includes(o));dx(e,[...a,...l])}function XE(e,t){const n=e.getBoundingClientRect(),a=n.top+n.height/2;return t<a?"before":"after"}function ZE(e,t,n,a){if(t===n)return e;const l=e.findIndex(g=>g.id===t),o=e.findIndex(g=>g.id===n);if(l===-1||o===-1)return e;const c=[...e],[f]=c.splice(l,1),h=c.findIndex(g=>g.id===n),m=a==="before"?h:h+1;return c.splice(m,0,f),c}function QE(e,t,n){if(t===n)return e;const a=e.findIndex(h=>h.id===t),l=e.findIndex(h=>h.id===n);if(a===-1||l===-1)return e;const o=[...e],[c]=o.splice(a,1),f=o.findIndex(h=>h.id===n);return o.splice(f+1,0,c),o}function JE({authEnabled:e,currentUser:t,deploymentId:n,onLogout:a}){var Pu,Gu,Ga,Va;const l=D.useMemo(()=>({deploymentId:n,userId:t.id}),[n,t.id]),[o,c]=D.useState(""),[f,h]=D.useState(new Set),[m,g]=D.useState([]),[v,k]=D.useState([]),[b,T]=D.useState(null),[A,q]=D.useState(!1),[z,M]=D.useState(null),[B,U]=D.useState(null),[ne,L]=D.useState(!1),[K,ie]=D.useState(!1),[Q,F]=D.useState({}),[he,ce]=D.useState({}),[Ie,be]=D.useState(null),[pe,J]=D.useState([]),[Y,ge]=D.useState(null),[Te,H]=D.useState(!1),[_,te]=D.useState(null),[O,ee]=D.useState("checking"),[Ae,re]=D.useState(null),[we,_e]=D.useState(!1),[He,wt]=D.useState(null),[et,$t]=D.useState(!1),[tt,fe]=D.useState(null),[qe,Je]=D.useState(!1),[Xe,Lt]=D.useState([]),[Tt,mt]=D.useState([]),[At,pn]=D.useState({model:"",reasoningEffort:"",fastMode:!1,sandbox:"workspace-write"}),[en,ht]=D.useState({profuseNotificationEnabled:!1,publicUrl:null}),[ur,me]=D.useState([]),[Se,$e]=D.useState(null),[at,kt]=D.useState(null),[wn,Yr]=D.useState(!1),[Bt,dn]=D.useState(null),[Gn,_t]=D.useState(!1),[Ta,Tr]=D.useState(null),[_f,$l]=D.useState(!1),[Fl,$i]=D.useState({model:"",reasoningEffort:"",fastMode:!1,sandbox:"workspace-write"}),[zn,sa]=D.useState("global"),[Ft,Pl]=D.useState(null),[ou,ai]=D.useState(null),[Fi,Gl]=D.useState({model:"",reasoningEffort:"",fastMode:!1,sandbox:"workspace-write"}),[n0,uu]=D.useState({memory:"",items:[]}),[r0,qs]=D.useState({memory:"",items:[]}),[cu,Us]=D.useState({memory:"",items:[]}),[a0,cr]=D.useState([]),[rn,gn]=D.useState(Cc),[Ar,Aa]=D.useState({description:"",key:"",value:""}),[du,Hs]=D.useState(null),[i0,oa]=D.useState(()=>new Set),[Vl,Ea]=D.useState(!1),[Na,ii]=D.useState(!1),[Pi,yn]=D.useState(!1),[ua,$s]=D.useState(null),[Ma,Gi]=D.useState(!0),[Lf,Yl]=D.useState(!1),[fu,Fs]=D.useState(!1),[Ps,Wl]=D.useState(!1),[Ln,kn]=D.useState(null),[l0,za]=D.useState(null),[li,hu]=D.useState(null),[dr,ca]=D.useState(null),[Sn,Gs]=D.useState(null),[Vi,Vs]=D.useState(null),[da,s0]=D.useState(()=>new Set),[Yi,Er]=D.useState(null),[mu,Kl]=D.useState(null),[pu,si]=D.useState(null),[Wr,fa]=D.useState(null),[Wi,er]=D.useState(null),[oi,Xl]=D.useState(()=>KE(l)),[Yt,Kr]=D.useState(null),[o0,Zl]=D.useState(()=>BE(l)),[gu,Ql]=D.useState(230),[Vn,yu]=D.useState(()=>Date.now()),[Jl,Da]=D.useState(0),Ys=D.useRef(null),ui=D.useRef(null),vu=D.useRef(null),Ki=D.useRef(null),ha=D.useRef(null),es=D.useRef(!0),Un=D.useRef(null),Nr=D.useRef(null),Xi=D.useRef(null),Ra=D.useRef(new Set),xu=D.useRef(!1),ts=D.useRef([]),ci=D.useRef(null),Zi=D.useRef(null),Oa=D.useRef(new Map),Qi=D.useRef(new Map),Ws=D.useRef(new Set),Ks=D.useRef(new Map),ns=D.useRef(new Map),Ia=D.useRef(new Map),Ji=D.useRef(new Set),_a=D.useRef(null),fr=D.useRef(new Map),hr=D.useRef(new Map),el=D.useRef(new Map),tl=D.useRef(new Set),Xs=P3(),Zs=P3(),Qs=D.useRef(null),Js=D.useRef(null),rs=D.useRef(!1),bu=D.useRef(!1),eo=D.useRef(!1),Ze=m.find(x=>x.id===b),wu=(Ze==null?void 0:Ze.unreadTurnCount)??0,Xr=m.find(x=>x.id===ua),vn=m.find(x=>x.id===Ft),ku=m.find(x=>x.id===Yi),di=D.useMemo(()=>{const C=Dd(l,v.length>0?v:[{id:"default",title:"Default",createdAt:"",updatedAt:""}]).map(W=>({id:W.id,title:W.title,conversations:[]})),N=new Map(C.map(W=>[W.id,W])),$=C[0];for(const W of m)(N.get(W.groupId)??$).conversations.push(W);return C.filter(W=>W.conversations.length>0||W.id!=="default")},[m,v]),to=D.useMemo(()=>pE(di,oi),[oi,di]),Nt=b!==null?Q[b]:null,nl=(Nt==null?void 0:Nt.messages)??[],no=(Nt==null?void 0:Nt.events)??[],as=pD(mD(no),b?he[b]:null),fi=Yx(as),hi=(Nt==null?void 0:Nt.status)??(Ze==null?void 0:Ze.status)??"idle",mi=s1(Ze,hi),u0=ua!==null?((Pu=Q[ua])==null?void 0:Pu.status)??(Xr==null?void 0:Xr.status)??"idle":"idle",c0=s1(Xr,u0),rl=b?hr.current.get(b)??null:null,Su=D.useMemo(()=>new Map(m.map(x=>[x.id,x.title])),[m]),ro=D.useMemo(()=>yx(nl,no,(Nt==null?void 0:Nt.turns)??[],(Nt==null?void 0:Nt.timelineNodes)??[],rl,Su),[rl,Nt==null?void 0:Nt.timelineNodes,Nt==null?void 0:Nt.turns,no,nl,Su]),La=D.useMemo(()=>new Set(nl.filter(x=>x.origin==="clone"&&x.turnId).map(x=>x.turnId)),[nl]),ao=b!==null&&da.has(b),Bf=b!==null&&f.has(b),d0=aE(o,Bf),io=rl?(Gu=ro.find(x=>Bc(x.turnIds,rl)))==null?void 0:Gu.activity:null,is=mi==="running"||mi==="initializing"||ao?io&&!tD(io)?io:{title:mi==="initializing"?"Initializing clone":"Thinking",createdAt:new Date().toISOString(),tone:"running"}:null,ls=!is&&mi==="waiting"&&(Ze!=null&&Ze.nextWakeup)?{title:"Scheduled wakeup",detail:hf(Ze.nextWakeup,Vn),createdAt:Ze.nextWakeup.wakeAt,tone:"waiting"}:null,ma=is??ls,qf=D.useMemo(()=>hD(Object.values(Q)),[Q]),lo=C5(_,qf);D.useEffect(()=>{Uf(),os()},[]),D.useEffect(()=>()=>{ha.current!==null&&window.clearTimeout(ha.current)},[]),D.useEffect(()=>{us(!1),us(!0);const x=window.setInterval(()=>{us(!0)},300*1e3);return()=>window.clearInterval(x)},[]),D.useEffect(()=>{const x=window.setInterval(()=>yu(Date.now()),1e3);return()=>window.clearInterval(x)},[]),D.useEffect(()=>{tl.current=da},[da]),D.useEffect(()=>{ci.current=b},[b]),D.useLayoutEffect(()=>{const x=Zi.current;if(Zi.current=b,!b||x===b)return;const C=window.requestAnimationFrame(()=>{const N=Ki.current;N&&!N.disabled&&!document.querySelector('[aria-modal="true"]')&&N.focus({preventScroll:!0})});return()=>window.cancelAnimationFrame(C)},[b]),D.useEffect(()=>{ts.current=m},[m]),D.useEffect(()=>{const x=Vr(l,G1),C=N=>{N.key===x&&g($=>zl(l,$))};return window.addEventListener("storage",C),()=>window.removeEventListener("storage",C)},[l]),D.useEffect(()=>{b&&lp(l,b)},[b,l]),D.useLayoutEffect(()=>{if(!b||wu<=0)return;let x=!1;const C=async()=>{if(document.visibilityState==="visible"){g($=>$.map(W=>W.id===b?{...W,unreadTurnCount:0}:W));try{await JM(b)}catch($){x||console.error($)}}},N=()=>void C();return C(),document.addEventListener("visibilitychange",N),()=>{x=!0,document.removeEventListener("visibilitychange",N)}},[b,wu]),D.useEffect(()=>{b&&tn(b)},[b]),D.useEffect(()=>{const x=window.setInterval(()=>void tr(),SE);return()=>window.clearInterval(x)},[]),D.useEffect(()=>{c(WE(l,b))},[b]),D.useEffect(()=>{if(!b)return;const x=uE({workspaceRunning:hi==="running",streamLeaseActive:ao,controllerActive:fr.current.has(b),currentTurnAbsent:Ws.current.has(b),retryAt:ns.current.get(b)??null,now:Date.now()});x.kind==="probe"&&Ha(b,{waitMs:x.waitMs})},[b,ao,Jl,hi]),D.useEffect(()=>()=>{for(const x of Ia.current.values())window.clearTimeout(x);Ia.current.clear()},[]),D.useEffect(()=>{if(!b)return;let x=!1;return Nz(b).then(C=>{x||ce(N=>({...N,[b]:C}))}).catch(C=>console.error(C)),()=>{x=!0}},[b]),D.useEffect(()=>{!b&&zn==="workspace"&&sa("global")},[b,zn]),D.useEffect(()=>{var x;if(qe){if(!Ft&&b){Pl(b);return}Ft&&!m.some(C=>C.id===Ft)&&Pl(b??((x=m[0])==null?void 0:x.id)??null)}},[b,m,qe,Ft]),D.useEffect(()=>{if(!qe||t.role!=="admin")return;const x=window.setInterval(()=>void ds(),5e3);return()=>window.clearInterval(x)},[t.role,qe]),D.useEffect(()=>{!qe||zn!=="workspace"||Us({memory:(vn==null?void 0:vn.memory)??"",items:(vn==null?void 0:vn.memoryItems)??[]})},[zn,qe,vn==null?void 0:vn.id,vn==null?void 0:vn.memory,vn==null?void 0:vn.memoryItems]),D.useEffect(()=>{if(!Vl)return;b&&oo(b);const x=C=>{C.key==="Escape"&&Ea(!1)};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[b,Vl]),D.useEffect(()=>{if(!qe)return;const x=C=>{C.key==="Escape"&&Je(!1)};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[qe]),D.useEffect(()=>{var C;if(!Na)return;if(ua&&!m.some(N=>N.id===ua)){$s(b??((C=m[0])==null?void 0:C.id)??null);return}const x=N=>{N.key==="Escape"&&(Ln?kn(null):ii(!1))};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[b,Na,Ln,ua,m]),D.useEffect(()=>{if(!dr)return;Gs(null);const x=C=>{C.key==="Escape"&&ca(null)};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[dr]),D.useEffect(()=>{const x=W=>{if(W.code==="ShiftLeft"){eo.current=!0;return}const oe=mE({code:W.code,key:W.key,metaKey:W.metaKey,shiftKey:W.shiftKey,ctrlKey:W.ctrlKey,altKey:W.altKey,leftShiftPressed:eo.current,repeat:W.repeat},Yt!==null);if((oe==null?void 0:oe.type)==="move"){W.preventDefault(),ie(!0),Kr(je=>gE(to,je,ci.current,oe.direction));return}if((oe==null?void 0:oe.type)==="cancel"){Kr(null);return}if(!((oe==null?void 0:oe.type)!=="confirm"||!Yt||va(W.target))){if(W.preventDefault(),Yt.kind==="group"){ps(Yt.id);return}yo(Yt.id),Kr(null),ie(!1)}},C=W=>{W.code==="ShiftLeft"&&(eo.current=!1)},N=()=>{eo.current=!1},$=()=>Kr(null);return window.addEventListener("keydown",x,!0),window.addEventListener("keyup",C,!0),window.addEventListener("blur",N),window.addEventListener("pointerdown",$),()=>{window.removeEventListener("keydown",x,!0),window.removeEventListener("keyup",C,!0),window.removeEventListener("blur",N),window.removeEventListener("pointerdown",$)}},[Yt,to]),D.useEffect(()=>{Yt&&!to.some(x=>Ts(x)===Ts(Yt))&&Kr(null)},[Yt,to]),D.useLayoutEffect(()=>{if(!Yt)return;const x=Ts(Yt),C=document.querySelector(`[data-keyboard-focus-key="${CSS.escape(x)}"]`);C==null||C.focus({preventScroll:!0}),C==null||C.scrollIntoView({block:"nearest"})},[Yt]),D.useLayoutEffect(()=>{HE(Ki.current)},[o]),D.useLayoutEffect(()=>{const x=vu.current;if(!x)return;const C=()=>{const $=x.getBoundingClientRect();Ql(Math.ceil($.height+44))};C();const N=typeof ResizeObserver>"u"?null:new ResizeObserver(C);return N==null||N.observe(x),window.addEventListener("resize",C),()=>{N==null||N.disconnect(),window.removeEventListener("resize",C)}},[]),D.useLayoutEffect(()=>{var oe,je;const x=ui.current;if(!x)return;const C=Un.current!==b;Un.current=b,C&&((oe=_a.current)==null||oe.call(_a),_a.current=null);const N=Nr.current;if(N&&N.conversationId===b){(je=_a.current)==null||je.call(_a),_a.current=VE(x,N),Nr.current=null,es.current=!1;return}if(!C&&!es.current)return;es.current=!0,ip(x);const $=requestAnimationFrame(()=>ip(x)),W=window.setTimeout(()=>ip(x),120);return()=>{cancelAnimationFrame($),window.clearTimeout(W)}},[b,no.length,nl.length]);async function f0(){var C;const x=ui.current;x&&(es.current=UE(x),!(!b||!((C=Nt==null?void 0:Nt.history)!=null&&C.hasMoreBefore))&&(Nt.loadingOlder||Ra.current.has(b)||x.scrollTop>96||await Ba(b)))}function so(x){var N,$;if(x.history)return x.history;const C=((N=x.timelineNodes)==null?void 0:N.filter(W=>W.parentId===null).reduce((W,oe)=>W===null||oe.timelineAt<W.timelineAt||oe.timelineAt===W.timelineAt&&oe.sequence<W.sequence?oe:W,null))??null;return{hasMoreBefore:!1,oldestMessageCreatedAt:(($=x.messages[0])==null?void 0:$.createdAt)??null,oldestTimelineAt:(C==null?void 0:C.timelineAt)??null,oldestTimelineSequence:(C==null?void 0:C.sequence)??null,messageTotal:x.messages.length,eventTotal:x.events.length,loadedMessageCount:x.messages.length,loadedEventCount:x.events.length}}async function pa(x){const C=new URL(x.url,window.location.href).toString();await navigator.clipboard.writeText(C),Gs(x.url)}async function pi(x,C){await navigator.clipboard.writeText(C),Vs(x),ha.current!==null&&window.clearTimeout(ha.current),ha.current=window.setTimeout(()=>{Vs(null),ha.current=null},1800)}function Pe(x,C,N){const $=Date.now();hu({id:$,tone:x,text:C,detail:N}),window.setTimeout(()=>{hu(W=>(W==null?void 0:W.id)===$?null:W)},N?8e3:2400)}function ss(x){const C=Ia.current.get(x);C!==void 0&&(window.clearTimeout(C),Ia.current.delete(x))}function al(x){Ws.current.delete(x),Ks.current.delete(x),ns.current.delete(x),Ji.current.delete(x),ss(x)}function h0(x){Ws.current.add(x),Ks.current.delete(x),ns.current.delete(x),Ji.current.delete(x),ss(x)}function ju(x){Ws.current.add(x),Ji.current.delete(x);const C=(Ks.current.get(x)??0)+1;Ks.current.set(x,C);const N=cE(C);ns.current.set(x,Date.now()+N),ss(x);const $=window.setTimeout(()=>{Ia.current.delete(x),Da(W=>W+1)},N);Ia.current.set(x,$)}function Cu(x,C){C!=="running"&&al(x)}async function Uf(){try{const[x,C]=await Promise.all([g5(),v5()]);ee("connected");const N=Dd(l,C);if(k(N),up(l,N),x.length>0){const $=zl(l,x),W=YE(l),oe=$.find(je=>je.id===W)??$[0];g($),Rd(l,$),T(oe.id);return}g([]),lp(l,null),T(null)}catch(x){console.error(x),ee("error")}}async function Yn(){const[x,C]=await Promise.all([g5(),v5()]);for(const W of x)Cu(W.id,W.status);const N=zl(l,x),$=Dd(l,C);k($),up(l,$),g(N),Rd(l,N)}async function tr(){if(!xu.current){xu.current=!0;try{const x=await KM(),C=ts.current,N=new Set(C.map(De=>De.id)),$=new Set(x.map(De=>De.id));if(N.size!==$.size||[...N].some(De=>!$.has(De))){await Yn(),ee("connected");return}const W=ci.current;for(const De of x)Cu(De.id,De.status);const oe=new Map(x.map(De=>[De.id,De])),je=W?oe.get(W)??null:null,Ve=zl(l,C.map(De=>{const Be=oe.get(De.id);return Be?{...De,status:Be.status,statusError:Be.statusError,nextWakeup:Be.nextWakeup,unreadTurnCount:Be.unreadTurnCount,updatedAt:Be.updatedAt}:De}));g(Ve),Rd(l,Ve),ee("connected"),je&&!tl.current.has(je.id)&&Et(je.id,De=>({...De,status:je.status}))}catch(x){console.error(x),ee("error")}finally{xu.current=!1}}}async function os(){try{const x=await Kz();ee("connected"),be(x.version)}catch(x){console.error(x),ee("error")}}async function us(x){try{const C=await Xz(x);C&&te(N=>C5(N,C))}catch(C){console.error("runtime rate-limit refresh failed",C)}}async function m0(){try{const x=await rz();Lt(x),ee("connected")}catch(x){console.error(x),ee("error")}}async function Tu(x){try{const C=await az(x);mt(C),ee("connected")}catch(C){console.error(C),mt([]),ee("error")}}async function oo(x){try{const C=await iz(x);cr(C),ee("connected")}catch(C){console.error(C),cr([]),ee("error")}}async function Au(x){try{const C=await cz();pn(C),$i(C),x||(ai(null),Gl(C)),ee("connected")}catch(C){console.error(C),ee("error")}}async function Hf(){if(t.role==="admin")try{ht(await dz()),ee("connected")}catch(x){console.error(x),ee("error")}}async function ga(x=!0){try{const C=await bz(x);me(C.models),ee("connected"),C.refreshing&&window.setTimeout(()=>void ga(!1),1e3)}catch(C){console.error(C),me([]),ee("error")}}async function cs(){try{const x=await hz();$e(x.codexVersion),kt(x.codexReleasedAt),ee("connected")}catch(x){console.error(x),$e(null),kt(null),ee("error")}}async function gi(x=!1){x&&$l(!0);try{const C=await wz(x);dn(C.job),Tr(C.latest),ee("connected"),C.job&&C.job.status!=="running"&&Xi.current===C.job.id&&(Xi.current=null,C.job.status==="succeeded"?(await Promise.all([ga(),cs()]),Pe("success",`Codex CLI updated to ${If(C.job.currentVersion)}`)):Pe("error","Codex CLI update failed",C.job.error??void 0))}catch(C){console.error(C),ee("error")}finally{x&&$l(!1)}}async function Eu(){_t(!0);try{const x=await kz();Xi.current=x.id,dn(x),ee("connected")}catch(x){console.error(x);const C=pt(x);Pe("error","Unable to start Codex CLI update",C.detail??C.message)}finally{_t(!1)}}D.useEffect(()=>{if(!wn||(Bt==null?void 0:Bt.status)!=="running")return;const x=window.setInterval(()=>void gi(),1e3);return()=>window.clearInterval(x)},[wn,Bt==null?void 0:Bt.id,Bt==null?void 0:Bt.status]);async function uo(x){try{const C=await Sz(x);ai(C),Gl(C.effective),ee("connected")}catch(C){console.error(C),ai(null),ee("error")}}async function yi(){try{const x=await jz();uu(x),qs(x),ee("connected")}catch(x){console.error(x),ee("error")}}async function il(){if(t.role!=="admin"){J([]);return}try{J(await qD()),ee("connected")}catch(x){console.error(x),ee("error")}}async function ds(){if(t.role!=="admin"){ge(null);return}H(!0);try{ge(await fz()),ee("connected")}catch(x){console.error(x),ee("error")}finally{H(!1)}}async function Nu(x=Ft){const C=[m0(),Au(x),cs(),ga(),yi()];t.role==="admin"&&(C.push(il()),C.push(ds()),C.push(Hf())),x&&(C.push(tn(x)),C.push(uo(x)),C.push(Tu(x)),C.push(oo(x))),await Promise.all(C)}function vi(){var C;const x=b??((C=m[0])==null?void 0:C.id)??null;ie(!1),Pl(x),sa(t.role==="admin"?"global":x?"workspace":"global"),Je(!0),Nu(x)}function p0(){var C;const x=b??((C=m[0])==null?void 0:C.id)??null;Pl(x),sa(x?"workspace":"global"),Je(!0),Nu(x)}function Mu(){var C;ie(!1);const x=b??((C=m[0])==null?void 0:C.id)??null;$s(x),za(null),kn(null),ii(!0),x&&g0(x)}async function g0(x){try{const C=await Dx(x);if(!C||C.status!=="running")return;Yl(!0);const N=await Rx(x,C);za(N),await tn(x),await Yn(),N.warmupTurnId&&$a(x,N.warmupTurnId),Pe("success","Full-history runtime reset completed")}catch(C){const N=pt(C);Pe("error","Full-history runtime reset failed",N.message)}finally{Yl(!1)}}function $f(x){Pl(x),sa("workspace"),tn(x),uo(x),Tu(x),oo(x),gn(Cc)}async function Ff(x){x.preventDefault();try{if(zn==="workspace"&&Ft){const C=(vn==null?void 0:vn.status)==="running",N=await b5(Ft,Dz(Fi,At,ou));ai(N.settings),Gl(N.settings.effective),Or(N.conversation),Pe("success","Workspace settings saved",C?"The current turn keeps its existing settings. Changes apply from the next turn.":void 0)}else{const C=await Cz(Fl);pn(C),$i(C),Ft&&await uo(Ft),Pe("success","Global settings saved")}ee("connected")}catch(C){console.error(C),ee("error");const N=pt(C);Pe("error","Failed to save runtime settings",N.detail??N.message)}}async function Pf(x){try{const C=await Tz(x);ht(C),ee("connected"),Pe("success","Deployment settings saved")}catch(C){console.error(C),ee("error");const N=pt(C);throw Pe("error","Failed to save deployment settings",N.detail??N.message),C}}async function y0(){var N;const x=Xr;if(!x){Pe("error","No workspace selected");return}const C=((N=Q[x.id])==null?void 0:N.status)??x.status;if(C==="running"||C==="initializing"){Pe("error","Stop the running turn before resetting runtime");return}Wl(!0),za(null);try{const $=await k5(x.id);kn($),ee("connected")}catch($){console.error($),ee("error");const W=pt($);Pe("error","Failed to preview runtime reset",W.detail??W.message)}finally{Wl(!1)}}async function v0(x){const C=Xr,N=Ln;if(!C||!N||N.conversationId!==C.id){Pe("error","Reset preview is required");return}Fs(!0),za(null);try{const $=await w5(C.id,{warmup:Ma,previewFingerprint:N.fingerprint,selectedEntryIds:x});za($),kn(null),ee("connected"),await tn(C.id),await Yn(),$.warmupTurnId&&$a(C.id,$.warmupTurnId),Pe("success","Runtime thread reset")}catch($){console.error($),ee("error");const W=pt($);Pe("error","Failed to reset runtime thread",W.detail??W.message)}finally{Fs(!1)}}async function zu(){var $;const x=Xr;if(!x){Pe("error","No workspace selected");return}const C=(($=Q[x.id])==null?void 0:$.status)??x.status;if(C==="running"||C==="initializing"){Pe("error","Stop the running turn before clearing context");return}if(window.confirm(`Start "${x.title}" from a blank context?
|
|
353
353
|
|
|
354
|
-
This clears Workspace Memory and creates a new Codex thread without restored history. Workspace files, Timeline, metadata, and Base Memory remain intact.`)){Yl(!0),za(null);try{const W=await k5(x.id),oe=await w5(x.id,{warmup:!1,previewFingerprint:W.fingerprint,selectedEntryIds:[],clearWorkspaceMemory:!0,saveSelection:!1});za(oe),kn(null),Ft===x.id&&Us({memory:"",items:[]}),ee("connected"),await tn(x.id),await Yn(),Pe("success","Workspace started from blank context")}catch(W){console.error(W),ee("error");const oe=pt(W);Pe("error","Failed to clear workspace context",oe.detail??oe.message)}finally{Yl(!1)}}}async function Mr(x){const C=Xr,N=Ln;if(!C||!N||N.conversationId!==C.id)throw new Error("Reset preview is no longer current.");try{await Az(C.id,{previewFingerprint:N.fingerprint,selectedEntryIds:x}),ee("connected")}catch($){console.error($),ee("error");const W=pt($);throw Pe("error","Failed to save reset defaults",W.detail??W.message),$}}async function co(x,C){try{const N=await b5(x,{[C]:null});ai(N.settings),Gl(N.settings.effective),Or(N.conversation),ee("connected"),Pe("success","Workspace override reset")}catch(N){console.error(N),ee("error"),Pe("error","Failed to reset workspace override")}}async function mr(x){try{const C=await qz({memory:Bz(x),items:x});return uu(C),qs(C),ee("connected"),Pe("success","Base memory saved"),C.items}catch(C){throw console.error(C),ee("error"),Pe("error","Failed to save memory"),C}}async function ll(x,C){try{const N=await qd(x,{memoryItems:C});return Or(N),Us({memory:N.memory,items:N.memoryItems}),ee("connected"),Pe("success","Workspace memory saved"),N.memoryItems}catch(N){throw console.error(N),ee("error"),Pe("error","Failed to save memory"),N}}async function Du(x){x.preventDefault();const C=Ar.key.trim();if(C)try{if(zn==="workspace"&&Ft){const N=await Hz(Ft,C,Ar.value,Ar.description);mt($=>[...$.filter(W=>W.key!==N.variable.key),N.variable].sort((W,oe)=>W.key.localeCompare(oe.key))),Or(N.conversation)}else{const N=await Uz(C,Ar.value,Ar.description);Lt($=>[...$.filter(W=>W.key!==N.key),N].sort((W,oe)=>W.key.localeCompare(oe.key)))}Pe("success",zn==="workspace"?"Workspace environment saved":"Base environment saved"),Aa({description:"",key:"",value:""}),Hs(null),oa(N=>{const $=new Set(N);return $.delete(C),$}),ee("connected")}catch(N){console.error(N),ee("error"),Pe("error","Failed to save environment")}}async function fo(x){try{if(zn==="workspace"&&Ft){const C=await Gz(Ft,x);mt(N=>N.filter($=>$.key!==x)),Or(C)}else await Pz(x),Lt(C=>C.filter(N=>N.key!==x));du===x&&(Aa({description:"",key:"",value:""}),Hs(null),oa(C=>{const N=new Set(C);return N.delete(x),N})),ee("connected"),Pe("success",zn==="workspace"?"Workspace environment deleted":"Base environment deleted")}catch(C){console.error(C),ee("error"),Pe("error","Failed to delete environment")}}async function ho(x,C){if(C.preventDefault(),!rn.name.trim()){Pe("error","Knowledge name is required");return}const N=Rz(rn);try{const $=rn.id?await Yz(x,rn.id,N):await Vz(x,N);cr(W=>[...W.filter(oe=>oe.id!==$.id),$].sort(S5)),gn(Cc),ee("connected"),Pe("success","Workspace knowledge saved")}catch($){console.error($),ee("error"),Pe("error","Failed to save workspace knowledge")}}async function Ru(x,C){try{await Wz(x,C),cr(N=>N.filter($=>$.id!==C)),rn.id===C&&gn(Cc),ee("connected"),Pe("success","Workspace knowledge deleted")}catch(N){console.error(N),ee("error"),Pe("error","Failed to delete workspace knowledge")}}function xi(x){sa("workspace"),gn(Oz(x))}function x0(x){Aa({description:x.description,key:x.key,value:""}),Hs(x.key),oa(C=>{const N=new Set(C);return N.delete(x.key),N}),b0(x.key,{preserveTypedValue:!0})}function mo(){const x=du;Aa({description:"",key:"",value:""}),Hs(null),x&&oa(C=>{const N=new Set(C);return N.delete(x),N})}async function sl(x){await b0(x)}async function b0(x,C={}){try{const N=zn==="workspace"&&Ft?await Fz(Ft,x):await $z(x);Aa($=>$.key===x&&(!C.preserveTypedValue||$.value.length===0)?{...$,value:N}:$),oa($=>new Set($).add(x)),ee("connected")}catch(N){console.error(N),ee("error")}}async function tn(x){const C=await Ko(x);ms(C)}async function po(x){try{const C=await Ko(x);dl(C)}catch(C){console.warn("Failed to synchronize timeline before turn stream",C)}}function ya(){Ze&&U({sourceId:Ze.id,name:`${Ze.title} - Clone`,groupId:Ze.groupId})}async function w0(x){if(x.preventDefault(),!(!B||!B.name.trim())){L(!0);try{const C=await Qz(B.sourceId,B.name.trim(),B.groupId);g(N=>{const $=[C.conversation,...N];return zc(l,F3(Fo(l),C.conversation.id,$.map(W=>W.id))),zl(l,$)}),T(C.conversation.id),U(null),ie(!1),Pe(C.error?"error":"success",C.error?"Clone created, initialization failed":"Workspace cloned",C.error??void 0)}catch(C){Pe("error","Clone failed",pt(C).detail??pt(C).message)}finally{L(!1)}}}async function go(){if(Ze)try{const x=await Jz(Ze.id);Or(x.conversation),Pe(x.error?"error":"success",x.error?"Clone retry failed":"Clone initialization restarted",x.error??void 0)}catch(x){Pe("error","Clone retry failed",pt(x).detail??pt(x).message)}}async function Ba(x,C={}){var De,Be,Mt,qt;const N=Q[x];if(!((De=N==null?void 0:N.history)!=null&&De.hasMoreBefore)||N.loadingOlder||Ra.current.has(x))return;const $=(Be=N==null?void 0:N.history)==null?void 0:Be.oldestTimelineAt,W=(Mt=N==null?void 0:N.history)==null?void 0:Mt.oldestTimelineSequence,oe=$&&W!==null&&W!==void 0?`${$}|${W}`:W==null?(qt=N==null?void 0:N.history)==null?void 0:qt.oldestMessageCreatedAt:String(W),je=ui.current;if(!oe||!je)return;if(C.preserveAnchor??!0){const Bn=PE(je);Nr.current={anchorOffset:Bn.anchorOffset,conversationId:x,previousScrollHeight:je.scrollHeight,anchorTurnId:Bn.anchorTurnId}}else Nr.current=null;Ra.current.add(x),Et(x,Bn=>({...Bn,loadingOlder:!0}));try{const Bn=await Ko(x,{before:oe,limit:rx});Hu(Bn)}catch(Bn){console.error(Bn),Nr.current=null}finally{Ra.current.delete(x),Et(x,Bn=>({...Bn,loadingOlder:!1}))}}async function Ou(x,C){const N=await Zz(x,C||void 0);g($=>{const W=[N,...$];return zc(l,F3(Fo(l),N.id,W.map(oe=>oe.id))),zl(l,W)}),T(N.id),ie(!1)}function yo(x){x!==ci.current&&(F(C=>{if(!(x in C))return C;const N={...C};return delete N[x],N}),T(x))}function Iu(){ie(!1),fe({mode:"create",groupId:null,title:""})}function _u(x){fe({mode:"rename",groupId:x.id,title:x.title})}function nr(){var x;ie(!1),
|
|
354
|
+
This clears Workspace Memory and creates a new Codex thread without restored history. Workspace files, Timeline, metadata, and Base Memory remain intact.`)){Yl(!0),za(null);try{const W=await k5(x.id),oe=await w5(x.id,{warmup:!1,previewFingerprint:W.fingerprint,selectedEntryIds:[],clearWorkspaceMemory:!0,saveSelection:!1});za(oe),kn(null),Ft===x.id&&Us({memory:"",items:[]}),ee("connected"),await tn(x.id),await Yn(),Pe("success","Workspace started from blank context")}catch(W){console.error(W),ee("error");const oe=pt(W);Pe("error","Failed to clear workspace context",oe.detail??oe.message)}finally{Yl(!1)}}}async function Mr(x){const C=Xr,N=Ln;if(!C||!N||N.conversationId!==C.id)throw new Error("Reset preview is no longer current.");try{await Az(C.id,{previewFingerprint:N.fingerprint,selectedEntryIds:x}),ee("connected")}catch($){console.error($),ee("error");const W=pt($);throw Pe("error","Failed to save reset defaults",W.detail??W.message),$}}async function co(x,C){try{const N=await b5(x,{[C]:null});ai(N.settings),Gl(N.settings.effective),Or(N.conversation),ee("connected"),Pe("success","Workspace override reset")}catch(N){console.error(N),ee("error"),Pe("error","Failed to reset workspace override")}}async function mr(x){try{const C=await qz({memory:Bz(x),items:x});return uu(C),qs(C),ee("connected"),Pe("success","Base memory saved"),C.items}catch(C){throw console.error(C),ee("error"),Pe("error","Failed to save memory"),C}}async function ll(x,C){try{const N=await qd(x,{memoryItems:C});return Or(N),Us({memory:N.memory,items:N.memoryItems}),ee("connected"),Pe("success","Workspace memory saved"),N.memoryItems}catch(N){throw console.error(N),ee("error"),Pe("error","Failed to save memory"),N}}async function Du(x){x.preventDefault();const C=Ar.key.trim();if(C)try{if(zn==="workspace"&&Ft){const N=await Hz(Ft,C,Ar.value,Ar.description);mt($=>[...$.filter(W=>W.key!==N.variable.key),N.variable].sort((W,oe)=>W.key.localeCompare(oe.key))),Or(N.conversation)}else{const N=await Uz(C,Ar.value,Ar.description);Lt($=>[...$.filter(W=>W.key!==N.key),N].sort((W,oe)=>W.key.localeCompare(oe.key)))}Pe("success",zn==="workspace"?"Workspace environment saved":"Base environment saved"),Aa({description:"",key:"",value:""}),Hs(null),oa(N=>{const $=new Set(N);return $.delete(C),$}),ee("connected")}catch(N){console.error(N),ee("error"),Pe("error","Failed to save environment")}}async function fo(x){try{if(zn==="workspace"&&Ft){const C=await Gz(Ft,x);mt(N=>N.filter($=>$.key!==x)),Or(C)}else await Pz(x),Lt(C=>C.filter(N=>N.key!==x));du===x&&(Aa({description:"",key:"",value:""}),Hs(null),oa(C=>{const N=new Set(C);return N.delete(x),N})),ee("connected"),Pe("success",zn==="workspace"?"Workspace environment deleted":"Base environment deleted")}catch(C){console.error(C),ee("error"),Pe("error","Failed to delete environment")}}async function ho(x,C){if(C.preventDefault(),!rn.name.trim()){Pe("error","Knowledge name is required");return}const N=Rz(rn);try{const $=rn.id?await Yz(x,rn.id,N):await Vz(x,N);cr(W=>[...W.filter(oe=>oe.id!==$.id),$].sort(S5)),gn(Cc),ee("connected"),Pe("success","Workspace knowledge saved")}catch($){console.error($),ee("error"),Pe("error","Failed to save workspace knowledge")}}async function Ru(x,C){try{await Wz(x,C),cr(N=>N.filter($=>$.id!==C)),rn.id===C&&gn(Cc),ee("connected"),Pe("success","Workspace knowledge deleted")}catch(N){console.error(N),ee("error"),Pe("error","Failed to delete workspace knowledge")}}function xi(x){sa("workspace"),gn(Oz(x))}function x0(x){Aa({description:x.description,key:x.key,value:""}),Hs(x.key),oa(C=>{const N=new Set(C);return N.delete(x.key),N}),b0(x.key,{preserveTypedValue:!0})}function mo(){const x=du;Aa({description:"",key:"",value:""}),Hs(null),x&&oa(C=>{const N=new Set(C);return N.delete(x),N})}async function sl(x){await b0(x)}async function b0(x,C={}){try{const N=zn==="workspace"&&Ft?await Fz(Ft,x):await $z(x);Aa($=>$.key===x&&(!C.preserveTypedValue||$.value.length===0)?{...$,value:N}:$),oa($=>new Set($).add(x)),ee("connected")}catch(N){console.error(N),ee("error")}}async function tn(x){const C=await Ko(x);ms(C)}async function po(x){try{const C=await Ko(x);dl(C)}catch(C){console.warn("Failed to synchronize timeline before turn stream",C)}}function ya(){Ze&&U({sourceId:Ze.id,name:`${Ze.title} - Clone`,groupId:Ze.groupId,excludeTopicHistory:!1})}async function w0(x){if(x.preventDefault(),!(!B||!B.name.trim())){L(!0);try{const C=await Qz(B.sourceId,B.name.trim(),B.groupId,B.excludeTopicHistory);g(N=>{const $=[C.conversation,...N];return zc(l,F3(Fo(l),C.conversation.id,$.map(W=>W.id))),zl(l,$)}),T(C.conversation.id),U(null),ie(!1),Pe(C.error?"error":"success",C.error?"Clone created, initialization failed":"Workspace cloned",C.error??void 0)}catch(C){Pe("error","Clone failed",pt(C).detail??pt(C).message)}finally{L(!1)}}}async function go(){if(Ze)try{const x=await Jz(Ze.id);Or(x.conversation),Pe(x.error?"error":"success",x.error?"Clone retry failed":"Clone initialization restarted",x.error??void 0)}catch(x){Pe("error","Clone retry failed",pt(x).detail??pt(x).message)}}async function Ba(x,C={}){var De,Be,Mt,qt;const N=Q[x];if(!((De=N==null?void 0:N.history)!=null&&De.hasMoreBefore)||N.loadingOlder||Ra.current.has(x))return;const $=(Be=N==null?void 0:N.history)==null?void 0:Be.oldestTimelineAt,W=(Mt=N==null?void 0:N.history)==null?void 0:Mt.oldestTimelineSequence,oe=$&&W!==null&&W!==void 0?`${$}|${W}`:W==null?(qt=N==null?void 0:N.history)==null?void 0:qt.oldestMessageCreatedAt:String(W),je=ui.current;if(!oe||!je)return;if(C.preserveAnchor??!0){const Bn=PE(je);Nr.current={anchorOffset:Bn.anchorOffset,conversationId:x,previousScrollHeight:je.scrollHeight,anchorTurnId:Bn.anchorTurnId}}else Nr.current=null;Ra.current.add(x),Et(x,Bn=>({...Bn,loadingOlder:!0}));try{const Bn=await Ko(x,{before:oe,limit:rx});Hu(Bn)}catch(Bn){console.error(Bn),Nr.current=null}finally{Ra.current.delete(x),Et(x,Bn=>({...Bn,loadingOlder:!1}))}}async function Ou(x,C){const N=await Zz(x,C||void 0);g($=>{const W=[N,...$];return zc(l,F3(Fo(l),N.id,W.map(oe=>oe.id))),zl(l,W)}),T(N.id),ie(!1)}function yo(x){x!==ci.current&&(F(C=>{if(!(x in C))return C;const N={...C};return delete N[x],N}),T(x))}function Iu(){ie(!1),fe({mode:"create",groupId:null,title:""})}function _u(x){fe({mode:"rename",groupId:x.id,title:x.title})}function nr(){var x;ie(!1),re({mode:"create",conversationId:null,title:"",groupId:(Ze==null?void 0:Ze.groupId)??((x=v[0])==null?void 0:x.id)})}async function ol(x){var C;if(x.status!=="running"){$t(!0);try{await eD(x.id),F($=>{const W={...$};return delete W[x.id],W});const N=ts.current.filter($=>$.id!==x.id);if(zc(l,hE(Fo(l),x.id)),sp(l,x.id,""),g(N),b===x.id){const $=((C=N[0])==null?void 0:C.id)??null;lp(l,$),T($)}(Ae==null?void 0:Ae.conversationId)===x.id&&Zr(),wt(null),Pe("success","Workspace moved to recycle")}catch(N){const $=pt(N);Pe("error","Failed to move workspace to recycle",$.detail??$.message)}finally{$t(!1)}}}async function ul(x){if(!(x.id===Y3||!window.confirm(`Delete group "${x.title}"?
|
|
355
355
|
|
|
356
|
-
Workspaces in this group will move to Default.`)))try{const N=await nz(x.id),$=Dd(l,N.groups);k($),up(l,$);const W=zl(l,N.conversations);g(W),Rd(l,W),Xl(oe=>{const je=new Set(oe);return je.delete(x.id),op(l,je),je})}catch(N){console.error(N)}}function vo(x){ne({mode:"rename",conversationId:x.id,title:x.title})}function Zr(){_e(!1),ne(null)}function Hn(){fe(null)}async function pr(x,C){const N=C.trim(),$=m.find(oe=>oe.id===x);if(!$||!N||N===$.title){Zr();return}const W=await qd(x,{title:N});Or(W),Zr()}function va(x){return x instanceof HTMLInputElement||x instanceof HTMLTextAreaElement}function zr(x){return x instanceof Element&&!!x.closest("input, button")}function Qr(x,C){const N=document.elementFromPoint(x,C);return N instanceof HTMLElement?N.closest(".session-item[data-workspace-id]"):null}function Jr(x,C){const N=document.elementFromPoint(x,C);return N instanceof HTMLElement?N.closest(".workspace-group[data-group-id]"):null}function k0(x,C,N){const $=Qr(C,N),W=$==null?void 0:$.dataset.workspaceId;if($&&W&&W!==x){fa({kind:"workspace",id:W,position:XE($,N)});return}const oe=Jr(C,N),je=oe==null?void 0:oe.dataset.groupId;if(!je){fa(null);return}fa({kind:"group",id:je})}function Lu(x,C){if(!x.isPrimary||x.button!==0||zr(x.target))return;x.pointerType!=="touch"&&x.currentTarget.setPointerCapture(x.pointerId),Qs.current={id:C,pointerId:x.pointerId,startX:x.clientX,startY:x.clientY};const N=x.currentTarget,$=x.pointerId;Xs.begin(x,()=>{N.isConnected&&(N.setPointerCapture($),Er(C),fa(null))})}function Bu(x,C){const N=Qs.current;if(!Xs.allows(x.pointerType)||!N||N.id!==C||N.pointerId!==x.pointerId)return;const $=Math.hypot(x.clientX-N.startX,x.clientY-N.startY);if(Yi!==C){if($<G3)return;Er(C),fa(null)}x.preventDefault(),er({x:x.clientX,y:x.clientY}),k0(C,x.clientX,x.clientY)}async function S0(x,C){var je;Xs.end(),Yi===C&&x.preventDefault(),x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId),Qs.current=null;const N=Yi===C;N&&(rs.current=!0);const $=Wr;if(!N||!$){Er(null),fa(null),er(null);return}const W=m.find(Ve=>Ve.id===C),oe=$.kind==="group"?$.id:(je=m.find(Ve=>Ve.id===$.id))==null?void 0:je.groupId;if(!W||!oe){Er(null),fa(null),er(null);return}if(g(Ve=>{const De=$.kind==="workspace"?ZE(Ve.map(Be=>Be.id===C?{...Be,groupId:oe}:Be),C,$.id,$.position):[...Ve.filter(Be=>Be.id!==C),{...W,groupId:oe}];return zc(l,P1(De.map(Be=>Be.id),Fo(l))),De}),W.groupId!==oe)try{const Ve=await qd(C,{groupId:oe});Or(Ve)}catch(Ve){console.error(Ve),await Yn()}Er(null),fa(null),er(null)}function Dn(x){Xs.end(),x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId),Qs.current=null,Er(null),fa(null),er(null)}function Wt(x,C){if(!x.isPrimary||x.button!==0)return;x.pointerType!=="touch"&&x.currentTarget.setPointerCapture(x.pointerId),Js.current={id:C,pointerId:x.pointerId,startX:x.clientX,startY:x.clientY};const N=x.currentTarget,$=x.pointerId;Zs.begin(x,()=>{N.isConnected&&(N.setPointerCapture($),Kl(C),si(null))})}function yt(x,C){const N=Js.current;if(!Zs.allows(x.pointerType)||!N||N.id!==C||N.pointerId!==x.pointerId)return;const $=Math.hypot(x.clientX-N.startX,x.clientY-N.startY);if(mu!==C){if($<G3)return;Kl(C),si(null)}x.preventDefault();const W=Jr(x.clientX,x.clientY),oe=W==null?void 0:W.dataset.groupId;si(oe&&oe!==C?oe:null)}function qa(x,C){Zs.end(),x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId);const N=mu===C;N&&(x.preventDefault(),bu.current=!0);const $=pu;N&&$&&k(W=>{const oe=QE(W,C,$);return dx(l,oe.map(je=>je.id)),oe}),Js.current=null,Kl(null),si(null)}function gr(x){Zs.end(),x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId),Js.current=null,Kl(null),si(null)}function qu(x){const C=x.target.value;ne(N=>N&&{...N,title:C})}function Ua(x){const C=x.target.value;ne(N=>N&&{...N,groupId:C})}function j0(x){const C=x.target.value;fe(N=>N&&{...N,title:C})}async function C0(x){if(x.preventDefault(),!Ae)return;const C=Ae.title.trim();if(C){_e(!0);try{if(Ae.mode==="create"){await Ou(C,Ae.groupId),Zr();return}Ae.conversationId&&await pr(Ae.conversationId,C)}catch(N){console.error(N);const $=pt(N);Pe("error",Ae.mode==="create"?"Failed to create workspace":"Failed to rename workspace",$.detail??$.message)}finally{_e(!1)}}}function xa(x){x.key==="Escape"&&(x.preventDefault(),x.stopPropagation(),Zr())}async function bi(x){if(x.preventDefault(),!tt)return;const C=tt.title.trim();if(C)try{if(tt.mode==="rename"){if(!tt.groupId)return;const $=await tz(tt.groupId,{title:C});k(W=>W.map(oe=>oe.id===$.id?$:oe)),Hn();return}const N=await ez(C);k($=>[...$,N]),Xl($=>{const W=new Set($);return W.delete(N.id),op(l,W),W}),Hn()}catch(N){console.error(N)}}function fs(x){x.key==="Escape"&&(x.preventDefault(),x.stopPropagation(),Hn())}async function hs(x){x.preventDefault(),await xo()}function Uu(x){b&&Oa.current.set(b,(Oa.current.get(b)??0)+1),c(x),sp(l,b,x)}function Dr(x,C,N){const $={conversationId:x,version:N};if(!q3($,{conversationId:x,version:Oa.current.get(x)??0}))return;sp(l,x,"");const W=ci.current;W&&q3($,{conversationId:W,version:Oa.current.get(W)??0})&&c(oe=>oe.trim()===C?"":oe)}function ba(x){if(Qi.current.has(x))return null;const C=Symbol(x);return Qi.current.set(x,C),h(N=>{const $=new Set(N);return $.add(x),$}),C}function Wn(x,C){Qi.current.get(x)===C&&(Qi.current.delete(x),h(N=>{const $=new Set(N);return $.delete(x),$}))}function Rr(x){const C=pt(x);Pe("error","Message was not confirmed",`${C.message}. Your text is still in the composer and can be retried.`)}async function xo(x={}){const C=o.trim();if(!C)return;const N=b,$=iE({hasConversation:N!==null,messageSubmitting:N!==null&&Qi.current.has(N),hasActiveTurn:N!==null&&hr.current.has(N),hasConfirmedCurrentTurn:N!==null&&Ji.current.has(N)},!!x.forceNewTurn);if($==="create-workspace"){nr();return}if($==="blocked"||!N)return;const W=Oa.current.get(N)??0,oe=ba(N);if(!oe)return;if($==="queue-turn"){await wi(N,C,W,oe);return}if($==="steer-turn"){await Rn(N,C,W,oe);return}const je=`local-${Date.now()}`;Et(N,De=>({...De,messages:[...De.messages,{id:je,role:"user",content:C,createdAt:new Date().toISOString()}],status:"running"})),Fa(N,"running"),$n(N,!0);let Ve=!1;try{let De=null;const Be=ze(`conversations/${N}/turns`),Mt=await fetch(Be,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:C,receiptOnly:!0})});if(Mt.ok){const qt=await Mt.json();if(qt.inputId&&qt.message){cl(N,je,qt.message),Ve=!0,Dr(N,C,W),Wn(N,oe),$n(N,!1),Ha(N,{waitMs:15e3});return}if(!qt.turnId)throw new Error("Turn did not return a turn id");if(De=qt.turnId,!qt.message)throw new Error("Turn did not return the persisted message");cl(N,je,qt.message,De),Ve=!0,Dr(N,C,W)}else{const qt=await LE(Mt);if(qt){De=qt;const Bn=await wo(N,qt,C);if(!Bn.ok)throw await Xn(Bn,{method:"POST",url:ze(`conversations/${N}/turns/${qt}/steer`)});const ka=await Bn.json();if(!ka.message)throw new Error("Steer did not return the persisted message");cl(N,je,ka.message,qt),Ve=!0,Dr(N,C,W)}else throw await Xn(Mt,{method:"POST",url:Be})}if(!De)throw await Xn(Mt,{method:"POST",url:Be});$a(N,De),Wn(N,oe)}catch(De){Ve||Rr(De);const Be=_E(De);Be&&Pe("error","Reset thread required","This thread does not support the required Seele tools. Reset this workspace thread and try again."),Et(N,Mt=>({...Mt,status:"error",messages:Ve?Mt.messages:Mt.messages.filter(qt=>qt.id!==je),events:[...Mt.events,{id:Mt.events.length+1,event:"client.error",data:Be?{message:"Reset thread required",detail:"This thread does not support the required Seele tools. Reset this workspace thread and try again."}:Ss(De),createdAt:new Date().toISOString()}]})),Fa(N,"error"),$n(N,!1),await Yn()}finally{Wn(N,oe)}}async function bo(x){const C=el.current.get(x)??[];if(C.length===0)return;const[N,...$]=C;el.current.set(x,$),await $a(x,N)}async function Ha(x,C={}){if(tl.current.has(x)||fr.current.has(x))return;ss(x),ns.current.delete(x);const N=new AbortController;fr.current.set(x,N),$n(x,!0);try{const $=C.waitMs?`?waitMs=${C.waitMs}`:"",W=ze(`conversations/${x}/turns/current/events${$}`),oe=await fetch(W,{signal:N.signal});if(!oe.ok||!oe.body)throw await Xn(oe,{method:"GET",url:W});al(x),Ji.current.add(x),await po(x),await N5(oe.body,je=>{const Ve=u5(je,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);Ve.turnId&&!hr.current.has(x)&&hr.current.set(x,Ve.turnId),Et(x,Be=>({...Be,status:Ud(Ve)??Be.status,events:o5(Be.events,Ve)}));const De=Ud(Ve);De&&Fa(x,De)}),await tn(x),await Yn()}catch($){if(!d5($)){if(IE($)){fr.current.get(x)===N&&ju(x);return}Et(x,W=>({...W,status:"error",events:[...W.events,{id:W.events.length+1,event:"client.error",data:Ss($),createdAt:new Date().toISOString()}]}))}}finally{fr.current.get(x)===N&&(Ji.current.delete(x),hr.current.delete(x),fr.current.delete(x),$n(x,!1),await bo(x))}}async function $a(x,C,N={}){const $=hr.current.get(x);if($===C)return;if($||fr.current.has(x)){const oe=el.current.get(x)??[];oe.includes(C)||el.current.set(x,[...oe,C]);return}al(x);const W=new AbortController;fr.current.set(x,W),hr.current.set(x,C),$n(x,!0);try{const oe=ze(`conversations/${x}/turns/${C}/events`),je=await fetch(oe,{signal:W.signal});if(!je.ok||!je.body)throw await Xn(je,{method:"GET",url:oe});await po(x),await N5(je.body,Ve=>{const De=u5(Ve,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);Et(x,Mt=>({...Mt,status:Ud(De)??Mt.status,events:o5(Mt.events,De)}));const Be=Ud(De);Be&&Fa(x,Be)}),await tn(x),await Yn()}catch(oe){if(!d5(oe)){if(N.recovered&&OE(oe)){await tn(x),await Yn();return}Et(x,je=>({...je,status:"error",events:[...je.events,{id:je.events.length+1,event:"client.error",data:Ss(oe),createdAt:new Date().toISOString()}]}))}}finally{fr.current.get(x)===W&&(hr.current.get(x)===C&&hr.current.delete(x),fr.current.delete(x),$n(x,!1),await bo(x))}}async function wi(x,C,N,$){let W=!1;const oe=`local-queued-${Date.now()}`;Et(x,je=>({...je,messages:[...je.messages,{id:oe,role:"user",content:C,createdAt:new Date().toISOString()}]}));try{const je=ze(`conversations/${x}/turns`),Ve=await fetch(je,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:C,mode:"queue",receiptOnly:!0})});if(!Ve.ok)throw await Xn(Ve,{method:"POST",url:je});const De=await Ve.json();if(!De.turnId&&!De.inputId)throw new Error("Queued turn did not return a turn id");if(!De.message)throw new Error("Queued turn did not return the persisted message");cl(x,oe,De.message,De.turnId),W=!0,Dr(x,C,N),De.turnId?$a(x,De.turnId):Ha(x,{waitMs:15e3}),Wn(x,$),await Yn(),Pe("success",De.inputId?"Message accepted":De.queuePosition?`Queued as next turn (${De.queuePosition})`:"Started new turn")}catch(je){W||Rr(je),Et(x,Ve=>({...Ve,messages:W?Ve.messages:Ve.messages.filter(De=>De.id!==oe),events:[...Ve.events,{id:Ve.events.length+1,event:"client.error",data:Ss(je),createdAt:new Date().toISOString()}]}))}finally{Wn(x,$)}}async function Rn(x,C,N,$){const W=hr.current.get(x);let oe=!1;const je=`local-steer-${Date.now()}`;Et(x,Ve=>({...Ve,messages:[...Ve.messages,{id:je,role:"user",content:C,createdAt:new Date().toISOString(),turnId:W??null}],status:"running"}));try{const Ve=ze(W?`conversations/${x}/turns/${W}/steer`:`conversations/${x}/turns/steer`),De=await fetch(Ve,K3(C));if(!De.ok)throw await Xn(De,{method:"POST",url:Ve});const Be=await De.json();if(!Be.message)throw new Error("Steer did not return the persisted message");cl(x,je,Be.message,W),oe=!0,Dr(x,C,N),Wn(x,$)}catch(Ve){Rr(Ve),Et(x,De=>({...De,messages:oe?De.messages:De.messages.filter(Be=>Be.id!==je),events:[...De.events,{id:De.events.length+1,event:"client.error",data:Ss(Ve),createdAt:new Date().toISOString()}]}))}finally{Wn(x,$)}}async function wo(x,C,N){return fetch(ze(`conversations/${x}/turns/${C}/steer`),K3(N))}function cl(x,C,N,$){Et(x,W=>({...W,messages:Pd(W.messages.filter(oe=>oe.id!==C),[{...N,turnId:$??N.turnId??null}])}))}async function Gf(){var $;if(!b||mi!=="running"&&mi!=="initializing"&&!ao)return;const x=b,C=mi,N=`client-stop-${Date.now()}`;h0(x),($=fr.current.get(x))==null||$.abort(),hr.current.delete(x),el.current.delete(x),$n(x,!1),Et(x,W=>({...W,status:"done",events:[...W.events,{id:N,event:"server.stop",data:{source:"client"},createdAt:new Date().toISOString()}]})),Fa(x,"done");try{const W=await T0(x);al(x),Et(x,oe=>({...oe,status:W})),Fa(x,W),Promise.all([tn(x),Yn()]).catch(oe=>{console.warn("Failed to refresh workspace after Stop",oe)})}catch(W){ju(x),Et(x,je=>({...je,status:C==="initializing"?"initializing":"running",events:[...je.events.filter(Ve=>Ve.id!==N),{id:je.events.length+1,event:"client.error",data:Ss(W),createdAt:new Date().toISOString()}]})),Fa(x,C==="initializing"?"initializing":"running");const oe=pt(W);Pe("error","Stop failed",oe.detail??oe.message);try{await Yn()}catch(je){console.warn("Failed to refresh workspace after Stop failed",je)}}}async function T0(x){const C=ze(`conversations/${x}/turns/interrupt`),N=await fetch(C,{method:"POST"});if(!N.ok)throw await Xn(N,{method:"POST",url:C});return dE(await N.json().catch(()=>null))}async function Vf(){var $;const x=Xr;if(!x){Pe("error","No workspace selected");return}if(!window.confirm(`Force stop and repair "${x.title}"?
|
|
356
|
+
Workspaces in this group will move to Default.`)))try{const N=await nz(x.id),$=Dd(l,N.groups);k($),up(l,$);const W=zl(l,N.conversations);g(W),Rd(l,W),Xl(oe=>{const je=new Set(oe);return je.delete(x.id),op(l,je),je})}catch(N){console.error(N)}}function vo(x){re({mode:"rename",conversationId:x.id,title:x.title})}function Zr(){_e(!1),re(null)}function Hn(){fe(null)}async function pr(x,C){const N=C.trim(),$=m.find(oe=>oe.id===x);if(!$||!N||N===$.title){Zr();return}const W=await qd(x,{title:N});Or(W),Zr()}function va(x){return x instanceof HTMLInputElement||x instanceof HTMLTextAreaElement}function zr(x){return x instanceof Element&&!!x.closest("input, button")}function Qr(x,C){const N=document.elementFromPoint(x,C);return N instanceof HTMLElement?N.closest(".session-item[data-workspace-id]"):null}function Jr(x,C){const N=document.elementFromPoint(x,C);return N instanceof HTMLElement?N.closest(".workspace-group[data-group-id]"):null}function k0(x,C,N){const $=Qr(C,N),W=$==null?void 0:$.dataset.workspaceId;if($&&W&&W!==x){fa({kind:"workspace",id:W,position:XE($,N)});return}const oe=Jr(C,N),je=oe==null?void 0:oe.dataset.groupId;if(!je){fa(null);return}fa({kind:"group",id:je})}function Lu(x,C){if(!x.isPrimary||x.button!==0||zr(x.target))return;x.pointerType!=="touch"&&x.currentTarget.setPointerCapture(x.pointerId),Qs.current={id:C,pointerId:x.pointerId,startX:x.clientX,startY:x.clientY};const N=x.currentTarget,$=x.pointerId;Xs.begin(x,()=>{N.isConnected&&(N.setPointerCapture($),Er(C),fa(null))})}function Bu(x,C){const N=Qs.current;if(!Xs.allows(x.pointerType)||!N||N.id!==C||N.pointerId!==x.pointerId)return;const $=Math.hypot(x.clientX-N.startX,x.clientY-N.startY);if(Yi!==C){if($<G3)return;Er(C),fa(null)}x.preventDefault(),er({x:x.clientX,y:x.clientY}),k0(C,x.clientX,x.clientY)}async function S0(x,C){var je;Xs.end(),Yi===C&&x.preventDefault(),x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId),Qs.current=null;const N=Yi===C;N&&(rs.current=!0);const $=Wr;if(!N||!$){Er(null),fa(null),er(null);return}const W=m.find(Ve=>Ve.id===C),oe=$.kind==="group"?$.id:(je=m.find(Ve=>Ve.id===$.id))==null?void 0:je.groupId;if(!W||!oe){Er(null),fa(null),er(null);return}if(g(Ve=>{const De=$.kind==="workspace"?ZE(Ve.map(Be=>Be.id===C?{...Be,groupId:oe}:Be),C,$.id,$.position):[...Ve.filter(Be=>Be.id!==C),{...W,groupId:oe}];return zc(l,P1(De.map(Be=>Be.id),Fo(l))),De}),W.groupId!==oe)try{const Ve=await qd(C,{groupId:oe});Or(Ve)}catch(Ve){console.error(Ve),await Yn()}Er(null),fa(null),er(null)}function Dn(x){Xs.end(),x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId),Qs.current=null,Er(null),fa(null),er(null)}function Wt(x,C){if(!x.isPrimary||x.button!==0)return;x.pointerType!=="touch"&&x.currentTarget.setPointerCapture(x.pointerId),Js.current={id:C,pointerId:x.pointerId,startX:x.clientX,startY:x.clientY};const N=x.currentTarget,$=x.pointerId;Zs.begin(x,()=>{N.isConnected&&(N.setPointerCapture($),Kl(C),si(null))})}function yt(x,C){const N=Js.current;if(!Zs.allows(x.pointerType)||!N||N.id!==C||N.pointerId!==x.pointerId)return;const $=Math.hypot(x.clientX-N.startX,x.clientY-N.startY);if(mu!==C){if($<G3)return;Kl(C),si(null)}x.preventDefault();const W=Jr(x.clientX,x.clientY),oe=W==null?void 0:W.dataset.groupId;si(oe&&oe!==C?oe:null)}function qa(x,C){Zs.end(),x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId);const N=mu===C;N&&(x.preventDefault(),bu.current=!0);const $=pu;N&&$&&k(W=>{const oe=QE(W,C,$);return dx(l,oe.map(je=>je.id)),oe}),Js.current=null,Kl(null),si(null)}function gr(x){Zs.end(),x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId),Js.current=null,Kl(null),si(null)}function qu(x){const C=x.target.value;re(N=>N&&{...N,title:C})}function Ua(x){const C=x.target.value;re(N=>N&&{...N,groupId:C})}function j0(x){const C=x.target.value;fe(N=>N&&{...N,title:C})}async function C0(x){if(x.preventDefault(),!Ae)return;const C=Ae.title.trim();if(C){_e(!0);try{if(Ae.mode==="create"){await Ou(C,Ae.groupId),Zr();return}Ae.conversationId&&await pr(Ae.conversationId,C)}catch(N){console.error(N);const $=pt(N);Pe("error",Ae.mode==="create"?"Failed to create workspace":"Failed to rename workspace",$.detail??$.message)}finally{_e(!1)}}}function xa(x){x.key==="Escape"&&(x.preventDefault(),x.stopPropagation(),Zr())}async function bi(x){if(x.preventDefault(),!tt)return;const C=tt.title.trim();if(C)try{if(tt.mode==="rename"){if(!tt.groupId)return;const $=await tz(tt.groupId,{title:C});k(W=>W.map(oe=>oe.id===$.id?$:oe)),Hn();return}const N=await ez(C);k($=>[...$,N]),Xl($=>{const W=new Set($);return W.delete(N.id),op(l,W),W}),Hn()}catch(N){console.error(N)}}function fs(x){x.key==="Escape"&&(x.preventDefault(),x.stopPropagation(),Hn())}async function hs(x){x.preventDefault(),await xo()}function Uu(x){b&&Oa.current.set(b,(Oa.current.get(b)??0)+1),c(x),sp(l,b,x)}function Dr(x,C,N){const $={conversationId:x,version:N};if(!q3($,{conversationId:x,version:Oa.current.get(x)??0}))return;sp(l,x,"");const W=ci.current;W&&q3($,{conversationId:W,version:Oa.current.get(W)??0})&&c(oe=>oe.trim()===C?"":oe)}function ba(x){if(Qi.current.has(x))return null;const C=Symbol(x);return Qi.current.set(x,C),h(N=>{const $=new Set(N);return $.add(x),$}),C}function Wn(x,C){Qi.current.get(x)===C&&(Qi.current.delete(x),h(N=>{const $=new Set(N);return $.delete(x),$}))}function Rr(x){const C=pt(x);Pe("error","Message was not confirmed",`${C.message}. Your text is still in the composer and can be retried.`)}async function xo(x={}){const C=o.trim();if(!C)return;const N=b,$=iE({hasConversation:N!==null,messageSubmitting:N!==null&&Qi.current.has(N),hasActiveTurn:N!==null&&hr.current.has(N),hasConfirmedCurrentTurn:N!==null&&Ji.current.has(N)},!!x.forceNewTurn);if($==="create-workspace"){nr();return}if($==="blocked"||!N)return;const W=Oa.current.get(N)??0,oe=ba(N);if(!oe)return;if($==="queue-turn"){await wi(N,C,W,oe);return}if($==="steer-turn"){await Rn(N,C,W,oe);return}const je=`local-${Date.now()}`;Et(N,De=>({...De,messages:[...De.messages,{id:je,role:"user",content:C,createdAt:new Date().toISOString()}],status:"running"})),Fa(N,"running"),$n(N,!0);let Ve=!1;try{let De=null;const Be=ze(`conversations/${N}/turns`),Mt=await fetch(Be,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:C,receiptOnly:!0})});if(Mt.ok){const qt=await Mt.json();if(qt.inputId&&qt.message){cl(N,je,qt.message),Ve=!0,Dr(N,C,W),Wn(N,oe),$n(N,!1),Ha(N,{waitMs:15e3});return}if(!qt.turnId)throw new Error("Turn did not return a turn id");if(De=qt.turnId,!qt.message)throw new Error("Turn did not return the persisted message");cl(N,je,qt.message,De),Ve=!0,Dr(N,C,W)}else{const qt=await LE(Mt);if(qt){De=qt;const Bn=await wo(N,qt,C);if(!Bn.ok)throw await Xn(Bn,{method:"POST",url:ze(`conversations/${N}/turns/${qt}/steer`)});const ka=await Bn.json();if(!ka.message)throw new Error("Steer did not return the persisted message");cl(N,je,ka.message,qt),Ve=!0,Dr(N,C,W)}else throw await Xn(Mt,{method:"POST",url:Be})}if(!De)throw await Xn(Mt,{method:"POST",url:Be});$a(N,De),Wn(N,oe)}catch(De){Ve||Rr(De);const Be=_E(De);Be&&Pe("error","Reset thread required","This thread does not support the required Seele tools. Reset this workspace thread and try again."),Et(N,Mt=>({...Mt,status:"error",messages:Ve?Mt.messages:Mt.messages.filter(qt=>qt.id!==je),events:[...Mt.events,{id:Mt.events.length+1,event:"client.error",data:Be?{message:"Reset thread required",detail:"This thread does not support the required Seele tools. Reset this workspace thread and try again."}:Ss(De),createdAt:new Date().toISOString()}]})),Fa(N,"error"),$n(N,!1),await Yn()}finally{Wn(N,oe)}}async function bo(x){const C=el.current.get(x)??[];if(C.length===0)return;const[N,...$]=C;el.current.set(x,$),await $a(x,N)}async function Ha(x,C={}){if(tl.current.has(x)||fr.current.has(x))return;ss(x),ns.current.delete(x);const N=new AbortController;fr.current.set(x,N),$n(x,!0);try{const $=C.waitMs?`?waitMs=${C.waitMs}`:"",W=ze(`conversations/${x}/turns/current/events${$}`),oe=await fetch(W,{signal:N.signal});if(!oe.ok||!oe.body)throw await Xn(oe,{method:"GET",url:W});al(x),Ji.current.add(x),await po(x),await N5(oe.body,je=>{const Ve=u5(je,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);Ve.turnId&&!hr.current.has(x)&&hr.current.set(x,Ve.turnId),Et(x,Be=>({...Be,status:Ud(Ve)??Be.status,events:o5(Be.events,Ve)}));const De=Ud(Ve);De&&Fa(x,De)}),await tn(x),await Yn()}catch($){if(!d5($)){if(IE($)){fr.current.get(x)===N&&ju(x);return}Et(x,W=>({...W,status:"error",events:[...W.events,{id:W.events.length+1,event:"client.error",data:Ss($),createdAt:new Date().toISOString()}]}))}}finally{fr.current.get(x)===N&&(Ji.current.delete(x),hr.current.delete(x),fr.current.delete(x),$n(x,!1),await bo(x))}}async function $a(x,C,N={}){const $=hr.current.get(x);if($===C)return;if($||fr.current.has(x)){const oe=el.current.get(x)??[];oe.includes(C)||el.current.set(x,[...oe,C]);return}al(x);const W=new AbortController;fr.current.set(x,W),hr.current.set(x,C),$n(x,!0);try{const oe=ze(`conversations/${x}/turns/${C}/events`),je=await fetch(oe,{signal:W.signal});if(!je.ok||!je.body)throw await Xn(je,{method:"GET",url:oe});await po(x),await N5(je.body,Ve=>{const De=u5(Ve,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);Et(x,Mt=>({...Mt,status:Ud(De)??Mt.status,events:o5(Mt.events,De)}));const Be=Ud(De);Be&&Fa(x,Be)}),await tn(x),await Yn()}catch(oe){if(!d5(oe)){if(N.recovered&&OE(oe)){await tn(x),await Yn();return}Et(x,je=>({...je,status:"error",events:[...je.events,{id:je.events.length+1,event:"client.error",data:Ss(oe),createdAt:new Date().toISOString()}]}))}}finally{fr.current.get(x)===W&&(hr.current.get(x)===C&&hr.current.delete(x),fr.current.delete(x),$n(x,!1),await bo(x))}}async function wi(x,C,N,$){let W=!1;const oe=`local-queued-${Date.now()}`;Et(x,je=>({...je,messages:[...je.messages,{id:oe,role:"user",content:C,createdAt:new Date().toISOString()}]}));try{const je=ze(`conversations/${x}/turns`),Ve=await fetch(je,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:C,mode:"queue",receiptOnly:!0})});if(!Ve.ok)throw await Xn(Ve,{method:"POST",url:je});const De=await Ve.json();if(!De.turnId&&!De.inputId)throw new Error("Queued turn did not return a turn id");if(!De.message)throw new Error("Queued turn did not return the persisted message");cl(x,oe,De.message,De.turnId),W=!0,Dr(x,C,N),De.turnId?$a(x,De.turnId):Ha(x,{waitMs:15e3}),Wn(x,$),await Yn(),Pe("success",De.inputId?"Message accepted":De.queuePosition?`Queued as next turn (${De.queuePosition})`:"Started new turn")}catch(je){W||Rr(je),Et(x,Ve=>({...Ve,messages:W?Ve.messages:Ve.messages.filter(De=>De.id!==oe),events:[...Ve.events,{id:Ve.events.length+1,event:"client.error",data:Ss(je),createdAt:new Date().toISOString()}]}))}finally{Wn(x,$)}}async function Rn(x,C,N,$){const W=hr.current.get(x);let oe=!1;const je=`local-steer-${Date.now()}`;Et(x,Ve=>({...Ve,messages:[...Ve.messages,{id:je,role:"user",content:C,createdAt:new Date().toISOString(),turnId:W??null}],status:"running"}));try{const Ve=ze(W?`conversations/${x}/turns/${W}/steer`:`conversations/${x}/turns/steer`),De=await fetch(Ve,K3(C));if(!De.ok)throw await Xn(De,{method:"POST",url:Ve});const Be=await De.json();if(!Be.message)throw new Error("Steer did not return the persisted message");cl(x,je,Be.message,W),oe=!0,Dr(x,C,N),Wn(x,$)}catch(Ve){Rr(Ve),Et(x,De=>({...De,messages:oe?De.messages:De.messages.filter(Be=>Be.id!==je),events:[...De.events,{id:De.events.length+1,event:"client.error",data:Ss(Ve),createdAt:new Date().toISOString()}]}))}finally{Wn(x,$)}}async function wo(x,C,N){return fetch(ze(`conversations/${x}/turns/${C}/steer`),K3(N))}function cl(x,C,N,$){Et(x,W=>({...W,messages:Pd(W.messages.filter(oe=>oe.id!==C),[{...N,turnId:$??N.turnId??null}])}))}async function Gf(){var $;if(!b||mi!=="running"&&mi!=="initializing"&&!ao)return;const x=b,C=mi,N=`client-stop-${Date.now()}`;h0(x),($=fr.current.get(x))==null||$.abort(),hr.current.delete(x),el.current.delete(x),$n(x,!1),Et(x,W=>({...W,status:"done",events:[...W.events,{id:N,event:"server.stop",data:{source:"client"},createdAt:new Date().toISOString()}]})),Fa(x,"done");try{const W=await T0(x);al(x),Et(x,oe=>({...oe,status:W})),Fa(x,W),Promise.all([tn(x),Yn()]).catch(oe=>{console.warn("Failed to refresh workspace after Stop",oe)})}catch(W){ju(x),Et(x,je=>({...je,status:C==="initializing"?"initializing":"running",events:[...je.events.filter(Ve=>Ve.id!==N),{id:je.events.length+1,event:"client.error",data:Ss(W),createdAt:new Date().toISOString()}]})),Fa(x,C==="initializing"?"initializing":"running");const oe=pt(W);Pe("error","Stop failed",oe.detail??oe.message);try{await Yn()}catch(je){console.warn("Failed to refresh workspace after Stop failed",je)}}}async function T0(x){const C=ze(`conversations/${x}/turns/interrupt`),N=await fetch(C,{method:"POST"});if(!N.ok)throw await Xn(N,{method:"POST",url:C});return dE(await N.json().catch(()=>null))}async function Vf(){var $;const x=Xr;if(!x){Pe("error","No workspace selected");return}if(!window.confirm(`Force stop and repair "${x.title}"?
|
|
357
357
|
|
|
358
|
-
This cancels every current or queued turn, kills its runtime, and repairs scheduler state. Future scheduled wakeups are preserved.`))return;const N=x.id;Fs(!0),h0(N),($=fr.current.get(N))==null||$.abort(),hr.current.delete(N),el.current.delete(N),$n(N,!1);try{const W=await T0(N);al(N),Et(N,oe=>({...oe,status:W})),Fa(N,W),await tn(N),await Yn(),Pe("success","Workspace stopped and repaired")}catch(W){ju(N);const oe=pt(W);Pe("error","Force stop failed",oe.detail??oe.message);try{await Yn()}catch(je){console.warn("Failed to refresh workspace after force Stop failed",je)}}finally{Fs(!1)}}async function Jt(x,C){if(!b||!x.approvalTurnId||x.approvalRequestId===void 0)return;const N=b;try{const $=ze(`conversations/${N}/turns/${x.approvalTurnId}/approvals/${encodeURIComponent(String(x.approvalRequestId))}`),W=await fetch($,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:C})});if(!W.ok)throw await Xn(W,{method:"POST",url:$});Et(N,oe=>({...oe,events:[...oe.events,{id:oe.events.length+1,event:"server.approval.decision",data:{requestId:x.approvalRequestId,decision:C,source:"client"},createdAt:new Date().toISOString()}]}))}catch($){Et(N,oe=>({...oe,events:[...oe.events,{id:oe.events.length+1,event:"client.error",data:Ss($),createdAt:new Date().toISOString()}]}));const W=pt($);Pe("error","Failed to respond to approval",W.detail??W.message)}}async function ki(x,C,N){const $=b,W=x.workspaceChangeProposalId??x.responsibilityProposalId;if(!$||!W)return!1;try{const oe=ze(`conversations/${$}/workspace-change-proposals/${encodeURIComponent(W)}`),je=await fetch(oe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:C,payload:C==="accept"?N??x.workspaceChangePayload:void 0})});if(!je.ok)throw await Xn(je,{method:"POST",url:oe});const Ve=await je.json(),De=yE(C,Ve.decision),Be=De==="accept"?Ve.payload??N??x.workspaceChangePayload:null;return Or(Ve.conversation),Et($,Mt=>({...Mt,events:[...Mt.events,{id:`${x.id}:${De}`,event:"server.workspace_change.decision",data:{proposalId:W,changeType:x.workspaceChangeType??"responsibility",decision:De,payload:Be},createdAt:new Date().toISOString()}]})),Pe("success",De==="accept"?"Workspace change applied":"Workspace change declined"),!0}catch(oe){console.error(oe);const je=pt(oe);return Pe("error","Failed to respond to workspace change proposal",je.detail??je.message),!1}}async function wa(x,C,N){const $=b;if(!(!$||!x.knowledgeProposalId))try{let W;if(C==="accept")try{W=JSON.parse(N??x.body)}catch{Pe("error","Knowledge proposal JSON is invalid");return}const oe=ze(`conversations/${$}/knowledge-proposals/${encodeURIComponent(x.knowledgeProposalId)}`),je=await fetch(oe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:C,knowledge:W})});if(!je.ok)throw await Xn(je,{method:"POST",url:oe});const Ve=await je.json();cr([...Ve.items??[]].sort(S5)),Et($,De=>({...De,events:[...De.events,{id:`${x.id}:${C}`,event:"server.knowledge.decision",data:{proposalId:x.knowledgeProposalId,decision:C,knowledge:C==="accept"?Ve.item:null},createdAt:new Date().toISOString()}]})),Pe("success",C==="accept"?"Workspace knowledge saved":"Knowledge proposal declined")}catch(W){console.error(W);const oe=pt(W);Pe("error","Failed to respond to knowledge proposal",oe.detail??oe.message)}}function ms(x){Cu(x.id,x.status),A0(x),F(C=>{const N=C[x.id],$=x.events.map(W=>({id:W.id,turnId:W.turnId,seq:W.seq,event:W.event,data:W.data,createdAt:W.createdAt}));return{...C,[x.id]:{messages:x.messages,events:_d($,(N==null?void 0:N.events)??[]),timelineNodes:Vd(x.timelineNodes??[],(N==null?void 0:N.timelineNodes)??[]),turns:Gd(x.turns??[],(N==null?void 0:N.turns)??[]),contextVersions:x.contextVersions??[],status:x.status,history:so(x),loadingOlder:!1,fullEventTurnIds:(N==null?void 0:N.fullEventTurnIds)??new Set,loadingEventTurnIds:(N==null?void 0:N.loadingEventTurnIds)??new Set}}})}function Hu(x){const C=so(x);Et(x.id,N=>{var $,W,oe;return{...N,messages:Pd(x.messages,N.messages),timelineNodes:Vd(x.timelineNodes??[],N.timelineNodes),turns:Gd(x.turns??[],N.turns),events:_d(x.events.map(je=>({id:je.id,turnId:je.turnId,seq:je.seq,event:je.event,data:je.data,createdAt:je.createdAt})),N.events),contextVersions:((($=x.contextVersions)==null?void 0:$.length)??0)>0?x.contextVersions??[]:N.contextVersions,history:{...C,loadedMessageCount:C.loadedMessageCount+(((W=N.history)==null?void 0:W.loadedMessageCount)??N.messages.length),loadedEventCount:C.loadedEventCount+(((oe=N.history)==null?void 0:oe.loadedEventCount)??N.events.length)},loadingOlder:!1}})}function dl(x){const C=so(x),N=x.events.map($=>({id:$.id,turnId:$.turnId,seq:$.seq,event:$.event,data:$.data,createdAt:$.createdAt}));Et(x.id,$=>{var W,oe,je;return{...$,messages:Pd($.messages,x.messages),timelineNodes:Vd($.timelineNodes,x.timelineNodes??[]),turns:Gd($.turns,x.turns??[]),events:_d(N,$.events),contextVersions:(((W=x.contextVersions)==null?void 0:W.length)??0)>0?x.contextVersions??[]:$.contextVersions,status:x.status,history:{...$.history??C,messageTotal:C.messageTotal,eventTotal:C.eventTotal,loadedMessageCount:Math.max(((oe=$.history)==null?void 0:oe.loadedMessageCount)??$.messages.length,$.messages.length,x.messages.length),loadedEventCount:Math.max(((je=$.history)==null?void 0:je.loadedEventCount)??$.events.length,$.events.length,x.events.length)},loadingOlder:!1}})}function Et(x,C){F(N=>{const $=N[x]??{messages:[],events:[],timelineNodes:[],turns:[],contextVersions:[],status:"idle",history:null,loadingOlder:!1,fullEventTurnIds:new Set,loadingEventTurnIds:new Set};return{...N,[x]:C($)}})}function Fa(x,C){g(N=>N.map($=>$.id===x?{...$,status:C,updatedAt:new Date().toISOString()}:$))}function A0(x){Or(x)}function Or(x){g(C=>zl(l,C.map(N=>N.id===x.id?{...N,...x}:N)))}async function E0(x,C){const N=C.filter($=>{const W=Q[x];return W&&!W.fullEventTurnIds.has($)&&!W.loadingEventTurnIds.has($)});if(N.length!==0){Et(x,$=>{const W=new Set($.loadingEventTurnIds);for(const oe of N)W.add(oe);return{...$,loadingEventTurnIds:W}});try{const $=await Promise.all(N.map(W=>Ox(x,W)));Et(x,W=>{const oe=new Set(W.fullEventTurnIds),je=new Set(W.loadingEventTurnIds),Ve=$.flatMap((De,Be)=>{const Mt=N[Be];return oe.add(Mt),je.delete(Mt),De.map(qt=>({id:qt.id,turnId:qt.turnId,seq:qt.seq,event:qt.event,data:qt.data,createdAt:qt.createdAt}))});return{...W,events:_d(W.events,Ve),fullEventTurnIds:oe,loadingEventTurnIds:je}})}catch($){console.error($),Et(x,W=>{const oe=new Set(W.loadingEventTurnIds);for(const je of N)oe.delete(je);return{...W,loadingEventTurnIds:oe}}),Pe("error","Failed to load process details")}}}function $n(x,C){const N=new Set(tl.current);C?N.add(x):N.delete(x),tl.current=N,s0($=>{const W=new Set($);return C?W.add(x):W.delete(x),W})}function $u(x){const C=lE({key:x.key,metaKey:x.metaKey,ctrlKey:x.ctrlKey,shiftKey:x.shiftKey,isComposing:x.nativeEvent.isComposing});C&&(x.preventDefault(),xo({forceNewTurn:C.forceNewTurn}))}function ps(x){Xl(C=>{const N=new Set(C);return N.has(x)?N.delete(x):N.add(x),op(l,N),N})}function N0(x){var C;return fE(x.status,(C=x.nextWakeup)==null?void 0:C.status,da.has(x.id))}function Pa(x){var $;const C=($=Ys.current)==null?void 0:$.getBoundingClientRect(),N=C?x-C.left:x;return Y1(N)}function Fu(x){x.preventDefault(),x.currentTarget.setPointerCapture(x.pointerId),Zl(Pa(x.clientX))}function ko(x){x.currentTarget.hasPointerCapture(x.pointerId)&&(x.preventDefault(),Zl(Pa(x.clientX)))}function So(x){x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId);const C=Pa(x.clientX);Zl(C),qE(l,C)}return u.jsxs(u.Fragment,{children:[u.jsxs("main",{inert:A,className:`shell${K?" mobile-sidebar-open":""}`,ref:Ys,style:{"--sidebar-width":`${o0}px`},children:[u.jsxs("aside",{className:"sidebar",children:[u.jsxs("div",{className:"sidebar-header",children:[u.jsxs("div",{children:[u.jsxs("p",{className:"eyebrow brand-line",children:[u.jsx("span",{children:"Seele"}),Ie?t.role==="admin"?u.jsxs("a",{"aria-label":`Open Seele Host control for Work v${Ie}`,className:"work-version-link",href:`${V1()}admin/host`,title:"Open Seele Host control: versions, restart, and logs",children:["v",Ie,u.jsx("span",{"aria-hidden":"true",children:"↗"})]}):u.jsxs("span",{children:["v",Ie]}):null,u.jsx("span",{"aria-label":M5(O),className:`backend-status ${O}`,"data-label":M5(O)})]}),u.jsxs("div",{className:"sidebar-title-row",children:[u.jsx("h2",{children:"Workspaces"}),e?u.jsx("button",{"aria-label":`Sign out ${t.username}`,className:"sign-out-button",onClick:a,title:`Sign out ${t.username}`,type:"button",children:"Sign out"}):null]})]}),u.jsxs("div",{className:"sidebar-header-actions",children:[u.jsx("button",{"aria-label":"Close workspace list",className:"mobile-sidebar-dismiss",onClick:()=>ie(!1),title:"Close workspace list",type:"button",children:"×"}),u.jsx("button",{"aria-label":"New workspace",className:"new-workspace-button",type:"button",onClick:nr,children:"+"})]})]}),u.jsx("nav",{className:"session-list","aria-label":"Workspaces",children:di.map(x=>u.jsxs("section",{className:["workspace-group",mu===x.id?"dragging":"",pu===x.id?"drop-after":"",(Wr==null?void 0:Wr.kind)==="group"&&Wr.id===x.id?"drop-into":""].filter(Boolean).join(" "),"data-group-id":x.id,children:[u.jsxs("div",{className:"workspace-group-header",children:[u.jsxs("button",{"aria-expanded":!oi.has(x.id),className:(Yt==null?void 0:Yt.kind)==="group"&&Yt.id===x.id?"workspace-group-toggle keyboard-focused":"workspace-group-toggle","data-keyboard-focus-key":Ts({kind:"group",id:x.id}),onClick:C=>{if(bu.current){C.preventDefault(),bu.current=!1;return}ps(x.id)},onDoubleClick:C=>{C.preventDefault(),C.stopPropagation(),_u(x)},onPointerCancel:gr,onPointerDown:C=>Wt(C,x.id),onPointerMove:C=>yt(C,x.id),onPointerUp:C=>qa(C,x.id),type:"button",children:[u.jsx("span",{className:oi.has(x.id)?"workspace-group-caret collapsed":"workspace-group-caret","aria-hidden":"true",children:"▾"}),u.jsx("span",{onDoubleClick:C=>{C.preventDefault(),C.stopPropagation(),_u(x)},title:"Double-click to rename",children:x.title})]}),x.id!==Y3?u.jsx("button",{"aria-label":`Delete group ${x.title}`,className:"workspace-group-delete",onClick:C=>{C.stopPropagation(),ul(x)},title:"Delete group",type:"button",children:"×"}):null]}),oi.has(x.id)?null:u.jsx("div",{className:"workspace-group-items",children:x.conversations.map(C=>{const N=N0(C);return u.jsxs("div",{className:["session-item",(Yt==null?void 0:Yt.kind)==="workspace"&&Yt.id===C.id?"keyboard-focused":"",C.id===b?"active":"",C.id===Yi?"dragging":"",(Wr==null?void 0:Wr.kind)==="workspace"&&Wr.id===C.id?`drop-${Wr.position}`:""].filter(Boolean).join(" "),"data-keyboard-focus-key":Ts({kind:"workspace",id:C.id}),"data-workspace-id":C.id,onClick:$=>{if(rs.current){$.preventDefault(),rs.current=!1;return}yo(C.id),ie(!1)},onDoubleClick:$=>{zr($.target)||($.preventDefault(),vo(C))},onKeyDown:$=>{va($.target)||$.key==="Enter"&&(yo(C.id),ie(!1))},onPointerCancel:Dn,onPointerDown:$=>Lu($,C.id),onPointerMove:$=>Bu($,C.id),onPointerUp:$=>S0($,C.id),role:"button",tabIndex:0,children:[u.jsxs("span",{className:"session-heading",children:[u.jsx("span",{"aria-label":Zd(N,C.nextWakeup,Vn),className:`session-status ${N}`,title:Zd(N,C.nextWakeup,Vn)}),u.jsx("span",{className:"session-title",title:"Double-click to rename",children:C.title}),N==="waiting"&&C.nextWakeup?u.jsx("span",{className:"session-countdown",title:Zd(N,C.nextWakeup,Vn),children:hf(C.nextWakeup,Vn)}):null,C.unreadTurnCount>0?u.jsx("span",{"aria-label":`${C.unreadTurnCount} unread turns`,className:"session-unread",title:`${C.unreadTurnCount} unread turns`,children:C.unreadTurnCount>99?"99+":C.unreadTurnCount}):null,N!=="running"?u.jsx("button",{"aria-label":`Delete ${C.title}`,className:"session-delete",onClick:$=>{$.stopPropagation(),wt(C)},title:"Move workspace to recycle",type:"button",children:"×"}):null]}),u.jsxs("span",{className:"session-workspace",title:C.workspacePath,children:["workspaces/",Xo(C.id)]})]},C.id)})})]},x.id))}),u.jsx("footer",{className:"sidebar-footer",children:u.jsxs("div",{className:"sidebar-actions","aria-label":"Workspace actions",children:[u.jsx("button",{"aria-label":"Settings",className:"sidebar-action-button",onClick:vi,type:"button",children:u.jsx(h5,{})}),u.jsx("button",{"aria-label":"New group",className:"sidebar-action-button",onClick:Iu,type:"button",children:u.jsx(HM,{})}),u.jsx("button",{"aria-label":"Collaboration topics",className:"sidebar-action-button",onClick:()=>{yn(!0),ie(!1)},type:"button",children:u.jsx(Yd,{})}),u.jsx("button",{"aria-label":"Console",className:"sidebar-action-button",onClick:Mu,type:"button",children:u.jsx($M,{})}),u.jsx(VN,{usage:lo})]})})]}),u.jsx("button",{"aria-label":"Close workspace list",className:"mobile-sidebar-backdrop",onClick:()=>ie(!1),tabIndex:K?0:-1,type:"button"}),u.jsx("div",{"aria-label":"Resize sidebar",className:"sidebar-resizer",onPointerDown:Fu,onPointerMove:ko,onPointerUp:So,role:"separator",tabIndex:0}),ku&&Wi?u.jsxs("div",{className:"workspace-drag-preview",style:{transform:`translate3d(${Wi.x+12}px, ${Wi.y+10}px, 0)`},children:[u.jsx("span",{className:"workspace-drag-title",children:ku.title}),u.jsxs("span",{className:"workspace-drag-path",children:["workspaces/",Xo(ku.id)]})]}):null,Ae?u.jsx("div",{className:"workspace-editor-overlay",onKeyDown:xa,role:"presentation",children:u.jsxs("form",{className:"workspace-editor",onKeyDown:xa,onSubmit:x=>void C0(x),children:[u.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-title",children:"Workspace name"}),u.jsx("input",{autoFocus:!0,id:"workspace-title",onChange:qu,onKeyDown:xa,value:Ae.title}),Ae.mode==="create"?u.jsxs(u.Fragment,{children:[u.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-group",children:"Group"}),u.jsx("select",{id:"workspace-group",onChange:Ua,onKeyDown:xa,value:Ae.groupId??((Ga=v[0])==null?void 0:Ga.id)??"",children:v.map(x=>u.jsx("option",{value:x.id,children:x.title},x.id))})]}):null,u.jsxs("div",{className:"workspace-editor-actions",children:[u.jsx("button",{type:"button",onClick:Zr,children:"Cancel"}),u.jsx("button",{disabled:we,type:"submit",children:we?"Saving...":Ae.mode==="create"?"Create":"Save"})]})]})}):null,tt?u.jsx("div",{className:"workspace-editor-overlay",onKeyDown:fs,role:"presentation",children:u.jsxs("form",{className:"workspace-editor",onKeyDown:fs,onSubmit:x=>void bi(x),children:[u.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-group-title",children:"Group name"}),u.jsx("input",{autoFocus:!0,id:"workspace-group-title",onChange:j0,onKeyDown:fs,value:tt.title}),u.jsxs("div",{className:"workspace-editor-actions",children:[u.jsx("button",{type:"button",onClick:Hn,children:"Cancel"}),u.jsx("button",{type:"submit",children:tt.mode==="create"?"Create":"Save"})]})]})}):null,qe?u.jsx(lN,{currentUser:t,conversations:m,editingEnvironmentKey:du,deploymentSettings:en,environmentDraft:Ar,globalEnvironment:Xe,workspaceEnvironment:Tt,memorySettings:n0,memorySettingsDraft:r0,workspaceMemoryDraft:cu,runtimeSettings:At,runtimeModels:ur,runtimeCodexVersion:Se,runtimeCodexReleasedAt:at,runtimeCodexUpdating:(Bt==null?void 0:Bt.status)==="running",runtimeSettingsDraft:Fl,runtimeSettingsScope:zn,settingsWorkspace:vn,settingsWorkspaceId:Ft,systemDiagnostics:Y,systemDiagnosticsLoading:Te,workspaceGroups:di,workspaceRuntimeSettings:ou,workspaceRuntimeSettingsDraft:Fi,managedUsers:pe,onCancelEnvironmentEdit:mo,onClose:()=>Je(!1),onCreateUser:async x=>{const C=await UD(x);J(N=>[...N,C]),Pe("success","User created")},onDeleteUser:async x=>{await $D(x),J(C=>C.filter(N=>N.id!==x)),Pe("success","User deleted")},onSaveDeploymentSettings:Pf,onDeleteEnvironment:x=>void fo(x),onDraftChange:Aa,onEditEnvironment:x0,onRevealEnvironmentValue:x=>void sl(x),onSaveBaseMemoryItems:x=>mr(x),onSaveResponsibility:async(x,C)=>{try{const N=await qd(x,{responsibility:C});return Or(N),ee("connected"),Pe("success","Workspace responsibility saved"),N.responsibility}catch(N){throw console.error(N),ee("error"),Pe("error","Failed to save workspace responsibility"),N}},onSaveWorkspaceMemoryItems:x=>Ft?ll(Ft,x):Promise.reject(new Error("No workspace selected")),onRuntimeDraftChange:$i,onCodexAccountSwitched:async()=>{Pe("success","Codex account selection saved"),(await Jx()).codexAccountsReady&&await Promise.all([us(!0),ga(!0),cs()])},onUpdateCodexCli:()=>{Yr(!0),gi(!0)},onRuntimeScopeChange:sa,onSettingsWorkspaceChange:$f,onSubmitRuntimeSettings:x=>void Ff(x),onWorkspaceRuntimeDraftChange:Gl,onWorkspaceRuntimeReset:x=>Ft?void co(Ft,x):void 0,revealedEnvironmentKeys:i0,onSubmitEnvironment:x=>void Du(x),onRefreshSystemDiagnostics:()=>void ds(),onUpdateUser:async(x,C)=>{const N=await HD(x,C);J($=>$.map(W=>W.id===N.id?N:W)),Pe("success","User updated")}}):null,wn?u.jsx(iN,{currentReleasedAt:at,currentVersion:Se,job:Bt,latest:Ta,latestChecking:_f,starting:Gn,onClose:()=>Yr(!1),onRefresh:()=>void gi(),onStart:()=>void Eu()}):null,Vl&&Ze?u.jsx(tN,{conversation:Ze,clockNow:Vn,knowledgeDraft:rn,workspaceKnowledge:a0,tokenUsage:as,onCancelKnowledgeEdit:()=>gn(Cc),onDeleteKnowledge:x=>void Ru(Ze.id,x),onEditKnowledge:xi,onKnowledgeDraftChange:gn,onSubmitKnowledge:x=>void ho(Ze.id,x),onClose:()=>Ea(!1)}):null,Pi?u.jsx(nN,{conversations:m,onClose:()=>yn(!1),workspaceGroups:di}):null,Na?u.jsx(rN,{busy:Lf||fu,conversation:Xr??null,conversationId:ua,forceStopBusy:fu,preview:(Ln==null?void 0:Ln.conversationId)===ua?Ln:null,previewLoading:Ps,result:l0,status:c0,warmup:Ma,workspaceGroups:di,onClose:()=>ii(!1),onCancelResetPreview:()=>kn(null),onForceStop:()=>void Vf(),onPreviewReset:()=>void y0(),onStartBlankContext:()=>void zu(),onResetRuntime:x=>void v0(x),onSaveResetSelection:Mr,onWorkspaceChange:x=>{$s(x),za(null),kn(null)},onWarmupChange:Gi}):null,B?u.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>!ae&&U(null),children:u.jsxs("form",{className:"dialog-card clone-dialog",onSubmit:w0,onMouseDown:x=>x.stopPropagation(),children:[u.jsxs("header",{children:[u.jsxs("div",{children:[u.jsx("h2",{children:"Clone workspace"}),u.jsx("p",{children:"Copy stable visible history and reusable workspace context into an independent workspace."})]}),u.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>U(null),type:"button",children:"×"})]}),u.jsxs("label",{children:[u.jsx("span",{children:"Name"}),u.jsx("input",{autoFocus:!0,value:B.name,onChange:x=>U(C=>C&&{...C,name:x.target.value})})]}),u.jsxs("label",{children:[u.jsx("span",{children:"Group"}),u.jsx("select",{value:B.groupId,onChange:x=>U(C=>C&&{...C,groupId:x.target.value}),children:di.map(x=>u.jsx("option",{value:x.id,children:x.title},x.id))})]}),u.jsxs("footer",{children:[u.jsx("button",{className:"secondary",disabled:ae,onClick:()=>U(null),type:"button",children:"Cancel"}),u.jsx("button",{disabled:ae||!B.name.trim(),type:"submit",children:ae?"Cloning...":"Clone"})]})]})}):null,z?u.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>M(null),children:u.jsxs("section",{"aria-labelledby":"system-event-detail-title","aria-modal":"true",className:"dialog-card system-event-detail-dialog",onMouseDown:x=>x.stopPropagation(),role:"dialog",children:[u.jsxs("header",{children:[u.jsxs("div",{children:[u.jsx("h2",{id:"system-event-detail-title",children:z.title}),u.jsx("p",{children:ct(z.createdAt)})]}),u.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>M(null),type:"button",children:"×"})]}),u.jsx("div",{className:"system-event-detail-content",children:u.jsx(Go,{content:z.fullDetail??z.detail??"No additional details.",conversation:Ze,streaming:!1,onPreviewArtifact:ca,onCopyArtifactUrl:pa,copiedArtifactUrl:Sn})}),u.jsx("footer",{children:u.jsx("button",{className:"secondary",onClick:()=>M(null),type:"button",children:"Close"})})]})}):null,He?u.jsx("div",{className:"memory-editor-overlay",onClick:()=>{et||wt(null)},role:"presentation",children:u.jsxs("section",{"aria-label":"Confirm workspace recycle","aria-modal":"true",className:"memory-delete-dialog workspace-delete-dialog",onClick:x=>x.stopPropagation(),role:"dialog",children:[u.jsxs("header",{children:[u.jsx("strong",{children:"Move Workspace to Recycle"}),u.jsx("button",{"aria-label":"Close workspace recycle confirmation",className:"memory-icon-button",disabled:et,onClick:()=>wt(null),title:"Close",type:"button",children:"×"})]}),u.jsxs("p",{children:["Move ",u.jsx("strong",{children:He.title})," to recycle?"]}),u.jsx("code",{children:He.workspacePath}),u.jsxs("div",{className:"memory-delete-actions",children:[u.jsx("button",{className:"memory-dialog-button",disabled:et,onClick:()=>wt(null),type:"button",children:"Cancel"}),u.jsx("button",{className:"memory-dialog-button danger",disabled:et,onClick:()=>void ol(He),type:"button",children:et?"Moving...":"Move to recycle"})]})]})}):null,li?u.jsxs("div",{className:`app-toast ${li.tone}`,role:"status",children:[u.jsx("strong",{children:li.text}),li.detail?u.jsx("pre",{children:li.detail}):null]}):null,u.jsxs("section",{className:"conversation",children:[u.jsxs("header",{className:"topbar",children:[u.jsxs("div",{className:"topbar-main",children:[u.jsx("button",{"aria-label":"Show workspaces",className:"mobile-workspace-menu",onClick:()=>ie(!0),title:"Workspaces",type:"button",children:u.jsx(UM,{})}),u.jsxs("div",{className:"topbar-heading",children:[u.jsx("div",{className:"topbar-title-row",children:u.jsx("h1",{children:(Ze==null?void 0:Ze.title)??"New workspace"})}),Ze?u.jsxs("p",{className:"topbar-workspace",children:["workspaces/",Xo(Ze.id)]}):null]})]}),u.jsx("div",{className:"topbar-actions",children:Ze?u.jsxs(u.Fragment,{children:[Ze.threadUpgradeRequired?u.jsx("button",{"aria-label":"Reset required for latest thread tools",className:"topbar-icon-button thread-upgrade-button",onClick:Mu,title:`当前 Thread 工具集已过期(${Ze.threadCapabilityVersion} / ${Ze.requiredThreadCapabilityVersion}),点击进行 Reset`,type:"button",children:u.jsx(zx,{})}):null,u.jsx("button",{"aria-label":"Clone workspace",className:"topbar-icon-button",onClick:ya,title:"Clone workspace",type:"button",children:u.jsx(qM,{})}),u.jsxs("button",{className:`context-button has-usage ${t4(fi??0)}`,onClick:()=>Ea(!0),style:{"--context-usage":`${Of(fi??0)}%`},title:as&&fi!==null?`Context ${Math.round(fi)}% · ${jr(as.totalTokens)} / ${Kd(as.modelContextWindow)}`:"Context 0% · no usage recorded yet",type:"button",children:[u.jsx("span",{children:"Context"}),u.jsxs("strong",{children:[Math.round(fi??0),"%"]})]}),u.jsx("button",{"aria-label":"Workspace settings",className:"topbar-icon-button",onClick:p0,title:"Workspace settings",type:"button",children:u.jsx(h5,{})})]}):null})]}),(Ze==null?void 0:Ze.status)==="initialization_failed"&&Ze.cloneLineage?u.jsxs("div",{className:"clone-initialization-error",children:[u.jsxs("div",{children:[u.jsx("strong",{children:"Clone initialization failed"}),u.jsx("span",{children:Ze.cloneLineage.initializationError??"The runtime could not initialize this clone."})]}),u.jsx("button",{onClick:()=>void go(),type:"button",children:"Retry with a clean thread"})]}):null,u.jsx("div",{className:"stream",onScroll:()=>void f0(),ref:ui,style:{scrollPaddingBottom:gu},children:u.jsxs("div",{className:"stream-inner",style:{paddingBottom:gu},children:[nl.length===0?u.jsx("div",{className:"empty-state",children:u.jsx("h2",{children:"Start a workspace"})}):null,u.jsxs("section",{className:"message-log","aria-label":"Conversation messages",children:[Ze!=null&&Ze.cloneLineage&&La.size>0?u.jsxs("div",{className:"clone-history-boundary clone-history-source",children:[u.jsxs("strong",{children:["Inherited from ",Ze.cloneLineage.sourceWorkspaceTitle]}),u.jsxs("span",{children:["through ",ct(Ze.cloneLineage.snapshotAt)," · ",Ze.cloneLineage.importedMessageCount," messages"]})]}):null,(Va=Nt==null?void 0:Nt.history)!=null&&Va.hasMoreBefore?u.jsx("button",{className:"history-loader",type:"button",disabled:Nt.loadingOlder,"aria-busy":Nt.loadingOlder,onClick:()=>b&&void Ba(b),children:Nt.loadingOlder?"正在加载更早消息…":"加载更早消息"}):null,ro.map((x,C)=>{var je,Ve,De;const N=((je=x.user)==null?void 0:je.type)==="system",$=x.turnIds.some(Be=>La.has(Be)),W=ro[C+1],oe=$&&(!W||!W.turnIds.some(Be=>La.has(Be)));return u.jsxs(D.Fragment,{children:[u.jsxs("section",{className:`turn-group${$?" clone-history-turn":""}`,"data-turn-id":x.id,children:[x.user?u.jsxs("div",{className:`turn-panel ${N?"system-turn":"user-turn"}`,children:[Po(x.user,Ze,ca,pa,Sn,Jt,ki,wa,M),u.jsx(Dc,{copied:Vi===`${N?"system":"user"}-${x.id}-bottom`,content:Rc(x.user),id:`${N?"system":"user"}-${x.id}-bottom`,timestamp:x.user.createdAt,variant:"outside",onCopy:pi})]}):null,x.followupUsers.length>0?u.jsx("div",{className:"turn-followup-users","aria-label":"Additional turn input",children:x.followupUsers.map(Be=>u.jsxs("div",{className:"turn-panel user-turn followup-user-turn",children:[u.jsx("span",{className:"followup-user-label",children:"Added while running"}),Po(Be,Ze,ca,pa,Sn,Jt,ki,wa,M),u.jsx(Dc,{copied:Vi===`user-${Be.id}-bottom`,content:Rc(Be),id:`user-${Be.id}-bottom`,timestamp:Be.createdAt,variant:"outside",onCopy:pi})]},Be.id))}):null,(Ve=x.acceptedSystemInputs)==null?void 0:Ve.map(Be=>u.jsxs("div",{className:"turn-panel system-turn",children:[Po(Be,Ze,ca,pa,Sn,Jt,ki,wa,M),u.jsx(Dc,{copied:Vi===`system-${Be.id}-bottom`,content:Rc(Be),id:`system-${Be.id}-bottom`,timestamp:Be.createdAt,variant:"outside",onCopy:pi})]},Be.id)),x.agentItems.length>0||x.stopped?u.jsx(px,{group:x,conversation:Ze,allowProcessView:!$,copiedFooter:Vi===`agent-${x.id}-bottom`,copiedArtifactUrl:Sn,running:!$&&Bc(x.turnIds,rl),onCopyArtifactUrl:pa,onCopyBubble:pi,onPreviewArtifact:ca,onLoadProcessDetails:Be=>Ze&&!$?E0(Ze.id,Be):void 0,onRespondApproval:Jt,onRespondWorkspaceChangeProposal:ki,onRespondKnowledgeProposal:wa,onOpenSystemEvent:M}):null,(De=x.trailingSystemItems)==null?void 0:De.map(Be=>u.jsxs("div",{className:"turn-panel system-turn",children:[Po(Be,Ze,ca,pa,Sn,Jt,ki,wa,M),u.jsx(Dc,{copied:Vi===`system-${Be.id}-bottom`,content:Rc(Be),id:`system-${Be.id}-bottom`,timestamp:Be.createdAt,variant:"outside",onCopy:pi})]},Be.id))]}),oe?u.jsx("div",{className:"clone-history-boundary clone-history-end",children:"Clone starts here"}):null]},x.id)})]})]})}),u.jsxs("form",{className:"composer",onSubmit:hs,ref:vu,children:[ma?u.jsxs("div",{className:`global-activity ${ma.tone??"running"}`,children:[is?u.jsx("button",{"aria-label":"Stop current workspace activity",className:"turn-stop activity-stop",onClick:()=>void Gf(),title:"Stop current workspace activity",type:"button",children:u.jsx(ON,{})}):u.jsx("span",{className:"activity-wait-dot","aria-hidden":"true"}),u.jsxs("div",{className:"global-activity-text",children:[u.jsx("span",{children:ma.title}),ma.detail?u.jsx("small",{children:ma.detail}):null]}),is?u.jsx("span",{className:"activity-spinner","aria-hidden":"true"}):null]}):null,u.jsxs("div",{className:"composer-panel",children:[u.jsx("textarea",{disabled:d0.textareaDisabled,onChange:x=>Uu(x.target.value),onKeyDown:$u,placeholder:"Cmd/Ctrl + Enter",ref:Ki,value:o}),u.jsxs("button",{"aria-label":"Send message",className:"composer-send",disabled:d0.sendDisabled,type:"submit",children:[u.jsx(IN,{}),u.jsxs("span",{className:"composer-send-tooltip",role:"tooltip",children:[u.jsxs("span",{children:[u.jsx("kbd",{children:"⌘ / Ctrl + Enter"})," Send or add to running turn"]}),u.jsxs("span",{children:[u.jsx("kbd",{children:"⇧ + ⌘ / Ctrl + Enter"})," New turn or queue"]})]})]})]})]}),dr?u.jsx("div",{className:"artifact-lightbox",onClick:()=>ca(null),role:"presentation",children:u.jsxs("figure",{className:"artifact-lightbox-card",onClick:x=>x.stopPropagation(),children:[u.jsx("button",{"aria-label":"Close preview",className:"artifact-lightbox-close",onClick:()=>ca(null),type:"button",children:"×"}),u.jsx("img",{alt:dr.name,src:dr.url}),u.jsxs("figcaption",{children:[u.jsx("span",{children:dr.name}),u.jsxs("div",{className:"artifact-lightbox-actions",children:[u.jsx("a",{href:dr.url,rel:"noreferrer",target:"_blank",children:"Open in new tab"}),u.jsx("button",{onClick:()=>void pa(dr),type:"button",children:Sn===dr.url?"Copied":"Copy URL"})]})]})]})}):null]})]}),b&&u.jsx(MA,{ownerId:b,ownerName:(Ze==null?void 0:Ze.title)??"Workspace",request:hx,onExpanded:q,renderMember:x=>u.jsx(eN,{workspaceId:x},x)},b)]})}async function hx(e,t,n){const a=ze(e),l=await fetch(a,{method:n??(t===void 0?"GET":"POST"),headers:t===void 0?void 0:{"Content-Type":"application/json"},body:t===void 0?void 0:JSON.stringify(t)});return await Fe(l,{url:a}),l.json()}function eN({workspaceId:e}){var J;const[t,n]=D.useState(null),[a,l]=D.useState(""),[o,c]=D.useState(null),[f,h]=D.useState(""),[m,g]=D.useState(!1),[v,k]=D.useState(!1),[b,T]=D.useState(null),[A,q]=D.useState(null),z=D.useRef(!1),M=D.useRef(new Map),B=`conversations/${encodeURIComponent(e)}`;function U(Y,ge=!1){n(Te=>{const H=new Map;for(const _ of[...(Te==null?void 0:Te.events)??[],...M.current.values(),...Y.events])H.set(_.id,_);return Te?{...Y,messages:Pd(ge?Te.messages:Y.messages,ge?Y.messages:Te.messages),turns:Gd(ge?Y.turns:Te.turns,ge?Te.turns:Y.turns),timelineNodes:Vd(ge?Y.timelineNodes??[]:Te.timelineNodes??[],ge?Te.timelineNodes??[]:Y.timelineNodes??[]),events:[...H.values()],history:ge||!z.current?Y.history:Te.history}:{...Y,events:[...H.values()]}})}async function ae(){U(await Ko(e))}D.useEffect(()=>{let Y=!0,ge=!1;const Te=async()=>{if(!ge){ge=!0;try{const _=await Ko(e);Y&&(U(_),l(""))}catch(_){Y&&l(String(_))}finally{ge=!1}}};Te();const H=window.setInterval(()=>void Te(),2e3);return()=>{Y=!1,window.clearInterval(H)}},[e]);async function L(Y,ge={}){g(!0),l("");try{return await hx(`${B}/${Y}`,ge),await ae(),!0}catch(Te){return l(String(Te)),!1}finally{g(!1)}}const K=(Y,ge)=>{Y.approvalTurnId&&Y.approvalRequestId!==void 0&&L(`turns/${Y.approvalTurnId}/approvals/${encodeURIComponent(String(Y.approvalRequestId))}`,{decision:ge})},ie=async(Y,ge,Te)=>{const H=Y.workspaceChangeProposalId??Y.responsibilityProposalId;return H?L(`workspace-change-proposals/${encodeURIComponent(H)}`,{decision:ge,payload:ge==="accept"?Te??Y.workspaceChangePayload:void 0}):!1},Q=async(Y,ge,Te)=>{if(Y.knowledgeProposalId)try{await L(`knowledge-proposals/${encodeURIComponent(Y.knowledgeProposalId)}`,{decision:ge,knowledge:ge==="accept"?JSON.parse(Te??Y.body):void 0})}catch(H){l(String(H))}};async function F(Y){try{const ge=await Promise.all(Y.map(Te=>Ox(e,Te)));for(const Te of ge.flat())M.current.set(Te.id,Te);await ae()}catch(ge){l(String(ge))}}async function he(){const Y=t==null?void 0:t.history;if(!Y||v)return;const ge=Y.oldestTimelineAt&&Y.oldestTimelineSequence!==null?`${Y.oldestTimelineAt}|${Y.oldestTimelineSequence}`:Y.oldestMessageCreatedAt;if(ge){k(!0);try{const Te=await Ko(e,{before:ge});z.current=!0,U(Te,!0)}catch(Te){l(String(Te))}finally{k(!1)}}}const ce=t==null?void 0:t.turns.find(Y=>["running","queued","waiting_input","waiting_approval"].includes(Y.status)),Ie=t?yx(t.messages,t.events,t.turns,t.timelineNodes??[],(ce==null?void 0:ce.id)??null,new Map):[],be=Y=>{navigator.clipboard.writeText(Y.url).then(()=>c(Y.url)).catch(ge=>l(String(ge)))},pe=Y=>Po(Y,t??void 0,T,be,o,K,ie,Q,q);return u.jsxs("div",{className:"cotask-member-content",children:[a&&u.jsx("p",{role:"alert",className:"cotask-error",children:a}),t?u.jsxs(u.Fragment,{children:[u.jsxs("header",{className:"cotask-member-toolbar",children:[u.jsxs("span",{children:["Member status: ",t.status]}),(ce||t.status==="running")&&u.jsx("button",{disabled:m,onClick:()=>void L("turns/interrupt"),children:"Stop"})]}),((J=t.history)==null?void 0:J.hasMoreBefore)&&u.jsx("button",{disabled:v,onClick:()=>void he(),children:v?"Loading…":"Load earlier history"}),Ie.map(Y=>{var ge,Te;return u.jsxs("section",{className:"turn-group",children:[Y.user&&pe(Y.user),Y.followupUsers.map(H=>u.jsx(D.Fragment,{children:pe(H)},H.id)),(ge=Y.acceptedSystemInputs)==null?void 0:ge.map(H=>u.jsx(D.Fragment,{children:pe(H)},H.id)),u.jsx(px,{group:Y,conversation:t,copiedFooter:o===Y.id,copiedArtifactUrl:o,running:!!(ce&&Y.turnIds.includes(ce.id)),onCopyArtifactUrl:be,onCopyBubble:(H,_)=>{navigator.clipboard.writeText(_).then(()=>c(H)).catch(te=>l(String(te)))},onLoadProcessDetails:F,onPreviewArtifact:T,onRespondApproval:K,onRespondWorkspaceChangeProposal:ie,onRespondKnowledgeProposal:Q,onOpenSystemEvent:q}),(Te=Y.trailingSystemItems)==null?void 0:Te.map(H=>u.jsx(D.Fragment,{children:pe(H)},H.id))]},Y.id)}),!Ie.length&&u.jsx("p",{children:"Member created. Waiting for task activity."}),(ce==null?void 0:ce.status)==="waiting_input"&&u.jsxs("form",{className:"cotask-member-reply",onSubmit:Y=>{Y.preventDefault(),f.trim()&&L("turns/steer",{message:f}).then(ge=>{ge&&h("")})},children:[u.jsxs("label",{children:["Answer the member’s question",u.jsx("textarea",{value:f,onChange:Y=>h(Y.target.value),disabled:m})]}),u.jsx("button",{disabled:m||!f.trim(),type:"submit",children:"Send reply"})]})]}):u.jsx("p",{children:"Loading member activity…"}),b&&u.jsxs("div",{className:"cotask-detail-overlay",role:"dialog","aria-label":"Artifact preview",onKeyDown:Y=>{Y.key==="Escape"&&(Y.stopPropagation(),T(null))},children:[u.jsx("button",{onClick:()=>T(null),children:"Close preview"}),u.jsxs("a",{href:b.url,target:"_blank",rel:"noreferrer",children:["Open in new tab: ",b.name]}),u.jsx("iframe",{title:b.name,src:b.url,sandbox:"allow-scripts",referrerPolicy:"no-referrer"})]}),A&&u.jsxs("div",{className:"cotask-detail-overlay",role:"dialog","aria-label":"Execution event",onKeyDown:Y=>{Y.key==="Escape"&&(Y.stopPropagation(),q(null))},children:[u.jsx("button",{onClick:()=>q(null),children:"Close details"}),u.jsx("h3",{children:A.title}),u.jsx(Go,{content:A.fullDetail??A.detail??"No further details",conversation:t??void 0,onPreviewArtifact:T,onCopyArtifactUrl:be,copiedArtifactUrl:o})]})]})}function tN({conversation:e,clockNow:t,knowledgeDraft:n,workspaceKnowledge:a,tokenUsage:l,onCancelKnowledgeEdit:o,onDeleteKnowledge:c,onEditKnowledge:f,onKnowledgeDraftChange:h,onSubmitKnowledge:m,onClose:g}){const[v,k]=D.useState("overview"),[b,T]=D.useState(!1),[A,q]=D.useState(!1),[z,M]=D.useState(null),[B,U]=D.useState(null),[ae,L]=D.useState(!1),[K,ie]=D.useState(null),[Q,F]=D.useState(null),[he,ce]=D.useState(!1),[Ie,be]=D.useState(null),[pe,J]=D.useState(null),Y=Yx(l),ge=s1(e,e.status),Te=z?xD(z):null;D.useEffect(()=>{T(!1),M(null),U(null),ie(null),F(null),be(null),J(null)},[e.id]),D.useEffect(()=>{v==="additionalContext"&&!K&&_()},[v,K]),D.useEffect(()=>{v==="compactions"&&!Ie&&te()},[v,Ie]);const H=()=>{T(!0),q(!0),U(null),Ez(e.id).then(O=>M(O)).catch(O=>{const ee=pt(O);U(ee.detail?`${ee.message}
|
|
358
|
+
This cancels every current or queued turn, kills its runtime, and repairs scheduler state. Future scheduled wakeups are preserved.`))return;const N=x.id;Fs(!0),h0(N),($=fr.current.get(N))==null||$.abort(),hr.current.delete(N),el.current.delete(N),$n(N,!1);try{const W=await T0(N);al(N),Et(N,oe=>({...oe,status:W})),Fa(N,W),await tn(N),await Yn(),Pe("success","Workspace stopped and repaired")}catch(W){ju(N);const oe=pt(W);Pe("error","Force stop failed",oe.detail??oe.message);try{await Yn()}catch(je){console.warn("Failed to refresh workspace after force Stop failed",je)}}finally{Fs(!1)}}async function Jt(x,C){if(!b||!x.approvalTurnId||x.approvalRequestId===void 0)return;const N=b;try{const $=ze(`conversations/${N}/turns/${x.approvalTurnId}/approvals/${encodeURIComponent(String(x.approvalRequestId))}`),W=await fetch($,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:C})});if(!W.ok)throw await Xn(W,{method:"POST",url:$});Et(N,oe=>({...oe,events:[...oe.events,{id:oe.events.length+1,event:"server.approval.decision",data:{requestId:x.approvalRequestId,decision:C,source:"client"},createdAt:new Date().toISOString()}]}))}catch($){Et(N,oe=>({...oe,events:[...oe.events,{id:oe.events.length+1,event:"client.error",data:Ss($),createdAt:new Date().toISOString()}]}));const W=pt($);Pe("error","Failed to respond to approval",W.detail??W.message)}}async function ki(x,C,N){const $=b,W=x.workspaceChangeProposalId??x.responsibilityProposalId;if(!$||!W)return!1;try{const oe=ze(`conversations/${$}/workspace-change-proposals/${encodeURIComponent(W)}`),je=await fetch(oe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:C,payload:C==="accept"?N??x.workspaceChangePayload:void 0})});if(!je.ok)throw await Xn(je,{method:"POST",url:oe});const Ve=await je.json(),De=yE(C,Ve.decision),Be=De==="accept"?Ve.payload??N??x.workspaceChangePayload:null;return Or(Ve.conversation),Et($,Mt=>({...Mt,events:[...Mt.events,{id:`${x.id}:${De}`,event:"server.workspace_change.decision",data:{proposalId:W,changeType:x.workspaceChangeType??"responsibility",decision:De,payload:Be},createdAt:new Date().toISOString()}]})),Pe("success",De==="accept"?"Workspace change applied":"Workspace change declined"),!0}catch(oe){console.error(oe);const je=pt(oe);return Pe("error","Failed to respond to workspace change proposal",je.detail??je.message),!1}}async function wa(x,C,N){const $=b;if(!(!$||!x.knowledgeProposalId))try{let W;if(C==="accept")try{W=JSON.parse(N??x.body)}catch{Pe("error","Knowledge proposal JSON is invalid");return}const oe=ze(`conversations/${$}/knowledge-proposals/${encodeURIComponent(x.knowledgeProposalId)}`),je=await fetch(oe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:C,knowledge:W})});if(!je.ok)throw await Xn(je,{method:"POST",url:oe});const Ve=await je.json();cr([...Ve.items??[]].sort(S5)),Et($,De=>({...De,events:[...De.events,{id:`${x.id}:${C}`,event:"server.knowledge.decision",data:{proposalId:x.knowledgeProposalId,decision:C,knowledge:C==="accept"?Ve.item:null},createdAt:new Date().toISOString()}]})),Pe("success",C==="accept"?"Workspace knowledge saved":"Knowledge proposal declined")}catch(W){console.error(W);const oe=pt(W);Pe("error","Failed to respond to knowledge proposal",oe.detail??oe.message)}}function ms(x){Cu(x.id,x.status),A0(x),F(C=>{const N=C[x.id],$=x.events.map(W=>({id:W.id,turnId:W.turnId,seq:W.seq,event:W.event,data:W.data,createdAt:W.createdAt}));return{...C,[x.id]:{messages:x.messages,events:_d($,(N==null?void 0:N.events)??[]),timelineNodes:Vd(x.timelineNodes??[],(N==null?void 0:N.timelineNodes)??[]),turns:Gd(x.turns??[],(N==null?void 0:N.turns)??[]),contextVersions:x.contextVersions??[],status:x.status,history:so(x),loadingOlder:!1,fullEventTurnIds:(N==null?void 0:N.fullEventTurnIds)??new Set,loadingEventTurnIds:(N==null?void 0:N.loadingEventTurnIds)??new Set}}})}function Hu(x){const C=so(x);Et(x.id,N=>{var $,W,oe;return{...N,messages:Pd(x.messages,N.messages),timelineNodes:Vd(x.timelineNodes??[],N.timelineNodes),turns:Gd(x.turns??[],N.turns),events:_d(x.events.map(je=>({id:je.id,turnId:je.turnId,seq:je.seq,event:je.event,data:je.data,createdAt:je.createdAt})),N.events),contextVersions:((($=x.contextVersions)==null?void 0:$.length)??0)>0?x.contextVersions??[]:N.contextVersions,history:{...C,loadedMessageCount:C.loadedMessageCount+(((W=N.history)==null?void 0:W.loadedMessageCount)??N.messages.length),loadedEventCount:C.loadedEventCount+(((oe=N.history)==null?void 0:oe.loadedEventCount)??N.events.length)},loadingOlder:!1}})}function dl(x){const C=so(x),N=x.events.map($=>({id:$.id,turnId:$.turnId,seq:$.seq,event:$.event,data:$.data,createdAt:$.createdAt}));Et(x.id,$=>{var W,oe,je;return{...$,messages:Pd($.messages,x.messages),timelineNodes:Vd($.timelineNodes,x.timelineNodes??[]),turns:Gd($.turns,x.turns??[]),events:_d(N,$.events),contextVersions:(((W=x.contextVersions)==null?void 0:W.length)??0)>0?x.contextVersions??[]:$.contextVersions,status:x.status,history:{...$.history??C,messageTotal:C.messageTotal,eventTotal:C.eventTotal,loadedMessageCount:Math.max(((oe=$.history)==null?void 0:oe.loadedMessageCount)??$.messages.length,$.messages.length,x.messages.length),loadedEventCount:Math.max(((je=$.history)==null?void 0:je.loadedEventCount)??$.events.length,$.events.length,x.events.length)},loadingOlder:!1}})}function Et(x,C){F(N=>{const $=N[x]??{messages:[],events:[],timelineNodes:[],turns:[],contextVersions:[],status:"idle",history:null,loadingOlder:!1,fullEventTurnIds:new Set,loadingEventTurnIds:new Set};return{...N,[x]:C($)}})}function Fa(x,C){g(N=>N.map($=>$.id===x?{...$,status:C,updatedAt:new Date().toISOString()}:$))}function A0(x){Or(x)}function Or(x){g(C=>zl(l,C.map(N=>N.id===x.id?{...N,...x}:N)))}async function E0(x,C){const N=C.filter($=>{const W=Q[x];return W&&!W.fullEventTurnIds.has($)&&!W.loadingEventTurnIds.has($)});if(N.length!==0){Et(x,$=>{const W=new Set($.loadingEventTurnIds);for(const oe of N)W.add(oe);return{...$,loadingEventTurnIds:W}});try{const $=await Promise.all(N.map(W=>Ox(x,W)));Et(x,W=>{const oe=new Set(W.fullEventTurnIds),je=new Set(W.loadingEventTurnIds),Ve=$.flatMap((De,Be)=>{const Mt=N[Be];return oe.add(Mt),je.delete(Mt),De.map(qt=>({id:qt.id,turnId:qt.turnId,seq:qt.seq,event:qt.event,data:qt.data,createdAt:qt.createdAt}))});return{...W,events:_d(W.events,Ve),fullEventTurnIds:oe,loadingEventTurnIds:je}})}catch($){console.error($),Et(x,W=>{const oe=new Set(W.loadingEventTurnIds);for(const je of N)oe.delete(je);return{...W,loadingEventTurnIds:oe}}),Pe("error","Failed to load process details")}}}function $n(x,C){const N=new Set(tl.current);C?N.add(x):N.delete(x),tl.current=N,s0($=>{const W=new Set($);return C?W.add(x):W.delete(x),W})}function $u(x){const C=lE({key:x.key,metaKey:x.metaKey,ctrlKey:x.ctrlKey,shiftKey:x.shiftKey,isComposing:x.nativeEvent.isComposing});C&&(x.preventDefault(),xo({forceNewTurn:C.forceNewTurn}))}function ps(x){Xl(C=>{const N=new Set(C);return N.has(x)?N.delete(x):N.add(x),op(l,N),N})}function N0(x){var C;return fE(x.status,(C=x.nextWakeup)==null?void 0:C.status,da.has(x.id))}function Pa(x){var $;const C=($=Ys.current)==null?void 0:$.getBoundingClientRect(),N=C?x-C.left:x;return Y1(N)}function Fu(x){x.preventDefault(),x.currentTarget.setPointerCapture(x.pointerId),Zl(Pa(x.clientX))}function ko(x){x.currentTarget.hasPointerCapture(x.pointerId)&&(x.preventDefault(),Zl(Pa(x.clientX)))}function So(x){x.currentTarget.hasPointerCapture(x.pointerId)&&x.currentTarget.releasePointerCapture(x.pointerId);const C=Pa(x.clientX);Zl(C),qE(l,C)}return u.jsxs(u.Fragment,{children:[u.jsxs("main",{inert:A,className:`shell${K?" mobile-sidebar-open":""}`,ref:Ys,style:{"--sidebar-width":`${o0}px`},children:[u.jsxs("aside",{className:"sidebar",children:[u.jsxs("div",{className:"sidebar-header",children:[u.jsxs("div",{children:[u.jsxs("p",{className:"eyebrow brand-line",children:[u.jsx("span",{children:"Seele"}),Ie?t.role==="admin"?u.jsxs("a",{"aria-label":`Open Seele Host control for Work v${Ie}`,className:"work-version-link",href:`${V1()}admin/host`,title:"Open Seele Host control: versions, restart, and logs",children:["v",Ie,u.jsx("span",{"aria-hidden":"true",children:"↗"})]}):u.jsxs("span",{children:["v",Ie]}):null,u.jsx("span",{"aria-label":M5(O),className:`backend-status ${O}`,"data-label":M5(O)})]}),u.jsxs("div",{className:"sidebar-title-row",children:[u.jsx("h2",{children:"Workspaces"}),e?u.jsx("button",{"aria-label":`Sign out ${t.username}`,className:"sign-out-button",onClick:a,title:`Sign out ${t.username}`,type:"button",children:"Sign out"}):null]})]}),u.jsxs("div",{className:"sidebar-header-actions",children:[u.jsx("button",{"aria-label":"Close workspace list",className:"mobile-sidebar-dismiss",onClick:()=>ie(!1),title:"Close workspace list",type:"button",children:"×"}),u.jsx("button",{"aria-label":"New workspace",className:"new-workspace-button",type:"button",onClick:nr,children:"+"})]})]}),u.jsx("nav",{className:"session-list","aria-label":"Workspaces",children:di.map(x=>u.jsxs("section",{className:["workspace-group",mu===x.id?"dragging":"",pu===x.id?"drop-after":"",(Wr==null?void 0:Wr.kind)==="group"&&Wr.id===x.id?"drop-into":""].filter(Boolean).join(" "),"data-group-id":x.id,children:[u.jsxs("div",{className:"workspace-group-header",children:[u.jsxs("button",{"aria-expanded":!oi.has(x.id),className:(Yt==null?void 0:Yt.kind)==="group"&&Yt.id===x.id?"workspace-group-toggle keyboard-focused":"workspace-group-toggle","data-keyboard-focus-key":Ts({kind:"group",id:x.id}),onClick:C=>{if(bu.current){C.preventDefault(),bu.current=!1;return}ps(x.id)},onDoubleClick:C=>{C.preventDefault(),C.stopPropagation(),_u(x)},onPointerCancel:gr,onPointerDown:C=>Wt(C,x.id),onPointerMove:C=>yt(C,x.id),onPointerUp:C=>qa(C,x.id),type:"button",children:[u.jsx("span",{className:oi.has(x.id)?"workspace-group-caret collapsed":"workspace-group-caret","aria-hidden":"true",children:"▾"}),u.jsx("span",{onDoubleClick:C=>{C.preventDefault(),C.stopPropagation(),_u(x)},title:"Double-click to rename",children:x.title})]}),x.id!==Y3?u.jsx("button",{"aria-label":`Delete group ${x.title}`,className:"workspace-group-delete",onClick:C=>{C.stopPropagation(),ul(x)},title:"Delete group",type:"button",children:"×"}):null]}),oi.has(x.id)?null:u.jsx("div",{className:"workspace-group-items",children:x.conversations.map(C=>{const N=N0(C);return u.jsxs("div",{className:["session-item",(Yt==null?void 0:Yt.kind)==="workspace"&&Yt.id===C.id?"keyboard-focused":"",C.id===b?"active":"",C.id===Yi?"dragging":"",(Wr==null?void 0:Wr.kind)==="workspace"&&Wr.id===C.id?`drop-${Wr.position}`:""].filter(Boolean).join(" "),"data-keyboard-focus-key":Ts({kind:"workspace",id:C.id}),"data-workspace-id":C.id,onClick:$=>{if(rs.current){$.preventDefault(),rs.current=!1;return}yo(C.id),ie(!1)},onDoubleClick:$=>{zr($.target)||($.preventDefault(),vo(C))},onKeyDown:$=>{va($.target)||$.key==="Enter"&&(yo(C.id),ie(!1))},onPointerCancel:Dn,onPointerDown:$=>Lu($,C.id),onPointerMove:$=>Bu($,C.id),onPointerUp:$=>S0($,C.id),role:"button",tabIndex:0,children:[u.jsxs("span",{className:"session-heading",children:[u.jsx("span",{"aria-label":Zd(N,C.nextWakeup,Vn),className:`session-status ${N}`,title:Zd(N,C.nextWakeup,Vn)}),u.jsx("span",{className:"session-title",title:"Double-click to rename",children:C.title}),N==="waiting"&&C.nextWakeup?u.jsx("span",{className:"session-countdown",title:Zd(N,C.nextWakeup,Vn),children:hf(C.nextWakeup,Vn)}):null,C.unreadTurnCount>0?u.jsx("span",{"aria-label":`${C.unreadTurnCount} unread turns`,className:"session-unread",title:`${C.unreadTurnCount} unread turns`,children:C.unreadTurnCount>99?"99+":C.unreadTurnCount}):null,N!=="running"?u.jsx("button",{"aria-label":`Delete ${C.title}`,className:"session-delete",onClick:$=>{$.stopPropagation(),wt(C)},title:"Move workspace to recycle",type:"button",children:"×"}):null]}),u.jsxs("span",{className:"session-workspace",title:C.workspacePath,children:["workspaces/",Xo(C.id)]})]},C.id)})})]},x.id))}),u.jsx("footer",{className:"sidebar-footer",children:u.jsxs("div",{className:"sidebar-actions","aria-label":"Workspace actions",children:[u.jsx("button",{"aria-label":"Settings",className:"sidebar-action-button",onClick:vi,type:"button",children:u.jsx(h5,{})}),u.jsx("button",{"aria-label":"New group",className:"sidebar-action-button",onClick:Iu,type:"button",children:u.jsx(HM,{})}),u.jsx("button",{"aria-label":"Collaboration topics",className:"sidebar-action-button",onClick:()=>{yn(!0),ie(!1)},type:"button",children:u.jsx(Yd,{})}),u.jsx("button",{"aria-label":"Console",className:"sidebar-action-button",onClick:Mu,type:"button",children:u.jsx($M,{})}),u.jsx(VN,{usage:lo})]})})]}),u.jsx("button",{"aria-label":"Close workspace list",className:"mobile-sidebar-backdrop",onClick:()=>ie(!1),tabIndex:K?0:-1,type:"button"}),u.jsx("div",{"aria-label":"Resize sidebar",className:"sidebar-resizer",onPointerDown:Fu,onPointerMove:ko,onPointerUp:So,role:"separator",tabIndex:0}),ku&&Wi?u.jsxs("div",{className:"workspace-drag-preview",style:{transform:`translate3d(${Wi.x+12}px, ${Wi.y+10}px, 0)`},children:[u.jsx("span",{className:"workspace-drag-title",children:ku.title}),u.jsxs("span",{className:"workspace-drag-path",children:["workspaces/",Xo(ku.id)]})]}):null,Ae?u.jsx("div",{className:"workspace-editor-overlay",onKeyDown:xa,role:"presentation",children:u.jsxs("form",{className:"workspace-editor",onKeyDown:xa,onSubmit:x=>void C0(x),children:[u.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-title",children:"Workspace name"}),u.jsx("input",{autoFocus:!0,id:"workspace-title",onChange:qu,onKeyDown:xa,value:Ae.title}),Ae.mode==="create"?u.jsxs(u.Fragment,{children:[u.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-group",children:"Group"}),u.jsx("select",{id:"workspace-group",onChange:Ua,onKeyDown:xa,value:Ae.groupId??((Ga=v[0])==null?void 0:Ga.id)??"",children:v.map(x=>u.jsx("option",{value:x.id,children:x.title},x.id))})]}):null,u.jsxs("div",{className:"workspace-editor-actions",children:[u.jsx("button",{type:"button",onClick:Zr,children:"Cancel"}),u.jsx("button",{disabled:we,type:"submit",children:we?"Saving...":Ae.mode==="create"?"Create":"Save"})]})]})}):null,tt?u.jsx("div",{className:"workspace-editor-overlay",onKeyDown:fs,role:"presentation",children:u.jsxs("form",{className:"workspace-editor",onKeyDown:fs,onSubmit:x=>void bi(x),children:[u.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-group-title",children:"Group name"}),u.jsx("input",{autoFocus:!0,id:"workspace-group-title",onChange:j0,onKeyDown:fs,value:tt.title}),u.jsxs("div",{className:"workspace-editor-actions",children:[u.jsx("button",{type:"button",onClick:Hn,children:"Cancel"}),u.jsx("button",{type:"submit",children:tt.mode==="create"?"Create":"Save"})]})]})}):null,qe?u.jsx(lN,{currentUser:t,conversations:m,editingEnvironmentKey:du,deploymentSettings:en,environmentDraft:Ar,globalEnvironment:Xe,workspaceEnvironment:Tt,memorySettings:n0,memorySettingsDraft:r0,workspaceMemoryDraft:cu,runtimeSettings:At,runtimeModels:ur,runtimeCodexVersion:Se,runtimeCodexReleasedAt:at,runtimeCodexUpdating:(Bt==null?void 0:Bt.status)==="running",runtimeSettingsDraft:Fl,runtimeSettingsScope:zn,settingsWorkspace:vn,settingsWorkspaceId:Ft,systemDiagnostics:Y,systemDiagnosticsLoading:Te,workspaceGroups:di,workspaceRuntimeSettings:ou,workspaceRuntimeSettingsDraft:Fi,managedUsers:pe,onCancelEnvironmentEdit:mo,onClose:()=>Je(!1),onCreateUser:async x=>{const C=await UD(x);J(N=>[...N,C]),Pe("success","User created")},onDeleteUser:async x=>{await $D(x),J(C=>C.filter(N=>N.id!==x)),Pe("success","User deleted")},onSaveDeploymentSettings:Pf,onDeleteEnvironment:x=>void fo(x),onDraftChange:Aa,onEditEnvironment:x0,onRevealEnvironmentValue:x=>void sl(x),onSaveBaseMemoryItems:x=>mr(x),onSaveResponsibility:async(x,C)=>{try{const N=await qd(x,{responsibility:C});return Or(N),ee("connected"),Pe("success","Workspace responsibility saved"),N.responsibility}catch(N){throw console.error(N),ee("error"),Pe("error","Failed to save workspace responsibility"),N}},onSaveWorkspaceMemoryItems:x=>Ft?ll(Ft,x):Promise.reject(new Error("No workspace selected")),onRuntimeDraftChange:$i,onCodexAccountSwitched:async()=>{Pe("success","Codex account selection saved"),(await Jx()).codexAccountsReady&&await Promise.all([us(!0),ga(!0),cs()])},onUpdateCodexCli:()=>{Yr(!0),gi(!0)},onRuntimeScopeChange:sa,onSettingsWorkspaceChange:$f,onSubmitRuntimeSettings:x=>void Ff(x),onWorkspaceRuntimeDraftChange:Gl,onWorkspaceRuntimeReset:x=>Ft?void co(Ft,x):void 0,revealedEnvironmentKeys:i0,onSubmitEnvironment:x=>void Du(x),onRefreshSystemDiagnostics:()=>void ds(),onUpdateUser:async(x,C)=>{const N=await HD(x,C);J($=>$.map(W=>W.id===N.id?N:W)),Pe("success","User updated")}}):null,wn?u.jsx(iN,{currentReleasedAt:at,currentVersion:Se,job:Bt,latest:Ta,latestChecking:_f,starting:Gn,onClose:()=>Yr(!1),onRefresh:()=>void gi(),onStart:()=>void Eu()}):null,Vl&&Ze?u.jsx(tN,{conversation:Ze,clockNow:Vn,knowledgeDraft:rn,workspaceKnowledge:a0,tokenUsage:as,onCancelKnowledgeEdit:()=>gn(Cc),onDeleteKnowledge:x=>void Ru(Ze.id,x),onEditKnowledge:xi,onKnowledgeDraftChange:gn,onSubmitKnowledge:x=>void ho(Ze.id,x),onClose:()=>Ea(!1)}):null,Pi?u.jsx(nN,{conversations:m,onClose:()=>yn(!1),workspaceGroups:di}):null,Na?u.jsx(rN,{busy:Lf||fu,conversation:Xr??null,conversationId:ua,forceStopBusy:fu,preview:(Ln==null?void 0:Ln.conversationId)===ua?Ln:null,previewLoading:Ps,result:l0,status:c0,warmup:Ma,workspaceGroups:di,onClose:()=>ii(!1),onCancelResetPreview:()=>kn(null),onForceStop:()=>void Vf(),onPreviewReset:()=>void y0(),onStartBlankContext:()=>void zu(),onResetRuntime:x=>void v0(x),onSaveResetSelection:Mr,onWorkspaceChange:x=>{$s(x),za(null),kn(null)},onWarmupChange:Gi}):null,B?u.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>!ne&&U(null),children:u.jsxs("form",{className:"dialog-card clone-dialog",onSubmit:w0,onMouseDown:x=>x.stopPropagation(),children:[u.jsxs("header",{children:[u.jsxs("div",{children:[u.jsx("h2",{children:"Clone workspace"}),u.jsx("p",{children:"复制成功完成的对话历史与可复用配置到独立 workspace。历史将分批整理压缩,优先保留有效决策与未完成事项。"})]}),u.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>U(null),type:"button",children:"×"})]}),u.jsxs("label",{children:[u.jsx("span",{children:"Name"}),u.jsx("input",{autoFocus:!0,value:B.name,onChange:x=>U(C=>C&&{...C,name:x.target.value})})]}),u.jsxs("label",{children:[u.jsx("span",{children:"Group"}),u.jsx("select",{value:B.groupId,onChange:x=>U(C=>C&&{...C,groupId:x.target.value}),children:di.map(x=>u.jsx("option",{value:x.id,children:x.title},x.id))})]}),u.jsxs("label",{children:[u.jsxs("span",{children:[u.jsx("input",{type:"checkbox",checked:B.excludeTopicHistory,disabled:ne,onChange:x=>U(C=>C&&{...C,excludeTopicHistory:x.target.checked})})," 排除 Topic 相关历史回复"]}),u.jsx("small",{children:"保留用户直接输入;Topic 消息和成员关系原本就不复制。普通对话中转述的 Topic 内容不会自动清除。"})]}),u.jsxs("footer",{children:[u.jsx("button",{className:"secondary",disabled:ne,onClick:()=>U(null),type:"button",children:"Cancel"}),u.jsx("button",{disabled:ne||!B.name.trim(),type:"submit",children:ne?"Cloning...":"Clone"})]})]})}):null,z?u.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>M(null),children:u.jsxs("section",{"aria-labelledby":"system-event-detail-title","aria-modal":"true",className:"dialog-card system-event-detail-dialog",onMouseDown:x=>x.stopPropagation(),role:"dialog",children:[u.jsxs("header",{children:[u.jsxs("div",{children:[u.jsx("h2",{id:"system-event-detail-title",children:z.title}),u.jsx("p",{children:ct(z.createdAt)})]}),u.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>M(null),type:"button",children:"×"})]}),u.jsx("div",{className:"system-event-detail-content",children:u.jsx(Go,{content:z.fullDetail??z.detail??"No additional details.",conversation:Ze,streaming:!1,onPreviewArtifact:ca,onCopyArtifactUrl:pa,copiedArtifactUrl:Sn})}),u.jsx("footer",{children:u.jsx("button",{className:"secondary",onClick:()=>M(null),type:"button",children:"Close"})})]})}):null,He?u.jsx("div",{className:"memory-editor-overlay",onClick:()=>{et||wt(null)},role:"presentation",children:u.jsxs("section",{"aria-label":"Confirm workspace recycle","aria-modal":"true",className:"memory-delete-dialog workspace-delete-dialog",onClick:x=>x.stopPropagation(),role:"dialog",children:[u.jsxs("header",{children:[u.jsx("strong",{children:"Move Workspace to Recycle"}),u.jsx("button",{"aria-label":"Close workspace recycle confirmation",className:"memory-icon-button",disabled:et,onClick:()=>wt(null),title:"Close",type:"button",children:"×"})]}),u.jsxs("p",{children:["Move ",u.jsx("strong",{children:He.title})," to recycle?"]}),u.jsx("code",{children:He.workspacePath}),u.jsxs("div",{className:"memory-delete-actions",children:[u.jsx("button",{className:"memory-dialog-button",disabled:et,onClick:()=>wt(null),type:"button",children:"Cancel"}),u.jsx("button",{className:"memory-dialog-button danger",disabled:et,onClick:()=>void ol(He),type:"button",children:et?"Moving...":"Move to recycle"})]})]})}):null,li?u.jsxs("div",{className:`app-toast ${li.tone}`,role:"status",children:[u.jsx("strong",{children:li.text}),li.detail?u.jsx("pre",{children:li.detail}):null]}):null,u.jsxs("section",{className:"conversation",children:[u.jsxs("header",{className:"topbar",children:[u.jsxs("div",{className:"topbar-main",children:[u.jsx("button",{"aria-label":"Show workspaces",className:"mobile-workspace-menu",onClick:()=>ie(!0),title:"Workspaces",type:"button",children:u.jsx(UM,{})}),u.jsxs("div",{className:"topbar-heading",children:[u.jsx("div",{className:"topbar-title-row",children:u.jsx("h1",{children:(Ze==null?void 0:Ze.title)??"New workspace"})}),Ze?u.jsxs("p",{className:"topbar-workspace",children:["workspaces/",Xo(Ze.id)]}):null]})]}),u.jsx("div",{className:"topbar-actions",children:Ze?u.jsxs(u.Fragment,{children:[Ze.threadUpgradeRequired?u.jsx("button",{"aria-label":"Reset required for latest thread tools",className:"topbar-icon-button thread-upgrade-button",onClick:Mu,title:`当前 Thread 工具集已过期(${Ze.threadCapabilityVersion} / ${Ze.requiredThreadCapabilityVersion}),点击进行 Reset`,type:"button",children:u.jsx(zx,{})}):null,u.jsx("button",{"aria-label":"Clone workspace",className:"topbar-icon-button",onClick:ya,title:"Clone workspace",type:"button",children:u.jsx(qM,{})}),u.jsxs("button",{className:`context-button has-usage ${t4(fi??0)}`,onClick:()=>Ea(!0),style:{"--context-usage":`${Of(fi??0)}%`},title:as&&fi!==null?`Context ${Math.round(fi)}% · ${jr(as.totalTokens)} / ${Kd(as.modelContextWindow)}`:"Context 0% · no usage recorded yet",type:"button",children:[u.jsx("span",{children:"Context"}),u.jsxs("strong",{children:[Math.round(fi??0),"%"]})]}),u.jsx("button",{"aria-label":"Workspace settings",className:"topbar-icon-button",onClick:p0,title:"Workspace settings",type:"button",children:u.jsx(h5,{})})]}):null})]}),(Ze==null?void 0:Ze.status)==="initialization_failed"&&Ze.cloneLineage?u.jsxs("div",{className:"clone-initialization-error",children:[u.jsxs("div",{children:[u.jsx("strong",{children:"Clone initialization failed"}),u.jsx("span",{children:Ze.cloneLineage.initializationError??"The runtime could not initialize this clone."})]}),u.jsx("button",{onClick:()=>void go(),type:"button",children:"Retry with a clean thread"})]}):null,u.jsx("div",{className:"stream",onScroll:()=>void f0(),ref:ui,style:{scrollPaddingBottom:gu},children:u.jsxs("div",{className:"stream-inner",style:{paddingBottom:gu},children:[nl.length===0?u.jsx("div",{className:"empty-state",children:u.jsx("h2",{children:"Start a workspace"})}):null,u.jsxs("section",{className:"message-log","aria-label":"Conversation messages",children:[Ze!=null&&Ze.cloneLineage&&La.size>0?u.jsxs("div",{className:"clone-history-boundary clone-history-source",children:[u.jsxs("strong",{children:["Inherited from ",Ze.cloneLineage.sourceWorkspaceTitle]}),u.jsxs("span",{children:["through ",ct(Ze.cloneLineage.snapshotAt)," · ",Ze.cloneLineage.importedMessageCount," messages"]})]}):null,(Va=Nt==null?void 0:Nt.history)!=null&&Va.hasMoreBefore?u.jsx("button",{className:"history-loader",type:"button",disabled:Nt.loadingOlder,"aria-busy":Nt.loadingOlder,onClick:()=>b&&void Ba(b),children:Nt.loadingOlder?"正在加载更早消息…":"加载更早消息"}):null,ro.map((x,C)=>{var je,Ve,De;const N=((je=x.user)==null?void 0:je.type)==="system",$=x.turnIds.some(Be=>La.has(Be)),W=ro[C+1],oe=$&&(!W||!W.turnIds.some(Be=>La.has(Be)));return u.jsxs(D.Fragment,{children:[u.jsxs("section",{className:`turn-group${$?" clone-history-turn":""}`,"data-turn-id":x.id,children:[x.user?u.jsxs("div",{className:`turn-panel ${N?"system-turn":"user-turn"}`,children:[Po(x.user,Ze,ca,pa,Sn,Jt,ki,wa,M),u.jsx(Dc,{copied:Vi===`${N?"system":"user"}-${x.id}-bottom`,content:Rc(x.user),id:`${N?"system":"user"}-${x.id}-bottom`,timestamp:x.user.createdAt,variant:"outside",onCopy:pi})]}):null,x.followupUsers.length>0?u.jsx("div",{className:"turn-followup-users","aria-label":"Additional turn input",children:x.followupUsers.map(Be=>u.jsxs("div",{className:"turn-panel user-turn followup-user-turn",children:[u.jsx("span",{className:"followup-user-label",children:"Added while running"}),Po(Be,Ze,ca,pa,Sn,Jt,ki,wa,M),u.jsx(Dc,{copied:Vi===`user-${Be.id}-bottom`,content:Rc(Be),id:`user-${Be.id}-bottom`,timestamp:Be.createdAt,variant:"outside",onCopy:pi})]},Be.id))}):null,(Ve=x.acceptedSystemInputs)==null?void 0:Ve.map(Be=>u.jsxs("div",{className:"turn-panel system-turn",children:[Po(Be,Ze,ca,pa,Sn,Jt,ki,wa,M),u.jsx(Dc,{copied:Vi===`system-${Be.id}-bottom`,content:Rc(Be),id:`system-${Be.id}-bottom`,timestamp:Be.createdAt,variant:"outside",onCopy:pi})]},Be.id)),x.agentItems.length>0||x.stopped?u.jsx(px,{group:x,conversation:Ze,allowProcessView:!$,copiedFooter:Vi===`agent-${x.id}-bottom`,copiedArtifactUrl:Sn,running:!$&&Bc(x.turnIds,rl),onCopyArtifactUrl:pa,onCopyBubble:pi,onPreviewArtifact:ca,onLoadProcessDetails:Be=>Ze&&!$?E0(Ze.id,Be):void 0,onRespondApproval:Jt,onRespondWorkspaceChangeProposal:ki,onRespondKnowledgeProposal:wa,onOpenSystemEvent:M}):null,(De=x.trailingSystemItems)==null?void 0:De.map(Be=>u.jsxs("div",{className:"turn-panel system-turn",children:[Po(Be,Ze,ca,pa,Sn,Jt,ki,wa,M),u.jsx(Dc,{copied:Vi===`system-${Be.id}-bottom`,content:Rc(Be),id:`system-${Be.id}-bottom`,timestamp:Be.createdAt,variant:"outside",onCopy:pi})]},Be.id))]}),oe?u.jsx("div",{className:"clone-history-boundary clone-history-end",children:"Clone starts here"}):null]},x.id)})]})]})}),u.jsxs("form",{className:"composer",onSubmit:hs,ref:vu,children:[ma?u.jsxs("div",{className:`global-activity ${ma.tone??"running"}`,children:[is?u.jsx("button",{"aria-label":"Stop current workspace activity",className:"turn-stop activity-stop",onClick:()=>void Gf(),title:"Stop current workspace activity",type:"button",children:u.jsx(ON,{})}):u.jsx("span",{className:"activity-wait-dot","aria-hidden":"true"}),u.jsxs("div",{className:"global-activity-text",children:[u.jsx("span",{children:ma.title}),ma.detail?u.jsx("small",{children:ma.detail}):null]}),is?u.jsx("span",{className:"activity-spinner","aria-hidden":"true"}):null]}):null,u.jsxs("div",{className:"composer-panel",children:[u.jsx("textarea",{disabled:d0.textareaDisabled,onChange:x=>Uu(x.target.value),onKeyDown:$u,placeholder:"Cmd/Ctrl + Enter",ref:Ki,value:o}),u.jsxs("button",{"aria-label":"Send message",className:"composer-send",disabled:d0.sendDisabled,type:"submit",children:[u.jsx(IN,{}),u.jsxs("span",{className:"composer-send-tooltip",role:"tooltip",children:[u.jsxs("span",{children:[u.jsx("kbd",{children:"⌘ / Ctrl + Enter"})," Send or add to running turn"]}),u.jsxs("span",{children:[u.jsx("kbd",{children:"⇧ + ⌘ / Ctrl + Enter"})," New turn or queue"]})]})]})]})]}),dr?u.jsx("div",{className:"artifact-lightbox",onClick:()=>ca(null),role:"presentation",children:u.jsxs("figure",{className:"artifact-lightbox-card",onClick:x=>x.stopPropagation(),children:[u.jsx("button",{"aria-label":"Close preview",className:"artifact-lightbox-close",onClick:()=>ca(null),type:"button",children:"×"}),u.jsx("img",{alt:dr.name,src:dr.url}),u.jsxs("figcaption",{children:[u.jsx("span",{children:dr.name}),u.jsxs("div",{className:"artifact-lightbox-actions",children:[u.jsx("a",{href:dr.url,rel:"noreferrer",target:"_blank",children:"Open in new tab"}),u.jsx("button",{onClick:()=>void pa(dr),type:"button",children:Sn===dr.url?"Copied":"Copy URL"})]})]})]})}):null]})]}),b&&u.jsx(MA,{ownerId:b,ownerName:(Ze==null?void 0:Ze.title)??"Workspace",request:hx,onExpanded:q,renderMember:x=>u.jsx(eN,{workspaceId:x},x)},b)]})}async function hx(e,t,n){const a=ze(e),l=await fetch(a,{method:n??(t===void 0?"GET":"POST"),headers:t===void 0?void 0:{"Content-Type":"application/json"},body:t===void 0?void 0:JSON.stringify(t)});return await Fe(l,{url:a}),l.json()}function eN({workspaceId:e}){var J;const[t,n]=D.useState(null),[a,l]=D.useState(""),[o,c]=D.useState(null),[f,h]=D.useState(""),[m,g]=D.useState(!1),[v,k]=D.useState(!1),[b,T]=D.useState(null),[A,q]=D.useState(null),z=D.useRef(!1),M=D.useRef(new Map),B=`conversations/${encodeURIComponent(e)}`;function U(Y,ge=!1){n(Te=>{const H=new Map;for(const _ of[...(Te==null?void 0:Te.events)??[],...M.current.values(),...Y.events])H.set(_.id,_);return Te?{...Y,messages:Pd(ge?Te.messages:Y.messages,ge?Y.messages:Te.messages),turns:Gd(ge?Y.turns:Te.turns,ge?Te.turns:Y.turns),timelineNodes:Vd(ge?Y.timelineNodes??[]:Te.timelineNodes??[],ge?Te.timelineNodes??[]:Y.timelineNodes??[]),events:[...H.values()],history:ge||!z.current?Y.history:Te.history}:{...Y,events:[...H.values()]}})}async function ne(){U(await Ko(e))}D.useEffect(()=>{let Y=!0,ge=!1;const Te=async()=>{if(!ge){ge=!0;try{const _=await Ko(e);Y&&(U(_),l(""))}catch(_){Y&&l(String(_))}finally{ge=!1}}};Te();const H=window.setInterval(()=>void Te(),2e3);return()=>{Y=!1,window.clearInterval(H)}},[e]);async function L(Y,ge={}){g(!0),l("");try{return await hx(`${B}/${Y}`,ge),await ne(),!0}catch(Te){return l(String(Te)),!1}finally{g(!1)}}const K=(Y,ge)=>{Y.approvalTurnId&&Y.approvalRequestId!==void 0&&L(`turns/${Y.approvalTurnId}/approvals/${encodeURIComponent(String(Y.approvalRequestId))}`,{decision:ge})},ie=async(Y,ge,Te)=>{const H=Y.workspaceChangeProposalId??Y.responsibilityProposalId;return H?L(`workspace-change-proposals/${encodeURIComponent(H)}`,{decision:ge,payload:ge==="accept"?Te??Y.workspaceChangePayload:void 0}):!1},Q=async(Y,ge,Te)=>{if(Y.knowledgeProposalId)try{await L(`knowledge-proposals/${encodeURIComponent(Y.knowledgeProposalId)}`,{decision:ge,knowledge:ge==="accept"?JSON.parse(Te??Y.body):void 0})}catch(H){l(String(H))}};async function F(Y){try{const ge=await Promise.all(Y.map(Te=>Ox(e,Te)));for(const Te of ge.flat())M.current.set(Te.id,Te);await ne()}catch(ge){l(String(ge))}}async function he(){const Y=t==null?void 0:t.history;if(!Y||v)return;const ge=Y.oldestTimelineAt&&Y.oldestTimelineSequence!==null?`${Y.oldestTimelineAt}|${Y.oldestTimelineSequence}`:Y.oldestMessageCreatedAt;if(ge){k(!0);try{const Te=await Ko(e,{before:ge});z.current=!0,U(Te,!0)}catch(Te){l(String(Te))}finally{k(!1)}}}const ce=t==null?void 0:t.turns.find(Y=>["running","queued","waiting_input","waiting_approval"].includes(Y.status)),Ie=t?yx(t.messages,t.events,t.turns,t.timelineNodes??[],(ce==null?void 0:ce.id)??null,new Map):[],be=Y=>{navigator.clipboard.writeText(Y.url).then(()=>c(Y.url)).catch(ge=>l(String(ge)))},pe=Y=>Po(Y,t??void 0,T,be,o,K,ie,Q,q);return u.jsxs("div",{className:"cotask-member-content",children:[a&&u.jsx("p",{role:"alert",className:"cotask-error",children:a}),t?u.jsxs(u.Fragment,{children:[u.jsxs("header",{className:"cotask-member-toolbar",children:[u.jsxs("span",{children:["Member status: ",t.status]}),(ce||t.status==="running")&&u.jsx("button",{disabled:m,onClick:()=>void L("turns/interrupt"),children:"Stop"})]}),((J=t.history)==null?void 0:J.hasMoreBefore)&&u.jsx("button",{disabled:v,onClick:()=>void he(),children:v?"Loading…":"Load earlier history"}),Ie.map(Y=>{var ge,Te;return u.jsxs("section",{className:"turn-group",children:[Y.user&&pe(Y.user),Y.followupUsers.map(H=>u.jsx(D.Fragment,{children:pe(H)},H.id)),(ge=Y.acceptedSystemInputs)==null?void 0:ge.map(H=>u.jsx(D.Fragment,{children:pe(H)},H.id)),u.jsx(px,{group:Y,conversation:t,copiedFooter:o===Y.id,copiedArtifactUrl:o,running:!!(ce&&Y.turnIds.includes(ce.id)),onCopyArtifactUrl:be,onCopyBubble:(H,_)=>{navigator.clipboard.writeText(_).then(()=>c(H)).catch(te=>l(String(te)))},onLoadProcessDetails:F,onPreviewArtifact:T,onRespondApproval:K,onRespondWorkspaceChangeProposal:ie,onRespondKnowledgeProposal:Q,onOpenSystemEvent:q}),(Te=Y.trailingSystemItems)==null?void 0:Te.map(H=>u.jsx(D.Fragment,{children:pe(H)},H.id))]},Y.id)}),!Ie.length&&u.jsx("p",{children:"Member created. Waiting for task activity."}),(ce==null?void 0:ce.status)==="waiting_input"&&u.jsxs("form",{className:"cotask-member-reply",onSubmit:Y=>{Y.preventDefault(),f.trim()&&L("turns/steer",{message:f}).then(ge=>{ge&&h("")})},children:[u.jsxs("label",{children:["Answer the member’s question",u.jsx("textarea",{value:f,onChange:Y=>h(Y.target.value),disabled:m})]}),u.jsx("button",{disabled:m||!f.trim(),type:"submit",children:"Send reply"})]})]}):u.jsx("p",{children:"Loading member activity…"}),b&&u.jsxs("div",{className:"cotask-detail-overlay",role:"dialog","aria-label":"Artifact preview",onKeyDown:Y=>{Y.key==="Escape"&&(Y.stopPropagation(),T(null))},children:[u.jsx("button",{onClick:()=>T(null),children:"Close preview"}),u.jsxs("a",{href:b.url,target:"_blank",rel:"noreferrer",children:["Open in new tab: ",b.name]}),u.jsx("iframe",{title:b.name,src:b.url,sandbox:"allow-scripts",referrerPolicy:"no-referrer"})]}),A&&u.jsxs("div",{className:"cotask-detail-overlay",role:"dialog","aria-label":"Execution event",onKeyDown:Y=>{Y.key==="Escape"&&(Y.stopPropagation(),q(null))},children:[u.jsx("button",{onClick:()=>q(null),children:"Close details"}),u.jsx("h3",{children:A.title}),u.jsx(Go,{content:A.fullDetail??A.detail??"No further details",conversation:t??void 0,onPreviewArtifact:T,onCopyArtifactUrl:be,copiedArtifactUrl:o})]})]})}function tN({conversation:e,clockNow:t,knowledgeDraft:n,workspaceKnowledge:a,tokenUsage:l,onCancelKnowledgeEdit:o,onDeleteKnowledge:c,onEditKnowledge:f,onKnowledgeDraftChange:h,onSubmitKnowledge:m,onClose:g}){const[v,k]=D.useState("overview"),[b,T]=D.useState(!1),[A,q]=D.useState(!1),[z,M]=D.useState(null),[B,U]=D.useState(null),[ne,L]=D.useState(!1),[K,ie]=D.useState(null),[Q,F]=D.useState(null),[he,ce]=D.useState(!1),[Ie,be]=D.useState(null),[pe,J]=D.useState(null),Y=Yx(l),ge=s1(e,e.status),Te=z?xD(z):null;D.useEffect(()=>{T(!1),M(null),U(null),ie(null),F(null),be(null),J(null)},[e.id]),D.useEffect(()=>{v==="additionalContext"&&!K&&_()},[v,K]),D.useEffect(()=>{v==="compactions"&&!Ie&&te()},[v,Ie]);const H=()=>{T(!0),q(!0),U(null),Ez(e.id).then(O=>M(O)).catch(O=>{const ee=pt(O);U(ee.detail?`${ee.message}
|
|
359
359
|
${ee.detail}`:ee.message)}).finally(()=>q(!1))},_=()=>{L(!0),F(null),Mz(e.id).then(O=>ie(O)).catch(O=>{const ee=pt(O);F(ee.detail?`${ee.message}
|
|
360
360
|
${ee.detail}`:ee.message)}).finally(()=>L(!1))},te=()=>{ce(!0),J(null),zz(e.id).then(O=>be(O)).catch(O=>{const ee=pt(O);J(ee.detail?`${ee.message}
|
|
361
|
-
${ee.detail}`:ee.message)}).finally(()=>ce(!1))};return u.jsx("div",{className:"context-panel-overlay workspace-context-overlay",onClick:g,role:"presentation",children:u.jsxs("section",{"aria-label":"Workspace context",className:"context-panel workspace-context-panel",onClick:O=>O.stopPropagation(),children:[u.jsxs("header",{className:"context-panel-header workspace-context-header",children:[u.jsxs("div",{children:[u.jsx("h2",{children:"Workspace Context"}),u.jsx("p",{children:"Long-lived context assets and observable state for this workspace."})]}),u.jsx("button",{"aria-label":"Close context panel",onClick:g,type:"button",children:"×"})]}),u.jsxs("div",{className:"workspace-context-body",children:[u.jsxs("nav",{className:"settings-nav workspace-context-nav","aria-label":"Workspace context sections",children:[u.jsxs("button",{className:v==="overview"?"active":void 0,onClick:()=>k("overview"),type:"button",children:[u.jsx("span",{children:"Overview"}),u.jsx("small",{children:"Identity + state"})]}),u.jsxs("button",{className:v==="responsibility"?"active":void 0,onClick:()=>k("responsibility"),type:"button",children:[u.jsx("span",{children:"Responsibility"}),u.jsx("small",{children:"Long-lived role"})]}),u.jsxs("button",{className:v==="knowledge"?"active":void 0,onClick:()=>k("knowledge"),type:"button",children:[u.jsx("span",{children:"Knowledge"}),u.jsx("small",{children:"Sources + skills"})]}),u.jsxs("button",{className:v==="runtime"?"active":void 0,onClick:()=>k("runtime"),type:"button",children:[u.jsx("span",{children:"Runtime View"}),u.jsx("small",{children:"Thread + tokens"})]}),u.jsxs("button",{className:v==="compactions"?"active":void 0,onClick:()=>k("compactions"),type:"button",children:[u.jsx("span",{children:"Compactions"}),u.jsx("small",{children:"Context history"})]}),u.jsxs("button",{className:v==="additionalContext"?"active":void 0,onClick:()=>k("additionalContext"),type:"button",children:[u.jsx("span",{children:"Additional Context"}),u.jsx("small",{children:"Injected keys"})]})]}),u.jsx("div",{className:"workspace-context-content",children:v==="overview"?u.jsxs("div",{className:"workspace-context-grid",children:[u.jsxs("section",{className:`context-card wide workspace-status-detail ${ge}`,children:[u.jsx("h3",{children:"Current Status"}),u.jsx(Ct,{label:"Status",value:Zd(ge,e.nextWakeup,t)}),e.nextWakeup?u.jsxs(u.Fragment,{children:[u.jsx(Ct,{label:"Wakeup state",value:e.nextWakeup.status}),u.jsx(Ct,{label:"Wake at",value:$c(e.nextWakeup.wakeAt)}),e.nextWakeup.status==="scheduled"?u.jsx(Ct,{label:"Remaining",value:hf(e.nextWakeup,t)}):null,u.jsx(Ct,{label:"Created by",value:e.nextWakeup.createdBy}),u.jsx(Ct,{label:"Attempts",value:`${e.nextWakeup.attemptCount} / ${e.nextWakeup.maxAttempts}`,mono:!0}),u.jsxs("div",{className:"workspace-status-detail-text",children:[u.jsx("span",{children:"Wakeup instruction"}),u.jsx("pre",{children:e.nextWakeup.instruction})]}),e.nextWakeup.error?u.jsxs("div",{className:"workspace-status-detail-text error",children:[u.jsx("span",{children:"Wakeup error"}),u.jsx("pre",{children:e.nextWakeup.error})]}):null]}):null,e.statusError?u.jsxs("div",{className:"workspace-status-detail-text error",children:[u.jsx("span",{children:"Error"}),u.jsx("pre",{children:e.statusError})]}):e.status==="error"||e.status==="initialization_failed"?u.jsx("p",{className:"context-muted",children:"No persisted error detail is available for this status."}):null]}),u.jsxs("section",{className:"context-card",children:[u.jsx("h3",{children:"Workspace"}),u.jsx(Ct,{label:"Name",value:e.title}),u.jsx(Ct,{label:"ID",value:`workspaces/${Xo(e.id)}`,mono:!0}),u.jsx(Ct,{label:"Path",value:e.workspacePath,mono:!0})]}),u.jsxs("section",{className:"context-card",children:[u.jsx("h3",{children:"Context Assets"}),u.jsx(Ct,{label:"Responsibility",value:e.responsibility.trim()?"configured":"missing"}),u.jsx(Ct,{label:"Memory",value:e.memory.trim()?"configured":"empty"}),u.jsx(Ct,{label:"Knowledge",value:`${a.length} item${a.length===1?"":"s"}`})]}),u.jsxs("section",{className:"context-card wide",children:[u.jsx("h3",{children:"Current Responsibility"}),e.responsibility.trim()?u.jsx("div",{className:"context-markdown-preview",children:Os(e.responsibility,e)}):u.jsx("p",{className:"context-muted",children:"No approved responsibility is configured yet."})]}),u.jsxs("section",{className:"context-card wide",children:[u.jsx("h3",{children:"Knowledge Index"}),u.jsx(mx,{items:a,onDelete:c,onEdit:O=>{f(O),k("knowledge")}})]})]}):v==="responsibility"?u.jsxs("section",{className:"context-tab-surface",children:[u.jsx("header",{className:"settings-section-header",children:u.jsxs("div",{children:[u.jsx("h3",{children:"Workspace Responsibility"}),u.jsx("p",{children:"User-approved long-lived role for this workspace. Edit it from Settings in workspace scope."})]})}),e.responsibility.trim()?u.jsx("div",{className:"context-card context-markdown-preview",children:Os(e.responsibility,e)}):u.jsx("p",{className:"context-card context-muted",children:"No approved responsibility is configured yet."})]}):v==="knowledge"?u.jsx(kN,{draft:n,items:a,scope:"workspace",workspaceName:e.title,onCancel:o,onDelete:c,onDraftChange:h,onEdit:f,onSubmit:m}):v==="runtime"?u.jsxs("div",{className:"workspace-context-grid",children:[u.jsxs("section",{className:"context-card",children:[u.jsx("h3",{children:"Runtime"}),u.jsx(Ct,{label:"Runtime thread",value:e.codexThreadId??"not started",mono:!0}),u.jsxs("div",{className:"thread-read-actions",children:[u.jsx("button",{disabled:A,onClick:H,type:"button",children:A?"Reading...":"Read Codex thread"}),b?u.jsx("button",{disabled:A,onClick:()=>T(!1),type:"button",children:"Hide"}):null]})]}),u.jsxs("section",{className:"context-card",children:[u.jsx("h3",{children:"Token Window"}),l?u.jsxs(u.Fragment,{children:[u.jsx(Ct,{label:"Used",value:Y===null?"unknown":`${Math.round(Y)}%`,mono:!0}),u.jsx(Ct,{label:"Latest usage",value:l.modelContextWindow?`${jr(l.totalTokens)} / ${jr(l.modelContextWindow)}`:jr(l.totalTokens),mono:!0}),Y!==null?u.jsx("div",{className:`context-token-bar ${t4(Y)}`,children:u.jsx("span",{style:{width:`${Of(Y)}%`}})}):null,u.jsx(Ct,{label:"Input / output",value:`${Kd(l.inputTokens)} / ${Kd(l.outputTokens)}`,mono:!0}),u.jsx(Ct,{label:"Reasoning",value:Kd(l.reasoningOutputTokens),mono:!0}),u.jsxs("p",{className:"context-muted",children:["Updated ",ct(l.createdAt),"."]})]}):u.jsx("p",{className:"context-muted",children:"No token usage event has been observed in the loaded event window yet."})]}),b?u.jsxs("section",{className:"context-card wide thread-read-panel",children:[u.jsx("h3",{children:"Runtime thread profile"}),u.jsx("p",{className:"context-muted",children:"One-time live thread/read response from Codex app-server. Seele does not persist this profile result."}),A?u.jsx("p",{className:"context-muted",children:"Reading Codex thread..."}):B?u.jsx("pre",{className:"thread-read-error",children:B}):z?u.jsxs(u.Fragment,{children:[Te?u.jsx(NN,{summary:Te}):null,u.jsxs("details",{className:"thread-read-raw",open:!0,children:[u.jsx("summary",{children:"Raw thread/read JSON"}),u.jsx("pre",{className:"thread-read-dump",children:JSON.stringify(z,null,2)})]})]}):u.jsx("p",{className:"context-muted",children:"No thread/read result loaded yet."})]}):null]}):v==="compactions"?u.jsxs("section",{className:"context-tab-surface",children:[u.jsxs("header",{className:"settings-section-header",children:[u.jsxs("div",{children:[u.jsx("h3",{children:"Context Compactions"}),u.jsx("p",{children:"Compaction history recorded for the current runtime thread."})]}),u.jsx("button",{className:"context-refresh-button",disabled:he,onClick:te,type:"button",children:he?"Refreshing...":"Refresh"})]}),pe?u.jsx("pre",{className:"thread-read-error",children:pe}):he&&!Ie?u.jsx("p",{className:"context-card context-muted",children:"Loading compaction history..."}):Ie!=null&&Ie.length?u.jsx("div",{className:"context-compaction-list",children:Ie.map(O=>u.jsxs("article",{className:"context-compaction-item",children:[u.jsxs("div",{className:"context-compaction-heading",children:[u.jsx("time",{children:ct(O.completedAt??O.usageObservedAt??O.startedAt??"")}),u.jsx("span",{className:`context-compaction-status ${O.status}`,children:O.status==="completed"?"Completed":"Running"})]}),u.jsx("dl",{className:"context-compaction-facts",children:fD(O).map(ee=>u.jsxs("div",{children:[u.jsx("dt",{children:ee.label}),u.jsx("dd",{children:ee.value})]},ee.label))}),u.jsxs("small",{children:[ql(O.id),O.turnId?` · turn ${ql(O.turnId)}`:""]})]},O.id))}):u.jsx("p",{className:"context-card context-muted",children:"No compaction records yet."})]}):u.jsxs("section",{className:"context-tab-surface thread-read-panel",children:[u.jsx("header",{className:"settings-section-header",children:u.jsxs("div",{children:[u.jsx("h3",{children:"Additional Context"}),u.jsx("p",{children:"One-time live render of the application additionalContext for this workspace. Seele does not persist this preview result."})]})}),
|
|
361
|
+
${ee.detail}`:ee.message)}).finally(()=>ce(!1))};return u.jsx("div",{className:"context-panel-overlay workspace-context-overlay",onClick:g,role:"presentation",children:u.jsxs("section",{"aria-label":"Workspace context",className:"context-panel workspace-context-panel",onClick:O=>O.stopPropagation(),children:[u.jsxs("header",{className:"context-panel-header workspace-context-header",children:[u.jsxs("div",{children:[u.jsx("h2",{children:"Workspace Context"}),u.jsx("p",{children:"Long-lived context assets and observable state for this workspace."})]}),u.jsx("button",{"aria-label":"Close context panel",onClick:g,type:"button",children:"×"})]}),u.jsxs("div",{className:"workspace-context-body",children:[u.jsxs("nav",{className:"settings-nav workspace-context-nav","aria-label":"Workspace context sections",children:[u.jsxs("button",{className:v==="overview"?"active":void 0,onClick:()=>k("overview"),type:"button",children:[u.jsx("span",{children:"Overview"}),u.jsx("small",{children:"Identity + state"})]}),u.jsxs("button",{className:v==="responsibility"?"active":void 0,onClick:()=>k("responsibility"),type:"button",children:[u.jsx("span",{children:"Responsibility"}),u.jsx("small",{children:"Long-lived role"})]}),u.jsxs("button",{className:v==="knowledge"?"active":void 0,onClick:()=>k("knowledge"),type:"button",children:[u.jsx("span",{children:"Knowledge"}),u.jsx("small",{children:"Sources + skills"})]}),u.jsxs("button",{className:v==="runtime"?"active":void 0,onClick:()=>k("runtime"),type:"button",children:[u.jsx("span",{children:"Runtime View"}),u.jsx("small",{children:"Thread + tokens"})]}),u.jsxs("button",{className:v==="compactions"?"active":void 0,onClick:()=>k("compactions"),type:"button",children:[u.jsx("span",{children:"Compactions"}),u.jsx("small",{children:"Context history"})]}),u.jsxs("button",{className:v==="additionalContext"?"active":void 0,onClick:()=>k("additionalContext"),type:"button",children:[u.jsx("span",{children:"Additional Context"}),u.jsx("small",{children:"Injected keys"})]})]}),u.jsx("div",{className:"workspace-context-content",children:v==="overview"?u.jsxs("div",{className:"workspace-context-grid",children:[u.jsxs("section",{className:`context-card wide workspace-status-detail ${ge}`,children:[u.jsx("h3",{children:"Current Status"}),u.jsx(Ct,{label:"Status",value:Zd(ge,e.nextWakeup,t)}),e.nextWakeup?u.jsxs(u.Fragment,{children:[u.jsx(Ct,{label:"Wakeup state",value:e.nextWakeup.status}),u.jsx(Ct,{label:"Wake at",value:$c(e.nextWakeup.wakeAt)}),e.nextWakeup.status==="scheduled"?u.jsx(Ct,{label:"Remaining",value:hf(e.nextWakeup,t)}):null,u.jsx(Ct,{label:"Created by",value:e.nextWakeup.createdBy}),u.jsx(Ct,{label:"Attempts",value:`${e.nextWakeup.attemptCount} / ${e.nextWakeup.maxAttempts}`,mono:!0}),u.jsxs("div",{className:"workspace-status-detail-text",children:[u.jsx("span",{children:"Wakeup instruction"}),u.jsx("pre",{children:e.nextWakeup.instruction})]}),e.nextWakeup.error?u.jsxs("div",{className:"workspace-status-detail-text error",children:[u.jsx("span",{children:"Wakeup error"}),u.jsx("pre",{children:e.nextWakeup.error})]}):null]}):null,e.statusError?u.jsxs("div",{className:"workspace-status-detail-text error",children:[u.jsx("span",{children:"Error"}),u.jsx("pre",{children:e.statusError})]}):e.status==="error"||e.status==="initialization_failed"?u.jsx("p",{className:"context-muted",children:"No persisted error detail is available for this status."}):null]}),u.jsxs("section",{className:"context-card",children:[u.jsx("h3",{children:"Workspace"}),u.jsx(Ct,{label:"Name",value:e.title}),u.jsx(Ct,{label:"ID",value:`workspaces/${Xo(e.id)}`,mono:!0}),u.jsx(Ct,{label:"Path",value:e.workspacePath,mono:!0})]}),u.jsxs("section",{className:"context-card",children:[u.jsx("h3",{children:"Context Assets"}),u.jsx(Ct,{label:"Responsibility",value:e.responsibility.trim()?"configured":"missing"}),u.jsx(Ct,{label:"Memory",value:e.memory.trim()?"configured":"empty"}),u.jsx(Ct,{label:"Knowledge",value:`${a.length} item${a.length===1?"":"s"}`})]}),u.jsxs("section",{className:"context-card wide",children:[u.jsx("h3",{children:"Current Responsibility"}),e.responsibility.trim()?u.jsx("div",{className:"context-markdown-preview",children:Os(e.responsibility,e)}):u.jsx("p",{className:"context-muted",children:"No approved responsibility is configured yet."})]}),u.jsxs("section",{className:"context-card wide",children:[u.jsx("h3",{children:"Knowledge Index"}),u.jsx(mx,{items:a,onDelete:c,onEdit:O=>{f(O),k("knowledge")}})]})]}):v==="responsibility"?u.jsxs("section",{className:"context-tab-surface",children:[u.jsx("header",{className:"settings-section-header",children:u.jsxs("div",{children:[u.jsx("h3",{children:"Workspace Responsibility"}),u.jsx("p",{children:"User-approved long-lived role for this workspace. Edit it from Settings in workspace scope."})]})}),e.responsibility.trim()?u.jsx("div",{className:"context-card context-markdown-preview",children:Os(e.responsibility,e)}):u.jsx("p",{className:"context-card context-muted",children:"No approved responsibility is configured yet."})]}):v==="knowledge"?u.jsx(kN,{draft:n,items:a,scope:"workspace",workspaceName:e.title,onCancel:o,onDelete:c,onDraftChange:h,onEdit:f,onSubmit:m}):v==="runtime"?u.jsxs("div",{className:"workspace-context-grid",children:[u.jsxs("section",{className:"context-card",children:[u.jsx("h3",{children:"Runtime"}),u.jsx(Ct,{label:"Runtime thread",value:e.codexThreadId??"not started",mono:!0}),u.jsxs("div",{className:"thread-read-actions",children:[u.jsx("button",{disabled:A,onClick:H,type:"button",children:A?"Reading...":"Read Codex thread"}),b?u.jsx("button",{disabled:A,onClick:()=>T(!1),type:"button",children:"Hide"}):null]})]}),u.jsxs("section",{className:"context-card",children:[u.jsx("h3",{children:"Token Window"}),l?u.jsxs(u.Fragment,{children:[u.jsx(Ct,{label:"Used",value:Y===null?"unknown":`${Math.round(Y)}%`,mono:!0}),u.jsx(Ct,{label:"Latest usage",value:l.modelContextWindow?`${jr(l.totalTokens)} / ${jr(l.modelContextWindow)}`:jr(l.totalTokens),mono:!0}),Y!==null?u.jsx("div",{className:`context-token-bar ${t4(Y)}`,children:u.jsx("span",{style:{width:`${Of(Y)}%`}})}):null,u.jsx(Ct,{label:"Input / output",value:`${Kd(l.inputTokens)} / ${Kd(l.outputTokens)}`,mono:!0}),u.jsx(Ct,{label:"Reasoning",value:Kd(l.reasoningOutputTokens),mono:!0}),u.jsxs("p",{className:"context-muted",children:["Updated ",ct(l.createdAt),"."]})]}):u.jsx("p",{className:"context-muted",children:"No token usage event has been observed in the loaded event window yet."})]}),b?u.jsxs("section",{className:"context-card wide thread-read-panel",children:[u.jsx("h3",{children:"Runtime thread profile"}),u.jsx("p",{className:"context-muted",children:"One-time live thread/read response from Codex app-server. Seele does not persist this profile result."}),A?u.jsx("p",{className:"context-muted",children:"Reading Codex thread..."}):B?u.jsx("pre",{className:"thread-read-error",children:B}):z?u.jsxs(u.Fragment,{children:[Te?u.jsx(NN,{summary:Te}):null,u.jsxs("details",{className:"thread-read-raw",open:!0,children:[u.jsx("summary",{children:"Raw thread/read JSON"}),u.jsx("pre",{className:"thread-read-dump",children:JSON.stringify(z,null,2)})]})]}):u.jsx("p",{className:"context-muted",children:"No thread/read result loaded yet."})]}):null]}):v==="compactions"?u.jsxs("section",{className:"context-tab-surface",children:[u.jsxs("header",{className:"settings-section-header",children:[u.jsxs("div",{children:[u.jsx("h3",{children:"Context Compactions"}),u.jsx("p",{children:"Compaction history recorded for the current runtime thread."})]}),u.jsx("button",{className:"context-refresh-button",disabled:he,onClick:te,type:"button",children:he?"Refreshing...":"Refresh"})]}),pe?u.jsx("pre",{className:"thread-read-error",children:pe}):he&&!Ie?u.jsx("p",{className:"context-card context-muted",children:"Loading compaction history..."}):Ie!=null&&Ie.length?u.jsx("div",{className:"context-compaction-list",children:Ie.map(O=>u.jsxs("article",{className:"context-compaction-item",children:[u.jsxs("div",{className:"context-compaction-heading",children:[u.jsx("time",{children:ct(O.completedAt??O.usageObservedAt??O.startedAt??"")}),u.jsx("span",{className:`context-compaction-status ${O.status}`,children:O.status==="completed"?"Completed":"Running"})]}),u.jsx("dl",{className:"context-compaction-facts",children:fD(O).map(ee=>u.jsxs("div",{children:[u.jsx("dt",{children:ee.label}),u.jsx("dd",{children:ee.value})]},ee.label))}),u.jsxs("small",{children:[ql(O.id),O.turnId?` · turn ${ql(O.turnId)}`:""]})]},O.id))}):u.jsx("p",{className:"context-card context-muted",children:"No compaction records yet."})]}):u.jsxs("section",{className:"context-tab-surface thread-read-panel",children:[u.jsx("header",{className:"settings-section-header",children:u.jsxs("div",{children:[u.jsx("h3",{children:"Additional Context"}),u.jsx("p",{children:"One-time live render of the application additionalContext for this workspace. Seele does not persist this preview result."})]})}),ne?u.jsx("p",{className:"context-card context-muted",children:"Rendering additionalContext..."}):Q?u.jsx("pre",{className:"thread-read-error",children:Q}):K?u.jsx(AN,{preview:K,refreshing:ne,onRefresh:_}):u.jsx("p",{className:"context-card context-muted",children:"No additionalContext preview loaded yet."})]})})]})]})})}function Tc(e){const t=e instanceof Rs?e.detail:e instanceof Error?e.message:String(e);let n="";if(e instanceof Rs)try{n=JSON.parse(e.body).error??""}catch{}return`${{collaboration_owner_mismatch:"无法添加参与者:所选工作空间与 Topic 不属于同一个平台用户。请检查工作空间的归属;这不是 Topic Owner 角色不匹配。",collaboration_version_conflict:"Topic 已被更新,本次修改未保存。请重新打开编辑后再试。",workspace_owner_required:"工作空间缺少所属用户,无法创建 Topic。请检查工作空间的归属。"}[n]??"Topic 操作失败,请查看以下错误详情。"}
|
|
362
362
|
|
|
363
|
-
${t}`}function nN({conversations:e,onClose:t,workspaceGroups:n}){var H;const[a,l]=D.useState([]),[o,c]=D.useState("active"),[f,h]=D.useState(null),[m,g]=D.useState([]),[v,k]=D.useState(!0),[b,T]=D.useState(null),[A,q]=D.useState(null),[z,M]=D.useState(!1),[B,U]=D.useState(!1),[ae,L]=D.useState(new Set),[K,ie]=D.useState({title:"",publicDescription:"",ownerWorkspaceId:((H=e[0])==null?void 0:H.id)??"",participantWorkspaceIds:[]}),Q=a.find(_=>_.id===f)??null,F=D.useMemo(()=>new Map(e.map(_=>[_.id,_.title])),[e]),he=a.filter(_=>o==="archived"?_.status==="archived":_.status!=="archived"),ce=n.map(_=>({..._,conversations:_.conversations.filter(te=>te.id!==K.ownerWorkspaceId)})).filter(_=>_.conversations.length>0),Ie=()=>{var _;T(null),ie({title:"",publicDescription:"",ownerWorkspaceId:((_=e[0])==null?void 0:_.id)??"",participantWorkspaceIds:[]}),L(new Set),q("create")},be=()=>{!Q||Q.status!=="active"||(T(null),ie({title:Q.title,publicDescription:Q.publicDescription,ownerWorkspaceId:Q.ownerWorkspaceId,participantWorkspaceIds:Q.members.filter(_=>_.role==="participant"&&_.status==="active").map(_=>_.workspaceId)}),L(new Set),q("edit"))},pe=async(_,te=o)=>{var O;k(!0),T(null);try{const ee=await y5();l(ee);const Ae=ee.filter(we=>te==="archived"?we.status==="archived":we.status!=="archived"),ne=(_&&Ae.some(we=>we.id===_)?_:null)??(f&&Ae.some(we=>we.id===f)?f:((O=Ae[0])==null?void 0:O.id)??null);h(ne),g(ne?await Bd(ne):[])}catch(ee){T(Tc(ee))}finally{k(!1)}};D.useEffect(()=>{pe()},[]),D.useEffect(()=>{const _=window.setInterval(()=>{(async()=>{try{const te=await y5();l(te),f&&te.some(O=>O.id===f)&&g(await Bd(f))}catch{}})()},1e4);return()=>window.clearInterval(_)},[f]);const J=async _=>{h(_),T(null);try{g(await Bd(_))}catch(te){T(Tc(te))}},Y=async _=>{var O;if(_===o)return;c(_),T(null);const te=((O=a.find(ee=>_==="archived"?ee.status==="archived":ee.status!=="archived"))==null?void 0:O.id)??null;if(h(te),!te){g([]);return}try{g(await Bd(te))}catch(ee){T(Tc(ee))}},ge=async _=>{var te;if(_.preventDefault(),!(!K.title.trim()||!K.ownerWorkspaceId)){U(!0),T(null);try{const O=A==="edit"&&Q?await ZM(Q.id,{expectedVersion:Q.version,title:K.title.trim(),publicDescription:K.publicDescription.trim(),participantWorkspaceIds:K.participantWorkspaceIds}):await XM({...K,title:K.title.trim(),publicDescription:K.publicDescription.trim()});c("active"),q(null),ie({title:"",publicDescription:"",ownerWorkspaceId:((te=e[0])==null?void 0:te.id)??"",participantWorkspaceIds:[]}),await pe(O.id,"active")}catch(O){T(Tc(O))}finally{U(!1)}}},Te=async()=>{if(!(!Q||Q.status!=="active")){U(!0),T(null);try{const _=await QM(Q.id,Q.version);M(!1),c("active"),await pe(void 0,"active")}catch(_){T(Tc(_))}finally{U(!1)}}};return u.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:t,role:"presentation",children:u.jsxs("section",{"aria-label":"工作空间协作",className:"context-panel collaboration-panel",onClick:_=>_.stopPropagation(),children:[u.jsxs("header",{className:"context-panel-header collaboration-panel-header",children:[u.jsxs("div",{children:[u.jsx("h2",{children:"协作"}),u.jsx("p",{children:"在明确选择的工作空间之间建立持久、定向的 Topic 通信。"})]}),u.jsxs("div",{className:"collaboration-header-actions",children:[u.jsx("button",{"aria-label":"新建 Topic",className:"memory-icon-button collaboration-new-topic",onClick:Ie,title:"新建 Topic",type:"button",children:"+"}),u.jsx("button",{"aria-label":"关闭协作",className:"icon-button",onClick:t,type:"button",children:"×"})]})]}),b&&!A&&!z?u.jsx("div",{className:"collaboration-error",role:"alert",children:b}):null,u.jsxs("div",{className:"collaboration-body",children:[u.jsxs("nav",{className:"collaboration-topic-list","aria-label":"协作 Topics",children:[u.jsxs("div",{className:"collaboration-topic-tabs",role:"tablist","aria-label":"Topic 列表范围",children:[u.jsx("button",{"aria-selected":o==="active",className:o==="active"?"active":void 0,onClick:()=>void Y("active"),role:"tab",type:"button",children:"当前"}),u.jsx("button",{"aria-selected":o==="archived",className:o==="archived"?"active":void 0,onClick:()=>void Y("archived"),role:"tab",type:"button",children:"已归档"})]}),v?u.jsx("p",{children:"正在加载..."}):he.length===0?u.jsx("p",{children:o==="archived"?"还没有已归档 Topic。":"还没有当前 Topic。"}):he.map(_=>u.jsxs("button",{className:`collaboration-topic-entry${_.id===f?" active":""}`,onClick:()=>void J(_.id),type:"button",children:[u.jsx("span",{children:_.title}),u.jsxs("small",{children:[_.members.length," 个工作空间 · ",_.status]})]},_.id))]}),u.jsx("main",{className:"collaboration-topic-detail",children:Q?u.jsxs(u.Fragment,{children:[u.jsxs("header",{children:[u.jsxs("div",{children:[u.jsx("h3",{children:Q.title}),u.jsx("p",{children:Q.publicDescription||"没有公开描述。"})]}),u.jsxs("div",{className:"collaboration-topic-actions",children:[u.jsx("span",{children:Q.status}),Q.status==="active"?u.jsxs(u.Fragment,{children:[u.jsx("button",{"aria-label":`编辑 Topic ${Q.title}`,className:"memory-icon-button",onClick:be,title:"编辑",type:"button",children:u.jsx(Rf,{})}),u.jsx("button",{"aria-label":`归档 Topic ${Q.title}`,className:"memory-icon-button",onClick:()=>M(!0),title:"归档",type:"button",children:u.jsx(FM,{})})]}):null]})]}),u.jsx("div",{className:"collaboration-members",children:Q.members.filter(_=>_.status==="active").map(_=>u.jsxs("span",{children:[_.workspaceTitleSnapshot,u.jsx("small",{children:_.role})]},`${_.workspaceId}-${_.membershipVersion}`))}),u.jsx("div",{className:"collaboration-message-list",children:m.length===0?u.jsx("p",{children:"还没有消息。"}):m.map(_=>u.jsxs("article",{children:[u.jsxs("header",{children:[u.jsx("strong",{children:_.senderTitleSnapshot}),u.jsx("span",{children:_.recipientWorkspaceIds.includes("ALL")?"发给全部参与者":`发给 ${Ix(_.recipientWorkspaceIds.map(te=>F.get(te)??ql(te)))}`}),u.jsx("time",{children:ct(_.createdAt)})]}),u.jsx("div",{className:"markdown-body",children:Os(_.contentMarkdown,void 0)})]},_.id))})]}):u.jsx("div",{className:"collaboration-empty",children:"选择或新建一个 Topic。"})})]}),A?u.jsx("div",{className:"collaboration-create-overlay",role:"presentation",onClick:()=>!B&&q(null),children:u.jsxs("form",{className:"dialog-card collaboration-create-dialog",onClick:_=>_.stopPropagation(),onSubmit:ge,children:[u.jsxs("header",{children:[u.jsxs("div",{children:[u.jsx("h3",{children:A==="edit"?"编辑 Topic":"新建 Topic"}),u.jsx("p",{children:A==="edit"?"调整公开信息与参与工作空间。":"明确选择本次通信的 owner 与参与者。"})]}),u.jsx("button",{"aria-label":"关闭 Topic 编辑",className:"icon-button",onClick:()=>q(null),type:"button",children:"×"})]}),u.jsxs("label",{children:["标题",u.jsx("input",{autoFocus:!0,placeholder:"填写 Topic 标题",value:K.title,onChange:_=>ie(te=>({...te,title:_.target.value}))})]}),u.jsxs("label",{children:["公开描述",u.jsx("textarea",{placeholder:"填写所有参与工作空间可见的共享背景",value:K.publicDescription,onChange:_=>ie(te=>({...te,publicDescription:_.target.value}))})]}),u.jsxs("label",{children:["Owner 工作空间",u.jsx("select",{disabled:A==="edit",value:K.ownerWorkspaceId,onChange:_=>ie(te=>({...te,ownerWorkspaceId:_.target.value,participantWorkspaceIds:te.participantWorkspaceIds.filter(O=>O!==_.target.value)})),children:n.map(_=>u.jsx("optgroup",{label:_.title,children:_.conversations.map(te=>u.jsx("option",{value:te.id,children:te.title},te.id))},_.id))})]}),u.jsxs("fieldset",{className:"collaboration-participant-groups",children:[u.jsx("legend",{children:"参与工作空间"}),u.jsxs("div",{className:"collaboration-participant-toolbar",children:[u.jsxs("span",{children:[K.participantWorkspaceIds.length," 个已选择"]}),u.jsxs("div",{children:[u.jsx("button",{onClick:()=>L(new Set),type:"button",children:"全部展开"}),u.jsx("button",{onClick:()=>L(new Set(ce.map(_=>_.id))),type:"button",children:"全部收起"})]})]}),ce.map(_=>{const te=_.conversations,O=te.filter(Ae=>K.participantWorkspaceIds.includes(Ae.id)).length,ee=ae.has(_.id);return u.jsxs("section",{className:"collaboration-participant-group",children:[u.jsxs("header",{children:[u.jsxs("button",{"aria-expanded":!ee,className:"collaboration-group-toggle",onClick:()=>L(Ae=>{const ne=new Set(Ae);return ne.has(_.id)?ne.delete(_.id):ne.add(_.id),ne}),type:"button",children:[u.jsx("span",{"aria-hidden":"true",className:ee?void 0:"expanded",children:"›"}),u.jsx("strong",{children:_.title}),u.jsxs("small",{children:[O,"/",te.length]})]}),u.jsxs("label",{title:`选择 ${_.title} 全部工作空间`,children:[u.jsx("input",{checked:O===te.length,onChange:()=>ie(Ae=>{const ne=te.map(_e=>_e.id),we=new Set(Ae.participantWorkspaceIds);return ne.every(_e=>we.has(_e))?ne.forEach(_e=>we.delete(_e)):ne.forEach(_e=>we.add(_e)),{...Ae,participantWorkspaceIds:Array.from(we)}}),type:"checkbox"}),u.jsx("span",{children:"全选"})]})]}),ee?null:u.jsx("div",{children:te.map(Ae=>u.jsxs("label",{className:"collaboration-participant-option",children:[u.jsx("input",{checked:K.participantWorkspaceIds.includes(Ae.id),onChange:ne=>ie(we=>({...we,participantWorkspaceIds:ne.target.checked?[...we.participantWorkspaceIds,Ae.id]:we.participantWorkspaceIds.filter(_e=>_e!==Ae.id)})),type:"checkbox"}),u.jsx("span",{children:Ae.title})]},Ae.id))})]},_.id)})]}),u.jsxs("footer",{className:"collaboration-submit-footer",children:[b?u.jsx("div",{className:"collaboration-error",role:"alert",children:b}):null,u.jsxs("div",{children:[u.jsx("button",{className:"secondary",disabled:B,onClick:()=>q(null),type:"button",children:"取消"}),u.jsx("button",{disabled:B||!K.title.trim()||!K.ownerWorkspaceId,type:"submit",children:B?"正在保存...":A==="edit"?"保存":"创建 Topic"})]})]})]})}):null,z&&Q?u.jsx("div",{className:"collaboration-create-overlay",onClick:()=>!B&&M(!1),role:"presentation",children:u.jsxs("section",{"aria-label":"归档 Topic",className:"dialog-card collaboration-archive-dialog",onClick:_=>_.stopPropagation(),children:[u.jsxs("header",{children:[u.jsxs("div",{children:[u.jsx("h3",{children:"归档 Topic"}),u.jsx("p",{children:"归档后保留历史消息,但工作空间不能再向此 Topic 发送新消息。"})]}),u.jsx("button",{"aria-label":"关闭归档确认",className:"icon-button",onClick:()=>M(!1),type:"button",children:"×"})]}),u.jsx("strong",{children:Q.title}),b?u.jsx("div",{className:"collaboration-error",role:"alert",children:b}):null,u.jsxs("footer",{children:[u.jsx("button",{className:"secondary",disabled:B,onClick:()=>M(!1),type:"button",children:"取消"}),u.jsx("button",{className:"danger",disabled:B,onClick:()=>void Te(),type:"button",children:B?"正在归档...":"归档"})]})]})}):null]})})}function rN({busy:e,conversation:t,conversationId:n,forceStopBusy:a,preview:l,previewLoading:o,result:c,status:f,warmup:h,workspaceGroups:m,onCancelResetPreview:g,onClose:v,onForceStop:k,onPreviewReset:b,onStartBlankContext:T,onResetRuntime:A,onSaveResetSelection:q,onWorkspaceChange:z,onWarmupChange:M}){const B=!t||e||f==="running"||f==="initializing";return u.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:v,role:"presentation",children:u.jsxs("section",{"aria-label":"Seele console",className:"context-panel console-panel",onClick:U=>U.stopPropagation(),children:[u.jsxs("header",{className:"context-panel-header console-panel-header",children:[u.jsxs("div",{children:[u.jsx("h2",{children:"Console"}),u.jsx("p",{children:"Control actions for the selected workspace runtime."})]}),u.jsxs("div",{className:"console-header-actions",children:[u.jsxs("label",{className:"console-workspace-picker",children:[u.jsx("span",{children:"Workspace"}),u.jsx("select",{disabled:e,onChange:U=>z(U.target.value),value:n??"",children:m.map(U=>u.jsx("optgroup",{label:U.title,children:U.conversations.map(ae=>u.jsxs("option",{value:ae.id,children:[ae.title," · workspaces/",Xo(ae.id)]},ae.id))},U.id))})]}),u.jsx("button",{"aria-label":"Close console",onClick:v,type:"button",children:"×"})]})]}),u.jsx("div",{className:"console-body",children:u.jsxs("section",{className:"console-card",children:[u.jsxs("div",{className:"console-card-heading",children:[u.jsxs("div",{children:[u.jsx("h3",{children:"Workspace Runtime"}),u.jsx("p",{children:"Reset only replaces the Codex runtime thread. Seele workspace history, metadata, and files remain intact."})]}),u.jsx("span",{className:`console-status ${f}`,children:f})]}),u.jsxs("dl",{className:"console-facts",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Workspace"}),u.jsx("dd",{children:(t==null?void 0:t.title)??"No workspace selected"})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"ID"}),u.jsx("dd",{children:t?`workspaces/${Xo(t.id)}`:"-"})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Thread"}),u.jsx("dd",{children:(t==null?void 0:t.codexThreadId)??"Not created"})]})]}),u.jsxs("label",{className:"console-toggle",children:[u.jsx("input",{checked:h,onChange:U=>M(U.target.checked),type:"checkbox"}),u.jsxs("span",{children:["Run a warmup turn after reset",u.jsx("small",{children:"The workspace will receive a system wakeup to re-orient itself after the thread is rebuilt."})]})]}),u.jsxs("div",{className:"console-actions",children:[u.jsx("button",{className:"danger",disabled:!t||a,onClick:k,title:"Kill the workspace runtime and repair every non-terminal scheduler state",type:"button",children:a?"Stopping & repairing...":"Force stop & repair"}),u.jsx("button",{className:"danger",disabled:B||o,onClick:b,type:"button",children:o?"Preparing preview...":"Preview runtime reset"}),u.jsx("button",{disabled:B||o,onClick:T,type:"button",children:"Clear memory & start blank"}),f==="running"||f==="initializing"?u.jsx("span",{children:"Force stop the active workspace operation before resetting."}):null]}),c?u.jsxs("div",{className:"console-result",children:[u.jsx("strong",{children:c.workspaceMemoryCleared?"Blank workspace context ready":"Runtime reset completed"}),u.jsxs("span",{children:[c.injectedItemCount," visible history items injected"]}),c.historyCompactionCount>0?u.jsxs("span",{children:["Full history processed in ",c.historyBatchCount," chronological batches with ",c.historyCompactionCount," native compactions"]}):null,c.workspaceMemoryCleared?u.jsx("span",{children:"Workspace Memory cleared; Base Memory retained"}):null,u.jsxs("span",{children:["New thread: ",c.newThreadId]}),c.warmupTurnId?u.jsxs("span",{children:["Warmup turn: ",c.warmupTurnId]}):null]}):null]})}),l?u.jsx(aN,{busy:e,preview:l,warmup:h,onCancel:g,onConfirm:A,onSaveSelection:q}):null]})})}function aN({busy:e,preview:t,warmup:n,onCancel:a,onConfirm:l,onSaveSelection:o}){const[c,f]=D.useState(()=>new Set(t.entries.filter(F=>F.includedByDefault).map(F=>F.id))),[h,m]=D.useState(!1),[g,v]=D.useState(!1),[k,b]=D.useState(null),T=D.useRef(null),A=t.entries.filter(F=>c.has(F.id)),q=A.filter(F=>F.role==="user").length,z=A.length-q,M=t.entries.filter(F=>F.topicRelation!==null).map(F=>F.id),B=M.filter(F=>c.has(F)).length,U=t.entries.length>0&&c.size===t.entries.length;D.useEffect(()=>{T.current&&(T.current.indeterminate=c.size>0&&c.size<t.entries.length)},[t.entries.length,c.size]);const ae=e||g;async function L(F){v(!0),b(null);try{await o(t.entries.filter(he=>F.has(he.id)).map(he=>he.id)),f(F)}catch(he){b(pt(he).message)}finally{v(!1)}}function K(F,he){const ce=new Set(c);he?ce.add(F):ce.delete(F),L(ce)}function ie(){const F=new Set(c);M.forEach(he=>F.add(he)),L(F)}function Q(){const F=new Set(c);M.forEach(he=>{F.has(he)?F.delete(he):F.add(he)}),L(F)}return u.jsx("div",{className:`reset-preview-overlay ${h?"expanded":""}`,onClick:ae?void 0:a,role:"presentation",children:u.jsxs("section",{"aria-label":"Runtime reset preview","aria-modal":"true",className:`reset-preview-dialog ${h?"expanded":""}`,onClick:F=>F.stopPropagation(),role:"dialog",children:[u.jsxs("header",{className:"reset-preview-header",children:[u.jsxs("div",{children:[u.jsx("h3",{children:"Confirm runtime reset"}),u.jsx("p",{children:"The new thread will process the selected original messages in chronological batches. Each batch is compacted natively before the next batch is injected; the old thread context is never reused."})]}),u.jsxs("div",{className:"reset-preview-header-actions",children:[u.jsx("button",{"aria-label":h?"Restore reset preview size":"Expand reset preview",onClick:()=>m(F=>!F),title:h?"Restore size":"Expand",type:"button",children:h?"⊡":"⛶"}),u.jsx("button",{"aria-label":"Close reset preview",disabled:ae,onClick:a,type:"button",children:"×"})]})]}),u.jsxs("div",{className:"reset-preview-summary",children:[u.jsxs("label",{className:"reset-preview-select-all",children:[u.jsx("input",{checked:U,disabled:ae||t.entries.length===0,onChange:F=>void L(F.target.checked?new Set(t.entries.map(he=>he.id)):new Set),ref:T,type:"checkbox"}),u.jsxs("span",{children:[c.size," of ",t.entries.length," selected"]})]}),u.jsxs("span",{children:[q," user"]}),u.jsxs("span",{children:[z," assistant"]}),M.length>0?u.jsxs("div",{className:"reset-preview-topic-actions",children:[u.jsxs("span",{children:[B," of ",M.length," Topic input + response"]}),u.jsx("button",{disabled:ae||B===M.length,onClick:ie,type:"button",children:"Select Topic turns"}),u.jsx("button",{disabled:ae,onClick:Q,type:"button",children:"Invert Topic turns"})]}):null,u.jsxs("span",{children:[t.historyBatchCount," planned batch",t.historyBatchCount===1?"":"es"]}),u.jsxs("span",{children:["~",t.estimatedTokenCount.toLocaleString()," source tokens"]}),u.jsx("span",{children:n?"Warmup enabled":"No warmup"}),g?u.jsx("span",{children:"Saving defaults..."}):null,k?u.jsx("span",{className:"reset-preview-selection-error",children:k}):null]}),u.jsx("div",{className:"reset-preview-list",children:t.entries.length>0?t.entries.map((F,he)=>u.jsxs("article",{className:`reset-preview-item ${F.role} ${c.has(F.id)?"":"excluded"}`,children:[u.jsxs("header",{children:[u.jsxs("label",{children:[u.jsx("input",{"aria-label":`Include ${F.role} message ${he+1}`,checked:c.has(F.id),disabled:ae,onChange:ce=>K(F.id,ce.target.checked),type:"checkbox"}),u.jsx("span",{children:he+1})]}),u.jsx("strong",{children:F.role}),F.topicRelation?u.jsxs("span",{className:"reset-preview-topic-badge",children:["Topic ",F.topicRelation]}):null,u.jsx("time",{dateTime:F.createdAt,children:ct(F.createdAt)})]}),u.jsx("pre",{children:F.content})]},F.id)):u.jsx("p",{className:"reset-preview-empty",children:"No visible history will be injected."})}),u.jsxs("footer",{className:"reset-preview-actions",children:[u.jsxs("small",{children:["Preview fingerprint: ",t.fingerprint.slice(0,12)]}),u.jsxs("div",{children:[u.jsx("button",{disabled:ae,onClick:a,type:"button",children:"Cancel"}),u.jsx("button",{className:"danger",disabled:ae,onClick:()=>l(t.entries.filter(F=>c.has(F.id)).map(F=>F.id)),type:"button",children:e?"Rebuilding and compacting...":"Confirm full-history reset"})]})]})]})})}function iN({currentReleasedAt:e,currentVersion:t,job:n,latest:a,latestChecking:l,starting:o,onClose:c,onRefresh:f,onStart:h}){const m=(n==null?void 0:n.currentVersion)??t,g=a!=null&&a.version&&TD(a.version,m)?CD(a.version):null;return D.useEffect(()=>{const v=k=>{k.key==="Escape"&&c()};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[c]),u.jsx("div",{className:"codex-update-overlay",onClick:c,role:"presentation",children:u.jsxs("section",{"aria-label":"Codex CLI update",className:"codex-update-panel",onClick:v=>v.stopPropagation(),children:[u.jsxs("header",{children:[u.jsxs("div",{children:[u.jsx("h3",{children:"Codex CLI update"}),u.jsx("p",{children:"Managed by Seele in the instance runtime directory."})]}),u.jsx("button",{"aria-label":"Close Codex CLI update",onClick:c,type:"button",children:"×"})]}),u.jsxs("dl",{className:"codex-update-summary",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Status"}),u.jsx("dd",{className:n?`status-${n.status}`:void 0,children:(n==null?void 0:n.status)??"Not started"})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Current"}),u.jsx("dd",{children:l1(m,(n==null?void 0:n.codexReleasedAt)??e)})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Latest"}),u.jsxs("dd",{title:(a==null?void 0:a.error)??void 0,children:[l?"Checking...":a!=null&&a.version?l1(a.version,a.releasedAt):a!=null&&a.error?"Check failed":"Not checked",g?u.jsx("a",{className:"codex-release-notes-link",href:g,rel:"noreferrer",target:"_blank",children:"Release notes"}):null]})]}),n?u.jsxs("div",{children:[u.jsx("dt",{children:"Started"}),u.jsx("dd",{children:ct(n.startedAt)})]}):null]}),a!=null&&a.error?u.jsxs("p",{className:"codex-latest-error",children:["Latest version check: ",a.error]}):null,u.jsx("div",{className:"codex-update-log",role:"log","aria-live":"polite",children:n!=null&&n.logs.length?n.logs.map((v,k)=>u.jsxs("div",{className:`log-${v.stream}`,children:[u.jsx("time",{children:jD(v.at)}),u.jsx("span",{children:v.text})]},`${v.at}-${k}`)):u.jsx("p",{children:"No update logs yet."})}),u.jsxs("footer",{children:[u.jsx("button",{className:"secondary",onClick:f,type:"button",children:"Refresh"}),u.jsx("button",{disabled:o||(n==null?void 0:n.status)==="running",onClick:h,type:"button",children:o?"Starting...":(n==null?void 0:n.status)==="running"?"Updating...":n?"Run again":"Start update"})]})]})})}function lN({currentUser:e,conversations:t,deploymentSettings:n,editingEnvironmentKey:a,environmentDraft:l,globalEnvironment:o,workspaceEnvironment:c,memorySettings:f,memorySettingsDraft:h,managedUsers:m,workspaceMemoryDraft:g,runtimeSettings:v,runtimeModels:k,runtimeCodexVersion:b,runtimeCodexReleasedAt:T,runtimeCodexUpdating:A,runtimeSettingsDraft:q,runtimeSettingsScope:z,settingsWorkspace:M,settingsWorkspaceId:B,systemDiagnostics:U,systemDiagnosticsLoading:ae,workspaceGroups:L,workspaceRuntimeSettings:K,workspaceRuntimeSettingsDraft:ie,onCancelEnvironmentEdit:Q,onClose:F,onCreateUser:he,onDeleteUser:ce,onDeleteEnvironment:Ie,onDraftChange:be,onEditEnvironment:pe,onSaveBaseMemoryItems:J,onSaveDeploymentSettings:Y,onSaveResponsibility:ge,onSaveWorkspaceMemoryItems:Te,onRevealEnvironmentValue:H,onRuntimeDraftChange:_,onCodexAccountSwitched:te,onUpdateCodexCli:O,onRuntimeScopeChange:ee,onSettingsWorkspaceChange:Ae,onSubmitRuntimeSettings:ne,onSubmitEnvironment:we,onRefreshSystemDiagnostics:_e,onUpdateUser:He,onWorkspaceRuntimeDraftChange:wt,onWorkspaceRuntimeReset:et,revealedEnvironmentKeys:$t}){const[tt,fe]=D.useState("model"),[qe,Je]=D.useState(!1);D.useEffect(()=>{e.role!=="admin"&&["accounts","channels","users","system","deployment"].includes(tt)&&fe("model")},[e.role,tt]);const[Xe,Lt]=D.useState(null),[Tt,mt]=D.useState(!1),[At,pn]=D.useState((M==null?void 0:M.responsibility)??""),[en,ht]=D.useState(!1),ur=D.useRef(null),me=z==="workspace"?Object.values((K==null?void 0:K.sources)??{}).filter(Se=>Se==="workspace").length:0;return D.useEffect(()=>{z==="global"&&mt(!1)},[z]),D.useEffect(()=>{pn((M==null?void 0:M.responsibility)??"")},[M==null?void 0:M.id,M==null?void 0:M.responsibility]),D.useEffect(()=>{if(!Tt)return;const Se=at=>{var wn;const kt=at.target;kt instanceof Node&&((wn=ur.current)!=null&&wn.contains(kt))||mt(!1)},$e=at=>{at.key==="Escape"&&mt(!1)};return document.addEventListener("pointerdown",Se,!0),document.addEventListener("keydown",$e,!0),()=>{document.removeEventListener("pointerdown",Se,!0),document.removeEventListener("keydown",$e,!0)}},[Tt]),u.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:F,role:"presentation",children:u.jsxs("section",{"aria-label":"Seele settings",className:"context-panel settings-panel",onClick:Se=>Se.stopPropagation(),children:[u.jsxs("header",{className:"context-panel-header settings-panel-header",children:[u.jsxs("div",{className:"settings-panel-title",children:[u.jsx("h2",{children:"Settings"}),tt!=="system"&&tt!=="users"&&tt!=="accounts"&&tt!=="deployment"?u.jsxs("div",{"aria-label":"Configuration scope",className:"settings-scope-segments",role:"radiogroup",children:[e.role==="admin"?u.jsx("button",{"aria-checked":z==="global",className:z==="global"?"active":void 0,onClick:()=>ee("global"),role:"radio",type:"button",children:"Global"}):null,u.jsxs("div",{className:"settings-workspace-picker",ref:ur,children:[u.jsx("button",{"aria-checked":z==="workspace","aria-expanded":z==="workspace"?Tt:void 0,"aria-label":z==="workspace"?"Settings workspace target":void 0,className:z==="workspace"?"active settings-scope-workspace-trigger":void 0,disabled:t.length===0,onClick:()=>{if(z!=="workspace"){ee("workspace");return}mt(Se=>!Se)},role:"radio",type:"button",children:z==="workspace"?u.jsxs(u.Fragment,{children:[u.jsxs("span",{children:["Workspace: ",(M==null?void 0:M.title)??"Select workspace"]}),u.jsx("span",{"aria-hidden":"true",children:"⌄"})]}):"Workspace"}),z==="workspace"&&Tt?u.jsx("div",{className:"settings-workspace-menu",role:"listbox",children:L.map(Se=>u.jsxs("div",{className:"settings-workspace-menu-group",children:[u.jsx("div",{className:"settings-workspace-menu-heading",children:Se.title}),Se.conversations.map($e=>u.jsxs("button",{"aria-selected":$e.id===B,className:$e.id===B?"selected":void 0,onClick:()=>{Ae($e.id),mt(!1)},role:"option",type:"button",children:[u.jsx("span",{children:$e.title}),u.jsxs("small",{children:["workspaces/",$e.id]})]},$e.id))]},Se.id))}):null]})]}):null]}),u.jsx("div",{className:"settings-header-actions",children:u.jsx("button",{"aria-label":"Close settings panel",onClick:F,type:"button",children:"×"})})]}),u.jsxs("div",{className:"settings-body",children:[u.jsxs("nav",{className:"settings-nav","aria-label":"Settings sections",children:[u.jsxs("button",{className:tt==="model"?"active":void 0,onClick:()=>fe("model"),type:"button",children:[u.jsx("span",{children:"Runtime"}),u.jsx("small",{children:"Effective settings"})]}),u.jsxs("button",{className:tt==="responsibility"?"active":void 0,onClick:()=>fe("responsibility"),type:"button",children:[u.jsx("span",{children:"Responsibility"}),u.jsx("small",{children:"Workspace role"})]}),u.jsxs("button",{className:tt==="memory"?"active":void 0,onClick:()=>fe("memory"),type:"button",children:[u.jsx("span",{children:"Memory"}),u.jsx("small",{children:"Base + workspace context"})]}),u.jsxs("button",{className:tt==="environment"?"active":void 0,onClick:()=>fe("environment"),type:"button",children:[u.jsx("span",{children:"Environment"}),u.jsx("small",{children:"Base + workspace variables"})]}),e.role==="admin"?u.jsxs(u.Fragment,{children:[u.jsxs("button",{className:tt==="accounts"?"active":void 0,onClick:()=>fe("accounts"),type:"button",children:[u.jsx("span",{children:"Codex Accounts"}),u.jsx("small",{children:"Cloud login + active account"})]}),u.jsxs("button",{className:tt==="channels"?"active":void 0,onClick:()=>fe("channels"),type:"button",children:[u.jsx("span",{children:"Custom model channels"}),u.jsx("small",{children:"Endpoint + key + fixed model"})]}),u.jsxs("button",{className:tt==="deployment"?"active":void 0,onClick:()=>fe("deployment"),type:"button",children:[u.jsx("span",{children:"Deployment"}),u.jsx("small",{children:"Local integrations"})]}),u.jsxs("button",{onClick:()=>{window.location.assign(`${V1()}admin/host`)},type:"button",children:[u.jsx("span",{children:"Work Operations"}),u.jsx("small",{children:"Versions, restart, logs"})]}),u.jsxs("button",{className:tt==="system"?"active":void 0,onClick:()=>fe("system"),type:"button",children:[u.jsx("span",{children:"System"}),u.jsx("small",{children:"Runtime + resources"})]}),u.jsxs("button",{className:tt==="users"?"active":void 0,onClick:()=>fe("users"),type:"button",children:[u.jsx("span",{children:"Users"}),u.jsx("small",{children:"Access + roles"})]})]}):null]}),u.jsxs("section",{className:"settings-content",children:[tt!=="system"&&tt!=="users"&&tt!=="accounts"&&tt!=="channels"&&tt!=="deployment"?u.jsxs("div",{className:`settings-scope-banner ${z==="workspace"?"workspace":"global"}`,children:[u.jsx("strong",{children:z==="workspace"?"Editing workspace custom settings":"Editing global settings"}),u.jsx("span",{children:z==="workspace"?`${(M==null?void 0:M.title)??"Selected workspace"} overrides global defaults.`:"These defaults apply to every workspace unless that workspace overrides them."})]}):null,tt==="system"?u.jsx(sN,{conversations:t,diagnostics:U,loading:ae,onRefresh:_e}):tt==="users"?u.jsx(pN,{currentUser:e,users:m,onCreate:he,onDelete:ce,onUpdate:He}):tt==="channels"?e.role==="admin"?u.jsx(LA,{load:lz,save:uz,queryBalance:oz}):null:tt==="accounts"?e.role==="admin"?u.jsx(mN,{onSwitched:te}):null:tt==="deployment"?u.jsx(gN,{settings:n,onSave:Y}):tt==="model"?u.jsx(yN,{draft:z==="workspace"?ie:q,globalSettings:v,models:k,codexVersion:b,codexReleasedAt:T,codexUpdating:A,scope:z,workspaceOverrideCount:me,settings:z==="workspace"?(K==null?void 0:K.effective)??ie:v,workspaceSettings:K,onDraftChange:z==="workspace"?wt:_,onResetWorkspaceSetting:et,onSubmit:ne,onUpdateCodexCli:O}):tt==="responsibility"?u.jsx(cN,{draft:At,saving:en,scope:z,workspace:M,onDraftChange:pn,onSubmit:Se=>{Se.preventDefault(),Se.stopPropagation(),!(z!=="workspace"||!M)&&(ht(!0),ge(M.id,At).then($e=>pn($e)).finally(()=>ht(!1)))}}):tt==="memory"?u.jsx(vN,{baseSettings:f,scope:z,workspaceSettings:g,workspaceName:M==null?void 0:M.title,onSaveBaseItems:J,onSaveWorkspaceItems:Te}):u.jsx(wN,{deleteConfirmKey:Xe,editingEnvironmentKey:a,environmentDraft:l,globalEnvironment:o,scope:z,workspaceEnvironment:c,valueVisible:qe,onCancelEnvironmentEdit:Q,onDeleteConfirmChange:Lt,onDeleteEnvironment:Ie,onDraftChange:be,onEditEnvironment:pe,onRevealEnvironmentValue:H,onSubmitEnvironment:we,onValueVisibleChange:Je,revealedEnvironmentKeys:$t})]})]})]})})}function sN({conversations:e,diagnostics:t,loading:n,onRefresh:a}){const l=(t==null?void 0:t.runtime.pool)??null,o=D.useMemo(()=>(t==null?void 0:t.systemLogs)??[],[t]),[c,f]=D.useState(!1),h=D.useMemo(()=>new Map(e.map(b=>[b.id,b.title])),[e]),m=D.useMemo(()=>t?JSON.stringify({generatedAt:t.generatedAt,app:t.app,systemLogs:o},null,2):"",[t,o]),g=async()=>{m&&(await navigator.clipboard.writeText(m),f(!0),window.setTimeout(()=>f(!1),1800))},v=()=>{if(!m||!t)return;const b=URL.createObjectURL(new Blob([m],{type:"application/json"})),T=document.createElement("a");T.href=b,T.download=`seele-system-log-${t.generatedAt.replaceAll(":","-").replaceAll(".","-")}.json`,T.click(),URL.revokeObjectURL(b)},k=()=>{if(!t||!o.length)return;const b=o[0],T=o.slice(0,5).map(B=>`- ${$c(B.createdAt)} · ${B.level.toUpperCase()} · ${B.event} · ${B.summary}`).join(`
|
|
363
|
+
${t}`}function nN({conversations:e,onClose:t,workspaceGroups:n}){var H;const[a,l]=D.useState([]),[o,c]=D.useState("active"),[f,h]=D.useState(null),[m,g]=D.useState([]),[v,k]=D.useState(!0),[b,T]=D.useState(null),[A,q]=D.useState(null),[z,M]=D.useState(!1),[B,U]=D.useState(!1),[ne,L]=D.useState(new Set),[K,ie]=D.useState({title:"",publicDescription:"",ownerWorkspaceId:((H=e[0])==null?void 0:H.id)??"",participantWorkspaceIds:[]}),Q=a.find(_=>_.id===f)??null,F=D.useMemo(()=>new Map(e.map(_=>[_.id,_.title])),[e]),he=a.filter(_=>o==="archived"?_.status==="archived":_.status!=="archived"),ce=n.map(_=>({..._,conversations:_.conversations.filter(te=>te.id!==K.ownerWorkspaceId)})).filter(_=>_.conversations.length>0),Ie=()=>{var _;T(null),ie({title:"",publicDescription:"",ownerWorkspaceId:((_=e[0])==null?void 0:_.id)??"",participantWorkspaceIds:[]}),L(new Set),q("create")},be=()=>{!Q||Q.status!=="active"||(T(null),ie({title:Q.title,publicDescription:Q.publicDescription,ownerWorkspaceId:Q.ownerWorkspaceId,participantWorkspaceIds:Q.members.filter(_=>_.role==="participant"&&_.status==="active").map(_=>_.workspaceId)}),L(new Set),q("edit"))},pe=async(_,te=o)=>{var O;k(!0),T(null);try{const ee=await y5();l(ee);const Ae=ee.filter(we=>te==="archived"?we.status==="archived":we.status!=="archived"),re=(_&&Ae.some(we=>we.id===_)?_:null)??(f&&Ae.some(we=>we.id===f)?f:((O=Ae[0])==null?void 0:O.id)??null);h(re),g(re?await Bd(re):[])}catch(ee){T(Tc(ee))}finally{k(!1)}};D.useEffect(()=>{pe()},[]),D.useEffect(()=>{const _=window.setInterval(()=>{(async()=>{try{const te=await y5();l(te),f&&te.some(O=>O.id===f)&&g(await Bd(f))}catch{}})()},1e4);return()=>window.clearInterval(_)},[f]);const J=async _=>{h(_),T(null);try{g(await Bd(_))}catch(te){T(Tc(te))}},Y=async _=>{var O;if(_===o)return;c(_),T(null);const te=((O=a.find(ee=>_==="archived"?ee.status==="archived":ee.status!=="archived"))==null?void 0:O.id)??null;if(h(te),!te){g([]);return}try{g(await Bd(te))}catch(ee){T(Tc(ee))}},ge=async _=>{var te;if(_.preventDefault(),!(!K.title.trim()||!K.ownerWorkspaceId)){U(!0),T(null);try{const O=A==="edit"&&Q?await ZM(Q.id,{expectedVersion:Q.version,title:K.title.trim(),publicDescription:K.publicDescription.trim(),participantWorkspaceIds:K.participantWorkspaceIds}):await XM({...K,title:K.title.trim(),publicDescription:K.publicDescription.trim()});c("active"),q(null),ie({title:"",publicDescription:"",ownerWorkspaceId:((te=e[0])==null?void 0:te.id)??"",participantWorkspaceIds:[]}),await pe(O.id,"active")}catch(O){T(Tc(O))}finally{U(!1)}}},Te=async()=>{if(!(!Q||Q.status!=="active")){U(!0),T(null);try{const _=await QM(Q.id,Q.version);M(!1),c("active"),await pe(void 0,"active")}catch(_){T(Tc(_))}finally{U(!1)}}};return u.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:t,role:"presentation",children:u.jsxs("section",{"aria-label":"工作空间协作",className:"context-panel collaboration-panel",onClick:_=>_.stopPropagation(),children:[u.jsxs("header",{className:"context-panel-header collaboration-panel-header",children:[u.jsxs("div",{children:[u.jsx("h2",{children:"协作"}),u.jsx("p",{children:"在明确选择的工作空间之间建立持久、定向的 Topic 通信。"})]}),u.jsxs("div",{className:"collaboration-header-actions",children:[u.jsx("button",{"aria-label":"新建 Topic",className:"memory-icon-button collaboration-new-topic",onClick:Ie,title:"新建 Topic",type:"button",children:"+"}),u.jsx("button",{"aria-label":"关闭协作",className:"icon-button",onClick:t,type:"button",children:"×"})]})]}),b&&!A&&!z?u.jsx("div",{className:"collaboration-error",role:"alert",children:b}):null,u.jsxs("div",{className:"collaboration-body",children:[u.jsxs("nav",{className:"collaboration-topic-list","aria-label":"协作 Topics",children:[u.jsxs("div",{className:"collaboration-topic-tabs",role:"tablist","aria-label":"Topic 列表范围",children:[u.jsx("button",{"aria-selected":o==="active",className:o==="active"?"active":void 0,onClick:()=>void Y("active"),role:"tab",type:"button",children:"当前"}),u.jsx("button",{"aria-selected":o==="archived",className:o==="archived"?"active":void 0,onClick:()=>void Y("archived"),role:"tab",type:"button",children:"已归档"})]}),v?u.jsx("p",{children:"正在加载..."}):he.length===0?u.jsx("p",{children:o==="archived"?"还没有已归档 Topic。":"还没有当前 Topic。"}):he.map(_=>u.jsxs("button",{className:`collaboration-topic-entry${_.id===f?" active":""}`,onClick:()=>void J(_.id),type:"button",children:[u.jsx("span",{children:_.title}),u.jsxs("small",{children:[_.members.length," 个工作空间 · ",_.status]})]},_.id))]}),u.jsx("main",{className:"collaboration-topic-detail",children:Q?u.jsxs(u.Fragment,{children:[u.jsxs("header",{children:[u.jsxs("div",{children:[u.jsx("h3",{children:Q.title}),u.jsx("p",{children:Q.publicDescription||"没有公开描述。"})]}),u.jsxs("div",{className:"collaboration-topic-actions",children:[u.jsx("span",{children:Q.status}),Q.status==="active"?u.jsxs(u.Fragment,{children:[u.jsx("button",{"aria-label":`编辑 Topic ${Q.title}`,className:"memory-icon-button",onClick:be,title:"编辑",type:"button",children:u.jsx(Rf,{})}),u.jsx("button",{"aria-label":`归档 Topic ${Q.title}`,className:"memory-icon-button",onClick:()=>M(!0),title:"归档",type:"button",children:u.jsx(FM,{})})]}):null]})]}),u.jsx("div",{className:"collaboration-members",children:Q.members.filter(_=>_.status==="active").map(_=>u.jsxs("span",{children:[_.workspaceTitleSnapshot,u.jsx("small",{children:_.role})]},`${_.workspaceId}-${_.membershipVersion}`))}),u.jsx("div",{className:"collaboration-message-list",children:m.length===0?u.jsx("p",{children:"还没有消息。"}):m.map(_=>u.jsxs("article",{children:[u.jsxs("header",{children:[u.jsx("strong",{children:_.senderTitleSnapshot}),u.jsx("span",{children:_.recipientWorkspaceIds.includes("ALL")?"发给全部参与者":`发给 ${Ix(_.recipientWorkspaceIds.map(te=>F.get(te)??ql(te)))}`}),u.jsx("time",{children:ct(_.createdAt)})]}),u.jsx("div",{className:"markdown-body",children:Os(_.contentMarkdown,void 0)})]},_.id))})]}):u.jsx("div",{className:"collaboration-empty",children:"选择或新建一个 Topic。"})})]}),A?u.jsx("div",{className:"collaboration-create-overlay",role:"presentation",onClick:()=>!B&&q(null),children:u.jsxs("form",{className:"dialog-card collaboration-create-dialog",onClick:_=>_.stopPropagation(),onSubmit:ge,children:[u.jsxs("header",{children:[u.jsxs("div",{children:[u.jsx("h3",{children:A==="edit"?"编辑 Topic":"新建 Topic"}),u.jsx("p",{children:A==="edit"?"调整公开信息与参与工作空间。":"明确选择本次通信的 owner 与参与者。"})]}),u.jsx("button",{"aria-label":"关闭 Topic 编辑",className:"icon-button",onClick:()=>q(null),type:"button",children:"×"})]}),u.jsxs("label",{children:["标题",u.jsx("input",{autoFocus:!0,placeholder:"填写 Topic 标题",value:K.title,onChange:_=>ie(te=>({...te,title:_.target.value}))})]}),u.jsxs("label",{children:["公开描述",u.jsx("textarea",{placeholder:"填写所有参与工作空间可见的共享背景",value:K.publicDescription,onChange:_=>ie(te=>({...te,publicDescription:_.target.value}))})]}),u.jsxs("label",{children:["Owner 工作空间",u.jsx("select",{disabled:A==="edit",value:K.ownerWorkspaceId,onChange:_=>ie(te=>({...te,ownerWorkspaceId:_.target.value,participantWorkspaceIds:te.participantWorkspaceIds.filter(O=>O!==_.target.value)})),children:n.map(_=>u.jsx("optgroup",{label:_.title,children:_.conversations.map(te=>u.jsx("option",{value:te.id,children:te.title},te.id))},_.id))})]}),u.jsxs("fieldset",{className:"collaboration-participant-groups",children:[u.jsx("legend",{children:"参与工作空间"}),u.jsxs("div",{className:"collaboration-participant-toolbar",children:[u.jsxs("span",{children:[K.participantWorkspaceIds.length," 个已选择"]}),u.jsxs("div",{children:[u.jsx("button",{onClick:()=>L(new Set),type:"button",children:"全部展开"}),u.jsx("button",{onClick:()=>L(new Set(ce.map(_=>_.id))),type:"button",children:"全部收起"})]})]}),ce.map(_=>{const te=_.conversations,O=te.filter(Ae=>K.participantWorkspaceIds.includes(Ae.id)).length,ee=ne.has(_.id);return u.jsxs("section",{className:"collaboration-participant-group",children:[u.jsxs("header",{children:[u.jsxs("button",{"aria-expanded":!ee,className:"collaboration-group-toggle",onClick:()=>L(Ae=>{const re=new Set(Ae);return re.has(_.id)?re.delete(_.id):re.add(_.id),re}),type:"button",children:[u.jsx("span",{"aria-hidden":"true",className:ee?void 0:"expanded",children:"›"}),u.jsx("strong",{children:_.title}),u.jsxs("small",{children:[O,"/",te.length]})]}),u.jsxs("label",{title:`选择 ${_.title} 全部工作空间`,children:[u.jsx("input",{checked:O===te.length,onChange:()=>ie(Ae=>{const re=te.map(_e=>_e.id),we=new Set(Ae.participantWorkspaceIds);return re.every(_e=>we.has(_e))?re.forEach(_e=>we.delete(_e)):re.forEach(_e=>we.add(_e)),{...Ae,participantWorkspaceIds:Array.from(we)}}),type:"checkbox"}),u.jsx("span",{children:"全选"})]})]}),ee?null:u.jsx("div",{children:te.map(Ae=>u.jsxs("label",{className:"collaboration-participant-option",children:[u.jsx("input",{checked:K.participantWorkspaceIds.includes(Ae.id),onChange:re=>ie(we=>({...we,participantWorkspaceIds:re.target.checked?[...we.participantWorkspaceIds,Ae.id]:we.participantWorkspaceIds.filter(_e=>_e!==Ae.id)})),type:"checkbox"}),u.jsx("span",{children:Ae.title})]},Ae.id))})]},_.id)})]}),u.jsxs("footer",{className:"collaboration-submit-footer",children:[b?u.jsx("div",{className:"collaboration-error",role:"alert",children:b}):null,u.jsxs("div",{children:[u.jsx("button",{className:"secondary",disabled:B,onClick:()=>q(null),type:"button",children:"取消"}),u.jsx("button",{disabled:B||!K.title.trim()||!K.ownerWorkspaceId,type:"submit",children:B?"正在保存...":A==="edit"?"保存":"创建 Topic"})]})]})]})}):null,z&&Q?u.jsx("div",{className:"collaboration-create-overlay",onClick:()=>!B&&M(!1),role:"presentation",children:u.jsxs("section",{"aria-label":"归档 Topic",className:"dialog-card collaboration-archive-dialog",onClick:_=>_.stopPropagation(),children:[u.jsxs("header",{children:[u.jsxs("div",{children:[u.jsx("h3",{children:"归档 Topic"}),u.jsx("p",{children:"归档后保留历史消息,但工作空间不能再向此 Topic 发送新消息。"})]}),u.jsx("button",{"aria-label":"关闭归档确认",className:"icon-button",onClick:()=>M(!1),type:"button",children:"×"})]}),u.jsx("strong",{children:Q.title}),b?u.jsx("div",{className:"collaboration-error",role:"alert",children:b}):null,u.jsxs("footer",{children:[u.jsx("button",{className:"secondary",disabled:B,onClick:()=>M(!1),type:"button",children:"取消"}),u.jsx("button",{className:"danger",disabled:B,onClick:()=>void Te(),type:"button",children:B?"正在归档...":"归档"})]})]})}):null]})})}function rN({busy:e,conversation:t,conversationId:n,forceStopBusy:a,preview:l,previewLoading:o,result:c,status:f,warmup:h,workspaceGroups:m,onCancelResetPreview:g,onClose:v,onForceStop:k,onPreviewReset:b,onStartBlankContext:T,onResetRuntime:A,onSaveResetSelection:q,onWorkspaceChange:z,onWarmupChange:M}){const B=!t||e||f==="running"||f==="initializing";return u.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:v,role:"presentation",children:u.jsxs("section",{"aria-label":"Seele console",className:"context-panel console-panel",onClick:U=>U.stopPropagation(),children:[u.jsxs("header",{className:"context-panel-header console-panel-header",children:[u.jsxs("div",{children:[u.jsx("h2",{children:"Console"}),u.jsx("p",{children:"Control actions for the selected workspace runtime."})]}),u.jsxs("div",{className:"console-header-actions",children:[u.jsxs("label",{className:"console-workspace-picker",children:[u.jsx("span",{children:"Workspace"}),u.jsx("select",{disabled:e,onChange:U=>z(U.target.value),value:n??"",children:m.map(U=>u.jsx("optgroup",{label:U.title,children:U.conversations.map(ne=>u.jsxs("option",{value:ne.id,children:[ne.title," · workspaces/",Xo(ne.id)]},ne.id))},U.id))})]}),u.jsx("button",{"aria-label":"Close console",onClick:v,type:"button",children:"×"})]})]}),u.jsx("div",{className:"console-body",children:u.jsxs("section",{className:"console-card",children:[u.jsxs("div",{className:"console-card-heading",children:[u.jsxs("div",{children:[u.jsx("h3",{children:"Workspace Runtime"}),u.jsx("p",{children:"Reset only replaces the Codex runtime thread. Seele workspace history, metadata, and files remain intact."})]}),u.jsx("span",{className:`console-status ${f}`,children:f})]}),u.jsxs("dl",{className:"console-facts",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Workspace"}),u.jsx("dd",{children:(t==null?void 0:t.title)??"No workspace selected"})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"ID"}),u.jsx("dd",{children:t?`workspaces/${Xo(t.id)}`:"-"})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Thread"}),u.jsx("dd",{children:(t==null?void 0:t.codexThreadId)??"Not created"})]})]}),u.jsxs("label",{className:"console-toggle",children:[u.jsx("input",{checked:h,onChange:U=>M(U.target.checked),type:"checkbox"}),u.jsxs("span",{children:["Run a warmup turn after reset",u.jsx("small",{children:"The workspace will receive a system wakeup to re-orient itself after the thread is rebuilt."})]})]}),u.jsxs("div",{className:"console-actions",children:[u.jsx("button",{className:"danger",disabled:!t||a,onClick:k,title:"Kill the workspace runtime and repair every non-terminal scheduler state",type:"button",children:a?"Stopping & repairing...":"Force stop & repair"}),u.jsx("button",{className:"danger",disabled:B||o,onClick:b,type:"button",children:o?"Preparing preview...":"Preview runtime reset"}),u.jsx("button",{disabled:B||o,onClick:T,type:"button",children:"Clear memory & start blank"}),f==="running"||f==="initializing"?u.jsx("span",{children:"Force stop the active workspace operation before resetting."}):null]}),c?u.jsxs("div",{className:"console-result",children:[u.jsx("strong",{children:c.workspaceMemoryCleared?"Blank workspace context ready":"Runtime reset completed"}),u.jsxs("span",{children:[c.injectedItemCount," visible history items injected"]}),c.historyCompactionCount>0?u.jsxs("span",{children:["Full history processed in ",c.historyBatchCount," chronological batches with ",c.historyCompactionCount," native compactions"]}):null,c.workspaceMemoryCleared?u.jsx("span",{children:"Workspace Memory cleared; Base Memory retained"}):null,u.jsxs("span",{children:["New thread: ",c.newThreadId]}),c.warmupTurnId?u.jsxs("span",{children:["Warmup turn: ",c.warmupTurnId]}):null]}):null]})}),l?u.jsx(aN,{busy:e,preview:l,warmup:h,onCancel:g,onConfirm:A,onSaveSelection:q}):null]})})}function aN({busy:e,preview:t,warmup:n,onCancel:a,onConfirm:l,onSaveSelection:o}){const[c,f]=D.useState(()=>new Set(t.entries.filter(F=>F.includedByDefault).map(F=>F.id))),[h,m]=D.useState(!1),[g,v]=D.useState(!1),[k,b]=D.useState(null),T=D.useRef(null),A=t.entries.filter(F=>c.has(F.id)),q=A.filter(F=>F.role==="user").length,z=A.length-q,M=t.entries.filter(F=>F.topicRelation!==null).map(F=>F.id),B=M.filter(F=>c.has(F)).length,U=t.entries.length>0&&c.size===t.entries.length;D.useEffect(()=>{T.current&&(T.current.indeterminate=c.size>0&&c.size<t.entries.length)},[t.entries.length,c.size]);const ne=e||g;async function L(F){v(!0),b(null);try{await o(t.entries.filter(he=>F.has(he.id)).map(he=>he.id)),f(F)}catch(he){b(pt(he).message)}finally{v(!1)}}function K(F,he){const ce=new Set(c);he?ce.add(F):ce.delete(F),L(ce)}function ie(){const F=new Set(c);M.forEach(he=>F.add(he)),L(F)}function Q(){const F=new Set(c);M.forEach(he=>{F.has(he)?F.delete(he):F.add(he)}),L(F)}return u.jsx("div",{className:`reset-preview-overlay ${h?"expanded":""}`,onClick:ne?void 0:a,role:"presentation",children:u.jsxs("section",{"aria-label":"Runtime reset preview","aria-modal":"true",className:`reset-preview-dialog ${h?"expanded":""}`,onClick:F=>F.stopPropagation(),role:"dialog",children:[u.jsxs("header",{className:"reset-preview-header",children:[u.jsxs("div",{children:[u.jsx("h3",{children:"Confirm runtime reset"}),u.jsx("p",{children:"The new thread will process the selected original messages in chronological batches. Each batch is compacted natively before the next batch is injected; the old thread context is never reused."})]}),u.jsxs("div",{className:"reset-preview-header-actions",children:[u.jsx("button",{"aria-label":h?"Restore reset preview size":"Expand reset preview",onClick:()=>m(F=>!F),title:h?"Restore size":"Expand",type:"button",children:h?"⊡":"⛶"}),u.jsx("button",{"aria-label":"Close reset preview",disabled:ne,onClick:a,type:"button",children:"×"})]})]}),u.jsxs("div",{className:"reset-preview-summary",children:[u.jsxs("label",{className:"reset-preview-select-all",children:[u.jsx("input",{checked:U,disabled:ne||t.entries.length===0,onChange:F=>void L(F.target.checked?new Set(t.entries.map(he=>he.id)):new Set),ref:T,type:"checkbox"}),u.jsxs("span",{children:[c.size," of ",t.entries.length," selected"]})]}),u.jsxs("span",{children:[q," user"]}),u.jsxs("span",{children:[z," assistant"]}),M.length>0?u.jsxs("div",{className:"reset-preview-topic-actions",children:[u.jsxs("span",{children:[B," of ",M.length," Topic input + response"]}),u.jsx("button",{disabled:ne||B===M.length,onClick:ie,type:"button",children:"Select Topic turns"}),u.jsx("button",{disabled:ne,onClick:Q,type:"button",children:"Invert Topic turns"})]}):null,u.jsxs("span",{children:[t.historyBatchCount," planned batch",t.historyBatchCount===1?"":"es"]}),u.jsxs("span",{children:["~",t.estimatedTokenCount.toLocaleString()," source tokens"]}),u.jsx("span",{children:n?"Warmup enabled":"No warmup"}),g?u.jsx("span",{children:"Saving defaults..."}):null,k?u.jsx("span",{className:"reset-preview-selection-error",children:k}):null]}),u.jsx("div",{className:"reset-preview-list",children:t.entries.length>0?t.entries.map((F,he)=>u.jsxs("article",{className:`reset-preview-item ${F.role} ${c.has(F.id)?"":"excluded"}`,children:[u.jsxs("header",{children:[u.jsxs("label",{children:[u.jsx("input",{"aria-label":`Include ${F.role} message ${he+1}`,checked:c.has(F.id),disabled:ne,onChange:ce=>K(F.id,ce.target.checked),type:"checkbox"}),u.jsx("span",{children:he+1})]}),u.jsx("strong",{children:F.role}),F.topicRelation?u.jsxs("span",{className:"reset-preview-topic-badge",children:["Topic ",F.topicRelation]}):null,u.jsx("time",{dateTime:F.createdAt,children:ct(F.createdAt)})]}),u.jsx("pre",{children:F.content})]},F.id)):u.jsx("p",{className:"reset-preview-empty",children:"No visible history will be injected."})}),u.jsxs("footer",{className:"reset-preview-actions",children:[u.jsxs("small",{children:["Preview fingerprint: ",t.fingerprint.slice(0,12)]}),u.jsxs("div",{children:[u.jsx("button",{disabled:ne,onClick:a,type:"button",children:"Cancel"}),u.jsx("button",{className:"danger",disabled:ne,onClick:()=>l(t.entries.filter(F=>c.has(F.id)).map(F=>F.id)),type:"button",children:e?"Rebuilding and compacting...":"Confirm full-history reset"})]})]})]})})}function iN({currentReleasedAt:e,currentVersion:t,job:n,latest:a,latestChecking:l,starting:o,onClose:c,onRefresh:f,onStart:h}){const m=(n==null?void 0:n.currentVersion)??t,g=a!=null&&a.version&&TD(a.version,m)?CD(a.version):null;return D.useEffect(()=>{const v=k=>{k.key==="Escape"&&c()};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[c]),u.jsx("div",{className:"codex-update-overlay",onClick:c,role:"presentation",children:u.jsxs("section",{"aria-label":"Codex CLI update",className:"codex-update-panel",onClick:v=>v.stopPropagation(),children:[u.jsxs("header",{children:[u.jsxs("div",{children:[u.jsx("h3",{children:"Codex CLI update"}),u.jsx("p",{children:"Managed by Seele in the instance runtime directory."})]}),u.jsx("button",{"aria-label":"Close Codex CLI update",onClick:c,type:"button",children:"×"})]}),u.jsxs("dl",{className:"codex-update-summary",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Status"}),u.jsx("dd",{className:n?`status-${n.status}`:void 0,children:(n==null?void 0:n.status)??"Not started"})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Current"}),u.jsx("dd",{children:l1(m,(n==null?void 0:n.codexReleasedAt)??e)})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Latest"}),u.jsxs("dd",{title:(a==null?void 0:a.error)??void 0,children:[l?"Checking...":a!=null&&a.version?l1(a.version,a.releasedAt):a!=null&&a.error?"Check failed":"Not checked",g?u.jsx("a",{className:"codex-release-notes-link",href:g,rel:"noreferrer",target:"_blank",children:"Release notes"}):null]})]}),n?u.jsxs("div",{children:[u.jsx("dt",{children:"Started"}),u.jsx("dd",{children:ct(n.startedAt)})]}):null]}),a!=null&&a.error?u.jsxs("p",{className:"codex-latest-error",children:["Latest version check: ",a.error]}):null,u.jsx("div",{className:"codex-update-log",role:"log","aria-live":"polite",children:n!=null&&n.logs.length?n.logs.map((v,k)=>u.jsxs("div",{className:`log-${v.stream}`,children:[u.jsx("time",{children:jD(v.at)}),u.jsx("span",{children:v.text})]},`${v.at}-${k}`)):u.jsx("p",{children:"No update logs yet."})}),u.jsxs("footer",{children:[u.jsx("button",{className:"secondary",onClick:f,type:"button",children:"Refresh"}),u.jsx("button",{disabled:o||(n==null?void 0:n.status)==="running",onClick:h,type:"button",children:o?"Starting...":(n==null?void 0:n.status)==="running"?"Updating...":n?"Run again":"Start update"})]})]})})}function lN({currentUser:e,conversations:t,deploymentSettings:n,editingEnvironmentKey:a,environmentDraft:l,globalEnvironment:o,workspaceEnvironment:c,memorySettings:f,memorySettingsDraft:h,managedUsers:m,workspaceMemoryDraft:g,runtimeSettings:v,runtimeModels:k,runtimeCodexVersion:b,runtimeCodexReleasedAt:T,runtimeCodexUpdating:A,runtimeSettingsDraft:q,runtimeSettingsScope:z,settingsWorkspace:M,settingsWorkspaceId:B,systemDiagnostics:U,systemDiagnosticsLoading:ne,workspaceGroups:L,workspaceRuntimeSettings:K,workspaceRuntimeSettingsDraft:ie,onCancelEnvironmentEdit:Q,onClose:F,onCreateUser:he,onDeleteUser:ce,onDeleteEnvironment:Ie,onDraftChange:be,onEditEnvironment:pe,onSaveBaseMemoryItems:J,onSaveDeploymentSettings:Y,onSaveResponsibility:ge,onSaveWorkspaceMemoryItems:Te,onRevealEnvironmentValue:H,onRuntimeDraftChange:_,onCodexAccountSwitched:te,onUpdateCodexCli:O,onRuntimeScopeChange:ee,onSettingsWorkspaceChange:Ae,onSubmitRuntimeSettings:re,onSubmitEnvironment:we,onRefreshSystemDiagnostics:_e,onUpdateUser:He,onWorkspaceRuntimeDraftChange:wt,onWorkspaceRuntimeReset:et,revealedEnvironmentKeys:$t}){const[tt,fe]=D.useState("model"),[qe,Je]=D.useState(!1);D.useEffect(()=>{e.role!=="admin"&&["accounts","channels","users","system","deployment"].includes(tt)&&fe("model")},[e.role,tt]);const[Xe,Lt]=D.useState(null),[Tt,mt]=D.useState(!1),[At,pn]=D.useState((M==null?void 0:M.responsibility)??""),[en,ht]=D.useState(!1),ur=D.useRef(null),me=z==="workspace"?Object.values((K==null?void 0:K.sources)??{}).filter(Se=>Se==="workspace").length:0;return D.useEffect(()=>{z==="global"&&mt(!1)},[z]),D.useEffect(()=>{pn((M==null?void 0:M.responsibility)??"")},[M==null?void 0:M.id,M==null?void 0:M.responsibility]),D.useEffect(()=>{if(!Tt)return;const Se=at=>{var wn;const kt=at.target;kt instanceof Node&&((wn=ur.current)!=null&&wn.contains(kt))||mt(!1)},$e=at=>{at.key==="Escape"&&mt(!1)};return document.addEventListener("pointerdown",Se,!0),document.addEventListener("keydown",$e,!0),()=>{document.removeEventListener("pointerdown",Se,!0),document.removeEventListener("keydown",$e,!0)}},[Tt]),u.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:F,role:"presentation",children:u.jsxs("section",{"aria-label":"Seele settings",className:"context-panel settings-panel",onClick:Se=>Se.stopPropagation(),children:[u.jsxs("header",{className:"context-panel-header settings-panel-header",children:[u.jsxs("div",{className:"settings-panel-title",children:[u.jsx("h2",{children:"Settings"}),tt!=="system"&&tt!=="users"&&tt!=="accounts"&&tt!=="deployment"?u.jsxs("div",{"aria-label":"Configuration scope",className:"settings-scope-segments",role:"radiogroup",children:[e.role==="admin"?u.jsx("button",{"aria-checked":z==="global",className:z==="global"?"active":void 0,onClick:()=>ee("global"),role:"radio",type:"button",children:"Global"}):null,u.jsxs("div",{className:"settings-workspace-picker",ref:ur,children:[u.jsx("button",{"aria-checked":z==="workspace","aria-expanded":z==="workspace"?Tt:void 0,"aria-label":z==="workspace"?"Settings workspace target":void 0,className:z==="workspace"?"active settings-scope-workspace-trigger":void 0,disabled:t.length===0,onClick:()=>{if(z!=="workspace"){ee("workspace");return}mt(Se=>!Se)},role:"radio",type:"button",children:z==="workspace"?u.jsxs(u.Fragment,{children:[u.jsxs("span",{children:["Workspace: ",(M==null?void 0:M.title)??"Select workspace"]}),u.jsx("span",{"aria-hidden":"true",children:"⌄"})]}):"Workspace"}),z==="workspace"&&Tt?u.jsx("div",{className:"settings-workspace-menu",role:"listbox",children:L.map(Se=>u.jsxs("div",{className:"settings-workspace-menu-group",children:[u.jsx("div",{className:"settings-workspace-menu-heading",children:Se.title}),Se.conversations.map($e=>u.jsxs("button",{"aria-selected":$e.id===B,className:$e.id===B?"selected":void 0,onClick:()=>{Ae($e.id),mt(!1)},role:"option",type:"button",children:[u.jsx("span",{children:$e.title}),u.jsxs("small",{children:["workspaces/",$e.id]})]},$e.id))]},Se.id))}):null]})]}):null]}),u.jsx("div",{className:"settings-header-actions",children:u.jsx("button",{"aria-label":"Close settings panel",onClick:F,type:"button",children:"×"})})]}),u.jsxs("div",{className:"settings-body",children:[u.jsxs("nav",{className:"settings-nav","aria-label":"Settings sections",children:[u.jsxs("button",{className:tt==="model"?"active":void 0,onClick:()=>fe("model"),type:"button",children:[u.jsx("span",{children:"Runtime"}),u.jsx("small",{children:"Effective settings"})]}),u.jsxs("button",{className:tt==="responsibility"?"active":void 0,onClick:()=>fe("responsibility"),type:"button",children:[u.jsx("span",{children:"Responsibility"}),u.jsx("small",{children:"Workspace role"})]}),u.jsxs("button",{className:tt==="memory"?"active":void 0,onClick:()=>fe("memory"),type:"button",children:[u.jsx("span",{children:"Memory"}),u.jsx("small",{children:"Base + workspace context"})]}),u.jsxs("button",{className:tt==="environment"?"active":void 0,onClick:()=>fe("environment"),type:"button",children:[u.jsx("span",{children:"Environment"}),u.jsx("small",{children:"Base + workspace variables"})]}),e.role==="admin"?u.jsxs(u.Fragment,{children:[u.jsxs("button",{className:tt==="accounts"?"active":void 0,onClick:()=>fe("accounts"),type:"button",children:[u.jsx("span",{children:"Codex Accounts"}),u.jsx("small",{children:"Cloud login + active account"})]}),u.jsxs("button",{className:tt==="channels"?"active":void 0,onClick:()=>fe("channels"),type:"button",children:[u.jsx("span",{children:"Custom model channels"}),u.jsx("small",{children:"Endpoint + key + fixed model"})]}),u.jsxs("button",{className:tt==="deployment"?"active":void 0,onClick:()=>fe("deployment"),type:"button",children:[u.jsx("span",{children:"Deployment"}),u.jsx("small",{children:"Local integrations"})]}),u.jsxs("button",{onClick:()=>{window.location.assign(`${V1()}admin/host`)},type:"button",children:[u.jsx("span",{children:"Work Operations"}),u.jsx("small",{children:"Versions, restart, logs"})]}),u.jsxs("button",{className:tt==="system"?"active":void 0,onClick:()=>fe("system"),type:"button",children:[u.jsx("span",{children:"System"}),u.jsx("small",{children:"Runtime + resources"})]}),u.jsxs("button",{className:tt==="users"?"active":void 0,onClick:()=>fe("users"),type:"button",children:[u.jsx("span",{children:"Users"}),u.jsx("small",{children:"Access + roles"})]})]}):null]}),u.jsxs("section",{className:"settings-content",children:[tt!=="system"&&tt!=="users"&&tt!=="accounts"&&tt!=="channels"&&tt!=="deployment"?u.jsxs("div",{className:`settings-scope-banner ${z==="workspace"?"workspace":"global"}`,children:[u.jsx("strong",{children:z==="workspace"?"Editing workspace custom settings":"Editing global settings"}),u.jsx("span",{children:z==="workspace"?`${(M==null?void 0:M.title)??"Selected workspace"} overrides global defaults.`:"These defaults apply to every workspace unless that workspace overrides them."})]}):null,tt==="system"?u.jsx(sN,{conversations:t,diagnostics:U,loading:ne,onRefresh:_e}):tt==="users"?u.jsx(pN,{currentUser:e,users:m,onCreate:he,onDelete:ce,onUpdate:He}):tt==="channels"?e.role==="admin"?u.jsx(LA,{load:lz,save:uz,queryBalance:oz}):null:tt==="accounts"?e.role==="admin"?u.jsx(mN,{onSwitched:te}):null:tt==="deployment"?u.jsx(gN,{settings:n,onSave:Y}):tt==="model"?u.jsx(yN,{draft:z==="workspace"?ie:q,globalSettings:v,models:k,codexVersion:b,codexReleasedAt:T,codexUpdating:A,scope:z,workspaceOverrideCount:me,settings:z==="workspace"?(K==null?void 0:K.effective)??ie:v,workspaceSettings:K,onDraftChange:z==="workspace"?wt:_,onResetWorkspaceSetting:et,onSubmit:re,onUpdateCodexCli:O}):tt==="responsibility"?u.jsx(cN,{draft:At,saving:en,scope:z,workspace:M,onDraftChange:pn,onSubmit:Se=>{Se.preventDefault(),Se.stopPropagation(),!(z!=="workspace"||!M)&&(ht(!0),ge(M.id,At).then($e=>pn($e)).finally(()=>ht(!1)))}}):tt==="memory"?u.jsx(vN,{baseSettings:f,scope:z,workspaceSettings:g,workspaceName:M==null?void 0:M.title,onSaveBaseItems:J,onSaveWorkspaceItems:Te}):u.jsx(wN,{deleteConfirmKey:Xe,editingEnvironmentKey:a,environmentDraft:l,globalEnvironment:o,scope:z,workspaceEnvironment:c,valueVisible:qe,onCancelEnvironmentEdit:Q,onDeleteConfirmChange:Lt,onDeleteEnvironment:Ie,onDraftChange:be,onEditEnvironment:pe,onRevealEnvironmentValue:H,onSubmitEnvironment:we,onValueVisibleChange:Je,revealedEnvironmentKeys:$t})]})]})]})})}function sN({conversations:e,diagnostics:t,loading:n,onRefresh:a}){const l=(t==null?void 0:t.runtime.pool)??null,o=D.useMemo(()=>(t==null?void 0:t.systemLogs)??[],[t]),[c,f]=D.useState(!1),h=D.useMemo(()=>new Map(e.map(b=>[b.id,b.title])),[e]),m=D.useMemo(()=>t?JSON.stringify({generatedAt:t.generatedAt,app:t.app,systemLogs:o},null,2):"",[t,o]),g=async()=>{m&&(await navigator.clipboard.writeText(m),f(!0),window.setTimeout(()=>f(!1),1800))},v=()=>{if(!m||!t)return;const b=URL.createObjectURL(new Blob([m],{type:"application/json"})),T=document.createElement("a");T.href=b,T.download=`seele-system-log-${t.generatedAt.replaceAll(":","-").replaceAll(".","-")}.json`,T.click(),URL.revokeObjectURL(b)},k=()=>{if(!t||!o.length)return;const b=o[0],T=o.slice(0,5).map(B=>`- ${$c(B.createdAt)} · ${B.level.toUpperCase()} · ${B.event} · ${B.summary}`).join(`
|
|
364
364
|
`),A=JSON.stringify(b,null,2),q=["## Environment","",`- Seele: ${t.app.version}`,`- Runtime: ${t.app.runtime}`,`- Report generated: ${$c(t.generatedAt)}`,"","## Latest incident","","```json",A.slice(0,2500),"```","","## Recent system log","",T,"","_Generated by Seele System Log. Attach the downloaded JSON report when more history is needed._"].join(`
|
|
365
|
-
`),z=`[System Log] ${b.summary}`.slice(0,180),M=new URL("https://github.com/seele-labs/seele-work/issues/new");M.searchParams.set("title",z),M.searchParams.set("body",q),window.open(M.toString(),"_blank","noopener,noreferrer")};return u.jsxs("section",{className:"system-information-section",children:[u.jsxs("header",{className:"settings-section-header",children:[u.jsxs("div",{children:[u.jsx("h3",{children:"System"}),u.jsx("p",{children:"Read-only runtime and resource information managed by Seele."})]}),u.jsx("button",{className:"system-information-refresh",disabled:n,onClick:a,type:"button",children:n?"Refreshing...":"Refresh"})]}),l?u.jsxs(u.Fragment,{children:[u.jsxs("dl",{className:"system-information-summary",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"LRU pool target"}),u.jsxs("dd",{children:[jr(l.maxRetainedRuntimes)," runtimes"]}),u.jsx("small",{children:l.capacitySource==="system_memory"?"Idle runtimes are released by least recent use":"Fallback target because system memory was unavailable"})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Retention policy"}),u.jsxs("dd",{children:["LRU · ",gp(l.maxIdleSeconds*1e3)," max idle"]}),u.jsx("small",{children:"Only idle runtimes are eligible for eviction"})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Current pool"}),u.jsxs("dd",{children:[l.activeRuntimeCount," active · ",l.idleRuntimeCount," idle"]}),u.jsxs("small",{children:[l.retainedRuntimeCount," retained runtimes"]})]})]}),u.jsxs("section",{className:"system-runtime-list",children:[u.jsxs("header",{children:[u.jsxs("div",{children:[u.jsx("h4",{children:"Workspace runtimes"}),u.jsx("p",{children:"Active workspaces and idle runtimes currently retained for reuse."})]}),u.jsx("time",{dateTime:t==null?void 0:t.generatedAt,children:t?ct(t.generatedAt):""})]}),l.workspaces.length>0?u.jsxs("div",{className:"system-runtime-table",children:[u.jsxs("div",{className:"system-runtime-table-header",children:[u.jsx("span",{children:"Workspace"}),u.jsx("span",{children:"Status"}),u.jsx("span",{children:"Runtime"}),u.jsx("span",{children:"Age"})]}),l.workspaces.map(b=>u.jsxs("div",{className:"system-runtime-row",children:[u.jsxs("div",{children:[u.jsx("strong",{children:h.get(b.workspaceId)??b.workspaceId}),u.jsx("small",{children:b.workspaceId})]}),u.jsx("span",{className:`system-runtime-state ${b.turnId?"active":"idle"}`,children:b.lifecycle==="shutting_down"?"Shutting down":b.turnId?"Active":"Idle"}),u.jsxs("div",{children:[u.jsx("span",{children:b.turnId?b.state:"Retained"}),u.jsx("small",{children:b.pid===null?"PID unavailable":`PID ${b.pid}`})]}),u.jsx("span",{children:b.idleMs===null?gp(b.uptimeMs):`${gp(b.idleMs)} idle`})]},b.workspaceId))]}):u.jsx("div",{className:"system-runtime-empty",children:"No workspace runtimes are currently retained."})]}),u.jsxs("section",{className:"system-runtime-list system-log-list",children:[u.jsxs("header",{children:[u.jsxs("div",{children:[u.jsx("h4",{children:"System log"}),u.jsx("p",{children:"Recent persistent warnings and errors for external diagnostics."})]}),u.jsxs("div",{className:"system-log-actions",children:[u.jsx("button",{"aria-label":"Copy system log report",className:"icon-button",disabled:!o.length,onClick:()=>void g(),title:"Copy system log report",type:"button",children:u.jsx(Q1,{})}),u.jsx("button",{"aria-label":"Download system log report",className:"icon-button",disabled:!o.length,onClick:v,title:"Download system log report",type:"button",children:u.jsx(oN,{})}),u.jsx("button",{"aria-label":"Report system log issue",className:"icon-button",disabled:!o.length,onClick:k,title:"Report issue to seele-labs/seele-work",type:"button",children:u.jsx(uN,{})}),c?u.jsx("small",{children:"Copied"}):null]})]}),o.length?u.jsx("div",{className:"system-log-entries",children:o.map(b=>u.jsxs("details",{className:`system-log-entry ${b.level}`,children:[u.jsxs("summary",{children:[u.jsx("span",{className:"system-log-level",children:b.level}),u.jsxs("span",{children:[u.jsx("strong",{children:b.summary}),u.jsxs("small",{children:[b.component," · ",$c(b.createdAt)]})]})]}),u.jsxs("dl",{children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Event"}),u.jsx("dd",{children:b.event})]}),b.workspaceId?u.jsxs("div",{children:[u.jsx("dt",{children:"Workspace"}),u.jsxs("dd",{children:[h.get(b.workspaceId)??b.workspaceId," · ",b.workspaceId]})]}):null,b.turnId?u.jsxs("div",{children:[u.jsx("dt",{children:"Turn"}),u.jsx("dd",{children:b.turnId})]}):null,b.runtimeId?u.jsxs("div",{children:[u.jsx("dt",{children:"Runtime"}),u.jsx("dd",{children:b.runtimeId})]}):null]}),u.jsx("pre",{children:JSON.stringify(b.detail,null,2)})]},b.id))}):u.jsx("div",{className:"system-runtime-empty",children:"No warnings or errors have been recorded."})]})]}):u.jsx("div",{className:"system-runtime-empty",children:n?"Loading system information...":"System information is unavailable."})]})}function oN(){return u.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",children:u.jsx("path",{d:"M12 3v12m0 0 4-4m-4 4-4-4M5 20h14"})})}function uN(){return u.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",children:[u.jsx("circle",{cx:"12",cy:"12",r:"9"}),u.jsx("path",{d:"M12 7v6m0 4h.01"})]})}function cN({draft:e,saving:t,scope:n,workspace:a,onDraftChange:l,onSubmit:o}){const c=n==="workspace";return u.jsxs(u.Fragment,{children:[u.jsx("header",{className:"settings-section-header",children:u.jsxs("div",{children:[u.jsx("h3",{children:"Responsibility"}),u.jsx("p",{children:"Workspace-specific long-lived role. This is content context, so it is only editable in workspace scope."})]})}),c&&a?u.jsxs("form",{className:"settings-responsibility-form",onSubmit:o,children:[u.jsxs("label",{children:[u.jsx("span",{children:a.title}),u.jsx("textarea",{"aria-label":"Workspace responsibility",onChange:f=>l(f.target.value),placeholder:"Describe this workspace's durable role, scope, and long-term responsibilities.",rows:14,value:e})]}),u.jsx("div",{className:"settings-form-actions",children:u.jsx("button",{disabled:t,type:"submit",children:t?"Saving...":"Save responsibility"})})]}):u.jsx("section",{className:"settings-readonly-block",children:u.jsxs("div",{children:[u.jsx("strong",{children:"Workspace-only setting"}),u.jsx("span",{children:"Switch the header scope to Workspace and choose a workspace to edit its responsibility."})]})})]})}function dN({usage:e}){return u.jsx("div",{"aria-label":"Codex account usage",className:"codex-account-usage",children:[...e.windows].sort((t,n)=>t.windowDurationMins-n.windowDurationMins).map(t=>{const n=Of(t.usedPercent),a=gx(t.windowDurationMins);return u.jsxs("div",{className:"codex-account-usage-window",children:[u.jsx("div",{className:"codex-account-usage-heading",children:u.jsxs("span",{children:[a," used ",u.jsxs("small",{children:["(Resets ",Zx(t.resetsAt),")"]})]})}),u.jsxs("div",{className:"codex-account-usage-meter",children:[u.jsx("span",{"aria-hidden":"true",className:"codex-account-usage-track",children:u.jsx("span",{style:{width:`${n}%`}})}),u.jsx("strong",{children:Xx(n)})]})]},`${t.windowDurationMins}:${t.resetsAt}`)})})}function fN(e){if(!e)return null;const t=e.toLowerCase();return t==="chatgpt"?"ChatGPT":t==="apikey"||t==="api_key"?"API key":e}function hN(e){return e?e.split(/[_-]/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" "):null}function mN({onSwitched:e}){var tt;const[t,n]=D.useState(null),[a,l]=D.useState(!0),[o,c]=D.useState(!1),[f,h]=D.useState(!1),[m,g]=D.useState(""),[v,k]=D.useState(!1),[b,T]=D.useState(""),[A,q]=D.useState(null),[z,M]=D.useState(null),[B,U]=D.useState(""),[ae,L]=D.useState(()=>new Date);D.useEffect(()=>{const fe=window.setInterval(()=>L(new Date),3e4);return()=>window.clearInterval(fe)},[]);const[K,ie]=D.useState(""),[Q,F]=D.useState(null),[he,ce]=D.useState(""),[Ie,be]=D.useState(null),[pe,J]=D.useState(!1),[Y,ge]=D.useState(""),[Te,H]=D.useState(null),_=D.useRef(new Map);async function te(fe,qe){if(f||o||!window.confirm(`Use one reset credit for ${fe.name}? This consumes the credit if an eligible rate-limit window is reset.`))return;const Je=JSON.stringify([fe.id,qe.id]),Xe=_.current.get(Je)??crypto.randomUUID();_.current.set(Je,Xe),h(!0),g(""),ge("");try{const Lt=ze(`settings/runtime/accounts/${encodeURIComponent(fe.id)}/reset-credits/consume`),Tt=await fetch(Lt,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({creditId:qe.id,idempotencyKey:Xe})});await Fe(Tt,{method:"POST",url:Lt});const mt=await Tt.json(),pn={reset:"Reset credit used. Eligible rate limits have been reset.",alreadyRedeemed:"This reset was already completed.",nothingToReset:"No rate-limit window needs a reset. No credit was used.",noCredit:"No reset credit is available for this account."}[mt.outcome];if(!pn)throw new Error("Reset outcome is unknown. Refresh details before trying again.");(mt.outcome==="nothingToReset"||mt.outcome==="noCredit")&&_.current.delete(Je),ge(`${fe.name}: ${pn}`),n(en=>{if(!en)return en;const ht={...en.accountDetails};return delete ht[fe.id],{...en,accountDetails:ht}});try{const en=await pp(!0);n(ht=>ap(ht,en))}catch{g("The result above is confirmed, but refreshing details failed. Please refresh details.")}}catch(Lt){g(`${pt(Lt).message} The outcome may be unknown; retrying this credit on this page reuses the same request ID.`)}finally{h(!1)}}async function O(){var qe;const fe=await x5();n(fe),((qe=fe.login)==null?void 0:qe.status)==="pending"&&(q(fe.login),k(!0))}async function ee(fe){c(!0),g("");try{const qe=await pp(fe);n(Je=>ap(Je,qe))}catch(qe){g(pt(qe).message)}finally{c(!1)}}D.useEffect(()=>{let fe=!1;return x5().then(qe=>{var Je;fe||(n(qe),((Je=qe.login)==null?void 0:Je.status)==="pending"&&(q(qe.login),k(!0)),qe.accounts.length>0&&(c(!0),pp(!1).then(Xe=>{fe||n(Lt=>ap(Lt,Xe))}).catch(Xe=>{fe||g(pt(Xe).message)}).finally(()=>{fe||c(!1)})))}).catch(qe=>{fe||g(pt(qe).message)}).finally(()=>{fe||l(!1)}),()=>{fe=!0}},[]),D.useEffect(()=>{if(!A||A.status!=="pending")return;let fe=!1;const qe=window.setInterval(()=>{pz(A.id).then(async Je=>{fe||(q(Je),Je.status!=="pending"&&(window.clearInterval(qe),Je.status==="succeeded"&&n(Xe=>{if(!Xe||!Je.account)return Xe;const Lt=Xe.accounts.some(Tt=>{var mt;return Tt.id===((mt=Je.account)==null?void 0:mt.id)})?Xe.accounts.map(Tt=>{var mt;return Tt.id===((mt=Je.account)==null?void 0:mt.id)?Je.account:Tt}):[...Xe.accounts,Je.account];return{...Xe,accounts:Lt}})))}).catch(Je=>{fe||g(pt(Je).message)})},1e3);return()=>{fe=!0,window.clearInterval(qe)}},[A==null?void 0:A.id,A==null?void 0:A.status]);function Ae(){T(""),q(null),g(""),J(!1),k(!0)}async function ne(fe){fe.preventDefault(),h(!0),g("");try{q(await mz(b.trim()))}catch(qe){g(pt(qe).message)}finally{h(!1)}}async function we(){if(!A||A.status!=="pending"){k(!1);return}h(!0),g("");try{const fe=await gz(A.id);q(fe),k(!1)}catch(fe){g(pt(fe).message)}finally{h(!1)}}function _e(fe){M(fe),U(fe.renewalDay==null?"":String(fe.renewalDay)),ie(fe.name),g("")}async function He(fe){if(fe.preventDefault(),!z)return;const qe=K.trim();if(!qe){M(null);return}h(!0),g("");try{await yz(z.id,qe,B===""?null:Number(B)),await O(),M(null)}catch(Je){g(pt(Je).message)}finally{h(!1)}}async function wt(){if(Q){h(!0),g("");try{const fe=await xz(Q.id);n(fe),F(null),ce("Account selection saved. Each deployment applies it to new requests after syncing; active turns are unchanged."),e().catch(()=>{ce("Account selection saved. Refreshing local status failed; deployment synchronization will continue in the background.")})}catch(fe){const qe=pt(fe);g(qe.detail??qe.message)}finally{h(!1)}}}async function et(){if(Ie){h(!0),g("");try{await vz(Ie.id),await O(),be(null)}catch(fe){g(pt(fe).detail??pt(fe).message)}finally{h(!1)}}}const $t=(t==null?void 0:t.accounts)??[];return u.jsxs("section",{className:"settings-section codex-accounts-section",children:[u.jsxs("header",{className:"settings-section-header",children:[u.jsxs("div",{children:[u.jsx("h3",{children:"Codex Accounts"}),u.jsx("p",{children:"Manage the cloud-owned Codex logins. Every deployment uses the same globally active account; workspaces do not bind to accounts."})]}),u.jsxs("div",{className:"codex-account-toolbar",children:[u.jsx("button",{className:"codex-account-add",disabled:f||o||$t.length===0,onClick:()=>void ee(!0),type:"button",children:o?"Refreshing...":"Refresh details"}),u.jsx("button",{className:"codex-account-add",disabled:f||o||(A==null?void 0:A.status)==="pending",onClick:Ae,type:"button",children:"Add account"})]})]}),u.jsxs("div",{className:"codex-account-policy",children:[u.jsx("strong",{children:"Cloud-wide account selection"}),u.jsx("span",{children:"Active turns keep their original account. Each deployment uses the selected account for new requests after syncing, without pausing existing work. There is no per-deployment selection."})]}),he?u.jsx("p",{className:"settings-note",role:"status",children:he}):null,m?u.jsx("p",{className:"memory-editor-error",children:m}):null,a?u.jsx("p",{className:"settings-note",children:"Loading Codex accounts..."}):null,!a&&$t.length===0?u.jsx("p",{className:"settings-note",children:"No persisted Codex account. Add one with the official device login flow."}):null,u.jsx("div",{className:"codex-account-list",children:$t.map(fe=>{var pn,en;const qe=(t==null?void 0:t.activeAccountId)===fe.id,Je=DA(fe.renewalDay,ae),Xe=(pn=t==null?void 0:t.accountDetails)==null?void 0:pn[fe.id],Lt=((en=t==null?void 0:t.accountIssues)==null?void 0:en[fe.id])??[],Tt=Lt.length>0,mt=Lt.some(ht=>["missing_credential","invalid_credential","credential_unreadable"].includes(ht.code)),At=[fe.email,fN(fe.accountType),hN(fe.planType)].filter(ht=>!!ht);return u.jsxs("article",{className:`codex-account-card${qe?" active":""}${Tt?" issue":""}`,children:[u.jsxs("div",{className:"codex-account-main",children:[u.jsxs("div",{className:"codex-account-title",children:[u.jsx("strong",{children:fe.name}),qe?u.jsx("span",{className:"codex-account-active",children:"Selected"}):null,Tt?u.jsx("span",{className:"codex-account-warning",children:"Needs attention"}):null]}),u.jsxs("small",{children:[At.join(" · ")||`Added ${ct(fe.createdAt)}`,Je?u.jsxs("span",{title:`按手动设置的每月 ${fe.renewalDay} 日计算(北京时间),下次 ${Je.date}`,children:[" · ",Je.days===0?"今日续费":`距续费 ${Je.days} 天`]}):null]}),Tt?u.jsx("div",{className:"codex-account-issues",role:"status",children:Lt.map(ht=>u.jsx("span",{children:ht.message},ht.code))}):null,Xe!=null&&Xe.usage?u.jsx(dN,{usage:Xe.usage}):u.jsx("span",{className:"codex-account-usage-empty",children:o?"Reading account usage...":"Usage unavailable"}),Xe?u.jsx("small",{className:Xe.error?"codex-account-detail-error":"codex-account-refreshed",children:Xe.error?`Refresh issue: ${Xe.error}`:`Updated ${ct(Xe.refreshedAt)}`}):null]}),u.jsxs("div",{className:"codex-account-actions",children:[u.jsxs("button",{className:"codex-credit-count",type:"button",disabled:f,"aria-label":`${fe.name}(${Xe!=null&&Xe.error||!(Xe!=null&&Xe.rateLimitResetCredits)?"券数量未知":`${Xe.rateLimitResetCredits.availableCount} 张可用券`})`,title:`${fe.name}(${Xe!=null&&Xe.error||!(Xe!=null&&Xe.rateLimitResetCredits)?"券数量未知":`${Xe.rateLimitResetCredits.availableCount} 张可用券`})`,onClick:()=>{H(fe.id),ge(""),g("")},children:[u.jsxs("svg",{"aria-hidden":"true",width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",children:[u.jsx("path",{d:"M3 5h18v5a2 2 0 0 0 0 4v5H3v-5a2 2 0 0 0 0-4V5Z"}),u.jsx("path",{d:"M16 5v3m0 3v2m0 3v3"})]}),u.jsx("span",{children:Xe!=null&&Xe.error||!(Xe!=null&&Xe.rateLimitResetCredits)?"—":Xe.rateLimitResetCredits.availableCount})]}),u.jsx("button",{disabled:f||o||mt,onClick:()=>_e(fe),title:mt?"Sign in again or delete this account to replace its credential.":void 0,type:"button",children:Tt?"Repair & edit":"Edit"}),u.jsx("button",{disabled:f||qe||Tt,onClick:()=>{g(""),F(fe)},type:"button",children:Tt?"Unavailable":"Switch"}),u.jsx("button",{className:"danger",disabled:f||o||qe,onClick:()=>{g(""),be(fe)},type:"button",children:"Delete"})]})]},fe.id)})}),Te&&$t.some(fe=>fe.id===Te)?u.jsxs("dialog",{className:"memory-editor-popover codex-credit-dialog","aria-label":"Rate-limit reset credits",ref:fe=>{fe&&!fe.open&&fe.showModal()},onCancel:fe=>{fe.preventDefault(),f||H(null)},children:[u.jsxs("header",{children:[u.jsx("strong",{children:"Rate-limit reset credits"}),u.jsx("button",{autoFocus:!0,className:"memory-icon-button",type:"button","aria-label":"Close reset credits",disabled:f,onClick:()=>H(null),children:"×"})]}),Y?u.jsx("p",{className:"settings-note",role:"status",children:Y}):null,m?u.jsx("p",{className:"memory-editor-error",role:"alert",children:m}):null,$t.filter(fe=>fe.id===Te).map(fe=>{var Xe,Lt,Tt,mt;const qe=(Xe=t==null?void 0:t.accountDetails)==null?void 0:Xe[fe.id],Je=qe==null?void 0:qe.rateLimitResetCredits;return u.jsxs("article",{className:"codex-credit-group",children:[u.jsxs("div",{className:"codex-credit-group-heading",children:[u.jsx("strong",{children:fe.name}),u.jsx("span",{children:qe!=null&&qe.error?"Unavailable":Je?`${Je.availableCount} available`:o?"Loading...":"Unavailable"})]}),Je?Je.availableCount===0&&!((Lt=Je.credits)!=null&&Lt.length)?u.jsx("small",{children:"No reset credits available."}):null:u.jsx("small",{children:"Credit details unavailable. Refresh details to try again."}),u.jsx("div",{className:"codex-credit-grid",children:(Tt=Je==null?void 0:Je.credits)==null?void 0:Tt.map(At=>{var ur,me;const pn=At.expiresAt!==null&&At.expiresAt*1e3<=ae.getTime(),en=At.status==="available"&&!pn,ht=pn&&At.status==="available"?"Expired":At.status;return u.jsxs("article",{className:`codex-credit-ticket${en?"":" inactive"}`,"aria-label":`${fe.name}: ${At.title||"Rate-limit reset"}`,children:[u.jsxs("div",{className:"codex-credit-ticket-heading",children:[u.jsx("strong",{title:At.title||"Rate-limit reset",children:At.title||"Rate-limit reset"}),u.jsx("span",{className:"codex-credit-badge",children:en?"1 use":ht})]}),u.jsx("small",{children:At.expiresAt===null?"No expiry":`Expires ${ct(new Date(At.expiresAt*1e3).toISOString())}`}),u.jsxs("div",{className:"codex-credit-ticket-actions",children:[u.jsxs("details",{children:[u.jsx("summary",{children:"Details"}),At.description?u.jsx("p",{children:At.description}):null,u.jsxs("p",{children:["Single-use credit · ",ht]}),u.jsxs("p",{children:["Granted ",ct(new Date(At.grantedAt*1e3).toISOString())]}),At.resetType!=="codexRateLimits"?u.jsx("p",{children:"This credit type is not supported."}):null]}),u.jsx("button",{className:"codex-account-add codex-credit-use",type:"button",disabled:f||o||!!(qe!=null&&qe.error)||!en||At.resetType!=="codexRateLimits"||!!((me=(ur=t==null?void 0:t.accountIssues)==null?void 0:ur[fe.id])!=null&&me.length),onClick:()=>void te(fe,At),children:"Use"})]})]},At.id)})}),Je&&Je.availableCount>(((mt=Je.credits)==null?void 0:mt.length)??0)?u.jsx("small",{children:"Credit details unavailable for some credits. Refresh details to use them."}):null,qe!=null&&qe.error?u.jsxs("small",{className:"codex-credit-error",children:["Refresh issue: ",qe.error]}):null]},fe.id)}),u.jsx("footer",{className:"memory-editor-actions",children:u.jsx("button",{type:"button",className:"memory-dialog-button",disabled:f||o,onClick:()=>void ee(!0),children:o?"Refreshing...":"Refresh details"})})]}):null,z?u.jsx("div",{className:"memory-editor-overlay",onClick:()=>!f&&M(null),role:"presentation",children:u.jsxs("form",{"aria-label":"Edit Codex account",className:"memory-editor-popover codex-account-login-dialog",onClick:fe=>fe.stopPropagation(),onSubmit:fe=>void He(fe),children:[u.jsxs("header",{children:[u.jsx("strong",{children:"Edit Codex Account"}),u.jsx("button",{"aria-label":"Close account editor",className:"memory-icon-button",disabled:f,onClick:()=>M(null),type:"button",children:"×"})]}),u.jsx("p",{className:"settings-note",children:"This name is only a Seele label. It does not change the Codex login or credential."}),u.jsxs("label",{children:[u.jsx("span",{children:"Account name"}),u.jsx("input",{"aria-label":"Codex account name",autoFocus:!0,maxLength:80,onChange:fe=>ie(fe.target.value),value:K})]}),u.jsxs("label",{children:[u.jsx("span",{children:"每月续费日"}),u.jsxs("select",{"aria-label":"每月续费日",value:B,title:"按北京时间计算;不足对应日期的月份按月末计算",onChange:fe=>U(fe.target.value),children:[u.jsx("option",{value:"",children:"未设置"}),Array.from({length:31},(fe,qe)=>qe+1).map(fe=>u.jsxs("option",{value:fe,children:[fe," 日"]},fe))]})]}),m?u.jsx("p",{className:"memory-editor-error",children:m}):null,u.jsxs("div",{className:"memory-editor-actions",children:[u.jsx("button",{className:"memory-dialog-button",disabled:f,onClick:()=>M(null),type:"button",children:"Cancel"}),u.jsx("button",{className:"memory-dialog-button primary",disabled:f||!K.trim(),type:"submit",children:f?"Saving...":"Save"})]})]})}):null,v?u.jsx("div",{className:"memory-editor-overlay",onClick:()=>!f&&!A&&k(!1),role:"presentation",children:A?u.jsxs("section",{"aria-label":"Complete Codex account login",className:"memory-delete-dialog codex-account-login-dialog",onClick:fe=>fe.stopPropagation(),children:[u.jsxs("header",{children:[u.jsx("strong",{children:A.status==="succeeded"?"Account Added":"Complete Codex Login"}),u.jsx("button",{"aria-label":"Close account login",className:"memory-icon-button",disabled:f,onClick:()=>void we(),type:"button",children:"×"})]}),A.status==="pending"?u.jsxs(u.Fragment,{children:[u.jsx("p",{children:"Open the official Codex device page and enter this one-time code."}),u.jsxs("div",{className:"codex-device-code",children:[u.jsx("strong",{children:A.userCode}),u.jsx("button",{onClick:()=>{navigator.clipboard.writeText(A.userCode),J(!0),window.setTimeout(()=>J(!1),1500)},type:"button",children:pe?"Copied":"Copy code"})]}),u.jsx("a",{href:A.verificationUrl,rel:"noreferrer",target:"_blank",children:"Open Codex device login"}),u.jsx("small",{className:"codex-login-waiting",children:"Waiting for Codex to confirm the login..."})]}):A.status==="succeeded"?u.jsxs("p",{children:[u.jsx("strong",{children:((tt=A.account)==null?void 0:tt.name)??A.accountName})," is persisted on the cloud and ready to synchronize. It was not activated automatically."]}):u.jsx("p",{className:"memory-editor-error",children:A.error??"Codex login was cancelled."}),u.jsx("div",{className:"memory-delete-actions",children:u.jsx("button",{className:"memory-dialog-button",disabled:f,onClick:()=>void we(),type:"button",children:A.status==="pending"?"Cancel login":"Close"})})]}):u.jsxs("form",{"aria-label":"Add Codex account",className:"memory-editor-popover codex-account-login-dialog",onClick:fe=>fe.stopPropagation(),onSubmit:fe=>void ne(fe),children:[u.jsxs("header",{children:[u.jsx("strong",{children:"Add Codex Account"}),u.jsx("button",{"aria-label":"Close account login",className:"memory-icon-button",onClick:()=>k(!1),type:"button",children:"×"})]}),u.jsx("p",{className:"settings-note",children:"Seele creates the login profile on the cloud. Completing login shares it with every deployment but does not make it active."}),u.jsxs("label",{children:[u.jsx("span",{children:"Account name"}),u.jsx("input",{autoFocus:!0,maxLength:80,onChange:fe=>T(fe.target.value),placeholder:"For example: Codex backup",value:b})]}),m?u.jsx("p",{className:"memory-editor-error",children:m}):null,u.jsxs("div",{className:"memory-editor-actions",children:[u.jsx("button",{className:"memory-dialog-button",onClick:()=>k(!1),type:"button",children:"Cancel"}),u.jsx("button",{className:"memory-dialog-button primary",disabled:f||!b.trim(),type:"submit",children:f?"Starting...":"Continue"})]})]})}):null,Q?u.jsx("div",{className:"memory-editor-overlay",onClick:()=>!f&&F(null),role:"presentation",children:u.jsxs("section",{"aria-label":"Switch Codex account",className:"memory-delete-dialog",onClick:fe=>fe.stopPropagation(),children:[u.jsxs("header",{children:[u.jsx("strong",{children:"Switch Codex Account"}),u.jsx("button",{"aria-label":"Close account switch",className:"memory-icon-button",disabled:f,onClick:()=>F(null),type:"button",children:"×"})]}),u.jsxs("p",{children:["Switch cloud-wide execution to ",u.jsx("strong",{children:Q.name}),"? Active turns continue with the account they started with. New requests use this account once their deployment syncs; workspace threads and memory stay unchanged."]}),m?u.jsx("p",{className:"memory-editor-error",children:m}):null,u.jsxs("div",{className:"memory-delete-actions",children:[u.jsx("button",{className:"memory-dialog-button",disabled:f,onClick:()=>F(null),type:"button",children:"Cancel"}),u.jsx("button",{className:"memory-dialog-button primary",disabled:f,onClick:()=>void wt(),type:"button",children:f?"Switching...":"Switch account"})]})]})}):null,Ie?u.jsx("div",{className:"memory-editor-overlay",onClick:()=>!f&&be(null),role:"presentation",children:u.jsxs("section",{"aria-label":"Delete Codex account",className:"memory-delete-dialog",onClick:fe=>fe.stopPropagation(),children:[u.jsxs("header",{children:[u.jsx("strong",{children:"Delete Codex Account"}),u.jsx("button",{"aria-label":"Close account deletion",className:"memory-icon-button",disabled:f,onClick:()=>be(null),type:"button",children:"×"})]}),u.jsxs("p",{children:["Delete ",u.jsx("strong",{children:Ie.name})," and its persisted Codex credential from the cloud and every member mirror? This cannot be undone."]}),m?u.jsx("p",{className:"memory-editor-error",children:m}):null,u.jsxs("div",{className:"memory-delete-actions",children:[u.jsx("button",{className:"memory-dialog-button",disabled:f,onClick:()=>be(null),type:"button",children:"Cancel"}),u.jsx("button",{className:"memory-dialog-button danger",disabled:f,onClick:()=>void et(),type:"button",children:f?"Deleting...":"Delete"})]})]})}):null]})}function pN({currentUser:e,users:t,onCreate:n,onDelete:a,onUpdate:l}){const o={username:"",password:"",role:"user",active:!0},[c,f]=D.useState(null),[h,m]=D.useState(o),[g,v]=D.useState(!1),[k,b]=D.useState(null),[T,A]=D.useState("");function q(){m(o),A(""),f("new")}function z(U){m({username:U.username,password:"",role:U.role,active:U.active}),A(""),f(U)}function M(){g||(f(null),A(""))}async function B(U){if(U.preventDefault(),!!c){v(!0),A("");try{c==="new"?await n({username:h.username.trim(),password:h.password,role:h.role}):await l(c.id,{username:h.username.trim(),password:h.password||void 0,role:h.role,active:h.active}),f(null)}catch(ae){A(pt(ae).message)}finally{v(!1)}}}return u.jsxs("section",{className:"settings-section user-management-section",children:[u.jsx("header",{className:"settings-section-header",children:u.jsxs("div",{children:[u.jsx("h3",{children:"Users"}),u.jsx("p",{children:"Manage sign-in access and Seele roles."})]})}),u.jsx("div",{className:"memory-items-editor-header actions-only",children:u.jsx("button",{"aria-label":"Add user",className:"memory-icon-button",onClick:q,title:"Add user",type:"button",children:"+"})}),u.jsxs("div",{className:"user-list",children:[t.map(U=>u.jsxs("div",{className:"user-list-item",children:[u.jsxs("div",{className:"user-list-main",children:[u.jsxs("div",{children:[u.jsx("strong",{children:U.username}),U.id===e.id?u.jsx("span",{className:"user-current-badge",children:"Current"}):null]}),u.jsxs("small",{children:["Created ",ct(U.createdAt)]})]}),u.jsx("span",{className:`user-role-badge role-${U.role}`,children:U.role}),u.jsx("span",{className:`user-status ${U.active?"active":"disabled"}`,children:U.active?"Active":"Disabled"}),u.jsxs("div",{className:"user-row-actions",children:[u.jsx("button",{"aria-label":`Edit user ${U.username}`,className:"memory-icon-button",onClick:()=>z(U),title:"Edit",type:"button",children:u.jsx(Rf,{})}),u.jsx("button",{"aria-label":`Delete user ${U.username}`,className:"memory-icon-button memory-item-delete",disabled:U.id===e.id,onClick:()=>{A(""),b(U)},title:"Delete",type:"button",children:"×"})]})]},U.id)),t.length===0?u.jsx("p",{className:"settings-note",children:"No users are configured."}):null]}),c?u.jsx("div",{className:"memory-editor-overlay",onClick:M,role:"presentation",children:u.jsxs("form",{"aria-label":c==="new"?"Add user":"Edit user",className:"memory-editor-popover user-editor-popover",onClick:U=>U.stopPropagation(),onSubmit:U=>void B(U),children:[u.jsxs("header",{children:[u.jsx("strong",{children:c==="new"?"Add User":"Edit User"}),u.jsx("button",{"aria-label":"Close user editor",className:"memory-icon-button",onClick:M,title:"Close",type:"button",children:"×"})]}),u.jsxs("label",{children:[u.jsx("span",{children:"Username"}),u.jsx("input",{autoComplete:"off",autoFocus:!0,onChange:U=>m(ae=>({...ae,username:U.target.value})),placeholder:"Sign-in username",value:h.username})]}),u.jsxs("label",{children:[u.jsx("span",{children:c==="new"?"Initial password":"New password"}),u.jsx("input",{autoComplete:"new-password",minLength:8,onChange:U=>m(ae=>({...ae,password:U.target.value})),placeholder:c==="new"?"At least 8 characters":"Leave blank to keep the current password",type:"password",value:h.password})]}),u.jsxs("label",{children:[u.jsx("span",{children:"Role"}),u.jsxs("select",{disabled:c!=="new"&&c.id===e.id,onChange:U=>m(ae=>({...ae,role:U.target.value==="admin"?"admin":"user"})),value:h.role,children:[u.jsx("option",{value:"user",children:"User"}),u.jsx("option",{value:"admin",children:"Admin"})]})]}),c!=="new"?u.jsxs("label",{className:"user-editor-active",children:[u.jsx("input",{checked:h.active,disabled:c.id===e.id,onChange:U=>m(ae=>({...ae,active:U.target.checked})),type:"checkbox"}),u.jsx("span",{children:"Account active"})]}):null,T?u.jsx("p",{className:"memory-editor-error",children:T}):null,u.jsxs("div",{className:"memory-editor-actions",children:[u.jsx("button",{className:"memory-dialog-button",onClick:M,type:"button",children:"Cancel"}),u.jsx("button",{className:"memory-dialog-button primary",disabled:g||!h.username.trim()||c==="new"&&h.password.length<8||c!=="new"&&h.password.length>0&&h.password.length<8,type:"submit",children:g?"Saving...":"Save"})]})]})}):null,k?u.jsx("div",{className:"memory-editor-overlay",onClick:()=>b(null),role:"presentation",children:u.jsxs("section",{"aria-label":"Delete user",className:"memory-delete-dialog",onClick:U=>U.stopPropagation(),children:[u.jsxs("header",{children:[u.jsx("strong",{children:"Delete User"}),u.jsx("button",{"aria-label":"Close delete user confirmation",className:"memory-icon-button",onClick:()=>b(null),title:"Close",type:"button",children:"×"})]}),u.jsxs("p",{children:["Delete ",u.jsx("strong",{children:k.username}),". Users that own workspaces must be disabled instead."]}),T?u.jsx("p",{className:"memory-editor-error",children:T}):null,u.jsxs("div",{className:"memory-delete-actions",children:[u.jsx("button",{className:"memory-dialog-button",onClick:()=>b(null),type:"button",children:"Cancel"}),u.jsx("button",{className:"memory-dialog-button danger",onClick:()=>{a(k.id).then(()=>b(null)).catch(U=>A(pt(U).message))},type:"button",children:"Delete"})]})]})}):null]})}function gN({settings:e,onSave:t}){const[n,a]=D.useState(e),[l,o]=D.useState(!1);return D.useEffect(()=>a(e),[e]),u.jsxs(u.Fragment,{children:[u.jsx("header",{className:"settings-section-header",children:u.jsxs("div",{children:[u.jsx("h3",{children:"Deployment"}),u.jsx("p",{children:"Settings stored only on this Seele instance. Cloud synchronization does not copy or overwrite them."})]})}),u.jsxs("form",{className:"settings-form",onSubmit:c=>{c.preventDefault(),o(!0),t(n).finally(()=>o(!1))},children:[u.jsxs("label",{className:"settings-field settings-field-wide",children:[u.jsxs("span",{children:[u.jsx("strong",{children:"Public URL"}),u.jsx("small",{children:"The externally reachable main URL of this deployment. Seele uses it when publishing callback links to external systems."})]}),u.jsx("input",{"aria-label":"Public URL of this deployment",onChange:c=>a({...n,publicUrl:c.target.value||null}),placeholder:"https://profuse.antgroup-inc.cn/codex/yishao-0/",type:"url",value:n.publicUrl||""})]}),u.jsxs("label",{className:"settings-toggle-field",children:[u.jsxs("span",{children:[u.jsx("strong",{children:"Profuse notification"}),u.jsx("small",{children:"Send DingTalk notifications from this deployment when a turn finishes or fails. Keep this off where the Profuse endpoint is unreachable."})]}),u.jsx("input",{"aria-label":"Enable Profuse notification on this deployment",checked:n.profuseNotificationEnabled,onChange:c=>a({...n,profuseNotificationEnabled:c.target.checked}),type:"checkbox"})]}),u.jsx("div",{className:"settings-form-actions",children:u.jsx("button",{disabled:l,type:"submit",children:l?"Saving...":"Save deployment settings"})})]})]})}function yN({codexReleasedAt:e,codexVersion:t,codexUpdating:n,draft:a,globalSettings:l,models:o,scope:c,settings:f,workspaceOverrideCount:h,workspaceSettings:m,onDraftChange:g,onResetWorkspaceSetting:v,onSubmit:k,onUpdateCodexCli:b}){var ce,Ie,be,pe,J;const T=c==="workspace",A=a.modelSource??{type:"codex"},q=A.type==="codex",z=((ce=l.modelSource)==null?void 0:ce.type)==="custom"?l.modelSource.channelId:null,M=((Ie=f.modelSource)==null?void 0:Ie.type)==="custom"?f.modelSource.channelId:null,[B,U]=D.useState(null),[ae,L]=D.useState(!1);D.useEffect(()=>{let Y=!1;return sz().then(ge=>{Y||U(ge)}).catch(()=>{Y||L(!0)}),()=>{Y=!0}},[]);const K=Xd(a.model,o),ie=Xd(l.model,o),Q=Xd(f.model,o),F=nE(a.reasoningEffort,K),he=tE(K,a.reasoningEffort);return u.jsxs(u.Fragment,{children:[u.jsxs("header",{className:"settings-section-header",children:[u.jsxs("div",{children:[u.jsx("h3",{children:"Runtime"}),u.jsx("p",{children:"Configure global defaults or override them for the selected workspace. Running turns keep the settings they started with."})]}),T?u.jsx("span",{className:h>0?"section-override-count active":"section-override-count",children:h>0?`${h} custom`:"No custom runtime"}):null]}),u.jsxs("form",{className:"settings-form runtime-form",onSubmit:k,children:[u.jsxs("div",{className:"settings-wide-field",children:[u.jsx(Ac,{label:"Model source",settingKey:"modelSource",isWorkspaceScope:T,globalValue:z?`Custom · ${((be=B==null?void 0:B.channels.find(Y=>Y.id===z))==null?void 0:be.name)??"Unavailable channel"}`:"Codex official",source:K6(a.modelSource,l.modelSource)?m==null?void 0:m.sources.modelSource:"workspace",onReset:v}),u.jsx(Od,{"aria-label":"Runtime model source",value:A.type,options:[{value:"codex",label:"Codex official"},{value:"custom",label:"Custom"}],onChange:Y=>{var ge;return g({...a,modelSource:Y==="custom"?{type:"custom",channelId:((ge=B==null?void 0:B.channels[0])==null?void 0:ge.id)??""}:{type:"codex"}})}}),q?null:u.jsxs(u.Fragment,{children:[u.jsxs("label",{className:"settings-field",children:[u.jsx("span",{children:"Custom channel"}),u.jsxs("select",{"aria-label":"Runtime custom channel",required:!0,value:A.channelId,onChange:Y=>g({...a,modelSource:{type:"custom",channelId:Y.target.value}}),children:[u.jsx("option",{value:"",disabled:!0,children:"Select a configured channel"}),A.channelId&&!(B!=null&&B.channels.some(Y=>Y.id===A.channelId))?u.jsx("option",{value:A.channelId,children:"Unavailable channel"}):null,B==null?void 0:B.channels.map(Y=>u.jsxs("option",{value:Y.id,children:[Y.name," · ",Y.model]},Y.id))]})]}),ae?u.jsx("p",{role:"alert",children:"Unable to load custom channels. Reopen Runtime to retry."}):(B==null?void 0:B.channels.length)===0?u.jsx("p",{children:"Add a channel in Custom model channels first."}):null,u.jsx("small",{children:"The channel fixes the model and connection. Codex reasoning effort and Fast mode do not apply."})]})]}),q?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:Id(T,Dl(a.model,l.model,m==null?void 0:m.sources.model)),children:[u.jsx(Ac,{globalValue:A5(l.model,o),isWorkspaceScope:T,label:"Model",settingKey:"model",source:Dl(a.model,l.model,m==null?void 0:m.sources.model),onReset:v}),u.jsx(Od,{"aria-label":"Runtime model",onChange:Y=>{g({...a,model:Y})},options:AD(o,a.model),value:a.model||((pe=o.find(Y=>Y.isDefault))==null?void 0:pe.model)||""})]}),u.jsxs("div",{className:Id(T,Dl(a.reasoningEffort,l.reasoningEffort,m==null?void 0:m.sources.reasoningEffort)),children:[u.jsx(Ac,{globalValue:B3(l.reasoningEffort,ie),isWorkspaceScope:T,label:"Reasoning effort",settingKey:"reasoningEffort",source:Dl(a.reasoningEffort,l.reasoningEffort,m==null?void 0:m.sources.reasoningEffort),onReset:v}),u.jsx(Od,{"aria-label":"Runtime reasoning effort",onChange:Y=>g({...a,reasoningEffort:Y}),options:he,value:a.reasoningEffort}),F?u.jsx("p",{role:"status",children:F}):null]})]}):null,u.jsxs("div",{className:Id(T,Dl(a.sandbox,l.sandbox,m==null?void 0:m.sources.sandbox)),children:[u.jsx(Ac,{globalValue:yp(l.sandbox),isWorkspaceScope:T,label:"Permission mode",settingKey:"sandbox",source:Dl(a.sandbox,l.sandbox,m==null?void 0:m.sources.sandbox),onReset:v}),u.jsx(Od,{"aria-label":"Permission mode",onChange:Y=>g({...a,sandbox:Y}),options:RE,value:a.sandbox})]}),q?u.jsxs("div",{className:Id(T,Dl(a.fastMode,l.fastMode,m==null?void 0:m.sources.fastMode),"settings-toggle-field"),children:[u.jsxs("span",{children:[u.jsx(Ac,{globalValue:l.fastMode?"On":"Off",isWorkspaceScope:T,label:"Fast mode",settingKey:"fastMode",source:Dl(a.fastMode,l.fastMode,m==null?void 0:m.sources.fastMode),onReset:v}),u.jsx("small",{children:"1.5x speed with higher Codex credit consumption"})]}),u.jsx("input",{"aria-label":"Enable Fast mode",checked:a.fastMode,onChange:Y=>g({...a,fastMode:Y.target.checked}),type:"checkbox"})]}):null,u.jsxs("dl",{className:"runtime-summary",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Current"}),u.jsx("dd",{children:M?u.jsxs(u.Fragment,{children:["Custom · ",((J=B==null?void 0:B.channels.find(Y=>Y.id===M))==null?void 0:J.name)??"Unavailable channel"," · ",yp(f.sandbox),"."]}):u.jsxs(u.Fragment,{children:["Model ",A5(f.model,o),", reasoning"," ",B3(f.reasoningEffort,Q),", Fast mode"," ",f.fastMode?"on":"off",", permission"," ",yp(f.sandbox),"."]})})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Codex CLI"}),u.jsxs("dd",{className:"runtime-version-value",children:[u.jsx("span",{children:l1(t,e)}),u.jsx("button",{className:"runtime-update-button",disabled:n,onClick:b,type:"button",children:n?"Updating...":"Check update"})]})]})]}),u.jsx("div",{className:"settings-form-actions",children:u.jsx("button",{type:"submit",children:T?"Save workspace overrides":"Save global runtime"})})]})]})}function Ac({globalValue:e,isWorkspaceScope:t,label:n,settingKey:a,source:l,onReset:o}){const c=t&&l==="workspace";return u.jsxs("span",{className:"runtime-field-label",children:[u.jsx("span",{children:n}),t?u.jsxs("span",{className:"runtime-field-meta",children:[u.jsx("span",{className:c?"override":"inherited",children:c?"Workspace override":`Inherited: ${e}`}),c?u.jsx("button",{type:"button",onClick:()=>o(a),children:"Reset"}):null]}):null]})}function Od({"aria-label":e,onChange:t,options:n,value:a}){const[l,o]=D.useState(!1),c=D.useRef(null),f=n.find(h=>h.value===a)??n[0]??null;return D.useEffect(()=>{if(!l)return;function h(g){var v;(v=c.current)!=null&&v.contains(g.target)||o(!1)}function m(g){g.key==="Escape"&&o(!1)}return document.addEventListener("pointerdown",h,!0),document.addEventListener("keydown",m,!0),()=>{document.removeEventListener("pointerdown",h,!0),document.removeEventListener("keydown",m,!0)}},[l]),u.jsxs("div",{className:"runtime-select",ref:c,children:[u.jsxs("button",{"aria-expanded":l,"aria-label":e,className:"runtime-select-trigger",onClick:()=>o(h=>!h),type:"button",children:[u.jsx("span",{children:(f==null?void 0:f.label)??a}),u.jsx("span",{"aria-hidden":"true",children:"⌄"})]}),l?u.jsx("div",{className:"runtime-select-menu",role:"listbox",children:n.map(h=>u.jsx("button",{"aria-selected":h.value===a,className:h.value===a?"selected":void 0,onClick:()=>{t(h.value),o(!1)},role:"option",type:"button",children:h.label},h.value||"default"))}):null]})}function Dl(e,t,n){return JSON.stringify(e)!==JSON.stringify(t)?"workspace":n}function Id(e,t,n="settings-wide-field"){return[n,e?"workspace-scoped":"",e&&t==="workspace"?"workspace-overridden":""].filter(Boolean).join(" ")}function vN({baseSettings:e,scope:t,workspaceSettings:n,workspaceName:a,onSaveBaseItems:l,onSaveWorkspaceItems:o}){const c=t==="workspace",f=c?n.items:e.items,h=c?o:l;return u.jsxs(u.Fragment,{children:[u.jsx("header",{className:"settings-section-header",children:u.jsxs("div",{children:[u.jsx("h3",{children:c?"Workspace Memory":"Base Memory"}),u.jsx("p",{children:c?"Workspace memory applies only to the selected workspace. Use stable English keys; values may be Chinese, plain text, or Markdown.":"Base memory applies to every workspace. Use stable English keys; values may be Chinese, plain text, or Markdown."})]})}),c?u.jsxs("section",{className:"settings-readonly-block",children:[u.jsxs("div",{children:[u.jsx("strong",{children:"Base Memory"}),u.jsx("span",{children:"Read-only in workspace scope"})]}),u.jsx(bN,{emptyText:"No base memory is configured.",items:e.items,readonly:!0})]}):null,u.jsx("div",{className:"memory-manager-shell",children:u.jsx(xN,{ariaLabel:c?"Workspace memory":"Base memory",emptyText:"No memory items are configured.",items:f,onSaveItems:h,title:""})})]})}function xN({ariaLabel:e,emptyText:t,items:n,onSaveItems:a,title:l}){var K;const[o,c]=D.useState(Hc(n)),[f,h]=D.useState(null),[m,g]=D.useState({key:"",value:""}),[v,k]=D.useState(null),[b,T]=D.useState(null),[A,q]=D.useState(null);D.useEffect(()=>{c(Hc(n))},[n]),D.useEffect(()=>{if(f===null)return;const ie=Q=>{Q.key==="Escape"&&(U(),T(null))};return document.addEventListener("keydown",ie),()=>document.removeEventListener("keydown",ie)},[f]);async function z(ie,Q){q(Q);try{const F=await a(ie);return c(Hc(F)),F}finally{q(null)}}function M(){T(null),k(null),g({key:"",value:""}),h("new")}function B(ie){const Q=o[ie];Q&&(T(null),k(null),g({...Q}),h(ie))}function U(){h(null),k(null),g({key:"",value:""})}async function ae(ie){const Q=o[ie],F=(Q==null?void 0:Q.key)||`${ie}`;await z(o.filter((he,ce)=>ce!==ie),`delete:${F}`),T(null)}async function L(ie){ie.preventDefault(),ie.stopPropagation();const Q=m.key.trim(),F=Lz(Q);if(F){k(F);return}const he=m.value.trim();if(!he){k("Value is required.");return}const ce=f==="new"?-1:f;if(o.some((be,pe)=>pe!==ce&&be.key.trim()===Q)){k(`Key "${Q}" already exists. Each memory key must be unique.`);return}const Ie={...m,key:Q,value:he};f==="new"?await z([...o,Ie],"add"):typeof f=="number"&&await z(o.map((be,pe)=>pe===f?Ie:be),`save:${f}`),U()}return u.jsxs("section",{className:"memory-items-manager","aria-label":e,children:[u.jsxs("div",{className:l?"memory-items-editor-header":"memory-items-editor-header actions-only",children:[l?u.jsx("span",{children:l}):null,u.jsx("button",{"aria-label":"Add memory item",className:"memory-icon-button",title:"Add",type:"button",onClick:M,children:"+"})]}),o.length?u.jsx("div",{className:"memory-items-grid",children:o.map((ie,Q)=>u.jsxs("div",{className:"memory-item-display",children:[u.jsxs("pre",{"aria-label":`Memory item ${ie.key}`,children:[u.jsx("span",{className:"memory-tag",children:`<${ie.key}>`}),`
|
|
365
|
+
`),z=`[System Log] ${b.summary}`.slice(0,180),M=new URL("https://github.com/seele-labs/seele-work/issues/new");M.searchParams.set("title",z),M.searchParams.set("body",q),window.open(M.toString(),"_blank","noopener,noreferrer")};return u.jsxs("section",{className:"system-information-section",children:[u.jsxs("header",{className:"settings-section-header",children:[u.jsxs("div",{children:[u.jsx("h3",{children:"System"}),u.jsx("p",{children:"Read-only runtime and resource information managed by Seele."})]}),u.jsx("button",{className:"system-information-refresh",disabled:n,onClick:a,type:"button",children:n?"Refreshing...":"Refresh"})]}),l?u.jsxs(u.Fragment,{children:[u.jsxs("dl",{className:"system-information-summary",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"LRU pool target"}),u.jsxs("dd",{children:[jr(l.maxRetainedRuntimes)," runtimes"]}),u.jsx("small",{children:l.capacitySource==="system_memory"?"Idle runtimes are released by least recent use":"Fallback target because system memory was unavailable"})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Retention policy"}),u.jsxs("dd",{children:["LRU · ",gp(l.maxIdleSeconds*1e3)," max idle"]}),u.jsx("small",{children:"Only idle runtimes are eligible for eviction"})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Current pool"}),u.jsxs("dd",{children:[l.activeRuntimeCount," active · ",l.idleRuntimeCount," idle"]}),u.jsxs("small",{children:[l.retainedRuntimeCount," retained runtimes"]})]})]}),u.jsxs("section",{className:"system-runtime-list",children:[u.jsxs("header",{children:[u.jsxs("div",{children:[u.jsx("h4",{children:"Workspace runtimes"}),u.jsx("p",{children:"Active workspaces and idle runtimes currently retained for reuse."})]}),u.jsx("time",{dateTime:t==null?void 0:t.generatedAt,children:t?ct(t.generatedAt):""})]}),l.workspaces.length>0?u.jsxs("div",{className:"system-runtime-table",children:[u.jsxs("div",{className:"system-runtime-table-header",children:[u.jsx("span",{children:"Workspace"}),u.jsx("span",{children:"Status"}),u.jsx("span",{children:"Runtime"}),u.jsx("span",{children:"Age"})]}),l.workspaces.map(b=>u.jsxs("div",{className:"system-runtime-row",children:[u.jsxs("div",{children:[u.jsx("strong",{children:h.get(b.workspaceId)??b.workspaceId}),u.jsx("small",{children:b.workspaceId})]}),u.jsx("span",{className:`system-runtime-state ${b.turnId?"active":"idle"}`,children:b.lifecycle==="shutting_down"?"Shutting down":b.turnId?"Active":"Idle"}),u.jsxs("div",{children:[u.jsx("span",{children:b.turnId?b.state:"Retained"}),u.jsx("small",{children:b.pid===null?"PID unavailable":`PID ${b.pid}`})]}),u.jsx("span",{children:b.idleMs===null?gp(b.uptimeMs):`${gp(b.idleMs)} idle`})]},b.workspaceId))]}):u.jsx("div",{className:"system-runtime-empty",children:"No workspace runtimes are currently retained."})]}),u.jsxs("section",{className:"system-runtime-list system-log-list",children:[u.jsxs("header",{children:[u.jsxs("div",{children:[u.jsx("h4",{children:"System log"}),u.jsx("p",{children:"Recent persistent warnings and errors for external diagnostics."})]}),u.jsxs("div",{className:"system-log-actions",children:[u.jsx("button",{"aria-label":"Copy system log report",className:"icon-button",disabled:!o.length,onClick:()=>void g(),title:"Copy system log report",type:"button",children:u.jsx(Q1,{})}),u.jsx("button",{"aria-label":"Download system log report",className:"icon-button",disabled:!o.length,onClick:v,title:"Download system log report",type:"button",children:u.jsx(oN,{})}),u.jsx("button",{"aria-label":"Report system log issue",className:"icon-button",disabled:!o.length,onClick:k,title:"Report issue to seele-labs/seele-work",type:"button",children:u.jsx(uN,{})}),c?u.jsx("small",{children:"Copied"}):null]})]}),o.length?u.jsx("div",{className:"system-log-entries",children:o.map(b=>u.jsxs("details",{className:`system-log-entry ${b.level}`,children:[u.jsxs("summary",{children:[u.jsx("span",{className:"system-log-level",children:b.level}),u.jsxs("span",{children:[u.jsx("strong",{children:b.summary}),u.jsxs("small",{children:[b.component," · ",$c(b.createdAt)]})]})]}),u.jsxs("dl",{children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Event"}),u.jsx("dd",{children:b.event})]}),b.workspaceId?u.jsxs("div",{children:[u.jsx("dt",{children:"Workspace"}),u.jsxs("dd",{children:[h.get(b.workspaceId)??b.workspaceId," · ",b.workspaceId]})]}):null,b.turnId?u.jsxs("div",{children:[u.jsx("dt",{children:"Turn"}),u.jsx("dd",{children:b.turnId})]}):null,b.runtimeId?u.jsxs("div",{children:[u.jsx("dt",{children:"Runtime"}),u.jsx("dd",{children:b.runtimeId})]}):null]}),u.jsx("pre",{children:JSON.stringify(b.detail,null,2)})]},b.id))}):u.jsx("div",{className:"system-runtime-empty",children:"No warnings or errors have been recorded."})]})]}):u.jsx("div",{className:"system-runtime-empty",children:n?"Loading system information...":"System information is unavailable."})]})}function oN(){return u.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",children:u.jsx("path",{d:"M12 3v12m0 0 4-4m-4 4-4-4M5 20h14"})})}function uN(){return u.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",children:[u.jsx("circle",{cx:"12",cy:"12",r:"9"}),u.jsx("path",{d:"M12 7v6m0 4h.01"})]})}function cN({draft:e,saving:t,scope:n,workspace:a,onDraftChange:l,onSubmit:o}){const c=n==="workspace";return u.jsxs(u.Fragment,{children:[u.jsx("header",{className:"settings-section-header",children:u.jsxs("div",{children:[u.jsx("h3",{children:"Responsibility"}),u.jsx("p",{children:"Workspace-specific long-lived role. This is content context, so it is only editable in workspace scope."})]})}),c&&a?u.jsxs("form",{className:"settings-responsibility-form",onSubmit:o,children:[u.jsxs("label",{children:[u.jsx("span",{children:a.title}),u.jsx("textarea",{"aria-label":"Workspace responsibility",onChange:f=>l(f.target.value),placeholder:"Describe this workspace's durable role, scope, and long-term responsibilities.",rows:14,value:e})]}),u.jsx("div",{className:"settings-form-actions",children:u.jsx("button",{disabled:t,type:"submit",children:t?"Saving...":"Save responsibility"})})]}):u.jsx("section",{className:"settings-readonly-block",children:u.jsxs("div",{children:[u.jsx("strong",{children:"Workspace-only setting"}),u.jsx("span",{children:"Switch the header scope to Workspace and choose a workspace to edit its responsibility."})]})})]})}function dN({usage:e}){return u.jsx("div",{"aria-label":"Codex account usage",className:"codex-account-usage",children:[...e.windows].sort((t,n)=>t.windowDurationMins-n.windowDurationMins).map(t=>{const n=Of(t.usedPercent),a=gx(t.windowDurationMins);return u.jsxs("div",{className:"codex-account-usage-window",children:[u.jsx("div",{className:"codex-account-usage-heading",children:u.jsxs("span",{children:[a," used ",u.jsxs("small",{children:["(Resets ",Zx(t.resetsAt),")"]})]})}),u.jsxs("div",{className:"codex-account-usage-meter",children:[u.jsx("span",{"aria-hidden":"true",className:"codex-account-usage-track",children:u.jsx("span",{style:{width:`${n}%`}})}),u.jsx("strong",{children:Xx(n)})]})]},`${t.windowDurationMins}:${t.resetsAt}`)})})}function fN(e){if(!e)return null;const t=e.toLowerCase();return t==="chatgpt"?"ChatGPT":t==="apikey"||t==="api_key"?"API key":e}function hN(e){return e?e.split(/[_-]/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" "):null}function mN({onSwitched:e}){var tt;const[t,n]=D.useState(null),[a,l]=D.useState(!0),[o,c]=D.useState(!1),[f,h]=D.useState(!1),[m,g]=D.useState(""),[v,k]=D.useState(!1),[b,T]=D.useState(""),[A,q]=D.useState(null),[z,M]=D.useState(null),[B,U]=D.useState(""),[ne,L]=D.useState(()=>new Date);D.useEffect(()=>{const fe=window.setInterval(()=>L(new Date),3e4);return()=>window.clearInterval(fe)},[]);const[K,ie]=D.useState(""),[Q,F]=D.useState(null),[he,ce]=D.useState(""),[Ie,be]=D.useState(null),[pe,J]=D.useState(!1),[Y,ge]=D.useState(""),[Te,H]=D.useState(null),_=D.useRef(new Map);async function te(fe,qe){if(f||o||!window.confirm(`Use one reset credit for ${fe.name}? This consumes the credit if an eligible rate-limit window is reset.`))return;const Je=JSON.stringify([fe.id,qe.id]),Xe=_.current.get(Je)??crypto.randomUUID();_.current.set(Je,Xe),h(!0),g(""),ge("");try{const Lt=ze(`settings/runtime/accounts/${encodeURIComponent(fe.id)}/reset-credits/consume`),Tt=await fetch(Lt,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({creditId:qe.id,idempotencyKey:Xe})});await Fe(Tt,{method:"POST",url:Lt});const mt=await Tt.json(),pn={reset:"Reset credit used. Eligible rate limits have been reset.",alreadyRedeemed:"This reset was already completed.",nothingToReset:"No rate-limit window needs a reset. No credit was used.",noCredit:"No reset credit is available for this account."}[mt.outcome];if(!pn)throw new Error("Reset outcome is unknown. Refresh details before trying again.");(mt.outcome==="nothingToReset"||mt.outcome==="noCredit")&&_.current.delete(Je),ge(`${fe.name}: ${pn}`),n(en=>{if(!en)return en;const ht={...en.accountDetails};return delete ht[fe.id],{...en,accountDetails:ht}});try{const en=await pp(!0);n(ht=>ap(ht,en))}catch{g("The result above is confirmed, but refreshing details failed. Please refresh details.")}}catch(Lt){g(`${pt(Lt).message} The outcome may be unknown; retrying this credit on this page reuses the same request ID.`)}finally{h(!1)}}async function O(){var qe;const fe=await x5();n(fe),((qe=fe.login)==null?void 0:qe.status)==="pending"&&(q(fe.login),k(!0))}async function ee(fe){c(!0),g("");try{const qe=await pp(fe);n(Je=>ap(Je,qe))}catch(qe){g(pt(qe).message)}finally{c(!1)}}D.useEffect(()=>{let fe=!1;return x5().then(qe=>{var Je;fe||(n(qe),((Je=qe.login)==null?void 0:Je.status)==="pending"&&(q(qe.login),k(!0)),qe.accounts.length>0&&(c(!0),pp(!1).then(Xe=>{fe||n(Lt=>ap(Lt,Xe))}).catch(Xe=>{fe||g(pt(Xe).message)}).finally(()=>{fe||c(!1)})))}).catch(qe=>{fe||g(pt(qe).message)}).finally(()=>{fe||l(!1)}),()=>{fe=!0}},[]),D.useEffect(()=>{if(!A||A.status!=="pending")return;let fe=!1;const qe=window.setInterval(()=>{pz(A.id).then(async Je=>{fe||(q(Je),Je.status!=="pending"&&(window.clearInterval(qe),Je.status==="succeeded"&&n(Xe=>{if(!Xe||!Je.account)return Xe;const Lt=Xe.accounts.some(Tt=>{var mt;return Tt.id===((mt=Je.account)==null?void 0:mt.id)})?Xe.accounts.map(Tt=>{var mt;return Tt.id===((mt=Je.account)==null?void 0:mt.id)?Je.account:Tt}):[...Xe.accounts,Je.account];return{...Xe,accounts:Lt}})))}).catch(Je=>{fe||g(pt(Je).message)})},1e3);return()=>{fe=!0,window.clearInterval(qe)}},[A==null?void 0:A.id,A==null?void 0:A.status]);function Ae(){T(""),q(null),g(""),J(!1),k(!0)}async function re(fe){fe.preventDefault(),h(!0),g("");try{q(await mz(b.trim()))}catch(qe){g(pt(qe).message)}finally{h(!1)}}async function we(){if(!A||A.status!=="pending"){k(!1);return}h(!0),g("");try{const fe=await gz(A.id);q(fe),k(!1)}catch(fe){g(pt(fe).message)}finally{h(!1)}}function _e(fe){M(fe),U(fe.renewalDay==null?"":String(fe.renewalDay)),ie(fe.name),g("")}async function He(fe){if(fe.preventDefault(),!z)return;const qe=K.trim();if(!qe){M(null);return}h(!0),g("");try{await yz(z.id,qe,B===""?null:Number(B)),await O(),M(null)}catch(Je){g(pt(Je).message)}finally{h(!1)}}async function wt(){if(Q){h(!0),g("");try{const fe=await xz(Q.id);n(fe),F(null),ce("Account selection saved. Each deployment applies it to new requests after syncing; active turns are unchanged."),e().catch(()=>{ce("Account selection saved. Refreshing local status failed; deployment synchronization will continue in the background.")})}catch(fe){const qe=pt(fe);g(qe.detail??qe.message)}finally{h(!1)}}}async function et(){if(Ie){h(!0),g("");try{await vz(Ie.id),await O(),be(null)}catch(fe){g(pt(fe).detail??pt(fe).message)}finally{h(!1)}}}const $t=(t==null?void 0:t.accounts)??[];return u.jsxs("section",{className:"settings-section codex-accounts-section",children:[u.jsxs("header",{className:"settings-section-header",children:[u.jsxs("div",{children:[u.jsx("h3",{children:"Codex Accounts"}),u.jsx("p",{children:"Manage the cloud-owned Codex logins. Every deployment uses the same globally active account; workspaces do not bind to accounts."})]}),u.jsxs("div",{className:"codex-account-toolbar",children:[u.jsx("button",{className:"codex-account-add",disabled:f||o||$t.length===0,onClick:()=>void ee(!0),type:"button",children:o?"Refreshing...":"Refresh details"}),u.jsx("button",{className:"codex-account-add",disabled:f||o||(A==null?void 0:A.status)==="pending",onClick:Ae,type:"button",children:"Add account"})]})]}),u.jsxs("div",{className:"codex-account-policy",children:[u.jsx("strong",{children:"Cloud-wide account selection"}),u.jsx("span",{children:"Active turns keep their original account. Each deployment uses the selected account for new requests after syncing, without pausing existing work. There is no per-deployment selection."})]}),he?u.jsx("p",{className:"settings-note",role:"status",children:he}):null,m?u.jsx("p",{className:"memory-editor-error",children:m}):null,a?u.jsx("p",{className:"settings-note",children:"Loading Codex accounts..."}):null,!a&&$t.length===0?u.jsx("p",{className:"settings-note",children:"No persisted Codex account. Add one with the official device login flow."}):null,u.jsx("div",{className:"codex-account-list",children:$t.map(fe=>{var pn,en;const qe=(t==null?void 0:t.activeAccountId)===fe.id,Je=DA(fe.renewalDay,ne),Xe=(pn=t==null?void 0:t.accountDetails)==null?void 0:pn[fe.id],Lt=((en=t==null?void 0:t.accountIssues)==null?void 0:en[fe.id])??[],Tt=Lt.length>0,mt=Lt.some(ht=>["missing_credential","invalid_credential","credential_unreadable"].includes(ht.code)),At=[fe.email,fN(fe.accountType),hN(fe.planType)].filter(ht=>!!ht);return u.jsxs("article",{className:`codex-account-card${qe?" active":""}${Tt?" issue":""}`,children:[u.jsxs("div",{className:"codex-account-main",children:[u.jsxs("div",{className:"codex-account-title",children:[u.jsx("strong",{children:fe.name}),qe?u.jsx("span",{className:"codex-account-active",children:"Selected"}):null,Tt?u.jsx("span",{className:"codex-account-warning",children:"Needs attention"}):null]}),u.jsxs("small",{children:[At.join(" · ")||`Added ${ct(fe.createdAt)}`,Je?u.jsxs("span",{title:`按手动设置的每月 ${fe.renewalDay} 日计算(北京时间),下次 ${Je.date}`,children:[" · ",Je.days===0?"今日续费":`距续费 ${Je.days} 天`]}):null]}),Tt?u.jsx("div",{className:"codex-account-issues",role:"status",children:Lt.map(ht=>u.jsx("span",{children:ht.message},ht.code))}):null,Xe!=null&&Xe.usage?u.jsx(dN,{usage:Xe.usage}):u.jsx("span",{className:"codex-account-usage-empty",children:o?"Reading account usage...":"Usage unavailable"}),Xe?u.jsx("small",{className:Xe.error?"codex-account-detail-error":"codex-account-refreshed",children:Xe.error?`Refresh issue: ${Xe.error}`:`Updated ${ct(Xe.refreshedAt)}`}):null]}),u.jsxs("div",{className:"codex-account-actions",children:[u.jsxs("button",{className:"codex-credit-count",type:"button",disabled:f,"aria-label":`${fe.name}(${Xe!=null&&Xe.error||!(Xe!=null&&Xe.rateLimitResetCredits)?"券数量未知":`${Xe.rateLimitResetCredits.availableCount} 张可用券`})`,title:`${fe.name}(${Xe!=null&&Xe.error||!(Xe!=null&&Xe.rateLimitResetCredits)?"券数量未知":`${Xe.rateLimitResetCredits.availableCount} 张可用券`})`,onClick:()=>{H(fe.id),ge(""),g("")},children:[u.jsxs("svg",{"aria-hidden":"true",width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",children:[u.jsx("path",{d:"M3 5h18v5a2 2 0 0 0 0 4v5H3v-5a2 2 0 0 0 0-4V5Z"}),u.jsx("path",{d:"M16 5v3m0 3v2m0 3v3"})]}),u.jsx("span",{children:Xe!=null&&Xe.error||!(Xe!=null&&Xe.rateLimitResetCredits)?"—":Xe.rateLimitResetCredits.availableCount})]}),u.jsx("button",{disabled:f||o||mt,onClick:()=>_e(fe),title:mt?"Sign in again or delete this account to replace its credential.":void 0,type:"button",children:Tt?"Repair & edit":"Edit"}),u.jsx("button",{disabled:f||qe||Tt,onClick:()=>{g(""),F(fe)},type:"button",children:Tt?"Unavailable":"Switch"}),u.jsx("button",{className:"danger",disabled:f||o||qe,onClick:()=>{g(""),be(fe)},type:"button",children:"Delete"})]})]},fe.id)})}),Te&&$t.some(fe=>fe.id===Te)?u.jsxs("dialog",{className:"memory-editor-popover codex-credit-dialog","aria-label":"Rate-limit reset credits",ref:fe=>{fe&&!fe.open&&fe.showModal()},onCancel:fe=>{fe.preventDefault(),f||H(null)},children:[u.jsxs("header",{children:[u.jsx("strong",{children:"Rate-limit reset credits"}),u.jsx("button",{autoFocus:!0,className:"memory-icon-button",type:"button","aria-label":"Close reset credits",disabled:f,onClick:()=>H(null),children:"×"})]}),Y?u.jsx("p",{className:"settings-note",role:"status",children:Y}):null,m?u.jsx("p",{className:"memory-editor-error",role:"alert",children:m}):null,$t.filter(fe=>fe.id===Te).map(fe=>{var Xe,Lt,Tt,mt;const qe=(Xe=t==null?void 0:t.accountDetails)==null?void 0:Xe[fe.id],Je=qe==null?void 0:qe.rateLimitResetCredits;return u.jsxs("article",{className:"codex-credit-group",children:[u.jsxs("div",{className:"codex-credit-group-heading",children:[u.jsx("strong",{children:fe.name}),u.jsx("span",{children:qe!=null&&qe.error?"Unavailable":Je?`${Je.availableCount} available`:o?"Loading...":"Unavailable"})]}),Je?Je.availableCount===0&&!((Lt=Je.credits)!=null&&Lt.length)?u.jsx("small",{children:"No reset credits available."}):null:u.jsx("small",{children:"Credit details unavailable. Refresh details to try again."}),u.jsx("div",{className:"codex-credit-grid",children:(Tt=Je==null?void 0:Je.credits)==null?void 0:Tt.map(At=>{var ur,me;const pn=At.expiresAt!==null&&At.expiresAt*1e3<=ne.getTime(),en=At.status==="available"&&!pn,ht=pn&&At.status==="available"?"Expired":At.status;return u.jsxs("article",{className:`codex-credit-ticket${en?"":" inactive"}`,"aria-label":`${fe.name}: ${At.title||"Rate-limit reset"}`,children:[u.jsxs("div",{className:"codex-credit-ticket-heading",children:[u.jsx("strong",{title:At.title||"Rate-limit reset",children:At.title||"Rate-limit reset"}),u.jsx("span",{className:"codex-credit-badge",children:en?"1 use":ht})]}),u.jsx("small",{children:At.expiresAt===null?"No expiry":`Expires ${ct(new Date(At.expiresAt*1e3).toISOString())}`}),u.jsxs("div",{className:"codex-credit-ticket-actions",children:[u.jsxs("details",{children:[u.jsx("summary",{children:"Details"}),At.description?u.jsx("p",{children:At.description}):null,u.jsxs("p",{children:["Single-use credit · ",ht]}),u.jsxs("p",{children:["Granted ",ct(new Date(At.grantedAt*1e3).toISOString())]}),At.resetType!=="codexRateLimits"?u.jsx("p",{children:"This credit type is not supported."}):null]}),u.jsx("button",{className:"codex-account-add codex-credit-use",type:"button",disabled:f||o||!!(qe!=null&&qe.error)||!en||At.resetType!=="codexRateLimits"||!!((me=(ur=t==null?void 0:t.accountIssues)==null?void 0:ur[fe.id])!=null&&me.length),onClick:()=>void te(fe,At),children:"Use"})]})]},At.id)})}),Je&&Je.availableCount>(((mt=Je.credits)==null?void 0:mt.length)??0)?u.jsx("small",{children:"Credit details unavailable for some credits. Refresh details to use them."}):null,qe!=null&&qe.error?u.jsxs("small",{className:"codex-credit-error",children:["Refresh issue: ",qe.error]}):null]},fe.id)}),u.jsx("footer",{className:"memory-editor-actions",children:u.jsx("button",{type:"button",className:"memory-dialog-button",disabled:f||o,onClick:()=>void ee(!0),children:o?"Refreshing...":"Refresh details"})})]}):null,z?u.jsx("div",{className:"memory-editor-overlay",onClick:()=>!f&&M(null),role:"presentation",children:u.jsxs("form",{"aria-label":"Edit Codex account",className:"memory-editor-popover codex-account-login-dialog",onClick:fe=>fe.stopPropagation(),onSubmit:fe=>void He(fe),children:[u.jsxs("header",{children:[u.jsx("strong",{children:"Edit Codex Account"}),u.jsx("button",{"aria-label":"Close account editor",className:"memory-icon-button",disabled:f,onClick:()=>M(null),type:"button",children:"×"})]}),u.jsx("p",{className:"settings-note",children:"This name is only a Seele label. It does not change the Codex login or credential."}),u.jsxs("label",{children:[u.jsx("span",{children:"Account name"}),u.jsx("input",{"aria-label":"Codex account name",autoFocus:!0,maxLength:80,onChange:fe=>ie(fe.target.value),value:K})]}),u.jsxs("label",{children:[u.jsx("span",{children:"每月续费日"}),u.jsxs("select",{"aria-label":"每月续费日",value:B,title:"按北京时间计算;不足对应日期的月份按月末计算",onChange:fe=>U(fe.target.value),children:[u.jsx("option",{value:"",children:"未设置"}),Array.from({length:31},(fe,qe)=>qe+1).map(fe=>u.jsxs("option",{value:fe,children:[fe," 日"]},fe))]})]}),m?u.jsx("p",{className:"memory-editor-error",children:m}):null,u.jsxs("div",{className:"memory-editor-actions",children:[u.jsx("button",{className:"memory-dialog-button",disabled:f,onClick:()=>M(null),type:"button",children:"Cancel"}),u.jsx("button",{className:"memory-dialog-button primary",disabled:f||!K.trim(),type:"submit",children:f?"Saving...":"Save"})]})]})}):null,v?u.jsx("div",{className:"memory-editor-overlay",onClick:()=>!f&&!A&&k(!1),role:"presentation",children:A?u.jsxs("section",{"aria-label":"Complete Codex account login",className:"memory-delete-dialog codex-account-login-dialog",onClick:fe=>fe.stopPropagation(),children:[u.jsxs("header",{children:[u.jsx("strong",{children:A.status==="succeeded"?"Account Added":"Complete Codex Login"}),u.jsx("button",{"aria-label":"Close account login",className:"memory-icon-button",disabled:f,onClick:()=>void we(),type:"button",children:"×"})]}),A.status==="pending"?u.jsxs(u.Fragment,{children:[u.jsx("p",{children:"Open the official Codex device page and enter this one-time code."}),u.jsxs("div",{className:"codex-device-code",children:[u.jsx("strong",{children:A.userCode}),u.jsx("button",{onClick:()=>{navigator.clipboard.writeText(A.userCode),J(!0),window.setTimeout(()=>J(!1),1500)},type:"button",children:pe?"Copied":"Copy code"})]}),u.jsx("a",{href:A.verificationUrl,rel:"noreferrer",target:"_blank",children:"Open Codex device login"}),u.jsx("small",{className:"codex-login-waiting",children:"Waiting for Codex to confirm the login..."})]}):A.status==="succeeded"?u.jsxs("p",{children:[u.jsx("strong",{children:((tt=A.account)==null?void 0:tt.name)??A.accountName})," is persisted on the cloud and ready to synchronize. It was not activated automatically."]}):u.jsx("p",{className:"memory-editor-error",children:A.error??"Codex login was cancelled."}),u.jsx("div",{className:"memory-delete-actions",children:u.jsx("button",{className:"memory-dialog-button",disabled:f,onClick:()=>void we(),type:"button",children:A.status==="pending"?"Cancel login":"Close"})})]}):u.jsxs("form",{"aria-label":"Add Codex account",className:"memory-editor-popover codex-account-login-dialog",onClick:fe=>fe.stopPropagation(),onSubmit:fe=>void re(fe),children:[u.jsxs("header",{children:[u.jsx("strong",{children:"Add Codex Account"}),u.jsx("button",{"aria-label":"Close account login",className:"memory-icon-button",onClick:()=>k(!1),type:"button",children:"×"})]}),u.jsx("p",{className:"settings-note",children:"Seele creates the login profile on the cloud. Completing login shares it with every deployment but does not make it active."}),u.jsxs("label",{children:[u.jsx("span",{children:"Account name"}),u.jsx("input",{autoFocus:!0,maxLength:80,onChange:fe=>T(fe.target.value),placeholder:"For example: Codex backup",value:b})]}),m?u.jsx("p",{className:"memory-editor-error",children:m}):null,u.jsxs("div",{className:"memory-editor-actions",children:[u.jsx("button",{className:"memory-dialog-button",onClick:()=>k(!1),type:"button",children:"Cancel"}),u.jsx("button",{className:"memory-dialog-button primary",disabled:f||!b.trim(),type:"submit",children:f?"Starting...":"Continue"})]})]})}):null,Q?u.jsx("div",{className:"memory-editor-overlay",onClick:()=>!f&&F(null),role:"presentation",children:u.jsxs("section",{"aria-label":"Switch Codex account",className:"memory-delete-dialog",onClick:fe=>fe.stopPropagation(),children:[u.jsxs("header",{children:[u.jsx("strong",{children:"Switch Codex Account"}),u.jsx("button",{"aria-label":"Close account switch",className:"memory-icon-button",disabled:f,onClick:()=>F(null),type:"button",children:"×"})]}),u.jsxs("p",{children:["Switch cloud-wide execution to ",u.jsx("strong",{children:Q.name}),"? Active turns continue with the account they started with. New requests use this account once their deployment syncs; workspace threads and memory stay unchanged."]}),m?u.jsx("p",{className:"memory-editor-error",children:m}):null,u.jsxs("div",{className:"memory-delete-actions",children:[u.jsx("button",{className:"memory-dialog-button",disabled:f,onClick:()=>F(null),type:"button",children:"Cancel"}),u.jsx("button",{className:"memory-dialog-button primary",disabled:f,onClick:()=>void wt(),type:"button",children:f?"Switching...":"Switch account"})]})]})}):null,Ie?u.jsx("div",{className:"memory-editor-overlay",onClick:()=>!f&&be(null),role:"presentation",children:u.jsxs("section",{"aria-label":"Delete Codex account",className:"memory-delete-dialog",onClick:fe=>fe.stopPropagation(),children:[u.jsxs("header",{children:[u.jsx("strong",{children:"Delete Codex Account"}),u.jsx("button",{"aria-label":"Close account deletion",className:"memory-icon-button",disabled:f,onClick:()=>be(null),type:"button",children:"×"})]}),u.jsxs("p",{children:["Delete ",u.jsx("strong",{children:Ie.name})," and its persisted Codex credential from the cloud and every member mirror? This cannot be undone."]}),m?u.jsx("p",{className:"memory-editor-error",children:m}):null,u.jsxs("div",{className:"memory-delete-actions",children:[u.jsx("button",{className:"memory-dialog-button",disabled:f,onClick:()=>be(null),type:"button",children:"Cancel"}),u.jsx("button",{className:"memory-dialog-button danger",disabled:f,onClick:()=>void et(),type:"button",children:f?"Deleting...":"Delete"})]})]})}):null]})}function pN({currentUser:e,users:t,onCreate:n,onDelete:a,onUpdate:l}){const o={username:"",password:"",role:"user",active:!0},[c,f]=D.useState(null),[h,m]=D.useState(o),[g,v]=D.useState(!1),[k,b]=D.useState(null),[T,A]=D.useState("");function q(){m(o),A(""),f("new")}function z(U){m({username:U.username,password:"",role:U.role,active:U.active}),A(""),f(U)}function M(){g||(f(null),A(""))}async function B(U){if(U.preventDefault(),!!c){v(!0),A("");try{c==="new"?await n({username:h.username.trim(),password:h.password,role:h.role}):await l(c.id,{username:h.username.trim(),password:h.password||void 0,role:h.role,active:h.active}),f(null)}catch(ne){A(pt(ne).message)}finally{v(!1)}}}return u.jsxs("section",{className:"settings-section user-management-section",children:[u.jsx("header",{className:"settings-section-header",children:u.jsxs("div",{children:[u.jsx("h3",{children:"Users"}),u.jsx("p",{children:"Manage sign-in access and Seele roles."})]})}),u.jsx("div",{className:"memory-items-editor-header actions-only",children:u.jsx("button",{"aria-label":"Add user",className:"memory-icon-button",onClick:q,title:"Add user",type:"button",children:"+"})}),u.jsxs("div",{className:"user-list",children:[t.map(U=>u.jsxs("div",{className:"user-list-item",children:[u.jsxs("div",{className:"user-list-main",children:[u.jsxs("div",{children:[u.jsx("strong",{children:U.username}),U.id===e.id?u.jsx("span",{className:"user-current-badge",children:"Current"}):null]}),u.jsxs("small",{children:["Created ",ct(U.createdAt)]})]}),u.jsx("span",{className:`user-role-badge role-${U.role}`,children:U.role}),u.jsx("span",{className:`user-status ${U.active?"active":"disabled"}`,children:U.active?"Active":"Disabled"}),u.jsxs("div",{className:"user-row-actions",children:[u.jsx("button",{"aria-label":`Edit user ${U.username}`,className:"memory-icon-button",onClick:()=>z(U),title:"Edit",type:"button",children:u.jsx(Rf,{})}),u.jsx("button",{"aria-label":`Delete user ${U.username}`,className:"memory-icon-button memory-item-delete",disabled:U.id===e.id,onClick:()=>{A(""),b(U)},title:"Delete",type:"button",children:"×"})]})]},U.id)),t.length===0?u.jsx("p",{className:"settings-note",children:"No users are configured."}):null]}),c?u.jsx("div",{className:"memory-editor-overlay",onClick:M,role:"presentation",children:u.jsxs("form",{"aria-label":c==="new"?"Add user":"Edit user",className:"memory-editor-popover user-editor-popover",onClick:U=>U.stopPropagation(),onSubmit:U=>void B(U),children:[u.jsxs("header",{children:[u.jsx("strong",{children:c==="new"?"Add User":"Edit User"}),u.jsx("button",{"aria-label":"Close user editor",className:"memory-icon-button",onClick:M,title:"Close",type:"button",children:"×"})]}),u.jsxs("label",{children:[u.jsx("span",{children:"Username"}),u.jsx("input",{autoComplete:"off",autoFocus:!0,onChange:U=>m(ne=>({...ne,username:U.target.value})),placeholder:"Sign-in username",value:h.username})]}),u.jsxs("label",{children:[u.jsx("span",{children:c==="new"?"Initial password":"New password"}),u.jsx("input",{autoComplete:"new-password",minLength:8,onChange:U=>m(ne=>({...ne,password:U.target.value})),placeholder:c==="new"?"At least 8 characters":"Leave blank to keep the current password",type:"password",value:h.password})]}),u.jsxs("label",{children:[u.jsx("span",{children:"Role"}),u.jsxs("select",{disabled:c!=="new"&&c.id===e.id,onChange:U=>m(ne=>({...ne,role:U.target.value==="admin"?"admin":"user"})),value:h.role,children:[u.jsx("option",{value:"user",children:"User"}),u.jsx("option",{value:"admin",children:"Admin"})]})]}),c!=="new"?u.jsxs("label",{className:"user-editor-active",children:[u.jsx("input",{checked:h.active,disabled:c.id===e.id,onChange:U=>m(ne=>({...ne,active:U.target.checked})),type:"checkbox"}),u.jsx("span",{children:"Account active"})]}):null,T?u.jsx("p",{className:"memory-editor-error",children:T}):null,u.jsxs("div",{className:"memory-editor-actions",children:[u.jsx("button",{className:"memory-dialog-button",onClick:M,type:"button",children:"Cancel"}),u.jsx("button",{className:"memory-dialog-button primary",disabled:g||!h.username.trim()||c==="new"&&h.password.length<8||c!=="new"&&h.password.length>0&&h.password.length<8,type:"submit",children:g?"Saving...":"Save"})]})]})}):null,k?u.jsx("div",{className:"memory-editor-overlay",onClick:()=>b(null),role:"presentation",children:u.jsxs("section",{"aria-label":"Delete user",className:"memory-delete-dialog",onClick:U=>U.stopPropagation(),children:[u.jsxs("header",{children:[u.jsx("strong",{children:"Delete User"}),u.jsx("button",{"aria-label":"Close delete user confirmation",className:"memory-icon-button",onClick:()=>b(null),title:"Close",type:"button",children:"×"})]}),u.jsxs("p",{children:["Delete ",u.jsx("strong",{children:k.username}),". Users that own workspaces must be disabled instead."]}),T?u.jsx("p",{className:"memory-editor-error",children:T}):null,u.jsxs("div",{className:"memory-delete-actions",children:[u.jsx("button",{className:"memory-dialog-button",onClick:()=>b(null),type:"button",children:"Cancel"}),u.jsx("button",{className:"memory-dialog-button danger",onClick:()=>{a(k.id).then(()=>b(null)).catch(U=>A(pt(U).message))},type:"button",children:"Delete"})]})]})}):null]})}function gN({settings:e,onSave:t}){const[n,a]=D.useState(e),[l,o]=D.useState(!1);return D.useEffect(()=>a(e),[e]),u.jsxs(u.Fragment,{children:[u.jsx("header",{className:"settings-section-header",children:u.jsxs("div",{children:[u.jsx("h3",{children:"Deployment"}),u.jsx("p",{children:"Settings stored only on this Seele instance. Cloud synchronization does not copy or overwrite them."})]})}),u.jsxs("form",{className:"settings-form",onSubmit:c=>{c.preventDefault(),o(!0),t(n).finally(()=>o(!1))},children:[u.jsxs("label",{className:"settings-field settings-field-wide",children:[u.jsxs("span",{children:[u.jsx("strong",{children:"Public URL"}),u.jsx("small",{children:"The externally reachable main URL of this deployment. Seele uses it when publishing callback links to external systems."})]}),u.jsx("input",{"aria-label":"Public URL of this deployment",onChange:c=>a({...n,publicUrl:c.target.value||null}),placeholder:"https://profuse.antgroup-inc.cn/codex/yishao-0/",type:"url",value:n.publicUrl||""})]}),u.jsxs("label",{className:"settings-toggle-field",children:[u.jsxs("span",{children:[u.jsx("strong",{children:"Profuse notification"}),u.jsx("small",{children:"Send DingTalk notifications from this deployment when a turn finishes or fails. Keep this off where the Profuse endpoint is unreachable."})]}),u.jsx("input",{"aria-label":"Enable Profuse notification on this deployment",checked:n.profuseNotificationEnabled,onChange:c=>a({...n,profuseNotificationEnabled:c.target.checked}),type:"checkbox"})]}),u.jsx("div",{className:"settings-form-actions",children:u.jsx("button",{disabled:l,type:"submit",children:l?"Saving...":"Save deployment settings"})})]})]})}function yN({codexReleasedAt:e,codexVersion:t,codexUpdating:n,draft:a,globalSettings:l,models:o,scope:c,settings:f,workspaceOverrideCount:h,workspaceSettings:m,onDraftChange:g,onResetWorkspaceSetting:v,onSubmit:k,onUpdateCodexCli:b}){var ce,Ie,be,pe,J;const T=c==="workspace",A=a.modelSource??{type:"codex"},q=A.type==="codex",z=((ce=l.modelSource)==null?void 0:ce.type)==="custom"?l.modelSource.channelId:null,M=((Ie=f.modelSource)==null?void 0:Ie.type)==="custom"?f.modelSource.channelId:null,[B,U]=D.useState(null),[ne,L]=D.useState(!1);D.useEffect(()=>{let Y=!1;return sz().then(ge=>{Y||U(ge)}).catch(()=>{Y||L(!0)}),()=>{Y=!0}},[]);const K=Xd(a.model,o),ie=Xd(l.model,o),Q=Xd(f.model,o),F=nE(a.reasoningEffort,K),he=tE(K,a.reasoningEffort);return u.jsxs(u.Fragment,{children:[u.jsxs("header",{className:"settings-section-header",children:[u.jsxs("div",{children:[u.jsx("h3",{children:"Runtime"}),u.jsx("p",{children:"Configure global defaults or override them for the selected workspace. Running turns keep the settings they started with."})]}),T?u.jsx("span",{className:h>0?"section-override-count active":"section-override-count",children:h>0?`${h} custom`:"No custom runtime"}):null]}),u.jsxs("form",{className:"settings-form runtime-form",onSubmit:k,children:[u.jsxs("div",{className:"settings-wide-field",children:[u.jsx(Ac,{label:"Model source",settingKey:"modelSource",isWorkspaceScope:T,globalValue:z?`Custom · ${((be=B==null?void 0:B.channels.find(Y=>Y.id===z))==null?void 0:be.name)??"Unavailable channel"}`:"Codex official",source:K6(a.modelSource,l.modelSource)?m==null?void 0:m.sources.modelSource:"workspace",onReset:v}),u.jsx(Od,{"aria-label":"Runtime model source",value:A.type,options:[{value:"codex",label:"Codex official"},{value:"custom",label:"Custom"}],onChange:Y=>{var ge;return g({...a,modelSource:Y==="custom"?{type:"custom",channelId:((ge=B==null?void 0:B.channels[0])==null?void 0:ge.id)??""}:{type:"codex"}})}}),q?null:u.jsxs(u.Fragment,{children:[u.jsxs("label",{className:"settings-field",children:[u.jsx("span",{children:"Custom channel"}),u.jsxs("select",{"aria-label":"Runtime custom channel",required:!0,value:A.channelId,onChange:Y=>g({...a,modelSource:{type:"custom",channelId:Y.target.value}}),children:[u.jsx("option",{value:"",disabled:!0,children:"Select a configured channel"}),A.channelId&&!(B!=null&&B.channels.some(Y=>Y.id===A.channelId))?u.jsx("option",{value:A.channelId,children:"Unavailable channel"}):null,B==null?void 0:B.channels.map(Y=>u.jsxs("option",{value:Y.id,children:[Y.name," · ",Y.model]},Y.id))]})]}),ne?u.jsx("p",{role:"alert",children:"Unable to load custom channels. Reopen Runtime to retry."}):(B==null?void 0:B.channels.length)===0?u.jsx("p",{children:"Add a channel in Custom model channels first."}):null,u.jsx("small",{children:"The channel fixes the model and connection. Codex reasoning effort and Fast mode do not apply."})]})]}),q?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:Id(T,Dl(a.model,l.model,m==null?void 0:m.sources.model)),children:[u.jsx(Ac,{globalValue:A5(l.model,o),isWorkspaceScope:T,label:"Model",settingKey:"model",source:Dl(a.model,l.model,m==null?void 0:m.sources.model),onReset:v}),u.jsx(Od,{"aria-label":"Runtime model",onChange:Y=>{g({...a,model:Y})},options:AD(o,a.model),value:a.model||((pe=o.find(Y=>Y.isDefault))==null?void 0:pe.model)||""})]}),u.jsxs("div",{className:Id(T,Dl(a.reasoningEffort,l.reasoningEffort,m==null?void 0:m.sources.reasoningEffort)),children:[u.jsx(Ac,{globalValue:B3(l.reasoningEffort,ie),isWorkspaceScope:T,label:"Reasoning effort",settingKey:"reasoningEffort",source:Dl(a.reasoningEffort,l.reasoningEffort,m==null?void 0:m.sources.reasoningEffort),onReset:v}),u.jsx(Od,{"aria-label":"Runtime reasoning effort",onChange:Y=>g({...a,reasoningEffort:Y}),options:he,value:a.reasoningEffort}),F?u.jsx("p",{role:"status",children:F}):null]})]}):null,u.jsxs("div",{className:Id(T,Dl(a.sandbox,l.sandbox,m==null?void 0:m.sources.sandbox)),children:[u.jsx(Ac,{globalValue:yp(l.sandbox),isWorkspaceScope:T,label:"Permission mode",settingKey:"sandbox",source:Dl(a.sandbox,l.sandbox,m==null?void 0:m.sources.sandbox),onReset:v}),u.jsx(Od,{"aria-label":"Permission mode",onChange:Y=>g({...a,sandbox:Y}),options:RE,value:a.sandbox})]}),q?u.jsxs("div",{className:Id(T,Dl(a.fastMode,l.fastMode,m==null?void 0:m.sources.fastMode),"settings-toggle-field"),children:[u.jsxs("span",{children:[u.jsx(Ac,{globalValue:l.fastMode?"On":"Off",isWorkspaceScope:T,label:"Fast mode",settingKey:"fastMode",source:Dl(a.fastMode,l.fastMode,m==null?void 0:m.sources.fastMode),onReset:v}),u.jsx("small",{children:"1.5x speed with higher Codex credit consumption"})]}),u.jsx("input",{"aria-label":"Enable Fast mode",checked:a.fastMode,onChange:Y=>g({...a,fastMode:Y.target.checked}),type:"checkbox"})]}):null,u.jsxs("dl",{className:"runtime-summary",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Current"}),u.jsx("dd",{children:M?u.jsxs(u.Fragment,{children:["Custom · ",((J=B==null?void 0:B.channels.find(Y=>Y.id===M))==null?void 0:J.name)??"Unavailable channel"," · ",yp(f.sandbox),"."]}):u.jsxs(u.Fragment,{children:["Model ",A5(f.model,o),", reasoning"," ",B3(f.reasoningEffort,Q),", Fast mode"," ",f.fastMode?"on":"off",", permission"," ",yp(f.sandbox),"."]})})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Codex CLI"}),u.jsxs("dd",{className:"runtime-version-value",children:[u.jsx("span",{children:l1(t,e)}),u.jsx("button",{className:"runtime-update-button",disabled:n,onClick:b,type:"button",children:n?"Updating...":"Check update"})]})]})]}),u.jsx("div",{className:"settings-form-actions",children:u.jsx("button",{type:"submit",children:T?"Save workspace overrides":"Save global runtime"})})]})]})}function Ac({globalValue:e,isWorkspaceScope:t,label:n,settingKey:a,source:l,onReset:o}){const c=t&&l==="workspace";return u.jsxs("span",{className:"runtime-field-label",children:[u.jsx("span",{children:n}),t?u.jsxs("span",{className:"runtime-field-meta",children:[u.jsx("span",{className:c?"override":"inherited",children:c?"Workspace override":`Inherited: ${e}`}),c?u.jsx("button",{type:"button",onClick:()=>o(a),children:"Reset"}):null]}):null]})}function Od({"aria-label":e,onChange:t,options:n,value:a}){const[l,o]=D.useState(!1),c=D.useRef(null),f=n.find(h=>h.value===a)??n[0]??null;return D.useEffect(()=>{if(!l)return;function h(g){var v;(v=c.current)!=null&&v.contains(g.target)||o(!1)}function m(g){g.key==="Escape"&&o(!1)}return document.addEventListener("pointerdown",h,!0),document.addEventListener("keydown",m,!0),()=>{document.removeEventListener("pointerdown",h,!0),document.removeEventListener("keydown",m,!0)}},[l]),u.jsxs("div",{className:"runtime-select",ref:c,children:[u.jsxs("button",{"aria-expanded":l,"aria-label":e,className:"runtime-select-trigger",onClick:()=>o(h=>!h),type:"button",children:[u.jsx("span",{children:(f==null?void 0:f.label)??a}),u.jsx("span",{"aria-hidden":"true",children:"⌄"})]}),l?u.jsx("div",{className:"runtime-select-menu",role:"listbox",children:n.map(h=>u.jsx("button",{"aria-selected":h.value===a,className:h.value===a?"selected":void 0,onClick:()=>{t(h.value),o(!1)},role:"option",type:"button",children:h.label},h.value||"default"))}):null]})}function Dl(e,t,n){return JSON.stringify(e)!==JSON.stringify(t)?"workspace":n}function Id(e,t,n="settings-wide-field"){return[n,e?"workspace-scoped":"",e&&t==="workspace"?"workspace-overridden":""].filter(Boolean).join(" ")}function vN({baseSettings:e,scope:t,workspaceSettings:n,workspaceName:a,onSaveBaseItems:l,onSaveWorkspaceItems:o}){const c=t==="workspace",f=c?n.items:e.items,h=c?o:l;return u.jsxs(u.Fragment,{children:[u.jsx("header",{className:"settings-section-header",children:u.jsxs("div",{children:[u.jsx("h3",{children:c?"Workspace Memory":"Base Memory"}),u.jsx("p",{children:c?"Workspace memory applies only to the selected workspace. Use stable English keys; values may be Chinese, plain text, or Markdown.":"Base memory applies to every workspace. Use stable English keys; values may be Chinese, plain text, or Markdown."})]})}),c?u.jsxs("section",{className:"settings-readonly-block",children:[u.jsxs("div",{children:[u.jsx("strong",{children:"Base Memory"}),u.jsx("span",{children:"Read-only in workspace scope"})]}),u.jsx(bN,{emptyText:"No base memory is configured.",items:e.items,readonly:!0})]}):null,u.jsx("div",{className:"memory-manager-shell",children:u.jsx(xN,{ariaLabel:c?"Workspace memory":"Base memory",emptyText:"No memory items are configured.",items:f,onSaveItems:h,title:""})})]})}function xN({ariaLabel:e,emptyText:t,items:n,onSaveItems:a,title:l}){var K;const[o,c]=D.useState(Hc(n)),[f,h]=D.useState(null),[m,g]=D.useState({key:"",value:""}),[v,k]=D.useState(null),[b,T]=D.useState(null),[A,q]=D.useState(null);D.useEffect(()=>{c(Hc(n))},[n]),D.useEffect(()=>{if(f===null)return;const ie=Q=>{Q.key==="Escape"&&(U(),T(null))};return document.addEventListener("keydown",ie),()=>document.removeEventListener("keydown",ie)},[f]);async function z(ie,Q){q(Q);try{const F=await a(ie);return c(Hc(F)),F}finally{q(null)}}function M(){T(null),k(null),g({key:"",value:""}),h("new")}function B(ie){const Q=o[ie];Q&&(T(null),k(null),g({...Q}),h(ie))}function U(){h(null),k(null),g({key:"",value:""})}async function ne(ie){const Q=o[ie],F=(Q==null?void 0:Q.key)||`${ie}`;await z(o.filter((he,ce)=>ce!==ie),`delete:${F}`),T(null)}async function L(ie){ie.preventDefault(),ie.stopPropagation();const Q=m.key.trim(),F=Lz(Q);if(F){k(F);return}const he=m.value.trim();if(!he){k("Value is required.");return}const ce=f==="new"?-1:f;if(o.some((be,pe)=>pe!==ce&&be.key.trim()===Q)){k(`Key "${Q}" already exists. Each memory key must be unique.`);return}const Ie={...m,key:Q,value:he};f==="new"?await z([...o,Ie],"add"):typeof f=="number"&&await z(o.map((be,pe)=>pe===f?Ie:be),`save:${f}`),U()}return u.jsxs("section",{className:"memory-items-manager","aria-label":e,children:[u.jsxs("div",{className:l?"memory-items-editor-header":"memory-items-editor-header actions-only",children:[l?u.jsx("span",{children:l}):null,u.jsx("button",{"aria-label":"Add memory item",className:"memory-icon-button",title:"Add",type:"button",onClick:M,children:"+"})]}),o.length?u.jsx("div",{className:"memory-items-grid",children:o.map((ie,Q)=>u.jsxs("div",{className:"memory-item-display",children:[u.jsxs("pre",{"aria-label":`Memory item ${ie.key}`,children:[u.jsx("span",{className:"memory-tag",children:`<${ie.key}>`}),`
|
|
366
366
|
`,u.jsx("span",{children:ie.value}),`
|
|
367
|
-
`,u.jsx("span",{className:"memory-tag",children:`</${ie.key}>`})]}),u.jsxs("div",{className:"memory-item-actions",children:[u.jsx("button",{"aria-label":`Edit memory item ${ie.key||Q+1}`,className:"memory-icon-button memory-item-edit",disabled:A!==null,title:"Edit",type:"button",onClick:()=>B(Q),children:"✎"}),u.jsx("button",{"aria-label":`Delete memory item ${ie.key||Q+1}`,className:"memory-icon-button memory-item-delete",disabled:A!==null,title:"Delete",type:"button",onClick:()=>T(Q),children:"×"})]})]},`${Q}-${ie.key}`))}):u.jsx("p",{className:"settings-note",children:t}),f!==null?u.jsx("div",{className:"memory-editor-overlay",onClick:U,role:"presentation",children:u.jsxs("form",{"aria-label":f==="new"?"Add memory item":"Edit memory item",className:"memory-editor-popover",onClick:ie=>ie.stopPropagation(),onSubmit:ie=>void L(ie),children:[u.jsxs("header",{children:[u.jsx("strong",{children:f==="new"?"Add Memory":"Edit Memory"}),u.jsx("button",{"aria-label":"Close memory editor",className:"memory-icon-button",title:"Close",type:"button",onClick:U,children:"×"})]}),u.jsxs("label",{children:[u.jsx("span",{children:"Key"}),u.jsx("input",{autoComplete:"off",autoFocus:!0,onChange:ie=>g(Q=>({...Q,key:ie.target.value})),placeholder:"Stable technical key used as the injected tag name",value:m.key})]}),u.jsxs("label",{children:[u.jsx("span",{children:"Value · up to 1000 tokens"}),u.jsx("textarea",{onChange:ie=>g(Q=>({...Q,value:ie.target.value})),placeholder:"Memory content injected under this key",rows:10,value:m.value})]}),v?u.jsx("p",{className:"memory-editor-error",children:v}):null,u.jsxs("div",{className:"memory-editor-actions",children:[u.jsx("button",{"aria-label":"Cancel memory edit",className:"memory-dialog-button",type:"button",onClick:U,children:"Cancel"}),u.jsx("button",{"aria-label":"Save memory item",className:"memory-dialog-button primary",disabled:A!==null,type:"submit",children:A==="add"||A!=null&&A.startsWith("save:")?"Saving...":"Save"})]})]})}):null,b!==null?u.jsx("div",{className:"memory-editor-overlay",onClick:()=>T(null),role:"presentation",children:u.jsxs("section",{"aria-label":"Confirm delete memory item",className:"memory-delete-dialog",onClick:ie=>ie.stopPropagation(),children:[u.jsxs("header",{children:[u.jsx("strong",{children:"Delete Memory"}),u.jsx("button",{"aria-label":"Close delete confirmation",className:"memory-icon-button",title:"Close",type:"button",onClick:()=>T(null),children:"×"})]}),u.jsxs("p",{children:["Delete"," ",u.jsx("code",{children:((K=o[b])==null?void 0:K.key)||`item ${b+1}`}),"?"]}),u.jsxs("div",{className:"memory-delete-actions",children:[u.jsx("button",{"aria-label":"Cancel delete",className:"memory-dialog-button",disabled:A!==null,type:"button",onClick:()=>T(null),children:"Cancel"}),u.jsx("button",{"aria-label":"Confirm delete",className:"memory-dialog-button danger",disabled:A!==null,type:"button",onClick:()=>void
|
|
367
|
+
`,u.jsx("span",{className:"memory-tag",children:`</${ie.key}>`})]}),u.jsxs("div",{className:"memory-item-actions",children:[u.jsx("button",{"aria-label":`Edit memory item ${ie.key||Q+1}`,className:"memory-icon-button memory-item-edit",disabled:A!==null,title:"Edit",type:"button",onClick:()=>B(Q),children:"✎"}),u.jsx("button",{"aria-label":`Delete memory item ${ie.key||Q+1}`,className:"memory-icon-button memory-item-delete",disabled:A!==null,title:"Delete",type:"button",onClick:()=>T(Q),children:"×"})]})]},`${Q}-${ie.key}`))}):u.jsx("p",{className:"settings-note",children:t}),f!==null?u.jsx("div",{className:"memory-editor-overlay",onClick:U,role:"presentation",children:u.jsxs("form",{"aria-label":f==="new"?"Add memory item":"Edit memory item",className:"memory-editor-popover",onClick:ie=>ie.stopPropagation(),onSubmit:ie=>void L(ie),children:[u.jsxs("header",{children:[u.jsx("strong",{children:f==="new"?"Add Memory":"Edit Memory"}),u.jsx("button",{"aria-label":"Close memory editor",className:"memory-icon-button",title:"Close",type:"button",onClick:U,children:"×"})]}),u.jsxs("label",{children:[u.jsx("span",{children:"Key"}),u.jsx("input",{autoComplete:"off",autoFocus:!0,onChange:ie=>g(Q=>({...Q,key:ie.target.value})),placeholder:"Stable technical key used as the injected tag name",value:m.key})]}),u.jsxs("label",{children:[u.jsx("span",{children:"Value · up to 1000 tokens"}),u.jsx("textarea",{onChange:ie=>g(Q=>({...Q,value:ie.target.value})),placeholder:"Memory content injected under this key",rows:10,value:m.value})]}),v?u.jsx("p",{className:"memory-editor-error",children:v}):null,u.jsxs("div",{className:"memory-editor-actions",children:[u.jsx("button",{"aria-label":"Cancel memory edit",className:"memory-dialog-button",type:"button",onClick:U,children:"Cancel"}),u.jsx("button",{"aria-label":"Save memory item",className:"memory-dialog-button primary",disabled:A!==null,type:"submit",children:A==="add"||A!=null&&A.startsWith("save:")?"Saving...":"Save"})]})]})}):null,b!==null?u.jsx("div",{className:"memory-editor-overlay",onClick:()=>T(null),role:"presentation",children:u.jsxs("section",{"aria-label":"Confirm delete memory item",className:"memory-delete-dialog",onClick:ie=>ie.stopPropagation(),children:[u.jsxs("header",{children:[u.jsx("strong",{children:"Delete Memory"}),u.jsx("button",{"aria-label":"Close delete confirmation",className:"memory-icon-button",title:"Close",type:"button",onClick:()=>T(null),children:"×"})]}),u.jsxs("p",{children:["Delete"," ",u.jsx("code",{children:((K=o[b])==null?void 0:K.key)||`item ${b+1}`}),"?"]}),u.jsxs("div",{className:"memory-delete-actions",children:[u.jsx("button",{"aria-label":"Cancel delete",className:"memory-dialog-button",disabled:A!==null,type:"button",onClick:()=>T(null),children:"Cancel"}),u.jsx("button",{"aria-label":"Confirm delete",className:"memory-dialog-button danger",disabled:A!==null,type:"button",onClick:()=>void ne(b),children:"Delete"})]})]})}):null]})}function bN({emptyText:e,items:t}){const n=Hc(t);return n.length?u.jsx("div",{className:"memory-items-list",children:n.map(a=>u.jsx("div",{className:"memory-item-display memory-item-readonly",children:u.jsxs("pre",{"aria-label":`Memory item ${a.key}`,children:[u.jsx("span",{className:"memory-tag",children:`<${a.key}>`}),`
|
|
368
368
|
`,u.jsx("span",{children:a.value}),`
|
|
369
|
-
`,u.jsx("span",{className:"memory-tag",children:`</${a.key}>`})]})},a.key))}):u.jsx("p",{className:"settings-note",children:e})}function wN({deleteConfirmKey:e,editingEnvironmentKey:t,environmentDraft:n,globalEnvironment:a,scope:l,workspaceEnvironment:o,valueVisible:c,onCancelEnvironmentEdit:f,onDeleteConfirmChange:h,onDeleteEnvironment:m,onDraftChange:g,onEditEnvironment:v,onRevealEnvironmentValue:k,onSubmitEnvironment:b,onValueVisibleChange:T,revealedEnvironmentKeys:A}){const q=t!==null&&A.has(t),z=l==="workspace",M=z?o:a,[B,U]=D.useState(!1);function ae(){f(),g({description:"",key:"",value:""}),T(!1),U(!0)}function L(Q){v(Q),T(!1),U(!0)}function K(){U(!1),f(),T(!1)}function ie(Q){b(Q),U(!1)}return u.jsxs(u.Fragment,{children:[u.jsx("header",{className:"settings-section-header",children:u.jsxs("div",{children:[u.jsx("h3",{children:z?"Workspace Environment":"Base Environment"}),u.jsx("p",{children:z?"Workspace variables are stored in this workspace and are merged with base variables for new runs.":"Base variables are injected into every new workspace run. Existing runs keep the environment they started with."})]})}),z?u.jsxs("section",{className:"settings-readonly-block",children:[u.jsxs("div",{children:[u.jsx("strong",{children:"Base Environment"}),u.jsx("span",{children:"Read-only in workspace scope"})]}),u.jsx(Z3,{emptyText:"No base environment variables are configured.",readonly:!0,variables:a})]}):null,u.jsxs("section",{className:"environment-manager",children:[u.jsx("div",{className:"memory-items-editor-header actions-only",children:u.jsx("button",{"aria-label":"Add environment variable",className:"memory-icon-button",title:"Add",type:"button",onClick:ae,children:"+"})}),u.jsx(Z3,{emptyText:z?"No workspace environment variables are configured.":"No base environment variables are configured.",onDelete:Q=>h(Q),onEdit:L,variables:M})]}),B?u.jsx("div",{className:"memory-editor-overlay",onClick:K,role:"presentation",children:u.jsxs("form",{"aria-label":t?"Edit environment variable":"Add environment variable",className:"memory-editor-popover environment-editor-popover",onClick:Q=>Q.stopPropagation(),onSubmit:ie,children:[u.jsxs("header",{children:[u.jsx("strong",{children:t?"Edit Environment":"Add Environment"}),u.jsx("button",{"aria-label":"Close environment editor",className:"memory-icon-button",title:"Close",type:"button",onClick:K,children:"×"})]}),u.jsxs("label",{children:[u.jsx("span",{children:"Key"}),u.jsx("input",{"aria-label":"Environment variable key",autoComplete:"off",autoFocus:!0,disabled:t!==null,onChange:Q=>g({...n,key:Q.target.value}),placeholder:"Environment variable name",spellCheck:!1,value:n.key})]}),u.jsxs("label",{children:[u.jsx("span",{children:"Value"}),u.jsxs("span",{className:"environment-value-field",children:[u.jsx("input",{"aria-label":"Environment variable value",autoComplete:"off",onChange:Q=>g({...n,value:Q.target.value}),placeholder:"Environment variable value",spellCheck:!1,type:c?"text":"password",value:n.value}),u.jsx("button",{"aria-label":c?"Hide value":"Show value",onClick:()=>{if(t&&!q&&!n.value){k(t),T(!0);return}T(!c)},title:c?"Hide value":"Show value",type:"button",children:c?u.jsx(GM,{}):u.jsx(PM,{})})]})]}),u.jsxs("label",{children:[u.jsx("span",{children:"Description"}),u.jsx("input",{"aria-label":"Environment variable description",autoComplete:"off",onChange:Q=>g({...n,description:Q.target.value}),placeholder:"What this variable is for",spellCheck:!1,value:n.description})]}),u.jsxs("div",{className:"memory-editor-actions",children:[u.jsx("button",{className:"memory-dialog-button",type:"button",onClick:K,children:"Cancel"}),u.jsx("button",{className:"memory-dialog-button primary",disabled:!n.key.trim(),type:"submit",children:"Save"})]})]})}):null,e?u.jsx("div",{className:"memory-editor-overlay",onClick:()=>h(null),role:"presentation",children:u.jsxs("section",{"aria-label":"Confirm delete environment variable",className:"memory-delete-dialog",onClick:Q=>Q.stopPropagation(),children:[u.jsxs("header",{children:[u.jsx("strong",{children:"Delete Environment"}),u.jsx("button",{"aria-label":"Close delete confirmation",className:"memory-icon-button",title:"Close",type:"button",onClick:()=>h(null),children:"×"})]}),u.jsxs("p",{children:["Delete ",u.jsx("code",{children:e}),"?"]}),u.jsxs("div",{className:"memory-delete-actions",children:[u.jsx("button",{className:"memory-dialog-button",type:"button",onClick:()=>h(null),children:"Cancel"}),u.jsx("button",{className:"memory-dialog-button danger",type:"button",onClick:()=>{m(e),h(null)},children:"Delete"})]})]})}):null]})}function Z3({emptyText:e,onDelete:t,onEdit:n,readonly:a=!1,variables:l}){return l.length===0?u.jsx("p",{className:"settings-note",children:e}):u.jsx("div",{className:a?"environment-list readonly":"environment-list",children:l.map(o=>u.jsxs("div",{className:a?"environment-row readonly":"environment-row",children:[u.jsxs("div",{className:"environment-row-main",children:[u.jsxs("pre",{"aria-label":`Environment variable ${o.key}`,children:[u.jsx("span",{className:"memory-tag",children:o.key}),"=",o.hasValue?"••••••":"",o.description?u.jsx("span",{className:"environment-comment",children:` # ${o.description}`}):null]}),u.jsxs("span",{children:[o.hasValue?"configured":"empty"," · updated"," ",ct(o.updatedAt)]})]}),a?u.jsx("span",{className:"environment-readonly-tag",children:"read-only"}):u.jsxs("div",{className:"environment-row-actions",children:[u.jsx("button",{"aria-label":`Edit ${o.key}`,className:"memory-icon-button memory-item-edit",onClick:()=>n==null?void 0:n(o),title:"Edit",type:"button",children:"✎"}),u.jsx("button",{"aria-label":`Delete ${o.key}`,className:"memory-icon-button memory-item-delete",onClick:()=>t==null?void 0:t(o.key),title:"Delete",type:"button",children:"×"})]})]},o.key))})}function mx({items:e,onDelete:t,onEdit:n}){const[a,l]=D.useState(null),[o,c]=D.useState(null);return e.length===0?u.jsxs("section",{className:"knowledge-empty",children:[u.jsx("h4",{children:"No knowledge registered"}),u.jsx("p",{children:"Give this workspace durable source material in chat. The workspace should decide whether to register it, create local copies, and produce digest or skill files."})]}):u.jsx("div",{className:"knowledge-list",children:e.map(f=>u.jsxs("article",{className:"knowledge-row",children:[u.jsxs("div",{className:"knowledge-row-main",children:[u.jsxs("header",{children:[u.jsx("strong",{children:f.name}),u.jsx("span",{children:SN(f.kind)}),u.jsx("span",{className:TN(f.status),children:jN(f.status)})]}),u.jsx("p",{children:f.purpose||f.description||"No purpose set."}),u.jsxs("div",{className:"knowledge-paths",children:[u.jsx("code",{children:f.digestPath}),u.jsx("code",{children:f.skillPath}),u.jsx("code",{children:f.fetch.scriptPath})]}),f.fetch.requiredEnv.length>0?u.jsx("div",{className:"knowledge-envs",children:f.fetch.requiredEnv.map(h=>u.jsx("span",{title:h.description||h.key,children:h.key},h.key))}):null,o===f.id?u.jsx("small",{className:"knowledge-row-notice",children:"Refresh/check is not automatic yet. Ask this workspace to review or refresh this knowledge source."}):null,u.jsxs("small",{children:[f.attention," · ",CN(f.refreshPolicy)," · updated ",ct(f.updatedAt)]})]}),u.jsx("div",{className:"environment-row-actions",children:a===f.id?u.jsxs(u.Fragment,{children:[u.jsx("button",{className:"danger",onClick:()=>{t(f.id),l(null)},type:"button",children:"Delete"}),u.jsx("button",{onClick:()=>l(null),type:"button",children:"Cancel"})]}):u.jsxs(u.Fragment,{children:[u.jsx("button",{"aria-label":`Check ${f.name}`,onClick:()=>c(f.id),title:"Check or refresh through workspace",type:"button",children:"↻"}),u.jsx("button",{"aria-label":`Edit ${f.name}`,onClick:()=>n(f),title:"Edit knowledge",type:"button",children:u.jsx(Rf,{})}),u.jsx("button",{"aria-label":`Delete ${f.name}`,onClick:()=>l(f.id),title:"Delete knowledge",type:"button",children:"×"})]})})]},f.id))})}function kN({draft:e,items:t,scope:n,workspaceName:a,onCancel:l,onDelete:o,onDraftChange:c,onEdit:f,onSubmit:h}){return n==="workspace"?u.jsxs(u.Fragment,{children:[u.jsx("header",{className:"settings-section-header",children:u.jsxs("div",{children:[u.jsx("h3",{children:"Workspace Knowledge"}),u.jsxs("p",{children:["Long-lived source-backed material for ",a??"this workspace",". The workspace should create and maintain these assets itself when it digests external material. You mainly review status, delete stale items, or trigger a future refresh/check."]})]})}),u.jsx(mx,{items:t,onDelete:o,onEdit:f}),e.id?u.jsxs("form",{className:"settings-form knowledge-form",onSubmit:h,children:[u.jsxs("div",{className:"knowledge-form-header",children:[u.jsxs("div",{children:[u.jsx("strong",{children:"Edit metadata"}),u.jsx("span",{children:"This is mainly for correction. New knowledge should usually be created by the workspace while processing source material."})]}),u.jsx("button",{className:"secondary",onClick:l,type:"button",children:"Close"})]}),u.jsxs("div",{className:"knowledge-form-grid",children:[u.jsxs("label",{children:[u.jsx("span",{children:"Name"}),u.jsx("input",{"aria-label":"Knowledge name",onChange:g=>c({...e,name:g.target.value}),value:e.name})]}),u.jsxs("label",{children:[u.jsx("span",{children:"Kind"}),u.jsxs("select",{"aria-label":"Knowledge kind",onChange:g=>c({...e,kind:g.target.value}),value:e.kind,children:[u.jsx("option",{value:"source",children:"Source"}),u.jsx("option",{value:"skill",children:"Skill"}),u.jsx("option",{value:"reference",children:"Reference"})]})]}),u.jsxs("label",{children:[u.jsx("span",{children:"Status"}),u.jsxs("select",{"aria-label":"Knowledge status",onChange:g=>c({...e,status:g.target.value}),value:e.status,children:[u.jsx("option",{value:"draft",children:"Draft"}),u.jsx("option",{value:"needs_fetch_method",children:"Needs fetch method"}),u.jsx("option",{value:"needs_credentials",children:"Needs credentials"}),u.jsx("option",{value:"invalid_credentials",children:"Invalid credentials"}),u.jsx("option",{value:"ready",children:"Ready"}),u.jsx("option",{value:"stale_signal",children:"Stale signal"})]})]}),u.jsxs("label",{children:[u.jsx("span",{children:"Attention"}),u.jsxs("select",{"aria-label":"Knowledge attention",onChange:g=>c({...e,attention:g.target.value}),value:e.attention,children:[u.jsx("option",{value:"none",children:"None"}),u.jsx("option",{value:"tracked",children:"Tracked"}),u.jsx("option",{value:"watch",children:"Watch"})]})]}),u.jsxs("label",{children:[u.jsx("span",{children:"Refresh"}),u.jsxs("select",{"aria-label":"Knowledge refresh policy",onChange:g=>c({...e,refreshPolicy:g.target.value}),value:e.refreshPolicy,children:[u.jsx("option",{value:"manual",children:"Manual"}),u.jsx("option",{value:"low-frequency-check",children:"Low-frequency check"})]})]})]}),u.jsxs("label",{className:"settings-wide-field",children:[u.jsx("span",{children:"Purpose"}),u.jsx("textarea",{"aria-label":"Knowledge purpose",onChange:g=>c({...e,purpose:g.target.value}),rows:2,value:e.purpose})]}),u.jsxs("label",{className:"settings-wide-field",children:[u.jsx("span",{children:"Content"}),u.jsx("textarea",{"aria-label":"Knowledge content",onChange:g=>c({...e,description:g.target.value}),rows:2,value:e.description})]}),u.jsxs("label",{className:"settings-wide-field",children:[u.jsx("span",{children:"Source clues"}),u.jsx("textarea",{"aria-label":"Knowledge source clues",onChange:g=>c({...e,sourceCluesText:g.target.value}),rows:4,value:e.sourceCluesText})]}),u.jsxs("label",{className:"settings-wide-field",children:[u.jsx("span",{children:"Required environment"}),u.jsx("textarea",{"aria-label":"Knowledge required environment",onChange:g=>c({...e,requiredEnvText:g.target.value}),rows:3,value:e.requiredEnvText})]}),u.jsx("p",{className:"settings-note",children:"Metadata lives under `.seele/knowledge/<id>/item.json`. Source copies, digest, skill, and fetch script stay in the same folder."}),u.jsx("div",{className:"settings-form-actions",children:u.jsx("button",{disabled:!e.name.trim(),type:"submit",children:"Save metadata"})})]}):null]}):u.jsxs("section",{className:"settings-empty-section",children:[u.jsx("h3",{children:"Workspace Knowledge"}),u.jsx("p",{children:"Knowledge belongs to a specific workspace because source copies, digests, skills, and fetch scripts live under that workspace's `.seele/knowledge` directory. Switch to Workspace scope to manage it."})]})}function SN(e){return e==="skill"?"Skill":e==="reference"?"Reference":"Source"}function jN(e){return e.split("_").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function CN(e){return e==="low-frequency-check"?"low-frequency check":"manual refresh"}function TN(e){return e==="ready"?"knowledge-status ready":e==="needs_credentials"||e==="invalid_credentials"||e==="needs_fetch_method"?"knowledge-status warning":e==="stale_signal"?"knowledge-status stale":"knowledge-status"}function Ct({label:e,value:t,mono:n=!1}){return u.jsxs("div",{className:"context-field",children:[u.jsx("span",{children:e}),u.jsx("strong",{className:n?"mono":void 0,title:t,children:t})]})}function AN({onRefresh:e,preview:t,refreshing:n}){const a=["workspace_identity","workspace_environment","rendering"],l=D.useMemo(()=>Object.entries(t.context).map(([c,f])=>[c,EN(f)]).sort(([c],[f])=>{const h=a.indexOf(c),m=a.indexOf(f);return h>=0||m>=0?(h>=0?h:Number.MAX_SAFE_INTEGER)-(m>=0?m:Number.MAX_SAFE_INTEGER):c.localeCompare(f)}),[t.context]),o=c=>{var f;(f=document.getElementById(Q3(c)))==null||f.scrollIntoView({behavior:"smooth",block:"start"})};return u.jsxs("div",{className:"additional-context-preview",children:[u.jsx("div",{className:"additional-context-header",children:u.jsxs("div",{className:"additional-context-meta",children:[u.jsxs("span",{children:["Generated ",ct(t.generatedAt)]}),u.jsxs("span",{children:[jr(l.length)," keys"]}),u.jsx("button",{disabled:n,onClick:e,type:"button",children:n?"Rendering...":"Refresh"})]})}),u.jsxs("div",{className:"additional-context-toc",children:[u.jsx("button",{"aria-label":"Additional context outline",type:"button",children:"☰"}),u.jsx("div",{className:"additional-context-toc-menu",children:l.map(([c])=>u.jsx("button",{onClick:()=>o(c),type:"button",children:c},c))})]}),u.jsx("div",{className:"additional-context-list",children:l.map(([c,f])=>u.jsxs("section",{className:"additional-context-item",id:Q3(c),children:[u.jsxs("header",{children:[u.jsxs("code",{children:["<",c,">"]}),u.jsxs("span",{children:[jr(f.length)," chars"]})]}),u.jsx("pre",{children:f})]},c))})]})}function Q3(e){return`additional-context-${e.replace(/[^a-zA-Z0-9_-]/g,"-")}`}function EN(e){if(typeof e=="string")return e;if(e!==null&&typeof e=="object"&&"value"in e&&typeof e.value=="string")return e.value;if(e==null)return"";try{return JSON.stringify(e,null,2)}catch{return String(e)}}function NN({summary:e}){return u.jsxs("div",{className:"thread-read-summary",children:[u.jsxs("section",{className:"thread-read-summary-grid",children:[u.jsx(Ct,{label:"Thread",value:e.id,mono:!0}),u.jsx(Ct,{label:"Session",value:e.sessionId,mono:!0}),u.jsx(Ct,{label:"Status",value:e.status}),u.jsx(Ct,{label:"Source",value:e.source}),u.jsx(Ct,{label:"Created",value:Nc(e.createdAt)}),u.jsx(Ct,{label:"Updated",value:Nc(e.updatedAt)}),u.jsx(Ct,{label:"Recency",value:Nc(e.recencyAt)}),u.jsx(Ct,{label:"Turns",value:jr(e.turnCount),mono:!0}),u.jsx(Ct,{label:"Items",value:jr(e.itemCount),mono:!0}),u.jsx(Ct,{label:"User / agent",value:`${jr(e.userMessageCount)} / ${jr(e.agentMessageCount)}`,mono:!0}),u.jsx(Ct,{label:"Compactions",value:`${jr(e.compactionCount)} / ${jr(e.contextCompactionCount)} context`,mono:!0}),u.jsx(Ct,{label:"CWD",value:e.cwd,mono:!0}),u.jsx(Ct,{label:"Path",value:e.path,mono:!0})]}),e.preview?u.jsxs("details",{className:"thread-read-preview",children:[u.jsx("summary",{children:"Preview"}),u.jsx("p",{children:e.preview})]}):null,u.jsxs("section",{className:"thread-read-turns",children:[u.jsxs("div",{children:[u.jsx("strong",{children:"Turns"}),u.jsxs("span",{children:[e.turns.length," turn",e.turns.length===1?"":"s"]})]}),u.jsx("div",{className:"thread-read-turn-list",children:e.turns.map((t,n)=>u.jsxs("details",{className:"thread-read-turn",children:[u.jsxs("summary",{children:[u.jsxs("code",{children:["turn ",n+1]}),u.jsx("span",{title:t.id,children:t.id}),u.jsxs("small",{children:[t.status," · ",t.itemCount," item",t.itemCount===1?"":"s"]})]}),u.jsxs("div",{className:"thread-read-turn-detail",children:[u.jsxs("div",{className:"thread-read-turn-fields",children:[u.jsx(Ct,{label:"Status",value:t.status}),u.jsx(Ct,{label:"Items view",value:t.itemsView}),u.jsx(Ct,{label:"Started",value:Nc(t.startedAt)}),u.jsx(Ct,{label:"Completed",value:Nc(t.completedAt)}),u.jsx(Ct,{label:"Duration",value:t.durationMs===null?"unknown":tu(t.durationMs)}),u.jsx(Ct,{label:"Item types",value:t.itemTypes||"none"})]}),t.preview?u.jsx("p",{className:"thread-read-turn-preview",children:t.preview}):null,u.jsxs("details",{className:"thread-read-turn-raw",children:[u.jsx("summary",{children:"Turn raw JSON"}),u.jsx("pre",{children:JSON.stringify(t.raw,null,2)})]})]})]},t.id))})]})]})}function Po(e,t,n,a,l,o,c,f,h){var m,g,v,k;if(e.type==="reasoning")return u.jsx(RA,{content:e.content,streaming:e.streaming});if(e.type==="assistantText")return u.jsx("article",{className:`message assistant${e.streaming?" streaming":""}`,"data-hover-time":ct(e.createdAt),children:u.jsxs("div",{className:"message-main",children:[u.jsxs("header",{className:"message-header",children:[u.jsx("span",{children:"Seele"}),u.jsx("time",{dateTime:e.createdAt,children:e.streaming?"streaming":ct(e.createdAt)})]}),u.jsx("div",{className:"message-body",children:u.jsx(Go,{content:e.content,conversation:t,streaming:e.streaming,onPreviewArtifact:n,onCopyArtifactUrl:a,copiedArtifactUrl:l})})]})});if(e.type==="turnError")return u.jsxs("article",{className:"turn-error-result","data-hover-time":ct(e.createdAt),role:"alert",children:[u.jsx("strong",{children:"Task failed"}),u.jsx(c5,{content:e.content})]});if(e.type==="message")return u.jsx("article",{className:`message ${e.message.role}`,"data-hover-time":ct(e.message.createdAt),children:u.jsxs("div",{className:"message-main",children:[u.jsxs("header",{className:"message-header",children:[u.jsx("span",{children:RD(e.message.role)}),u.jsx("time",{dateTime:e.message.createdAt,children:ct(e.message.createdAt)})]}),u.jsx("div",{className:"message-body",children:e.message.role==="user"?u.jsx(c5,{content:e.message.content}):u.jsx(Go,{content:e.message.content,conversation:t,streaming:!1,onPreviewArtifact:n,onCopyArtifactUrl:a,copiedArtifactUrl:l})})]})});if(e.type==="system"){if((m=e.topicMessages)!=null&&m.length)return u.jsx("div",{className:"topic-input-list",children:e.topicMessages.map(T=>u.jsx("article",{className:"message topic-input","data-hover-time":ct(T.createdAt),children:u.jsxs("div",{className:"topic-message-bubble topic-input-bubble",children:[u.jsxs("header",{className:"topic-input-header",children:[u.jsxs("span",{className:"topic-input-sender",children:["From ",T.senderName]}),u.jsx("time",{dateTime:T.createdAt,children:ct(T.createdAt)})]}),u.jsx("div",{className:"topic-input-content message-body",children:u.jsx(Go,{content:T.contentMarkdown,conversation:t,streaming:!1,onPreviewArtifact:n,onCopyArtifactUrl:a,copiedArtifactUrl:l})})]})},T.id))});const b=Ds({},[e.detail]);return u.jsx("article",{className:"message system","data-hover-time":ct(e.createdAt),children:u.jsx("div",{className:"message-main",children:u.jsxs("button",{className:`system-message-body system-message-link${e.visualKind?` ${e.visualKind}`:""}`,onClick:()=>h==null?void 0:h(e),type:"button",children:[e.visualKind==="topic"?u.jsx("span",{className:"system-message-icon",children:u.jsx(Yd,{})}):null,u.jsx("span",{className:"system-message-title",children:e.title}),u.jsx("small",{children:b})]})})})}return e.type==="steerMarker"?u.jsxs("div",{className:"turn-steer-marker","data-message-id":e.messageId,title:e.content,children:[u.jsx("span",{children:"Added while running"}),u.jsx("strong",{children:e.content})]}):e.tool.kind==="command"?u.jsx(HN,{tool:e.tool,onRespondApproval:o}):e.tool.kind==="file"&&((g=e.tool.fileChanges)!=null&&g.length)?u.jsx(qN,{conversation:t,tool:e.tool}):e.tool.kind==="responsibility"||e.tool.kind==="workspaceChange"?u.jsx(LN,{conversation:t,tool:e.tool,onRespond:c}):e.tool.kind==="knowledge"?u.jsx(BN,{tool:e.tool,onRespond:f}):e.tool.kind==="collaboration"&&e.tool.topicAction==="send"?u.jsxs("details",{className:"tool-card collaboration topic-output","data-hover-time":ct(e.tool.createdAt),title:ct(e.tool.createdAt),children:[u.jsxs("summary",{children:[u.jsxs("span",{className:"tool-card-summary-title",children:[u.jsx("span",{className:"tool-card-kind-icon",children:u.jsx(Yd,{})}),u.jsx("span",{children:e.tool.title})]}),e.tool.meta?u.jsx("small",{children:e.tool.meta}):null]}),u.jsxs("div",{className:"topic-message-bubble topic-output-bubble",children:[u.jsxs("header",{className:"topic-input-header",children:[u.jsxs("span",{className:"topic-input-sender",children:["To ",e.tool.topicRecipientLabel??"Topic"]}),u.jsx("time",{dateTime:e.tool.createdAt,children:ct(e.tool.createdAt)})]}),u.jsx("div",{className:"topic-input-content message-body",children:u.jsx(Go,{content:e.tool.topicMessageContent??e.tool.output??"",conversation:t,streaming:!1,onPreviewArtifact:n,onCopyArtifactUrl:a,copiedArtifactUrl:l})})]}),(v=e.tool.rawEvents)!=null&&v.length?u.jsxs("details",{className:"tool-raw-details",children:[u.jsx("summary",{children:"Raw events"}),u.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(e.tool.rawEvents,null,2)})]}):null]}):u.jsxs("details",{className:`tool-card ${e.tool.kind}`,"data-hover-time":ct(e.tool.createdAt),title:ct(e.tool.createdAt),children:[u.jsxs("summary",{children:[u.jsxs("span",{className:"tool-card-summary-title",children:[e.tool.kind==="collaboration"?u.jsx("span",{className:"tool-card-kind-icon",children:u.jsx(Yd,{})}):null,u.jsx("span",{children:e.tool.title})]}),e.tool.meta?u.jsx("small",{children:e.tool.meta}):null]}),u.jsx("code",{children:e.tool.body}),e.tool.output?u.jsx("pre",{children:e.tool.output}):null,(k=e.tool.rawEvents)!=null&&k.length?u.jsxs("details",{className:"tool-raw-details",children:[u.jsx("summary",{children:"Raw events"}),u.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(e.tool.rawEvents,null,2)})]}):null]})}function J3(e){return e.type==="message"||e.type==="turnError"||e.type==="assistantText"&&e.pinnedToResult||e.type==="assistantText"&&e.phase==="final_answer"||e.type==="tool"&&MN(e.tool)}function MN(e){return e.kind==="responsibility"||e.kind==="workspaceChange"&&!!(e.workspaceChangeProposalId??e.responsibilityProposalId)||e.kind==="knowledge"||e.kind==="collaboration"&&e.topicAction==="send"||e.meta==="approval"}function zN(e){const t=[],n=[];for(const a of e)a.type==="tool"&&(a.tool.kind==="collaboration"&&a.tool.topicAction==="send"||a.tool.kind==="workspaceChange"||a.tool.kind==="responsibility")?n.push(a):t.push(a);return[...t,...n]}function px({group:e,conversation:t,allowProcessView:n=!0,copiedFooter:a,copiedArtifactUrl:l,running:o,onCopyArtifactUrl:c,onCopyBubble:f,onLoadProcessDetails:h,onPreviewArtifact:m,onRespondApproval:g,onRespondWorkspaceChangeProposal:v,onRespondKnowledgeProposal:k,onOpenSystemEvent:b}){const T=zN(e.agentItems.filter(J3)),A=e.agentItems.some(F=>!J3(F)),q=n&&(A||e.turnIds.length>0),z=o?"process":"result",[M,B]=D.useState(z),[U,ae]=D.useState(!1),L=M==="result"?T:e.agentItems,K=PN(L);D.useEffect(()=>{U||B(z)},[z,U]);const ie=o||q||e.stopped,Q=u.jsxs(u.Fragment,{children:[ie?u.jsx("div",{className:"turn-panel-controls",children:o?u.jsx("span",{"aria-label":"Agent run in progress",className:"turn-view-spinner",title:"Agent run in progress"}):q?u.jsx("button",{"aria-label":M==="result"?"Show process":"Show result",className:"turn-view-toggle",title:M==="result"?"Show process":"Show result",type:"button",onClick:()=>{ae(!0),B(F=>F==="result"?(h(e.turnIds),"process"):"result")},children:M==="result"?u.jsx(DN,{}):u.jsx(RN,{})}):null}):null,L.map(F=>u.jsx(D.Fragment,{children:Po(F,t,m,c,l,g,v,k,b)},F.id)),M==="result"&&L.length===0?u.jsx("div",{className:"turn-result-empty",children:e.stopped?"Run stopped by user":A?"No reliable final answer captured":"No result yet"}):null,u.jsx(Dc,{copied:a,content:K,id:`agent-${e.id}-bottom`,notice:e.notificationFailure,timestamp:GN(L),variant:"outside",onCopy:f})]});return e.stopped?u.jsxs("details",{className:"turn-panel agent-turn stopped","data-collapsed":"true",children:[u.jsxs("summary",{children:[u.jsx("span",{className:"turn-stopped-badge",children:"Stopped"}),u.jsx("span",{children:"Run stopped by user"})]}),u.jsx("div",{className:ie?"stopped-turn-body has-controls":"stopped-turn-body",children:Q})]}):u.jsx("div",{className:["turn-panel","agent-turn",e.stopped?"stopped":"",ie?"has-controls":""].filter(Boolean).join(" "),children:Q})}function DN(){return u.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:u.jsx("path",{d:"M8 7h8M6 12h12M8 17h8",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})})}function RN(){return u.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:u.jsx("path",{d:"m7 12 3 3 7-7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})})}function ON(){return u.jsx("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:u.jsx("rect",{fill:"currentColor",height:"12",rx:"2.6",width:"12",x:"6",y:"6"})})}function IN(){return u.jsx("svg",{"aria-hidden":"true",fill:"none",height:"16",viewBox:"0 0 24 24",width:"16",children:u.jsx("path",{d:"M12 19V5m-5 5 5-5 5 5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.1"})})}function _N({className:e="",description:t,icon:n,onClick:a,timestamp:l,title:o,trailing:c,visibleTitle:f}){return u.jsxs("button",{className:`tool-card file compact-timeline-link ${e}`.trim(),"data-hover-time":ct(l),onClick:a,title:o,type:"button",children:[u.jsx("span",{className:"compact-timeline-link-icon",children:n}),u.jsxs("span",{className:"compact-timeline-link-copy",children:[u.jsx("strong",{children:f}),u.jsx("small",{children:t})]}),c?u.jsx("span",{className:"compact-timeline-link-trailing",children:c}):null]})}function LN({conversation:e,tool:t,onRespond:n}){var q;const a=We((q=t.workspaceChangePayload)==null?void 0:q.content)||t.body,[l,o]=D.useState(a),[c,f]=D.useState(null),[h,m]=D.useState("source"),[g,v]=D.useState(!1),k=!!(t.workspaceChangeProposalId??t.responsibilityProposalId),b=t.meta==="saved"||t.meta==="declined"?t.meta:k?"pending":"preparing",T=b==="pending";D.useEffect(()=>{o(a)},[a]);async function A(z){f(z);try{await n(t,z,z==="accept"?{content:l}:void 0)&&v(!1)}finally{f(null)}}return u.jsxs(u.Fragment,{children:[u.jsx(_N,{className:"responsibility-request-link",description:"Workspace responsibility",icon:u.jsx(Rf,{}),onClick:()=>v(!0),timestamp:t.createdAt,title:"View workspace change request",trailing:u.jsx("span",{className:`responsibility-request-status ${b}`,children:b}),visibleTitle:t.title}),g?u.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>!c&&v(!1),children:u.jsxs("section",{"aria-labelledby":`responsibility-proposal-${t.id}`,"aria-modal":"true",className:"dialog-card responsibility-proposal-dialog",onMouseDown:z=>z.stopPropagation(),role:"dialog",children:[u.jsxs("header",{children:[u.jsxs("div",{children:[u.jsx("h2",{id:`responsibility-proposal-${t.id}`,children:t.title}),u.jsxs("p",{children:["Workspace change · ",ct(t.createdAt)]})]}),u.jsx("button",{"aria-label":"Close",className:"icon-button",disabled:!!c,onClick:()=>v(!1),type:"button",children:"×"})]}),u.jsxs("div",{className:"responsibility-proposal-dialog-body",children:[u.jsxs("div",{className:"responsibility-proposal-header",children:[u.jsxs("div",{children:[u.jsx("strong",{children:"Proposed responsibility"}),u.jsx("p",{children:k?"Review or edit the Markdown before applying it to future turns.":"The proposal becomes actionable after the current turn completes."})]}),u.jsx("span",{children:b})]}),t.responsibilityReason?u.jsx("p",{className:"responsibility-proposal-reason",children:t.responsibilityReason}):null,T?u.jsxs("div",{className:"responsibility-proposal-editor",children:[u.jsxs("div",{className:"responsibility-proposal-tabs",role:"tablist",children:[u.jsx("button",{"aria-selected":h==="source",className:h==="source"?"active":"",role:"tab",type:"button",onClick:()=>m("source"),children:"Source"}),u.jsx("button",{"aria-selected":h==="preview",className:h==="preview"?"active":"",role:"tab",type:"button",onClick:()=>m("preview"),children:"Preview"})]}),h==="source"?u.jsx("textarea",{"aria-label":"Proposed workspace responsibility",className:"responsibility-proposal-body",disabled:!!c,onChange:z=>o(z.target.value),rows:12,value:l}):u.jsx("div",{className:"message-body responsibility-markdown-preview",children:Os(l,e)})]}):u.jsx("div",{className:"message-body responsibility-markdown-preview saved",children:Os(l,e)})]}),u.jsx("footer",{className:"responsibility-proposal-dialog-actions",children:T?u.jsxs(u.Fragment,{children:[u.jsx("button",{className:"secondary reject",disabled:!!c,type:"button",onClick:()=>void A("decline"),children:c==="decline"?"Rejecting...":"Reject"}),u.jsx("button",{className:"approve",disabled:!!c,type:"button",onClick:()=>void A("accept"),children:c==="accept"?"Saving...":"Save"})]}):u.jsx("button",{className:"secondary",onClick:()=>v(!1),type:"button",children:"Close"})})]})}):null]})}function BN({tool:e,onRespond:t}){const[n,a]=D.useState(e.body),[l,o]=D.useState(null),[c,f]=D.useState("source"),h=e.meta==="saved"||e.meta==="declined"?e.meta:"pending",m=h==="pending",g=e5(n);return D.useEffect(()=>{a(e.body)},[e.body]),u.jsxs("article",{className:"tool-card responsibility knowledge-proposal","data-hover-time":ct(e.createdAt),title:ct(e.createdAt),children:[u.jsxs("div",{className:"responsibility-proposal-header",children:[u.jsxs("div",{children:[u.jsx("strong",{children:e.title}),u.jsx("p",{children:"Long-term knowledge changes require approval. Keep one item as a reusable source or skill, not a tiny note."})]}),u.jsx("span",{children:h})]}),m?u.jsxs("div",{className:"responsibility-proposal-editor",children:[u.jsxs("div",{className:"responsibility-proposal-tabs",role:"tablist",children:[u.jsx("button",{"aria-selected":c==="source",className:c==="source"?"active":"",role:"tab",type:"button",onClick:()=>f("source"),children:"JSON"}),u.jsx("button",{"aria-selected":c==="preview",className:c==="preview"?"active":"",role:"tab",type:"button",onClick:()=>f("preview"),children:"Preview"})]}),c==="source"?u.jsx("textarea",{"aria-label":"Proposed workspace knowledge",className:"responsibility-proposal-body",disabled:!!l,onChange:v=>a(v.target.value),rows:10,value:n}):g?u.jsx(t5,{value:g}):u.jsx("div",{className:"knowledge-proposal-invalid",children:"Invalid JSON. Fix the proposal before saving."})]}):g?u.jsx(t5,{value:g,saved:!0}):u.jsx("pre",{className:"knowledge-proposal-raw",children:n}),m?u.jsxs("div",{className:"tool-approval-actions responsibility-actions",children:[u.jsx("button",{className:"approve",disabled:!!l,type:"button",onClick:()=>{e5(n)&&(o("accept"),Promise.resolve(t(e,"accept",n)).finally(()=>o(null)))},children:l==="accept"?"Saving...":"Save"}),u.jsx("button",{className:"reject",disabled:!!l,type:"button",onClick:()=>{o("decline"),Promise.resolve(t(e,"decline",n)).finally(()=>o(null))},children:l==="decline"?"Rejecting...":"Reject"})]}):null]})}function e5(e){try{const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?null:t}catch{return null}}function cp(e){return typeof e=="string"&&e.trim()?e.trim():typeof e=="number"||typeof e=="boolean"?String(e):"-"}function t5({value:e,saved:t}){return u.jsx("div",{className:`knowledge-proposal-preview${t?" saved":""}`,children:u.jsxs("dl",{children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Name"}),u.jsx("dd",{children:cp(e.name)})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Purpose"}),u.jsx("dd",{children:cp(e.purpose)})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Content"}),u.jsx("dd",{children:cp(e.content??e.description)})]})]})})}function qN({conversation:e,tool:t}){var c;const n=t.fileChanges??[],a=e==null?void 0:e.workspacePath,l=ZA(n),o=t.meta==="started"||t.meta==="running";return u.jsxs("details",{className:`tool-card file${o?" running":" done"}`,"data-hover-time":ct(t.createdAt),title:ct(t.createdAt),children:[u.jsxs("summary",{children:[u.jsxs("span",{className:"tool-card-summary-title",children:[u.jsx("span",{className:"file-change-indicator","aria-hidden":"true"}),u.jsx("span",{className:"file-change-title",children:XA(n,a)})]}),u.jsx(n5,{additions:l.additions,deletions:l.deletions,running:o})]}),u.jsx("div",{className:"file-change-list",children:n.map((f,h)=>u.jsxs("div",{className:"file-change-row",children:[u.jsx("span",{className:"file-change-kind",children:UN(f.kind)}),u.jsx("code",{title:f.path,children:J6(f.path,a)}),u.jsx(n5,{additions:f.additions,deletions:f.deletions})]},`${f.path}:${h}`))}),(c=t.rawEvents)!=null&&c.length?u.jsxs("details",{className:"tool-raw-details",children:[u.jsx("summary",{children:"Raw events"}),u.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(t.rawEvents,null,2)})]}):null]})}function n5({additions:e,deletions:t,running:n=!1}){return u.jsxs("span",{className:"file-change-stats",children:[n?u.jsx("small",{children:"editing"}):null,e>0?u.jsxs("span",{className:"file-change-additions",children:["+",e]}):null,t>0?u.jsxs("span",{className:"file-change-deletions",children:["-",t]}):null]})}function UN(e){switch(e){case"add":return"A";case"delete":return"D";case"move":return"R";default:return"M"}}function HN({tool:e,onRespondApproval:t}){var k;const n=lD(e),[a,l]=D.useState(!1),[o,c]=D.useState("script"),f=n==="approval"&&e.approvalRequestId!==void 0&&!!e.approvalTurnId,h=df(e.body)?null:e.body,m=h?dD(h):null,g=m?`${$N(n)} · ${m}`:n==="running"?"Running script":n==="approval"?"Waiting for approval":"Command",v=sD(e,n);return u.jsxs("article",{className:`tool-card command ${n}`,"data-hover-time":ct(e.createdAt),title:ct(e.createdAt),children:[u.jsxs("div",{className:"tool-command-bar",children:[u.jsxs("button",{"aria-expanded":a,className:"tool-command-toggle",type:"button",onClick:()=>l(b=>!b),children:[u.jsx("span",{className:"tool-command-indicator","aria-hidden":"true"}),u.jsx("span",{children:g}),u.jsx("small",{className:"tool-command-badge",children:v})]}),a?u.jsxs("div",{className:"tool-command-tabs",role:"tablist","aria-label":"Command details",children:[u.jsx("button",{"aria-selected":o==="script",role:"tab",type:"button",onClick:()=>c("script"),children:"Script"}),u.jsx("button",{"aria-selected":o==="result",role:"tab",type:"button",onClick:()=>c("result"),children:"Result"}),(k=e.rawEvents)!=null&&k.length?u.jsx("button",{"aria-selected":o==="raw",role:"tab",type:"button",onClick:()=>c("raw"),children:"Raw"}):null]}):null,f?u.jsxs("div",{className:"tool-approval-actions",children:[u.jsx("button",{className:"approve",type:"button",onClick:()=>t(e,"accept"),children:"Approve"}),u.jsx("button",{className:"reject",type:"button",onClick:()=>t(e,"decline"),children:"Reject"})]}):null]}),a?o==="script"?u.jsx("div",{className:"tool-tab-panel",role:"tabpanel",children:h?u.jsx(r5,{content:h}):u.jsx("p",{className:"tool-output-pending",children:"Script unavailable"})}):o==="result"?u.jsxs("div",{className:"tool-tab-panel result",role:"tabpanel",children:[u.jsx("p",{className:"tool-command-result-meta",children:oD(e,n)}),e.output?u.jsx(r5,{content:e.output}):u.jsx("p",{className:"tool-output-pending",children:n==="running"?"Waiting for output...":n==="approval"?"Waiting for approval before running.":e.meta??"No output"})]}):u.jsx(FN,{events:e.rawEvents??[]}):null]})}function $N(e){return e==="running"?"Running":e==="approval"?"Approval required":"Command"}function r5({content:e}){const[t,n]=D.useState(!1),a=cD(e,W3);return u.jsxs("div",{className:"tool-content-block",children:[u.jsx("pre",{className:"tool-content-code",children:t?e:uD(e,W3)}),a?u.jsx("button",{className:"tool-content-toggle",type:"button",onClick:()=>n(l=>!l),children:t?"Collapse":"Show all"}):null]})}function FN({events:e}){return u.jsx("div",{className:"tool-tab-panel raw",role:"tabpanel",children:u.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(e,null,2)})})}function Dc({copied:e,content:t,id:n,notice:a,timestamp:l,variant:o,onCopy:c}){return t.trim()?u.jsxs("footer",{className:`turn-panel-footer ${o}${a?" has-notice":""}`,children:[a?u.jsx("span",{"aria-label":`Notification failed: ${a}`,className:"turn-panel-footer-notice",role:"img",title:a,children:u.jsx(zx,{})}):null,u.jsx("time",{dateTime:l,children:ct(l)}),u.jsx("button",{"aria-label":e?"Copied markdown":"Copy markdown",onClick:()=>c(n,t),title:e?"Copied":"Copy",type:"button",children:e?u.jsx("span",{"aria-hidden":"true",children:"Copied"}):u.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"12",viewBox:"0 0 24 24",width:"12",children:[u.jsx("rect",{height:"14",rx:"2",stroke:"currentColor",strokeWidth:"2",width:"14",x:"8",y:"8"}),u.jsx("path",{d:"M4 16V6a2 2 0 0 1 2-2h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})})]}):null}function Rc(e){return e.type==="message"?e.message.role==="user"?e.message.content:Kc(e.message.content):e.type==="assistantText"?Kc(e.content):e.type==="turnError"?`Task failed
|
|
369
|
+
`,u.jsx("span",{className:"memory-tag",children:`</${a.key}>`})]})},a.key))}):u.jsx("p",{className:"settings-note",children:e})}function wN({deleteConfirmKey:e,editingEnvironmentKey:t,environmentDraft:n,globalEnvironment:a,scope:l,workspaceEnvironment:o,valueVisible:c,onCancelEnvironmentEdit:f,onDeleteConfirmChange:h,onDeleteEnvironment:m,onDraftChange:g,onEditEnvironment:v,onRevealEnvironmentValue:k,onSubmitEnvironment:b,onValueVisibleChange:T,revealedEnvironmentKeys:A}){const q=t!==null&&A.has(t),z=l==="workspace",M=z?o:a,[B,U]=D.useState(!1);function ne(){f(),g({description:"",key:"",value:""}),T(!1),U(!0)}function L(Q){v(Q),T(!1),U(!0)}function K(){U(!1),f(),T(!1)}function ie(Q){b(Q),U(!1)}return u.jsxs(u.Fragment,{children:[u.jsx("header",{className:"settings-section-header",children:u.jsxs("div",{children:[u.jsx("h3",{children:z?"Workspace Environment":"Base Environment"}),u.jsx("p",{children:z?"Workspace variables are stored in this workspace and are merged with base variables for new runs.":"Base variables are injected into every new workspace run. Existing runs keep the environment they started with."})]})}),z?u.jsxs("section",{className:"settings-readonly-block",children:[u.jsxs("div",{children:[u.jsx("strong",{children:"Base Environment"}),u.jsx("span",{children:"Read-only in workspace scope"})]}),u.jsx(Z3,{emptyText:"No base environment variables are configured.",readonly:!0,variables:a})]}):null,u.jsxs("section",{className:"environment-manager",children:[u.jsx("div",{className:"memory-items-editor-header actions-only",children:u.jsx("button",{"aria-label":"Add environment variable",className:"memory-icon-button",title:"Add",type:"button",onClick:ne,children:"+"})}),u.jsx(Z3,{emptyText:z?"No workspace environment variables are configured.":"No base environment variables are configured.",onDelete:Q=>h(Q),onEdit:L,variables:M})]}),B?u.jsx("div",{className:"memory-editor-overlay",onClick:K,role:"presentation",children:u.jsxs("form",{"aria-label":t?"Edit environment variable":"Add environment variable",className:"memory-editor-popover environment-editor-popover",onClick:Q=>Q.stopPropagation(),onSubmit:ie,children:[u.jsxs("header",{children:[u.jsx("strong",{children:t?"Edit Environment":"Add Environment"}),u.jsx("button",{"aria-label":"Close environment editor",className:"memory-icon-button",title:"Close",type:"button",onClick:K,children:"×"})]}),u.jsxs("label",{children:[u.jsx("span",{children:"Key"}),u.jsx("input",{"aria-label":"Environment variable key",autoComplete:"off",autoFocus:!0,disabled:t!==null,onChange:Q=>g({...n,key:Q.target.value}),placeholder:"Environment variable name",spellCheck:!1,value:n.key})]}),u.jsxs("label",{children:[u.jsx("span",{children:"Value"}),u.jsxs("span",{className:"environment-value-field",children:[u.jsx("input",{"aria-label":"Environment variable value",autoComplete:"off",onChange:Q=>g({...n,value:Q.target.value}),placeholder:"Environment variable value",spellCheck:!1,type:c?"text":"password",value:n.value}),u.jsx("button",{"aria-label":c?"Hide value":"Show value",onClick:()=>{if(t&&!q&&!n.value){k(t),T(!0);return}T(!c)},title:c?"Hide value":"Show value",type:"button",children:c?u.jsx(GM,{}):u.jsx(PM,{})})]})]}),u.jsxs("label",{children:[u.jsx("span",{children:"Description"}),u.jsx("input",{"aria-label":"Environment variable description",autoComplete:"off",onChange:Q=>g({...n,description:Q.target.value}),placeholder:"What this variable is for",spellCheck:!1,value:n.description})]}),u.jsxs("div",{className:"memory-editor-actions",children:[u.jsx("button",{className:"memory-dialog-button",type:"button",onClick:K,children:"Cancel"}),u.jsx("button",{className:"memory-dialog-button primary",disabled:!n.key.trim(),type:"submit",children:"Save"})]})]})}):null,e?u.jsx("div",{className:"memory-editor-overlay",onClick:()=>h(null),role:"presentation",children:u.jsxs("section",{"aria-label":"Confirm delete environment variable",className:"memory-delete-dialog",onClick:Q=>Q.stopPropagation(),children:[u.jsxs("header",{children:[u.jsx("strong",{children:"Delete Environment"}),u.jsx("button",{"aria-label":"Close delete confirmation",className:"memory-icon-button",title:"Close",type:"button",onClick:()=>h(null),children:"×"})]}),u.jsxs("p",{children:["Delete ",u.jsx("code",{children:e}),"?"]}),u.jsxs("div",{className:"memory-delete-actions",children:[u.jsx("button",{className:"memory-dialog-button",type:"button",onClick:()=>h(null),children:"Cancel"}),u.jsx("button",{className:"memory-dialog-button danger",type:"button",onClick:()=>{m(e),h(null)},children:"Delete"})]})]})}):null]})}function Z3({emptyText:e,onDelete:t,onEdit:n,readonly:a=!1,variables:l}){return l.length===0?u.jsx("p",{className:"settings-note",children:e}):u.jsx("div",{className:a?"environment-list readonly":"environment-list",children:l.map(o=>u.jsxs("div",{className:a?"environment-row readonly":"environment-row",children:[u.jsxs("div",{className:"environment-row-main",children:[u.jsxs("pre",{"aria-label":`Environment variable ${o.key}`,children:[u.jsx("span",{className:"memory-tag",children:o.key}),"=",o.hasValue?"••••••":"",o.description?u.jsx("span",{className:"environment-comment",children:` # ${o.description}`}):null]}),u.jsxs("span",{children:[o.hasValue?"configured":"empty"," · updated"," ",ct(o.updatedAt)]})]}),a?u.jsx("span",{className:"environment-readonly-tag",children:"read-only"}):u.jsxs("div",{className:"environment-row-actions",children:[u.jsx("button",{"aria-label":`Edit ${o.key}`,className:"memory-icon-button memory-item-edit",onClick:()=>n==null?void 0:n(o),title:"Edit",type:"button",children:"✎"}),u.jsx("button",{"aria-label":`Delete ${o.key}`,className:"memory-icon-button memory-item-delete",onClick:()=>t==null?void 0:t(o.key),title:"Delete",type:"button",children:"×"})]})]},o.key))})}function mx({items:e,onDelete:t,onEdit:n}){const[a,l]=D.useState(null),[o,c]=D.useState(null);return e.length===0?u.jsxs("section",{className:"knowledge-empty",children:[u.jsx("h4",{children:"No knowledge registered"}),u.jsx("p",{children:"Give this workspace durable source material in chat. The workspace should decide whether to register it, create local copies, and produce digest or skill files."})]}):u.jsx("div",{className:"knowledge-list",children:e.map(f=>u.jsxs("article",{className:"knowledge-row",children:[u.jsxs("div",{className:"knowledge-row-main",children:[u.jsxs("header",{children:[u.jsx("strong",{children:f.name}),u.jsx("span",{children:SN(f.kind)}),u.jsx("span",{className:TN(f.status),children:jN(f.status)})]}),u.jsx("p",{children:f.purpose||f.description||"No purpose set."}),u.jsxs("div",{className:"knowledge-paths",children:[u.jsx("code",{children:f.digestPath}),u.jsx("code",{children:f.skillPath}),u.jsx("code",{children:f.fetch.scriptPath})]}),f.fetch.requiredEnv.length>0?u.jsx("div",{className:"knowledge-envs",children:f.fetch.requiredEnv.map(h=>u.jsx("span",{title:h.description||h.key,children:h.key},h.key))}):null,o===f.id?u.jsx("small",{className:"knowledge-row-notice",children:"Refresh/check is not automatic yet. Ask this workspace to review or refresh this knowledge source."}):null,u.jsxs("small",{children:[f.attention," · ",CN(f.refreshPolicy)," · updated ",ct(f.updatedAt)]})]}),u.jsx("div",{className:"environment-row-actions",children:a===f.id?u.jsxs(u.Fragment,{children:[u.jsx("button",{className:"danger",onClick:()=>{t(f.id),l(null)},type:"button",children:"Delete"}),u.jsx("button",{onClick:()=>l(null),type:"button",children:"Cancel"})]}):u.jsxs(u.Fragment,{children:[u.jsx("button",{"aria-label":`Check ${f.name}`,onClick:()=>c(f.id),title:"Check or refresh through workspace",type:"button",children:"↻"}),u.jsx("button",{"aria-label":`Edit ${f.name}`,onClick:()=>n(f),title:"Edit knowledge",type:"button",children:u.jsx(Rf,{})}),u.jsx("button",{"aria-label":`Delete ${f.name}`,onClick:()=>l(f.id),title:"Delete knowledge",type:"button",children:"×"})]})})]},f.id))})}function kN({draft:e,items:t,scope:n,workspaceName:a,onCancel:l,onDelete:o,onDraftChange:c,onEdit:f,onSubmit:h}){return n==="workspace"?u.jsxs(u.Fragment,{children:[u.jsx("header",{className:"settings-section-header",children:u.jsxs("div",{children:[u.jsx("h3",{children:"Workspace Knowledge"}),u.jsxs("p",{children:["Long-lived source-backed material for ",a??"this workspace",". The workspace should create and maintain these assets itself when it digests external material. You mainly review status, delete stale items, or trigger a future refresh/check."]})]})}),u.jsx(mx,{items:t,onDelete:o,onEdit:f}),e.id?u.jsxs("form",{className:"settings-form knowledge-form",onSubmit:h,children:[u.jsxs("div",{className:"knowledge-form-header",children:[u.jsxs("div",{children:[u.jsx("strong",{children:"Edit metadata"}),u.jsx("span",{children:"This is mainly for correction. New knowledge should usually be created by the workspace while processing source material."})]}),u.jsx("button",{className:"secondary",onClick:l,type:"button",children:"Close"})]}),u.jsxs("div",{className:"knowledge-form-grid",children:[u.jsxs("label",{children:[u.jsx("span",{children:"Name"}),u.jsx("input",{"aria-label":"Knowledge name",onChange:g=>c({...e,name:g.target.value}),value:e.name})]}),u.jsxs("label",{children:[u.jsx("span",{children:"Kind"}),u.jsxs("select",{"aria-label":"Knowledge kind",onChange:g=>c({...e,kind:g.target.value}),value:e.kind,children:[u.jsx("option",{value:"source",children:"Source"}),u.jsx("option",{value:"skill",children:"Skill"}),u.jsx("option",{value:"reference",children:"Reference"})]})]}),u.jsxs("label",{children:[u.jsx("span",{children:"Status"}),u.jsxs("select",{"aria-label":"Knowledge status",onChange:g=>c({...e,status:g.target.value}),value:e.status,children:[u.jsx("option",{value:"draft",children:"Draft"}),u.jsx("option",{value:"needs_fetch_method",children:"Needs fetch method"}),u.jsx("option",{value:"needs_credentials",children:"Needs credentials"}),u.jsx("option",{value:"invalid_credentials",children:"Invalid credentials"}),u.jsx("option",{value:"ready",children:"Ready"}),u.jsx("option",{value:"stale_signal",children:"Stale signal"})]})]}),u.jsxs("label",{children:[u.jsx("span",{children:"Attention"}),u.jsxs("select",{"aria-label":"Knowledge attention",onChange:g=>c({...e,attention:g.target.value}),value:e.attention,children:[u.jsx("option",{value:"none",children:"None"}),u.jsx("option",{value:"tracked",children:"Tracked"}),u.jsx("option",{value:"watch",children:"Watch"})]})]}),u.jsxs("label",{children:[u.jsx("span",{children:"Refresh"}),u.jsxs("select",{"aria-label":"Knowledge refresh policy",onChange:g=>c({...e,refreshPolicy:g.target.value}),value:e.refreshPolicy,children:[u.jsx("option",{value:"manual",children:"Manual"}),u.jsx("option",{value:"low-frequency-check",children:"Low-frequency check"})]})]})]}),u.jsxs("label",{className:"settings-wide-field",children:[u.jsx("span",{children:"Purpose"}),u.jsx("textarea",{"aria-label":"Knowledge purpose",onChange:g=>c({...e,purpose:g.target.value}),rows:2,value:e.purpose})]}),u.jsxs("label",{className:"settings-wide-field",children:[u.jsx("span",{children:"Content"}),u.jsx("textarea",{"aria-label":"Knowledge content",onChange:g=>c({...e,description:g.target.value}),rows:2,value:e.description})]}),u.jsxs("label",{className:"settings-wide-field",children:[u.jsx("span",{children:"Source clues"}),u.jsx("textarea",{"aria-label":"Knowledge source clues",onChange:g=>c({...e,sourceCluesText:g.target.value}),rows:4,value:e.sourceCluesText})]}),u.jsxs("label",{className:"settings-wide-field",children:[u.jsx("span",{children:"Required environment"}),u.jsx("textarea",{"aria-label":"Knowledge required environment",onChange:g=>c({...e,requiredEnvText:g.target.value}),rows:3,value:e.requiredEnvText})]}),u.jsx("p",{className:"settings-note",children:"Metadata lives under `.seele/knowledge/<id>/item.json`. Source copies, digest, skill, and fetch script stay in the same folder."}),u.jsx("div",{className:"settings-form-actions",children:u.jsx("button",{disabled:!e.name.trim(),type:"submit",children:"Save metadata"})})]}):null]}):u.jsxs("section",{className:"settings-empty-section",children:[u.jsx("h3",{children:"Workspace Knowledge"}),u.jsx("p",{children:"Knowledge belongs to a specific workspace because source copies, digests, skills, and fetch scripts live under that workspace's `.seele/knowledge` directory. Switch to Workspace scope to manage it."})]})}function SN(e){return e==="skill"?"Skill":e==="reference"?"Reference":"Source"}function jN(e){return e.split("_").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function CN(e){return e==="low-frequency-check"?"low-frequency check":"manual refresh"}function TN(e){return e==="ready"?"knowledge-status ready":e==="needs_credentials"||e==="invalid_credentials"||e==="needs_fetch_method"?"knowledge-status warning":e==="stale_signal"?"knowledge-status stale":"knowledge-status"}function Ct({label:e,value:t,mono:n=!1}){return u.jsxs("div",{className:"context-field",children:[u.jsx("span",{children:e}),u.jsx("strong",{className:n?"mono":void 0,title:t,children:t})]})}function AN({onRefresh:e,preview:t,refreshing:n}){const a=["workspace_identity","workspace_environment","rendering"],l=D.useMemo(()=>Object.entries(t.context).map(([c,f])=>[c,EN(f)]).sort(([c],[f])=>{const h=a.indexOf(c),m=a.indexOf(f);return h>=0||m>=0?(h>=0?h:Number.MAX_SAFE_INTEGER)-(m>=0?m:Number.MAX_SAFE_INTEGER):c.localeCompare(f)}),[t.context]),o=c=>{var f;(f=document.getElementById(Q3(c)))==null||f.scrollIntoView({behavior:"smooth",block:"start"})};return u.jsxs("div",{className:"additional-context-preview",children:[u.jsx("div",{className:"additional-context-header",children:u.jsxs("div",{className:"additional-context-meta",children:[u.jsxs("span",{children:["Generated ",ct(t.generatedAt)]}),u.jsxs("span",{children:[jr(l.length)," keys"]}),u.jsx("button",{disabled:n,onClick:e,type:"button",children:n?"Rendering...":"Refresh"})]})}),u.jsxs("div",{className:"additional-context-toc",children:[u.jsx("button",{"aria-label":"Additional context outline",type:"button",children:"☰"}),u.jsx("div",{className:"additional-context-toc-menu",children:l.map(([c])=>u.jsx("button",{onClick:()=>o(c),type:"button",children:c},c))})]}),u.jsx("div",{className:"additional-context-list",children:l.map(([c,f])=>u.jsxs("section",{className:"additional-context-item",id:Q3(c),children:[u.jsxs("header",{children:[u.jsxs("code",{children:["<",c,">"]}),u.jsxs("span",{children:[jr(f.length)," chars"]})]}),u.jsx("pre",{children:f})]},c))})]})}function Q3(e){return`additional-context-${e.replace(/[^a-zA-Z0-9_-]/g,"-")}`}function EN(e){if(typeof e=="string")return e;if(e!==null&&typeof e=="object"&&"value"in e&&typeof e.value=="string")return e.value;if(e==null)return"";try{return JSON.stringify(e,null,2)}catch{return String(e)}}function NN({summary:e}){return u.jsxs("div",{className:"thread-read-summary",children:[u.jsxs("section",{className:"thread-read-summary-grid",children:[u.jsx(Ct,{label:"Thread",value:e.id,mono:!0}),u.jsx(Ct,{label:"Session",value:e.sessionId,mono:!0}),u.jsx(Ct,{label:"Status",value:e.status}),u.jsx(Ct,{label:"Source",value:e.source}),u.jsx(Ct,{label:"Created",value:Nc(e.createdAt)}),u.jsx(Ct,{label:"Updated",value:Nc(e.updatedAt)}),u.jsx(Ct,{label:"Recency",value:Nc(e.recencyAt)}),u.jsx(Ct,{label:"Turns",value:jr(e.turnCount),mono:!0}),u.jsx(Ct,{label:"Items",value:jr(e.itemCount),mono:!0}),u.jsx(Ct,{label:"User / agent",value:`${jr(e.userMessageCount)} / ${jr(e.agentMessageCount)}`,mono:!0}),u.jsx(Ct,{label:"Compactions",value:`${jr(e.compactionCount)} / ${jr(e.contextCompactionCount)} context`,mono:!0}),u.jsx(Ct,{label:"CWD",value:e.cwd,mono:!0}),u.jsx(Ct,{label:"Path",value:e.path,mono:!0})]}),e.preview?u.jsxs("details",{className:"thread-read-preview",children:[u.jsx("summary",{children:"Preview"}),u.jsx("p",{children:e.preview})]}):null,u.jsxs("section",{className:"thread-read-turns",children:[u.jsxs("div",{children:[u.jsx("strong",{children:"Turns"}),u.jsxs("span",{children:[e.turns.length," turn",e.turns.length===1?"":"s"]})]}),u.jsx("div",{className:"thread-read-turn-list",children:e.turns.map((t,n)=>u.jsxs("details",{className:"thread-read-turn",children:[u.jsxs("summary",{children:[u.jsxs("code",{children:["turn ",n+1]}),u.jsx("span",{title:t.id,children:t.id}),u.jsxs("small",{children:[t.status," · ",t.itemCount," item",t.itemCount===1?"":"s"]})]}),u.jsxs("div",{className:"thread-read-turn-detail",children:[u.jsxs("div",{className:"thread-read-turn-fields",children:[u.jsx(Ct,{label:"Status",value:t.status}),u.jsx(Ct,{label:"Items view",value:t.itemsView}),u.jsx(Ct,{label:"Started",value:Nc(t.startedAt)}),u.jsx(Ct,{label:"Completed",value:Nc(t.completedAt)}),u.jsx(Ct,{label:"Duration",value:t.durationMs===null?"unknown":tu(t.durationMs)}),u.jsx(Ct,{label:"Item types",value:t.itemTypes||"none"})]}),t.preview?u.jsx("p",{className:"thread-read-turn-preview",children:t.preview}):null,u.jsxs("details",{className:"thread-read-turn-raw",children:[u.jsx("summary",{children:"Turn raw JSON"}),u.jsx("pre",{children:JSON.stringify(t.raw,null,2)})]})]})]},t.id))})]})]})}function Po(e,t,n,a,l,o,c,f,h){var m,g,v,k;if(e.type==="reasoning")return u.jsx(RA,{content:e.content,streaming:e.streaming});if(e.type==="assistantText")return u.jsx("article",{className:`message assistant${e.streaming?" streaming":""}`,"data-hover-time":ct(e.createdAt),children:u.jsxs("div",{className:"message-main",children:[u.jsxs("header",{className:"message-header",children:[u.jsx("span",{children:"Seele"}),u.jsx("time",{dateTime:e.createdAt,children:e.streaming?"streaming":ct(e.createdAt)})]}),u.jsx("div",{className:"message-body",children:u.jsx(Go,{content:e.content,conversation:t,streaming:e.streaming,onPreviewArtifact:n,onCopyArtifactUrl:a,copiedArtifactUrl:l})})]})});if(e.type==="turnError")return u.jsxs("article",{className:"turn-error-result","data-hover-time":ct(e.createdAt),role:"alert",children:[u.jsx("strong",{children:"Task failed"}),u.jsx(c5,{content:e.content})]});if(e.type==="message")return u.jsx("article",{className:`message ${e.message.role}`,"data-hover-time":ct(e.message.createdAt),children:u.jsxs("div",{className:"message-main",children:[u.jsxs("header",{className:"message-header",children:[u.jsx("span",{children:RD(e.message.role)}),u.jsx("time",{dateTime:e.message.createdAt,children:ct(e.message.createdAt)})]}),u.jsx("div",{className:"message-body",children:e.message.role==="user"?u.jsx(c5,{content:e.message.content}):u.jsx(Go,{content:e.message.content,conversation:t,streaming:!1,onPreviewArtifact:n,onCopyArtifactUrl:a,copiedArtifactUrl:l})})]})});if(e.type==="system"){if((m=e.topicMessages)!=null&&m.length)return u.jsx("div",{className:"topic-input-list",children:e.topicMessages.map(T=>u.jsx("article",{className:"message topic-input","data-hover-time":ct(T.createdAt),children:u.jsxs("div",{className:"topic-message-bubble topic-input-bubble",children:[u.jsxs("header",{className:"topic-input-header",children:[u.jsxs("span",{className:"topic-input-sender",children:["From ",T.senderName]}),u.jsx("time",{dateTime:T.createdAt,children:ct(T.createdAt)})]}),u.jsx("div",{className:"topic-input-content message-body",children:u.jsx(Go,{content:T.contentMarkdown,conversation:t,streaming:!1,onPreviewArtifact:n,onCopyArtifactUrl:a,copiedArtifactUrl:l})})]})},T.id))});const b=Ds({},[e.detail]);return u.jsx("article",{className:"message system","data-hover-time":ct(e.createdAt),children:u.jsx("div",{className:"message-main",children:u.jsxs("button",{className:`system-message-body system-message-link${e.visualKind?` ${e.visualKind}`:""}`,onClick:()=>h==null?void 0:h(e),type:"button",children:[e.visualKind==="topic"?u.jsx("span",{className:"system-message-icon",children:u.jsx(Yd,{})}):null,u.jsx("span",{className:"system-message-title",children:e.title}),u.jsx("small",{children:b})]})})})}return e.type==="steerMarker"?u.jsxs("div",{className:"turn-steer-marker","data-message-id":e.messageId,title:e.content,children:[u.jsx("span",{children:"Added while running"}),u.jsx("strong",{children:e.content})]}):e.tool.kind==="command"?u.jsx(HN,{tool:e.tool,onRespondApproval:o}):e.tool.kind==="file"&&((g=e.tool.fileChanges)!=null&&g.length)?u.jsx(qN,{conversation:t,tool:e.tool}):e.tool.kind==="responsibility"||e.tool.kind==="workspaceChange"?u.jsx(LN,{conversation:t,tool:e.tool,onRespond:c}):e.tool.kind==="knowledge"?u.jsx(BN,{tool:e.tool,onRespond:f}):e.tool.kind==="collaboration"&&e.tool.topicAction==="send"?u.jsxs("details",{className:"tool-card collaboration topic-output","data-hover-time":ct(e.tool.createdAt),title:ct(e.tool.createdAt),children:[u.jsxs("summary",{children:[u.jsxs("span",{className:"tool-card-summary-title",children:[u.jsx("span",{className:"tool-card-kind-icon",children:u.jsx(Yd,{})}),u.jsx("span",{children:e.tool.title})]}),e.tool.meta?u.jsx("small",{children:e.tool.meta}):null]}),u.jsxs("div",{className:"topic-message-bubble topic-output-bubble",children:[u.jsxs("header",{className:"topic-input-header",children:[u.jsxs("span",{className:"topic-input-sender",children:["To ",e.tool.topicRecipientLabel??"Topic"]}),u.jsx("time",{dateTime:e.tool.createdAt,children:ct(e.tool.createdAt)})]}),u.jsx("div",{className:"topic-input-content message-body",children:u.jsx(Go,{content:e.tool.topicMessageContent??e.tool.output??"",conversation:t,streaming:!1,onPreviewArtifact:n,onCopyArtifactUrl:a,copiedArtifactUrl:l})})]}),(v=e.tool.rawEvents)!=null&&v.length?u.jsxs("details",{className:"tool-raw-details",children:[u.jsx("summary",{children:"Raw events"}),u.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(e.tool.rawEvents,null,2)})]}):null]}):u.jsxs("details",{className:`tool-card ${e.tool.kind}`,"data-hover-time":ct(e.tool.createdAt),title:ct(e.tool.createdAt),children:[u.jsxs("summary",{children:[u.jsxs("span",{className:"tool-card-summary-title",children:[e.tool.kind==="collaboration"?u.jsx("span",{className:"tool-card-kind-icon",children:u.jsx(Yd,{})}):null,u.jsx("span",{children:e.tool.title})]}),e.tool.meta?u.jsx("small",{children:e.tool.meta}):null]}),u.jsx("code",{children:e.tool.body}),e.tool.output?u.jsx("pre",{children:e.tool.output}):null,(k=e.tool.rawEvents)!=null&&k.length?u.jsxs("details",{className:"tool-raw-details",children:[u.jsx("summary",{children:"Raw events"}),u.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(e.tool.rawEvents,null,2)})]}):null]})}function J3(e){return e.type==="message"||e.type==="turnError"||e.type==="assistantText"&&e.pinnedToResult||e.type==="assistantText"&&e.phase==="final_answer"||e.type==="tool"&&MN(e.tool)}function MN(e){return e.kind==="responsibility"||e.kind==="workspaceChange"&&!!(e.workspaceChangeProposalId??e.responsibilityProposalId)||e.kind==="knowledge"||e.kind==="collaboration"&&e.topicAction==="send"||e.meta==="approval"}function zN(e){const t=[],n=[];for(const a of e)a.type==="tool"&&(a.tool.kind==="collaboration"&&a.tool.topicAction==="send"||a.tool.kind==="workspaceChange"||a.tool.kind==="responsibility")?n.push(a):t.push(a);return[...t,...n]}function px({group:e,conversation:t,allowProcessView:n=!0,copiedFooter:a,copiedArtifactUrl:l,running:o,onCopyArtifactUrl:c,onCopyBubble:f,onLoadProcessDetails:h,onPreviewArtifact:m,onRespondApproval:g,onRespondWorkspaceChangeProposal:v,onRespondKnowledgeProposal:k,onOpenSystemEvent:b}){const T=zN(e.agentItems.filter(J3)),A=e.agentItems.some(F=>!J3(F)),q=n&&(A||e.turnIds.length>0),z=o?"process":"result",[M,B]=D.useState(z),[U,ne]=D.useState(!1),L=M==="result"?T:e.agentItems,K=PN(L);D.useEffect(()=>{U||B(z)},[z,U]);const ie=o||q||e.stopped,Q=u.jsxs(u.Fragment,{children:[ie?u.jsx("div",{className:"turn-panel-controls",children:o?u.jsx("span",{"aria-label":"Agent run in progress",className:"turn-view-spinner",title:"Agent run in progress"}):q?u.jsx("button",{"aria-label":M==="result"?"Show process":"Show result",className:"turn-view-toggle",title:M==="result"?"Show process":"Show result",type:"button",onClick:()=>{ne(!0),B(F=>F==="result"?(h(e.turnIds),"process"):"result")},children:M==="result"?u.jsx(DN,{}):u.jsx(RN,{})}):null}):null,L.map(F=>u.jsx(D.Fragment,{children:Po(F,t,m,c,l,g,v,k,b)},F.id)),M==="result"&&L.length===0?u.jsx("div",{className:"turn-result-empty",children:e.stopped?"Run stopped by user":A?"No reliable final answer captured":"No result yet"}):null,u.jsx(Dc,{copied:a,content:K,id:`agent-${e.id}-bottom`,notice:e.notificationFailure,timestamp:GN(L),variant:"outside",onCopy:f})]});return e.stopped?u.jsxs("details",{className:"turn-panel agent-turn stopped","data-collapsed":"true",children:[u.jsxs("summary",{children:[u.jsx("span",{className:"turn-stopped-badge",children:"Stopped"}),u.jsx("span",{children:"Run stopped by user"})]}),u.jsx("div",{className:ie?"stopped-turn-body has-controls":"stopped-turn-body",children:Q})]}):u.jsx("div",{className:["turn-panel","agent-turn",e.stopped?"stopped":"",ie?"has-controls":""].filter(Boolean).join(" "),children:Q})}function DN(){return u.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:u.jsx("path",{d:"M8 7h8M6 12h12M8 17h8",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})})}function RN(){return u.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:u.jsx("path",{d:"m7 12 3 3 7-7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})})}function ON(){return u.jsx("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:u.jsx("rect",{fill:"currentColor",height:"12",rx:"2.6",width:"12",x:"6",y:"6"})})}function IN(){return u.jsx("svg",{"aria-hidden":"true",fill:"none",height:"16",viewBox:"0 0 24 24",width:"16",children:u.jsx("path",{d:"M12 19V5m-5 5 5-5 5 5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.1"})})}function _N({className:e="",description:t,icon:n,onClick:a,timestamp:l,title:o,trailing:c,visibleTitle:f}){return u.jsxs("button",{className:`tool-card file compact-timeline-link ${e}`.trim(),"data-hover-time":ct(l),onClick:a,title:o,type:"button",children:[u.jsx("span",{className:"compact-timeline-link-icon",children:n}),u.jsxs("span",{className:"compact-timeline-link-copy",children:[u.jsx("strong",{children:f}),u.jsx("small",{children:t})]}),c?u.jsx("span",{className:"compact-timeline-link-trailing",children:c}):null]})}function LN({conversation:e,tool:t,onRespond:n}){var q;const a=We((q=t.workspaceChangePayload)==null?void 0:q.content)||t.body,[l,o]=D.useState(a),[c,f]=D.useState(null),[h,m]=D.useState("source"),[g,v]=D.useState(!1),k=!!(t.workspaceChangeProposalId??t.responsibilityProposalId),b=t.meta==="saved"||t.meta==="declined"?t.meta:k?"pending":"preparing",T=b==="pending";D.useEffect(()=>{o(a)},[a]);async function A(z){f(z);try{await n(t,z,z==="accept"?{content:l}:void 0)&&v(!1)}finally{f(null)}}return u.jsxs(u.Fragment,{children:[u.jsx(_N,{className:"responsibility-request-link",description:"Workspace responsibility",icon:u.jsx(Rf,{}),onClick:()=>v(!0),timestamp:t.createdAt,title:"View workspace change request",trailing:u.jsx("span",{className:`responsibility-request-status ${b}`,children:b}),visibleTitle:t.title}),g?u.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>!c&&v(!1),children:u.jsxs("section",{"aria-labelledby":`responsibility-proposal-${t.id}`,"aria-modal":"true",className:"dialog-card responsibility-proposal-dialog",onMouseDown:z=>z.stopPropagation(),role:"dialog",children:[u.jsxs("header",{children:[u.jsxs("div",{children:[u.jsx("h2",{id:`responsibility-proposal-${t.id}`,children:t.title}),u.jsxs("p",{children:["Workspace change · ",ct(t.createdAt)]})]}),u.jsx("button",{"aria-label":"Close",className:"icon-button",disabled:!!c,onClick:()=>v(!1),type:"button",children:"×"})]}),u.jsxs("div",{className:"responsibility-proposal-dialog-body",children:[u.jsxs("div",{className:"responsibility-proposal-header",children:[u.jsxs("div",{children:[u.jsx("strong",{children:"Proposed responsibility"}),u.jsx("p",{children:k?"Review or edit the Markdown before applying it to future turns.":"The proposal becomes actionable after the current turn completes."})]}),u.jsx("span",{children:b})]}),t.responsibilityReason?u.jsx("p",{className:"responsibility-proposal-reason",children:t.responsibilityReason}):null,T?u.jsxs("div",{className:"responsibility-proposal-editor",children:[u.jsxs("div",{className:"responsibility-proposal-tabs",role:"tablist",children:[u.jsx("button",{"aria-selected":h==="source",className:h==="source"?"active":"",role:"tab",type:"button",onClick:()=>m("source"),children:"Source"}),u.jsx("button",{"aria-selected":h==="preview",className:h==="preview"?"active":"",role:"tab",type:"button",onClick:()=>m("preview"),children:"Preview"})]}),h==="source"?u.jsx("textarea",{"aria-label":"Proposed workspace responsibility",className:"responsibility-proposal-body",disabled:!!c,onChange:z=>o(z.target.value),rows:12,value:l}):u.jsx("div",{className:"message-body responsibility-markdown-preview",children:Os(l,e)})]}):u.jsx("div",{className:"message-body responsibility-markdown-preview saved",children:Os(l,e)})]}),u.jsx("footer",{className:"responsibility-proposal-dialog-actions",children:T?u.jsxs(u.Fragment,{children:[u.jsx("button",{className:"secondary reject",disabled:!!c,type:"button",onClick:()=>void A("decline"),children:c==="decline"?"Rejecting...":"Reject"}),u.jsx("button",{className:"approve",disabled:!!c,type:"button",onClick:()=>void A("accept"),children:c==="accept"?"Saving...":"Save"})]}):u.jsx("button",{className:"secondary",onClick:()=>v(!1),type:"button",children:"Close"})})]})}):null]})}function BN({tool:e,onRespond:t}){const[n,a]=D.useState(e.body),[l,o]=D.useState(null),[c,f]=D.useState("source"),h=e.meta==="saved"||e.meta==="declined"?e.meta:"pending",m=h==="pending",g=e5(n);return D.useEffect(()=>{a(e.body)},[e.body]),u.jsxs("article",{className:"tool-card responsibility knowledge-proposal","data-hover-time":ct(e.createdAt),title:ct(e.createdAt),children:[u.jsxs("div",{className:"responsibility-proposal-header",children:[u.jsxs("div",{children:[u.jsx("strong",{children:e.title}),u.jsx("p",{children:"Long-term knowledge changes require approval. Keep one item as a reusable source or skill, not a tiny note."})]}),u.jsx("span",{children:h})]}),m?u.jsxs("div",{className:"responsibility-proposal-editor",children:[u.jsxs("div",{className:"responsibility-proposal-tabs",role:"tablist",children:[u.jsx("button",{"aria-selected":c==="source",className:c==="source"?"active":"",role:"tab",type:"button",onClick:()=>f("source"),children:"JSON"}),u.jsx("button",{"aria-selected":c==="preview",className:c==="preview"?"active":"",role:"tab",type:"button",onClick:()=>f("preview"),children:"Preview"})]}),c==="source"?u.jsx("textarea",{"aria-label":"Proposed workspace knowledge",className:"responsibility-proposal-body",disabled:!!l,onChange:v=>a(v.target.value),rows:10,value:n}):g?u.jsx(t5,{value:g}):u.jsx("div",{className:"knowledge-proposal-invalid",children:"Invalid JSON. Fix the proposal before saving."})]}):g?u.jsx(t5,{value:g,saved:!0}):u.jsx("pre",{className:"knowledge-proposal-raw",children:n}),m?u.jsxs("div",{className:"tool-approval-actions responsibility-actions",children:[u.jsx("button",{className:"approve",disabled:!!l,type:"button",onClick:()=>{e5(n)&&(o("accept"),Promise.resolve(t(e,"accept",n)).finally(()=>o(null)))},children:l==="accept"?"Saving...":"Save"}),u.jsx("button",{className:"reject",disabled:!!l,type:"button",onClick:()=>{o("decline"),Promise.resolve(t(e,"decline",n)).finally(()=>o(null))},children:l==="decline"?"Rejecting...":"Reject"})]}):null]})}function e5(e){try{const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?null:t}catch{return null}}function cp(e){return typeof e=="string"&&e.trim()?e.trim():typeof e=="number"||typeof e=="boolean"?String(e):"-"}function t5({value:e,saved:t}){return u.jsx("div",{className:`knowledge-proposal-preview${t?" saved":""}`,children:u.jsxs("dl",{children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Name"}),u.jsx("dd",{children:cp(e.name)})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Purpose"}),u.jsx("dd",{children:cp(e.purpose)})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Content"}),u.jsx("dd",{children:cp(e.content??e.description)})]})]})})}function qN({conversation:e,tool:t}){var c;const n=t.fileChanges??[],a=e==null?void 0:e.workspacePath,l=ZA(n),o=t.meta==="started"||t.meta==="running";return u.jsxs("details",{className:`tool-card file${o?" running":" done"}`,"data-hover-time":ct(t.createdAt),title:ct(t.createdAt),children:[u.jsxs("summary",{children:[u.jsxs("span",{className:"tool-card-summary-title",children:[u.jsx("span",{className:"file-change-indicator","aria-hidden":"true"}),u.jsx("span",{className:"file-change-title",children:XA(n,a)})]}),u.jsx(n5,{additions:l.additions,deletions:l.deletions,running:o})]}),u.jsx("div",{className:"file-change-list",children:n.map((f,h)=>u.jsxs("div",{className:"file-change-row",children:[u.jsx("span",{className:"file-change-kind",children:UN(f.kind)}),u.jsx("code",{title:f.path,children:J6(f.path,a)}),u.jsx(n5,{additions:f.additions,deletions:f.deletions})]},`${f.path}:${h}`))}),(c=t.rawEvents)!=null&&c.length?u.jsxs("details",{className:"tool-raw-details",children:[u.jsx("summary",{children:"Raw events"}),u.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(t.rawEvents,null,2)})]}):null]})}function n5({additions:e,deletions:t,running:n=!1}){return u.jsxs("span",{className:"file-change-stats",children:[n?u.jsx("small",{children:"editing"}):null,e>0?u.jsxs("span",{className:"file-change-additions",children:["+",e]}):null,t>0?u.jsxs("span",{className:"file-change-deletions",children:["-",t]}):null]})}function UN(e){switch(e){case"add":return"A";case"delete":return"D";case"move":return"R";default:return"M"}}function HN({tool:e,onRespondApproval:t}){var k;const n=lD(e),[a,l]=D.useState(!1),[o,c]=D.useState("script"),f=n==="approval"&&e.approvalRequestId!==void 0&&!!e.approvalTurnId,h=df(e.body)?null:e.body,m=h?dD(h):null,g=m?`${$N(n)} · ${m}`:n==="running"?"Running script":n==="approval"?"Waiting for approval":"Command",v=sD(e,n);return u.jsxs("article",{className:`tool-card command ${n}`,"data-hover-time":ct(e.createdAt),title:ct(e.createdAt),children:[u.jsxs("div",{className:"tool-command-bar",children:[u.jsxs("button",{"aria-expanded":a,className:"tool-command-toggle",type:"button",onClick:()=>l(b=>!b),children:[u.jsx("span",{className:"tool-command-indicator","aria-hidden":"true"}),u.jsx("span",{children:g}),u.jsx("small",{className:"tool-command-badge",children:v})]}),a?u.jsxs("div",{className:"tool-command-tabs",role:"tablist","aria-label":"Command details",children:[u.jsx("button",{"aria-selected":o==="script",role:"tab",type:"button",onClick:()=>c("script"),children:"Script"}),u.jsx("button",{"aria-selected":o==="result",role:"tab",type:"button",onClick:()=>c("result"),children:"Result"}),(k=e.rawEvents)!=null&&k.length?u.jsx("button",{"aria-selected":o==="raw",role:"tab",type:"button",onClick:()=>c("raw"),children:"Raw"}):null]}):null,f?u.jsxs("div",{className:"tool-approval-actions",children:[u.jsx("button",{className:"approve",type:"button",onClick:()=>t(e,"accept"),children:"Approve"}),u.jsx("button",{className:"reject",type:"button",onClick:()=>t(e,"decline"),children:"Reject"})]}):null]}),a?o==="script"?u.jsx("div",{className:"tool-tab-panel",role:"tabpanel",children:h?u.jsx(r5,{content:h}):u.jsx("p",{className:"tool-output-pending",children:"Script unavailable"})}):o==="result"?u.jsxs("div",{className:"tool-tab-panel result",role:"tabpanel",children:[u.jsx("p",{className:"tool-command-result-meta",children:oD(e,n)}),e.output?u.jsx(r5,{content:e.output}):u.jsx("p",{className:"tool-output-pending",children:n==="running"?"Waiting for output...":n==="approval"?"Waiting for approval before running.":e.meta??"No output"})]}):u.jsx(FN,{events:e.rawEvents??[]}):null]})}function $N(e){return e==="running"?"Running":e==="approval"?"Approval required":"Command"}function r5({content:e}){const[t,n]=D.useState(!1),a=cD(e,W3);return u.jsxs("div",{className:"tool-content-block",children:[u.jsx("pre",{className:"tool-content-code",children:t?e:uD(e,W3)}),a?u.jsx("button",{className:"tool-content-toggle",type:"button",onClick:()=>n(l=>!l),children:t?"Collapse":"Show all"}):null]})}function FN({events:e}){return u.jsx("div",{className:"tool-tab-panel raw",role:"tabpanel",children:u.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(e,null,2)})})}function Dc({copied:e,content:t,id:n,notice:a,timestamp:l,variant:o,onCopy:c}){return t.trim()?u.jsxs("footer",{className:`turn-panel-footer ${o}${a?" has-notice":""}`,children:[a?u.jsx("span",{"aria-label":`Notification failed: ${a}`,className:"turn-panel-footer-notice",role:"img",title:a,children:u.jsx(zx,{})}):null,u.jsx("time",{dateTime:l,children:ct(l)}),u.jsx("button",{"aria-label":e?"Copied markdown":"Copy markdown",onClick:()=>c(n,t),title:e?"Copied":"Copy",type:"button",children:e?u.jsx("span",{"aria-hidden":"true",children:"Copied"}):u.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"12",viewBox:"0 0 24 24",width:"12",children:[u.jsx("rect",{height:"14",rx:"2",stroke:"currentColor",strokeWidth:"2",width:"14",x:"8",y:"8"}),u.jsx("path",{d:"M4 16V6a2 2 0 0 1 2-2h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})})]}):null}function Rc(e){return e.type==="message"?e.message.role==="user"?e.message.content:Kc(e.message.content):e.type==="assistantText"?Kc(e.content):e.type==="turnError"?`Task failed
|
|
370
370
|
|
|
371
371
|
${e.content}`:e.type==="system"?[e.title,e.fullDetail??e.detail].filter(t=>!!(t!=null&&t.trim())).join(`
|
|
372
372
|
|
|
373
373
|
`):""}function PN(e){return e.map(Rc).filter(t=>t.trim()).join(`
|
|
374
374
|
|
|
375
|
-
`)}function GN(e){for(let t=e.length-1;t>=0;t-=1){const n=e[t];if(n.type!=="tool")return n.createdAt}return new Date().toISOString()}function VN({usage:e}){return e?u.jsx("div",{className:"usage-indicators","aria-label":"Seele usage",children:e.windows.map(t=>u.jsx(YN,{label:gx(t.windowDurationMins),window:t},`${t.windowDurationMins}:${t.resetsAt}`))}):u.jsx("span",{"aria-label":"Usage pending",className:"usage-indicator muted","data-tooltip":"Usage pending",role:"status",tabIndex:0,children:u.jsx("strong",{children:"--"})})}function gx(e){return e%10080===0?`${e/10080}w`:e%1440===0?`${e/1440}d`:e%60===0?`${e/60}h`:`${e}m`}function YN({label:e,window:t}){const n=Of(t.usedPercent),a=t4(n),l=`${e} usage ${Xx(n)} · resets ${Zx(t.resetsAt)}`;return u.jsx("span",{"aria-label":l,className:`usage-indicator ${a}`,"data-tooltip":l,role:"status",style:{"--usage-level":`${n}%`},tabIndex:0,children:u.jsxs("strong",{children:[Math.round(n),"%"]})})}function yx(e,t,n,a,l,o){const c=[...e].sort(Uc),f=new Map(a.filter(L=>L.parentId===null&&L.nodeType==="agent_turn"&&L.turnId!==null).map(L=>[L.turnId,L.sequence])),h=new Map(a.filter(L=>L.parentId===null&&L.nodeType==="agent_turn"&&L.turnId!==null).map(L=>[L.turnId,L.timelineAt])),m=new Map(a.filter(L=>L.nodeType==="user_message"&&L.entityId!==null).map(L=>[L.entityId,L.sequence])),g=new Map(a.filter(L=>L.nodeType==="user_message"&&L.entityId!==null).map(L=>[L.entityId,L.timelineAt])),v=a.filter(L=>L.parentId===null&&L.nodeType==="system_event"),k=v.filter(L=>L.turnId!==null&&L.subtype.startsWith("input:")),b=v.filter(L=>!k.includes(L)),T=new Set(v.flatMap(L=>L.turnId?[L.turnId]:[])),A=BA(t),q=new Map(n.map(L=>[L.id,L])),z=a.filter(L=>L.parentId===null&&L.nodeType==="agent_turn"&&L.turnId!==null).map(L=>L.turnId),B=[...new Set(a.length>0?[...z,...l?[l]:[]]:[...n.map(L=>L.id),...c.flatMap(L=>L.turnId?[L.turnId]:[]),...t.flatMap(L=>L.turnId?[L.turnId]:[])])].map(L=>{var we,_e,He,wt;const K=q.get(L),ie=c.filter(et=>et.turnId===L),Q=ie.filter(et=>et.role==="user").sort((et,$t)=>{const tt=g.get(et.id)??et.createdAt,fe=g.get($t.id)??$t.createdAt;return tt.localeCompare(fe)||Uc(et,$t)}),F=ie.filter(et=>et.role==="assistant"),he=t.filter(et=>et.turnId===L).sort(Uc),ce=`turn:${L}`,Ie=a.filter(et=>et.parentId===ce).sort((et,$t)=>et.sequence-$t.sequence),be=(K==null?void 0:K.origin)??A.get(L),pe=k.filter(et=>et.turnId===L).sort((et,$t)=>et.timelineAt.localeCompare($t.timelineAt)||et.sequence-$t.sequence).map(et=>a5(et,void 0,o)),J=be==="timeline_event"?[]:a.length>0?tM(Ie,he,Bc([L],l),o):xx(he,Bc([L],l),o),Y=F.map(Ec),ge=eM(J,Y),Te=qA(K);Te&&ge.push({id:`turn-error-${Te.turnId}`,type:"turnError",createdAt:Te.createdAt,content:Te.content});const H=he.find(et=>et.event==="server.wakeup.started"),_=Oe(H==null?void 0:H.data),te=typeof _.instruction=="string"?_.instruction.trim():"",O=be==="timeline_event"?he[0]:void 0,ee=T.has(L)?null:O?vx(O,(K==null?void 0:K.startedAt)??new Date(0).toISOString()):ZN(be)?{id:`system-${L}`,type:"system",createdAt:(K==null?void 0:K.startedAt)??((we=he[0])==null?void 0:we.createdAt)??new Date(0).toISOString(),title:QN(be??"system"),detail:JN(be??"system",te),fullDetail:te||void 0}:null,Ae=pM(he),
|
|
375
|
+
`)}function GN(e){for(let t=e.length-1;t>=0;t-=1){const n=e[t];if(n.type!=="tool")return n.createdAt}return new Date().toISOString()}function VN({usage:e}){return e?u.jsx("div",{className:"usage-indicators","aria-label":"Seele usage",children:e.windows.map(t=>u.jsx(YN,{label:gx(t.windowDurationMins),window:t},`${t.windowDurationMins}:${t.resetsAt}`))}):u.jsx("span",{"aria-label":"Usage pending",className:"usage-indicator muted","data-tooltip":"Usage pending",role:"status",tabIndex:0,children:u.jsx("strong",{children:"--"})})}function gx(e){return e%10080===0?`${e/10080}w`:e%1440===0?`${e/1440}d`:e%60===0?`${e/60}h`:`${e}m`}function YN({label:e,window:t}){const n=Of(t.usedPercent),a=t4(n),l=`${e} usage ${Xx(n)} · resets ${Zx(t.resetsAt)}`;return u.jsx("span",{"aria-label":l,className:`usage-indicator ${a}`,"data-tooltip":l,role:"status",style:{"--usage-level":`${n}%`},tabIndex:0,children:u.jsxs("strong",{children:[Math.round(n),"%"]})})}function yx(e,t,n,a,l,o){const c=[...e].sort(Uc),f=new Map(a.filter(L=>L.parentId===null&&L.nodeType==="agent_turn"&&L.turnId!==null).map(L=>[L.turnId,L.sequence])),h=new Map(a.filter(L=>L.parentId===null&&L.nodeType==="agent_turn"&&L.turnId!==null).map(L=>[L.turnId,L.timelineAt])),m=new Map(a.filter(L=>L.nodeType==="user_message"&&L.entityId!==null).map(L=>[L.entityId,L.sequence])),g=new Map(a.filter(L=>L.nodeType==="user_message"&&L.entityId!==null).map(L=>[L.entityId,L.timelineAt])),v=a.filter(L=>L.parentId===null&&L.nodeType==="system_event"),k=v.filter(L=>L.turnId!==null&&L.subtype.startsWith("input:")),b=v.filter(L=>!k.includes(L)),T=new Set(v.flatMap(L=>L.turnId?[L.turnId]:[])),A=BA(t),q=new Map(n.map(L=>[L.id,L])),z=a.filter(L=>L.parentId===null&&L.nodeType==="agent_turn"&&L.turnId!==null).map(L=>L.turnId),B=[...new Set(a.length>0?[...z,...l?[l]:[]]:[...n.map(L=>L.id),...c.flatMap(L=>L.turnId?[L.turnId]:[]),...t.flatMap(L=>L.turnId?[L.turnId]:[])])].map(L=>{var we,_e,He,wt;const K=q.get(L),ie=c.filter(et=>et.turnId===L),Q=ie.filter(et=>et.role==="user").sort((et,$t)=>{const tt=g.get(et.id)??et.createdAt,fe=g.get($t.id)??$t.createdAt;return tt.localeCompare(fe)||Uc(et,$t)}),F=ie.filter(et=>et.role==="assistant"),he=t.filter(et=>et.turnId===L).sort(Uc),ce=`turn:${L}`,Ie=a.filter(et=>et.parentId===ce).sort((et,$t)=>et.sequence-$t.sequence),be=(K==null?void 0:K.origin)??A.get(L),pe=k.filter(et=>et.turnId===L).sort((et,$t)=>et.timelineAt.localeCompare($t.timelineAt)||et.sequence-$t.sequence).map(et=>a5(et,void 0,o)),J=be==="timeline_event"?[]:a.length>0?tM(Ie,he,Bc([L],l),o):xx(he,Bc([L],l),o),Y=F.map(Ec),ge=eM(J,Y),Te=qA(K);Te&&ge.push({id:`turn-error-${Te.turnId}`,type:"turnError",createdAt:Te.createdAt,content:Te.content});const H=he.find(et=>et.event==="server.wakeup.started"),_=Oe(H==null?void 0:H.data),te=typeof _.instruction=="string"?_.instruction.trim():"",O=be==="timeline_event"?he[0]:void 0,ee=T.has(L)?null:O?vx(O,(K==null?void 0:K.startedAt)??new Date(0).toISOString()):ZN(be)?{id:`system-${L}`,type:"system",createdAt:(K==null?void 0:K.startedAt)??((we=he[0])==null?void 0:we.createdAt)??new Date(0).toISOString(),title:QN(be??"system"),detail:JN(be??"system",te),fullDetail:te||void 0}:null,Ae=pM(he),re=(Q[0]?g.get(Q[0].id):(_e=k.find(et=>et.turnId===L))==null?void 0:_e.timelineAt)??h.get(L)??(K==null?void 0:K.startedAt)??((He=ie[0])==null?void 0:He.createdAt)??((wt=he[0])==null?void 0:wt.createdAt)??new Date(0).toISOString();return{id:`turn-${L}`,turnIds:[L],user:ee??(Q[0]?Ec(Q[0]):null),followupUsers:Q.slice(1).map(Ec),acceptedSystemInputs:pe,agentItems:ge,activity:Ae??(Bc([L],l)?{id:-1,title:ge.some(et=>et.type==="assistantText"&&et.streaming)?"Writing response":"Working",createdAt:re,tone:"running"}:null),notificationFailure:mM(he),stopped:(K==null?void 0:K.status)==="cancelled"||he.some(wx),trailingSystemItems:[],sortAt:re,sortSequence:f.get(L)??null}}),U=c.filter(L=>!L.turnId);B.push(...U.map(L=>({id:`message-${L.id}`,turnIds:[],user:L.role==="user"?Ec(L):null,followupUsers:[],agentItems:L.role==="assistant"?[Ec(L)]:[],activity:null,notificationFailure:null,stopped:!1,sortAt:g.get(L.id)??L.createdAt,sortSequence:m.get(L.id)??null})));const ne=new Map(t.map(L=>[String(L.id),L]));return B.push(...b.map(L=>({id:L.id,turnIds:[],user:a5(L,L.entityType==="event"&&L.entityId?ne.get(L.entityId):void 0,o),followupUsers:[],agentItems:[],activity:null,notificationFailure:null,stopped:!1,trailingSystemItems:[],sortAt:L.timelineAt,sortSequence:L.sequence}))),B.sort((L,K)=>{const ie=L.sortAt.localeCompare(K.sortAt);return ie!==0?ie:L.sortSequence!==null||K.sortSequence!==null?(L.sortSequence??Number.MAX_SAFE_INTEGER)-(K.sortSequence??Number.MAX_SAFE_INTEGER):0}).map(({sortAt:L,...K})=>K)}function a5(e,t,n){var f,h;if(t||e.entityType==="event")return vx(t??n1(e),e.createdAt);const a=Oe(e.detail);if(e.subtype==="input:collaboration_notice"||e.subtype==="input:topic_message"){const m=Kp(a,n),g=WN(a.messages,n),v=Array.isArray(a.senderWorkspaceIds)?a.senderWorkspaceIds.filter(b=>typeof b=="string"&&b.trim().length>0):[],k=typeof a.unreadCount=="number"?a.unreadCount:0;return{id:e.id,type:"system",createdAt:e.createdAt,title:m.title,detail:m.detail,visualKind:"topic",topicMessages:g,fullDetail:[`## ${m.title}`,"","**Unread**","",String(k),"","**From**","",v.length>0?v.map(b=>{const T=n.get(b)??b;return`${Ns(T)} (\`${b}\`)`}).join(", "):"Unknown"].join(`
|
|
376
376
|
`)}}const l=Z6(e.title,e.subtype),o=Ds(a,[e.summary,e.contentMarkdown]),c=[`## ${Ns(l)}`,"",((f=e.contentMarkdown)==null?void 0:f.trim())||((h=e.summary)==null?void 0:h.trim())||"",Object.keys(a).length>0?["","```json",JSON.stringify(a,null,2),"```"].join(`
|
|
377
377
|
`):""].filter(Boolean).join(`
|
|
378
378
|
`);return{id:e.id,type:"system",createdAt:e.createdAt,title:l,detail:o,fullDetail:c||void 0}}function WN(e,t){if(!Array.isArray(e))return[];const n=new Set,a=[];for(const l of e){const o=Oe(l),c=We(o.id),f=We(o.senderWorkspaceId),h=We(o.contentMarkdown).trim(),m=We(o.createdAt);!c||n.has(c)||!f||!h||!m||(n.add(c),a.push({id:c,senderWorkspaceId:f,senderName:t.get(f)??(We(o.senderTitleSnapshot)||f),contentMarkdown:h,createdAt:m}))}return a}function vx(e,t){return e.event==="server.collaboration.topic_created"?KN(e,t):XN(e,t)}function KN(e,t){const n=Oe(Oe(e.data).topic),a=We(n.title).trim()||"Untitled Topic",l=We(n.publicDescription).trim()||"未填写描述",o=Array.isArray(n.members)?n.members.map(Oe):[],c=We(n.ownerWorkspaceId),f=o.find(v=>We(v.role)==="owner"||We(v.workspaceId)===c),h=We(f==null?void 0:f.workspaceTitleSnapshot).trim()||"Unknown workspace",m=o.filter(v=>We(v.role)!=="owner"&&We(v.status)==="active"),g=m.length?m.map(v=>{const k=We(v.workspaceTitleSnapshot).trim()||"Unknown workspace";return`- ${Ns(k)} (\`${We(v.workspaceId)}\`)`}):["无"];return{id:`collaboration-topic-created-${e.id}`,type:"system",createdAt:e.createdAt??t,title:"Created",detail:a,visualKind:"topic",fullDetail:["## Topic 已创建","","**名称**","",Ns(a),"","**描述**","",Ns(l),"","**Owner Workspace**","",`${Ns(h)} (\`${c}\`)`,"","**协作 Workspace**","",...g].join(`
|
|
379
379
|
`)}}function XN(e,t){const n=Oe(e.data),a=t1(e.data),l=Z6(void 0,e.event);return{id:`system-event-${e.id}`,type:"system",createdAt:e.createdAt??t,title:l,detail:Ds(n),visualKind:e.event.startsWith("server.collaboration.")?"topic":void 0,fullDetail:[`## ${Ns(l)}`,"","**Event**","",`\`${e.event}\``,"","```json",JSON.stringify(a??null,null,2),"```"].join(`
|
|
380
|
-
`)}}function t1(e,t=""){return Array.isArray(e)?e.map(n=>t1(n)):e&&typeof e=="object"?Object.fromEntries(Object.entries(e).map(([n,a])=>[n,t1(a,n)])):typeof e=="string"&&(t==="wakeAt"||t==="wake_at")&&$c(e)||e}function ZN(e){return e==="system"||e==="wakeup"||e==="runtime-reset"||e==="clone_initialization"}function QN(e){return e==="runtime-reset"?"Runtime reset":e==="clone_initialization"?"Clone initialization":e==="system"?"System action":"Scheduled wakeup"}function JN(e,t){return e==="runtime-reset"?"Thread rebuilt":e==="clone_initialization"?"Activating inherited context":e==="system"?"Workspace runtime action":t?Fx(t,20):"Auto resumed"}function eM(e,t){if(e.some(l=>l.type==="assistantText"))return cf(e);if(t.length===0)return e;const n=[...t],a=[];for(const l of e)l.type==="tool"&&X1(l.tool)&&K1(n,l.tool)||a.push(l);return cf([...a,...n])}function tM(e,t,n,a){var h;const l=new Map(t.filter(m=>m.id!==void 0).map(m=>[String(m.id),m])),o=new Map,c=new Set;for(const m of e){const g=nM(m,t,l);g.length>0&&c.add(m.id);for(const v of g)o.set(Qa(v),v)}if(n)for(const m of t)rM(e,m)||o.set(Qa(m),m);else if(t.length>0&&!e.some(m=>m.phase==="process"))for(const m of t)o.set(Qa(m),m);for(const m of t){const g=Oe(m.data),v=Oe(g.params);(typeof g.method=="string"&&g.method.startsWith("item/reasoning/")||g.method==="item/completed"&&Oe(v.item).type==="reasoning")&&o.set(Qa(m),m)}const f=xx([...o.values()].sort(Uc),n,a);for(const m of e)if(!c.has(m.id)){if(m.nodeType==="agent_text"&&m.subtype!=="final_answer"&&((h=m.contentMarkdown)!=null&&h.trim())){f.push({id:m.id,type:"assistantText",createdAt:m.createdAt,content:m.contentMarkdown,phase:aM(m),itemId:m.entityType==="codex_item"?m.entityId??void 0:void 0,streaming:n&&m.status==="running"});continue}m.nodeType==="operation"&&f.push({id:m.id,type:"tool",createdAt:m.createdAt,tool:iM(m,a)})}return cf(f)}function nM(e,t,n){if(e.entityType==="event"&&e.entityId){const a=n.get(e.entityId);return a&&e.phase==="process"&&e.status==="running"?[a]:[n1(e)]}if(e.entityType==="codex_item"&&e.entityId){const a=t.filter(l=>W1(l)===e.entityId);return a.length>0?a:[n1(e)]}return[]}function n1(e){const t=Oe(e.detail),n=e.subtype==="server.collaboration.message_staged"&&e.phase==="result"?e.status==="failed"?"server.collaboration.message_rejected":We(t.messageId)?"server.collaboration.message_sent":e.subtype:e.subtype;return{id:e.entityId??e.id,turnId:e.turnId,seq:e.sequence,event:e.entityType==="codex_item"?"codex.notification":n,data:e.detail,createdAt:e.updatedAt||e.createdAt}}function rM(e,t){const n=t.id===void 0?null:String(t.id),a=W1(t);return e.some(l=>n!==null&&l.entityType==="event"&&l.entityId===n||a!==null&&l.entityType==="codex_item"&&l.entityId===a)}function W1(e){if(e.event!=="codex.notification"&&e.event!=="server.item.snapshot")return null;const t=Oe(e.data),n=Oe(t.params),a=Oe(n.item);return We(a.id)||We(n.itemId)||null}function aM(e){return e.subtype==="final_answer"?"final_answer":e.phase==="process"?"commentary":"unknown"}function iM(e,t){var a,l;const n=Oe(e.detail);return{id:e.id,kind:e.status==="failed"?"error":"activity",title:e.subtype==="input:collaboration_notice"?Kp(n,t).title:e.title||Px(e.subtype),body:e.subtype==="input:collaboration_notice"?Kp(n,t).detail:((a=e.summary)==null?void 0:a.trim())||((l=e.contentMarkdown)==null?void 0:l.trim())||Lx(n),createdAt:e.createdAt,itemId:e.entityType==="codex_item"?e.entityId??void 0:void 0,meta:e.status}}function xx(e,t,n){const a=[],l=new Map,o=new Map,c=new Map,f=new Map,h=new Map;for(const m of e){const g=OA(l,m.data);if(g){const z=IA(g);let M=o.get(g.itemId);!M&&z&&(M={id:`reasoning-${m.id}`,type:"reasoning",createdAt:m.createdAt??new Date().toISOString(),content:z,streaming:!1},o.set(g.itemId,M),a.push(M)),M&&(M.content=z,M.streaming=t&&!g.completed);continue}if(m.event==="server.workspace_change.decision"||m.event==="server.responsibility.decision"){oM(a,m);continue}if(m.event==="server.knowledge.decision"){uM(a,m);continue}if(wx(m)){hM(a);continue}if(m.event==="server.steer"){const z=Oe(m.data),M=typeof z.message=="string"?z.message.trim():"";a.push({id:`steer-${m.id}`,type:"steerMarker",createdAt:m.createdAt??new Date().toISOString(),content:M||"Additional input",messageId:typeof z.messageId=="string"?z.messageId:void 0});continue}const v=MD(m.data);v!=null&&v.itemId&&h.set(v.itemId,v.phase);const k=ND(m.data);if(k!=null&&k.text){const z=k.itemId?h.get(k.itemId)??k.phase:k.phase,M=k.itemId??`phase:${z}`,B=`${c.get(M)??""}${k.text}`,U=Ax(B),ae=f.get(M)??"",L=U.startsWith(ae)?U.slice(ae.length):U;if(c.set(M,B),f.set(M,U),L){const K=a[a.length-1];(K==null?void 0:K.type)==="assistantText"&&dM(K,k.itemId,z)?(K.content+=L,K.itemId=K.itemId??k.itemId,K.streamKey=K.streamKey??M,K.streaming=t):a.push({id:`assistant-event-${m.id}`,type:"assistantText",createdAt:m.createdAt??new Date().toISOString(),content:L,phase:z,itemId:k.itemId,streamKey:M,streaming:t})}continue}const b=zD(m.data);if(b!=null&&b.text){const z=Kc(b.text),M=b.itemId??`phase:${b.phase}`,B=fM(a,b.itemId,b.phase);if(B>=0){const U=a[B];U.type==="assistantText"&&(z?(U.content=z,U.phase=b.phase,U.itemId=U.itemId??b.itemId,U.streamKey=U.streamKey??M,U.streaming=!1,sM(a,B,b.itemId)):a.splice(B,1))}else z&&a.push({id:`assistant-completed-${m.id}`,type:"assistantText",createdAt:m.createdAt??new Date().toISOString(),content:z,phase:b.phase,itemId:b.itemId,streamKey:M,streaming:!1});continue}const T=nD(m,n);if(T){T.rawEvents=[m];const z=l5(a,T);if(z>=0){s5(a[z],T);continue}if(X1(T)&&K1(a,T)||T.kind==="command"&&T.meta==="running"&&df(T.body))continue;a.push({id:`tool-${T.id}`,type:"tool",createdAt:T.createdAt,tool:T});continue}const A=rD(m);if(A){A.rawEvents=[m];const z=l5(a,A);if(z>=0){s5(a[z],A);continue}a.push({id:`tool-${A.id}`,type:"tool",createdAt:A.createdAt,tool:A});continue}if(VA(m)){lM(a,m);continue}const q=aD(m);q&&(q.rawEvents=[m],a.push({id:`tool-${q.id}`,type:"tool",createdAt:q.createdAt,tool:q}))}return cf(a)}function lM(e,t){const n=W1(t);if(n)for(let a=e.length-1;a>=0;a-=1){const l=e[a];if(!(l.type!=="tool"||l.tool.itemId!==n)){l.tool={...l.tool,rawEvents:kx(l.tool.rawEvents,[t])};return}}}function sM(e,t,n){if(n)for(let a=e.length-1;a>t;a-=1){const l=e[a];l.type==="assistantText"&&l.itemId===n&&e.splice(a,1)}}function oM(e,t){const n=Oe(t.data),a=typeof n.proposalId=="string"?n.proposalId:void 0,l=typeof n.decision=="string"?n.decision:void 0,o=Oe(n.payload),c=We(o.content)||(typeof n.responsibility=="string"?n.responsibility:void 0);if(!(!a||l!=="accept"&&l!=="decline"))for(let f=e.length-1;f>=0;f-=1){const h=e[f];if(h.type==="tool"&&(h.tool.kind==="responsibility"||h.tool.kind==="workspaceChange")&&(h.tool.workspaceChangeProposalId===a||h.tool.responsibilityProposalId===a)){const m=vE(h.tool.meta,l);h.tool={...h.tool,title:m==="saved"?"Workspace change applied":"Workspace change declined",meta:m,body:m==="saved"?c??h.tool.body:h.tool.body,workspaceChangePayload:m==="saved"&&Object.keys(o).length>0?o:h.tool.workspaceChangePayload};return}}}function uM(e,t){const n=Oe(t.data),a=typeof n.proposalId=="string"?n.proposalId:void 0,l=typeof n.decision=="string"?n.decision:void 0,o=Oe(n.knowledge);if(!(!a||l!=="accept"&&l!=="decline"))for(let c=e.length-1;c>=0;c-=1){const f=e[c];if(f.type==="tool"&&f.tool.kind==="knowledge"&&f.tool.knowledgeProposalId===a){f.tool={...f.tool,title:l==="accept"?"Knowledge saved":"Knowledge proposal declined",meta:l==="accept"?"saved":"declined",body:l==="accept"&&Object.keys(o).length>0?JSON.stringify(o,null,2):f.tool.body};return}}}function K1(e,t){const n=bx(t);if(typeof n!="number")return!1;for(let o=0;o<e.length;o+=1){const c=e[o];if(c.type!=="assistantText"||!i5(c,t))continue;const f=Kc(c.content);f!==c.content&&(e[o]={...c,content:f})}let a=0,l=-1;for(let o=0;o<e.length;o+=1){const c=e[o];if(c.type!=="assistantText"||!i5(c,t))continue;l=o;const f=a,h=f+c.content.length;if(a=h,n>=h)continue;const m=Math.max(0,Math.min(c.content.length,n-f)),g=c.content.slice(0,m).trimEnd(),v=c.content.slice(m).trimStart(),k=[];return g&&k.push({...c,id:`${c.id}:before-tool-${t.id}`,content:g,pinnedToResult:!0}),k.push({id:`tool-${t.id}`,type:"tool",createdAt:t.createdAt,tool:t}),v&&k.push({...c,id:`${c.id}:after-tool-${t.id}`,content:v,pinnedToResult:!0}),e.splice(o,1,...k),!0}if(l>=0&&n>=a){const o=e[l];return(o==null?void 0:o.type)==="assistantText"&&(e[l]={...o,pinnedToResult:!0}),e.splice(l+1,0,{id:`tool-${t.id}`,type:"tool",createdAt:t.createdAt,tool:t}),!0}return!1}function i5(e,t){return!t.anchorStreamKey||e.streamKey===t.anchorStreamKey}function cf(e){const t=[],n=[];for(const o of e){if(o.type==="tool"&&X1(o.tool)){t.push(o.tool);continue}n.push(o)}const a=[...n],l=[];for(const o of t)K1(a,o)||l.push({id:`tool-${o.id}`,type:"tool",createdAt:o.createdAt,tool:o});return cM([...l,...a])}function X1(e){return typeof bx(e)=="number"}function bx(e){if(typeof e.anchorOffset=="number")return e.anchorOffset;if(e.kind==="responsibility")return e.responsibilityAnchorOffset;if(e.kind==="knowledge")return e.knowledgeAnchorOffset}function cM(e){const t=[];for(let n=0;n<e.length;n+=1){const a=e[n],l=e[n+1];if((a==null?void 0:a.type)==="tool"&&a.tool.kind==="responsibility"&&typeof a.tool.responsibilityAnchorOffset!="number"&&(l==null?void 0:l.type)==="assistantText"){t.push({...l,pinnedToResult:!0}),t.push(a),n+=1;continue}t.push(a)}return t}function dM(e,t,n){return e.type!=="assistantText"?!1:e.itemId&&t?e.itemId===t:e.itemId||t?!1:e.phase===n}function fM(e,t,n){if(t){const a=e.findIndex(l=>l.type==="assistantText"&&l.itemId===t);if(a>=0)return a}for(let a=e.length-1;a>=0;a-=1){const l=e[a];if(l.type==="assistantText"&&l.streaming&&(!t||!l.itemId)&&(l.phase===n||l.phase==="unknown"||n==="unknown"))return a}return-1}function wx(e){return e.event==="server.stop"||e.event==="server.stopped"}function hM(e){for(const t of e)t.type==="tool"&&t.tool.kind==="command"&&t.tool.meta==="running"&&(t.tool={...t.tool,title:"Command stopped",meta:"stopped"})}function mM(e){for(let t=e.length-1;t>=0;t-=1){const n=e[t];if(n.event!=="server.notification.failed")continue;const a=Oe(n.data);return typeof a.message=="string"?a.message:"Notification failed"}return null}function pM(e){for(let t=e.length-1;t>=0;t-=1){const n=Gx(e[t]);if(n)return n}return null}function l5(e,t){for(let n=e.length-1;n>=0;n-=1){const a=e[n];if(a.type==="tool"&&a.tool.kind===t.kind&&(t.itemId&&a.tool.itemId===t.itemId||a.tool.body===t.body&&a.tool.meta==="running"))return n}return-1}function s5(e,t){if(e.type!=="tool")return;const n=e.tool.kind==="command"&&e.tool.meta!=="running"&&t.meta==="running",a=e.tool.kind==="command"&&t.kind==="command"&&df(t.body)&&!df(e.tool.body);e.tool={...e.tool,...t,id:e.tool.id,createdAt:e.tool.createdAt,title:n?e.tool.title:t.title,body:a?e.tool.body:t.body,meta:n?e.tool.meta:t.meta,output:t.outputKind?TA(e.tool.output,t.output,t.outputKind):vD(e.tool.output,t.output),topicRecipientLabel:t.topicRecipientLabel??e.tool.topicRecipientLabel,topicMessageContent:t.topicMessageContent??e.tool.topicMessageContent,rawEvents:kx(e.tool.rawEvents,t.rawEvents)}}function kx(e,t){const n=[...e??[],...t??[]];if(n.length===0)return;const a=new Set;return n.filter(l=>{const o=Qa(l);return a.has(o)?!1:(a.add(o),!0)})}function Ec(e){return{id:`message-${e.id}`,type:"message",createdAt:e.createdAt,message:e}}function Pd(e,t){const n=new Set,a=[...e,...t].filter(l=>n.has(l.id)?!1:(n.add(l.id),!0));return a.filter(l=>Sx(l)?!a.some(o=>gM(o,l)):!0)}function Gd(e,t){const n=new Map;for(const a of[...e,...t])n.set(a.id,a);return[...n.values()].sort((a,l)=>Date.parse(a.startedAt)-Date.parse(l.startedAt))}function Vd(e,t){const n=new Map;for(const a of[...e,...t])n.set(a.id,a);return[...n.values()].sort((a,l)=>a.timelineAt.localeCompare(l.timelineAt)||a.sequence-l.sequence)}function Sx(e){return e.id.startsWith("local-")}function gM(e,t){if(Sx(e)||e.role!==t.role||e.content.trim()!==t.content.trim())return!1;const n=Date.parse(e.createdAt),a=Date.parse(t.createdAt);return Number.isNaN(n)||Number.isNaN(a)?!1:Math.abs(n-a)<=12e4}function _d(e,t){const n=new Map,a=new Map;for(const o of[...e,...t]){const c=Qa(o);a.has(c)||a.set(c,a.size),n.set(c,o)}return[...n.values()].sort((o,c)=>{const f=jx(o,c);return f!==0?f:(a.get(Qa(o))??0)-(a.get(Qa(c))??0)})}function o5(e,t){const n=Qa(t),a=e.findIndex(o=>Qa(o)===n);if(a<0)return[...e,t];if(yM(e[a],t))return e;const l=[...e];return l[a]=t,l}function yM(e,t){return e.turnId===t.turnId&&e.event===t.event&&e.createdAt===t.createdAt&&e.seq===t.seq&&JSON.stringify(e.data)===JSON.stringify(t.data)}function Qa(e){return e.id!==void 0?`${typeof e.id}:${e.id}`:`${e.event}:${e.createdAt??""}:${JSON.stringify(e.data)}`}function Uc(e,t){const n=jx(e,t);return n!==0?n:vM(e.id,t.id)}function jx(e,t){if(e.turnId&&t.turnId&&e.turnId===t.turnId&&typeof e.seq=="number"&&typeof t.seq=="number"&&e.seq!==t.seq)return e.seq-t.seq;const n=Date.parse(e.createdAt??""),a=Date.parse(t.createdAt??"");return!Number.isNaN(n)&&!Number.isNaN(a)&&n!==a?n-a:Number.isNaN(n)!==Number.isNaN(a)?Number.isNaN(n)?1:-1:0}function vM(e,t){return e===t?0:e===void 0?1:t===void 0?-1:typeof e=="number"&&typeof t=="number"?e-t:String(e).localeCompare(String(t))}function u5(e,t){const n=Oe(e.data);return typeof n.__seq=="number"&&typeof n.__createdAt=="string"&&Object.prototype.hasOwnProperty.call(n,"payload")?{id:typeof n.__eventId=="string"?n.__eventId:`stream:${n.__turnId??"unknown"}:${n.__seq}`,turnId:typeof n.__turnId=="string"?n.__turnId:null,seq:n.__seq,event:e.event,data:n.payload,createdAt:n.__createdAt}:{id:t,turnId:e.turnId??null,event:e.event,data:e.data,createdAt:e.createdAt??new Date().toISOString()}}const Go=D.memo(function({content:t,conversation:n,streaming:a,onPreviewArtifact:l,onCopyArtifactUrl:o,copiedArtifactUrl:c}){const f=a?Ax(t):Kc(t),h=n&&!a?TM(f,n):[];return u.jsxs(u.Fragment,{children:[a?u.jsx(wM,{content:f,conversation:n}):Os(f,n),h.length>0?u.jsx("div",{className:"artifact-preview-list",children:h.map(m=>u.jsx(CM,{artifact:m,onPreview:l,onCopyUrl:o,copied:c===m.url},m.id))}):null]})},xM);function xM(e,t){var n,a,l,o;return e.content===t.content&&e.streaming===t.streaming&&e.copiedArtifactUrl===t.copiedArtifactUrl&&((n=e.conversation)==null?void 0:n.id)===((a=t.conversation)==null?void 0:a.id)&&((l=e.conversation)==null?void 0:l.workspacePath)===((o=t.conversation)==null?void 0:o.workspacePath)}function c5({content:e}){return u.jsx("div",{className:"plain-message-content",children:e})}const bM=2;function wM({content:e,conversation:t}){const n=D.useRef(null),[a,l]=D.useState(null),{committedBlocks:o,activeBlock:c}=kM(e);return D.useLayoutEffect(()=>{const f=n.current;if(!f)return;const h=parseFloat(window.getComputedStyle(f).lineHeight)||28,m=f.scrollHeight;l(g=>{const v=h*bM,k=Math.min(m,v);return g!==null&&k<=g?g:k})},[e]),u.jsxs("div",{className:"streaming-message-content",ref:n,style:a===null?void 0:{minHeight:a},children:[o.map((f,h)=>u.jsx(D.Fragment,{children:Os(f,t)},`${h}:${f.length}`)),c?u.jsx("p",{className:"streaming-active-line",children:c}):null]})}function kM(e){const t=jM(e),n=t>0?e.slice(0,t):"",a=e.slice(t);return{committedBlocks:SM(n),activeBlock:a}}function SM(e){const t=[];let n=0,a=!1,l=!1;const o=e.match(/[^\n]*(?:\n|$)/g)??[];let c=0;for(const f of o){if(!f)continue;const h=f.trim(),m=c;if(c+=f.length,/^\s*(```|~~~)/.test(f)){a=!a,a||(Ld(t,e.slice(n,c)),n=c);continue}if(a)continue;if(/^\s*\|.*\|\s*$/.test(f)||/^\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(f)){l=!0;continue}l&&(Ld(t,e.slice(n,m)),n=m,l=!1),h===""&&(Ld(t,e.slice(n,c)),n=c)}return n<e.length&&Ld(t,e.slice(n)),t}function Ld(e,t){t.trim()&&e.push(t)}function jM(e){const t=e.lastIndexOf(`
|
|
380
|
+
`)}}function t1(e,t=""){return Array.isArray(e)?e.map(n=>t1(n)):e&&typeof e=="object"?Object.fromEntries(Object.entries(e).map(([n,a])=>[n,t1(a,n)])):typeof e=="string"&&(t==="wakeAt"||t==="wake_at")&&$c(e)||e}function ZN(e){return e==="system"||e==="wakeup"||e==="runtime-reset"||e==="clone_initialization"}function QN(e){return e==="runtime-reset"?"Runtime reset":e==="clone_initialization"?"Clone initialization":e==="system"?"System action":"Scheduled wakeup"}function JN(e,t){return e==="runtime-reset"?"Thread rebuilt":e==="clone_initialization"?"Activating inherited context":e==="system"?"Workspace runtime action":t?Fx(t,20):"Auto resumed"}function eM(e,t){if(e.some(l=>l.type==="assistantText"))return cf(e);if(t.length===0)return e;const n=[...t],a=[];for(const l of e)l.type==="tool"&&X1(l.tool)&&K1(n,l.tool)||a.push(l);return cf([...a,...n])}function tM(e,t,n,a){var h;const l=new Map(t.filter(m=>m.id!==void 0).map(m=>[String(m.id),m])),o=new Map,c=new Set;for(const m of e){const g=nM(m,t,l);g.length>0&&c.add(m.id);for(const v of g)o.set(Qa(v),v)}if(n)for(const m of t)rM(e,m)||o.set(Qa(m),m);else if(t.length>0&&!e.some(m=>m.phase==="process"))for(const m of t)o.set(Qa(m),m);for(const m of t){const g=Oe(m.data),v=Oe(g.params);(typeof g.method=="string"&&g.method.startsWith("item/reasoning/")||g.method==="item/completed"&&Oe(v.item).type==="reasoning")&&o.set(Qa(m),m)}const f=xx([...o.values()].sort(Uc),n,a);for(const m of e)if(!c.has(m.id)){if(m.nodeType==="agent_text"&&m.subtype!=="final_answer"&&((h=m.contentMarkdown)!=null&&h.trim())){f.push({id:m.id,type:"assistantText",createdAt:m.createdAt,content:m.contentMarkdown,phase:aM(m),itemId:m.entityType==="codex_item"?m.entityId??void 0:void 0,streaming:n&&m.status==="running"});continue}m.nodeType==="operation"&&f.push({id:m.id,type:"tool",createdAt:m.createdAt,tool:iM(m,a)})}return cf(f)}function nM(e,t,n){if(e.entityType==="event"&&e.entityId){const a=n.get(e.entityId);return a&&e.phase==="process"&&e.status==="running"?[a]:[n1(e)]}if(e.entityType==="codex_item"&&e.entityId){const a=t.filter(l=>W1(l)===e.entityId);return a.length>0?a:[n1(e)]}return[]}function n1(e){const t=Oe(e.detail),n=e.subtype==="server.collaboration.message_staged"&&e.phase==="result"?e.status==="failed"?"server.collaboration.message_rejected":We(t.messageId)?"server.collaboration.message_sent":e.subtype:e.subtype;return{id:e.entityId??e.id,turnId:e.turnId,seq:e.sequence,event:e.entityType==="codex_item"?"codex.notification":n,data:e.detail,createdAt:e.updatedAt||e.createdAt}}function rM(e,t){const n=t.id===void 0?null:String(t.id),a=W1(t);return e.some(l=>n!==null&&l.entityType==="event"&&l.entityId===n||a!==null&&l.entityType==="codex_item"&&l.entityId===a)}function W1(e){if(e.event!=="codex.notification"&&e.event!=="server.item.snapshot")return null;const t=Oe(e.data),n=Oe(t.params),a=Oe(n.item);return We(a.id)||We(n.itemId)||null}function aM(e){return e.subtype==="final_answer"?"final_answer":e.phase==="process"?"commentary":"unknown"}function iM(e,t){var a,l;const n=Oe(e.detail);return{id:e.id,kind:e.status==="failed"?"error":"activity",title:e.subtype==="input:collaboration_notice"?Kp(n,t).title:e.title||Px(e.subtype),body:e.subtype==="input:collaboration_notice"?Kp(n,t).detail:((a=e.summary)==null?void 0:a.trim())||((l=e.contentMarkdown)==null?void 0:l.trim())||Lx(n),createdAt:e.createdAt,itemId:e.entityType==="codex_item"?e.entityId??void 0:void 0,meta:e.status}}function xx(e,t,n){const a=[],l=new Map,o=new Map,c=new Map,f=new Map,h=new Map;for(const m of e){const g=OA(l,m.data);if(g){const z=IA(g);let M=o.get(g.itemId);!M&&z&&(M={id:`reasoning-${m.id}`,type:"reasoning",createdAt:m.createdAt??new Date().toISOString(),content:z,streaming:!1},o.set(g.itemId,M),a.push(M)),M&&(M.content=z,M.streaming=t&&!g.completed);continue}if(m.event==="server.workspace_change.decision"||m.event==="server.responsibility.decision"){oM(a,m);continue}if(m.event==="server.knowledge.decision"){uM(a,m);continue}if(wx(m)){hM(a);continue}if(m.event==="server.steer"){const z=Oe(m.data),M=typeof z.message=="string"?z.message.trim():"";a.push({id:`steer-${m.id}`,type:"steerMarker",createdAt:m.createdAt??new Date().toISOString(),content:M||"Additional input",messageId:typeof z.messageId=="string"?z.messageId:void 0});continue}const v=MD(m.data);v!=null&&v.itemId&&h.set(v.itemId,v.phase);const k=ND(m.data);if(k!=null&&k.text){const z=k.itemId?h.get(k.itemId)??k.phase:k.phase,M=k.itemId??`phase:${z}`,B=`${c.get(M)??""}${k.text}`,U=Ax(B),ne=f.get(M)??"",L=U.startsWith(ne)?U.slice(ne.length):U;if(c.set(M,B),f.set(M,U),L){const K=a[a.length-1];(K==null?void 0:K.type)==="assistantText"&&dM(K,k.itemId,z)?(K.content+=L,K.itemId=K.itemId??k.itemId,K.streamKey=K.streamKey??M,K.streaming=t):a.push({id:`assistant-event-${m.id}`,type:"assistantText",createdAt:m.createdAt??new Date().toISOString(),content:L,phase:z,itemId:k.itemId,streamKey:M,streaming:t})}continue}const b=zD(m.data);if(b!=null&&b.text){const z=Kc(b.text),M=b.itemId??`phase:${b.phase}`,B=fM(a,b.itemId,b.phase);if(B>=0){const U=a[B];U.type==="assistantText"&&(z?(U.content=z,U.phase=b.phase,U.itemId=U.itemId??b.itemId,U.streamKey=U.streamKey??M,U.streaming=!1,sM(a,B,b.itemId)):a.splice(B,1))}else z&&a.push({id:`assistant-completed-${m.id}`,type:"assistantText",createdAt:m.createdAt??new Date().toISOString(),content:z,phase:b.phase,itemId:b.itemId,streamKey:M,streaming:!1});continue}const T=nD(m,n);if(T){T.rawEvents=[m];const z=l5(a,T);if(z>=0){s5(a[z],T);continue}if(X1(T)&&K1(a,T)||T.kind==="command"&&T.meta==="running"&&df(T.body))continue;a.push({id:`tool-${T.id}`,type:"tool",createdAt:T.createdAt,tool:T});continue}const A=rD(m);if(A){A.rawEvents=[m];const z=l5(a,A);if(z>=0){s5(a[z],A);continue}a.push({id:`tool-${A.id}`,type:"tool",createdAt:A.createdAt,tool:A});continue}if(VA(m)){lM(a,m);continue}const q=aD(m);q&&(q.rawEvents=[m],a.push({id:`tool-${q.id}`,type:"tool",createdAt:q.createdAt,tool:q}))}return cf(a)}function lM(e,t){const n=W1(t);if(n)for(let a=e.length-1;a>=0;a-=1){const l=e[a];if(!(l.type!=="tool"||l.tool.itemId!==n)){l.tool={...l.tool,rawEvents:kx(l.tool.rawEvents,[t])};return}}}function sM(e,t,n){if(n)for(let a=e.length-1;a>t;a-=1){const l=e[a];l.type==="assistantText"&&l.itemId===n&&e.splice(a,1)}}function oM(e,t){const n=Oe(t.data),a=typeof n.proposalId=="string"?n.proposalId:void 0,l=typeof n.decision=="string"?n.decision:void 0,o=Oe(n.payload),c=We(o.content)||(typeof n.responsibility=="string"?n.responsibility:void 0);if(!(!a||l!=="accept"&&l!=="decline"))for(let f=e.length-1;f>=0;f-=1){const h=e[f];if(h.type==="tool"&&(h.tool.kind==="responsibility"||h.tool.kind==="workspaceChange")&&(h.tool.workspaceChangeProposalId===a||h.tool.responsibilityProposalId===a)){const m=vE(h.tool.meta,l);h.tool={...h.tool,title:m==="saved"?"Workspace change applied":"Workspace change declined",meta:m,body:m==="saved"?c??h.tool.body:h.tool.body,workspaceChangePayload:m==="saved"&&Object.keys(o).length>0?o:h.tool.workspaceChangePayload};return}}}function uM(e,t){const n=Oe(t.data),a=typeof n.proposalId=="string"?n.proposalId:void 0,l=typeof n.decision=="string"?n.decision:void 0,o=Oe(n.knowledge);if(!(!a||l!=="accept"&&l!=="decline"))for(let c=e.length-1;c>=0;c-=1){const f=e[c];if(f.type==="tool"&&f.tool.kind==="knowledge"&&f.tool.knowledgeProposalId===a){f.tool={...f.tool,title:l==="accept"?"Knowledge saved":"Knowledge proposal declined",meta:l==="accept"?"saved":"declined",body:l==="accept"&&Object.keys(o).length>0?JSON.stringify(o,null,2):f.tool.body};return}}}function K1(e,t){const n=bx(t);if(typeof n!="number")return!1;for(let o=0;o<e.length;o+=1){const c=e[o];if(c.type!=="assistantText"||!i5(c,t))continue;const f=Kc(c.content);f!==c.content&&(e[o]={...c,content:f})}let a=0,l=-1;for(let o=0;o<e.length;o+=1){const c=e[o];if(c.type!=="assistantText"||!i5(c,t))continue;l=o;const f=a,h=f+c.content.length;if(a=h,n>=h)continue;const m=Math.max(0,Math.min(c.content.length,n-f)),g=c.content.slice(0,m).trimEnd(),v=c.content.slice(m).trimStart(),k=[];return g&&k.push({...c,id:`${c.id}:before-tool-${t.id}`,content:g,pinnedToResult:!0}),k.push({id:`tool-${t.id}`,type:"tool",createdAt:t.createdAt,tool:t}),v&&k.push({...c,id:`${c.id}:after-tool-${t.id}`,content:v,pinnedToResult:!0}),e.splice(o,1,...k),!0}if(l>=0&&n>=a){const o=e[l];return(o==null?void 0:o.type)==="assistantText"&&(e[l]={...o,pinnedToResult:!0}),e.splice(l+1,0,{id:`tool-${t.id}`,type:"tool",createdAt:t.createdAt,tool:t}),!0}return!1}function i5(e,t){return!t.anchorStreamKey||e.streamKey===t.anchorStreamKey}function cf(e){const t=[],n=[];for(const o of e){if(o.type==="tool"&&X1(o.tool)){t.push(o.tool);continue}n.push(o)}const a=[...n],l=[];for(const o of t)K1(a,o)||l.push({id:`tool-${o.id}`,type:"tool",createdAt:o.createdAt,tool:o});return cM([...l,...a])}function X1(e){return typeof bx(e)=="number"}function bx(e){if(typeof e.anchorOffset=="number")return e.anchorOffset;if(e.kind==="responsibility")return e.responsibilityAnchorOffset;if(e.kind==="knowledge")return e.knowledgeAnchorOffset}function cM(e){const t=[];for(let n=0;n<e.length;n+=1){const a=e[n],l=e[n+1];if((a==null?void 0:a.type)==="tool"&&a.tool.kind==="responsibility"&&typeof a.tool.responsibilityAnchorOffset!="number"&&(l==null?void 0:l.type)==="assistantText"){t.push({...l,pinnedToResult:!0}),t.push(a),n+=1;continue}t.push(a)}return t}function dM(e,t,n){return e.type!=="assistantText"?!1:e.itemId&&t?e.itemId===t:e.itemId||t?!1:e.phase===n}function fM(e,t,n){if(t){const a=e.findIndex(l=>l.type==="assistantText"&&l.itemId===t);if(a>=0)return a}for(let a=e.length-1;a>=0;a-=1){const l=e[a];if(l.type==="assistantText"&&l.streaming&&(!t||!l.itemId)&&(l.phase===n||l.phase==="unknown"||n==="unknown"))return a}return-1}function wx(e){return e.event==="server.stop"||e.event==="server.stopped"}function hM(e){for(const t of e)t.type==="tool"&&t.tool.kind==="command"&&t.tool.meta==="running"&&(t.tool={...t.tool,title:"Command stopped",meta:"stopped"})}function mM(e){for(let t=e.length-1;t>=0;t-=1){const n=e[t];if(n.event!=="server.notification.failed")continue;const a=Oe(n.data);return typeof a.message=="string"?a.message:"Notification failed"}return null}function pM(e){for(let t=e.length-1;t>=0;t-=1){const n=Gx(e[t]);if(n)return n}return null}function l5(e,t){for(let n=e.length-1;n>=0;n-=1){const a=e[n];if(a.type==="tool"&&a.tool.kind===t.kind&&(t.itemId&&a.tool.itemId===t.itemId||a.tool.body===t.body&&a.tool.meta==="running"))return n}return-1}function s5(e,t){if(e.type!=="tool")return;const n=e.tool.kind==="command"&&e.tool.meta!=="running"&&t.meta==="running",a=e.tool.kind==="command"&&t.kind==="command"&&df(t.body)&&!df(e.tool.body);e.tool={...e.tool,...t,id:e.tool.id,createdAt:e.tool.createdAt,title:n?e.tool.title:t.title,body:a?e.tool.body:t.body,meta:n?e.tool.meta:t.meta,output:t.outputKind?TA(e.tool.output,t.output,t.outputKind):vD(e.tool.output,t.output),topicRecipientLabel:t.topicRecipientLabel??e.tool.topicRecipientLabel,topicMessageContent:t.topicMessageContent??e.tool.topicMessageContent,rawEvents:kx(e.tool.rawEvents,t.rawEvents)}}function kx(e,t){const n=[...e??[],...t??[]];if(n.length===0)return;const a=new Set;return n.filter(l=>{const o=Qa(l);return a.has(o)?!1:(a.add(o),!0)})}function Ec(e){return{id:`message-${e.id}`,type:"message",createdAt:e.createdAt,message:e}}function Pd(e,t){const n=new Set,a=[...e,...t].filter(l=>n.has(l.id)?!1:(n.add(l.id),!0));return a.filter(l=>Sx(l)?!a.some(o=>gM(o,l)):!0)}function Gd(e,t){const n=new Map;for(const a of[...e,...t])n.set(a.id,a);return[...n.values()].sort((a,l)=>Date.parse(a.startedAt)-Date.parse(l.startedAt))}function Vd(e,t){const n=new Map;for(const a of[...e,...t])n.set(a.id,a);return[...n.values()].sort((a,l)=>a.timelineAt.localeCompare(l.timelineAt)||a.sequence-l.sequence)}function Sx(e){return e.id.startsWith("local-")}function gM(e,t){if(Sx(e)||e.role!==t.role||e.content.trim()!==t.content.trim())return!1;const n=Date.parse(e.createdAt),a=Date.parse(t.createdAt);return Number.isNaN(n)||Number.isNaN(a)?!1:Math.abs(n-a)<=12e4}function _d(e,t){const n=new Map,a=new Map;for(const o of[...e,...t]){const c=Qa(o);a.has(c)||a.set(c,a.size),n.set(c,o)}return[...n.values()].sort((o,c)=>{const f=jx(o,c);return f!==0?f:(a.get(Qa(o))??0)-(a.get(Qa(c))??0)})}function o5(e,t){const n=Qa(t),a=e.findIndex(o=>Qa(o)===n);if(a<0)return[...e,t];if(yM(e[a],t))return e;const l=[...e];return l[a]=t,l}function yM(e,t){return e.turnId===t.turnId&&e.event===t.event&&e.createdAt===t.createdAt&&e.seq===t.seq&&JSON.stringify(e.data)===JSON.stringify(t.data)}function Qa(e){return e.id!==void 0?`${typeof e.id}:${e.id}`:`${e.event}:${e.createdAt??""}:${JSON.stringify(e.data)}`}function Uc(e,t){const n=jx(e,t);return n!==0?n:vM(e.id,t.id)}function jx(e,t){if(e.turnId&&t.turnId&&e.turnId===t.turnId&&typeof e.seq=="number"&&typeof t.seq=="number"&&e.seq!==t.seq)return e.seq-t.seq;const n=Date.parse(e.createdAt??""),a=Date.parse(t.createdAt??"");return!Number.isNaN(n)&&!Number.isNaN(a)&&n!==a?n-a:Number.isNaN(n)!==Number.isNaN(a)?Number.isNaN(n)?1:-1:0}function vM(e,t){return e===t?0:e===void 0?1:t===void 0?-1:typeof e=="number"&&typeof t=="number"?e-t:String(e).localeCompare(String(t))}function u5(e,t){const n=Oe(e.data);return typeof n.__seq=="number"&&typeof n.__createdAt=="string"&&Object.prototype.hasOwnProperty.call(n,"payload")?{id:typeof n.__eventId=="string"?n.__eventId:`stream:${n.__turnId??"unknown"}:${n.__seq}`,turnId:typeof n.__turnId=="string"?n.__turnId:null,seq:n.__seq,event:e.event,data:n.payload,createdAt:n.__createdAt}:{id:t,turnId:e.turnId??null,event:e.event,data:e.data,createdAt:e.createdAt??new Date().toISOString()}}const Go=D.memo(function({content:t,conversation:n,streaming:a,onPreviewArtifact:l,onCopyArtifactUrl:o,copiedArtifactUrl:c}){const f=a?Ax(t):Kc(t),h=n&&!a?TM(f,n):[];return u.jsxs(u.Fragment,{children:[a?u.jsx(wM,{content:f,conversation:n}):Os(f,n),h.length>0?u.jsx("div",{className:"artifact-preview-list",children:h.map(m=>u.jsx(CM,{artifact:m,onPreview:l,onCopyUrl:o,copied:c===m.url},m.id))}):null]})},xM);function xM(e,t){var n,a,l,o;return e.content===t.content&&e.streaming===t.streaming&&e.copiedArtifactUrl===t.copiedArtifactUrl&&((n=e.conversation)==null?void 0:n.id)===((a=t.conversation)==null?void 0:a.id)&&((l=e.conversation)==null?void 0:l.workspacePath)===((o=t.conversation)==null?void 0:o.workspacePath)}function c5({content:e}){return u.jsx("div",{className:"plain-message-content",children:e})}const bM=2;function wM({content:e,conversation:t}){const n=D.useRef(null),[a,l]=D.useState(null),{committedBlocks:o,activeBlock:c}=kM(e);return D.useLayoutEffect(()=>{const f=n.current;if(!f)return;const h=parseFloat(window.getComputedStyle(f).lineHeight)||28,m=f.scrollHeight;l(g=>{const v=h*bM,k=Math.min(m,v);return g!==null&&k<=g?g:k})},[e]),u.jsxs("div",{className:"streaming-message-content",ref:n,style:a===null?void 0:{minHeight:a},children:[o.map((f,h)=>u.jsx(D.Fragment,{children:Os(f,t)},`${h}:${f.length}`)),c?u.jsx("p",{className:"streaming-active-line",children:c}):null]})}function kM(e){const t=jM(e),n=t>0?e.slice(0,t):"",a=e.slice(t);return{committedBlocks:SM(n),activeBlock:a}}function SM(e){const t=[];let n=0,a=!1,l=!1;const o=e.match(/[^\n]*(?:\n|$)/g)??[];let c=0;for(const f of o){if(!f)continue;const h=f.trim(),m=c;if(c+=f.length,/^\s*(```|~~~)/.test(f)){a=!a,a||(Ld(t,e.slice(n,c)),n=c);continue}if(a)continue;if(/^\s*\|.*\|\s*$/.test(f)||/^\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(f)){l=!0;continue}l&&(Ld(t,e.slice(n,m)),n=m,l=!1),h===""&&(Ld(t,e.slice(n,c)),n=c)}return n<e.length&&Ld(t,e.slice(n)),t}function Ld(e,t){t.trim()&&e.push(t)}function jM(e){const t=e.lastIndexOf(`
|
|
381
381
|
`);if(t<0)return 0;const n=[0];for(let l=0;l<e.length;l+=1)e[l]===`
|
|
382
382
|
`&&l+1<e.length&&n.push(l+1);let a=-1;for(const l of n){const o=e.indexOf(`
|
|
383
383
|
`,l),c=e.slice(l,o===-1?e.length:o);/^\s*(```|~~~)/.test(c)&&(a=a===-1?l:-1)}return a>=0?a:t+1}function CM({artifact:e,onPreview:t,onCopyUrl:n,copied:a}){return e?u.jsxs("figure",{className:"artifact-preview",children:[u.jsx("button",{className:"artifact-preview-media",onClick:()=>t(e),type:"button",children:u.jsx("img",{alt:e.name,src:e.url})}),u.jsxs("figcaption",{children:[u.jsx("span",{children:e.name}),u.jsxs("div",{className:"artifact-preview-actions",children:[u.jsx("button",{onClick:()=>t(e),type:"button",children:"Preview"}),u.jsx("a",{href:e.url,rel:"noreferrer",target:"_blank",children:"Open"}),u.jsx("button",{onClick:()=>n(e),type:"button",children:a?"Copied":"Copy"})]})]})]}):null}function TM(e,t){const n=new Map;for(const a of AM(e)){const l=Cx(a);if(l){const o=Tx(l).toLowerCase(),c=n.get(o);(!c||MM(l,c))&&n.set(o,l)}}return Array.from(n.values()).map(a=>EM(a,t)).filter(a=>a!==null)}function AM(e){const t=[],n=/!\[[^\]]*]\(([^)]+)\)/g,a=/\[[^\]]+]\(([^)]+)\)/g,l=/(?:artifact|preview|image|file)\s*:\s*(`?[^`\n]+?\.(?:svg|png|jpe?g|webp|gif)`?)/gim;for(const o of[n,a,l]){let c;for(;(c=o.exec(e))!==null;)t.push(c[1])}return t}function EM(e,t){const n=Cx(e);if(!n||!NM(n))return null;const a=nx(n,t.workspacePath);return{id:`${t.id}:${a}`,path:a,name:Tx(a),url:ze(`conversations/${t.id}/files?path=${encodeURIComponent(a)}`)}}function Cx(e){const t=e.trim().replace(/^`+|`+$/g,"").replace(/[),.;:,。;:]+$/g,"");return t||null}function NM(e){return/\.(?:svg|png|jpe?g|webp|gif)$/i.test(e)}function Tx(e){return e.replace(/\\/g,"/").split("/").filter(Boolean).pop()??e}function MM(e,t){return e.startsWith("/")&&!t.startsWith("/")?!0:e.length>t.length}function Kc(e){return e.trim()}function Ax(e){return e.trim()}function d5(e){return e instanceof DOMException&&e.name==="AbortError"||e instanceof Error&&e.name==="AbortError"}function zM(e){return{a({children:t,href:n}){if(!n)return u.jsx(u.Fragment,{children:t});const a=/^[a-z][a-z\d+.-]*:/i.test(n),l=tx(n);if(n.startsWith("seele-public:")&&!l)return u.jsxs("span",{title:"无效的 Seele Public URL 地址",children:[t,"(地址格式无效)"]});const o=!a&&e?DM(n,e):null,c=l?ze(`deployment/public-link?path=${encodeURIComponent(l)}`):o??n,f=a||!!o;return u.jsx("a",{className:"markdown-link",href:c,rel:f?"noreferrer":void 0,target:f?"_blank":void 0,children:t})},img(){return null},pre({children:t}){const n=OM(t);return n?Z1(n.language)==="mermaid"?u.jsx(IM,{code:n.code}):u.jsx(BM,{code:n.code,language:n.language}):u.jsx("pre",{children:t})},table({children:t}){return u.jsx("div",{className:"markdown-table-wrap",children:u.jsx("table",{className:"markdown-table",children:t})})},td({align:t,children:n}){return u.jsx("td",{style:f5(t),children:n})},th({align:t,children:n}){return u.jsx("th",{style:f5(t),children:n})}}}function DM(e,t){if(!e||e.startsWith("#")||e.startsWith("/api/")||e.startsWith("?"))return null;const n=wE(e,t.workspacePath);if(!n)return null;const a=n.line?`#L${n.line}${n.column?`C${n.column}`:""}`:"";return`${ze(`conversations/${t.id}/files?path=${encodeURIComponent(n.path)}`)}${a}`}function f5(e){return e&&e!=="char"?{textAlign:e}:void 0}function Os(e,t){const n=YT(RM(e));return u.jsx(Rk,{urlTransform:a=>tx(a)?a:gv(a),components:zM(t),remarkPlugins:[Pj,VT],rehypePlugins:[[CA,{trust:!1,strict:"ignore"}]],skipHtml:!0,children:n})}function RM(e){return e.replace(/([^\n])(```[^\n`]*(?:\r?\n|$))/g,`$1
|
|
384
|
-
$2`)}function OM(e){var o;const t=D.Children.toArray(e),n=t.length===1&&D.isValidElement(t[0])?t[0]:null;if(!n||n.type!=="code")return null;const l=((o=(n.props.className??"").match(/(?:^|\s)language-([^\s]+)/))==null?void 0:o[1])??"";return{code:r1(n.props.children).replace(/\n$/,""),language:l}}function r1(e){return e==null||typeof e=="boolean"?"":typeof e=="string"||typeof e=="number"||typeof e=="bigint"?String(e):Array.isArray(e)?e.map(r1).join(""):D.isValidElement(e)?r1(e.props.children):""}const Ex="github-light",dp=new Map,fp=new Map;let hp=null,mp=null;const Nx=new Set(["bash","css","diff","dockerfile","html","java","javascript","json","jsonc","jsx","markdown","python","shellscript","sql","toml","tsx","typescript","xml","yaml"]);function Z1(e){const t=e.trim().toLowerCase().replace(/^\./,"");return{bash:"bash",cjs:"javascript",console:"shellscript",htm:"html",js:"javascript",jsx:"jsx",md:"markdown",mjs:"javascript",py:"python",rb:"ruby",shell:"bash",ts:"typescript",tsx:"tsx",yml:"yaml",zsh:"bash"}[t]??t}function Mx(e){const t=Z1(e);return!t||t==="text"||t==="txt"?"text":Nx.has(t)?t:"text"}function IM({code:e}){const n=`seele-mermaid-${D.useId().replace(/[^a-zA-Z0-9_-]/g,"")}`,[a,l]=D.useState(!1),[o,c]=D.useState(()=>fp.get(e)??null),[f,h]=D.useState(null);D.useEffect(()=>{let g=!1,v;const k=fp.get(e);return k?(c(k),h(null),()=>{g=!0}):(h(null),c(null),_M(n,e).then(b=>{g||(v!==void 0&&window.clearTimeout(v),fp.set(e,b),c(b),h(null))},b=>{if(!g){const T=b instanceof Error?b.message:String(b);v=window.setTimeout(()=>{g||h(T)},DE)}}),()=>{g=!0,v!==void 0&&window.clearTimeout(v)})},[e,n]);async function m(){await navigator.clipboard.writeText(e),l(!0),window.setTimeout(()=>l(!1),1200)}return u.jsxs("figure",{className:`mermaid-block${f?" error":""}`,children:[u.jsx("span",{className:"code-block-kind",children:"mermaid"}),u.jsx("div",{className:"code-block-tools",children:u.jsx("button",{"aria-label":a?"Copied Mermaid source":"Copy Mermaid source",className:a?"copied":"",onClick:()=>void m(),title:a?"Copied":"Copy",type:"button",children:u.jsx(Q1,{})})}),o?u.jsx("div",{className:"mermaid-diagram",dangerouslySetInnerHTML:{__html:o}}):f?u.jsxs("div",{className:"mermaid-error",children:[u.jsx("strong",{children:"Mermaid render failed"}),u.jsx("pre",{children:f}),u.jsx("code",{children:e})]}):u.jsx("div",{className:"mermaid-loading",children:"Rendering diagram..."})]})}async function _M(e,t){return(await(await LM()).render(e,t)).svg}function LM(){return mp||(mp=on(()=>import("./mermaid.core-CeDonWvV.js").then(e=>e.bp),[],import.meta.url).then(e=>{const t=e.default;return t.initialize({startOnLoad:!1,securityLevel:"strict",theme:"base",themeVariables:{background:"#ffffff",primaryColor:"#f9fafa",primaryBorderColor:"#d8d9e8",primaryTextColor:"#0b0f16",lineColor:"#7a8294",secondaryColor:"#f5f5fb",tertiaryColor:"#ffffff",fontFamily:'Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'}}),t})),mp}function BM({code:e,language:t,reserveHeight:n=!1}){const[a,l]=D.useState(!1),[o,c]=D.useState(()=>{if(!p5(t))return null;const m=m5(e,t);return dp.get(m)??null}),f=n?{"--code-block-min-height":`${FE(e)}px`}:void 0;D.useEffect(()=>{let m=!1;if(!p5(t))return c(null),()=>{m=!0};const g=m5(e,t),v=dp.get(g);return v?(c(v),()=>{m=!0}):(c(null),VM(e,t).then(k=>{dp.set(g,k),m||c(k)}).catch(k=>{console.warn("Failed to highlight code block",k),m||c(null)}),()=>{m=!0})},[e,t]);async function h(){await navigator.clipboard.writeText(e),l(!0),window.setTimeout(()=>l(!1),1200)}return u.jsxs("figure",{className:"code-block",style:f,children:[t?u.jsx("span",{className:"code-block-kind",children:t}):null,u.jsx("div",{className:"code-block-tools",children:u.jsx("button",{"aria-label":a?"Copied code block":"Copy code block",className:a?"copied":"",onClick:()=>void h(),title:a?"Copied":"Copy",type:"button",children:u.jsx(Q1,{})})}),o?u.jsx("div",{className:"code-block-shiki",dangerouslySetInnerHTML:{__html:o}}):u.jsx("pre",{children:u.jsx("code",{children:e})})]})}function Q1(){return u.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:[u.jsx("rect",{height:"14",rx:"2",stroke:"currentColor",strokeWidth:"2",width:"14",x:"8",y:"8"}),u.jsx("path",{d:"M4 16V6a2 2 0 0 1 2-2h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})}function qM(){return u.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"16",viewBox:"0 0 24 24",width:"16",children:[u.jsx("circle",{cx:"6",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"2"}),u.jsx("circle",{cx:"18",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"2"}),u.jsx("circle",{cx:"12",cy:"19",r:"2",stroke:"currentColor",strokeWidth:"2"}),u.jsx("path",{d:"M6 7v1a6 6 0 0 0 6 6v3M18 7v1a6 6 0 0 1-6 6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})]})}function zx(){return u.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"12",viewBox:"0 0 24 24",width:"12",children:[u.jsx("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"2.2"}),u.jsx("path",{d:"M12 7v6",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2.4"}),u.jsx("circle",{cx:"12",cy:"17",fill:"currentColor",r:"1.25"})]})}function UM(){return u.jsx("svg",{"aria-hidden":"true",fill:"none",height:"18",viewBox:"0 0 24 24",width:"18",children:u.jsx("path",{d:"M4 7h16M4 12h16M4 17h16",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})})}function HM(){return u.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[u.jsx("path",{d:"M7 7h10M7 12h10M7 17h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"}),u.jsx("circle",{cx:"4",cy:"7",fill:"currentColor",r:"1.4"}),u.jsx("circle",{cx:"4",cy:"12",fill:"currentColor",r:"1.4"}),u.jsx("circle",{cx:"4",cy:"17",fill:"currentColor",r:"1.4"})]})}function h5(){return u.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[u.jsx("circle",{cx:"12",cy:"12",r:"3",stroke:"currentColor",strokeWidth:"2"}),u.jsx("path",{d:"M19 12a7.8 7.8 0 0 0-.1-1l2-1.5-2-3.4-2.4 1a8 8 0 0 0-1.8-1l-.3-2.6h-4l-.3 2.6a8 8 0 0 0-1.8 1l-2.4-1-2 3.4 2 1.5a7.8 7.8 0 0 0 0 2l-2 1.5 2 3.4 2.4-1a8 8 0 0 0 1.8 1l.3 2.6h4l.3-2.6a8 8 0 0 0 1.8-1l2.4 1 2-3.4-2-1.5c.1-.3.1-.7.1-1Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.7"})]})}function $M(){return u.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[u.jsx("rect",{height:"16",rx:"2.6",stroke:"currentColor",strokeWidth:"1.8",width:"18",x:"3",y:"4"}),u.jsx("path",{d:"m7 9 3 3-3 3M12.5 15h4.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.9"})]})}function Yd(){return u.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"17",viewBox:"0 0 24 24",width:"17",children:[u.jsx("circle",{cx:"7",cy:"12",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),u.jsx("circle",{cx:"17",cy:"7",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),u.jsx("circle",{cx:"17",cy:"17",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),u.jsx("path",{d:"m9.2 10.9 5.6-2.8M9.2 13.1l5.6 2.8",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.8"})]})}function Rf(){return u.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:[u.jsx("path",{d:"m4 16-.8 4 4-.8L18.4 8 15.2 4.8 4 16Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"2"}),u.jsx("path",{d:"m13.8 6.2 3.2 3.2",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})}function FM(){return u.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:u.jsx("path",{d:"M5 8v11h14V8M4 4h16v4H4zM9 12h6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})})}function PM(){return u.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[u.jsx("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"2"}),u.jsx("circle",{cx:"12",cy:"12",r:"3",stroke:"currentColor",strokeWidth:"2"})]})}function GM(){return u.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[u.jsx("path",{d:"M3 3l18 18",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"}),u.jsx("path",{d:"M9.9 5.4A9.8 9.8 0 0 1 12 5c6 0 9.5 7 9.5 7a15.5 15.5 0 0 1-3 3.8M6.2 6.8C3.8 8.4 2.5 12 2.5 12s3.5 7 9.5 7a9.7 9.7 0 0 0 4-.8",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})]})}function m5(e,t){return`${Ex}:${Mx(t)}:${e}`}function p5(e){const t=Z1(e);return!!t&&Nx.has(t)}async function VM(e,t){return(await YM()).codeToHtml(e,{lang:Mx(t),theme:Ex})}function YM(){return hp||(hp=WM()),hp}async function WM(){const[{createHighlighterCore:e},{createJavaScriptRegexEngine:t},{default:n},{default:a},{default:l},{default:o},{default:c},{default:f},{default:h},{default:m},{default:g},{default:v},{default:k},{default:b},{default:T},{default:A},{default:q},{default:z},{default:M},{default:B},{default:U},{default:ae}]=await Promise.all([on(()=>import("./core-DSYKin3G.js"),[],import.meta.url),on(()=>import("./engine-javascript-DBd1bXLz.js"),[],import.meta.url),on(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url),on(()=>import("./bash-BELqPA7S.js").then(L=>L.b),[],import.meta.url),on(()=>import("./css-CLj8gQPS.js"),[],import.meta.url),on(()=>import("./diff-D97Zzqfu.js"),[],import.meta.url),on(()=>import("./dockerfile-BcOcwvcX.js"),[],import.meta.url),on(()=>import("./html-pp8916En.js"),__vite__mapDeps([0,1,2]),import.meta.url),on(()=>import("./java-CylS5w8V.js"),[],import.meta.url),on(()=>import("./javascript-wDzz0qaB.js"),[],import.meta.url),on(()=>import("./json-Cp-IABpG.js"),[],import.meta.url),on(()=>import("./jsonc-Des-eS-w.js"),[],import.meta.url),on(()=>import("./jsx-g9-lgVsj.js"),[],import.meta.url),on(()=>import("./markdown-Cvjx9yec.js"),[],import.meta.url),on(()=>import("./python-B6aJPvgy.js"),[],import.meta.url),on(()=>import("./bash-BELqPA7S.js").then(L=>L.s),[],import.meta.url),on(()=>import("./sql-CRqJ_cUM.js"),[],import.meta.url),on(()=>import("./toml-vGWfd6FD.js"),[],import.meta.url),on(()=>import("./tsx-COt5Ahok.js"),[],import.meta.url),on(()=>import("./typescript-BPQ3VLAy.js"),[],import.meta.url),on(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([3,4]),import.meta.url),on(()=>import("./yaml-Buea-lGh.js"),[],import.meta.url)]);return e({engine:t(),themes:[n],langs:[a,l,o,c,f,h,m,g,v,k,b,T,A,q,z,M,B,U,ae]})}async function g5(){const e=ze("conversations"),t=await fetch(e);return await Fe(t,{url:e}),(await t.json()).conversations}async function KM(){const e=ze("workspace-states"),t=await fetch(e);return await Fe(t,{url:e}),(await t.json()).workspaces}async function y5(){const e=ze("collaboration/topics"),t=await fetch(e);return await Fe(t,{url:e}),(await t.json()).topics}async function Bd(e){const t=ze(`collaboration/topics/${e}/messages?limit=100`),n=await fetch(t);return await Fe(n,{url:t}),(await n.json()).messages}async function XM(e){const t=ze("collaboration/topics"),n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Fe(n,{method:"POST",url:t}),(await n.json()).topic}async function ZM(e,t){const n=ze(`collaboration/topics/${e}`),a=await fetch(n,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await Fe(a,{method:"PATCH",url:n}),(await a.json()).topic}async function QM(e,t){const n=ze(`collaboration/topics/${e}/archive`),a=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedVersion:t})});return await Fe(a,{method:"POST",url:n}),(await a.json()).topic}async function JM(e){const t=ze(`conversations/${e}/read`),n=await fetch(t,{method:"POST"});await Fe(n,{method:"POST",url:t})}async function v5(){const e=ze("workspace-groups"),t=await fetch(e);return await Fe(t,{url:e}),(await t.json()).groups}async function ez(e){const t=ze("workspace-groups"),n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e})});return await Fe(n,{method:"POST",url:t}),(await n.json()).group}async function tz(e,t){const n=ze(`workspace-groups/${e}`),a=await fetch(n,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await Fe(a,{method:"PATCH",url:n}),(await a.json()).group}async function nz(e){const t=ze(`workspace-groups/${e}`),n=await fetch(t,{method:"DELETE"});return await Fe(n,{method:"DELETE",url:t}),await n.json()}async function rz(){const e=ze("settings/environment"),t=await fetch(e);return await Fe(t,{url:e}),(await t.json()).variables}async function az(e){const t=ze(`conversations/${e}/settings/environment`),n=await fetch(t);return await Fe(n,{url:t}),(await n.json()).variables}async function iz(e){const t=ze(`conversations/${e}/knowledge`),n=await fetch(t);return await Fe(n,{url:t}),(await n.json()).items}async function lz(){const e=ze("settings/model-providers"),t=await fetch(e);return await Fe(t,{url:e}),t.json()}async function sz(){const e=ze("settings/model-providers/options"),t=await fetch(e);return await Fe(t,{url:e}),t.json()}async function oz(e){const t=ze(`settings/model-providers/${encodeURIComponent(e)}/balance`),n=await fetch(t);return await Fe(n,{url:t}),n.json()}async function uz(e){const t=ze("settings/model-providers"),n=await fetch(t,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Fe(n,{url:t,method:"PUT"}),n.json()}async function cz(){const e=ze("settings/runtime"),t=await fetch(e);return await Fe(t,{url:e}),(await t.json()).settings}async function dz(){const e=ze("settings/deployment"),t=await fetch(e);return await Fe(t,{url:e}),(await t.json()).settings}async function fz(){const e=ze("diagnostics"),t=await fetch(e);return await Fe(t,{url:e}),await t.json()}async function hz(){const e=ze("settings/runtime/codex"),t=await fetch(e);return await Fe(t,{url:e}),await t.json()}async function x5(){const e=ze("settings/runtime/accounts"),t=await fetch(e);await Fe(t,{url:e});const n=await t.json();return Bs(),n}async function pp(e=!1){const t=ze(`settings/runtime/accounts/refresh${e?"?force=1":""}`),n=await fetch(t,{method:"POST"});await Fe(n,{method:"POST",url:t});const a=await n.json();return Bs(),a}async function mz(e){const t=ze("settings/runtime/accounts"),n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})});await Fe(n,{method:"POST",url:t});const a=await n.json();return a.login.status==="succeeded"&&Bs(),a.login}async function pz(e){const t=ze(`settings/runtime/accounts/login/${e}`),n=await fetch(t);return await Fe(n,{url:t}),(await n.json()).login}async function gz(e){const t=ze(`settings/runtime/accounts/login/${e}/cancel`),n=await fetch(t,{method:"POST"});return await Fe(n,{method:"POST",url:t}),(await n.json()).login}async function yz(e,t,n){const a=ze(`settings/runtime/accounts/${e}`),l=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,renewalDay:n})});await Fe(l,{method:"PATCH",url:a});const o=await l.json();return Bs(),o.account}async function vz(e){const t=ze(`settings/runtime/accounts/${e}`),n=await fetch(t,{method:"DELETE"});await Fe(n,{method:"DELETE",url:t}),Bs()}async function xz(e){const t=ze(`settings/runtime/accounts/${e}/switch`),n=await fetch(t,{method:"POST"});await Fe(n,{method:"POST",url:t});const a=await n.json();return Bs(),a}async function bz(e=!0){const t=ze(`settings/runtime/models?refresh=${e?"1":"0"}`),n=await fetch(t);return await Fe(n,{url:t}),await n.json()}async function wz(e=!1){const t=ze(`settings/runtime/codex/update${e?"?refreshLatest=1":""}`),n=await fetch(t);return await Fe(n,{url:t}),await n.json()}async function kz(){const e=ze("settings/runtime/codex/update"),t=await fetch(e,{method:"POST"});return await Fe(t,{method:"POST",url:e}),(await t.json()).job}async function Sz(e){const t=ze(`conversations/${e}/settings/runtime`),n=await fetch(t);return await Fe(n,{url:t}),(await n.json()).settings}async function jz(){const e=ze("settings/memory"),t=await fetch(e);return await Fe(t,{url:e}),await t.json()}async function Cz(e){const t=ze("settings/runtime"),n=await fetch(t,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Fe(n,{method:"PUT",url:t}),(await n.json()).settings}async function Tz(e){const t=ze("settings/deployment"),n=await fetch(t,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Fe(n,{method:"PUT",url:t}),(await n.json()).settings}async function b5(e,t){const n=ze(`conversations/${e}/settings/runtime`),a=await fetch(n,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await Fe(a,{method:"PUT",url:n}),await a.json()}async function w5(e,t){const n=ze(`conversations/${e}/runtime/reset`),a=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});await Fe(a,{method:"POST",url:n});const l=(await a.json()).job;return Rx(e,l)}async function Dx(e){const t=ze(`conversations/${e}/runtime/reset`),n=await fetch(t);return await Fe(n,{url:t}),(await n.json()).job}async function Rx(e,t){let n=t;const a=Date.now()+1800*1e3;for(;n.status==="running";){if(Date.now()>=a)throw new Error("Full-history reset is still running after 30 minutes. Reopen Console to check the workspace before retrying.");await new Promise(o=>window.setTimeout(o,1e3));const l=await Dx(e);if(!l||l.id!==n.id)throw new Error("The runtime reset job is no longer available.");n=l}if(n.status==="failed"||n.status==="cancelled"||!n.result)throw new Error(n.error??"Full-history reset failed.");return n.result}async function k5(e){const t=ze(`conversations/${e}/runtime/reset-preview`),n=await fetch(t);return await Fe(n,{url:t}),await n.json()}async function Az(e,t){const n=ze(`conversations/${e}/runtime/reset-selection`),a=await fetch(n,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});await Fe(a,{method:"PUT",url:n})}async function Ez(e){const t=ze(`conversations/${e}/runtime/thread-read`),n=await fetch(t);return await Fe(n,{url:t}),(await n.json()).result}async function Nz(e){const t=ze(`conversations/${e}/runtime/token-usage`),n=await fetch(t);await Fe(n,{url:t});const a=await n.json();return a.event?Vx(a.event):null}async function Mz(e){const t=ze(`conversations/${e}/runtime/additional-context`),n=await fetch(t);return await Fe(n,{url:t}),await n.json()}async function zz(e){const t=ze(`conversations/${e}/runtime/compactions`),n=await fetch(t);return await Fe(n,{url:t}),(await n.json()).compactions}function Dz(e,t,n){return{modelSource:K6(e.modelSource,t.modelSource)&&(n==null?void 0:n.sources.modelSource)!=="workspace"?null:e.modelSource??{type:"codex"},model:e.model===t.model?null:e.model,reasoningEffort:rE(e.reasoningEffort,t.reasoningEffort,(n==null?void 0:n.sources.reasoningEffort)==="workspace"),fastMode:e.fastMode===t.fastMode?null:e.fastMode,sandbox:e.sandbox===t.sandbox?null:e.sandbox}}function Rz(e){return{kind:e.kind,name:e.name,description:e.description,purpose:e.purpose,attention:e.attention,refreshPolicy:e.refreshPolicy,status:e.status,sourceClues:Iz(e.sourceCluesText),requiredEnv:_z(e.requiredEnvText)}}function Oz(e){return{id:e.id,kind:e.kind,name:e.name,description:e.description,purpose:e.purpose,attention:e.attention,refreshPolicy:e.refreshPolicy,status:e.status,sourceCluesText:e.sourceClues.map(t=>`${t.type}: ${t.value}`).join(`
|
|
384
|
+
$2`)}function OM(e){var o;const t=D.Children.toArray(e),n=t.length===1&&D.isValidElement(t[0])?t[0]:null;if(!n||n.type!=="code")return null;const l=((o=(n.props.className??"").match(/(?:^|\s)language-([^\s]+)/))==null?void 0:o[1])??"";return{code:r1(n.props.children).replace(/\n$/,""),language:l}}function r1(e){return e==null||typeof e=="boolean"?"":typeof e=="string"||typeof e=="number"||typeof e=="bigint"?String(e):Array.isArray(e)?e.map(r1).join(""):D.isValidElement(e)?r1(e.props.children):""}const Ex="github-light",dp=new Map,fp=new Map;let hp=null,mp=null;const Nx=new Set(["bash","css","diff","dockerfile","html","java","javascript","json","jsonc","jsx","markdown","python","shellscript","sql","toml","tsx","typescript","xml","yaml"]);function Z1(e){const t=e.trim().toLowerCase().replace(/^\./,"");return{bash:"bash",cjs:"javascript",console:"shellscript",htm:"html",js:"javascript",jsx:"jsx",md:"markdown",mjs:"javascript",py:"python",rb:"ruby",shell:"bash",ts:"typescript",tsx:"tsx",yml:"yaml",zsh:"bash"}[t]??t}function Mx(e){const t=Z1(e);return!t||t==="text"||t==="txt"?"text":Nx.has(t)?t:"text"}function IM({code:e}){const n=`seele-mermaid-${D.useId().replace(/[^a-zA-Z0-9_-]/g,"")}`,[a,l]=D.useState(!1),[o,c]=D.useState(()=>fp.get(e)??null),[f,h]=D.useState(null);D.useEffect(()=>{let g=!1,v;const k=fp.get(e);return k?(c(k),h(null),()=>{g=!0}):(h(null),c(null),_M(n,e).then(b=>{g||(v!==void 0&&window.clearTimeout(v),fp.set(e,b),c(b),h(null))},b=>{if(!g){const T=b instanceof Error?b.message:String(b);v=window.setTimeout(()=>{g||h(T)},DE)}}),()=>{g=!0,v!==void 0&&window.clearTimeout(v)})},[e,n]);async function m(){await navigator.clipboard.writeText(e),l(!0),window.setTimeout(()=>l(!1),1200)}return u.jsxs("figure",{className:`mermaid-block${f?" error":""}`,children:[u.jsx("span",{className:"code-block-kind",children:"mermaid"}),u.jsx("div",{className:"code-block-tools",children:u.jsx("button",{"aria-label":a?"Copied Mermaid source":"Copy Mermaid source",className:a?"copied":"",onClick:()=>void m(),title:a?"Copied":"Copy",type:"button",children:u.jsx(Q1,{})})}),o?u.jsx("div",{className:"mermaid-diagram",dangerouslySetInnerHTML:{__html:o}}):f?u.jsxs("div",{className:"mermaid-error",children:[u.jsx("strong",{children:"Mermaid render failed"}),u.jsx("pre",{children:f}),u.jsx("code",{children:e})]}):u.jsx("div",{className:"mermaid-loading",children:"Rendering diagram..."})]})}async function _M(e,t){return(await(await LM()).render(e,t)).svg}function LM(){return mp||(mp=on(()=>import("./mermaid.core-CmWgft13.js").then(e=>e.bp),[],import.meta.url).then(e=>{const t=e.default;return t.initialize({startOnLoad:!1,securityLevel:"strict",theme:"base",themeVariables:{background:"#ffffff",primaryColor:"#f9fafa",primaryBorderColor:"#d8d9e8",primaryTextColor:"#0b0f16",lineColor:"#7a8294",secondaryColor:"#f5f5fb",tertiaryColor:"#ffffff",fontFamily:'Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'}}),t})),mp}function BM({code:e,language:t,reserveHeight:n=!1}){const[a,l]=D.useState(!1),[o,c]=D.useState(()=>{if(!p5(t))return null;const m=m5(e,t);return dp.get(m)??null}),f=n?{"--code-block-min-height":`${FE(e)}px`}:void 0;D.useEffect(()=>{let m=!1;if(!p5(t))return c(null),()=>{m=!0};const g=m5(e,t),v=dp.get(g);return v?(c(v),()=>{m=!0}):(c(null),VM(e,t).then(k=>{dp.set(g,k),m||c(k)}).catch(k=>{console.warn("Failed to highlight code block",k),m||c(null)}),()=>{m=!0})},[e,t]);async function h(){await navigator.clipboard.writeText(e),l(!0),window.setTimeout(()=>l(!1),1200)}return u.jsxs("figure",{className:"code-block",style:f,children:[t?u.jsx("span",{className:"code-block-kind",children:t}):null,u.jsx("div",{className:"code-block-tools",children:u.jsx("button",{"aria-label":a?"Copied code block":"Copy code block",className:a?"copied":"",onClick:()=>void h(),title:a?"Copied":"Copy",type:"button",children:u.jsx(Q1,{})})}),o?u.jsx("div",{className:"code-block-shiki",dangerouslySetInnerHTML:{__html:o}}):u.jsx("pre",{children:u.jsx("code",{children:e})})]})}function Q1(){return u.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:[u.jsx("rect",{height:"14",rx:"2",stroke:"currentColor",strokeWidth:"2",width:"14",x:"8",y:"8"}),u.jsx("path",{d:"M4 16V6a2 2 0 0 1 2-2h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})}function qM(){return u.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"16",viewBox:"0 0 24 24",width:"16",children:[u.jsx("circle",{cx:"6",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"2"}),u.jsx("circle",{cx:"18",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"2"}),u.jsx("circle",{cx:"12",cy:"19",r:"2",stroke:"currentColor",strokeWidth:"2"}),u.jsx("path",{d:"M6 7v1a6 6 0 0 0 6 6v3M18 7v1a6 6 0 0 1-6 6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})]})}function zx(){return u.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"12",viewBox:"0 0 24 24",width:"12",children:[u.jsx("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"2.2"}),u.jsx("path",{d:"M12 7v6",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2.4"}),u.jsx("circle",{cx:"12",cy:"17",fill:"currentColor",r:"1.25"})]})}function UM(){return u.jsx("svg",{"aria-hidden":"true",fill:"none",height:"18",viewBox:"0 0 24 24",width:"18",children:u.jsx("path",{d:"M4 7h16M4 12h16M4 17h16",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})})}function HM(){return u.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[u.jsx("path",{d:"M7 7h10M7 12h10M7 17h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"}),u.jsx("circle",{cx:"4",cy:"7",fill:"currentColor",r:"1.4"}),u.jsx("circle",{cx:"4",cy:"12",fill:"currentColor",r:"1.4"}),u.jsx("circle",{cx:"4",cy:"17",fill:"currentColor",r:"1.4"})]})}function h5(){return u.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[u.jsx("circle",{cx:"12",cy:"12",r:"3",stroke:"currentColor",strokeWidth:"2"}),u.jsx("path",{d:"M19 12a7.8 7.8 0 0 0-.1-1l2-1.5-2-3.4-2.4 1a8 8 0 0 0-1.8-1l-.3-2.6h-4l-.3 2.6a8 8 0 0 0-1.8 1l-2.4-1-2 3.4 2 1.5a7.8 7.8 0 0 0 0 2l-2 1.5 2 3.4 2.4-1a8 8 0 0 0 1.8 1l.3 2.6h4l.3-2.6a8 8 0 0 0 1.8-1l2.4 1 2-3.4-2-1.5c.1-.3.1-.7.1-1Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.7"})]})}function $M(){return u.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[u.jsx("rect",{height:"16",rx:"2.6",stroke:"currentColor",strokeWidth:"1.8",width:"18",x:"3",y:"4"}),u.jsx("path",{d:"m7 9 3 3-3 3M12.5 15h4.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.9"})]})}function Yd(){return u.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"17",viewBox:"0 0 24 24",width:"17",children:[u.jsx("circle",{cx:"7",cy:"12",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),u.jsx("circle",{cx:"17",cy:"7",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),u.jsx("circle",{cx:"17",cy:"17",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),u.jsx("path",{d:"m9.2 10.9 5.6-2.8M9.2 13.1l5.6 2.8",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.8"})]})}function Rf(){return u.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:[u.jsx("path",{d:"m4 16-.8 4 4-.8L18.4 8 15.2 4.8 4 16Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"2"}),u.jsx("path",{d:"m13.8 6.2 3.2 3.2",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})}function FM(){return u.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:u.jsx("path",{d:"M5 8v11h14V8M4 4h16v4H4zM9 12h6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})})}function PM(){return u.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[u.jsx("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"2"}),u.jsx("circle",{cx:"12",cy:"12",r:"3",stroke:"currentColor",strokeWidth:"2"})]})}function GM(){return u.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[u.jsx("path",{d:"M3 3l18 18",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"}),u.jsx("path",{d:"M9.9 5.4A9.8 9.8 0 0 1 12 5c6 0 9.5 7 9.5 7a15.5 15.5 0 0 1-3 3.8M6.2 6.8C3.8 8.4 2.5 12 2.5 12s3.5 7 9.5 7a9.7 9.7 0 0 0 4-.8",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})]})}function m5(e,t){return`${Ex}:${Mx(t)}:${e}`}function p5(e){const t=Z1(e);return!!t&&Nx.has(t)}async function VM(e,t){return(await YM()).codeToHtml(e,{lang:Mx(t),theme:Ex})}function YM(){return hp||(hp=WM()),hp}async function WM(){const[{createHighlighterCore:e},{createJavaScriptRegexEngine:t},{default:n},{default:a},{default:l},{default:o},{default:c},{default:f},{default:h},{default:m},{default:g},{default:v},{default:k},{default:b},{default:T},{default:A},{default:q},{default:z},{default:M},{default:B},{default:U},{default:ne}]=await Promise.all([on(()=>import("./core-1UxKLd8w.js"),[],import.meta.url),on(()=>import("./engine-javascript-DBd1bXLz.js"),[],import.meta.url),on(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url),on(()=>import("./bash-BELqPA7S.js").then(L=>L.b),[],import.meta.url),on(()=>import("./css-CLj8gQPS.js"),[],import.meta.url),on(()=>import("./diff-D97Zzqfu.js"),[],import.meta.url),on(()=>import("./dockerfile-BcOcwvcX.js"),[],import.meta.url),on(()=>import("./html-pp8916En.js"),__vite__mapDeps([0,1,2]),import.meta.url),on(()=>import("./java-CylS5w8V.js"),[],import.meta.url),on(()=>import("./javascript-wDzz0qaB.js"),[],import.meta.url),on(()=>import("./json-Cp-IABpG.js"),[],import.meta.url),on(()=>import("./jsonc-Des-eS-w.js"),[],import.meta.url),on(()=>import("./jsx-g9-lgVsj.js"),[],import.meta.url),on(()=>import("./markdown-Cvjx9yec.js"),[],import.meta.url),on(()=>import("./python-B6aJPvgy.js"),[],import.meta.url),on(()=>import("./bash-BELqPA7S.js").then(L=>L.s),[],import.meta.url),on(()=>import("./sql-CRqJ_cUM.js"),[],import.meta.url),on(()=>import("./toml-vGWfd6FD.js"),[],import.meta.url),on(()=>import("./tsx-COt5Ahok.js"),[],import.meta.url),on(()=>import("./typescript-BPQ3VLAy.js"),[],import.meta.url),on(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([3,4]),import.meta.url),on(()=>import("./yaml-Buea-lGh.js"),[],import.meta.url)]);return e({engine:t(),themes:[n],langs:[a,l,o,c,f,h,m,g,v,k,b,T,A,q,z,M,B,U,ne]})}async function g5(){const e=ze("conversations"),t=await fetch(e);return await Fe(t,{url:e}),(await t.json()).conversations}async function KM(){const e=ze("workspace-states"),t=await fetch(e);return await Fe(t,{url:e}),(await t.json()).workspaces}async function y5(){const e=ze("collaboration/topics"),t=await fetch(e);return await Fe(t,{url:e}),(await t.json()).topics}async function Bd(e){const t=ze(`collaboration/topics/${e}/messages?limit=100`),n=await fetch(t);return await Fe(n,{url:t}),(await n.json()).messages}async function XM(e){const t=ze("collaboration/topics"),n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Fe(n,{method:"POST",url:t}),(await n.json()).topic}async function ZM(e,t){const n=ze(`collaboration/topics/${e}`),a=await fetch(n,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await Fe(a,{method:"PATCH",url:n}),(await a.json()).topic}async function QM(e,t){const n=ze(`collaboration/topics/${e}/archive`),a=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedVersion:t})});return await Fe(a,{method:"POST",url:n}),(await a.json()).topic}async function JM(e){const t=ze(`conversations/${e}/read`),n=await fetch(t,{method:"POST"});await Fe(n,{method:"POST",url:t})}async function v5(){const e=ze("workspace-groups"),t=await fetch(e);return await Fe(t,{url:e}),(await t.json()).groups}async function ez(e){const t=ze("workspace-groups"),n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e})});return await Fe(n,{method:"POST",url:t}),(await n.json()).group}async function tz(e,t){const n=ze(`workspace-groups/${e}`),a=await fetch(n,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await Fe(a,{method:"PATCH",url:n}),(await a.json()).group}async function nz(e){const t=ze(`workspace-groups/${e}`),n=await fetch(t,{method:"DELETE"});return await Fe(n,{method:"DELETE",url:t}),await n.json()}async function rz(){const e=ze("settings/environment"),t=await fetch(e);return await Fe(t,{url:e}),(await t.json()).variables}async function az(e){const t=ze(`conversations/${e}/settings/environment`),n=await fetch(t);return await Fe(n,{url:t}),(await n.json()).variables}async function iz(e){const t=ze(`conversations/${e}/knowledge`),n=await fetch(t);return await Fe(n,{url:t}),(await n.json()).items}async function lz(){const e=ze("settings/model-providers"),t=await fetch(e);return await Fe(t,{url:e}),t.json()}async function sz(){const e=ze("settings/model-providers/options"),t=await fetch(e);return await Fe(t,{url:e}),t.json()}async function oz(e){const t=ze(`settings/model-providers/${encodeURIComponent(e)}/balance`),n=await fetch(t);return await Fe(n,{url:t}),n.json()}async function uz(e){const t=ze("settings/model-providers"),n=await fetch(t,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Fe(n,{url:t,method:"PUT"}),n.json()}async function cz(){const e=ze("settings/runtime"),t=await fetch(e);return await Fe(t,{url:e}),(await t.json()).settings}async function dz(){const e=ze("settings/deployment"),t=await fetch(e);return await Fe(t,{url:e}),(await t.json()).settings}async function fz(){const e=ze("diagnostics"),t=await fetch(e);return await Fe(t,{url:e}),await t.json()}async function hz(){const e=ze("settings/runtime/codex"),t=await fetch(e);return await Fe(t,{url:e}),await t.json()}async function x5(){const e=ze("settings/runtime/accounts"),t=await fetch(e);await Fe(t,{url:e});const n=await t.json();return Bs(),n}async function pp(e=!1){const t=ze(`settings/runtime/accounts/refresh${e?"?force=1":""}`),n=await fetch(t,{method:"POST"});await Fe(n,{method:"POST",url:t});const a=await n.json();return Bs(),a}async function mz(e){const t=ze("settings/runtime/accounts"),n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})});await Fe(n,{method:"POST",url:t});const a=await n.json();return a.login.status==="succeeded"&&Bs(),a.login}async function pz(e){const t=ze(`settings/runtime/accounts/login/${e}`),n=await fetch(t);return await Fe(n,{url:t}),(await n.json()).login}async function gz(e){const t=ze(`settings/runtime/accounts/login/${e}/cancel`),n=await fetch(t,{method:"POST"});return await Fe(n,{method:"POST",url:t}),(await n.json()).login}async function yz(e,t,n){const a=ze(`settings/runtime/accounts/${e}`),l=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,renewalDay:n})});await Fe(l,{method:"PATCH",url:a});const o=await l.json();return Bs(),o.account}async function vz(e){const t=ze(`settings/runtime/accounts/${e}`),n=await fetch(t,{method:"DELETE"});await Fe(n,{method:"DELETE",url:t}),Bs()}async function xz(e){const t=ze(`settings/runtime/accounts/${e}/switch`),n=await fetch(t,{method:"POST"});await Fe(n,{method:"POST",url:t});const a=await n.json();return Bs(),a}async function bz(e=!0){const t=ze(`settings/runtime/models?refresh=${e?"1":"0"}`),n=await fetch(t);return await Fe(n,{url:t}),await n.json()}async function wz(e=!1){const t=ze(`settings/runtime/codex/update${e?"?refreshLatest=1":""}`),n=await fetch(t);return await Fe(n,{url:t}),await n.json()}async function kz(){const e=ze("settings/runtime/codex/update"),t=await fetch(e,{method:"POST"});return await Fe(t,{method:"POST",url:e}),(await t.json()).job}async function Sz(e){const t=ze(`conversations/${e}/settings/runtime`),n=await fetch(t);return await Fe(n,{url:t}),(await n.json()).settings}async function jz(){const e=ze("settings/memory"),t=await fetch(e);return await Fe(t,{url:e}),await t.json()}async function Cz(e){const t=ze("settings/runtime"),n=await fetch(t,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Fe(n,{method:"PUT",url:t}),(await n.json()).settings}async function Tz(e){const t=ze("settings/deployment"),n=await fetch(t,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Fe(n,{method:"PUT",url:t}),(await n.json()).settings}async function b5(e,t){const n=ze(`conversations/${e}/settings/runtime`),a=await fetch(n,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await Fe(a,{method:"PUT",url:n}),await a.json()}async function w5(e,t){const n=ze(`conversations/${e}/runtime/reset`),a=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});await Fe(a,{method:"POST",url:n});const l=(await a.json()).job;return Rx(e,l)}async function Dx(e){const t=ze(`conversations/${e}/runtime/reset`),n=await fetch(t);return await Fe(n,{url:t}),(await n.json()).job}async function Rx(e,t){let n=t;const a=Date.now()+1800*1e3;for(;n.status==="running";){if(Date.now()>=a)throw new Error("Full-history reset is still running after 30 minutes. Reopen Console to check the workspace before retrying.");await new Promise(o=>window.setTimeout(o,1e3));const l=await Dx(e);if(!l||l.id!==n.id)throw new Error("The runtime reset job is no longer available.");n=l}if(n.status==="failed"||n.status==="cancelled"||!n.result)throw new Error(n.error??"Full-history reset failed.");return n.result}async function k5(e){const t=ze(`conversations/${e}/runtime/reset-preview`),n=await fetch(t);return await Fe(n,{url:t}),await n.json()}async function Az(e,t){const n=ze(`conversations/${e}/runtime/reset-selection`),a=await fetch(n,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});await Fe(a,{method:"PUT",url:n})}async function Ez(e){const t=ze(`conversations/${e}/runtime/thread-read`),n=await fetch(t);return await Fe(n,{url:t}),(await n.json()).result}async function Nz(e){const t=ze(`conversations/${e}/runtime/token-usage`),n=await fetch(t);await Fe(n,{url:t});const a=await n.json();return a.event?Vx(a.event):null}async function Mz(e){const t=ze(`conversations/${e}/runtime/additional-context`),n=await fetch(t);return await Fe(n,{url:t}),await n.json()}async function zz(e){const t=ze(`conversations/${e}/runtime/compactions`),n=await fetch(t);return await Fe(n,{url:t}),(await n.json()).compactions}function Dz(e,t,n){return{modelSource:K6(e.modelSource,t.modelSource)&&(n==null?void 0:n.sources.modelSource)!=="workspace"?null:e.modelSource??{type:"codex"},model:e.model===t.model?null:e.model,reasoningEffort:rE(e.reasoningEffort,t.reasoningEffort,(n==null?void 0:n.sources.reasoningEffort)==="workspace"),fastMode:e.fastMode===t.fastMode?null:e.fastMode,sandbox:e.sandbox===t.sandbox?null:e.sandbox}}function Rz(e){return{kind:e.kind,name:e.name,description:e.description,purpose:e.purpose,attention:e.attention,refreshPolicy:e.refreshPolicy,status:e.status,sourceClues:Iz(e.sourceCluesText),requiredEnv:_z(e.requiredEnvText)}}function Oz(e){return{id:e.id,kind:e.kind,name:e.name,description:e.description,purpose:e.purpose,attention:e.attention,refreshPolicy:e.refreshPolicy,status:e.status,sourceCluesText:e.sourceClues.map(t=>`${t.type}: ${t.value}`).join(`
|
|
385
385
|
`),requiredEnvText:e.fetch.requiredEnv.map(t=>t.description?`${t.key} - ${t.description}`:t.key).join(`
|
|
386
386
|
`)}}function Iz(e){const t=new Date().toISOString();return e.split(/\r?\n/).map(n=>n.trim()).filter(Boolean).map(n=>{const a=n.match(/^([a-zA-Z][\w-]{0,31})\s*:\s*(.+)$/);return{type:a?a[1].toLowerCase():"text",value:a?a[2].trim():n,providedBy:"user",providedAt:t}})}function _z(e){return e.split(/\r?\n/).map(t=>t.trim()).filter(Boolean).map(t=>{const[n,...a]=t.split(/\s+-\s+/);return{key:n.trim().toUpperCase(),description:a.join(" - ").trim()}}).filter(t=>/^[A-Z_][A-Z0-9_]*$/.test(t.key))}function S5(e,t){const n=j5(t.attention)-j5(e.attention);return n!==0?n:t.updatedAt.localeCompare(e.updatedAt)}function j5(e){return e==="watch"?2:e==="tracked"?1:0}function Hc(e){return e.map(t=>({key:t.key??"",value:t.value??"",updatedAt:t.updatedAt}))}function Lz(e){return e?/^[a-z_][a-z0-9_.-]*$/.test(e)?null:"Key must start with a lowercase English letter or underscore, and may contain lowercase letters, numbers, dots, underscores, and hyphens.":"Key is required."}function Bz(e){return Hc(e).filter(t=>t.key.trim()&&t.value.trim()).map(t=>`${t.key.trim()}: ${t.value.trim()}`).join(`
|
|
387
|
-
`)}async function qz(e){const t=ze("settings/memory"),n=await fetch(t,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Fe(n,{method:"PUT",url:t}),await n.json()}async function Uz(e,t,n){const a=ze("settings/environment"),l=await fetch(a,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:n,key:e,value:t})});return await Fe(l,{method:"PUT",url:a}),(await l.json()).variable}async function Hz(e,t,n,a){const l=ze(`conversations/${e}/settings/environment`),o=await fetch(l,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:a,key:t,value:n})});return await Fe(o,{method:"PUT",url:l}),await o.json()}async function $z(e){const t=ze(`settings/environment/${encodeURIComponent(e)}/reveal`),n=await fetch(t);return await Fe(n,{url:t}),(await n.json()).variable.value}async function Fz(e,t){const n=ze(`conversations/${e}/settings/environment/${encodeURIComponent(t)}/reveal`),a=await fetch(n);return await Fe(a,{url:n}),(await a.json()).variable.value}async function Pz(e){const t=ze(`settings/environment/${encodeURIComponent(e)}`),n=await fetch(t,{method:"DELETE"});await Fe(n,{method:"DELETE",url:t})}async function Gz(e,t){const n=ze(`conversations/${e}/settings/environment/${encodeURIComponent(t)}`),a=await fetch(n,{method:"DELETE"});return await Fe(a,{method:"DELETE",url:n}),(await a.json()).conversation}async function Vz(e,t){const n=ze(`conversations/${e}/knowledge`),a=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await Fe(a,{method:"POST",url:n}),(await a.json()).item}async function Yz(e,t,n){const a=ze(`conversations/${e}/knowledge/${encodeURIComponent(t)}`),l=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});return await Fe(l,{method:"PATCH",url:a}),(await l.json()).item}async function Wz(e,t){const n=ze(`conversations/${e}/knowledge/${encodeURIComponent(t)}`),a=await fetch(n,{method:"DELETE"});await Fe(a,{method:"DELETE",url:n})}async function Kz(){const e=ze("meta"),t=await fetch(e);return await Fe(t,{url:e}),await t.json()}async function Xz(e){const t=ze(`settings/runtime/rate-limits?refresh=${e?"1":"0"}`),n=await fetch(t);return await Fe(n,{url:t}),(await n.json()).usage??null}async function Zz(e,t){const n=ze("conversations"),a=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e,groupId:t})});return await Fe(a,{method:"POST",url:n}),(await a.json()).conversation}async function Qz(e,t,n){const
|
|
387
|
+
`)}async function qz(e){const t=ze("settings/memory"),n=await fetch(t,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Fe(n,{method:"PUT",url:t}),await n.json()}async function Uz(e,t,n){const a=ze("settings/environment"),l=await fetch(a,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:n,key:e,value:t})});return await Fe(l,{method:"PUT",url:a}),(await l.json()).variable}async function Hz(e,t,n,a){const l=ze(`conversations/${e}/settings/environment`),o=await fetch(l,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:a,key:t,value:n})});return await Fe(o,{method:"PUT",url:l}),await o.json()}async function $z(e){const t=ze(`settings/environment/${encodeURIComponent(e)}/reveal`),n=await fetch(t);return await Fe(n,{url:t}),(await n.json()).variable.value}async function Fz(e,t){const n=ze(`conversations/${e}/settings/environment/${encodeURIComponent(t)}/reveal`),a=await fetch(n);return await Fe(a,{url:n}),(await a.json()).variable.value}async function Pz(e){const t=ze(`settings/environment/${encodeURIComponent(e)}`),n=await fetch(t,{method:"DELETE"});await Fe(n,{method:"DELETE",url:t})}async function Gz(e,t){const n=ze(`conversations/${e}/settings/environment/${encodeURIComponent(t)}`),a=await fetch(n,{method:"DELETE"});return await Fe(a,{method:"DELETE",url:n}),(await a.json()).conversation}async function Vz(e,t){const n=ze(`conversations/${e}/knowledge`),a=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await Fe(a,{method:"POST",url:n}),(await a.json()).item}async function Yz(e,t,n){const a=ze(`conversations/${e}/knowledge/${encodeURIComponent(t)}`),l=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});return await Fe(l,{method:"PATCH",url:a}),(await l.json()).item}async function Wz(e,t){const n=ze(`conversations/${e}/knowledge/${encodeURIComponent(t)}`),a=await fetch(n,{method:"DELETE"});await Fe(a,{method:"DELETE",url:n})}async function Kz(){const e=ze("meta"),t=await fetch(e);return await Fe(t,{url:e}),await t.json()}async function Xz(e){const t=ze(`settings/runtime/rate-limits?refresh=${e?"1":"0"}`),n=await fetch(t);return await Fe(n,{url:t}),(await n.json()).usage??null}async function Zz(e,t){const n=ze("conversations"),a=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e,groupId:t})});return await Fe(a,{method:"POST",url:n}),(await a.json()).conversation}async function Qz(e,t,n,a){const l=ze(`conversations/${e}/clone`),o=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,groupId:n,excludeTopicHistory:a})});return await Fe(o,{method:"POST",url:l}),await o.json()}async function Jz(e){const t=ze(`conversations/${e}/clone/retry`),n=await fetch(t,{method:"POST"});return await Fe(n,{method:"POST",url:t}),await n.json()}async function Ko(e,t={}){const n=new URLSearchParams;n.set("limit",String(t.limit??rx)),t.before&&n.set("before",t.before);const a=ze(`conversations/${e}?${n}`),l=await fetch(a);return await Fe(l,{url:a}),(await l.json()).conversation}async function Ox(e,t){const n=ze(`conversations/${e}/turns/${t}/history-events`),a=await fetch(n);return await Fe(a,{url:n}),(await a.json()).events}async function qd(e,t){const n=ze(`conversations/${e}`),a=await fetch(n,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await Fe(a,{method:"PATCH",url:n}),(await a.json()).conversation}async function eD(e){const t=ze(`conversations/${e}`),n=await fetch(t,{method:"DELETE"});await Fe(n,{method:"DELETE",url:t})}function tD(e){return e.title==="Phase boundary recommended"||e.title==="Long run in progress"}function Ix(e){return e.length<=3?e.join(", "):`${e.slice(0,3).join(", ")} +${e.length-3}`}function nD(e,t){if(e.event==="server.error"||e.event==="client.error")return{id:e.id,kind:"error",title:"Error",body:SD(e.data),createdAt:e.createdAt??new Date().toISOString()};if(e.event==="server.collaboration.message_staged"||e.event==="server.collaboration.message_sent"||e.event==="server.collaboration.message_rejected"){const o=Oe(e.data),c=We(o.toolCallId),f=typeof o.controlIndex=="number"?o.controlIndex:null;if(c||f!==null){const h=e.event==="server.collaboration.message_staged",m=e.event==="server.collaboration.message_sent",g=We(o.audience),v=We(o.recipientWorkspaceId),k=v?[v]:Array.isArray(o.recipientWorkspaceIds)?o.recipientWorkspaceIds.filter(q=>typeof q=="string"):Array.isArray(o.recipients)?o.recipients.filter(q=>typeof q=="string"):[],b=k.filter(q=>q!=="ALL").map(q=>t.get(q)).filter(q=>!!q);let T="Topic";b.length>0?T=Ix(b):k.length===1?T=k[0]==="ALL"?"Topic participants":ql(k[0]):k.length>1?T=`${k.length} workspaces`:g==="public"||g==="all"?T="Topic participants":g==="owner"&&(T="Topic owner");const A=We(o.topicId);return{id:e.id,kind:"collaboration",title:`Send to ${T}`,body:A?`Topic ${ql(A)}`:"Topic",createdAt:e.createdAt??new Date().toISOString(),itemId:c||`legacy-topic-message:${f}`,meta:h?"pending send":m?"done":"failed",output:h||m?We(o.contentMarkdown)||void 0:We(o.reason)||void 0,topicAction:"send",topicRecipientLabel:T,topicMessageContent:(h||m)&&We(o.contentMarkdown)||void 0}}}if(e.event==="codex.input_request"||e.event==="codex.input_or_approval_request"){const o=Oe(e.data);if(e.event==="codex.input_request"||o.method==="item/tool/requestUserInput"){const c=Oe(o.params),h=(Array.isArray(c.questions)?c.questions:[]).map(m=>{const g=Oe(m),v=typeof g.question=="string"?g.question:"Please provide the missing information.",k=Array.isArray(g.options)?g.options.map(b=>{const T=Oe(b);return typeof T.label=="string"?`- ${T.label}${typeof T.description=="string"?`: ${T.description}`:""}`:""}).filter(Boolean).join(`
|
|
388
388
|
`):"";return k?`${v}
|
|
389
389
|
|
|
390
390
|
${k}`:v}).join(`
|
|
@@ -400,4 +400,4 @@ ${a}`:n||a||e4(e)}function T5(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").rep
|
|
|
400
400
|
|
|
401
401
|
`);l=f.pop()??"";for(const h of f){const m=ED(h);m&&t(m)}}}function ED(e){const t=e.split(`
|
|
402
402
|
`),n=t.find(c=>c.startsWith("event: ")),a=t.filter(c=>c.startsWith("data: ")).map(c=>c.slice(6));if(!n||a.length===0)return null;const l=n.slice(7),o=a.join(`
|
|
403
|
-
`);try{return{event:l,data:JSON.parse(o)}}catch{return{event:l,data:o}}}function ND(e){var a,l,o,c,f;if(!e||typeof e!="object")return null;const t=e;if(t.method!=="item/agentMessage/delta"&&t.method!=="item/plan/delta"&&t.method!=="item/agentMessage/textSnapshot"&&t.method!=="item/plan/textSnapshot")return null;const n=((a=t.params)==null?void 0:a.delta)??((l=t.params)==null?void 0:l.text)??"";return n?{text:n,phase:t.method.startsWith("item/plan/")?"final_answer":((o=t.params)==null?void 0:o.phase)==="commentary"||((c=t.params)==null?void 0:c.phase)==="final_answer"?t.params.phase:"unknown",itemId:(f=t.params)==null?void 0:f.itemId}:null}function MD(e){var a;if(!e||typeof e!="object")return null;const t=e;if(t.method!=="item/started")return null;const n=(a=t.params)==null?void 0:a.item;return(n==null?void 0:n.type)!=="agentMessage"&&(n==null?void 0:n.type)!=="plan"?null:{itemId:n.id,phase:n.type==="plan"?"final_answer":n.phase==="commentary"||n.phase==="final_answer"?n.phase:"unknown"}}function zD(e){var a;if(!e||typeof e!="object")return null;const t=e;if(t.method!=="item/completed")return null;const n=(a=t.params)==null?void 0:a.item;return(n==null?void 0:n.type)!=="agentMessage"&&(n==null?void 0:n.type)!=="plan"||!n.text?null:{itemId:n.id,text:n.text,phase:n.type==="plan"?"final_answer":n.phase==="commentary"||n.phase==="final_answer"?n.phase:"unknown"}}function Ud(e){var n,a,l,o;if(e.event==="server.error"||e.event==="client.error")return"error";if(!e.data||typeof e.data!="object")return null;const t=e.data;return t.method==="thread/status/changed"&&((a=(n=t.params)==null?void 0:n.status)==null?void 0:a.type)==="idle"?"done":t.method==="turn/completed"?(o=(l=t.params)==null?void 0:l.turn)!=null&&o.error?"error":"done":null}function Xo(e){return e.length<=6?e:e.slice(0,6)}function ql(e){return e.slice(0,8)}function yp(e){switch(e){case"danger-full-access":return"System";case"workspace-write":return"Workspace";case"read-only":return"Read only"}}function s1(e,t){var n;return t==="running"||t==="error"?t:((n=e==null?void 0:e.nextWakeup)==null?void 0:n.status)==="scheduled"?"waiting":t}function DD(e,t){return`waiting ${hf(e,t)}`}function hf(e,t){const n=Date.parse(e.wakeAt);if(Number.isNaN(n))return"waiting";const a=Math.max(0,Math.ceil((n-t)/1e3));if(a<60)return`${a}s`;const l=Math.ceil(a/60);if(l<60)return`${l}m`;const o=Math.ceil(l/60);return o<24?`${o}h`:`${Math.ceil(o/24)}d`}function Zd(e,t=null,n=Date.now()){if(e==="waiting")return t?DD(t,n):"waiting";switch(e){case"done":return"idle";case"running":return"running";case"error":return"error";case"initializing":return"initializing";case"initialization_failed":return"initialization failed";case"idle":return"idle"}}function M5(e){switch(e){case"checking":return"backend checking";case"connected":return"backend connected";case"error":return"backend unavailable"}}function RD(e){return e==="assistant"?"Seele":"You"}const OD=document.getElementById("root"),Qx=window.__seeleCodexRoot??jb.createRoot(OD);window.__seeleCodexRoot=Qx;FD();Qx.render(u.jsx(D.StrictMode,{children:u.jsx(ID,{})}));function ID(){const[e,t]=D.useState(null),[n,a]=D.useState(null),[l,o]=D.useState(""),[c,f]=D.useState(""),[h,m]=D.useState("admin"),[g,v]=D.useState(""),[k,b]=D.useState(!1),[T,A]=D.useState("");D.useEffect(()=>{let M=!1,B=0;const U=async()=>{try{const ae=await z5();if(M)return;t(ae),f("")}catch{if(M)return;f("Reconnecting to Seele..."),B=window.setTimeout(U,2e3)}};return U(),()=>{M=!0,window.clearTimeout(B)}},[]),D.useEffect(()=>{let M=!1,B=0;const U=async()=>{try{const L=await Jx();if(M)return;a(L),o(""),B=window.setTimeout(U,L.status==="authorized"&&L.configurationReady&&L.codexAccountsReady?3e4:3e3)}catch{if(M)return;o("Unable to reach Seele."),B=window.setTimeout(U,3e3)}},ae=()=>{window.clearTimeout(B),U()};return window.addEventListener(e1,ae),U(),()=>{M=!0,window.clearTimeout(B),window.removeEventListener(e1,ae)}},[]),D.useEffect(()=>{const M=()=>{t({enabled:!0,authenticated:!1,user:null}),v(""),A("Your session has expired. Sign in again.")};return window.addEventListener(Jp,M),()=>window.removeEventListener(Jp,M)},[]);async function q(M){M.preventDefault(),b(!0),A("");try{const B=await fetch(ze("auth/login"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:h,password:g})});if(!B.ok){A(B.status===401?"Incorrect username or password.":B.status===429?"Too many failed attempts. Try again later.":"Login failed.");return}v(""),t(await z5())}catch{A("Unable to reach Seele.")}finally{b(!1)}}async function z(){await fetch(ze("auth/logout"),{method:"POST"}).catch(()=>{}),t({enabled:!0,authenticated:!1,user:null})}if(n&&sE(n))return u.jsx(_D,{authorization:n});if(!e||!n)return u.jsx("main",{className:"auth-shell",children:u.jsx("span",{className:"auth-loading",children:l||c||"Loading Seele..."})});if(!e.enabled||e.authenticated){const M=e.user??{id:"local-admin",username:"admin",role:"admin",active:!0,createdAt:"",updatedAt:""};return u.jsx(JE,{authEnabled:e.enabled,currentUser:M,deploymentId:n.deploymentId,onLogout:z},`${n.deploymentId}:${M.id}`)}return u.jsx("main",{className:"auth-shell",children:u.jsxs("section",{className:"auth-panel",children:[u.jsxs("header",{children:[u.jsx("p",{children:"Seele"}),u.jsx("h1",{children:"Sign in"})]}),u.jsxs("form",{onSubmit:q,children:[u.jsxs("label",{children:[u.jsx("span",{children:"Username"}),u.jsx("input",{autoComplete:"username",autoFocus:!0,onChange:M=>m(M.target.value),value:h})]}),u.jsxs("label",{children:[u.jsx("span",{children:"Password"}),u.jsx("input",{autoComplete:"current-password",onChange:M=>v(M.target.value),type:"password",value:g})]}),T?u.jsx("p",{className:"auth-error",role:"alert",children:T}):null,u.jsx("button",{disabled:k||!h||!g,type:"submit",children:k?"Signing in...":"Sign in"})]})]})})}function _D({authorization:e}){const t={starting:{title:"Checking deployment authorization",body:"Seele is contacting its configured cloud service."},pending:{title:"Waiting for cloud approval",body:"A cloud administrator must authorize this deployment before it can be used."},revoked:{title:"Deployment access revoked",body:"This deployment is disabled until a cloud administrator authorizes it again."},unavailable:{title:"Cloud authorization unavailable",body:"Seele will keep retrying. Business APIs and the runtime remain paused."},authorized:{title:"Deployment authorized",body:"Seele is ready."}},n=e.status==="authorized"&&!e.configurationReady?{title:"Synchronizing global configuration",body:"Seele is applying the current cloud configuration before the deployment becomes available."}:e.status==="authorized"&&!e.codexAccountsReady?{title:"Synchronizing Codex accounts",body:"Seele is installing the cloud account credentials before the deployment becomes available."}:t[e.status];return u.jsx("main",{className:"deployment-shell",children:u.jsxs("section",{className:"deployment-panel deployment-waiting-panel",children:[u.jsx("div",{className:`deployment-status-mark is-${e.status}`,"aria-hidden":"true"}),u.jsx("p",{className:"deployment-kicker",children:"Seele deployment"}),u.jsx("h1",{children:n.title}),u.jsx("p",{className:"deployment-lead",children:n.body}),u.jsxs("dl",{className:"deployment-facts",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Deployment ID"}),u.jsx("dd",{children:u.jsx("code",{children:e.deploymentId})})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Name"}),u.jsx("dd",{children:e.name})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Cloud"}),u.jsx("dd",{children:e.cloudUrl})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Last checked"}),u.jsx("dd",{children:e.lastCheckedAt?BD(e.lastCheckedAt):"Starting"})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Global revision"}),u.jsxs("dd",{children:[e.appliedGlobalRevision," / ",e.requiredGlobalRevision]})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Codex account revision"}),u.jsxs("dd",{children:[e.appliedCodexAccountRevision," / ",e.requiredCodexAccountRevision]})]})]}),e.lastError||e.configurationError||e.codexAccountError?u.jsx("p",{className:"deployment-error",role:"alert",children:e.lastError||e.configurationError||e.codexAccountError}):null,u.jsx("a",{className:"deployment-primary-link",href:LD(e.cloudUrl),children:"Open cloud deployment management"}),u.jsx("p",{className:"deployment-retry-note",children:"Authorization is checked automatically."})]})})}function LD(e){return`${e.replace(/\/+$/,"")}/admin/deployments`}function BD(e){const t=Date.parse(e);return Number.isNaN(t)?e:new Date(t).toLocaleString()}async function Jx(){const e=await fetch(ze("deployment/authorization"));if(!e.ok)throw new Error(`Deployment authorization request failed: ${e.status}`);return e.json()}async function z5(){const e=await fetch(ze("auth/session"));if(!e.ok)throw new Error(`Auth session request failed: ${e.status}`);return e.json()}async function qD(){const e=ze("admin/users"),t=await fetch(e);if(!t.ok)throw await Xn(t,{url:e});return(await t.json()).users}async function UD(e){const t=ze("admin/users"),n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok)throw await Xn(n,{method:"POST",url:t});return(await n.json()).user}async function HD(e,t){const n=ze(`admin/users/${encodeURIComponent(e)}`),a=await fetch(n,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok)throw await Xn(a,{method:"PATCH",url:n});return(await a.json()).user}async function $D(e){const t=ze(`admin/users/${encodeURIComponent(e)}`),n=await fetch(t,{method:"DELETE"});if(!n.ok)throw await Xn(n,{method:"DELETE",url:t})}function FD(){if(window.__seeleAuthFetchInstalled)return;const e=window.fetch.bind(window);window.fetch=async(...t)=>{const n=await e(...t),a=typeof t[0]=="string"?t[0]:t[0]instanceof URL?t[0].toString():t[0].url;if(n.status===401){const l=await n.clone().json().then(o=>o&&typeof o=="object"&&"error"in o?o.error:void 0).catch(()=>{});oE(n.status,l,a.includes("/api/auth/"))==="reauthenticate"&&window.dispatchEvent(new Event(Jp))}return n.status===503&&a.includes("/api/")&&Bs(),n},window.__seeleAuthFetchInstalled=!0}function Bs(){window.dispatchEvent(new Event(e1))}export{on as _,Cb as a,qb as b,Iy as c,U5 as f,D5 as g,H5 as h,GD as k,mf as s,Mb as w};
|
|
403
|
+
`);try{return{event:l,data:JSON.parse(o)}}catch{return{event:l,data:o}}}function ND(e){var a,l,o,c,f;if(!e||typeof e!="object")return null;const t=e;if(t.method!=="item/agentMessage/delta"&&t.method!=="item/plan/delta"&&t.method!=="item/agentMessage/textSnapshot"&&t.method!=="item/plan/textSnapshot")return null;const n=((a=t.params)==null?void 0:a.delta)??((l=t.params)==null?void 0:l.text)??"";return n?{text:n,phase:t.method.startsWith("item/plan/")?"final_answer":((o=t.params)==null?void 0:o.phase)==="commentary"||((c=t.params)==null?void 0:c.phase)==="final_answer"?t.params.phase:"unknown",itemId:(f=t.params)==null?void 0:f.itemId}:null}function MD(e){var a;if(!e||typeof e!="object")return null;const t=e;if(t.method!=="item/started")return null;const n=(a=t.params)==null?void 0:a.item;return(n==null?void 0:n.type)!=="agentMessage"&&(n==null?void 0:n.type)!=="plan"?null:{itemId:n.id,phase:n.type==="plan"?"final_answer":n.phase==="commentary"||n.phase==="final_answer"?n.phase:"unknown"}}function zD(e){var a;if(!e||typeof e!="object")return null;const t=e;if(t.method!=="item/completed")return null;const n=(a=t.params)==null?void 0:a.item;return(n==null?void 0:n.type)!=="agentMessage"&&(n==null?void 0:n.type)!=="plan"||!n.text?null:{itemId:n.id,text:n.text,phase:n.type==="plan"?"final_answer":n.phase==="commentary"||n.phase==="final_answer"?n.phase:"unknown"}}function Ud(e){var n,a,l,o;if(e.event==="server.error"||e.event==="client.error")return"error";if(!e.data||typeof e.data!="object")return null;const t=e.data;return t.method==="thread/status/changed"&&((a=(n=t.params)==null?void 0:n.status)==null?void 0:a.type)==="idle"?"done":t.method==="turn/completed"?(o=(l=t.params)==null?void 0:l.turn)!=null&&o.error?"error":"done":null}function Xo(e){return e.length<=6?e:e.slice(0,6)}function ql(e){return e.slice(0,8)}function yp(e){switch(e){case"danger-full-access":return"System";case"workspace-write":return"Workspace";case"read-only":return"Read only"}}function s1(e,t){var n;return t==="running"||t==="error"?t:((n=e==null?void 0:e.nextWakeup)==null?void 0:n.status)==="scheduled"?"waiting":t}function DD(e,t){return`waiting ${hf(e,t)}`}function hf(e,t){const n=Date.parse(e.wakeAt);if(Number.isNaN(n))return"waiting";const a=Math.max(0,Math.ceil((n-t)/1e3));if(a<60)return`${a}s`;const l=Math.ceil(a/60);if(l<60)return`${l}m`;const o=Math.ceil(l/60);return o<24?`${o}h`:`${Math.ceil(o/24)}d`}function Zd(e,t=null,n=Date.now()){if(e==="waiting")return t?DD(t,n):"waiting";switch(e){case"done":return"idle";case"running":return"running";case"error":return"error";case"initializing":return"initializing";case"initialization_failed":return"initialization failed";case"idle":return"idle"}}function M5(e){switch(e){case"checking":return"backend checking";case"connected":return"backend connected";case"error":return"backend unavailable"}}function RD(e){return e==="assistant"?"Seele":"You"}const OD=document.getElementById("root"),Qx=window.__seeleCodexRoot??jb.createRoot(OD);window.__seeleCodexRoot=Qx;FD();Qx.render(u.jsx(D.StrictMode,{children:u.jsx(ID,{})}));function ID(){const[e,t]=D.useState(null),[n,a]=D.useState(null),[l,o]=D.useState(""),[c,f]=D.useState(""),[h,m]=D.useState("admin"),[g,v]=D.useState(""),[k,b]=D.useState(!1),[T,A]=D.useState("");D.useEffect(()=>{let M=!1,B=0;const U=async()=>{try{const ne=await z5();if(M)return;t(ne),f("")}catch{if(M)return;f("Reconnecting to Seele..."),B=window.setTimeout(U,2e3)}};return U(),()=>{M=!0,window.clearTimeout(B)}},[]),D.useEffect(()=>{let M=!1,B=0;const U=async()=>{try{const L=await Jx();if(M)return;a(L),o(""),B=window.setTimeout(U,L.status==="authorized"&&L.configurationReady&&L.codexAccountsReady?3e4:3e3)}catch{if(M)return;o("Unable to reach Seele."),B=window.setTimeout(U,3e3)}},ne=()=>{window.clearTimeout(B),U()};return window.addEventListener(e1,ne),U(),()=>{M=!0,window.clearTimeout(B),window.removeEventListener(e1,ne)}},[]),D.useEffect(()=>{const M=()=>{t({enabled:!0,authenticated:!1,user:null}),v(""),A("Your session has expired. Sign in again.")};return window.addEventListener(Jp,M),()=>window.removeEventListener(Jp,M)},[]);async function q(M){M.preventDefault(),b(!0),A("");try{const B=await fetch(ze("auth/login"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:h,password:g})});if(!B.ok){A(B.status===401?"Incorrect username or password.":B.status===429?"Too many failed attempts. Try again later.":"Login failed.");return}v(""),t(await z5())}catch{A("Unable to reach Seele.")}finally{b(!1)}}async function z(){await fetch(ze("auth/logout"),{method:"POST"}).catch(()=>{}),t({enabled:!0,authenticated:!1,user:null})}if(n&&sE(n))return u.jsx(_D,{authorization:n});if(!e||!n)return u.jsx("main",{className:"auth-shell",children:u.jsx("span",{className:"auth-loading",children:l||c||"Loading Seele..."})});if(!e.enabled||e.authenticated){const M=e.user??{id:"local-admin",username:"admin",role:"admin",active:!0,createdAt:"",updatedAt:""};return u.jsx(JE,{authEnabled:e.enabled,currentUser:M,deploymentId:n.deploymentId,onLogout:z},`${n.deploymentId}:${M.id}`)}return u.jsx("main",{className:"auth-shell",children:u.jsxs("section",{className:"auth-panel",children:[u.jsxs("header",{children:[u.jsx("p",{children:"Seele"}),u.jsx("h1",{children:"Sign in"})]}),u.jsxs("form",{onSubmit:q,children:[u.jsxs("label",{children:[u.jsx("span",{children:"Username"}),u.jsx("input",{autoComplete:"username",autoFocus:!0,onChange:M=>m(M.target.value),value:h})]}),u.jsxs("label",{children:[u.jsx("span",{children:"Password"}),u.jsx("input",{autoComplete:"current-password",onChange:M=>v(M.target.value),type:"password",value:g})]}),T?u.jsx("p",{className:"auth-error",role:"alert",children:T}):null,u.jsx("button",{disabled:k||!h||!g,type:"submit",children:k?"Signing in...":"Sign in"})]})]})})}function _D({authorization:e}){const t={starting:{title:"Checking deployment authorization",body:"Seele is contacting its configured cloud service."},pending:{title:"Waiting for cloud approval",body:"A cloud administrator must authorize this deployment before it can be used."},revoked:{title:"Deployment access revoked",body:"This deployment is disabled until a cloud administrator authorizes it again."},unavailable:{title:"Cloud authorization unavailable",body:"Seele will keep retrying. Business APIs and the runtime remain paused."},authorized:{title:"Deployment authorized",body:"Seele is ready."}},n=e.status==="authorized"&&!e.configurationReady?{title:"Synchronizing global configuration",body:"Seele is applying the current cloud configuration before the deployment becomes available."}:e.status==="authorized"&&!e.codexAccountsReady?{title:"Synchronizing Codex accounts",body:"Seele is installing the cloud account credentials before the deployment becomes available."}:t[e.status];return u.jsx("main",{className:"deployment-shell",children:u.jsxs("section",{className:"deployment-panel deployment-waiting-panel",children:[u.jsx("div",{className:`deployment-status-mark is-${e.status}`,"aria-hidden":"true"}),u.jsx("p",{className:"deployment-kicker",children:"Seele deployment"}),u.jsx("h1",{children:n.title}),u.jsx("p",{className:"deployment-lead",children:n.body}),u.jsxs("dl",{className:"deployment-facts",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Deployment ID"}),u.jsx("dd",{children:u.jsx("code",{children:e.deploymentId})})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Name"}),u.jsx("dd",{children:e.name})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Cloud"}),u.jsx("dd",{children:e.cloudUrl})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Last checked"}),u.jsx("dd",{children:e.lastCheckedAt?BD(e.lastCheckedAt):"Starting"})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Global revision"}),u.jsxs("dd",{children:[e.appliedGlobalRevision," / ",e.requiredGlobalRevision]})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Codex account revision"}),u.jsxs("dd",{children:[e.appliedCodexAccountRevision," / ",e.requiredCodexAccountRevision]})]})]}),e.lastError||e.configurationError||e.codexAccountError?u.jsx("p",{className:"deployment-error",role:"alert",children:e.lastError||e.configurationError||e.codexAccountError}):null,u.jsx("a",{className:"deployment-primary-link",href:LD(e.cloudUrl),children:"Open cloud deployment management"}),u.jsx("p",{className:"deployment-retry-note",children:"Authorization is checked automatically."})]})})}function LD(e){return`${e.replace(/\/+$/,"")}/admin/deployments`}function BD(e){const t=Date.parse(e);return Number.isNaN(t)?e:new Date(t).toLocaleString()}async function Jx(){const e=await fetch(ze("deployment/authorization"));if(!e.ok)throw new Error(`Deployment authorization request failed: ${e.status}`);return e.json()}async function z5(){const e=await fetch(ze("auth/session"));if(!e.ok)throw new Error(`Auth session request failed: ${e.status}`);return e.json()}async function qD(){const e=ze("admin/users"),t=await fetch(e);if(!t.ok)throw await Xn(t,{url:e});return(await t.json()).users}async function UD(e){const t=ze("admin/users"),n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok)throw await Xn(n,{method:"POST",url:t});return(await n.json()).user}async function HD(e,t){const n=ze(`admin/users/${encodeURIComponent(e)}`),a=await fetch(n,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok)throw await Xn(a,{method:"PATCH",url:n});return(await a.json()).user}async function $D(e){const t=ze(`admin/users/${encodeURIComponent(e)}`),n=await fetch(t,{method:"DELETE"});if(!n.ok)throw await Xn(n,{method:"DELETE",url:t})}function FD(){if(window.__seeleAuthFetchInstalled)return;const e=window.fetch.bind(window);window.fetch=async(...t)=>{const n=await e(...t),a=typeof t[0]=="string"?t[0]:t[0]instanceof URL?t[0].toString():t[0].url;if(n.status===401){const l=await n.clone().json().then(o=>o&&typeof o=="object"&&"error"in o?o.error:void 0).catch(()=>{});oE(n.status,l,a.includes("/api/auth/"))==="reauthenticate"&&window.dispatchEvent(new Event(Jp))}return n.status===503&&a.includes("/api/")&&Bs(),n},window.__seeleAuthFetchInstalled=!0}function Bs(){window.dispatchEvent(new Event(e1))}export{on as _,Cb as a,qb as b,Iy as c,U5 as f,D5 as g,H5 as h,GD as k,mf as s,Mb as w};
|