@tea-agent/loop-agent 0.40.0-next.11 → 0.40.0-next.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -0
- package/README.md +1 -1
- package/dist/build-stamp.json +3 -3
- package/dist/cli/command-definitions.js +9 -5
- package/dist/cli/program.js +38 -3
- package/dist/commands/client-recovery.js +8 -36
- package/dist/commands/task-advance.js +23 -1
- package/dist/commands/task-source-prepare.js +5 -0
- package/dist/commands/task-status.js +1 -0
- package/dist/executors/pi-sdk-executor.js +33 -5
- package/dist/shared/operator/capabilities.js +9 -1
- package/dist/shared/pi-context-pressure/checkpoint.js +116 -0
- package/dist/shared/pi-context-pressure/compaction-policy.js +151 -0
- package/dist/shared/pi-context-pressure/env.js +58 -0
- package/dist/shared/pi-context-pressure/extension.js +100 -0
- package/dist/shared/pi-context-pressure/index.js +7 -0
- package/dist/shared/pi-context-pressure/overflow.js +252 -0
- package/dist/shared/pi-context-pressure/sift-bridge.js +386 -0
- package/dist/shared/pi-context-pressure/telemetry.js +51 -0
- package/dist/worker/console/chat/assistant-content.js +7 -0
- package/dist/worker/console/chat/chat-event-store.js +82 -11
- package/dist/worker/console/chat/goal-round-driver.js +72 -0
- package/dist/worker/console/chat/goals.js +300 -0
- package/dist/worker/console/chat/pi-runtime.js +285 -8
- package/dist/worker/console/chat/provider-error.js +2 -1
- package/dist/worker/console/chat/repo-browser.js +94 -12
- package/dist/worker/console/chat/routes.js +485 -29
- package/dist/worker/console/chat/session-catalog.js +48 -0
- package/dist/worker/console/chat/session-store.js +27 -18
- package/dist/worker/console/chat/shortcuts.js +7 -0
- package/dist/worker/console/chat/sift-bridge.js +1 -0
- package/dist/worker/console/chat/turn-process.js +32 -3
- package/dist/worker/console/operator-actions.js +16 -2
- package/dist/worker/console/operator-selection.js +6 -2
- package/dist/worker/console/pi-plugins.catalog.json +73658 -0
- package/dist/worker/console/pi-plugins.js +100 -0
- package/dist/worker/console/routes.js +221 -6
- package/dist/worker/console/server.js +172 -42
- package/dist/worker/console/static/assets/{abnfDiagram-N423BO3Z-Bs-CDAXM.js → abnfDiagram-N423BO3Z-Wj-fsQlk.js} +1 -1
- package/dist/worker/console/static/assets/{arc-CAkA3We3.js → arc-CkXT-vzQ.js} +1 -1
- package/dist/worker/console/static/assets/{architectureDiagram-T3A2C74G-DEmI_zqr.js → architectureDiagram-T3A2C74G-xlfnojWU.js} +1 -1
- package/dist/worker/console/static/assets/{blockDiagram-VBNYF7ZC-uDHANebE.js → blockDiagram-VBNYF7ZC-BilahvuB.js} +1 -1
- package/dist/worker/console/static/assets/{c4Diagram-5PPSVZJV-Bv97b4_B.js → c4Diagram-5PPSVZJV-DqtAVhjz.js} +1 -1
- package/dist/worker/console/static/assets/channel-SnQ_u-Td.js +1 -0
- package/dist/worker/console/static/assets/{chunk-2GRJ4B5K-shmQKsFz.js → chunk-2GRJ4B5K-pAqQXZ5y.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-2Q5K7J3B-BAraNvcN.js → chunk-2Q5K7J3B-BEWxeq2r.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-5RXB4S5H-BirhxUop.js → chunk-5RXB4S5H-CvlbGDTp.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-5VM5RSS4-C9LgUJpR.js → chunk-5VM5RSS4-D0uGd9-f.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-6Q2QTUOP-DrU-s-t7.js → chunk-6Q2QTUOP-DSdWIteg.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-GF5L2VYU-Tx-H_FA2.js → chunk-GF5L2VYU-Dweg7f0v.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-JWPE2WC7-BjLtNFrR.js → chunk-JWPE2WC7-BpZKI_k7.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-KBJHAD2P-UNLVwSsy.js → chunk-KBJHAD2P-IPLknC4m.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-RYQCIY6F-CBEUX8XD.js → chunk-RYQCIY6F-E93k9lVI.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-XXDRQBXY-WTL7IZOq.js → chunk-XXDRQBXY-BrESwkPq.js} +1 -1
- package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-SGM51NVY.js +1 -0
- package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-SGM51NVY.js +1 -0
- package/dist/worker/console/static/assets/{cose-bilkent-JH36ORCC-CkHG6W3s.js → cose-bilkent-JH36ORCC-DmFHvJkB.js} +1 -1
- package/dist/worker/console/static/assets/{cynefin-VYW2F7L2-BRzFqTaL.js → cynefin-VYW2F7L2-CDigXiSL.js} +1 -1
- package/dist/worker/console/static/assets/{cynefinDiagram-MW4NZA55-2_CFp_i7.js → cynefinDiagram-MW4NZA55-B0zhrbaA.js} +1 -1
- package/dist/worker/console/static/assets/{dagre-VZM6K2ZE-BJtsmdkE.js → dagre-VZM6K2ZE-DrKybVxm.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-7IWD3JNH-DNEFFo6w.js → diagram-7IWD3JNH-CeUrnbFk.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-B4RE2ZJO-B_IWV7eo.js → diagram-B4RE2ZJO-BJyunUMi.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-LBJQPF4R-DvvRx2dz.js → diagram-LBJQPF4R-a5TBP73u.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-Q27KOJAE-CsibsWLg.js → diagram-Q27KOJAE-ChRgBURJ.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-UB23O5K3-les_djBQ.js → diagram-UB23O5K3-CqCnPRSk.js} +1 -1
- package/dist/worker/console/static/assets/{ebnfDiagram-BXEA7PRR-BEm2n7qJ.js → ebnfDiagram-BXEA7PRR-BI-UD9_S.js} +1 -1
- package/dist/worker/console/static/assets/{erDiagram-JOGREHBK-BI7vHHVm.js → erDiagram-JOGREHBK-CDLvvkYZ.js} +1 -1
- package/dist/worker/console/static/assets/{flowDiagram-UKHOOZJN-CUFCERrB.js → flowDiagram-UKHOOZJN-Heoo4afj.js} +1 -1
- package/dist/worker/console/static/assets/{ganttDiagram-PKOTCBZU-wxyLiGWt.js → ganttDiagram-PKOTCBZU-kFpOitHd.js} +1 -1
- package/dist/worker/console/static/assets/{gitGraphDiagram-DS77QQ5N-Bt897K8Z.js → gitGraphDiagram-DS77QQ5N-FvyZ9WAY.js} +1 -1
- package/dist/worker/console/static/assets/index-C80SO8y0.js +437 -0
- package/dist/worker/console/static/assets/index-CmJCHmJP.css +1 -0
- package/dist/worker/console/static/assets/{infoDiagram-6WML65LV-DYNx_IPv.js → infoDiagram-6WML65LV-HBzlwtgI.js} +1 -1
- package/dist/worker/console/static/assets/{ishikawaDiagram-WSZJBQD7-CzpLNEu6.js → ishikawaDiagram-WSZJBQD7-C9Iim5sm.js} +1 -1
- package/dist/worker/console/static/assets/{journeyDiagram-NVQOT4AX-97f9owNU.js → journeyDiagram-NVQOT4AX-CJwJTg0S.js} +1 -1
- package/dist/worker/console/static/assets/{kanban-definition-27J2QSJJ-BxM9hyBn.js → kanban-definition-27J2QSJJ-CZNJ7S4q.js} +1 -1
- package/dist/worker/console/static/assets/{linear-ByuxcHvp.js → linear-RZ0AnGi8.js} +1 -1
- package/dist/worker/console/static/assets/{mermaid.core-DwPGvpCv.js → mermaid.core-EYSdm-nd.js} +5 -5
- package/dist/worker/console/static/assets/{mindmap-definition-FAOFIHXS-DCoqG9RT.js → mindmap-definition-FAOFIHXS-D0OLECFN.js} +1 -1
- package/dist/worker/console/static/assets/{pegDiagram-VL7TDLO6-BLSBmBMx.js → pegDiagram-VL7TDLO6-CPTvGbh7.js} +1 -1
- package/dist/worker/console/static/assets/{pieDiagram-7S7Q4E2Y-B0t_0oJW.js → pieDiagram-7S7Q4E2Y-Ddc1aDea.js} +1 -1
- package/dist/worker/console/static/assets/{quadrantDiagram-CIZ2JOQS-sTzDk7Nt.js → quadrantDiagram-CIZ2JOQS-CWCTCdAt.js} +1 -1
- package/dist/worker/console/static/assets/{railroadDiagram-AXF67PYL-B3jRdATC.js → railroadDiagram-AXF67PYL-CfsaBL8E.js} +1 -1
- package/dist/worker/console/static/assets/{requirementDiagram-LRYGKXZP-D-cTtXEN.js → requirementDiagram-LRYGKXZP-BH2rqGf6.js} +1 -1
- package/dist/worker/console/static/assets/{sankeyDiagram-W5VNT64P-B25igJRE.js → sankeyDiagram-W5VNT64P-BZgJ1Til.js} +1 -1
- package/dist/worker/console/static/assets/{sequenceDiagram-SI44F4Z6-jW_lM1_D.js → sequenceDiagram-SI44F4Z6-DmPr-o-y.js} +1 -1
- package/dist/worker/console/static/assets/{sizeCapture-X5ZJPWSS-CrzTgsHE.js → sizeCapture-X5ZJPWSS-CF6HzDh_.js} +1 -1
- package/dist/worker/console/static/assets/{stateDiagram-OKZ733FA-B01MvlqE.js → stateDiagram-OKZ733FA-DhS8N_B9.js} +1 -1
- package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-N56zxwsk.js +1 -0
- package/dist/worker/console/static/assets/{swimlanes-SLNWSIFB-YcF12FiU.js → swimlanes-SLNWSIFB-CYNzoiaD.js} +2 -2
- package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-o47kGgVt.js +8 -0
- package/dist/worker/console/static/assets/{timeline-definition-Z64GVDOM-ClnRcg2s.js → timeline-definition-Z64GVDOM-QBICF5qH.js} +1 -1
- package/dist/worker/console/static/assets/{vennDiagram-T6HMQDX7-B6gr_z-q.js → vennDiagram-T6HMQDX7-fquBvWcf.js} +1 -1
- package/dist/worker/console/static/assets/{wardleyDiagram-T6FBY63Y-CvSgguGH.js → wardleyDiagram-T6FBY63Y-BYaJLlSd.js} +1 -1
- package/dist/worker/console/static/assets/{xychartDiagram-ELKLHX3M-23OtSZCb.js → xychartDiagram-ELKLHX3M--ePe_JCJ.js} +1 -1
- package/dist/worker/console/static/index.html +2 -2
- package/dist/worker/console/static-src/operator-chat/chat-sse-events.js +95 -25
- package/dist/worker/console/static-src/operator-chat/compaction-message.js +35 -1
- package/dist/worker/console/static-src/operator-chat/open-preview-in-browser.js +3 -1
- package/dist/worker/console/static-src/operator-chat/useChatSessions.js +24 -19
- package/dist/worker/console/static-src/operator-chat/useChatStream.js +0 -11
- package/dist/worker/console/static-src/operator-chat/useChatThread.js +8 -1
- package/dist/worker/console/static-src/operator-chat/useRepoBrowser.js +34 -4
- package/dist/worker/console/static-src/operator-chat/workspace-reorder.js +18 -0
- package/dist/worker/console/static-src/shell/useWorkspaces.js +150 -34
- package/dist/worker/console/workspace-context.js +28 -3
- package/dist/worker/console/workspace-registry.js +333 -60
- package/dist/worker/observe/static/inspect-bootstrap.d.ts +8 -0
- package/dist/worker/observe/static/inspect-bootstrap.js +57 -0
- package/dist/worker/observe/static/inspect-workspace.js +54 -10
- package/dist/worker/observe/static/operator-chrome.css +23 -4
- package/dist/worker/observe/static/operator-chrome.js +6 -2
- package/dist/worker/observe/static/styles.css +87 -25
- package/dist/worker/observe/static/views/dag-inspector.js +42 -1
- package/dist/worker/observe/static/views/dags.js +7 -5
- package/dist/worker/observe/static/views/session-timeline.js +135 -0
- package/dist/workflows/dag/init-hybrid.js +3 -3
- package/docs/architecture/runtime-boundaries.md +2 -1
- package/docs/templates/backend-test-dag.json +3 -3
- package/package.json +3 -2
- package/skills/loop-agent/references/command-reference.md +14 -0
- package/dist/worker/console/static/assets/channel-amxUpk7o.js +0 -1
- package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-bejwBVIz.js +0 -1
- package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-bejwBVIz.js +0 -1
- package/dist/worker/console/static/assets/index-BHhUOTri.css +0 -1
- package/dist/worker/console/static/assets/index-DqJbO3-p.js +0 -407
- package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-BvFKEtm2.js +0 -1
- package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-DIB2eVg-.js +0 -8
|
@@ -1,407 +0,0 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function dd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Bf={exports:{}},gl={};var ob;function d9(){if(ob)return gl;ob=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,s,o){var c=null;if(o!==void 0&&(c=""+o),s.key!==void 0&&(c=""+s.key),"key"in s){o={};for(var d in s)d!=="key"&&(o[d]=s[d])}else o=s;return s=o.ref,{$$typeof:e,type:a,key:c,ref:s!==void 0?s:null,props:o}}return gl.Fragment=t,gl.jsx=n,gl.jsxs=n,gl}var lb;function f9(){return lb||(lb=1,Bf.exports=d9()),Bf.exports}var u=f9(),qf={exports:{}},kt={};var cb;function m9(){if(cb)return kt;cb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),x=Symbol.iterator;function y(G){return G===null||typeof G!="object"?null:(G=x&&G[x]||G["@@iterator"],typeof G=="function"?G:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,A={};function C(G,W,O){this.props=G,this.context=W,this.refs=A,this.updater=O||S}C.prototype.isReactComponent={},C.prototype.setState=function(G,W){if(typeof G!="object"&&typeof G!="function"&&G!=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,G,W,"setState")},C.prototype.forceUpdate=function(G){this.updater.enqueueForceUpdate(this,G,"forceUpdate")};function M(){}M.prototype=C.prototype;function I(G,W,O){this.props=G,this.context=W,this.refs=A,this.updater=O||S}var P=I.prototype=new M;P.constructor=I,T(P,C.prototype),P.isPureReactComponent=!0;var U=Array.isArray;function N(){}var z={H:null,A:null,T:null,S:null},X=Object.prototype.hasOwnProperty;function B(G,W,O){var be=O.ref;return{$$typeof:e,type:G,key:W,ref:be!==void 0?be:null,props:O}}function $(G,W){return B(G.type,W,G.props)}function F(G){return typeof G=="object"&&G!==null&&G.$$typeof===e}function K(G){var W={"=":"=0",":":"=2"};return"$"+G.replace(/[=:]/g,function(O){return W[O]})}var oe=/\/+/g;function J(G,W){return typeof G=="object"&&G!==null&&G.key!=null?K(""+G.key):W.toString(36)}function H(G){switch(G.status){case"fulfilled":return G.value;case"rejected":throw G.reason;default:switch(typeof G.status=="string"?G.then(N,N):(G.status="pending",G.then(function(W){G.status==="pending"&&(G.status="fulfilled",G.value=W)},function(W){G.status==="pending"&&(G.status="rejected",G.reason=W)})),G.status){case"fulfilled":return G.value;case"rejected":throw G.reason}}throw G}function _(G,W,O,be,se){var V=typeof G;(V==="undefined"||V==="boolean")&&(G=null);var Z=!1;if(G===null)Z=!0;else switch(V){case"bigint":case"string":case"number":Z=!0;break;case"object":switch(G.$$typeof){case e:case t:Z=!0;break;case p:return Z=G._init,_(Z(G._payload),W,O,be,se)}}if(Z)return se=se(G),Z=be===""?"."+J(G,0):be,U(se)?(O="",Z!=null&&(O=Z.replace(oe,"$&/")+"/"),_(se,W,O,"",function(he){return he})):se!=null&&(F(se)&&(se=$(se,O+(se.key==null||G&&G.key===se.key?"":(""+se.key).replace(oe,"$&/")+"/")+Z)),W.push(se)),1;Z=0;var ne=be===""?".":be+":";if(U(G))for(var ue=0;ue<G.length;ue++)be=G[ue],V=ne+J(be,ue),Z+=_(be,W,O,V,se);else if(ue=y(G),typeof ue=="function")for(G=ue.call(G),ue=0;!(be=G.next()).done;)be=be.value,V=ne+J(be,ue++),Z+=_(be,W,O,V,se);else if(V==="object"){if(typeof G.then=="function")return _(H(G),W,O,be,se);throw W=String(G),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(G).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.")}return Z}function Y(G,W,O){if(G==null)return G;var be=[],se=0;return _(G,be,"","",function(V){return W.call(O,V,se++)}),be}function re(G){if(G._status===-1){var W=G._result;W=W(),W.then(function(O){(G._status===0||G._status===-1)&&(G._status=1,G._result=O)},function(O){(G._status===0||G._status===-1)&&(G._status=2,G._result=O)}),G._status===-1&&(G._status=0,G._result=W)}if(G._status===1)return G._result.default;throw G._result}var fe=typeof reportError=="function"?reportError:function(G){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var W=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof G=="object"&&G!==null&&typeof G.message=="string"?String(G.message):String(G),error:G});if(!window.dispatchEvent(W))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",G);return}console.error(G)},j={map:Y,forEach:function(G,W,O){Y(G,function(){W.apply(this,arguments)},O)},count:function(G){var W=0;return Y(G,function(){W++}),W},toArray:function(G){return Y(G,function(W){return W})||[]},only:function(G){if(!F(G))throw Error("React.Children.only expected to receive a single React element child.");return G}};return kt.Activity=b,kt.Children=j,kt.Component=C,kt.Fragment=n,kt.Profiler=s,kt.PureComponent=I,kt.StrictMode=a,kt.Suspense=m,kt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,kt.__COMPILER_RUNTIME={__proto__:null,c:function(G){return z.H.useMemoCache(G)}},kt.cache=function(G){return function(){return G.apply(null,arguments)}},kt.cacheSignal=function(){return null},kt.cloneElement=function(G,W,O){if(G==null)throw Error("The argument must be a React element, but you passed "+G+".");var be=T({},G.props),se=G.key;if(W!=null)for(V in W.key!==void 0&&(se=""+W.key),W)!X.call(W,V)||V==="key"||V==="__self"||V==="__source"||V==="ref"&&W.ref===void 0||(be[V]=W[V]);var V=arguments.length-2;if(V===1)be.children=O;else if(1<V){for(var Z=Array(V),ne=0;ne<V;ne++)Z[ne]=arguments[ne+2];be.children=Z}return B(G.type,se,be)},kt.createContext=function(G){return G={$$typeof:c,_currentValue:G,_currentValue2:G,_threadCount:0,Provider:null,Consumer:null},G.Provider=G,G.Consumer={$$typeof:o,_context:G},G},kt.createElement=function(G,W,O){var be,se={},V=null;if(W!=null)for(be in W.key!==void 0&&(V=""+W.key),W)X.call(W,be)&&be!=="key"&&be!=="__self"&&be!=="__source"&&(se[be]=W[be]);var Z=arguments.length-2;if(Z===1)se.children=O;else if(1<Z){for(var ne=Array(Z),ue=0;ue<Z;ue++)ne[ue]=arguments[ue+2];se.children=ne}if(G&&G.defaultProps)for(be in Z=G.defaultProps,Z)se[be]===void 0&&(se[be]=Z[be]);return B(G,V,se)},kt.createRef=function(){return{current:null}},kt.forwardRef=function(G){return{$$typeof:d,render:G}},kt.isValidElement=F,kt.lazy=function(G){return{$$typeof:p,_payload:{_status:-1,_result:G},_init:re}},kt.memo=function(G,W){return{$$typeof:h,type:G,compare:W===void 0?null:W}},kt.startTransition=function(G){var W=z.T,O={};z.T=O;try{var be=G(),se=z.S;se!==null&&se(O,be),typeof be=="object"&&be!==null&&typeof be.then=="function"&&be.then(N,fe)}catch(V){fe(V)}finally{W!==null&&O.types!==null&&(W.types=O.types),z.T=W}},kt.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},kt.use=function(G){return z.H.use(G)},kt.useActionState=function(G,W,O){return z.H.useActionState(G,W,O)},kt.useCallback=function(G,W){return z.H.useCallback(G,W)},kt.useContext=function(G){return z.H.useContext(G)},kt.useDebugValue=function(){},kt.useDeferredValue=function(G,W){return z.H.useDeferredValue(G,W)},kt.useEffect=function(G,W){return z.H.useEffect(G,W)},kt.useEffectEvent=function(G){return z.H.useEffectEvent(G)},kt.useId=function(){return z.H.useId()},kt.useImperativeHandle=function(G,W,O){return z.H.useImperativeHandle(G,W,O)},kt.useInsertionEffect=function(G,W){return z.H.useInsertionEffect(G,W)},kt.useLayoutEffect=function(G,W){return z.H.useLayoutEffect(G,W)},kt.useMemo=function(G,W){return z.H.useMemo(G,W)},kt.useOptimistic=function(G,W){return z.H.useOptimistic(G,W)},kt.useReducer=function(G,W,O){return z.H.useReducer(G,W,O)},kt.useRef=function(G){return z.H.useRef(G)},kt.useState=function(G){return z.H.useState(G)},kt.useSyncExternalStore=function(G,W,O){return z.H.useSyncExternalStore(G,W,O)},kt.useTransition=function(){return z.H.useTransition()},kt.version="19.2.8",kt}var ub;function M1(){return ub||(ub=1,qf.exports=m9()),qf.exports}var w=M1();const nt=dd(w);var Hf={exports:{}},bl={},Uf={exports:{}},Ff={};var db;function h9(){return db||(db=1,(function(e){function t(_,Y){var re=_.length;_.push(Y);e:for(;0<re;){var fe=re-1>>>1,j=_[fe];if(0<s(j,Y))_[fe]=Y,_[re]=j,re=fe;else break e}}function n(_){return _.length===0?null:_[0]}function a(_){if(_.length===0)return null;var Y=_[0],re=_.pop();if(re!==Y){_[0]=re;e:for(var fe=0,j=_.length,G=j>>>1;fe<G;){var W=2*(fe+1)-1,O=_[W],be=W+1,se=_[be];if(0>s(O,re))be<j&&0>s(se,O)?(_[fe]=se,_[be]=re,fe=be):(_[fe]=O,_[W]=re,fe=W);else if(be<j&&0>s(se,re))_[fe]=se,_[be]=re,fe=be;else break e}}return Y}function s(_,Y){var re=_.sortIndex-Y.sortIndex;return re!==0?re:_.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,d=c.now();e.unstable_now=function(){return c.now()-d}}var m=[],h=[],p=1,b=null,x=3,y=!1,S=!1,T=!1,A=!1,C=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;function P(_){for(var Y=n(h);Y!==null;){if(Y.callback===null)a(h);else if(Y.startTime<=_)a(h),Y.sortIndex=Y.expirationTime,t(m,Y);else break;Y=n(h)}}function U(_){if(T=!1,P(_),!S)if(n(m)!==null)S=!0,N||(N=!0,K());else{var Y=n(h);Y!==null&&H(U,Y.startTime-_)}}var N=!1,z=-1,X=5,B=-1;function $(){return A?!0:!(e.unstable_now()-B<X)}function F(){if(A=!1,N){var _=e.unstable_now();B=_;var Y=!0;try{e:{S=!1,T&&(T=!1,M(z),z=-1),y=!0;var re=x;try{t:{for(P(_),b=n(m);b!==null&&!(b.expirationTime>_&&$());){var fe=b.callback;if(typeof fe=="function"){b.callback=null,x=b.priorityLevel;var j=fe(b.expirationTime<=_);if(_=e.unstable_now(),typeof j=="function"){b.callback=j,P(_),Y=!0;break t}b===n(m)&&a(m),P(_)}else a(m);b=n(m)}if(b!==null)Y=!0;else{var G=n(h);G!==null&&H(U,G.startTime-_),Y=!1}}break e}finally{b=null,x=re,y=!1}Y=void 0}}finally{Y?K():N=!1}}}var K;if(typeof I=="function")K=function(){I(F)};else if(typeof MessageChannel<"u"){var oe=new MessageChannel,J=oe.port2;oe.port1.onmessage=F,K=function(){J.postMessage(null)}}else K=function(){C(F,0)};function H(_,Y){z=C(function(){_(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(_){_.callback=null},e.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):X=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(_){switch(x){case 1:case 2:case 3:var Y=3;break;default:Y=x}var re=x;x=Y;try{return _()}finally{x=re}},e.unstable_requestPaint=function(){A=!0},e.unstable_runWithPriority=function(_,Y){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var re=x;x=_;try{return Y()}finally{x=re}},e.unstable_scheduleCallback=function(_,Y,re){var fe=e.unstable_now();switch(typeof re=="object"&&re!==null?(re=re.delay,re=typeof re=="number"&&0<re?fe+re:fe):re=fe,_){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=re+j,_={id:p++,callback:Y,priorityLevel:_,startTime:re,expirationTime:j,sortIndex:-1},re>fe?(_.sortIndex=re,t(h,_),n(m)===null&&_===n(h)&&(T?(M(z),z=-1):T=!0,H(U,re-fe))):(_.sortIndex=j,t(m,_),S||y||(S=!0,N||(N=!0,K()))),_},e.unstable_shouldYield=$,e.unstable_wrapCallback=function(_){var Y=x;return function(){var re=x;x=Y;try{return _.apply(this,arguments)}finally{x=re}}}})(Ff)),Ff}var fb;function p9(){return fb||(fb=1,Uf.exports=h9()),Uf.exports}var $f={exports:{}},tr={};var mb;function g9(){if(mb)return tr;mb=1;var e=M1();function t(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)h+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+m+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var a={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function o(m,h,p){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:b==null?null:""+b,children:m,containerInfo:h,implementation:p}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(m,h){if(m==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return tr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,tr.createPortal=function(m,h){var p=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return o(m,h,null,p)},tr.flushSync=function(m){var h=c.T,p=a.p;try{if(c.T=null,a.p=2,m)return m()}finally{c.T=h,a.p=p,a.d.f()}},tr.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,a.d.C(m,h))},tr.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},tr.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var p=h.as,b=d(p,h.crossOrigin),x=typeof h.integrity=="string"?h.integrity:void 0,y=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;p==="style"?a.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:b,integrity:x,fetchPriority:y}):p==="script"&&a.d.X(m,{crossOrigin:b,integrity:x,fetchPriority:y,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},tr.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var p=d(h.as,h.crossOrigin);a.d.M(m,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&a.d.M(m)},tr.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var p=h.as,b=d(p,h.crossOrigin);a.d.L(m,p,{crossOrigin:b,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},tr.preloadModule=function(m,h){if(typeof m=="string")if(h){var p=d(h.as,h.crossOrigin);a.d.m(m,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else a.d.m(m)},tr.requestFormReset=function(m){a.d.r(m)},tr.unstable_batchedUpdates=function(m,h){return m(h)},tr.useFormState=function(m,h,p){return c.H.useFormState(m,h,p)},tr.useFormStatus=function(){return c.H.useHostTransitionStatus()},tr.version="19.2.8",tr}var hb;function P3(){if(hb)return $f.exports;hb=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(),$f.exports=g9(),$f.exports}var pb;function b9(){if(pb)return bl;pb=1;var e=p9(),t=M1(),n=P3();function a(r){var i="https://react.dev/errors/"+r;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l])}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 s(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function o(r){var i=r,l=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,(i.flags&4098)!==0&&(l=i.return),r=i.return;while(r)}return i.tag===3?l: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 d(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 m(r){if(o(r)!==r)throw Error(a(188))}function h(r){var i=r.alternate;if(!i){if(i=o(r),i===null)throw Error(a(188));return i!==r?null:r}for(var l=r,f=i;;){var g=l.return;if(g===null)break;var v=g.alternate;if(v===null){if(f=g.return,f!==null){l=f;continue}break}if(g.child===v.child){for(v=g.child;v;){if(v===l)return m(g),r;if(v===f)return m(g),i;v=v.sibling}throw Error(a(188))}if(l.return!==f.return)l=g,f=v;else{for(var R=!1,L=g.child;L;){if(L===l){R=!0,l=g,f=v;break}if(L===f){R=!0,f=g,l=v;break}L=L.sibling}if(!R){for(L=v.child;L;){if(L===l){R=!0,l=v,f=g;break}if(L===f){R=!0,f=v,l=g;break}L=L.sibling}if(!R)throw Error(a(189))}}if(l.alternate!==f)throw Error(a(190))}if(l.tag!==3)throw Error(a(188));return l.stateNode.current===l?r:i}function p(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r;for(r=r.child;r!==null;){if(i=p(r),i!==null)return i;r=r.sibling}return null}var b=Object.assign,x=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),I=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),$=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function K(r){return r===null||typeof r!="object"?null:(r=F&&r[F]||r["@@iterator"],typeof r=="function"?r:null)}var oe=Symbol.for("react.client.reference");function J(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===oe?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case T:return"Fragment";case C:return"Profiler";case A:return"StrictMode";case U:return"Suspense";case N:return"SuspenseList";case B:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case S:return"Portal";case I:return r.displayName||"Context";case M:return(r._context.displayName||"Context")+".Consumer";case P:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case z:return i=r.displayName||null,i!==null?i:J(r.type)||"Memo";case X:i=r._payload,r=r._init;try{return J(r(i))}catch{}}return null}var H=Array.isArray,_=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,re={pending:!1,data:null,method:null,action:null},fe=[],j=-1;function G(r){return{current:r}}function W(r){0>j||(r.current=fe[j],fe[j]=null,j--)}function O(r,i){j++,fe[j]=r.current,r.current=i}var be=G(null),se=G(null),V=G(null),Z=G(null);function ne(r,i){switch(O(V,i),O(se,r),O(be,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?I2(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=I2(i),r=_2(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}W(be),O(be,r)}function ue(){W(be),W(se),W(V)}function he(r){r.memoizedState!==null&&O(Z,r);var i=be.current,l=_2(i,r.type);i!==l&&(O(se,r),O(be,l))}function Re(r){se.current===r&&(W(be),W(se)),Z.current===r&&(W(Z),fl._currentValue=re)}var Le,Ye;function ut(r){if(Le===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);Le=i&&i[1]||"",Ye=-1<l.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+Le+r+Ye}var pt=!1;function Rt(r,i){if(!r||pt)return"";pt=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var f={DetermineComponentFrameRoot:function(){try{if(i){var Ce=function(){throw Error()};if(Object.defineProperty(Ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ce,[])}catch(xe){var ye=xe}Reflect.construct(r,[],Ce)}else{try{Ce.call()}catch(xe){ye=xe}r.call(Ce.prototype)}}else{try{throw Error()}catch(xe){ye=xe}(Ce=r())&&typeof Ce.catch=="function"&&Ce.catch(function(){})}}catch(xe){if(xe&&ye&&typeof xe.stack=="string")return[xe.stack,ye.stack]}return[null,null]}};f.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(f.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(f.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=f.DetermineComponentFrameRoot(),R=v[0],L=v[1];if(R&&L){var ie=R.split(`
|
|
4
|
-
`),ve=L.split(`
|
|
5
|
-
`);for(g=f=0;f<ie.length&&!ie[f].includes("DetermineComponentFrameRoot");)f++;for(;g<ve.length&&!ve[g].includes("DetermineComponentFrameRoot");)g++;if(f===ie.length||g===ve.length)for(f=ie.length-1,g=ve.length-1;1<=f&&0<=g&&ie[f]!==ve[g];)g--;for(;1<=f&&0<=g;f--,g--)if(ie[f]!==ve[g]){if(f!==1||g!==1)do if(f--,g--,0>g||ie[f]!==ve[g]){var Se=`
|
|
6
|
-
`+ie[f].replace(" at new "," at ");return r.displayName&&Se.includes("<anonymous>")&&(Se=Se.replace("<anonymous>",r.displayName)),Se}while(1<=f&&0<=g);break}}}finally{pt=!1,Error.prepareStackTrace=l}return(l=r?r.displayName||r.name:"")?ut(l):""}function Ht(r,i){switch(r.tag){case 26:case 27:case 5:return ut(r.type);case 16:return ut("Lazy");case 13:return r.child!==i&&i!==null?ut("Suspense Fallback"):ut("Suspense");case 19:return ut("SuspenseList");case 0:case 15:return Rt(r.type,!1);case 11:return Rt(r.type.render,!1);case 1:return Rt(r.type,!0);case 31:return ut("Activity");default:return""}}function at(r){try{var i="",l=null;do i+=Ht(r,l),l=r,r=r.return;while(r);return i}catch(f){return`
|
|
7
|
-
Error generating stack: `+f.message+`
|
|
8
|
-
`+f.stack}}var Mt=Object.prototype.hasOwnProperty,ft=e.unstable_scheduleCallback,Ut=e.unstable_cancelCallback,ze=e.unstable_shouldYield,Qe=e.unstable_requestPaint,Ue=e.unstable_now,mt=e.unstable_getCurrentPriorityLevel,pe=e.unstable_ImmediatePriority,me=e.unstable_UserBlockingPriority,He=e.unstable_NormalPriority,we=e.unstable_LowPriority,Fe=e.unstable_IdlePriority,lt=e.log,Ae=e.unstable_setDisableYieldValue,Kt=null,gt=null;function _t(r){if(typeof lt=="function"&&Ae(r),gt&&typeof gt.setStrictMode=="function")try{gt.setStrictMode(Kt,r)}catch{}}var Tt=Math.clz32?Math.clz32:st,Mn=Math.log,pn=Math.LN2;function st(r){return r>>>=0,r===0?32:31-(Mn(r)/pn|0)|0}var je=256,wt=262144,bt=4194304;function Gt(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 Q(r,i,l){var f=r.pendingLanes;if(f===0)return 0;var g=0,v=r.suspendedLanes,R=r.pingedLanes;r=r.warmLanes;var L=f&134217727;return L!==0?(f=L&~v,f!==0?g=Gt(f):(R&=L,R!==0?g=Gt(R):l||(l=L&~r,l!==0&&(g=Gt(l))))):(L=f&~v,L!==0?g=Gt(L):R!==0?g=Gt(R):l||(l=f&~r,l!==0&&(g=Gt(l)))),g===0?0:i!==0&&i!==g&&(i&v)===0&&(v=g&-g,l=i&-i,v>=l||v===32&&(l&4194048)!==0)?i:g}function ke(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function qe(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 et(){var r=bt;return bt<<=1,(bt&62914560)===0&&(bt=4194304),r}function St(r){for(var i=[],l=0;31>l;l++)i.push(r);return i}function jt(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function Ke(r,i,l,f,g,v){var R=r.pendingLanes;r.pendingLanes=l,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=l,r.entangledLanes&=l,r.errorRecoveryDisabledLanes&=l,r.shellSuspendCounter=0;var L=r.entanglements,ie=r.expirationTimes,ve=r.hiddenUpdates;for(l=R&~l;0<l;){var Se=31-Tt(l),Ce=1<<Se;L[Se]=0,ie[Se]=-1;var ye=ve[Se];if(ye!==null)for(ve[Se]=null,Se=0;Se<ye.length;Se++){var xe=ye[Se];xe!==null&&(xe.lane&=-536870913)}l&=~Ce}f!==0&&Pe(r,f,0),v!==0&&g===0&&r.tag!==0&&(r.suspendedLanes|=v&~(R&~i))}function Pe(r,i,l){r.pendingLanes|=i,r.suspendedLanes&=~i;var f=31-Tt(i);r.entangledLanes|=i,r.entanglements[f]=r.entanglements[f]|1073741824|l&261930}function it(r,i){var l=r.entangledLanes|=i;for(r=r.entanglements;l;){var f=31-Tt(l),g=1<<f;g&i|r[f]&i&&(r[f]|=i),l&=~g}}function Xt(r,i){var l=i&-i;return l=(l&42)!==0?1:Yt(l),(l&(r.suspendedLanes|i))!==0?0:l}function Yt(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 Nr(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function na(){var r=Y.p;return r!==0?r:(r=window.event,r===void 0?32:eb(r.type))}function Na(r,i){var l=Y.p;try{return Y.p=r,i()}finally{Y.p=l}}var mr=Math.random().toString(36).slice(2),xn="__reactFiber$"+mr,Kn="__reactProps$"+mr,da="__reactContainer$"+mr,Aa="__reactEvents$"+mr,As="__reactListeners$"+mr,ii="__reactHandles$"+mr,Is="__reactResources$"+mr,fa="__reactMarker$"+mr;function si(r){delete r[xn],delete r[Kn],delete r[Aa],delete r[As],delete r[ii]}function Wn(r){var i=r[xn];if(i)return i;for(var l=r.parentNode;l;){if(i=l[da]||l[xn]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(r=B2(r);r!==null;){if(l=r[xn])return l;r=B2(r)}return i}r=l,l=r.parentNode}return null}function ir(r){if(r=r[xn]||r[da]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function ra(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function aa(r){var i=r[Is];return i||(i=r[Is]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function wn(r){r[fa]=!0}var Ki=new Set,ma={};function Ar(r,i){_e(r,i),_e(r+"Capture",i)}function _e(r,i){for(ma[r]=i,r=0;r<i.length;r++)Ki.add(i[r])}var Je=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]*$"),Nt={},ee={};function Ee(r){return Mt.call(ee,r)?!0:Mt.call(Nt,r)?!1:Je.test(r)?ee[r]=!0:(Nt[r]=!0,!1)}function vt(r,i,l){if(Ee(i))if(l===null)r.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var f=i.toLowerCase().slice(0,5);if(f!=="data-"&&f!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+l)}}function Lt(r,i,l){if(l===null)r.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(i);return}r.setAttribute(i,""+l)}}function gn(r,i,l,f){if(f===null)r.removeAttribute(l);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(l);return}r.setAttributeNS(i,l,""+f)}}function Ot(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function fn(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function hr(r,i,l){var f=Object.getOwnPropertyDescriptor(r.constructor.prototype,i);if(!r.hasOwnProperty(i)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var g=f.get,v=f.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return g.call(this)},set:function(R){l=""+R,v.call(this,R)}}),Object.defineProperty(r,i,{enumerable:f.enumerable}),{getValue:function(){return l},setValue:function(R){l=""+R},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function pr(r){if(!r._valueTracker){var i=fn(r)?"checked":"value";r._valueTracker=hr(r,i,""+r[i])}}function sr(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var l=i.getValue(),f="";return r&&(f=fn(r)?r.checked?"true":"false":r.value),r=f,r!==l?(i.setValue(r),!0):!1}function ia(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 Ld=/[\n"\\]/g;function gr(r){return r.replace(Ld,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Co(r,i,l,f,g,v,R,L){r.name="",R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?r.type=R:r.removeAttribute("type"),i!=null?R==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+Ot(i)):r.value!==""+Ot(i)&&(r.value=""+Ot(i)):R!=="submit"&&R!=="reset"||r.removeAttribute("value"),i!=null?_s(r,R,Ot(i)):l!=null?_s(r,R,Ot(l)):f!=null&&r.removeAttribute("value"),g==null&&v!=null&&(r.defaultChecked=!!v),g!=null&&(r.checked=g&&typeof g!="function"&&typeof g!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?r.name=""+Ot(L):r.removeAttribute("name")}function Yi(r,i,l,f,g,v,R,L){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(r.type=v),i!=null||l!=null){if(!(v!=="submit"&&v!=="reset"||i!=null)){pr(r);return}l=l!=null?""+Ot(l):"",i=i!=null?""+Ot(i):l,L||i===r.value||(r.value=i),r.defaultValue=i}f=f??g,f=typeof f!="function"&&typeof f!="symbol"&&!!f,r.checked=L?r.checked:!!f,r.defaultChecked=!!f,R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"&&(r.name=R),pr(r)}function _s(r,i,l){i==="number"&&ia(r.ownerDocument)===r||r.defaultValue===""+l||(r.defaultValue=""+l)}function Zn(r,i,l,f){if(r=r.options,i){i={};for(var g=0;g<l.length;g++)i["$"+l[g]]=!0;for(l=0;l<r.length;l++)g=i.hasOwnProperty("$"+r[l].value),r[l].selected!==g&&(r[l].selected=g),g&&f&&(r[l].defaultSelected=!0)}else{for(l=""+Ot(l),i=null,g=0;g<r.length;g++){if(r[g].value===l){r[g].selected=!0,f&&(r[g].defaultSelected=!0);return}i!==null||r[g].disabled||(i=r[g])}i!==null&&(i.selected=!0)}}function rc(r,i,l){if(i!=null&&(i=""+Ot(i),i!==r.value&&(r.value=i),l==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=l!=null?""+Ot(l):""}function Ms(r,i,l,f){if(i==null){if(f!=null){if(l!=null)throw Error(a(92));if(H(f)){if(1<f.length)throw Error(a(93));f=f[0]}l=f}l==null&&(l=""),i=l}l=Ot(i),r.defaultValue=l,f=r.textContent,f===l&&f!==""&&f!==null&&(r.value=f),pr(r)}function dt(r,i){if(i){var l=r.firstChild;if(l&&l===r.lastChild&&l.nodeType===3){l.nodeValue=i;return}}r.textContent=i}var ac=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 On(r,i,l){var f=i.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?f?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":f?r.setProperty(i,l):typeof l!="number"||l===0||ac.has(i)?i==="float"?r.cssFloat=l:r[i]=(""+l).trim():r[i]=l+"px"}function tn(r,i,l){if(i!=null&&typeof i!="object")throw Error(a(62));if(r=r.style,l!=null){for(var f in l)!l.hasOwnProperty(f)||i!=null&&i.hasOwnProperty(f)||(f.indexOf("--")===0?r.setProperty(f,""):f==="float"?r.cssFloat="":r[f]="");for(var g in i)f=i[g],i.hasOwnProperty(g)&&l[g]!==f&&On(r,g,f)}else for(var v in i)i.hasOwnProperty(v)&&On(r,v,i[v])}function oi(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 Ia=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"]]),Ro=/^[\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 li(r){return Ro.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function $e(){}var Ze=null;function Et(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Ft=null,kn=null;function $r(r){var i=ir(r);if(i&&(r=i.stateNode)){var l=r[Kn]||null;e:switch(r=i.stateNode,i.type){case"input":if(Co(r,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),i=l.name,l.type==="radio"&&i!=null){for(l=r;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+gr(""+i)+'"][type="radio"]'),i=0;i<l.length;i++){var f=l[i];if(f!==r&&f.form===r.form){var g=f[Kn]||null;if(!g)throw Error(a(90));Co(f,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(i=0;i<l.length;i++)f=l[i],f.form===r.form&&sr(f)}break e;case"textarea":rc(r,l.value,l.defaultValue);break e;case"select":i=l.value,i!=null&&Zn(r,!!l.multiple,i,!1)}}}var No=!1;function ic(r,i,l){if(No)return r(i,l);No=!0;try{var f=r(i);return f}finally{if(No=!1,(Ft!==null||kn!==null)&&(Vc(),Ft&&(i=Ft,r=kn,kn=Ft=null,$r(i),r)))for(i=0;i<r.length;i++)$r(r[i])}}function Ao(r,i){var l=r.stateNode;if(l===null)return null;var f=l[Kn]||null;if(f===null)return null;l=f[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":(f=!f.disabled)||(r=r.type,f=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!f;break e;default:r=!1}if(r)return null;if(l&&typeof l!="function")throw Error(a(231,i,typeof l));return l}var _a=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),zd=!1;if(_a)try{var Io={};Object.defineProperty(Io,"passive",{get:function(){zd=!0}}),window.addEventListener("test",Io,Io),window.removeEventListener("test",Io,Io)}catch{zd=!1}var ci=null,Bd=null,sc=null;function _p(){if(sc)return sc;var r,i=Bd,l=i.length,f,g="value"in ci?ci.value:ci.textContent,v=g.length;for(r=0;r<l&&i[r]===g[r];r++);var R=l-r;for(f=1;f<=R&&i[l-f]===g[v-f];f++);return sc=g.slice(r,1<f?1-f:void 0)}function oc(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 lc(){return!0}function Mp(){return!1}function br(r){function i(l,f,g,v,R){this._reactName=l,this._targetInst=g,this.type=f,this.nativeEvent=v,this.target=R,this.currentTarget=null;for(var L in r)r.hasOwnProperty(L)&&(l=r[L],this[L]=l?l(v):v[L]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?lc:Mp,this.isPropagationStopped=Mp,this}return b(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=lc)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=lc)},persist:function(){},isPersistent:lc}),i}var Wi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cc=br(Wi),_o=b({},Wi,{view:0,detail:0}),cx=br(_o),qd,Hd,Mo,uc=b({},_o,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fd,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!==Mo&&(Mo&&r.type==="mousemove"?(qd=r.screenX-Mo.screenX,Hd=r.screenY-Mo.screenY):Hd=qd=0,Mo=r),qd)},movementY:function(r){return"movementY"in r?r.movementY:Hd}}),Op=br(uc),ux=b({},uc,{dataTransfer:0}),dx=br(ux),fx=b({},_o,{relatedTarget:0}),Ud=br(fx),mx=b({},Wi,{animationName:0,elapsedTime:0,pseudoElement:0}),hx=br(mx),px=b({},Wi,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),gx=br(px),bx=b({},Wi,{data:0}),Dp=br(bx),vx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},yx={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"},xx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function wx(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=xx[r])?!!i[r]:!1}function Fd(){return wx}var kx=b({},_o,{key:function(r){if(r.key){var i=vx[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=oc(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?yx[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fd,charCode:function(r){return r.type==="keypress"?oc(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?oc(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),Sx=br(kx),Ex=b({},uc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),jp=br(Ex),Tx=b({},_o,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fd}),Cx=br(Tx),Rx=b({},Wi,{propertyName:0,elapsedTime:0,pseudoElement:0}),Nx=br(Rx),Ax=b({},uc,{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}),Ix=br(Ax),_x=b({},Wi,{newState:0,oldState:0}),Mx=br(_x),Ox=[9,13,27,32],$d=_a&&"CompositionEvent"in window,Oo=null;_a&&"documentMode"in document&&(Oo=document.documentMode);var Dx=_a&&"TextEvent"in window&&!Oo,Lp=_a&&(!$d||Oo&&8<Oo&&11>=Oo),zp=" ",Bp=!1;function qp(r,i){switch(r){case"keyup":return Ox.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hp(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Os=!1;function jx(r,i){switch(r){case"compositionend":return Hp(i);case"keypress":return i.which!==32?null:(Bp=!0,zp);case"textInput":return r=i.data,r===zp&&Bp?null:r;default:return null}}function Lx(r,i){if(Os)return r==="compositionend"||!$d&&qp(r,i)?(r=_p(),sc=Bd=ci=null,Os=!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 Lp&&i.locale!=="ko"?null:i.data;default:return null}}var zx={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 Up(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!zx[r.type]:i==="textarea"}function Fp(r,i,l,f){Ft?kn?kn.push(f):kn=[f]:Ft=f,i=Jc(i,"onChange"),0<i.length&&(l=new cc("onChange","change",null,l,f),r.push({event:l,listeners:i}))}var Do=null,jo=null;function Bx(r){E2(r,0)}function dc(r){var i=ra(r);if(sr(i))return r}function $p(r,i){if(r==="change")return i}var Pp=!1;if(_a){var Pd;if(_a){var Gd="oninput"in document;if(!Gd){var Gp=document.createElement("div");Gp.setAttribute("oninput","return;"),Gd=typeof Gp.oninput=="function"}Pd=Gd}else Pd=!1;Pp=Pd&&(!document.documentMode||9<document.documentMode)}function Vp(){Do&&(Do.detachEvent("onpropertychange",Kp),jo=Do=null)}function Kp(r){if(r.propertyName==="value"&&dc(jo)){var i=[];Fp(i,jo,r,Et(r)),ic(Bx,i)}}function qx(r,i,l){r==="focusin"?(Vp(),Do=i,jo=l,Do.attachEvent("onpropertychange",Kp)):r==="focusout"&&Vp()}function Hx(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return dc(jo)}function Ux(r,i){if(r==="click")return dc(i)}function Fx(r,i){if(r==="input"||r==="change")return dc(i)}function $x(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var Ir=typeof Object.is=="function"?Object.is:$x;function Lo(r,i){if(Ir(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var l=Object.keys(r),f=Object.keys(i);if(l.length!==f.length)return!1;for(f=0;f<l.length;f++){var g=l[f];if(!Mt.call(i,g)||!Ir(r[g],i[g]))return!1}return!0}function Yp(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Wp(r,i){var l=Yp(r);r=0;for(var f;l;){if(l.nodeType===3){if(f=r+l.textContent.length,r<=i&&f>=i)return{node:l,offset:i-r};r=f}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Yp(l)}}function Zp(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?Zp(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function Xp(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=ia(r.document);i instanceof r.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)r=i.contentWindow;else break;i=ia(r.document)}return i}function Vd(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 Px=_a&&"documentMode"in document&&11>=document.documentMode,Ds=null,Kd=null,zo=null,Yd=!1;function Qp(r,i,l){var f=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Yd||Ds==null||Ds!==ia(f)||(f=Ds,"selectionStart"in f&&Vd(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),zo&&Lo(zo,f)||(zo=f,f=Jc(Kd,"onSelect"),0<f.length&&(i=new cc("onSelect","select",null,i,l),r.push({event:i,listeners:f}),i.target=Ds)))}function Zi(r,i){var l={};return l[r.toLowerCase()]=i.toLowerCase(),l["Webkit"+r]="webkit"+i,l["Moz"+r]="moz"+i,l}var js={animationend:Zi("Animation","AnimationEnd"),animationiteration:Zi("Animation","AnimationIteration"),animationstart:Zi("Animation","AnimationStart"),transitionrun:Zi("Transition","TransitionRun"),transitionstart:Zi("Transition","TransitionStart"),transitioncancel:Zi("Transition","TransitionCancel"),transitionend:Zi("Transition","TransitionEnd")},Wd={},Jp={};_a&&(Jp=document.createElement("div").style,"AnimationEvent"in window||(delete js.animationend.animation,delete js.animationiteration.animation,delete js.animationstart.animation),"TransitionEvent"in window||delete js.transitionend.transition);function Xi(r){if(Wd[r])return Wd[r];if(!js[r])return r;var i=js[r],l;for(l in i)if(i.hasOwnProperty(l)&&l in Jp)return Wd[r]=i[l];return r}var eg=Xi("animationend"),tg=Xi("animationiteration"),ng=Xi("animationstart"),Gx=Xi("transitionrun"),Vx=Xi("transitionstart"),Kx=Xi("transitioncancel"),rg=Xi("transitionend"),ag=new Map,Zd="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(" ");Zd.push("scrollEnd");function sa(r,i){ag.set(r,i),Ar(i,[r])}var fc=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)},Pr=[],Ls=0,Xd=0;function mc(){for(var r=Ls,i=Xd=Ls=0;i<r;){var l=Pr[i];Pr[i++]=null;var f=Pr[i];Pr[i++]=null;var g=Pr[i];Pr[i++]=null;var v=Pr[i];if(Pr[i++]=null,f!==null&&g!==null){var R=f.pending;R===null?g.next=g:(g.next=R.next,R.next=g),f.pending=g}v!==0&&ig(l,g,v)}}function hc(r,i,l,f){Pr[Ls++]=r,Pr[Ls++]=i,Pr[Ls++]=l,Pr[Ls++]=f,Xd|=f,r.lanes|=f,r=r.alternate,r!==null&&(r.lanes|=f)}function Qd(r,i,l,f){return hc(r,i,l,f),pc(r)}function Qi(r,i){return hc(r,null,null,i),pc(r)}function ig(r,i,l){r.lanes|=l;var f=r.alternate;f!==null&&(f.lanes|=l);for(var g=!1,v=r.return;v!==null;)v.childLanes|=l,f=v.alternate,f!==null&&(f.childLanes|=l),v.tag===22&&(r=v.stateNode,r===null||r._visibility&1||(g=!0)),r=v,v=v.return;return r.tag===3?(v=r.stateNode,g&&i!==null&&(g=31-Tt(l),r=v.hiddenUpdates,f=r[g],f===null?r[g]=[i]:f.push(i),i.lane=l|536870912),v):null}function pc(r){if(50<il)throw il=0,lf=null,Error(a(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var zs={};function Yx(r,i,l,f){this.tag=r,this.key=l,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=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function _r(r,i,l,f){return new Yx(r,i,l,f)}function Jd(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Ma(r,i){var l=r.alternate;return l===null?(l=_r(r.tag,i,r.key,r.mode),l.elementType=r.elementType,l.type=r.type,l.stateNode=r.stateNode,l.alternate=r,r.alternate=l):(l.pendingProps=i,l.type=r.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=r.flags&65011712,l.childLanes=r.childLanes,l.lanes=r.lanes,l.child=r.child,l.memoizedProps=r.memoizedProps,l.memoizedState=r.memoizedState,l.updateQueue=r.updateQueue,i=r.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=r.sibling,l.index=r.index,l.ref=r.ref,l.refCleanup=r.refCleanup,l}function sg(r,i){r.flags&=65011714;var l=r.alternate;return l===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=l.childLanes,r.lanes=l.lanes,r.child=l.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=l.memoizedProps,r.memoizedState=l.memoizedState,r.updateQueue=l.updateQueue,r.type=l.type,i=l.dependencies,r.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),r}function gc(r,i,l,f,g,v){var R=0;if(f=r,typeof r=="function")Jd(r)&&(R=1);else if(typeof r=="string")R=J8(r,l,be.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case B:return r=_r(31,l,i,g),r.elementType=B,r.lanes=v,r;case T:return Ji(l.children,g,v,i);case A:R=8,g|=24;break;case C:return r=_r(12,l,i,g|2),r.elementType=C,r.lanes=v,r;case U:return r=_r(13,l,i,g),r.elementType=U,r.lanes=v,r;case N:return r=_r(19,l,i,g),r.elementType=N,r.lanes=v,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case I:R=10;break e;case M:R=9;break e;case P:R=11;break e;case z:R=14;break e;case X:R=16,f=null;break e}R=29,l=Error(a(130,r===null?"null":typeof r,"")),f=null}return i=_r(R,l,i,g),i.elementType=r,i.type=f,i.lanes=v,i}function Ji(r,i,l,f){return r=_r(7,r,f,i),r.lanes=l,r}function e0(r,i,l){return r=_r(6,r,null,i),r.lanes=l,r}function og(r){var i=_r(18,null,null,0);return i.stateNode=r,i}function t0(r,i,l){return i=_r(4,r.children!==null?r.children:[],r.key,i),i.lanes=l,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var lg=new WeakMap;function Gr(r,i){if(typeof r=="object"&&r!==null){var l=lg.get(r);return l!==void 0?l:(i={value:r,source:i,stack:at(i)},lg.set(r,i),i)}return{value:r,source:i,stack:at(i)}}var Bs=[],qs=0,bc=null,Bo=0,Vr=[],Kr=0,ui=null,ha=1,pa="";function Oa(r,i){Bs[qs++]=Bo,Bs[qs++]=bc,bc=r,Bo=i}function cg(r,i,l){Vr[Kr++]=ha,Vr[Kr++]=pa,Vr[Kr++]=ui,ui=r;var f=ha;r=pa;var g=32-Tt(f)-1;f&=~(1<<g),l+=1;var v=32-Tt(i)+g;if(30<v){var R=g-g%5;v=(f&(1<<R)-1).toString(32),f>>=R,g-=R,ha=1<<32-Tt(i)+g|l<<g|f,pa=v+r}else ha=1<<v|l<<g|f,pa=r}function n0(r){r.return!==null&&(Oa(r,1),cg(r,1,0))}function r0(r){for(;r===bc;)bc=Bs[--qs],Bs[qs]=null,Bo=Bs[--qs],Bs[qs]=null;for(;r===ui;)ui=Vr[--Kr],Vr[Kr]=null,pa=Vr[--Kr],Vr[Kr]=null,ha=Vr[--Kr],Vr[Kr]=null}function ug(r,i){Vr[Kr++]=ha,Vr[Kr++]=pa,Vr[Kr++]=ui,ha=i.id,pa=i.overflow,ui=r}var Xn=null,mn=null,Vt=!1,di=null,Yr=!1,a0=Error(a(519));function fi(r){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw qo(Gr(i,r)),a0}function dg(r){var i=r.stateNode,l=r.type,f=r.memoizedProps;switch(i[xn]=r,i[Kn]=f,l){case"dialog":Bt("cancel",i),Bt("close",i);break;case"iframe":case"object":case"embed":Bt("load",i);break;case"video":case"audio":for(l=0;l<ol.length;l++)Bt(ol[l],i);break;case"source":Bt("error",i);break;case"img":case"image":case"link":Bt("error",i),Bt("load",i);break;case"details":Bt("toggle",i);break;case"input":Bt("invalid",i),Yi(i,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0);break;case"select":Bt("invalid",i);break;case"textarea":Bt("invalid",i),Ms(i,f.value,f.defaultValue,f.children)}l=f.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||i.textContent===""+l||f.suppressHydrationWarning===!0||N2(i.textContent,l)?(f.popover!=null&&(Bt("beforetoggle",i),Bt("toggle",i)),f.onScroll!=null&&Bt("scroll",i),f.onScrollEnd!=null&&Bt("scrollend",i),f.onClick!=null&&(i.onclick=$e),i=!0):i=!1,i||fi(r,!0)}function fg(r){for(Xn=r.return;Xn;)switch(Xn.tag){case 5:case 31:case 13:Yr=!1;return;case 27:case 3:Yr=!0;return;default:Xn=Xn.return}}function Hs(r){if(r!==Xn)return!1;if(!Vt)return fg(r),Vt=!0,!1;var i=r.tag,l;if((l=i!==3&&i!==27)&&((l=i===5)&&(l=r.type,l=!(l!=="form"&&l!=="button")||Sf(r.type,r.memoizedProps)),l=!l),l&&mn&&fi(r),fg(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));mn=z2(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));mn=z2(r)}else i===27?(i=mn,Ci(r.type)?(r=Nf,Nf=null,mn=r):mn=i):mn=Xn?Zr(r.stateNode.nextSibling):null;return!0}function es(){mn=Xn=null,Vt=!1}function i0(){var r=di;return r!==null&&(wr===null?wr=r:wr.push.apply(wr,r),di=null),r}function qo(r){di===null?di=[r]:di.push(r)}var s0=G(null),ts=null,Da=null;function mi(r,i,l){O(s0,i._currentValue),i._currentValue=l}function ja(r){r._currentValue=s0.current,W(s0)}function o0(r,i,l){for(;r!==null;){var f=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,f!==null&&(f.childLanes|=i)):f!==null&&(f.childLanes&i)!==i&&(f.childLanes|=i),r===l)break;r=r.return}}function l0(r,i,l,f){var g=r.child;for(g!==null&&(g.return=r);g!==null;){var v=g.dependencies;if(v!==null){var R=g.child;v=v.firstContext;e:for(;v!==null;){var L=v;v=g;for(var ie=0;ie<i.length;ie++)if(L.context===i[ie]){v.lanes|=l,L=v.alternate,L!==null&&(L.lanes|=l),o0(v.return,l,r),f||(R=null);break e}v=L.next}}else if(g.tag===18){if(R=g.return,R===null)throw Error(a(341));R.lanes|=l,v=R.alternate,v!==null&&(v.lanes|=l),o0(R,l,r),R=null}else R=g.child;if(R!==null)R.return=g;else for(R=g;R!==null;){if(R===r){R=null;break}if(g=R.sibling,g!==null){g.return=R.return,R=g;break}R=R.return}g=R}}function Us(r,i,l,f){r=null;for(var g=i,v=!1;g!==null;){if(!v){if((g.flags&524288)!==0)v=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var R=g.alternate;if(R===null)throw Error(a(387));if(R=R.memoizedProps,R!==null){var L=g.type;Ir(g.pendingProps.value,R.value)||(r!==null?r.push(L):r=[L])}}else if(g===Z.current){if(R=g.alternate,R===null)throw Error(a(387));R.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(r!==null?r.push(fl):r=[fl])}g=g.return}r!==null&&l0(i,r,l,f),i.flags|=262144}function vc(r){for(r=r.firstContext;r!==null;){if(!Ir(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function ns(r){ts=r,Da=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function Qn(r){return mg(ts,r)}function yc(r,i){return ts===null&&ns(r),mg(r,i)}function mg(r,i){var l=i._currentValue;if(i={context:i,memoizedValue:l,next:null},Da===null){if(r===null)throw Error(a(308));Da=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else Da=Da.next=i;return l}var Wx=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(l,f){r.push(f)}};this.abort=function(){i.aborted=!0,r.forEach(function(l){return l()})}},Zx=e.unstable_scheduleCallback,Xx=e.unstable_NormalPriority,Dn={$$typeof:I,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function c0(){return{controller:new Wx,data:new Map,refCount:0}}function Ho(r){r.refCount--,r.refCount===0&&Zx(Xx,function(){r.controller.abort()})}var Uo=null,u0=0,Fs=0,$s=null;function Qx(r,i){if(Uo===null){var l=Uo=[];u0=0,Fs=hf(),$s={status:"pending",value:void 0,then:function(f){l.push(f)}}}return u0++,i.then(hg,hg),i}function hg(){if(--u0===0&&Uo!==null){$s!==null&&($s.status="fulfilled");var r=Uo;Uo=null,Fs=0,$s=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function Jx(r,i){var l=[],f={status:"pending",value:null,reason:null,then:function(g){l.push(g)}};return r.then(function(){f.status="fulfilled",f.value=i;for(var g=0;g<l.length;g++)(0,l[g])(i)},function(g){for(f.status="rejected",f.reason=g,g=0;g<l.length;g++)(0,l[g])(void 0)}),f}var pg=_.S;_.S=function(r,i){Q4=Ue(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&Qx(r,i),pg!==null&&pg(r,i)};var rs=G(null);function d0(){var r=rs.current;return r!==null?r:ln.pooledCache}function xc(r,i){i===null?O(rs,rs.current):O(rs,i.pool)}function gg(){var r=d0();return r===null?null:{parent:Dn._currentValue,pool:r}}var Ps=Error(a(460)),f0=Error(a(474)),wc=Error(a(542)),kc={then:function(){}};function bg(r){return r=r.status,r==="fulfilled"||r==="rejected"}function vg(r,i,l){switch(l=r[l],l===void 0?r.push(i):l!==i&&(i.then($e,$e),i=l),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,xg(r),r;default:if(typeof i.status=="string")i.then($e,$e);else{if(r=ln,r!==null&&100<r.shellSuspendCounter)throw Error(a(482));r=i,r.status="pending",r.then(function(f){if(i.status==="pending"){var g=i;g.status="fulfilled",g.value=f}},function(f){if(i.status==="pending"){var g=i;g.status="rejected",g.reason=f}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,xg(r),r}throw is=i,Ps}}function as(r){try{var i=r._init;return i(r._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(is=l,Ps):l}}var is=null;function yg(){if(is===null)throw Error(a(459));var r=is;return is=null,r}function xg(r){if(r===Ps||r===wc)throw Error(a(483))}var Gs=null,Fo=0;function Sc(r){var i=Fo;return Fo+=1,Gs===null&&(Gs=[]),vg(Gs,r,i)}function $o(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function Ec(r,i){throw i.$$typeof===x?Error(a(525)):(r=Object.prototype.toString.call(i),Error(a(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r)))}function wg(r){function i(de,le){if(r){var ge=de.deletions;ge===null?(de.deletions=[le],de.flags|=16):ge.push(le)}}function l(de,le){if(!r)return null;for(;le!==null;)i(de,le),le=le.sibling;return null}function f(de){for(var le=new Map;de!==null;)de.key!==null?le.set(de.key,de):le.set(de.index,de),de=de.sibling;return le}function g(de,le){return de=Ma(de,le),de.index=0,de.sibling=null,de}function v(de,le,ge){return de.index=ge,r?(ge=de.alternate,ge!==null?(ge=ge.index,ge<le?(de.flags|=67108866,le):ge):(de.flags|=67108866,le)):(de.flags|=1048576,le)}function R(de){return r&&de.alternate===null&&(de.flags|=67108866),de}function L(de,le,ge,Te){return le===null||le.tag!==6?(le=e0(ge,de.mode,Te),le.return=de,le):(le=g(le,ge),le.return=de,le)}function ie(de,le,ge,Te){var rt=ge.type;return rt===T?Se(de,le,ge.props.children,Te,ge.key):le!==null&&(le.elementType===rt||typeof rt=="object"&&rt!==null&&rt.$$typeof===X&&as(rt)===le.type)?(le=g(le,ge.props),$o(le,ge),le.return=de,le):(le=gc(ge.type,ge.key,ge.props,null,de.mode,Te),$o(le,ge),le.return=de,le)}function ve(de,le,ge,Te){return le===null||le.tag!==4||le.stateNode.containerInfo!==ge.containerInfo||le.stateNode.implementation!==ge.implementation?(le=t0(ge,de.mode,Te),le.return=de,le):(le=g(le,ge.children||[]),le.return=de,le)}function Se(de,le,ge,Te,rt){return le===null||le.tag!==7?(le=Ji(ge,de.mode,Te,rt),le.return=de,le):(le=g(le,ge),le.return=de,le)}function Ce(de,le,ge){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return le=e0(""+le,de.mode,ge),le.return=de,le;if(typeof le=="object"&&le!==null){switch(le.$$typeof){case y:return ge=gc(le.type,le.key,le.props,null,de.mode,ge),$o(ge,le),ge.return=de,ge;case S:return le=t0(le,de.mode,ge),le.return=de,le;case X:return le=as(le),Ce(de,le,ge)}if(H(le)||K(le))return le=Ji(le,de.mode,ge,null),le.return=de,le;if(typeof le.then=="function")return Ce(de,Sc(le),ge);if(le.$$typeof===I)return Ce(de,yc(de,le),ge);Ec(de,le)}return null}function ye(de,le,ge,Te){var rt=le!==null?le.key:null;if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return rt!==null?null:L(de,le,""+ge,Te);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case y:return ge.key===rt?ie(de,le,ge,Te):null;case S:return ge.key===rt?ve(de,le,ge,Te):null;case X:return ge=as(ge),ye(de,le,ge,Te)}if(H(ge)||K(ge))return rt!==null?null:Se(de,le,ge,Te,null);if(typeof ge.then=="function")return ye(de,le,Sc(ge),Te);if(ge.$$typeof===I)return ye(de,le,yc(de,ge),Te);Ec(de,ge)}return null}function xe(de,le,ge,Te,rt){if(typeof Te=="string"&&Te!==""||typeof Te=="number"||typeof Te=="bigint")return de=de.get(ge)||null,L(le,de,""+Te,rt);if(typeof Te=="object"&&Te!==null){switch(Te.$$typeof){case y:return de=de.get(Te.key===null?ge:Te.key)||null,ie(le,de,Te,rt);case S:return de=de.get(Te.key===null?ge:Te.key)||null,ve(le,de,Te,rt);case X:return Te=as(Te),xe(de,le,ge,Te,rt)}if(H(Te)||K(Te))return de=de.get(ge)||null,Se(le,de,Te,rt,null);if(typeof Te.then=="function")return xe(de,le,ge,Sc(Te),rt);if(Te.$$typeof===I)return xe(de,le,ge,yc(le,Te),rt);Ec(le,Te)}return null}function We(de,le,ge,Te){for(var rt=null,Wt=null,Xe=le,At=le=0,Pt=null;Xe!==null&&At<ge.length;At++){Xe.index>At?(Pt=Xe,Xe=null):Pt=Xe.sibling;var Zt=ye(de,Xe,ge[At],Te);if(Zt===null){Xe===null&&(Xe=Pt);break}r&&Xe&&Zt.alternate===null&&i(de,Xe),le=v(Zt,le,At),Wt===null?rt=Zt:Wt.sibling=Zt,Wt=Zt,Xe=Pt}if(At===ge.length)return l(de,Xe),Vt&&Oa(de,At),rt;if(Xe===null){for(;At<ge.length;At++)Xe=Ce(de,ge[At],Te),Xe!==null&&(le=v(Xe,le,At),Wt===null?rt=Xe:Wt.sibling=Xe,Wt=Xe);return Vt&&Oa(de,At),rt}for(Xe=f(Xe);At<ge.length;At++)Pt=xe(Xe,de,At,ge[At],Te),Pt!==null&&(r&&Pt.alternate!==null&&Xe.delete(Pt.key===null?At:Pt.key),le=v(Pt,le,At),Wt===null?rt=Pt:Wt.sibling=Pt,Wt=Pt);return r&&Xe.forEach(function(_i){return i(de,_i)}),Vt&&Oa(de,At),rt}function ct(de,le,ge,Te){if(ge==null)throw Error(a(151));for(var rt=null,Wt=null,Xe=le,At=le=0,Pt=null,Zt=ge.next();Xe!==null&&!Zt.done;At++,Zt=ge.next()){Xe.index>At?(Pt=Xe,Xe=null):Pt=Xe.sibling;var _i=ye(de,Xe,Zt.value,Te);if(_i===null){Xe===null&&(Xe=Pt);break}r&&Xe&&_i.alternate===null&&i(de,Xe),le=v(_i,le,At),Wt===null?rt=_i:Wt.sibling=_i,Wt=_i,Xe=Pt}if(Zt.done)return l(de,Xe),Vt&&Oa(de,At),rt;if(Xe===null){for(;!Zt.done;At++,Zt=ge.next())Zt=Ce(de,Zt.value,Te),Zt!==null&&(le=v(Zt,le,At),Wt===null?rt=Zt:Wt.sibling=Zt,Wt=Zt);return Vt&&Oa(de,At),rt}for(Xe=f(Xe);!Zt.done;At++,Zt=ge.next())Zt=xe(Xe,de,At,Zt.value,Te),Zt!==null&&(r&&Zt.alternate!==null&&Xe.delete(Zt.key===null?At:Zt.key),le=v(Zt,le,At),Wt===null?rt=Zt:Wt.sibling=Zt,Wt=Zt);return r&&Xe.forEach(function(u9){return i(de,u9)}),Vt&&Oa(de,At),rt}function on(de,le,ge,Te){if(typeof ge=="object"&&ge!==null&&ge.type===T&&ge.key===null&&(ge=ge.props.children),typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case y:e:{for(var rt=ge.key;le!==null;){if(le.key===rt){if(rt=ge.type,rt===T){if(le.tag===7){l(de,le.sibling),Te=g(le,ge.props.children),Te.return=de,de=Te;break e}}else if(le.elementType===rt||typeof rt=="object"&&rt!==null&&rt.$$typeof===X&&as(rt)===le.type){l(de,le.sibling),Te=g(le,ge.props),$o(Te,ge),Te.return=de,de=Te;break e}l(de,le);break}else i(de,le);le=le.sibling}ge.type===T?(Te=Ji(ge.props.children,de.mode,Te,ge.key),Te.return=de,de=Te):(Te=gc(ge.type,ge.key,ge.props,null,de.mode,Te),$o(Te,ge),Te.return=de,de=Te)}return R(de);case S:e:{for(rt=ge.key;le!==null;){if(le.key===rt)if(le.tag===4&&le.stateNode.containerInfo===ge.containerInfo&&le.stateNode.implementation===ge.implementation){l(de,le.sibling),Te=g(le,ge.children||[]),Te.return=de,de=Te;break e}else{l(de,le);break}else i(de,le);le=le.sibling}Te=t0(ge,de.mode,Te),Te.return=de,de=Te}return R(de);case X:return ge=as(ge),on(de,le,ge,Te)}if(H(ge))return We(de,le,ge,Te);if(K(ge)){if(rt=K(ge),typeof rt!="function")throw Error(a(150));return ge=rt.call(ge),ct(de,le,ge,Te)}if(typeof ge.then=="function")return on(de,le,Sc(ge),Te);if(ge.$$typeof===I)return on(de,le,yc(de,ge),Te);Ec(de,ge)}return typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint"?(ge=""+ge,le!==null&&le.tag===6?(l(de,le.sibling),Te=g(le,ge),Te.return=de,de=Te):(l(de,le),Te=e0(ge,de.mode,Te),Te.return=de,de=Te),R(de)):l(de,le)}return function(de,le,ge,Te){try{Fo=0;var rt=on(de,le,ge,Te);return Gs=null,rt}catch(Xe){if(Xe===Ps||Xe===wc)throw Xe;var Wt=_r(29,Xe,null,de.mode);return Wt.lanes=Te,Wt.return=de,Wt}}}var ss=wg(!0),kg=wg(!1),hi=!1;function m0(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function h0(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 pi(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function gi(r,i,l){var f=r.updateQueue;if(f===null)return null;if(f=f.shared,(Qt&2)!==0){var g=f.pending;return g===null?i.next=i:(i.next=g.next,g.next=i),f.pending=i,i=pc(r),ig(r,null,l),i}return hc(r,f,i,l),pc(r)}function Po(r,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194048)!==0)){var f=i.lanes;f&=r.pendingLanes,l|=f,i.lanes=l,it(r,l)}}function p0(r,i){var l=r.updateQueue,f=r.alternate;if(f!==null&&(f=f.updateQueue,l===f)){var g=null,v=null;if(l=l.firstBaseUpdate,l!==null){do{var R={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};v===null?g=v=R:v=v.next=R,l=l.next}while(l!==null);v===null?g=v=i:v=v.next=i}else g=v=i;l={baseState:f.baseState,firstBaseUpdate:g,lastBaseUpdate:v,shared:f.shared,callbacks:f.callbacks},r.updateQueue=l;return}r=l.lastBaseUpdate,r===null?l.firstBaseUpdate=i:r.next=i,l.lastBaseUpdate=i}var g0=!1;function Go(){if(g0){var r=$s;if(r!==null)throw r}}function Vo(r,i,l,f){g0=!1;var g=r.updateQueue;hi=!1;var v=g.firstBaseUpdate,R=g.lastBaseUpdate,L=g.shared.pending;if(L!==null){g.shared.pending=null;var ie=L,ve=ie.next;ie.next=null,R===null?v=ve:R.next=ve,R=ie;var Se=r.alternate;Se!==null&&(Se=Se.updateQueue,L=Se.lastBaseUpdate,L!==R&&(L===null?Se.firstBaseUpdate=ve:L.next=ve,Se.lastBaseUpdate=ie))}if(v!==null){var Ce=g.baseState;R=0,Se=ve=ie=null,L=v;do{var ye=L.lane&-536870913,xe=ye!==L.lane;if(xe?($t&ye)===ye:(f&ye)===ye){ye!==0&&ye===Fs&&(g0=!0),Se!==null&&(Se=Se.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var We=r,ct=L;ye=i;var on=l;switch(ct.tag){case 1:if(We=ct.payload,typeof We=="function"){Ce=We.call(on,Ce,ye);break e}Ce=We;break e;case 3:We.flags=We.flags&-65537|128;case 0:if(We=ct.payload,ye=typeof We=="function"?We.call(on,Ce,ye):We,ye==null)break e;Ce=b({},Ce,ye);break e;case 2:hi=!0}}ye=L.callback,ye!==null&&(r.flags|=64,xe&&(r.flags|=8192),xe=g.callbacks,xe===null?g.callbacks=[ye]:xe.push(ye))}else xe={lane:ye,tag:L.tag,payload:L.payload,callback:L.callback,next:null},Se===null?(ve=Se=xe,ie=Ce):Se=Se.next=xe,R|=ye;if(L=L.next,L===null){if(L=g.shared.pending,L===null)break;xe=L,L=xe.next,xe.next=null,g.lastBaseUpdate=xe,g.shared.pending=null}}while(!0);Se===null&&(ie=Ce),g.baseState=ie,g.firstBaseUpdate=ve,g.lastBaseUpdate=Se,v===null&&(g.shared.lanes=0),wi|=R,r.lanes=R,r.memoizedState=Ce}}function Sg(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function Eg(r,i){var l=r.callbacks;if(l!==null)for(r.callbacks=null,r=0;r<l.length;r++)Sg(l[r],i)}var Vs=G(null),Tc=G(0);function Tg(r,i){r=Pa,O(Tc,r),O(Vs,i),Pa=r|i.baseLanes}function b0(){O(Tc,Pa),O(Vs,Vs.current)}function v0(){Pa=Tc.current,W(Vs),W(Tc)}var Mr=G(null),Wr=null;function bi(r){var i=r.alternate;O(An,An.current&1),O(Mr,r),Wr===null&&(i===null||Vs.current!==null||i.memoizedState!==null)&&(Wr=r)}function y0(r){O(An,An.current),O(Mr,r),Wr===null&&(Wr=r)}function Cg(r){r.tag===22?(O(An,An.current),O(Mr,r),Wr===null&&(Wr=r)):vi()}function vi(){O(An,An.current),O(Mr,Mr.current)}function Or(r){W(Mr),Wr===r&&(Wr=null),W(An)}var An=G(0);function Cc(r){for(var i=r;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Cf(l)||Rf(l)))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 La=0,Ct=null,an=null,jn=null,Rc=!1,Ks=!1,os=!1,Nc=0,Ko=0,Ys=null,e8=0;function Tn(){throw Error(a(321))}function x0(r,i){if(i===null)return!1;for(var l=0;l<i.length&&l<r.length;l++)if(!Ir(r[l],i[l]))return!1;return!0}function w0(r,i,l,f,g,v){return La=v,Ct=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,_.H=r===null||r.memoizedState===null?c4:L0,os=!1,v=l(f,g),os=!1,Ks&&(v=Ng(i,l,f,g)),Rg(r),v}function Rg(r){_.H=Zo;var i=an!==null&&an.next!==null;if(La=0,jn=an=Ct=null,Rc=!1,Ko=0,Ys=null,i)throw Error(a(300));r===null||Ln||(r=r.dependencies,r!==null&&vc(r)&&(Ln=!0))}function Ng(r,i,l,f){Ct=r;var g=0;do{if(Ks&&(Ys=null),Ko=0,Ks=!1,25<=g)throw Error(a(301));if(g+=1,jn=an=null,r.updateQueue!=null){var v=r.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}_.H=u4,v=i(l,f)}while(Ks);return v}function t8(){var r=_.H,i=r.useState()[0];return i=typeof i.then=="function"?Yo(i):i,r=r.useState()[0],(an!==null?an.memoizedState:null)!==r&&(Ct.flags|=1024),i}function k0(){var r=Nc!==0;return Nc=0,r}function S0(r,i,l){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~l}function E0(r){if(Rc){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Rc=!1}La=0,jn=an=Ct=null,Ks=!1,Ko=Nc=0,Ys=null}function or(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jn===null?Ct.memoizedState=jn=r:jn=jn.next=r,jn}function In(){if(an===null){var r=Ct.alternate;r=r!==null?r.memoizedState:null}else r=an.next;var i=jn===null?Ct.memoizedState:jn.next;if(i!==null)jn=i,an=r;else{if(r===null)throw Ct.alternate===null?Error(a(467)):Error(a(310));an=r,r={memoizedState:an.memoizedState,baseState:an.baseState,baseQueue:an.baseQueue,queue:an.queue,next:null},jn===null?Ct.memoizedState=jn=r:jn=jn.next=r}return jn}function Ac(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Yo(r){var i=Ko;return Ko+=1,Ys===null&&(Ys=[]),r=vg(Ys,r,i),i=Ct,(jn===null?i.memoizedState:jn.next)===null&&(i=i.alternate,_.H=i===null||i.memoizedState===null?c4:L0),r}function Ic(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Yo(r);if(r.$$typeof===I)return Qn(r)}throw Error(a(438,String(r)))}function T0(r){var i=null,l=Ct.updateQueue;if(l!==null&&(i=l.memoCache),i==null){var f=Ct.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(i={data:f.data.map(function(g){return g.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),l===null&&(l=Ac(),Ct.updateQueue=l),l.memoCache=i,l=i.data[i.index],l===void 0)for(l=i.data[i.index]=Array(r),f=0;f<r;f++)l[f]=$;return i.index++,l}function za(r,i){return typeof i=="function"?i(r):i}function _c(r){var i=In();return C0(i,an,r)}function C0(r,i,l){var f=r.queue;if(f===null)throw Error(a(311));f.lastRenderedReducer=l;var g=r.baseQueue,v=f.pending;if(v!==null){if(g!==null){var R=g.next;g.next=v.next,v.next=R}i.baseQueue=g=v,f.pending=null}if(v=r.baseState,g===null)r.memoizedState=v;else{i=g.next;var L=R=null,ie=null,ve=i,Se=!1;do{var Ce=ve.lane&-536870913;if(Ce!==ve.lane?($t&Ce)===Ce:(La&Ce)===Ce){var ye=ve.revertLane;if(ye===0)ie!==null&&(ie=ie.next={lane:0,revertLane:0,gesture:null,action:ve.action,hasEagerState:ve.hasEagerState,eagerState:ve.eagerState,next:null}),Ce===Fs&&(Se=!0);else if((La&ye)===ye){ve=ve.next,ye===Fs&&(Se=!0);continue}else Ce={lane:0,revertLane:ve.revertLane,gesture:null,action:ve.action,hasEagerState:ve.hasEagerState,eagerState:ve.eagerState,next:null},ie===null?(L=ie=Ce,R=v):ie=ie.next=Ce,Ct.lanes|=ye,wi|=ye;Ce=ve.action,os&&l(v,Ce),v=ve.hasEagerState?ve.eagerState:l(v,Ce)}else ye={lane:Ce,revertLane:ve.revertLane,gesture:ve.gesture,action:ve.action,hasEagerState:ve.hasEagerState,eagerState:ve.eagerState,next:null},ie===null?(L=ie=ye,R=v):ie=ie.next=ye,Ct.lanes|=Ce,wi|=Ce;ve=ve.next}while(ve!==null&&ve!==i);if(ie===null?R=v:ie.next=L,!Ir(v,r.memoizedState)&&(Ln=!0,Se&&(l=$s,l!==null)))throw l;r.memoizedState=v,r.baseState=R,r.baseQueue=ie,f.lastRenderedState=v}return g===null&&(f.lanes=0),[r.memoizedState,f.dispatch]}function R0(r){var i=In(),l=i.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=r;var f=l.dispatch,g=l.pending,v=i.memoizedState;if(g!==null){l.pending=null;var R=g=g.next;do v=r(v,R.action),R=R.next;while(R!==g);Ir(v,i.memoizedState)||(Ln=!0),i.memoizedState=v,i.baseQueue===null&&(i.baseState=v),l.lastRenderedState=v}return[v,f]}function Ag(r,i,l){var f=Ct,g=In(),v=Vt;if(v){if(l===void 0)throw Error(a(407));l=l()}else l=i();var R=!Ir((an||g).memoizedState,l);if(R&&(g.memoizedState=l,Ln=!0),g=g.queue,I0(Mg.bind(null,f,g,r),[r]),g.getSnapshot!==i||R||jn!==null&&jn.memoizedState.tag&1){if(f.flags|=2048,Ws(9,{destroy:void 0},_g.bind(null,f,g,l,i),null),ln===null)throw Error(a(349));v||(La&127)!==0||Ig(f,i,l)}return l}function Ig(r,i,l){r.flags|=16384,r={getSnapshot:i,value:l},i=Ct.updateQueue,i===null?(i=Ac(),Ct.updateQueue=i,i.stores=[r]):(l=i.stores,l===null?i.stores=[r]:l.push(r))}function _g(r,i,l,f){i.value=l,i.getSnapshot=f,Og(i)&&Dg(r)}function Mg(r,i,l){return l(function(){Og(i)&&Dg(r)})}function Og(r){var i=r.getSnapshot;r=r.value;try{var l=i();return!Ir(r,l)}catch{return!0}}function Dg(r){var i=Qi(r,2);i!==null&&kr(i,r,2)}function N0(r){var i=or();if(typeof r=="function"){var l=r;if(r=l(),os){_t(!0);try{l()}finally{_t(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:za,lastRenderedState:r},i}function jg(r,i,l,f){return r.baseState=l,C0(r,an,typeof f=="function"?f:za)}function n8(r,i,l,f,g){if(Dc(r))throw Error(a(485));if(r=i.action,r!==null){var v={payload:g,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(R){v.listeners.push(R)}};_.T!==null?l(!0):v.isTransition=!1,f(v),l=i.pending,l===null?(v.next=i.pending=v,Lg(i,v)):(v.next=l.next,i.pending=l.next=v)}}function Lg(r,i){var l=i.action,f=i.payload,g=r.state;if(i.isTransition){var v=_.T,R={};_.T=R;try{var L=l(g,f),ie=_.S;ie!==null&&ie(R,L),zg(r,i,L)}catch(ve){A0(r,i,ve)}finally{v!==null&&R.types!==null&&(v.types=R.types),_.T=v}}else try{v=l(g,f),zg(r,i,v)}catch(ve){A0(r,i,ve)}}function zg(r,i,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(f){Bg(r,i,f)},function(f){return A0(r,i,f)}):Bg(r,i,l)}function Bg(r,i,l){i.status="fulfilled",i.value=l,qg(i),r.state=l,i=r.pending,i!==null&&(l=i.next,l===i?r.pending=null:(l=l.next,i.next=l,Lg(r,l)))}function A0(r,i,l){var f=r.pending;if(r.pending=null,f!==null){f=f.next;do i.status="rejected",i.reason=l,qg(i),i=i.next;while(i!==f)}r.action=null}function qg(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function Hg(r,i){return i}function Ug(r,i){if(Vt){var l=ln.formState;if(l!==null){e:{var f=Ct;if(Vt){if(mn){t:{for(var g=mn,v=Yr;g.nodeType!==8;){if(!v){g=null;break t}if(g=Zr(g.nextSibling),g===null){g=null;break t}}v=g.data,g=v==="F!"||v==="F"?g:null}if(g){mn=Zr(g.nextSibling),f=g.data==="F!";break e}}fi(f)}f=!1}f&&(i=l[0])}}return l=or(),l.memoizedState=l.baseState=i,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hg,lastRenderedState:i},l.queue=f,l=s4.bind(null,Ct,f),f.dispatch=l,f=N0(!1),v=j0.bind(null,Ct,!1,f.queue),f=or(),g={state:i,dispatch:null,action:r,pending:null},f.queue=g,l=n8.bind(null,Ct,g,v,l),g.dispatch=l,f.memoizedState=r,[i,l,!1]}function Fg(r){var i=In();return $g(i,an,r)}function $g(r,i,l){if(i=C0(r,i,Hg)[0],r=_c(za)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var f=Yo(i)}catch(R){throw R===Ps?wc:R}else f=i;i=In();var g=i.queue,v=g.dispatch;return l!==i.memoizedState&&(Ct.flags|=2048,Ws(9,{destroy:void 0},r8.bind(null,g,l),null)),[f,v,r]}function r8(r,i){r.action=i}function Pg(r){var i=In(),l=an;if(l!==null)return $g(i,l,r);In(),i=i.memoizedState,l=In();var f=l.queue.dispatch;return l.memoizedState=r,[i,f,!1]}function Ws(r,i,l,f){return r={tag:r,create:l,deps:f,inst:i,next:null},i=Ct.updateQueue,i===null&&(i=Ac(),Ct.updateQueue=i),l=i.lastEffect,l===null?i.lastEffect=r.next=r:(f=l.next,l.next=r,r.next=f,i.lastEffect=r),r}function Gg(){return In().memoizedState}function Mc(r,i,l,f){var g=or();Ct.flags|=r,g.memoizedState=Ws(1|i,{destroy:void 0},l,f===void 0?null:f)}function Oc(r,i,l,f){var g=In();f=f===void 0?null:f;var v=g.memoizedState.inst;an!==null&&f!==null&&x0(f,an.memoizedState.deps)?g.memoizedState=Ws(i,v,l,f):(Ct.flags|=r,g.memoizedState=Ws(1|i,v,l,f))}function Vg(r,i){Mc(8390656,8,r,i)}function I0(r,i){Oc(2048,8,r,i)}function a8(r){Ct.flags|=4;var i=Ct.updateQueue;if(i===null)i=Ac(),Ct.updateQueue=i,i.events=[r];else{var l=i.events;l===null?i.events=[r]:l.push(r)}}function Kg(r){var i=In().memoizedState;return a8({ref:i,nextImpl:r}),function(){if((Qt&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function Yg(r,i){return Oc(4,2,r,i)}function Wg(r,i){return Oc(4,4,r,i)}function Zg(r,i){if(typeof i=="function"){r=r();var l=i(r);return function(){typeof l=="function"?l():i(null)}}if(i!=null)return r=r(),i.current=r,function(){i.current=null}}function Xg(r,i,l){l=l!=null?l.concat([r]):null,Oc(4,4,Zg.bind(null,i,r),l)}function _0(){}function Qg(r,i){var l=In();i=i===void 0?null:i;var f=l.memoizedState;return i!==null&&x0(i,f[1])?f[0]:(l.memoizedState=[r,i],r)}function Jg(r,i){var l=In();i=i===void 0?null:i;var f=l.memoizedState;if(i!==null&&x0(i,f[1]))return f[0];if(f=r(),os){_t(!0);try{r()}finally{_t(!1)}}return l.memoizedState=[f,i],f}function M0(r,i,l){return l===void 0||(La&1073741824)!==0&&($t&261930)===0?r.memoizedState=i:(r.memoizedState=l,r=e2(),Ct.lanes|=r,wi|=r,l)}function e4(r,i,l,f){return Ir(l,i)?l:Vs.current!==null?(r=M0(r,l,f),Ir(r,i)||(Ln=!0),r):(La&42)===0||(La&1073741824)!==0&&($t&261930)===0?(Ln=!0,r.memoizedState=l):(r=e2(),Ct.lanes|=r,wi|=r,i)}function t4(r,i,l,f,g){var v=Y.p;Y.p=v!==0&&8>v?v:8;var R=_.T,L={};_.T=L,j0(r,!1,i,l);try{var ie=g(),ve=_.S;if(ve!==null&&ve(L,ie),ie!==null&&typeof ie=="object"&&typeof ie.then=="function"){var Se=Jx(ie,f);Wo(r,i,Se,Lr(r))}else Wo(r,i,f,Lr(r))}catch(Ce){Wo(r,i,{then:function(){},status:"rejected",reason:Ce},Lr())}finally{Y.p=v,R!==null&&L.types!==null&&(R.types=L.types),_.T=R}}function i8(){}function O0(r,i,l,f){if(r.tag!==5)throw Error(a(476));var g=n4(r).queue;t4(r,g,i,re,l===null?i8:function(){return r4(r),l(f)})}function n4(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:za,lastRenderedState:re},next:null};var l={};return i.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:za,lastRenderedState:l},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function r4(r){var i=n4(r);i.next===null&&(i=r.alternate.memoizedState),Wo(r,i.next.queue,{},Lr())}function D0(){return Qn(fl)}function a4(){return In().memoizedState}function i4(){return In().memoizedState}function s8(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var l=Lr();r=pi(l);var f=gi(i,r,l);f!==null&&(kr(f,i,l),Po(f,i,l)),i={cache:c0()},r.payload=i;return}i=i.return}}function o8(r,i,l){var f=Lr();l={lane:f,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Dc(r)?o4(i,l):(l=Qd(r,i,l,f),l!==null&&(kr(l,r,f),l4(l,i,f)))}function s4(r,i,l){var f=Lr();Wo(r,i,l,f)}function Wo(r,i,l,f){var g={lane:f,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Dc(r))o4(i,g);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=i.lastRenderedReducer,v!==null))try{var R=i.lastRenderedState,L=v(R,l);if(g.hasEagerState=!0,g.eagerState=L,Ir(L,R))return hc(r,i,g,0),ln===null&&mc(),!1}catch{}if(l=Qd(r,i,g,f),l!==null)return kr(l,r,f),l4(l,i,f),!0}return!1}function j0(r,i,l,f){if(f={lane:2,revertLane:hf(),gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},Dc(r)){if(i)throw Error(a(479))}else i=Qd(r,l,f,2),i!==null&&kr(i,r,2)}function Dc(r){var i=r.alternate;return r===Ct||i!==null&&i===Ct}function o4(r,i){Ks=Rc=!0;var l=r.pending;l===null?i.next=i:(i.next=l.next,l.next=i),r.pending=i}function l4(r,i,l){if((l&4194048)!==0){var f=i.lanes;f&=r.pendingLanes,l|=f,i.lanes=l,it(r,l)}}var Zo={readContext:Qn,use:Ic,useCallback:Tn,useContext:Tn,useEffect:Tn,useImperativeHandle:Tn,useLayoutEffect:Tn,useInsertionEffect:Tn,useMemo:Tn,useReducer:Tn,useRef:Tn,useState:Tn,useDebugValue:Tn,useDeferredValue:Tn,useTransition:Tn,useSyncExternalStore:Tn,useId:Tn,useHostTransitionStatus:Tn,useFormState:Tn,useActionState:Tn,useOptimistic:Tn,useMemoCache:Tn,useCacheRefresh:Tn};Zo.useEffectEvent=Tn;var c4={readContext:Qn,use:Ic,useCallback:function(r,i){return or().memoizedState=[r,i===void 0?null:i],r},useContext:Qn,useEffect:Vg,useImperativeHandle:function(r,i,l){l=l!=null?l.concat([r]):null,Mc(4194308,4,Zg.bind(null,i,r),l)},useLayoutEffect:function(r,i){return Mc(4194308,4,r,i)},useInsertionEffect:function(r,i){Mc(4,2,r,i)},useMemo:function(r,i){var l=or();i=i===void 0?null:i;var f=r();if(os){_t(!0);try{r()}finally{_t(!1)}}return l.memoizedState=[f,i],f},useReducer:function(r,i,l){var f=or();if(l!==void 0){var g=l(i);if(os){_t(!0);try{l(i)}finally{_t(!1)}}}else g=i;return f.memoizedState=f.baseState=g,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:g},f.queue=r,r=r.dispatch=o8.bind(null,Ct,r),[f.memoizedState,r]},useRef:function(r){var i=or();return r={current:r},i.memoizedState=r},useState:function(r){r=N0(r);var i=r.queue,l=s4.bind(null,Ct,i);return i.dispatch=l,[r.memoizedState,l]},useDebugValue:_0,useDeferredValue:function(r,i){var l=or();return M0(l,r,i)},useTransition:function(){var r=N0(!1);return r=t4.bind(null,Ct,r.queue,!0,!1),or().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,l){var f=Ct,g=or();if(Vt){if(l===void 0)throw Error(a(407));l=l()}else{if(l=i(),ln===null)throw Error(a(349));($t&127)!==0||Ig(f,i,l)}g.memoizedState=l;var v={value:l,getSnapshot:i};return g.queue=v,Vg(Mg.bind(null,f,v,r),[r]),f.flags|=2048,Ws(9,{destroy:void 0},_g.bind(null,f,v,l,i),null),l},useId:function(){var r=or(),i=ln.identifierPrefix;if(Vt){var l=pa,f=ha;l=(f&~(1<<32-Tt(f)-1)).toString(32)+l,i="_"+i+"R_"+l,l=Nc++,0<l&&(i+="H"+l.toString(32)),i+="_"}else l=e8++,i="_"+i+"r_"+l.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:D0,useFormState:Ug,useActionState:Ug,useOptimistic:function(r){var i=or();i.memoizedState=i.baseState=r;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=l,i=j0.bind(null,Ct,!0,l),l.dispatch=i,[r,i]},useMemoCache:T0,useCacheRefresh:function(){return or().memoizedState=s8.bind(null,Ct)},useEffectEvent:function(r){var i=or(),l={impl:r};return i.memoizedState=l,function(){if((Qt&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},L0={readContext:Qn,use:Ic,useCallback:Qg,useContext:Qn,useEffect:I0,useImperativeHandle:Xg,useInsertionEffect:Yg,useLayoutEffect:Wg,useMemo:Jg,useReducer:_c,useRef:Gg,useState:function(){return _c(za)},useDebugValue:_0,useDeferredValue:function(r,i){var l=In();return e4(l,an.memoizedState,r,i)},useTransition:function(){var r=_c(za)[0],i=In().memoizedState;return[typeof r=="boolean"?r:Yo(r),i]},useSyncExternalStore:Ag,useId:a4,useHostTransitionStatus:D0,useFormState:Fg,useActionState:Fg,useOptimistic:function(r,i){var l=In();return jg(l,an,r,i)},useMemoCache:T0,useCacheRefresh:i4};L0.useEffectEvent=Kg;var u4={readContext:Qn,use:Ic,useCallback:Qg,useContext:Qn,useEffect:I0,useImperativeHandle:Xg,useInsertionEffect:Yg,useLayoutEffect:Wg,useMemo:Jg,useReducer:R0,useRef:Gg,useState:function(){return R0(za)},useDebugValue:_0,useDeferredValue:function(r,i){var l=In();return an===null?M0(l,r,i):e4(l,an.memoizedState,r,i)},useTransition:function(){var r=R0(za)[0],i=In().memoizedState;return[typeof r=="boolean"?r:Yo(r),i]},useSyncExternalStore:Ag,useId:a4,useHostTransitionStatus:D0,useFormState:Pg,useActionState:Pg,useOptimistic:function(r,i){var l=In();return an!==null?jg(l,an,r,i):(l.baseState=r,[r,l.queue.dispatch])},useMemoCache:T0,useCacheRefresh:i4};u4.useEffectEvent=Kg;function z0(r,i,l,f){i=r.memoizedState,l=l(f,i),l=l==null?i:b({},i,l),r.memoizedState=l,r.lanes===0&&(r.updateQueue.baseState=l)}var B0={enqueueSetState:function(r,i,l){r=r._reactInternals;var f=Lr(),g=pi(f);g.payload=i,l!=null&&(g.callback=l),i=gi(r,g,f),i!==null&&(kr(i,r,f),Po(i,r,f))},enqueueReplaceState:function(r,i,l){r=r._reactInternals;var f=Lr(),g=pi(f);g.tag=1,g.payload=i,l!=null&&(g.callback=l),i=gi(r,g,f),i!==null&&(kr(i,r,f),Po(i,r,f))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var l=Lr(),f=pi(l);f.tag=2,i!=null&&(f.callback=i),i=gi(r,f,l),i!==null&&(kr(i,r,l),Po(i,r,l))}};function d4(r,i,l,f,g,v,R){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(f,v,R):i.prototype&&i.prototype.isPureReactComponent?!Lo(l,f)||!Lo(g,v):!0}function f4(r,i,l,f){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,f),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,f),i.state!==r&&B0.enqueueReplaceState(i,i.state,null)}function ls(r,i){var l=i;if("ref"in i){l={};for(var f in i)f!=="ref"&&(l[f]=i[f])}if(r=r.defaultProps){l===i&&(l=b({},l));for(var g in r)l[g]===void 0&&(l[g]=r[g])}return l}function m4(r){fc(r)}function h4(r){console.error(r)}function p4(r){fc(r)}function jc(r,i){try{var l=r.onUncaughtError;l(i.value,{componentStack:i.stack})}catch(f){setTimeout(function(){throw f})}}function g4(r,i,l){try{var f=r.onCaughtError;f(l.value,{componentStack:l.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function q0(r,i,l){return l=pi(l),l.tag=3,l.payload={element:null},l.callback=function(){jc(r,i)},l}function b4(r){return r=pi(r),r.tag=3,r}function v4(r,i,l,f){var g=l.type.getDerivedStateFromError;if(typeof g=="function"){var v=f.value;r.payload=function(){return g(v)},r.callback=function(){g4(i,l,f)}}var R=l.stateNode;R!==null&&typeof R.componentDidCatch=="function"&&(r.callback=function(){g4(i,l,f),typeof g!="function"&&(ki===null?ki=new Set([this]):ki.add(this));var L=f.stack;this.componentDidCatch(f.value,{componentStack:L!==null?L:""})})}function l8(r,i,l,f,g){if(l.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(i=l.alternate,i!==null&&Us(i,l,g,!0),l=Mr.current,l!==null){switch(l.tag){case 31:case 13:return Wr===null?Kc():l.alternate===null&&Cn===0&&(Cn=3),l.flags&=-257,l.flags|=65536,l.lanes=g,f===kc?l.flags|=16384:(i=l.updateQueue,i===null?l.updateQueue=new Set([f]):i.add(f),df(r,f,g)),!1;case 22:return l.flags|=65536,f===kc?l.flags|=16384:(i=l.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([f])},l.updateQueue=i):(l=i.retryQueue,l===null?i.retryQueue=new Set([f]):l.add(f)),df(r,f,g)),!1}throw Error(a(435,l.tag))}return df(r,f,g),Kc(),!1}if(Vt)return i=Mr.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=g,f!==a0&&(r=Error(a(422),{cause:f}),qo(Gr(r,l)))):(f!==a0&&(i=Error(a(423),{cause:f}),qo(Gr(i,l))),r=r.current.alternate,r.flags|=65536,g&=-g,r.lanes|=g,f=Gr(f,l),g=q0(r.stateNode,f,g),p0(r,g),Cn!==4&&(Cn=2)),!1;var v=Error(a(520),{cause:f});if(v=Gr(v,l),al===null?al=[v]:al.push(v),Cn!==4&&(Cn=2),i===null)return!0;f=Gr(f,l),l=i;do{switch(l.tag){case 3:return l.flags|=65536,r=g&-g,l.lanes|=r,r=q0(l.stateNode,f,r),p0(l,r),!1;case 1:if(i=l.type,v=l.stateNode,(l.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(ki===null||!ki.has(v))))return l.flags|=65536,g&=-g,l.lanes|=g,g=b4(g),v4(g,r,l,f),p0(l,g),!1}l=l.return}while(l!==null);return!1}var H0=Error(a(461)),Ln=!1;function Jn(r,i,l,f){i.child=r===null?kg(i,null,l,f):ss(i,r.child,l,f)}function y4(r,i,l,f,g){l=l.render;var v=i.ref;if("ref"in f){var R={};for(var L in f)L!=="ref"&&(R[L]=f[L])}else R=f;return ns(i),f=w0(r,i,l,R,v,g),L=k0(),r!==null&&!Ln?(S0(r,i,g),Ba(r,i,g)):(Vt&&L&&n0(i),i.flags|=1,Jn(r,i,f,g),i.child)}function x4(r,i,l,f,g){if(r===null){var v=l.type;return typeof v=="function"&&!Jd(v)&&v.defaultProps===void 0&&l.compare===null?(i.tag=15,i.type=v,w4(r,i,v,f,g)):(r=gc(l.type,null,f,i,i.mode,g),r.ref=i.ref,r.return=i,i.child=r)}if(v=r.child,!Y0(r,g)){var R=v.memoizedProps;if(l=l.compare,l=l!==null?l:Lo,l(R,f)&&r.ref===i.ref)return Ba(r,i,g)}return i.flags|=1,r=Ma(v,f),r.ref=i.ref,r.return=i,i.child=r}function w4(r,i,l,f,g){if(r!==null){var v=r.memoizedProps;if(Lo(v,f)&&r.ref===i.ref)if(Ln=!1,i.pendingProps=f=v,Y0(r,g))(r.flags&131072)!==0&&(Ln=!0);else return i.lanes=r.lanes,Ba(r,i,g)}return U0(r,i,l,f,g)}function k4(r,i,l,f){var g=f.children,v=r!==null?r.memoizedState:null;if(r===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.mode==="hidden"){if((i.flags&128)!==0){if(v=v!==null?v.baseLanes|l:l,r!==null){for(f=i.child=r.child,g=0;f!==null;)g=g|f.lanes|f.childLanes,f=f.sibling;f=g&~v}else f=0,i.child=null;return S4(r,i,v,l,f)}if((l&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&xc(i,v!==null?v.cachePool:null),v!==null?Tg(i,v):b0(),Cg(i);else return f=i.lanes=536870912,S4(r,i,v!==null?v.baseLanes|l:l,l,f)}else v!==null?(xc(i,v.cachePool),Tg(i,v),vi(),i.memoizedState=null):(r!==null&&xc(i,null),b0(),vi());return Jn(r,i,g,l),i.child}function Xo(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function S4(r,i,l,f,g){var v=d0();return v=v===null?null:{parent:Dn._currentValue,pool:v},i.memoizedState={baseLanes:l,cachePool:v},r!==null&&xc(i,null),b0(),Cg(i),r!==null&&Us(r,i,f,!0),i.childLanes=g,null}function Lc(r,i){return i=Bc({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function E4(r,i,l){return ss(i,r.child,null,l),r=Lc(i,i.pendingProps),r.flags|=2,Or(i),i.memoizedState=null,r}function c8(r,i,l){var f=i.pendingProps,g=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(Vt){if(f.mode==="hidden")return r=Lc(i,f),i.lanes=536870912,Xo(null,r);if(y0(i),(r=mn)?(r=L2(r,Yr),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:ui!==null?{id:ha,overflow:pa}:null,retryLane:536870912,hydrationErrors:null},l=og(r),l.return=i,i.child=l,Xn=i,mn=null)):r=null,r===null)throw fi(i);return i.lanes=536870912,null}return Lc(i,f)}var v=r.memoizedState;if(v!==null){var R=v.dehydrated;if(y0(i),g)if(i.flags&256)i.flags&=-257,i=E4(r,i,l);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(a(558));else if(Ln||Us(r,i,l,!1),g=(l&r.childLanes)!==0,Ln||g){if(f=ln,f!==null&&(R=Xt(f,l),R!==0&&R!==v.retryLane))throw v.retryLane=R,Qi(r,R),kr(f,r,R),H0;Kc(),i=E4(r,i,l)}else r=v.treeContext,mn=Zr(R.nextSibling),Xn=i,Vt=!0,di=null,Yr=!1,r!==null&&ug(i,r),i=Lc(i,f),i.flags|=4096;return i}return r=Ma(r.child,{mode:f.mode,children:f.children}),r.ref=i.ref,i.child=r,r.return=i,r}function zc(r,i){var l=i.ref;if(l===null)r!==null&&r.ref!==null&&(i.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(a(284));(r===null||r.ref!==l)&&(i.flags|=4194816)}}function U0(r,i,l,f,g){return ns(i),l=w0(r,i,l,f,void 0,g),f=k0(),r!==null&&!Ln?(S0(r,i,g),Ba(r,i,g)):(Vt&&f&&n0(i),i.flags|=1,Jn(r,i,l,g),i.child)}function T4(r,i,l,f,g,v){return ns(i),i.updateQueue=null,l=Ng(i,f,l,g),Rg(r),f=k0(),r!==null&&!Ln?(S0(r,i,v),Ba(r,i,v)):(Vt&&f&&n0(i),i.flags|=1,Jn(r,i,l,v),i.child)}function C4(r,i,l,f,g){if(ns(i),i.stateNode===null){var v=zs,R=l.contextType;typeof R=="object"&&R!==null&&(v=Qn(R)),v=new l(f,v),i.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=B0,i.stateNode=v,v._reactInternals=i,v=i.stateNode,v.props=f,v.state=i.memoizedState,v.refs={},m0(i),R=l.contextType,v.context=typeof R=="object"&&R!==null?Qn(R):zs,v.state=i.memoizedState,R=l.getDerivedStateFromProps,typeof R=="function"&&(z0(i,l,R,f),v.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(R=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),R!==v.state&&B0.enqueueReplaceState(v,v.state,null),Vo(i,f,v,g),Go(),v.state=i.memoizedState),typeof v.componentDidMount=="function"&&(i.flags|=4194308),f=!0}else if(r===null){v=i.stateNode;var L=i.memoizedProps,ie=ls(l,L);v.props=ie;var ve=v.context,Se=l.contextType;R=zs,typeof Se=="object"&&Se!==null&&(R=Qn(Se));var Ce=l.getDerivedStateFromProps;Se=typeof Ce=="function"||typeof v.getSnapshotBeforeUpdate=="function",L=i.pendingProps!==L,Se||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(L||ve!==R)&&f4(i,v,f,R),hi=!1;var ye=i.memoizedState;v.state=ye,Vo(i,f,v,g),Go(),ve=i.memoizedState,L||ye!==ve||hi?(typeof Ce=="function"&&(z0(i,l,Ce,f),ve=i.memoizedState),(ie=hi||d4(i,l,ie,f,ye,ve,R))?(Se||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(i.flags|=4194308)):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=f,i.memoizedState=ve),v.props=f,v.state=ve,v.context=R,f=ie):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),f=!1)}else{v=i.stateNode,h0(r,i),R=i.memoizedProps,Se=ls(l,R),v.props=Se,Ce=i.pendingProps,ye=v.context,ve=l.contextType,ie=zs,typeof ve=="object"&&ve!==null&&(ie=Qn(ve)),L=l.getDerivedStateFromProps,(ve=typeof L=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(R!==Ce||ye!==ie)&&f4(i,v,f,ie),hi=!1,ye=i.memoizedState,v.state=ye,Vo(i,f,v,g),Go();var xe=i.memoizedState;R!==Ce||ye!==xe||hi||r!==null&&r.dependencies!==null&&vc(r.dependencies)?(typeof L=="function"&&(z0(i,l,L,f),xe=i.memoizedState),(Se=hi||d4(i,l,Se,f,ye,xe,ie)||r!==null&&r.dependencies!==null&&vc(r.dependencies))?(ve||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(f,xe,ie),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(f,xe,ie)),typeof v.componentDidUpdate=="function"&&(i.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof v.componentDidUpdate!="function"||R===r.memoizedProps&&ye===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||R===r.memoizedProps&&ye===r.memoizedState||(i.flags|=1024),i.memoizedProps=f,i.memoizedState=xe),v.props=f,v.state=xe,v.context=ie,f=Se):(typeof v.componentDidUpdate!="function"||R===r.memoizedProps&&ye===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||R===r.memoizedProps&&ye===r.memoizedState||(i.flags|=1024),f=!1)}return v=f,zc(r,i),f=(i.flags&128)!==0,v||f?(v=i.stateNode,l=f&&typeof l.getDerivedStateFromError!="function"?null:v.render(),i.flags|=1,r!==null&&f?(i.child=ss(i,r.child,null,g),i.child=ss(i,null,l,g)):Jn(r,i,l,g),i.memoizedState=v.state,r=i.child):r=Ba(r,i,g),r}function R4(r,i,l,f){return es(),i.flags|=256,Jn(r,i,l,f),i.child}var F0={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function $0(r){return{baseLanes:r,cachePool:gg()}}function P0(r,i,l){return r=r!==null?r.childLanes&~l:0,i&&(r|=jr),r}function N4(r,i,l){var f=i.pendingProps,g=!1,v=(i.flags&128)!==0,R;if((R=v)||(R=r!==null&&r.memoizedState===null?!1:(An.current&2)!==0),R&&(g=!0,i.flags&=-129),R=(i.flags&32)!==0,i.flags&=-33,r===null){if(Vt){if(g?bi(i):vi(),(r=mn)?(r=L2(r,Yr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:ui!==null?{id:ha,overflow:pa}:null,retryLane:536870912,hydrationErrors:null},l=og(r),l.return=i,i.child=l,Xn=i,mn=null)):r=null,r===null)throw fi(i);return Rf(r)?i.lanes=32:i.lanes=536870912,null}var L=f.children;return f=f.fallback,g?(vi(),g=i.mode,L=Bc({mode:"hidden",children:L},g),f=Ji(f,g,l,null),L.return=i,f.return=i,L.sibling=f,i.child=L,f=i.child,f.memoizedState=$0(l),f.childLanes=P0(r,R,l),i.memoizedState=F0,Xo(null,f)):(bi(i),G0(i,L))}var ie=r.memoizedState;if(ie!==null&&(L=ie.dehydrated,L!==null)){if(v)i.flags&256?(bi(i),i.flags&=-257,i=V0(r,i,l)):i.memoizedState!==null?(vi(),i.child=r.child,i.flags|=128,i=null):(vi(),L=f.fallback,g=i.mode,f=Bc({mode:"visible",children:f.children},g),L=Ji(L,g,l,null),L.flags|=2,f.return=i,L.return=i,f.sibling=L,i.child=f,ss(i,r.child,null,l),f=i.child,f.memoizedState=$0(l),f.childLanes=P0(r,R,l),i.memoizedState=F0,i=Xo(null,f));else if(bi(i),Rf(L)){if(R=L.nextSibling&&L.nextSibling.dataset,R)var ve=R.dgst;R=ve,f=Error(a(419)),f.stack="",f.digest=R,qo({value:f,source:null,stack:null}),i=V0(r,i,l)}else if(Ln||Us(r,i,l,!1),R=(l&r.childLanes)!==0,Ln||R){if(R=ln,R!==null&&(f=Xt(R,l),f!==0&&f!==ie.retryLane))throw ie.retryLane=f,Qi(r,f),kr(R,r,f),H0;Cf(L)||Kc(),i=V0(r,i,l)}else Cf(L)?(i.flags|=192,i.child=r.child,i=null):(r=ie.treeContext,mn=Zr(L.nextSibling),Xn=i,Vt=!0,di=null,Yr=!1,r!==null&&ug(i,r),i=G0(i,f.children),i.flags|=4096);return i}return g?(vi(),L=f.fallback,g=i.mode,ie=r.child,ve=ie.sibling,f=Ma(ie,{mode:"hidden",children:f.children}),f.subtreeFlags=ie.subtreeFlags&65011712,ve!==null?L=Ma(ve,L):(L=Ji(L,g,l,null),L.flags|=2),L.return=i,f.return=i,f.sibling=L,i.child=f,Xo(null,f),f=i.child,L=r.child.memoizedState,L===null?L=$0(l):(g=L.cachePool,g!==null?(ie=Dn._currentValue,g=g.parent!==ie?{parent:ie,pool:ie}:g):g=gg(),L={baseLanes:L.baseLanes|l,cachePool:g}),f.memoizedState=L,f.childLanes=P0(r,R,l),i.memoizedState=F0,Xo(r.child,f)):(bi(i),l=r.child,r=l.sibling,l=Ma(l,{mode:"visible",children:f.children}),l.return=i,l.sibling=null,r!==null&&(R=i.deletions,R===null?(i.deletions=[r],i.flags|=16):R.push(r)),i.child=l,i.memoizedState=null,l)}function G0(r,i){return i=Bc({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function Bc(r,i){return r=_r(22,r,null,i),r.lanes=0,r}function V0(r,i,l){return ss(i,r.child,null,l),r=G0(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function A4(r,i,l){r.lanes|=i;var f=r.alternate;f!==null&&(f.lanes|=i),o0(r.return,i,l)}function K0(r,i,l,f,g,v){var R=r.memoizedState;R===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:f,tail:l,tailMode:g,treeForkCount:v}:(R.isBackwards=i,R.rendering=null,R.renderingStartTime=0,R.last=f,R.tail=l,R.tailMode=g,R.treeForkCount=v)}function I4(r,i,l){var f=i.pendingProps,g=f.revealOrder,v=f.tail;f=f.children;var R=An.current,L=(R&2)!==0;if(L?(R=R&1|2,i.flags|=128):R&=1,O(An,R),Jn(r,i,f,l),f=Vt?Bo:0,!L&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&A4(r,l,i);else if(r.tag===19)A4(r,l,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(g){case"forwards":for(l=i.child,g=null;l!==null;)r=l.alternate,r!==null&&Cc(r)===null&&(g=l),l=l.sibling;l=g,l===null?(g=i.child,i.child=null):(g=l.sibling,l.sibling=null),K0(i,!1,g,l,v,f);break;case"backwards":case"unstable_legacy-backwards":for(l=null,g=i.child,i.child=null;g!==null;){if(r=g.alternate,r!==null&&Cc(r)===null){i.child=g;break}r=g.sibling,g.sibling=l,l=g,g=r}K0(i,!0,l,null,v,f);break;case"together":K0(i,!1,null,null,void 0,f);break;default:i.memoizedState=null}return i.child}function Ba(r,i,l){if(r!==null&&(i.dependencies=r.dependencies),wi|=i.lanes,(l&i.childLanes)===0)if(r!==null){if(Us(r,i,l,!1),(l&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,l=Ma(r,r.pendingProps),i.child=l,l.return=i;r.sibling!==null;)r=r.sibling,l=l.sibling=Ma(r,r.pendingProps),l.return=i;l.sibling=null}return i.child}function Y0(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&vc(r)))}function u8(r,i,l){switch(i.tag){case 3:ne(i,i.stateNode.containerInfo),mi(i,Dn,r.memoizedState.cache),es();break;case 27:case 5:he(i);break;case 4:ne(i,i.stateNode.containerInfo);break;case 10:mi(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,y0(i),null;break;case 13:var f=i.memoizedState;if(f!==null)return f.dehydrated!==null?(bi(i),i.flags|=128,null):(l&i.child.childLanes)!==0?N4(r,i,l):(bi(i),r=Ba(r,i,l),r!==null?r.sibling:null);bi(i);break;case 19:var g=(r.flags&128)!==0;if(f=(l&i.childLanes)!==0,f||(Us(r,i,l,!1),f=(l&i.childLanes)!==0),g){if(f)return I4(r,i,l);i.flags|=128}if(g=i.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),O(An,An.current),f)break;return null;case 22:return i.lanes=0,k4(r,i,l,i.pendingProps);case 24:mi(i,Dn,r.memoizedState.cache)}return Ba(r,i,l)}function _4(r,i,l){if(r!==null)if(r.memoizedProps!==i.pendingProps)Ln=!0;else{if(!Y0(r,l)&&(i.flags&128)===0)return Ln=!1,u8(r,i,l);Ln=(r.flags&131072)!==0}else Ln=!1,Vt&&(i.flags&1048576)!==0&&cg(i,Bo,i.index);switch(i.lanes=0,i.tag){case 16:e:{var f=i.pendingProps;if(r=as(i.elementType),i.type=r,typeof r=="function")Jd(r)?(f=ls(r,f),i.tag=1,i=C4(null,i,r,f,l)):(i.tag=0,i=U0(null,i,r,f,l));else{if(r!=null){var g=r.$$typeof;if(g===P){i.tag=11,i=y4(null,i,r,f,l);break e}else if(g===z){i.tag=14,i=x4(null,i,r,f,l);break e}}throw i=J(r)||r,Error(a(306,i,""))}}return i;case 0:return U0(r,i,i.type,i.pendingProps,l);case 1:return f=i.type,g=ls(f,i.pendingProps),C4(r,i,f,g,l);case 3:e:{if(ne(i,i.stateNode.containerInfo),r===null)throw Error(a(387));f=i.pendingProps;var v=i.memoizedState;g=v.element,h0(r,i),Vo(i,f,null,l);var R=i.memoizedState;if(f=R.cache,mi(i,Dn,f),f!==v.cache&&l0(i,[Dn],l,!0),Go(),f=R.element,v.isDehydrated)if(v={element:f,isDehydrated:!1,cache:R.cache},i.updateQueue.baseState=v,i.memoizedState=v,i.flags&256){i=R4(r,i,f,l);break e}else if(f!==g){g=Gr(Error(a(424)),i),qo(g),i=R4(r,i,f,l);break e}else for(r=i.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,mn=Zr(r.firstChild),Xn=i,Vt=!0,di=null,Yr=!0,l=kg(i,null,f,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(es(),f===g){i=Ba(r,i,l);break e}Jn(r,i,f,l)}i=i.child}return i;case 26:return zc(r,i),r===null?(l=F2(i.type,null,i.pendingProps,null))?i.memoizedState=l:Vt||(l=i.type,r=i.pendingProps,f=eu(V.current).createElement(l),f[xn]=i,f[Kn]=r,er(f,l,r),wn(f),i.stateNode=f):i.memoizedState=F2(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return he(i),r===null&&Vt&&(f=i.stateNode=q2(i.type,i.pendingProps,V.current),Xn=i,Yr=!0,g=mn,Ci(i.type)?(Nf=g,mn=Zr(f.firstChild)):mn=g),Jn(r,i,i.pendingProps.children,l),zc(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&Vt&&((g=f=mn)&&(f=H8(f,i.type,i.pendingProps,Yr),f!==null?(i.stateNode=f,Xn=i,mn=Zr(f.firstChild),Yr=!1,g=!0):g=!1),g||fi(i)),he(i),g=i.type,v=i.pendingProps,R=r!==null?r.memoizedProps:null,f=v.children,Sf(g,v)?f=null:R!==null&&Sf(g,R)&&(i.flags|=32),i.memoizedState!==null&&(g=w0(r,i,t8,null,null,l),fl._currentValue=g),zc(r,i),Jn(r,i,f,l),i.child;case 6:return r===null&&Vt&&((r=l=mn)&&(l=U8(l,i.pendingProps,Yr),l!==null?(i.stateNode=l,Xn=i,mn=null,r=!0):r=!1),r||fi(i)),null;case 13:return N4(r,i,l);case 4:return ne(i,i.stateNode.containerInfo),f=i.pendingProps,r===null?i.child=ss(i,null,f,l):Jn(r,i,f,l),i.child;case 11:return y4(r,i,i.type,i.pendingProps,l);case 7:return Jn(r,i,i.pendingProps,l),i.child;case 8:return Jn(r,i,i.pendingProps.children,l),i.child;case 12:return Jn(r,i,i.pendingProps.children,l),i.child;case 10:return f=i.pendingProps,mi(i,i.type,f.value),Jn(r,i,f.children,l),i.child;case 9:return g=i.type._context,f=i.pendingProps.children,ns(i),g=Qn(g),f=f(g),i.flags|=1,Jn(r,i,f,l),i.child;case 14:return x4(r,i,i.type,i.pendingProps,l);case 15:return w4(r,i,i.type,i.pendingProps,l);case 19:return I4(r,i,l);case 31:return c8(r,i,l);case 22:return k4(r,i,l,i.pendingProps);case 24:return ns(i),f=Qn(Dn),r===null?(g=d0(),g===null&&(g=ln,v=c0(),g.pooledCache=v,v.refCount++,v!==null&&(g.pooledCacheLanes|=l),g=v),i.memoizedState={parent:f,cache:g},m0(i),mi(i,Dn,g)):((r.lanes&l)!==0&&(h0(r,i),Vo(i,null,null,l),Go()),g=r.memoizedState,v=i.memoizedState,g.parent!==f?(g={parent:f,cache:f},i.memoizedState=g,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=g),mi(i,Dn,f)):(f=v.cache,mi(i,Dn,f),f!==g.cache&&l0(i,[Dn],l,!0))),Jn(r,i,i.pendingProps.children,l),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function qa(r){r.flags|=4}function W0(r,i,l,f,g){if((i=(r.mode&32)!==0)&&(i=!1),i){if(r.flags|=16777216,(g&335544128)===g)if(r.stateNode.complete)r.flags|=8192;else if(a2())r.flags|=8192;else throw is=kc,f0}else r.flags&=-16777217}function M4(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!K2(i))if(a2())r.flags|=8192;else throw is=kc,f0}function qc(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?et():536870912,r.lanes|=i,Js|=i)}function Qo(r,i){if(!Vt)switch(r.tailMode){case"hidden":i=r.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?r.tail=null:l.sibling=null;break;case"collapsed":l=r.tail;for(var f=null;l!==null;)l.alternate!==null&&(f=l),l=l.sibling;f===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:f.sibling=null}}function hn(r){var i=r.alternate!==null&&r.alternate.child===r.child,l=0,f=0;if(i)for(var g=r.child;g!==null;)l|=g.lanes|g.childLanes,f|=g.subtreeFlags&65011712,f|=g.flags&65011712,g.return=r,g=g.sibling;else for(g=r.child;g!==null;)l|=g.lanes|g.childLanes,f|=g.subtreeFlags,f|=g.flags,g.return=r,g=g.sibling;return r.subtreeFlags|=f,r.childLanes=l,i}function d8(r,i,l){var f=i.pendingProps;switch(r0(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return hn(i),null;case 1:return hn(i),null;case 3:return l=i.stateNode,f=null,r!==null&&(f=r.memoizedState.cache),i.memoizedState.cache!==f&&(i.flags|=2048),ja(Dn),ue(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(r===null||r.child===null)&&(Hs(i)?qa(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,i0())),hn(i),null;case 26:var g=i.type,v=i.memoizedState;return r===null?(qa(i),v!==null?(hn(i),M4(i,v)):(hn(i),W0(i,g,null,f,l))):v?v!==r.memoizedState?(qa(i),hn(i),M4(i,v)):(hn(i),i.flags&=-16777217):(r=r.memoizedProps,r!==f&&qa(i),hn(i),W0(i,g,r,f,l)),null;case 27:if(Re(i),l=V.current,g=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==f&&qa(i);else{if(!f){if(i.stateNode===null)throw Error(a(166));return hn(i),null}r=be.current,Hs(i)?dg(i):(r=q2(g,f,l),i.stateNode=r,qa(i))}return hn(i),null;case 5:if(Re(i),g=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==f&&qa(i);else{if(!f){if(i.stateNode===null)throw Error(a(166));return hn(i),null}if(v=be.current,Hs(i))dg(i);else{var R=eu(V.current);switch(v){case 1:v=R.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:v=R.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":v=R.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":v=R.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":v=R.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof f.is=="string"?R.createElement("select",{is:f.is}):R.createElement("select"),f.multiple?v.multiple=!0:f.size&&(v.size=f.size);break;default:v=typeof f.is=="string"?R.createElement(g,{is:f.is}):R.createElement(g)}}v[xn]=i,v[Kn]=f;e:for(R=i.child;R!==null;){if(R.tag===5||R.tag===6)v.appendChild(R.stateNode);else if(R.tag!==4&&R.tag!==27&&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}i.stateNode=v;e:switch(er(v,g,f),g){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}f&&qa(i)}}return hn(i),W0(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,l),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==f&&qa(i);else{if(typeof f!="string"&&i.stateNode===null)throw Error(a(166));if(r=V.current,Hs(i)){if(r=i.stateNode,l=i.memoizedProps,f=null,g=Xn,g!==null)switch(g.tag){case 27:case 5:f=g.memoizedProps}r[xn]=i,r=!!(r.nodeValue===l||f!==null&&f.suppressHydrationWarning===!0||N2(r.nodeValue,l)),r||fi(i,!0)}else r=eu(r).createTextNode(f),r[xn]=i,i.stateNode=r}return hn(i),null;case 31:if(l=i.memoizedState,r===null||r.memoizedState!==null){if(f=Hs(i),l!==null){if(r===null){if(!f)throw Error(a(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));r[xn]=i}else es(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;hn(i),r=!1}else l=i0(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=l),r=!0;if(!r)return i.flags&256?(Or(i),i):(Or(i),null);if((i.flags&128)!==0)throw Error(a(558))}return hn(i),null;case 13:if(f=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(g=Hs(i),f!==null&&f.dehydrated!==null){if(r===null){if(!g)throw Error(a(318));if(g=i.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(a(317));g[xn]=i}else es(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;hn(i),g=!1}else g=i0(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=g),g=!0;if(!g)return i.flags&256?(Or(i),i):(Or(i),null)}return Or(i),(i.flags&128)!==0?(i.lanes=l,i):(l=f!==null,r=r!==null&&r.memoizedState!==null,l&&(f=i.child,g=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(g=f.alternate.memoizedState.cachePool.pool),v=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(v=f.memoizedState.cachePool.pool),v!==g&&(f.flags|=2048)),l!==r&&l&&(i.child.flags|=8192),qc(i,i.updateQueue),hn(i),null);case 4:return ue(),r===null&&vf(i.stateNode.containerInfo),hn(i),null;case 10:return ja(i.type),hn(i),null;case 19:if(W(An),f=i.memoizedState,f===null)return hn(i),null;if(g=(i.flags&128)!==0,v=f.rendering,v===null)if(g)Qo(f,!1);else{if(Cn!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(v=Cc(r),v!==null){for(i.flags|=128,Qo(f,!1),r=v.updateQueue,i.updateQueue=r,qc(i,r),i.subtreeFlags=0,r=l,l=i.child;l!==null;)sg(l,r),l=l.sibling;return O(An,An.current&1|2),Vt&&Oa(i,f.treeForkCount),i.child}r=r.sibling}f.tail!==null&&Ue()>Pc&&(i.flags|=128,g=!0,Qo(f,!1),i.lanes=4194304)}else{if(!g)if(r=Cc(v),r!==null){if(i.flags|=128,g=!0,r=r.updateQueue,i.updateQueue=r,qc(i,r),Qo(f,!0),f.tail===null&&f.tailMode==="hidden"&&!v.alternate&&!Vt)return hn(i),null}else 2*Ue()-f.renderingStartTime>Pc&&l!==536870912&&(i.flags|=128,g=!0,Qo(f,!1),i.lanes=4194304);f.isBackwards?(v.sibling=i.child,i.child=v):(r=f.last,r!==null?r.sibling=v:i.child=v,f.last=v)}return f.tail!==null?(r=f.tail,f.rendering=r,f.tail=r.sibling,f.renderingStartTime=Ue(),r.sibling=null,l=An.current,O(An,g?l&1|2:l&1),Vt&&Oa(i,f.treeForkCount),r):(hn(i),null);case 22:case 23:return Or(i),v0(),f=i.memoizedState!==null,r!==null?r.memoizedState!==null!==f&&(i.flags|=8192):f&&(i.flags|=8192),f?(l&536870912)!==0&&(i.flags&128)===0&&(hn(i),i.subtreeFlags&6&&(i.flags|=8192)):hn(i),l=i.updateQueue,l!==null&&qc(i,l.retryQueue),l=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),f=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),f!==l&&(i.flags|=2048),r!==null&&W(rs),null;case 24:return l=null,r!==null&&(l=r.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),ja(Dn),hn(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function f8(r,i){switch(r0(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return ja(Dn),ue(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return Re(i),null;case 31:if(i.memoizedState!==null){if(Or(i),i.alternate===null)throw Error(a(340));es()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(Or(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));es()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return W(An),null;case 4:return ue(),null;case 10:return ja(i.type),null;case 22:case 23:return Or(i),v0(),r!==null&&W(rs),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return ja(Dn),null;case 25:return null;default:return null}}function O4(r,i){switch(r0(i),i.tag){case 3:ja(Dn),ue();break;case 26:case 27:case 5:Re(i);break;case 4:ue();break;case 31:i.memoizedState!==null&&Or(i);break;case 13:Or(i);break;case 19:W(An);break;case 10:ja(i.type);break;case 22:case 23:Or(i),v0(),r!==null&&W(rs);break;case 24:ja(Dn)}}function Jo(r,i){try{var l=i.updateQueue,f=l!==null?l.lastEffect:null;if(f!==null){var g=f.next;l=g;do{if((l.tag&r)===r){f=void 0;var v=l.create,R=l.inst;f=v(),R.destroy=f}l=l.next}while(l!==g)}}catch(L){rn(i,i.return,L)}}function yi(r,i,l){try{var f=i.updateQueue,g=f!==null?f.lastEffect:null;if(g!==null){var v=g.next;f=v;do{if((f.tag&r)===r){var R=f.inst,L=R.destroy;if(L!==void 0){R.destroy=void 0,g=i;var ie=l,ve=L;try{ve()}catch(Se){rn(g,ie,Se)}}}f=f.next}while(f!==v)}}catch(Se){rn(i,i.return,Se)}}function D4(r){var i=r.updateQueue;if(i!==null){var l=r.stateNode;try{Eg(i,l)}catch(f){rn(r,r.return,f)}}}function j4(r,i,l){l.props=ls(r.type,r.memoizedProps),l.state=r.memoizedState;try{l.componentWillUnmount()}catch(f){rn(r,i,f)}}function el(r,i){try{var l=r.ref;if(l!==null){switch(r.tag){case 26:case 27:case 5:var f=r.stateNode;break;case 30:f=r.stateNode;break;default:f=r.stateNode}typeof l=="function"?r.refCleanup=l(f):l.current=f}}catch(g){rn(r,i,g)}}function ga(r,i){var l=r.ref,f=r.refCleanup;if(l!==null)if(typeof f=="function")try{f()}catch(g){rn(r,i,g)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(g){rn(r,i,g)}else l.current=null}function L4(r){var i=r.type,l=r.memoizedProps,f=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":l.autoFocus&&f.focus();break e;case"img":l.src?f.src=l.src:l.srcSet&&(f.srcset=l.srcSet)}}catch(g){rn(r,r.return,g)}}function Z0(r,i,l){try{var f=r.stateNode;D8(f,r.type,l,i),f[Kn]=i}catch(g){rn(r,r.return,g)}}function z4(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Ci(r.type)||r.tag===4}function X0(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||z4(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&&Ci(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 Q0(r,i,l){var f=r.tag;if(f===5||f===6)r=r.stateNode,i?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(r,i):(i=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,i.appendChild(r),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=$e));else if(f!==4&&(f===27&&Ci(r.type)&&(l=r.stateNode,i=null),r=r.child,r!==null))for(Q0(r,i,l),r=r.sibling;r!==null;)Q0(r,i,l),r=r.sibling}function Hc(r,i,l){var f=r.tag;if(f===5||f===6)r=r.stateNode,i?l.insertBefore(r,i):l.appendChild(r);else if(f!==4&&(f===27&&Ci(r.type)&&(l=r.stateNode),r=r.child,r!==null))for(Hc(r,i,l),r=r.sibling;r!==null;)Hc(r,i,l),r=r.sibling}function B4(r){var i=r.stateNode,l=r.memoizedProps;try{for(var f=r.type,g=i.attributes;g.length;)i.removeAttributeNode(g[0]);er(i,f,l),i[xn]=r,i[Kn]=l}catch(v){rn(r,r.return,v)}}var Ha=!1,zn=!1,J0=!1,q4=typeof WeakSet=="function"?WeakSet:Set,Yn=null;function m8(r,i){if(r=r.containerInfo,wf=ou,r=Xp(r),Vd(r)){if("selectionStart"in r)var l={start:r.selectionStart,end:r.selectionEnd};else e:{l=(l=r.ownerDocument)&&l.defaultView||window;var f=l.getSelection&&l.getSelection();if(f&&f.rangeCount!==0){l=f.anchorNode;var g=f.anchorOffset,v=f.focusNode;f=f.focusOffset;try{l.nodeType,v.nodeType}catch{l=null;break e}var R=0,L=-1,ie=-1,ve=0,Se=0,Ce=r,ye=null;t:for(;;){for(var xe;Ce!==l||g!==0&&Ce.nodeType!==3||(L=R+g),Ce!==v||f!==0&&Ce.nodeType!==3||(ie=R+f),Ce.nodeType===3&&(R+=Ce.nodeValue.length),(xe=Ce.firstChild)!==null;)ye=Ce,Ce=xe;for(;;){if(Ce===r)break t;if(ye===l&&++ve===g&&(L=R),ye===v&&++Se===f&&(ie=R),(xe=Ce.nextSibling)!==null)break;Ce=ye,ye=Ce.parentNode}Ce=xe}l=L===-1||ie===-1?null:{start:L,end:ie}}else l=null}l=l||{start:0,end:0}}else l=null;for(kf={focusedElem:r,selectionRange:l},ou=!1,Yn=i;Yn!==null;)if(i=Yn,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,Yn=r;else for(;Yn!==null;){switch(i=Yn,v=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(l=0;l<r.length;l++)g=r[l],g.ref.impl=g.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&v!==null){r=void 0,l=i,g=v.memoizedProps,v=v.memoizedState,f=l.stateNode;try{var We=ls(l.type,g);r=f.getSnapshotBeforeUpdate(We,v),f.__reactInternalSnapshotBeforeUpdate=r}catch(ct){rn(l,l.return,ct)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,l=r.nodeType,l===9)Tf(r);else if(l===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Tf(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,Yn=r;break}Yn=i.return}}function H4(r,i,l){var f=l.flags;switch(l.tag){case 0:case 11:case 15:Fa(r,l),f&4&&Jo(5,l);break;case 1:if(Fa(r,l),f&4)if(r=l.stateNode,i===null)try{r.componentDidMount()}catch(R){rn(l,l.return,R)}else{var g=ls(l.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(g,i,r.__reactInternalSnapshotBeforeUpdate)}catch(R){rn(l,l.return,R)}}f&64&&D4(l),f&512&&el(l,l.return);break;case 3:if(Fa(r,l),f&64&&(r=l.updateQueue,r!==null)){if(i=null,l.child!==null)switch(l.child.tag){case 27:case 5:i=l.child.stateNode;break;case 1:i=l.child.stateNode}try{Eg(r,i)}catch(R){rn(l,l.return,R)}}break;case 27:i===null&&f&4&&B4(l);case 26:case 5:Fa(r,l),i===null&&f&4&&L4(l),f&512&&el(l,l.return);break;case 12:Fa(r,l);break;case 31:Fa(r,l),f&4&&$4(r,l);break;case 13:Fa(r,l),f&4&&P4(r,l),f&64&&(r=l.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(l=k8.bind(null,l),F8(r,l))));break;case 22:if(f=l.memoizedState!==null||Ha,!f){i=i!==null&&i.memoizedState!==null||zn,g=Ha;var v=zn;Ha=f,(zn=i)&&!v?$a(r,l,(l.subtreeFlags&8772)!==0):Fa(r,l),Ha=g,zn=v}break;case 30:break;default:Fa(r,l)}}function U4(r){var i=r.alternate;i!==null&&(r.alternate=null,U4(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&si(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 bn=null,vr=!1;function Ua(r,i,l){for(l=l.child;l!==null;)F4(r,i,l),l=l.sibling}function F4(r,i,l){if(gt&&typeof gt.onCommitFiberUnmount=="function")try{gt.onCommitFiberUnmount(Kt,l)}catch{}switch(l.tag){case 26:zn||ga(l,i),Ua(r,i,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:zn||ga(l,i);var f=bn,g=vr;Ci(l.type)&&(bn=l.stateNode,vr=!1),Ua(r,i,l),cl(l.stateNode),bn=f,vr=g;break;case 5:zn||ga(l,i);case 6:if(f=bn,g=vr,bn=null,Ua(r,i,l),bn=f,vr=g,bn!==null)if(vr)try{(bn.nodeType===9?bn.body:bn.nodeName==="HTML"?bn.ownerDocument.body:bn).removeChild(l.stateNode)}catch(v){rn(l,i,v)}else try{bn.removeChild(l.stateNode)}catch(v){rn(l,i,v)}break;case 18:bn!==null&&(vr?(r=bn,D2(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,l.stateNode),oo(r)):D2(bn,l.stateNode));break;case 4:f=bn,g=vr,bn=l.stateNode.containerInfo,vr=!0,Ua(r,i,l),bn=f,vr=g;break;case 0:case 11:case 14:case 15:yi(2,l,i),zn||yi(4,l,i),Ua(r,i,l);break;case 1:zn||(ga(l,i),f=l.stateNode,typeof f.componentWillUnmount=="function"&&j4(l,i,f)),Ua(r,i,l);break;case 21:Ua(r,i,l);break;case 22:zn=(f=zn)||l.memoizedState!==null,Ua(r,i,l),zn=f;break;default:Ua(r,i,l)}}function $4(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{oo(r)}catch(l){rn(i,i.return,l)}}}function P4(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{oo(r)}catch(l){rn(i,i.return,l)}}function h8(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new q4),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new q4),i;default:throw Error(a(435,r.tag))}}function Uc(r,i){var l=h8(r);i.forEach(function(f){if(!l.has(f)){l.add(f);var g=S8.bind(null,r,f);f.then(g,g)}})}function yr(r,i){var l=i.deletions;if(l!==null)for(var f=0;f<l.length;f++){var g=l[f],v=r,R=i,L=R;e:for(;L!==null;){switch(L.tag){case 27:if(Ci(L.type)){bn=L.stateNode,vr=!1;break e}break;case 5:bn=L.stateNode,vr=!1;break e;case 3:case 4:bn=L.stateNode.containerInfo,vr=!0;break e}L=L.return}if(bn===null)throw Error(a(160));F4(v,R,g),bn=null,vr=!1,v=g.alternate,v!==null&&(v.return=null),g.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)G4(i,r),i=i.sibling}var oa=null;function G4(r,i){var l=r.alternate,f=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:yr(i,r),xr(r),f&4&&(yi(3,r,r.return),Jo(3,r),yi(5,r,r.return));break;case 1:yr(i,r),xr(r),f&512&&(zn||l===null||ga(l,l.return)),f&64&&Ha&&(r=r.updateQueue,r!==null&&(f=r.callbacks,f!==null&&(l=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=l===null?f:l.concat(f))));break;case 26:var g=oa;if(yr(i,r),xr(r),f&512&&(zn||l===null||ga(l,l.return)),f&4){var v=l!==null?l.memoizedState:null;if(f=r.memoizedState,l===null)if(f===null)if(r.stateNode===null){e:{f=r.type,l=r.memoizedProps,g=g.ownerDocument||g;t:switch(f){case"title":v=g.getElementsByTagName("title")[0],(!v||v[fa]||v[xn]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=g.createElement(f),g.head.insertBefore(v,g.querySelector("head > title"))),er(v,f,l),v[xn]=r,wn(v),f=v;break e;case"link":var R=G2("link","href",g).get(f+(l.href||""));if(R){for(var L=0;L<R.length;L++)if(v=R[L],v.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&v.getAttribute("rel")===(l.rel==null?null:l.rel)&&v.getAttribute("title")===(l.title==null?null:l.title)&&v.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){R.splice(L,1);break t}}v=g.createElement(f),er(v,f,l),g.head.appendChild(v);break;case"meta":if(R=G2("meta","content",g).get(f+(l.content||""))){for(L=0;L<R.length;L++)if(v=R[L],v.getAttribute("content")===(l.content==null?null:""+l.content)&&v.getAttribute("name")===(l.name==null?null:l.name)&&v.getAttribute("property")===(l.property==null?null:l.property)&&v.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&v.getAttribute("charset")===(l.charSet==null?null:l.charSet)){R.splice(L,1);break t}}v=g.createElement(f),er(v,f,l),g.head.appendChild(v);break;default:throw Error(a(468,f))}v[xn]=r,wn(v),f=v}r.stateNode=f}else V2(g,r.type,r.stateNode);else r.stateNode=P2(g,f,r.memoizedProps);else v!==f?(v===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):v.count--,f===null?V2(g,r.type,r.stateNode):P2(g,f,r.memoizedProps)):f===null&&r.stateNode!==null&&Z0(r,r.memoizedProps,l.memoizedProps)}break;case 27:yr(i,r),xr(r),f&512&&(zn||l===null||ga(l,l.return)),l!==null&&f&4&&Z0(r,r.memoizedProps,l.memoizedProps);break;case 5:if(yr(i,r),xr(r),f&512&&(zn||l===null||ga(l,l.return)),r.flags&32){g=r.stateNode;try{dt(g,"")}catch(We){rn(r,r.return,We)}}f&4&&r.stateNode!=null&&(g=r.memoizedProps,Z0(r,g,l!==null?l.memoizedProps:g)),f&1024&&(J0=!0);break;case 6:if(yr(i,r),xr(r),f&4){if(r.stateNode===null)throw Error(a(162));f=r.memoizedProps,l=r.stateNode;try{l.nodeValue=f}catch(We){rn(r,r.return,We)}}break;case 3:if(ru=null,g=oa,oa=tu(i.containerInfo),yr(i,r),oa=g,xr(r),f&4&&l!==null&&l.memoizedState.isDehydrated)try{oo(i.containerInfo)}catch(We){rn(r,r.return,We)}J0&&(J0=!1,V4(r));break;case 4:f=oa,oa=tu(r.stateNode.containerInfo),yr(i,r),xr(r),oa=f;break;case 12:yr(i,r),xr(r);break;case 31:yr(i,r),xr(r),f&4&&(f=r.updateQueue,f!==null&&(r.updateQueue=null,Uc(r,f)));break;case 13:yr(i,r),xr(r),r.child.flags&8192&&r.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&($c=Ue()),f&4&&(f=r.updateQueue,f!==null&&(r.updateQueue=null,Uc(r,f)));break;case 22:g=r.memoizedState!==null;var ie=l!==null&&l.memoizedState!==null,ve=Ha,Se=zn;if(Ha=ve||g,zn=Se||ie,yr(i,r),zn=Se,Ha=ve,xr(r),f&8192)e:for(i=r.stateNode,i._visibility=g?i._visibility&-2:i._visibility|1,g&&(l===null||ie||Ha||zn||cs(r)),l=null,i=r;;){if(i.tag===5||i.tag===26){if(l===null){ie=l=i;try{if(v=ie.stateNode,g)R=v.style,typeof R.setProperty=="function"?R.setProperty("display","none","important"):R.display="none";else{L=ie.stateNode;var Ce=ie.memoizedProps.style,ye=Ce!=null&&Ce.hasOwnProperty("display")?Ce.display:null;L.style.display=ye==null||typeof ye=="boolean"?"":(""+ye).trim()}}catch(We){rn(ie,ie.return,We)}}}else if(i.tag===6){if(l===null){ie=i;try{ie.stateNode.nodeValue=g?"":ie.memoizedProps}catch(We){rn(ie,ie.return,We)}}}else if(i.tag===18){if(l===null){ie=i;try{var xe=ie.stateNode;g?j2(xe,!0):j2(ie.stateNode,!1)}catch(We){rn(ie,ie.return,We)}}}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;l===i&&(l=null),i=i.return}l===i&&(l=null),i.sibling.return=i.return,i=i.sibling}f&4&&(f=r.updateQueue,f!==null&&(l=f.retryQueue,l!==null&&(f.retryQueue=null,Uc(r,l))));break;case 19:yr(i,r),xr(r),f&4&&(f=r.updateQueue,f!==null&&(r.updateQueue=null,Uc(r,f)));break;case 30:break;case 21:break;default:yr(i,r),xr(r)}}function xr(r){var i=r.flags;if(i&2){try{for(var l,f=r.return;f!==null;){if(z4(f)){l=f;break}f=f.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var g=l.stateNode,v=X0(r);Hc(r,v,g);break;case 5:var R=l.stateNode;l.flags&32&&(dt(R,""),l.flags&=-33);var L=X0(r);Hc(r,L,R);break;case 3:case 4:var ie=l.stateNode.containerInfo,ve=X0(r);Q0(r,ve,ie);break;default:throw Error(a(161))}}catch(Se){rn(r,r.return,Se)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function V4(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;V4(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function Fa(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)H4(r,i.alternate,i),i=i.sibling}function cs(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:yi(4,i,i.return),cs(i);break;case 1:ga(i,i.return);var l=i.stateNode;typeof l.componentWillUnmount=="function"&&j4(i,i.return,l),cs(i);break;case 27:cl(i.stateNode);case 26:case 5:ga(i,i.return),cs(i);break;case 22:i.memoizedState===null&&cs(i);break;case 30:cs(i);break;default:cs(i)}r=r.sibling}}function $a(r,i,l){for(l=l&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var f=i.alternate,g=r,v=i,R=v.flags;switch(v.tag){case 0:case 11:case 15:$a(g,v,l),Jo(4,v);break;case 1:if($a(g,v,l),f=v,g=f.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(ve){rn(f,f.return,ve)}if(f=v,g=f.updateQueue,g!==null){var L=f.stateNode;try{var ie=g.shared.hiddenCallbacks;if(ie!==null)for(g.shared.hiddenCallbacks=null,g=0;g<ie.length;g++)Sg(ie[g],L)}catch(ve){rn(f,f.return,ve)}}l&&R&64&&D4(v),el(v,v.return);break;case 27:B4(v);case 26:case 5:$a(g,v,l),l&&f===null&&R&4&&L4(v),el(v,v.return);break;case 12:$a(g,v,l);break;case 31:$a(g,v,l),l&&R&4&&$4(g,v);break;case 13:$a(g,v,l),l&&R&4&&P4(g,v);break;case 22:v.memoizedState===null&&$a(g,v,l),el(v,v.return);break;case 30:break;default:$a(g,v,l)}i=i.sibling}}function ef(r,i){var l=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==l&&(r!=null&&r.refCount++,l!=null&&Ho(l))}function tf(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&Ho(r))}function la(r,i,l,f){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)K4(r,i,l,f),i=i.sibling}function K4(r,i,l,f){var g=i.flags;switch(i.tag){case 0:case 11:case 15:la(r,i,l,f),g&2048&&Jo(9,i);break;case 1:la(r,i,l,f);break;case 3:la(r,i,l,f),g&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&Ho(r)));break;case 12:if(g&2048){la(r,i,l,f),r=i.stateNode;try{var v=i.memoizedProps,R=v.id,L=v.onPostCommit;typeof L=="function"&&L(R,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(ie){rn(i,i.return,ie)}}else la(r,i,l,f);break;case 31:la(r,i,l,f);break;case 13:la(r,i,l,f);break;case 23:break;case 22:v=i.stateNode,R=i.alternate,i.memoizedState!==null?v._visibility&2?la(r,i,l,f):tl(r,i):v._visibility&2?la(r,i,l,f):(v._visibility|=2,Zs(r,i,l,f,(i.subtreeFlags&10256)!==0||!1)),g&2048&&ef(R,i);break;case 24:la(r,i,l,f),g&2048&&tf(i.alternate,i);break;default:la(r,i,l,f)}}function Zs(r,i,l,f,g){for(g=g&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var v=r,R=i,L=l,ie=f,ve=R.flags;switch(R.tag){case 0:case 11:case 15:Zs(v,R,L,ie,g),Jo(8,R);break;case 23:break;case 22:var Se=R.stateNode;R.memoizedState!==null?Se._visibility&2?Zs(v,R,L,ie,g):tl(v,R):(Se._visibility|=2,Zs(v,R,L,ie,g)),g&&ve&2048&&ef(R.alternate,R);break;case 24:Zs(v,R,L,ie,g),g&&ve&2048&&tf(R.alternate,R);break;default:Zs(v,R,L,ie,g)}i=i.sibling}}function tl(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var l=r,f=i,g=f.flags;switch(f.tag){case 22:tl(l,f),g&2048&&ef(f.alternate,f);break;case 24:tl(l,f),g&2048&&tf(f.alternate,f);break;default:tl(l,f)}i=i.sibling}}var nl=8192;function Xs(r,i,l){if(r.subtreeFlags&nl)for(r=r.child;r!==null;)Y4(r,i,l),r=r.sibling}function Y4(r,i,l){switch(r.tag){case 26:Xs(r,i,l),r.flags&nl&&r.memoizedState!==null&&e9(l,oa,r.memoizedState,r.memoizedProps);break;case 5:Xs(r,i,l);break;case 3:case 4:var f=oa;oa=tu(r.stateNode.containerInfo),Xs(r,i,l),oa=f;break;case 22:r.memoizedState===null&&(f=r.alternate,f!==null&&f.memoizedState!==null?(f=nl,nl=16777216,Xs(r,i,l),nl=f):Xs(r,i,l));break;default:Xs(r,i,l)}}function W4(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 rl(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var f=i[l];Yn=f,X4(f,r)}W4(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Z4(r),r=r.sibling}function Z4(r){switch(r.tag){case 0:case 11:case 15:rl(r),r.flags&2048&&yi(9,r,r.return);break;case 3:rl(r);break;case 12:rl(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,Fc(r)):rl(r);break;default:rl(r)}}function Fc(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var f=i[l];Yn=f,X4(f,r)}W4(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:yi(8,i,i.return),Fc(i);break;case 22:l=i.stateNode,l._visibility&2&&(l._visibility&=-3,Fc(i));break;default:Fc(i)}r=r.sibling}}function X4(r,i){for(;Yn!==null;){var l=Yn;switch(l.tag){case 0:case 11:case 15:yi(8,l,i);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var f=l.memoizedState.cachePool.pool;f!=null&&f.refCount++}break;case 24:Ho(l.memoizedState.cache)}if(f=l.child,f!==null)f.return=l,Yn=f;else e:for(l=r;Yn!==null;){f=Yn;var g=f.sibling,v=f.return;if(U4(f),f===l){Yn=null;break e}if(g!==null){g.return=v,Yn=g;break e}Yn=v}}}var p8={getCacheForType:function(r){var i=Qn(Dn),l=i.data.get(r);return l===void 0&&(l=r(),i.data.set(r,l)),l},cacheSignal:function(){return Qn(Dn).controller.signal}},g8=typeof WeakMap=="function"?WeakMap:Map,Qt=0,ln=null,zt=null,$t=0,nn=0,Dr=null,xi=!1,Qs=!1,nf=!1,Pa=0,Cn=0,wi=0,us=0,rf=0,jr=0,Js=0,al=null,wr=null,af=!1,$c=0,Q4=0,Pc=1/0,Gc=null,ki=null,$n=0,Si=null,eo=null,Ga=0,sf=0,of=null,J4=null,il=0,lf=null;function Lr(){return(Qt&2)!==0&&$t!==0?$t&-$t:_.T!==null?hf():na()}function e2(){if(jr===0)if(($t&536870912)===0||Vt){var r=wt;wt<<=1,(wt&3932160)===0&&(wt=262144),jr=r}else jr=536870912;return r=Mr.current,r!==null&&(r.flags|=32),jr}function kr(r,i,l){(r===ln&&(nn===2||nn===9)||r.cancelPendingCommit!==null)&&(to(r,0),Ei(r,$t,jr,!1)),jt(r,l),((Qt&2)===0||r!==ln)&&(r===ln&&((Qt&2)===0&&(us|=l),Cn===4&&Ei(r,$t,jr,!1)),ba(r))}function t2(r,i,l){if((Qt&6)!==0)throw Error(a(327));var f=!l&&(i&127)===0&&(i&r.expiredLanes)===0||ke(r,i),g=f?y8(r,i):uf(r,i,!0),v=f;do{if(g===0){Qs&&!f&&Ei(r,i,0,!1);break}else{if(l=r.current.alternate,v&&!b8(l)){g=uf(r,i,!1),v=!1;continue}if(g===2){if(v=i,r.errorRecoveryDisabledLanes&v)var R=0;else R=r.pendingLanes&-536870913,R=R!==0?R:R&536870912?536870912:0;if(R!==0){i=R;e:{var L=r;g=al;var ie=L.current.memoizedState.isDehydrated;if(ie&&(to(L,R).flags|=256),R=uf(L,R,!1),R!==2){if(nf&&!ie){L.errorRecoveryDisabledLanes|=v,us|=v,g=4;break e}v=wr,wr=g,v!==null&&(wr===null?wr=v:wr.push.apply(wr,v))}g=R}if(v=!1,g!==2)continue}}if(g===1){to(r,0),Ei(r,i,0,!0);break}e:{switch(f=r,v=g,v){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:Ei(f,i,jr,!xi);break e;case 2:wr=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(g=$c+300-Ue(),10<g)){if(Ei(f,i,jr,!xi),Q(f,0,!0)!==0)break e;Ga=i,f.timeoutHandle=M2(n2.bind(null,f,l,wr,Gc,af,i,jr,us,Js,xi,v,"Throttled",-0,0),g);break e}n2(f,l,wr,Gc,af,i,jr,us,Js,xi,v,null,-0,0)}}break}while(!0);ba(r)}function n2(r,i,l,f,g,v,R,L,ie,ve,Se,Ce,ye,xe){if(r.timeoutHandle=-1,Ce=i.subtreeFlags,Ce&8192||(Ce&16785408)===16785408){Ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:$e},Y4(i,v,Ce);var We=(v&62914560)===v?$c-Ue():(v&4194048)===v?Q4-Ue():0;if(We=t9(Ce,We),We!==null){Ga=v,r.cancelPendingCommit=We(u2.bind(null,r,i,v,l,f,g,R,L,ie,Se,Ce,null,ye,xe)),Ei(r,v,R,!ve);return}}u2(r,i,v,l,f,g,R,L,ie)}function b8(r){for(var i=r;;){var l=i.tag;if((l===0||l===11||l===15)&&i.flags&16384&&(l=i.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var f=0;f<l.length;f++){var g=l[f],v=g.getSnapshot;g=g.value;try{if(!Ir(v(),g))return!1}catch{return!1}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;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 Ei(r,i,l,f){i&=~rf,i&=~us,r.suspendedLanes|=i,r.pingedLanes&=~i,f&&(r.warmLanes|=i),f=r.expirationTimes;for(var g=i;0<g;){var v=31-Tt(g),R=1<<v;f[v]=-1,g&=~R}l!==0&&Pe(r,l,i)}function Vc(){return(Qt&6)===0?(sl(0),!1):!0}function cf(){if(zt!==null){if(nn===0)var r=zt.return;else r=zt,Da=ts=null,E0(r),Gs=null,Fo=0,r=zt;for(;r!==null;)O4(r.alternate,r),r=r.return;zt=null}}function to(r,i){var l=r.timeoutHandle;l!==-1&&(r.timeoutHandle=-1,z8(l)),l=r.cancelPendingCommit,l!==null&&(r.cancelPendingCommit=null,l()),Ga=0,cf(),ln=r,zt=l=Ma(r.current,null),$t=i,nn=0,Dr=null,xi=!1,Qs=ke(r,i),nf=!1,Js=jr=rf=us=wi=Cn=0,wr=al=null,af=!1,(i&8)!==0&&(i|=i&32);var f=r.entangledLanes;if(f!==0)for(r=r.entanglements,f&=i;0<f;){var g=31-Tt(f),v=1<<g;i|=r[g],f&=~v}return Pa=i,mc(),l}function r2(r,i){Ct=null,_.H=Zo,i===Ps||i===wc?(i=yg(),nn=3):i===f0?(i=yg(),nn=4):nn=i===H0?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Dr=i,zt===null&&(Cn=1,jc(r,Gr(i,r.current)))}function a2(){var r=Mr.current;return r===null?!0:($t&4194048)===$t?Wr===null:($t&62914560)===$t||($t&536870912)!==0?r===Wr:!1}function i2(){var r=_.H;return _.H=Zo,r===null?Zo:r}function s2(){var r=_.A;return _.A=p8,r}function Kc(){Cn=4,xi||($t&4194048)!==$t&&Mr.current!==null||(Qs=!0),(wi&134217727)===0&&(us&134217727)===0||ln===null||Ei(ln,$t,jr,!1)}function uf(r,i,l){var f=Qt;Qt|=2;var g=i2(),v=s2();(ln!==r||$t!==i)&&(Gc=null,to(r,i)),i=!1;var R=Cn;e:do try{if(nn!==0&&zt!==null){var L=zt,ie=Dr;switch(nn){case 8:cf(),R=6;break e;case 3:case 2:case 9:case 6:Mr.current===null&&(i=!0);var ve=nn;if(nn=0,Dr=null,no(r,L,ie,ve),l&&Qs){R=0;break e}break;default:ve=nn,nn=0,Dr=null,no(r,L,ie,ve)}}v8(),R=Cn;break}catch(Se){r2(r,Se)}while(!0);return i&&r.shellSuspendCounter++,Da=ts=null,Qt=f,_.H=g,_.A=v,zt===null&&(ln=null,$t=0,mc()),R}function v8(){for(;zt!==null;)o2(zt)}function y8(r,i){var l=Qt;Qt|=2;var f=i2(),g=s2();ln!==r||$t!==i?(Gc=null,Pc=Ue()+500,to(r,i)):Qs=ke(r,i);e:do try{if(nn!==0&&zt!==null){i=zt;var v=Dr;t:switch(nn){case 1:nn=0,Dr=null,no(r,i,v,1);break;case 2:case 9:if(bg(v)){nn=0,Dr=null,l2(i);break}i=function(){nn!==2&&nn!==9||ln!==r||(nn=7),ba(r)},v.then(i,i);break e;case 3:nn=7;break e;case 4:nn=5;break e;case 7:bg(v)?(nn=0,Dr=null,l2(i)):(nn=0,Dr=null,no(r,i,v,7));break;case 5:var R=null;switch(zt.tag){case 26:R=zt.memoizedState;case 5:case 27:var L=zt;if(R?K2(R):L.stateNode.complete){nn=0,Dr=null;var ie=L.sibling;if(ie!==null)zt=ie;else{var ve=L.return;ve!==null?(zt=ve,Yc(ve)):zt=null}break t}}nn=0,Dr=null,no(r,i,v,5);break;case 6:nn=0,Dr=null,no(r,i,v,6);break;case 8:cf(),Cn=6;break e;default:throw Error(a(462))}}x8();break}catch(Se){r2(r,Se)}while(!0);return Da=ts=null,_.H=f,_.A=g,Qt=l,zt!==null?0:(ln=null,$t=0,mc(),Cn)}function x8(){for(;zt!==null&&!ze();)o2(zt)}function o2(r){var i=_4(r.alternate,r,Pa);r.memoizedProps=r.pendingProps,i===null?Yc(r):zt=i}function l2(r){var i=r,l=i.alternate;switch(i.tag){case 15:case 0:i=T4(l,i,i.pendingProps,i.type,void 0,$t);break;case 11:i=T4(l,i,i.pendingProps,i.type.render,i.ref,$t);break;case 5:E0(i);default:O4(l,i),i=zt=sg(i,Pa),i=_4(l,i,Pa)}r.memoizedProps=r.pendingProps,i===null?Yc(r):zt=i}function no(r,i,l,f){Da=ts=null,E0(i),Gs=null,Fo=0;var g=i.return;try{if(l8(r,g,i,l,$t)){Cn=1,jc(r,Gr(l,r.current)),zt=null;return}}catch(v){if(g!==null)throw zt=g,v;Cn=1,jc(r,Gr(l,r.current)),zt=null;return}i.flags&32768?(Vt||f===1?r=!0:Qs||($t&536870912)!==0?r=!1:(xi=r=!0,(f===2||f===9||f===3||f===6)&&(f=Mr.current,f!==null&&f.tag===13&&(f.flags|=16384))),c2(i,r)):Yc(i)}function Yc(r){var i=r;do{if((i.flags&32768)!==0){c2(i,xi);return}r=i.return;var l=d8(i.alternate,i,Pa);if(l!==null){zt=l;return}if(i=i.sibling,i!==null){zt=i;return}zt=i=r}while(i!==null);Cn===0&&(Cn=5)}function c2(r,i){do{var l=f8(r.alternate,r);if(l!==null){l.flags&=32767,zt=l;return}if(l=r.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!i&&(r=r.sibling,r!==null)){zt=r;return}zt=r=l}while(r!==null);Cn=6,zt=null}function u2(r,i,l,f,g,v,R,L,ie){r.cancelPendingCommit=null;do Wc();while($n!==0);if((Qt&6)!==0)throw Error(a(327));if(i!==null){if(i===r.current)throw Error(a(177));if(v=i.lanes|i.childLanes,v|=Xd,Ke(r,l,v,R,L,ie),r===ln&&(zt=ln=null,$t=0),eo=i,Si=r,Ga=l,sf=v,of=g,J4=f,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,E8(He,function(){return p2(),null})):(r.callbackNode=null,r.callbackPriority=0),f=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||f){f=_.T,_.T=null,g=Y.p,Y.p=2,R=Qt,Qt|=4;try{m8(r,i,l)}finally{Qt=R,Y.p=g,_.T=f}}$n=1,d2(),f2(),m2()}}function d2(){if($n===1){$n=0;var r=Si,i=eo,l=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||l){l=_.T,_.T=null;var f=Y.p;Y.p=2;var g=Qt;Qt|=4;try{G4(i,r);var v=kf,R=Xp(r.containerInfo),L=v.focusedElem,ie=v.selectionRange;if(R!==L&&L&&L.ownerDocument&&Zp(L.ownerDocument.documentElement,L)){if(ie!==null&&Vd(L)){var ve=ie.start,Se=ie.end;if(Se===void 0&&(Se=ve),"selectionStart"in L)L.selectionStart=ve,L.selectionEnd=Math.min(Se,L.value.length);else{var Ce=L.ownerDocument||document,ye=Ce&&Ce.defaultView||window;if(ye.getSelection){var xe=ye.getSelection(),We=L.textContent.length,ct=Math.min(ie.start,We),on=ie.end===void 0?ct:Math.min(ie.end,We);!xe.extend&&ct>on&&(R=on,on=ct,ct=R);var de=Wp(L,ct),le=Wp(L,on);if(de&&le&&(xe.rangeCount!==1||xe.anchorNode!==de.node||xe.anchorOffset!==de.offset||xe.focusNode!==le.node||xe.focusOffset!==le.offset)){var ge=Ce.createRange();ge.setStart(de.node,de.offset),xe.removeAllRanges(),ct>on?(xe.addRange(ge),xe.extend(le.node,le.offset)):(ge.setEnd(le.node,le.offset),xe.addRange(ge))}}}}for(Ce=[],xe=L;xe=xe.parentNode;)xe.nodeType===1&&Ce.push({element:xe,left:xe.scrollLeft,top:xe.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<Ce.length;L++){var Te=Ce[L];Te.element.scrollLeft=Te.left,Te.element.scrollTop=Te.top}}ou=!!wf,kf=wf=null}finally{Qt=g,Y.p=f,_.T=l}}r.current=i,$n=2}}function f2(){if($n===2){$n=0;var r=Si,i=eo,l=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||l){l=_.T,_.T=null;var f=Y.p;Y.p=2;var g=Qt;Qt|=4;try{H4(r,i.alternate,i)}finally{Qt=g,Y.p=f,_.T=l}}$n=3}}function m2(){if($n===4||$n===3){$n=0,Qe();var r=Si,i=eo,l=Ga,f=J4;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?$n=5:($n=0,eo=Si=null,h2(r,r.pendingLanes));var g=r.pendingLanes;if(g===0&&(ki=null),Nr(l),i=i.stateNode,gt&&typeof gt.onCommitFiberRoot=="function")try{gt.onCommitFiberRoot(Kt,i,void 0,(i.current.flags&128)===128)}catch{}if(f!==null){i=_.T,g=Y.p,Y.p=2,_.T=null;try{for(var v=r.onRecoverableError,R=0;R<f.length;R++){var L=f[R];v(L.value,{componentStack:L.stack})}}finally{_.T=i,Y.p=g}}(Ga&3)!==0&&Wc(),ba(r),g=r.pendingLanes,(l&261930)!==0&&(g&42)!==0?r===lf?il++:(il=0,lf=r):il=0,sl(0)}}function h2(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,Ho(i)))}function Wc(){return d2(),f2(),m2(),p2()}function p2(){if($n!==5)return!1;var r=Si,i=sf;sf=0;var l=Nr(Ga),f=_.T,g=Y.p;try{Y.p=32>l?32:l,_.T=null,l=of,of=null;var v=Si,R=Ga;if($n=0,eo=Si=null,Ga=0,(Qt&6)!==0)throw Error(a(331));var L=Qt;if(Qt|=4,Z4(v.current),K4(v,v.current,R,l),Qt=L,sl(0,!1),gt&&typeof gt.onPostCommitFiberRoot=="function")try{gt.onPostCommitFiberRoot(Kt,v)}catch{}return!0}finally{Y.p=g,_.T=f,h2(r,i)}}function g2(r,i,l){i=Gr(l,i),i=q0(r.stateNode,i,2),r=gi(r,i,2),r!==null&&(jt(r,2),ba(r))}function rn(r,i,l){if(r.tag===3)g2(r,r,l);else for(;i!==null;){if(i.tag===3){g2(i,r,l);break}else if(i.tag===1){var f=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(ki===null||!ki.has(f))){r=Gr(l,r),l=b4(2),f=gi(i,l,2),f!==null&&(v4(l,f,i,r),jt(f,2),ba(f));break}}i=i.return}}function df(r,i,l){var f=r.pingCache;if(f===null){f=r.pingCache=new g8;var g=new Set;f.set(i,g)}else g=f.get(i),g===void 0&&(g=new Set,f.set(i,g));g.has(l)||(nf=!0,g.add(l),r=w8.bind(null,r,i,l),i.then(r,r))}function w8(r,i,l){var f=r.pingCache;f!==null&&f.delete(i),r.pingedLanes|=r.suspendedLanes&l,r.warmLanes&=~l,ln===r&&($t&l)===l&&(Cn===4||Cn===3&&($t&62914560)===$t&&300>Ue()-$c?(Qt&2)===0&&to(r,0):rf|=l,Js===$t&&(Js=0)),ba(r)}function b2(r,i){i===0&&(i=et()),r=Qi(r,i),r!==null&&(jt(r,i),ba(r))}function k8(r){var i=r.memoizedState,l=0;i!==null&&(l=i.retryLane),b2(r,l)}function S8(r,i){var l=0;switch(r.tag){case 31:case 13:var f=r.stateNode,g=r.memoizedState;g!==null&&(l=g.retryLane);break;case 19:f=r.stateNode;break;case 22:f=r.stateNode._retryCache;break;default:throw Error(a(314))}f!==null&&f.delete(i),b2(r,l)}function E8(r,i){return ft(r,i)}var Zc=null,ro=null,ff=!1,Xc=!1,mf=!1,Ti=0;function ba(r){r!==ro&&r.next===null&&(ro===null?Zc=ro=r:ro=ro.next=r),Xc=!0,ff||(ff=!0,C8())}function sl(r,i){if(!mf&&Xc){mf=!0;do for(var l=!1,f=Zc;f!==null;){if(r!==0){var g=f.pendingLanes;if(g===0)var v=0;else{var R=f.suspendedLanes,L=f.pingedLanes;v=(1<<31-Tt(42|r)+1)-1,v&=g&~(R&~L),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(l=!0,w2(f,v))}else v=$t,v=Q(f,f===ln?v:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(v&3)===0||ke(f,v)||(l=!0,w2(f,v));f=f.next}while(l);mf=!1}}function T8(){v2()}function v2(){Xc=ff=!1;var r=0;Ti!==0&&L8()&&(r=Ti);for(var i=Ue(),l=null,f=Zc;f!==null;){var g=f.next,v=y2(f,i);v===0?(f.next=null,l===null?Zc=g:l.next=g,g===null&&(ro=l)):(l=f,(r!==0||(v&3)!==0)&&(Xc=!0)),f=g}$n!==0&&$n!==5||sl(r),Ti!==0&&(Ti=0)}function y2(r,i){for(var l=r.suspendedLanes,f=r.pingedLanes,g=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var R=31-Tt(v),L=1<<R,ie=g[R];ie===-1?((L&l)===0||(L&f)!==0)&&(g[R]=qe(L,i)):ie<=i&&(r.expiredLanes|=L),v&=~L}if(i=ln,l=$t,l=Q(r,r===i?l:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),f=r.callbackNode,l===0||r===i&&(nn===2||nn===9)||r.cancelPendingCommit!==null)return f!==null&&f!==null&&Ut(f),r.callbackNode=null,r.callbackPriority=0;if((l&3)===0||ke(r,l)){if(i=l&-l,i===r.callbackPriority)return i;switch(f!==null&&Ut(f),Nr(l)){case 2:case 8:l=me;break;case 32:l=He;break;case 268435456:l=Fe;break;default:l=He}return f=x2.bind(null,r),l=ft(l,f),r.callbackPriority=i,r.callbackNode=l,i}return f!==null&&f!==null&&Ut(f),r.callbackPriority=2,r.callbackNode=null,2}function x2(r,i){if($n!==0&&$n!==5)return r.callbackNode=null,r.callbackPriority=0,null;var l=r.callbackNode;if(Wc()&&r.callbackNode!==l)return null;var f=$t;return f=Q(r,r===ln?f:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),f===0?null:(t2(r,f,i),y2(r,Ue()),r.callbackNode!=null&&r.callbackNode===l?x2.bind(null,r):null)}function w2(r,i){if(Wc())return null;t2(r,i,!0)}function C8(){B8(function(){(Qt&6)!==0?ft(pe,T8):v2()})}function hf(){if(Ti===0){var r=Fs;r===0&&(r=je,je<<=1,(je&261888)===0&&(je=256)),Ti=r}return Ti}function k2(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:li(""+r)}function S2(r,i){var l=i.ownerDocument.createElement("input");return l.name=i.name,l.value=i.value,r.id&&l.setAttribute("form",r.id),i.parentNode.insertBefore(l,i),r=new FormData(r),l.parentNode.removeChild(l),r}function R8(r,i,l,f,g){if(i==="submit"&&l&&l.stateNode===g){var v=k2((g[Kn]||null).action),R=f.submitter;R&&(i=(i=R[Kn]||null)?k2(i.formAction):R.getAttribute("formAction"),i!==null&&(v=i,R=null));var L=new cc("action","action",null,f,g);r.push({event:L,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(Ti!==0){var ie=R?S2(g,R):new FormData(g);O0(l,{pending:!0,data:ie,method:g.method,action:v},null,ie)}}else typeof v=="function"&&(L.preventDefault(),ie=R?S2(g,R):new FormData(g),O0(l,{pending:!0,data:ie,method:g.method,action:v},v,ie))},currentTarget:g}]})}}for(var pf=0;pf<Zd.length;pf++){var gf=Zd[pf],N8=gf.toLowerCase(),A8=gf[0].toUpperCase()+gf.slice(1);sa(N8,"on"+A8)}sa(eg,"onAnimationEnd"),sa(tg,"onAnimationIteration"),sa(ng,"onAnimationStart"),sa("dblclick","onDoubleClick"),sa("focusin","onFocus"),sa("focusout","onBlur"),sa(Gx,"onTransitionRun"),sa(Vx,"onTransitionStart"),sa(Kx,"onTransitionCancel"),sa(rg,"onTransitionEnd"),_e("onMouseEnter",["mouseout","mouseover"]),_e("onMouseLeave",["mouseout","mouseover"]),_e("onPointerEnter",["pointerout","pointerover"]),_e("onPointerLeave",["pointerout","pointerover"]),Ar("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ar("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ar("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ar("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ar("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ar("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ol="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(" "),I8=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ol));function E2(r,i){i=(i&4)!==0;for(var l=0;l<r.length;l++){var f=r[l],g=f.event;f=f.listeners;e:{var v=void 0;if(i)for(var R=f.length-1;0<=R;R--){var L=f[R],ie=L.instance,ve=L.currentTarget;if(L=L.listener,ie!==v&&g.isPropagationStopped())break e;v=L,g.currentTarget=ve;try{v(g)}catch(Se){fc(Se)}g.currentTarget=null,v=ie}else for(R=0;R<f.length;R++){if(L=f[R],ie=L.instance,ve=L.currentTarget,L=L.listener,ie!==v&&g.isPropagationStopped())break e;v=L,g.currentTarget=ve;try{v(g)}catch(Se){fc(Se)}g.currentTarget=null,v=ie}}}}function Bt(r,i){var l=i[Aa];l===void 0&&(l=i[Aa]=new Set);var f=r+"__bubble";l.has(f)||(T2(i,r,2,!1),l.add(f))}function bf(r,i,l){var f=0;i&&(f|=4),T2(l,r,f,i)}var Qc="_reactListening"+Math.random().toString(36).slice(2);function vf(r){if(!r[Qc]){r[Qc]=!0,Ki.forEach(function(l){l!=="selectionchange"&&(I8.has(l)||bf(l,!1,r),bf(l,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[Qc]||(i[Qc]=!0,bf("selectionchange",!1,i))}}function T2(r,i,l,f){switch(eb(i)){case 2:var g=a9;break;case 8:g=i9;break;default:g=Of}l=g.bind(null,i,l,r),g=void 0,!zd||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(g=!0),f?g!==void 0?r.addEventListener(i,l,{capture:!0,passive:g}):r.addEventListener(i,l,!0):g!==void 0?r.addEventListener(i,l,{passive:g}):r.addEventListener(i,l,!1)}function yf(r,i,l,f,g){var v=f;if((i&1)===0&&(i&2)===0&&f!==null)e:for(;;){if(f===null)return;var R=f.tag;if(R===3||R===4){var L=f.stateNode.containerInfo;if(L===g)break;if(R===4)for(R=f.return;R!==null;){var ie=R.tag;if((ie===3||ie===4)&&R.stateNode.containerInfo===g)return;R=R.return}for(;L!==null;){if(R=Wn(L),R===null)return;if(ie=R.tag,ie===5||ie===6||ie===26||ie===27){f=v=R;continue e}L=L.parentNode}}f=f.return}ic(function(){var ve=v,Se=Et(l),Ce=[];e:{var ye=ag.get(r);if(ye!==void 0){var xe=cc,We=r;switch(r){case"keypress":if(oc(l)===0)break e;case"keydown":case"keyup":xe=Sx;break;case"focusin":We="focus",xe=Ud;break;case"focusout":We="blur",xe=Ud;break;case"beforeblur":case"afterblur":xe=Ud;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":xe=Op;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":xe=dx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":xe=Cx;break;case eg:case tg:case ng:xe=hx;break;case rg:xe=Nx;break;case"scroll":case"scrollend":xe=cx;break;case"wheel":xe=Ix;break;case"copy":case"cut":case"paste":xe=gx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":xe=jp;break;case"toggle":case"beforetoggle":xe=Mx}var ct=(i&4)!==0,on=!ct&&(r==="scroll"||r==="scrollend"),de=ct?ye!==null?ye+"Capture":null:ye;ct=[];for(var le=ve,ge;le!==null;){var Te=le;if(ge=Te.stateNode,Te=Te.tag,Te!==5&&Te!==26&&Te!==27||ge===null||de===null||(Te=Ao(le,de),Te!=null&&ct.push(ll(le,Te,ge))),on)break;le=le.return}0<ct.length&&(ye=new xe(ye,We,null,l,Se),Ce.push({event:ye,listeners:ct}))}}if((i&7)===0){e:{if(ye=r==="mouseover"||r==="pointerover",xe=r==="mouseout"||r==="pointerout",ye&&l!==Ze&&(We=l.relatedTarget||l.fromElement)&&(Wn(We)||We[da]))break e;if((xe||ye)&&(ye=Se.window===Se?Se:(ye=Se.ownerDocument)?ye.defaultView||ye.parentWindow:window,xe?(We=l.relatedTarget||l.toElement,xe=ve,We=We?Wn(We):null,We!==null&&(on=o(We),ct=We.tag,We!==on||ct!==5&&ct!==27&&ct!==6)&&(We=null)):(xe=null,We=ve),xe!==We)){if(ct=Op,Te="onMouseLeave",de="onMouseEnter",le="mouse",(r==="pointerout"||r==="pointerover")&&(ct=jp,Te="onPointerLeave",de="onPointerEnter",le="pointer"),on=xe==null?ye:ra(xe),ge=We==null?ye:ra(We),ye=new ct(Te,le+"leave",xe,l,Se),ye.target=on,ye.relatedTarget=ge,Te=null,Wn(Se)===ve&&(ct=new ct(de,le+"enter",We,l,Se),ct.target=ge,ct.relatedTarget=on,Te=ct),on=Te,xe&&We)t:{for(ct=_8,de=xe,le=We,ge=0,Te=de;Te;Te=ct(Te))ge++;Te=0;for(var rt=le;rt;rt=ct(rt))Te++;for(;0<ge-Te;)de=ct(de),ge--;for(;0<Te-ge;)le=ct(le),Te--;for(;ge--;){if(de===le||le!==null&&de===le.alternate){ct=de;break t}de=ct(de),le=ct(le)}ct=null}else ct=null;xe!==null&&C2(Ce,ye,xe,ct,!1),We!==null&&on!==null&&C2(Ce,on,We,ct,!0)}}e:{if(ye=ve?ra(ve):window,xe=ye.nodeName&&ye.nodeName.toLowerCase(),xe==="select"||xe==="input"&&ye.type==="file")var Wt=$p;else if(Up(ye))if(Pp)Wt=Fx;else{Wt=Hx;var Xe=qx}else xe=ye.nodeName,!xe||xe.toLowerCase()!=="input"||ye.type!=="checkbox"&&ye.type!=="radio"?ve&&oi(ve.elementType)&&(Wt=$p):Wt=Ux;if(Wt&&(Wt=Wt(r,ve))){Fp(Ce,Wt,l,Se);break e}Xe&&Xe(r,ye,ve),r==="focusout"&&ve&&ye.type==="number"&&ve.memoizedProps.value!=null&&_s(ye,"number",ye.value)}switch(Xe=ve?ra(ve):window,r){case"focusin":(Up(Xe)||Xe.contentEditable==="true")&&(Ds=Xe,Kd=ve,zo=null);break;case"focusout":zo=Kd=Ds=null;break;case"mousedown":Yd=!0;break;case"contextmenu":case"mouseup":case"dragend":Yd=!1,Qp(Ce,l,Se);break;case"selectionchange":if(Px)break;case"keydown":case"keyup":Qp(Ce,l,Se)}var At;if($d)e:{switch(r){case"compositionstart":var Pt="onCompositionStart";break e;case"compositionend":Pt="onCompositionEnd";break e;case"compositionupdate":Pt="onCompositionUpdate";break e}Pt=void 0}else Os?qp(r,l)&&(Pt="onCompositionEnd"):r==="keydown"&&l.keyCode===229&&(Pt="onCompositionStart");Pt&&(Lp&&l.locale!=="ko"&&(Os||Pt!=="onCompositionStart"?Pt==="onCompositionEnd"&&Os&&(At=_p()):(ci=Se,Bd="value"in ci?ci.value:ci.textContent,Os=!0)),Xe=Jc(ve,Pt),0<Xe.length&&(Pt=new Dp(Pt,r,null,l,Se),Ce.push({event:Pt,listeners:Xe}),At?Pt.data=At:(At=Hp(l),At!==null&&(Pt.data=At)))),(At=Dx?jx(r,l):Lx(r,l))&&(Pt=Jc(ve,"onBeforeInput"),0<Pt.length&&(Xe=new Dp("onBeforeInput","beforeinput",null,l,Se),Ce.push({event:Xe,listeners:Pt}),Xe.data=At)),R8(Ce,r,ve,l,Se)}E2(Ce,i)})}function ll(r,i,l){return{instance:r,listener:i,currentTarget:l}}function Jc(r,i){for(var l=i+"Capture",f=[];r!==null;){var g=r,v=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||v===null||(g=Ao(r,l),g!=null&&f.unshift(ll(r,g,v)),g=Ao(r,i),g!=null&&f.push(ll(r,g,v))),r.tag===3)return f;r=r.return}return[]}function _8(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function C2(r,i,l,f,g){for(var v=i._reactName,R=[];l!==null&&l!==f;){var L=l,ie=L.alternate,ve=L.stateNode;if(L=L.tag,ie!==null&&ie===f)break;L!==5&&L!==26&&L!==27||ve===null||(ie=ve,g?(ve=Ao(l,v),ve!=null&&R.unshift(ll(l,ve,ie))):g||(ve=Ao(l,v),ve!=null&&R.push(ll(l,ve,ie)))),l=l.return}R.length!==0&&r.push({event:i,listeners:R})}var M8=/\r\n?/g,O8=/\u0000|\uFFFD/g;function R2(r){return(typeof r=="string"?r:""+r).replace(M8,`
|
|
9
|
-
`).replace(O8,"")}function N2(r,i){return i=R2(i),R2(r)===i}function sn(r,i,l,f,g,v){switch(l){case"children":typeof f=="string"?i==="body"||i==="textarea"&&f===""||dt(r,f):(typeof f=="number"||typeof f=="bigint")&&i!=="body"&&dt(r,""+f);break;case"className":Lt(r,"class",f);break;case"tabIndex":Lt(r,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":Lt(r,l,f);break;case"style":tn(r,f,v);break;case"data":if(i!=="object"){Lt(r,"data",f);break}case"src":case"href":if(f===""&&(i!=="a"||l!=="href")){r.removeAttribute(l);break}if(f==null||typeof f=="function"||typeof f=="symbol"||typeof f=="boolean"){r.removeAttribute(l);break}f=li(""+f),r.setAttribute(l,f);break;case"action":case"formAction":if(typeof f=="function"){r.setAttribute(l,"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 v=="function"&&(l==="formAction"?(i!=="input"&&sn(r,i,"name",g.name,g,null),sn(r,i,"formEncType",g.formEncType,g,null),sn(r,i,"formMethod",g.formMethod,g,null),sn(r,i,"formTarget",g.formTarget,g,null)):(sn(r,i,"encType",g.encType,g,null),sn(r,i,"method",g.method,g,null),sn(r,i,"target",g.target,g,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){r.removeAttribute(l);break}f=li(""+f),r.setAttribute(l,f);break;case"onClick":f!=null&&(r.onclick=$e);break;case"onScroll":f!=null&&Bt("scroll",r);break;case"onScrollEnd":f!=null&&Bt("scrollend",r);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(a(61));if(l=f.__html,l!=null){if(g.children!=null)throw Error(a(60));r.innerHTML=l}}break;case"multiple":r.multiple=f&&typeof f!="function"&&typeof f!="symbol";break;case"muted":r.muted=f&&typeof f!="function"&&typeof f!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(f==null||typeof f=="function"||typeof f=="boolean"||typeof f=="symbol"){r.removeAttribute("xlink:href");break}l=li(""+f),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":f!=null&&typeof f!="function"&&typeof f!="symbol"?r.setAttribute(l,""+f):r.removeAttribute(l);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":f&&typeof f!="function"&&typeof f!="symbol"?r.setAttribute(l,""):r.removeAttribute(l);break;case"capture":case"download":f===!0?r.setAttribute(l,""):f!==!1&&f!=null&&typeof f!="function"&&typeof f!="symbol"?r.setAttribute(l,f):r.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":f!=null&&typeof f!="function"&&typeof f!="symbol"&&!isNaN(f)&&1<=f?r.setAttribute(l,f):r.removeAttribute(l);break;case"rowSpan":case"start":f==null||typeof f=="function"||typeof f=="symbol"||isNaN(f)?r.removeAttribute(l):r.setAttribute(l,f);break;case"popover":Bt("beforetoggle",r),Bt("toggle",r),vt(r,"popover",f);break;case"xlinkActuate":gn(r,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":gn(r,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":gn(r,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":gn(r,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":gn(r,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":gn(r,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":gn(r,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":gn(r,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":gn(r,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":vt(r,"is",f);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=Ia.get(l)||l,vt(r,l,f))}}function xf(r,i,l,f,g,v){switch(l){case"style":tn(r,f,v);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(a(61));if(l=f.__html,l!=null){if(g.children!=null)throw Error(a(60));r.innerHTML=l}}break;case"children":typeof f=="string"?dt(r,f):(typeof f=="number"||typeof f=="bigint")&&dt(r,""+f);break;case"onScroll":f!=null&&Bt("scroll",r);break;case"onScrollEnd":f!=null&&Bt("scrollend",r);break;case"onClick":f!=null&&(r.onclick=$e);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ma.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(g=l.endsWith("Capture"),i=l.slice(2,g?l.length-7:void 0),v=r[Kn]||null,v=v!=null?v[l]:null,typeof v=="function"&&r.removeEventListener(i,v,g),typeof f=="function")){typeof v!="function"&&v!==null&&(l in r?r[l]=null:r.hasAttribute(l)&&r.removeAttribute(l)),r.addEventListener(i,f,g);break e}l in r?r[l]=f:f===!0?r.setAttribute(l,""):vt(r,l,f)}}}function er(r,i,l){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Bt("error",r),Bt("load",r);var f=!1,g=!1,v;for(v in l)if(l.hasOwnProperty(v)){var R=l[v];if(R!=null)switch(v){case"src":f=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:sn(r,i,v,R,l,null)}}g&&sn(r,i,"srcSet",l.srcSet,l,null),f&&sn(r,i,"src",l.src,l,null);return;case"input":Bt("invalid",r);var L=v=R=g=null,ie=null,ve=null;for(f in l)if(l.hasOwnProperty(f)){var Se=l[f];if(Se!=null)switch(f){case"name":g=Se;break;case"type":R=Se;break;case"checked":ie=Se;break;case"defaultChecked":ve=Se;break;case"value":v=Se;break;case"defaultValue":L=Se;break;case"children":case"dangerouslySetInnerHTML":if(Se!=null)throw Error(a(137,i));break;default:sn(r,i,f,Se,l,null)}}Yi(r,v,L,ie,ve,R,g,!1);return;case"select":Bt("invalid",r),f=R=v=null;for(g in l)if(l.hasOwnProperty(g)&&(L=l[g],L!=null))switch(g){case"value":v=L;break;case"defaultValue":R=L;break;case"multiple":f=L;default:sn(r,i,g,L,l,null)}i=v,l=R,r.multiple=!!f,i!=null?Zn(r,!!f,i,!1):l!=null&&Zn(r,!!f,l,!0);return;case"textarea":Bt("invalid",r),v=g=f=null;for(R in l)if(l.hasOwnProperty(R)&&(L=l[R],L!=null))switch(R){case"value":f=L;break;case"defaultValue":g=L;break;case"children":v=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(a(91));break;default:sn(r,i,R,L,l,null)}Ms(r,f,g,v);return;case"option":for(ie in l)l.hasOwnProperty(ie)&&(f=l[ie],f!=null)&&(ie==="selected"?r.selected=f&&typeof f!="function"&&typeof f!="symbol":sn(r,i,ie,f,l,null));return;case"dialog":Bt("beforetoggle",r),Bt("toggle",r),Bt("cancel",r),Bt("close",r);break;case"iframe":case"object":Bt("load",r);break;case"video":case"audio":for(f=0;f<ol.length;f++)Bt(ol[f],r);break;case"image":Bt("error",r),Bt("load",r);break;case"details":Bt("toggle",r);break;case"embed":case"source":case"link":Bt("error",r),Bt("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(ve in l)if(l.hasOwnProperty(ve)&&(f=l[ve],f!=null))switch(ve){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:sn(r,i,ve,f,l,null)}return;default:if(oi(i)){for(Se in l)l.hasOwnProperty(Se)&&(f=l[Se],f!==void 0&&xf(r,i,Se,f,l,void 0));return}}for(L in l)l.hasOwnProperty(L)&&(f=l[L],f!=null&&sn(r,i,L,f,l,null))}function D8(r,i,l,f){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,v=null,R=null,L=null,ie=null,ve=null,Se=null;for(xe in l){var Ce=l[xe];if(l.hasOwnProperty(xe)&&Ce!=null)switch(xe){case"checked":break;case"value":break;case"defaultValue":ie=Ce;default:f.hasOwnProperty(xe)||sn(r,i,xe,null,f,Ce)}}for(var ye in f){var xe=f[ye];if(Ce=l[ye],f.hasOwnProperty(ye)&&(xe!=null||Ce!=null))switch(ye){case"type":v=xe;break;case"name":g=xe;break;case"checked":ve=xe;break;case"defaultChecked":Se=xe;break;case"value":R=xe;break;case"defaultValue":L=xe;break;case"children":case"dangerouslySetInnerHTML":if(xe!=null)throw Error(a(137,i));break;default:xe!==Ce&&sn(r,i,ye,xe,f,Ce)}}Co(r,R,L,ie,ve,Se,v,g);return;case"select":xe=R=L=ye=null;for(v in l)if(ie=l[v],l.hasOwnProperty(v)&&ie!=null)switch(v){case"value":break;case"multiple":xe=ie;default:f.hasOwnProperty(v)||sn(r,i,v,null,f,ie)}for(g in f)if(v=f[g],ie=l[g],f.hasOwnProperty(g)&&(v!=null||ie!=null))switch(g){case"value":ye=v;break;case"defaultValue":L=v;break;case"multiple":R=v;default:v!==ie&&sn(r,i,g,v,f,ie)}i=L,l=R,f=xe,ye!=null?Zn(r,!!l,ye,!1):!!f!=!!l&&(i!=null?Zn(r,!!l,i,!0):Zn(r,!!l,l?[]:"",!1));return;case"textarea":xe=ye=null;for(L in l)if(g=l[L],l.hasOwnProperty(L)&&g!=null&&!f.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:sn(r,i,L,null,f,g)}for(R in f)if(g=f[R],v=l[R],f.hasOwnProperty(R)&&(g!=null||v!=null))switch(R){case"value":ye=g;break;case"defaultValue":xe=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(a(91));break;default:g!==v&&sn(r,i,R,g,f,v)}rc(r,ye,xe);return;case"option":for(var We in l)ye=l[We],l.hasOwnProperty(We)&&ye!=null&&!f.hasOwnProperty(We)&&(We==="selected"?r.selected=!1:sn(r,i,We,null,f,ye));for(ie in f)ye=f[ie],xe=l[ie],f.hasOwnProperty(ie)&&ye!==xe&&(ye!=null||xe!=null)&&(ie==="selected"?r.selected=ye&&typeof ye!="function"&&typeof ye!="symbol":sn(r,i,ie,ye,f,xe));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 ct in l)ye=l[ct],l.hasOwnProperty(ct)&&ye!=null&&!f.hasOwnProperty(ct)&&sn(r,i,ct,null,f,ye);for(ve in f)if(ye=f[ve],xe=l[ve],f.hasOwnProperty(ve)&&ye!==xe&&(ye!=null||xe!=null))switch(ve){case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(a(137,i));break;default:sn(r,i,ve,ye,f,xe)}return;default:if(oi(i)){for(var on in l)ye=l[on],l.hasOwnProperty(on)&&ye!==void 0&&!f.hasOwnProperty(on)&&xf(r,i,on,void 0,f,ye);for(Se in f)ye=f[Se],xe=l[Se],!f.hasOwnProperty(Se)||ye===xe||ye===void 0&&xe===void 0||xf(r,i,Se,ye,f,xe);return}}for(var de in l)ye=l[de],l.hasOwnProperty(de)&&ye!=null&&!f.hasOwnProperty(de)&&sn(r,i,de,null,f,ye);for(Ce in f)ye=f[Ce],xe=l[Ce],!f.hasOwnProperty(Ce)||ye===xe||ye==null&&xe==null||sn(r,i,Ce,ye,f,xe)}function A2(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function j8(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,l=performance.getEntriesByType("resource"),f=0;f<l.length;f++){var g=l[f],v=g.transferSize,R=g.initiatorType,L=g.duration;if(v&&L&&A2(R)){for(R=0,L=g.responseEnd,f+=1;f<l.length;f++){var ie=l[f],ve=ie.startTime;if(ve>L)break;var Se=ie.transferSize,Ce=ie.initiatorType;Se&&A2(Ce)&&(ie=ie.responseEnd,R+=Se*(ie<L?1:(L-ve)/(ie-ve)))}if(--f,i+=8*(v+R)/(g.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 wf=null,kf=null;function eu(r){return r.nodeType===9?r:r.ownerDocument}function I2(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 _2(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 Sf(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 Ef=null;function L8(){var r=window.event;return r&&r.type==="popstate"?r===Ef?!1:(Ef=r,!0):(Ef=null,!1)}var M2=typeof setTimeout=="function"?setTimeout:void 0,z8=typeof clearTimeout=="function"?clearTimeout:void 0,O2=typeof Promise=="function"?Promise:void 0,B8=typeof queueMicrotask=="function"?queueMicrotask:typeof O2<"u"?function(r){return O2.resolve(null).then(r).catch(q8)}:M2;function q8(r){setTimeout(function(){throw r})}function Ci(r){return r==="head"}function D2(r,i){var l=i,f=0;do{var g=l.nextSibling;if(r.removeChild(l),g&&g.nodeType===8)if(l=g.data,l==="/$"||l==="/&"){if(f===0){r.removeChild(g),oo(i);return}f--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")f++;else if(l==="html")cl(r.ownerDocument.documentElement);else if(l==="head"){l=r.ownerDocument.head,cl(l);for(var v=l.firstChild;v;){var R=v.nextSibling,L=v.nodeName;v[fa]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&v.rel.toLowerCase()==="stylesheet"||l.removeChild(v),v=R}}else l==="body"&&cl(r.ownerDocument.body);l=g}while(l);oo(i)}function j2(r,i){var l=r;r=0;do{var f=l.nextSibling;if(l.nodeType===1?i?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(i?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),f&&f.nodeType===8)if(l=f.data,l==="/$"){if(r===0)break;r--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||r++;l=f}while(l)}function Tf(r){var i=r.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var l=i;switch(i=i.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Tf(l),si(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}r.removeChild(l)}}function H8(r,i,l,f){for(;r.nodeType===1;){var g=l;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!f&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(f){if(!r[fa])switch(i){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(v=r.getAttribute("rel"),v==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(v!==g.rel||r.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||r.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||r.getAttribute("title")!==(g.title==null?null:g.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(v=r.getAttribute("src"),(v!==(g.src==null?null:g.src)||r.getAttribute("type")!==(g.type==null?null:g.type)||r.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&v&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(i==="input"&&r.type==="hidden"){var v=g.name==null?null:""+g.name;if(g.type==="hidden"&&r.getAttribute("name")===v)return r}else return r;if(r=Zr(r.nextSibling),r===null)break}return null}function U8(r,i,l){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!l||(r=Zr(r.nextSibling),r===null))return null;return r}function L2(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=Zr(r.nextSibling),r===null))return null;return r}function Cf(r){return r.data==="$?"||r.data==="$~"}function Rf(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function F8(r,i){var l=r.ownerDocument;if(r.data==="$~")r._reactRetry=i;else if(r.data!=="$?"||l.readyState!=="loading")i();else{var f=function(){i(),l.removeEventListener("DOMContentLoaded",f)};l.addEventListener("DOMContentLoaded",f),r._reactRetry=f}}function Zr(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 Nf=null;function z2(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var l=r.data;if(l==="/$"||l==="/&"){if(i===0)return Zr(r.nextSibling);i--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||i++}r=r.nextSibling}return null}function B2(r){r=r.previousSibling;for(var i=0;r;){if(r.nodeType===8){var l=r.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(i===0)return r;i--}else l!=="/$"&&l!=="/&"||i++}r=r.previousSibling}return null}function q2(r,i,l){switch(i=eu(l),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 cl(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);si(r)}var Xr=new Map,H2=new Set;function tu(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var Va=Y.d;Y.d={f:$8,r:P8,D:G8,C:V8,L:K8,m:Y8,X:Z8,S:W8,M:X8};function $8(){var r=Va.f(),i=Vc();return r||i}function P8(r){var i=ir(r);i!==null&&i.tag===5&&i.type==="form"?r4(i):Va.r(r)}var ao=typeof document>"u"?null:document;function U2(r,i,l){var f=ao;if(f&&typeof i=="string"&&i){var g=gr(i);g='link[rel="'+r+'"][href="'+g+'"]',typeof l=="string"&&(g+='[crossorigin="'+l+'"]'),H2.has(g)||(H2.add(g),r={rel:r,crossOrigin:l,href:i},f.querySelector(g)===null&&(i=f.createElement("link"),er(i,"link",r),wn(i),f.head.appendChild(i)))}}function G8(r){Va.D(r),U2("dns-prefetch",r,null)}function V8(r,i){Va.C(r,i),U2("preconnect",r,i)}function K8(r,i,l){Va.L(r,i,l);var f=ao;if(f&&r&&i){var g='link[rel="preload"][as="'+gr(i)+'"]';i==="image"&&l&&l.imageSrcSet?(g+='[imagesrcset="'+gr(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(g+='[imagesizes="'+gr(l.imageSizes)+'"]')):g+='[href="'+gr(r)+'"]';var v=g;switch(i){case"style":v=io(r);break;case"script":v=so(r)}Xr.has(v)||(r=b({rel:"preload",href:i==="image"&&l&&l.imageSrcSet?void 0:r,as:i},l),Xr.set(v,r),f.querySelector(g)!==null||i==="style"&&f.querySelector(ul(v))||i==="script"&&f.querySelector(dl(v))||(i=f.createElement("link"),er(i,"link",r),wn(i),f.head.appendChild(i)))}}function Y8(r,i){Va.m(r,i);var l=ao;if(l&&r){var f=i&&typeof i.as=="string"?i.as:"script",g='link[rel="modulepreload"][as="'+gr(f)+'"][href="'+gr(r)+'"]',v=g;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=so(r)}if(!Xr.has(v)&&(r=b({rel:"modulepreload",href:r},i),Xr.set(v,r),l.querySelector(g)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(dl(v)))return}f=l.createElement("link"),er(f,"link",r),wn(f),l.head.appendChild(f)}}}function W8(r,i,l){Va.S(r,i,l);var f=ao;if(f&&r){var g=aa(f).hoistableStyles,v=io(r);i=i||"default";var R=g.get(v);if(!R){var L={loading:0,preload:null};if(R=f.querySelector(ul(v)))L.loading=5;else{r=b({rel:"stylesheet",href:r,"data-precedence":i},l),(l=Xr.get(v))&&Af(r,l);var ie=R=f.createElement("link");wn(ie),er(ie,"link",r),ie._p=new Promise(function(ve,Se){ie.onload=ve,ie.onerror=Se}),ie.addEventListener("load",function(){L.loading|=1}),ie.addEventListener("error",function(){L.loading|=2}),L.loading|=4,nu(R,i,f)}R={type:"stylesheet",instance:R,count:1,state:L},g.set(v,R)}}}function Z8(r,i){Va.X(r,i);var l=ao;if(l&&r){var f=aa(l).hoistableScripts,g=so(r),v=f.get(g);v||(v=l.querySelector(dl(g)),v||(r=b({src:r,async:!0},i),(i=Xr.get(g))&&If(r,i),v=l.createElement("script"),wn(v),er(v,"link",r),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},f.set(g,v))}}function X8(r,i){Va.M(r,i);var l=ao;if(l&&r){var f=aa(l).hoistableScripts,g=so(r),v=f.get(g);v||(v=l.querySelector(dl(g)),v||(r=b({src:r,async:!0,type:"module"},i),(i=Xr.get(g))&&If(r,i),v=l.createElement("script"),wn(v),er(v,"link",r),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},f.set(g,v))}}function F2(r,i,l,f){var g=(g=V.current)?tu(g):null;if(!g)throw Error(a(446));switch(r){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(i=io(l.href),l=aa(g).hoistableStyles,f=l.get(i),f||(f={type:"style",instance:null,count:0,state:null},l.set(i,f)),f):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){r=io(l.href);var v=aa(g).hoistableStyles,R=v.get(r);if(R||(g=g.ownerDocument||g,R={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,R),(v=g.querySelector(ul(r)))&&!v._p&&(R.instance=v,R.state.loading=5),Xr.has(r)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Xr.set(r,l),v||Q8(g,r,l,R.state))),i&&f===null)throw Error(a(528,""));return R}if(i&&f!==null)throw Error(a(529,""));return null;case"script":return i=l.async,l=l.src,typeof l=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=so(l),l=aa(g).hoistableScripts,f=l.get(i),f||(f={type:"script",instance:null,count:0,state:null},l.set(i,f)),f):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function io(r){return'href="'+gr(r)+'"'}function ul(r){return'link[rel="stylesheet"]['+r+"]"}function $2(r){return b({},r,{"data-precedence":r.precedence,precedence:null})}function Q8(r,i,l,f){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?f.loading=1:(i=r.createElement("link"),f.preload=i,i.addEventListener("load",function(){return f.loading|=1}),i.addEventListener("error",function(){return f.loading|=2}),er(i,"link",l),wn(i),r.head.appendChild(i))}function so(r){return'[src="'+gr(r)+'"]'}function dl(r){return"script[async]"+r}function P2(r,i,l){if(i.count++,i.instance===null)switch(i.type){case"style":var f=r.querySelector('style[data-href~="'+gr(l.href)+'"]');if(f)return i.instance=f,wn(f),f;var g=b({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return f=(r.ownerDocument||r).createElement("style"),wn(f),er(f,"style",g),nu(f,l.precedence,r),i.instance=f;case"stylesheet":g=io(l.href);var v=r.querySelector(ul(g));if(v)return i.state.loading|=4,i.instance=v,wn(v),v;f=$2(l),(g=Xr.get(g))&&Af(f,g),v=(r.ownerDocument||r).createElement("link"),wn(v);var R=v;return R._p=new Promise(function(L,ie){R.onload=L,R.onerror=ie}),er(v,"link",f),i.state.loading|=4,nu(v,l.precedence,r),i.instance=v;case"script":return v=so(l.src),(g=r.querySelector(dl(v)))?(i.instance=g,wn(g),g):(f=l,(g=Xr.get(v))&&(f=b({},l),If(f,g)),r=r.ownerDocument||r,g=r.createElement("script"),wn(g),er(g,"link",f),r.head.appendChild(g),i.instance=g);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(f=i.instance,i.state.loading|=4,nu(f,l.precedence,r));return i.instance}function nu(r,i,l){for(var f=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=f.length?f[f.length-1]:null,v=g,R=0;R<f.length;R++){var L=f[R];if(L.dataset.precedence===i)v=L;else if(v!==g)break}v?v.parentNode.insertBefore(r,v.nextSibling):(i=l.nodeType===9?l.head:l,i.insertBefore(r,i.firstChild))}function Af(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function If(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var ru=null;function G2(r,i,l){if(ru===null){var f=new Map,g=ru=new Map;g.set(l,f)}else g=ru,f=g.get(l),f||(f=new Map,g.set(l,f));if(f.has(r))return f;for(f.set(r,null),l=l.getElementsByTagName(r),g=0;g<l.length;g++){var v=l[g];if(!(v[fa]||v[xn]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var R=v.getAttribute(i)||"";R=r+R;var L=f.get(R);L?L.push(v):f.set(R,[v])}}return f}function V2(r,i,l){r=r.ownerDocument||r,r.head.insertBefore(l,i==="title"?r.querySelector("head > title"):null)}function J8(r,i,l){if(l===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;return i.rel==="stylesheet"?(r=i.disabled,typeof i.precedence=="string"&&r==null):!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 K2(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function e9(r,i,l,f){if(l.type==="stylesheet"&&(typeof f.media!="string"||matchMedia(f.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var g=io(f.href),v=i.querySelector(ul(g));if(v){i=v._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=au.bind(r),i.then(r,r)),l.state.loading|=4,l.instance=v,wn(v);return}v=i.ownerDocument||i,f=$2(f),(g=Xr.get(g))&&Af(f,g),v=v.createElement("link"),wn(v);var R=v;R._p=new Promise(function(L,ie){R.onload=L,R.onerror=ie}),er(v,"link",f),l.instance=v}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(l,i),(i=l.state.preload)&&(l.state.loading&3)===0&&(r.count++,l=au.bind(r),i.addEventListener("load",l),i.addEventListener("error",l))}}var _f=0;function t9(r,i){return r.stylesheets&&r.count===0&&su(r,r.stylesheets),0<r.count||0<r.imgCount?function(l){var f=setTimeout(function(){if(r.stylesheets&&su(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+i);0<r.imgBytes&&_f===0&&(_f=62500*j8());var g=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&su(r,r.stylesheets),r.unsuspend)){var v=r.unsuspend;r.unsuspend=null,v()}},(r.imgBytes>_f?50:800)+i);return r.unsuspend=l,function(){r.unsuspend=null,clearTimeout(f),clearTimeout(g)}}:null}function au(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)su(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var iu=null;function su(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,iu=new Map,i.forEach(n9,r),iu=null,au.call(r))}function n9(r,i){if(!(i.state.loading&4)){var l=iu.get(r);if(l)var f=l.get(null);else{l=new Map,iu.set(r,l);for(var g=r.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<g.length;v++){var R=g[v];(R.nodeName==="LINK"||R.getAttribute("media")!=="not all")&&(l.set(R.dataset.precedence,R),f=R)}f&&l.set(null,f)}g=i.instance,R=g.getAttribute("data-precedence"),v=l.get(R)||f,v===f&&l.set(null,g),l.set(R,g),this.count++,f=au.bind(this),g.addEventListener("load",f),g.addEventListener("error",f),v?v.parentNode.insertBefore(g,v.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(g,r.firstChild)),i.state.loading|=4}}var fl={$$typeof:I,Provider:null,Consumer:null,_currentValue:re,_currentValue2:re,_threadCount:0};function r9(r,i,l,f,g,v,R,L,ie){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=St(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=St(0),this.hiddenUpdates=St(null),this.identifierPrefix=f,this.onUncaughtError=g,this.onCaughtError=v,this.onRecoverableError=R,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ie,this.incompleteTransitions=new Map}function Y2(r,i,l,f,g,v,R,L,ie,ve,Se,Ce){return r=new r9(r,i,l,R,ie,ve,Se,Ce,L),i=1,v===!0&&(i|=24),v=_r(3,null,null,i),r.current=v,v.stateNode=r,i=c0(),i.refCount++,r.pooledCache=i,i.refCount++,v.memoizedState={element:f,isDehydrated:l,cache:i},m0(v),r}function W2(r){return r?(r=zs,r):zs}function Z2(r,i,l,f,g,v){g=W2(g),f.context===null?f.context=g:f.pendingContext=g,f=pi(i),f.payload={element:l},v=v===void 0?null:v,v!==null&&(f.callback=v),l=gi(r,f,i),l!==null&&(kr(l,r,i),Po(l,r,i))}function X2(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var l=r.retryLane;r.retryLane=l!==0&&l<i?l:i}}function Mf(r,i){X2(r,i),(r=r.alternate)&&X2(r,i)}function Q2(r){if(r.tag===13||r.tag===31){var i=Qi(r,67108864);i!==null&&kr(i,r,67108864),Mf(r,67108864)}}function J2(r){if(r.tag===13||r.tag===31){var i=Lr();i=Yt(i);var l=Qi(r,i);l!==null&&kr(l,r,i),Mf(r,i)}}var ou=!0;function a9(r,i,l,f){var g=_.T;_.T=null;var v=Y.p;try{Y.p=2,Of(r,i,l,f)}finally{Y.p=v,_.T=g}}function i9(r,i,l,f){var g=_.T;_.T=null;var v=Y.p;try{Y.p=8,Of(r,i,l,f)}finally{Y.p=v,_.T=g}}function Of(r,i,l,f){if(ou){var g=Df(f);if(g===null)yf(r,i,f,lu,l),tb(r,f);else if(o9(g,r,i,l,f))f.stopPropagation();else if(tb(r,f),i&4&&-1<s9.indexOf(r)){for(;g!==null;){var v=ir(g);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var R=Gt(v.pendingLanes);if(R!==0){var L=v;for(L.pendingLanes|=2,L.entangledLanes|=2;R;){var ie=1<<31-Tt(R);L.entanglements[1]|=ie,R&=~ie}ba(v),(Qt&6)===0&&(Pc=Ue()+500,sl(0))}}break;case 31:case 13:L=Qi(v,2),L!==null&&kr(L,v,2),Vc(),Mf(v,2)}if(v=Df(f),v===null&&yf(r,i,f,lu,l),v===g)break;g=v}g!==null&&f.stopPropagation()}else yf(r,i,f,null,l)}}function Df(r){return r=Et(r),jf(r)}var lu=null;function jf(r){if(lu=null,r=Wn(r),r!==null){var i=o(r);if(i===null)r=null;else{var l=i.tag;if(l===13){if(r=c(i),r!==null)return r;r=null}else if(l===31){if(r=d(i),r!==null)return r;r=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null)}}return lu=r,null}function eb(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(mt()){case pe:return 2;case me:return 8;case He:case we:return 32;case Fe:return 268435456;default:return 32}default:return 32}}var Lf=!1,Ri=null,Ni=null,Ai=null,ml=new Map,hl=new Map,Ii=[],s9="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 tb(r,i){switch(r){case"focusin":case"focusout":Ri=null;break;case"dragenter":case"dragleave":Ni=null;break;case"mouseover":case"mouseout":Ai=null;break;case"pointerover":case"pointerout":ml.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":hl.delete(i.pointerId)}}function pl(r,i,l,f,g,v){return r===null||r.nativeEvent!==v?(r={blockedOn:i,domEventName:l,eventSystemFlags:f,nativeEvent:v,targetContainers:[g]},i!==null&&(i=ir(i),i!==null&&Q2(i)),r):(r.eventSystemFlags|=f,i=r.targetContainers,g!==null&&i.indexOf(g)===-1&&i.push(g),r)}function o9(r,i,l,f,g){switch(i){case"focusin":return Ri=pl(Ri,r,i,l,f,g),!0;case"dragenter":return Ni=pl(Ni,r,i,l,f,g),!0;case"mouseover":return Ai=pl(Ai,r,i,l,f,g),!0;case"pointerover":var v=g.pointerId;return ml.set(v,pl(ml.get(v)||null,r,i,l,f,g)),!0;case"gotpointercapture":return v=g.pointerId,hl.set(v,pl(hl.get(v)||null,r,i,l,f,g)),!0}return!1}function nb(r){var i=Wn(r.target);if(i!==null){var l=o(i);if(l!==null){if(i=l.tag,i===13){if(i=c(l),i!==null){r.blockedOn=i,Na(r.priority,function(){J2(l)});return}}else if(i===31){if(i=d(l),i!==null){r.blockedOn=i,Na(r.priority,function(){J2(l)});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){r.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}r.blockedOn=null}function cu(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var l=Df(r.nativeEvent);if(l===null){l=r.nativeEvent;var f=new l.constructor(l.type,l);Ze=f,l.target.dispatchEvent(f),Ze=null}else return i=ir(l),i!==null&&Q2(i),r.blockedOn=l,!1;i.shift()}return!0}function rb(r,i,l){cu(r)&&l.delete(i)}function l9(){Lf=!1,Ri!==null&&cu(Ri)&&(Ri=null),Ni!==null&&cu(Ni)&&(Ni=null),Ai!==null&&cu(Ai)&&(Ai=null),ml.forEach(rb),hl.forEach(rb)}function uu(r,i){r.blockedOn===i&&(r.blockedOn=null,Lf||(Lf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,l9)))}var du=null;function ab(r){du!==r&&(du=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){du===r&&(du=null);for(var i=0;i<r.length;i+=3){var l=r[i],f=r[i+1],g=r[i+2];if(typeof f!="function"){if(jf(f||l)===null)continue;break}var v=ir(l);v!==null&&(r.splice(i,3),i-=3,O0(v,{pending:!0,data:g,method:l.method,action:f},f,g))}}))}function oo(r){function i(ie){return uu(ie,r)}Ri!==null&&uu(Ri,r),Ni!==null&&uu(Ni,r),Ai!==null&&uu(Ai,r),ml.forEach(i),hl.forEach(i);for(var l=0;l<Ii.length;l++){var f=Ii[l];f.blockedOn===r&&(f.blockedOn=null)}for(;0<Ii.length&&(l=Ii[0],l.blockedOn===null);)nb(l),l.blockedOn===null&&Ii.shift();if(l=(r.ownerDocument||r).$$reactFormReplay,l!=null)for(f=0;f<l.length;f+=3){var g=l[f],v=l[f+1],R=g[Kn]||null;if(typeof v=="function")R||ab(l);else if(R){var L=null;if(v&&v.hasAttribute("formAction")){if(g=v,R=v[Kn]||null)L=R.formAction;else if(jf(g)!==null)continue}else L=R.action;typeof L=="function"?l[f+1]=L:(l.splice(f,3),f-=3),ab(l)}}}function ib(){function r(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(R){return g=R})},focusReset:"manual",scroll:"manual"})}function i(){g!==null&&(g(),g=null),f||setTimeout(l,20)}function l(){if(!f&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var f=!1,g=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(l,100),function(){f=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),g!==null&&(g(),g=null)}}}function zf(r){this._internalRoot=r}fu.prototype.render=zf.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var l=i.current,f=Lr();Z2(l,f,r,i,null,null)},fu.prototype.unmount=zf.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;Z2(r.current,2,null,r,null,null),Vc(),i[da]=null}};function fu(r){this._internalRoot=r}fu.prototype.unstable_scheduleHydration=function(r){if(r){var i=na();r={blockedOn:null,target:r,priority:i};for(var l=0;l<Ii.length&&i!==0&&i<Ii[l].priority;l++);Ii.splice(l,0,r),l===0&&nb(r)}};var sb=t.version;if(sb!=="19.2.8")throw Error(a(527,sb,"19.2.8"));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=h(i),r=r!==null?p(r):null,r=r===null?null:r.stateNode,r};var c9={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:_,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var mu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!mu.isDisabled&&mu.supportsFiber)try{Kt=mu.inject(c9),gt=mu}catch{}}return bl.createRoot=function(r,i){if(!s(r))throw Error(a(299));var l=!1,f="",g=m4,v=h4,R=p4;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(f=i.identifierPrefix),i.onUncaughtError!==void 0&&(g=i.onUncaughtError),i.onCaughtError!==void 0&&(v=i.onCaughtError),i.onRecoverableError!==void 0&&(R=i.onRecoverableError)),i=Y2(r,1,!1,null,null,l,f,null,g,v,R,ib),r[da]=i.current,vf(r),new zf(i)},bl.hydrateRoot=function(r,i,l){if(!s(r))throw Error(a(299));var f=!1,g="",v=m4,R=h4,L=p4,ie=null;return l!=null&&(l.unstable_strictMode===!0&&(f=!0),l.identifierPrefix!==void 0&&(g=l.identifierPrefix),l.onUncaughtError!==void 0&&(v=l.onUncaughtError),l.onCaughtError!==void 0&&(R=l.onCaughtError),l.onRecoverableError!==void 0&&(L=l.onRecoverableError),l.formState!==void 0&&(ie=l.formState)),i=Y2(r,1,!0,i,l??null,f,g,ie,v,R,L,ib),i.context=W2(null),l=i.current,f=Lr(),f=Yt(f),g=pi(f),g.callback=null,gi(l,g,f),l=f,i.current.lanes=l,jt(i,l),ba(i),r[da]=i.current,vf(r),new fu(i)},bl.version="19.2.8",bl}var gb;function v9(){if(gb)return Hf.exports;gb=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(),Hf.exports=b9(),Hf.exports}var y9=v9();const Al={"worker-managed-rerun-unsupported":"这次运行由 Console/Worker 启动,不能只从某个节点续跑","workspace-drift":"工作区在上次运行后又改过文件,旧结果不能接着用","controller-drift":"控制器版本已变化,不能接到上次运行上继续","binding-drift":"任务契约或源文件已变化,不能只续跑旧计划","restart-subgraph-contains-unsafe-shell":"下游包含会执行命令的验证步骤,不能只重跑这一段","restart-subgraph-contains-writer":"下游包含会改代码的写入步骤,不能只重跑这一段","restart-subgraph-contains-decision-gate":"下游包含需要人工决策的门禁,不能只重跑这一段","dynamic-rerun-unsupported":"这次运行含动态展开节点,不支持从节点续跑","parent-lifecycle-ineligible":"当前运行状态不允许从节点续跑","convergence-rerun-unsupported":"收敛型运行不支持从节点续跑","evaluation-rerun-unsupported":"带评估的运行不支持从节点续跑","budget-rerun-unsupported":"硬预算运行不支持从节点续跑","workspace-checkpoint-missing":"缺少工作区快照,无法安全地只续跑一段","skill-snapshot-invalid":"技能快照缺失或损坏,不能接到上次运行上继续","unresolved-errors-outside-reset-closure":"选中节点之外还有未解决的失败,只重跑这一段不够","selected-node-missing":"找不到要续跑的起始节点","ambiguous-skipped-rewrite":"跳过的节点有多个上游失败,无法自动选定起点","skipped-without-upstream-error":"该节点被跳过且没有明确的上游失败","parent-facts-invalid":"上次运行的证据不完整或已损坏,不能只续跑一段",RUN_NOT_ACTIVE:"这次运行不在活动状态,不能协作中止",RUN_NOT_CONSOLE_OWNED:"此运行不由当前 Console 持有,暂不支持协作中止",RUNNER_IDENTITY_MISMATCH:"运行身份已变化,不能中止这份过期请求",INTERRUPT_ALREADY_PENDING:"已有一条中止请求等待结算",RUN_ALREADY_TERMINAL:"运行已经结束,没有可中止的活 runner",INTERRUPT_NEEDS_RECONCILE:"中止请求已登记但无法确认 runner 已处理,需要对账"};function x9(){return Object.keys(Al)}function Bu(e){const t=e.trim().replace(/[.…]+$/,"");if(!t)return null;if(Al[t])return{code:t};const n=t.lastIndexOf(":");if(n>0){const a=t.slice(n+1),s=t.slice(0,n);if(Al[a])return{code:a,nodeId:s};const o=x9().find(c=>a.length>=3&&c.startsWith(a));if(o)return{code:o,nodeId:s}}return Al[t]?{code:t}:null}function w9(e){const t=[];for(const n of e.blockedReasons??[]){const a=Bu(String(n));a&&t.push(a)}for(const n of e.blockingNodes??[]){const a=n.reasonCode?.trim();if(!a)continue;const s=Bu(n.nodeId?`${n.nodeId}:${a}`:a);s&&t.push(s)}if(t.length===0&&e.fallbackMessage?.trim()){const n=e.fallbackMessage.trim().replace(/^从节点重跑不具备安全资格[::]?\s*/,"").replace(/[。..]+$/,"");for(const a of n.split(/[;;]/)){const s=Bu(a);s&&t.push(s)}}return t}function k9(e){const t=new Map;for(const a of e){const s=t.get(a.code)??[];a.nodeId&&!s.includes(a.nodeId)&&s.push(a.nodeId),t.set(a.code,s)}const n=[];for(const[a,s]of t){const o=Al[a];o&&(s.length>0&&a.startsWith("restart-subgraph-contains-")?n.push(`${o}(${s.join("、")})`):n.push(o))}return n}function S9(e){return e.join("; ").includes("worker-managed-rerun-unsupported")||e.some(n=>Bu(n)?.code==="worker-managed-rerun-unsupported")?"下一步:请点下方「重新排队 Worker Task」,从头完整执行。":"下一步:请改用「带反馈重新执行任务」,重新生成完整 DAG。"}function G3(e){const t=e.fallbackMessage?.trim();if(t?.startsWith("无法从该节点续跑"))return t;const n=w9(e),a=k9(n),s=n.map(c=>c.code),o=S9(s.length>0?s:[t??""]);return a.length===0?["无法从该节点续跑。这次续跑不够安全(工作区、控制器或下游步骤不允许只重跑一段)。",o].join(`
|
|
10
|
-
`):["无法从该节点续跑,因为:",...a.map(c=>`• ${c}`),"",o].join(`
|
|
11
|
-
`)}function E9(e){const t=e.trim();if(!t)return null;if(t.startsWith("无法从该节点续跑"))return t;if(/从节点重跑不具备安全资格|worker-managed-rerun-unsupported|restart-subgraph-contains-|workspace-drift|controller-drift|binding-drift/.test(t))return G3({fallbackMessage:t});if(/action must be a mutation-gate target/i.test(t))return"这个操作不能再走确认门。Worker 启动的任务请直接点「重新排队 Worker Task」;独立运行请点「带反馈重新执行任务」。";if(/cannot read dagReport run facts/i.test(t))return"读不到这次运行的失败报告,不能完整重跑。请先点「查看报告」或「Doctor 诊断」。";if(/dagRerunPlan run facts unavailable/i.test(t))return"读不到节点恢复资格,不能直接改走完整重跑。请先点「从失败节点恢复」查看资格,或先「查看报告」。";if(/node rerun plan is eligible/i.test(t))return"节点恢复是安全的,请改用「从失败节点恢复」,不必重新执行完整任务。";if(/does not support autonomous standaloneTaskRerun/i.test(t))return"当前失败不适合自动完整重跑。请先点「查看报告」,按建议操作。";if(/primaryRecovery requires a human decision/i.test(t))return"这次失败需要人工决策,不能自动重跑。请先点「查看报告」。";if(/is not bound to run/i.test(t))return"填写的任务 ID 与这次运行不匹配。请使用该运行绑定的原任务 ID。";if(/cannot read pool doctor/i.test(t))return"读不到任务队列状态,暂时不能重新排队。请稍后重试,或先跑 Doctor 诊断。";if(/not found in the pool doctor inventory/i.test(t))return"任务队列里找不到这个任务,不能重新排队。请确认 Task ID 来自 Worker 队列,而不是只填了 DAG 运行 ID。";if(/only Failed tasks are retry-eligible/i.test(t)){const n=t.match(/is ([A-Za-z_]+); only Failed/)?.[1];return n?`该任务当前是「${n}」,只有失败(Failed)的任务才能重新排队。`:"只有失败(Failed)的任务才能重新排队。请先确认任务已失败。"}return/featureId .+ does not match the pool task/i.test(t)?"Feature ID 与队列中的任务不一致。请改用队列里记录的 Feature ID,或留空后重试。":/RUN_NOT_CONSOLE_OWNED|不由当前 Console 持有/.test(t)?"此运行不由当前 Console 持有,暂不支持协作中止。请用 Doctor / 报告查看。":/RUNNER_IDENTITY_MISMATCH|运行身份已变化/.test(t)?"运行身份已变化,不能中止这份过期请求。请刷新后再试。":/INTERRUPT_ALREADY_PENDING|已有一条中止请求/.test(t)?"已有一条中止请求等待当前节点安全收敛。请稍候刷新,不要重复提交。":/RUN_ALREADY_TERMINAL|运行已经结束/.test(t)?"运行已经结束,没有可中止的活 runner。请改用报告或对账。":/INTERRUPT_NEEDS_RECONCILE|无法确认 runner 已处理/.test(t)?"中止请求已登记,但无法确认 runner 已处理。请用 Doctor 对账,不要当成已经中止。":/RUN_NOT_ACTIVE/.test(t)?"这次运行不在本机活动目录,或已经不是 running,不能协作中止。":null}function T9(e){return e==="validate"||e==="apply"||e==="spine"?"contract":e}async function C9(e,t){const a=await fetch(Cr(`/api/dag-runs/${encodeURIComponent(e)}/prewrite-result`),{credentials:"same-origin"});if(!a.ok)return{ok:!1,status:a.status};const s=await a.json();return!s||typeof s.classification!="string"?{ok:!1,status:a.status}:{ok:!0,result:{schemaVersion:typeof s.schemaVersion=="number"?s.schemaVersion:1,schemaId:typeof s.schemaId=="string"?s.schemaId:"",classification:s.classification,failureCode:typeof s.failureCode=="string"?s.failureCode:null,failureReason:typeof s.failureReason=="string"?s.failureReason:null}}}function R9(e){return e==="fail"?"未通过":e==="pass"?"通过":"未知/不可判定"}const O1="X-Loop-Console-Confirmation",V3="agent-worker console doctor --repo .",D1=["LOW","MED","HIGH"];function N9(e){if(e.length===0)return"模型值不能为空";if(e.trim()!==e)return"模型值不能包含首尾空白";if(e==="default")return"default 是保留哨兵,不能作为模型值";if(e.startsWith("/")||e.endsWith("/")||e.includes("//"))return"provider/model 格式非法:不允许 /model、provider/ 或 a//b"}function A9(e){const t={};for(const n of D1){const a=N9(e[n]);a&&(t[n]=a)}return t}function bb(e){return{LOW:e?.LOW?.value??"",MED:e?.MED?.value??"",HIGH:e?.HIGH?.value??""}}function I9(e){return D1.every(t=>e[t]===void 0)}const Bh=[{kind:"standard",label:"后端研发(默认 DAG)",hint:"生成标准 hybrid DAG(contract → implement → verify)"},{kind:"frontend-implementation",label:"前端研发",hint:"生成 frontend-implementation 专用节点链"},{kind:"backend-test",label:"后端测试",hint:"生成 backend-test-dag(分析 / 用例 / pytest)"},{kind:"frontend-test",label:"前端测试",hint:"生成 frontend-test-dag(RAG 用例 + Playwright CLI)"}],K3={"setup-required":"需要设置",ready:"已就绪",degraded:"降级可用",unknown:"未知"},_9={idle:"未探测",match:"匹配",mismatch:"仓库不匹配",unavailable:"不可用"},Y3={low:"低",medium:"中",high:"高"},W3={"validation-failed":"校验失败","contract-drift":"契约漂移","runtime-mismatch":"运行时不匹配","pause-on-human":"等待人工","verification-failed":"验证失败","orphan-unknown":"孤立/未知","terminal-failed":"已终止(失败)","terminal-succeeded":"已终止(成功)","needs-reconcile":"需要对账","running-active":"正在运行"},M9={idle:"空闲","not-started":"未开始","not-run":"未运行","n/a (MVP)":"不适用(MVP)",accepted:"已接受",succeeded:"已成功",running:"运行中",ran:"已执行"};function hu(e){return M9[e]??e}function j1(){return window.__CONSOLE_CONFIRMATION_TOKEN__??""}function $u(e){return`${e}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function Z3(e=typeof globalThis.location?.hash=="string"?globalThis.location.hash:""){const t=e.indexOf("?");if(!(t<0))return new URLSearchParams(e.slice(t+1)).get("workspaceId")?.trim()||void 0}function X3(e,t){const n=t?.trim()||Z3();if(!n)return e;const a=e.includes("?")?"&":"?";return`${e}${a}workspaceId=${encodeURIComponent(n)}`}function Cr(e,t){return X3(e,t)}async function Ll(e,t={},n,a){const s=a?.trim()||Z3(),o={"Content-Type":"application/json",[O1]:j1()},c=await fetch("/api/operator/v1/operations",{method:"POST",credentials:"same-origin",headers:o,body:JSON.stringify({action:e,actionParams:t,...s?{workspaceId:s}:{},...n?{clientRequestId:n}:{}})});let d={};try{d=await c.json()}catch{d={ok:!1,error:{code:"INVALID_INPUT",message:"操作响应不是合法 JSON"}}}return{status:c.status,body:d}}const O9=new Set(["runDag","dagRerun","dagReconcileRun","dagRequestInterrupt","standaloneTaskRerun","consoleUpdateAndInit"]);function Pf(e,t){return G3({blockedReasons:e.blockedReasons,blockingNodes:e.blockingNodes,fallbackMessage:t})}async function vb(e,t=3e5,n){const a=X3(`/api/operator/v1/operations/${encodeURIComponent(e)}`,n),s=Date.now();for(;Date.now()-s<t;){const o=await fetch(a,{credentials:"same-origin"});if(!o.ok)return null;const c=await o.json(),d=c.operation??c,m=d.state??"";if(m==="succeeded"||m==="failed"||m==="needs-reconcile"||m==="timed-out"||m==="restarting")return d;await new Promise(h=>setTimeout(h,250))}return{state:"needs-reconcile",errorMessage:"等待操作结果超时"}}function ds(e){if(e==null)return null;if(typeof e=="string")return e.trim()||null;if(typeof e=="number"||typeof e=="boolean")return String(e);if(typeof e=="object"){const t=e;if(typeof t.text=="string"&&t.text.trim())return t.text.trim();if(typeof t.errorMessage=="string"&&t.errorMessage.trim())return t.errorMessage.trim();if(Array.isArray(t.content)){const n=t.content.map(a=>{if(typeof a=="string")return a;if(a&&typeof a=="object"){const s=a;if(typeof s.text=="string")return s.text}return""}).filter(Boolean);if(n.length)return n.join(`
|
|
12
|
-
`).slice(0,240)}if(typeof t.role=="string")return`${t.role} 消息`}return null}function D9(e){const t=ds(e.at)??ds(e.timestamp)??ds(e.recordedAt)??"",n=ds(e.errorMessage)??ds(e.label)??ds(e.type)??ds(e.message)??"运行事件";return t?`${t} · ${n}`:n}function Il(e){return String(e.nodeId??e.id??"").trim()}function Gf(e){const t=Il(e);return String(e.label??e.name??(t||"未命名节点"))}function yb(e,t){if(e.length===0)return;const n=t?.trim();if(n){const o=e.find(c=>Il(c)===n);if(o)return o}const a=e.find(o=>{const c=String(o.status??"").toLowerCase();return c.includes("fail")||c.includes("error")||c==="blocked"});return a||(e.find(o=>{const c=String(o.status??"").toLowerCase();return c==="running"||c==="in_progress"||c==="active"})??e[0])}const j9=new Set(["finished","failed","partial_failed","superseded","abandoned"]);function qh(e){if(!e)return!1;const t=String(e.effectiveStatus??e.status??"").toLowerCase();return j9.has(t)}const L9=5e3;function z9({dagRunId:e,nodeId:t,onClose:n,onOpenFull:a}){const s=w.useRef(null),[o,c]=w.useState(null),[d,m]=w.useState([]),[h,p]=w.useState(null),[b,x]=w.useState(!0),[y,S]=w.useState(null),T=qh(o);w.useEffect(()=>{s.current?.focus();const P=U=>{U.key==="Escape"&&n()};return document.addEventListener("keydown",P),document.title=`检视 · DAG ${e} · Loop Operator`,()=>document.removeEventListener("keydown",P)},[e,n]),w.useEffect(()=>{const P=new AbortController;let U;const N=async z=>{z&&(x(!0),p(null),m([]));try{const X=await fetch(Cr(`/api/dag-runs/${encodeURIComponent(e)}`),{signal:P.signal,credentials:"same-origin"});if(!X.ok)throw new Error(`DAG 查询失败(HTTP ${X.status})`);const B=await X.json();if(P.signal.aborted)return;c(B),p(null);const $=Array.isArray(B.nodes)?B.nodes:[];try{const oe=await C9(e);if(P.signal.aborted)return;oe.ok?S({status:"success",...oe.result}):oe.status===404&&S({status:"missing"})}catch{}const F=yb($,t),K=F?Il(F):t?.trim();if(K){const oe=await fetch(Cr(`/api/dag-runs/${encodeURIComponent(e)}/nodes/${encodeURIComponent(K)}/session-events`),{signal:P.signal,credentials:"same-origin"});if(oe.ok){const J=await oe.json();P.signal.aborted||m((J.events??[]).slice(-20))}}qh(B)&&U!==void 0&&(window.clearInterval(U),U=void 0)}catch(X){P.signal.aborted||p(X instanceof Error?X.message:String(X))}finally{!P.signal.aborted&&z&&x(!1)}};return N(!0),U=window.setInterval(()=>{N(!1)},L9),()=>{P.abort(),U!==void 0&&window.clearInterval(U)}},[e,t]);const A=w.useMemo(()=>Array.isArray(o?.nodes)?o.nodes:[],[o]),C=yb(A,t),M=C?Il(C):"",I=String(o?.effectiveStatus??o?.status??(b?"加载中…":"未知"));return u.jsxs("aside",{className:"inspect-split-panel","aria-label":"DAG 紧凑检视",children:[u.jsxs("div",{className:"inspect-split-header",children:[u.jsxs("div",{children:[u.jsx("p",{className:"inspect-split-kicker",children:"Inspect"}),u.jsx("h2",{children:"检视 DAG"})]}),u.jsx("button",{ref:s,type:"button","aria-label":"关闭检视面板",onClick:n,children:"关闭"})]}),u.jsx("p",{className:"inspect-split-id",children:u.jsx("code",{children:e})}),o?u.jsx("p",{className:`inspect-split-refresh${T?" is-terminal":""}`,"data-testid":"inspect-split-refresh",children:T?"已结束 · 停止自动刷新":"进行中 · 每 5 秒自动刷新"}):null,h?u.jsx("p",{className:"error",children:h}):null,b&&!o?u.jsx("p",{className:"muted",children:"正在加载 DAG…"}):null,u.jsxs("dl",{className:"inspect-split-facts",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"状态"}),u.jsx("dd",{children:I})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"当前节点"}),u.jsx("dd",{children:C?Gf(C):"暂无节点"})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"节点状态"}),u.jsx("dd",{children:C?.status??"—"})]}),C?.errorPreview?u.jsxs("div",{children:[u.jsx("dt",{children:"错误摘要"}),u.jsx("dd",{children:C.errorPreview})]}):null,y?u.jsxs("div",{"data-testid":"inspect-prewrite-gate",children:[u.jsx("dt",{children:"prewrite 门禁"}),u.jsx("dd",{children:y.status==="missing"?u.jsx("span",{className:"muted",children:"prewrite 门禁结果尚未生成"}):u.jsxs(u.Fragment,{children:[y.classification,y.failureCode?u.jsxs("code",{"data-testid":"inspect-prewrite-failure-code",children:[" ",y.failureCode]}):null,y.failureReason?u.jsxs("span",{className:"muted",children:[" ","— ",y.failureReason]}):null]})})]}):null]}),u.jsxs("section",{children:[u.jsxs("h3",{children:["节点(",A.length,")"]}),A.length?u.jsx("ul",{className:"inspect-split-nodes",children:A.slice(0,24).map(P=>{const U=Il(P)||Gf(P),N=U===M;return u.jsxs("li",{"data-active":N?"true":void 0,className:N?"is-active":void 0,children:[u.jsx("span",{children:Gf(P)}),u.jsx("code",{children:P.status??"—"})]},U)})}):u.jsx("p",{className:"muted",children:b?"加载节点中…":"该运行暂无节点。"})]}),u.jsxs("section",{children:[u.jsxs("h3",{children:["最近事件",M?` · ${M}`:""]}),d.length?u.jsx("ul",{className:"inspect-split-events",children:d.map((P,U)=>u.jsx("li",{children:D9(P)},`${P.at??U}-${U}`))}):u.jsx("p",{className:"muted",children:b?"加载事件中…":"节点事件将在可用时显示。"})]}),u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:a,children:"全屏观测"}),u.jsx("p",{className:"muted",children:"全屏后点顶栏「返回操作台」可回来。"})]})}const Qa="loop-console.operator-chat.active-session.v1",Pu="loop-console.operator-chat.active-session-by-workspace.v1",B9="loop-console.operator-chat.default-landing.v1";function L1(e){try{const t=JSON.parse(e.getItem(Pu)??"{}");return!t||typeof t!="object"||Array.isArray(t)?{}:Object.fromEntries(Object.entries(t).filter(n=>!!n[0].trim()&&typeof n[1]=="string"&&!!n[1].trim()))}catch{return{}}}function q9(e,t){const n=t?.trim();if(n){const a=L1(e),s=a[n]?.trim();if(s)return s;if(Object.keys(a).length>0)return null}return e.getItem(Qa)?.trim()||null}function Vf(e,t,n){const a=n.trim();if(!a)return;e.setItem(Qa,a);const s=t?.trim();if(!s)return;const o=L1(e);o[s]=a,e.setItem(Pu,JSON.stringify(o))}function pu(e,t,n){const a=t?.trim();if(a){const o=L1(e);(!n||o[a]===n)&&delete o[a],Object.keys(o).length>0?e.setItem(Pu,JSON.stringify(o)):e.removeItem(Pu)}const s=e.getItem(Qa)?.trim();(!n||s===n)&&e.removeItem(Qa)}function Gu(e){const t=e?.trim().toLowerCase();if(t==="chat")return"chat";if(t==="tasks")return"tasks"}function H9(e){const t=e?.trim().toLowerCase();if(t==="chat"||t==="tasks"||t==="recovery"||t==="night"||t==="models"||t==="settings")return t}function U9(e){const t=n=>e.get(n)?.trim()||void 0;return{...t("taskId")?{taskId:t("taskId")}:{},...t("dagRunId")?{dagRunId:t("dagRunId")}:{},...t("fromNodeId")?{fromNodeId:t("fromNodeId")}:{},...t("featureId")?{featureId:t("featureId")}:{},...t("intent")?{intent:t("intent")}:{},...t("workspaceId")?{workspaceId:t("workspaceId")}:{},...t("sessionId")?{sessionId:t("sessionId")}:{}}}function F9(e){const t=String(e??"").replace(/^#/,"");if(!t)return null;const n=t.indexOf("?"),a=n>=0?t.slice(0,n):t,s=n>=0?t.slice(n+1):"",o=(a||"/").split("?")[0]||"/";if(o==="/"||o==="")return null;const c=o.replace(/^\//,"").split("/")[0],d=H9(c);return d?{workspace:d,...U9(new URLSearchParams(s))}:null}function $9(e){if(!e)return;const t=F9(e.hash);if(t)return t.workspace;const n=new URLSearchParams(e.search),a=Gu(n.get("landing")??n.get("workspace"));if(a)return a;const s=e.hash.startsWith("#")?e.hash.slice(1):e.hash;return Gu(new URLSearchParams(s).get("workspace"))}function P9(e){return $9(e.location)??Gu(e.storage?.getItem(B9))??Gu(e.env)??"chat"}function G9(e,t={}){const n=new URLSearchParams;for(const[o,c]of Object.entries(t))c?.trim()&&n.set(o,c.trim());const a=n.toString(),s=`/${e}`;return a?`${s}?${a}`:s}function V9(e,t={}){return`#${G9(e,t)}`}const K9={};function Y9(){const[e,t]=w.useState(()=>P9({env:K9?.VITE_OPERATOR_CHAT_DEFAULT_LANDING,storage:window.localStorage,location:window.location})),[n,a]=w.useState(null),[s,o]=w.useState("unknown"),[c,d]=w.useState(null),[m,h]=w.useState(null),[p,b]=w.useState(!1),[x,y]=w.useState(!1),[S,T]=w.useState(null),[A,C]=w.useState(null),[M,I]=w.useState(null),[P,U]=w.useState(null),[N,z]=w.useState({command:"idle",dag:"not-started",verification:"not-run",promote:"n/a (MVP)"}),[X,B]=w.useState("setup"),$=w.useCallback(H=>{B(_=>T9(typeof H=="function"?H(_):H))},[]),F=s==="setup-required",K=s==="degraded",oe=w.useCallback(H=>{H!==e&&(T(null),I(null),C(null)),t(H)},[e]),J=w.useCallback(async H=>{const _=H?.trim(),Y=fe=>{o(fe),$(fe==="ready"||fe==="degraded"?j=>j==="setup"?"import-prd":j:"setup")};let re="setup-required";try{const j=await(await fetch("/api/health")).json();a(j),re=j.piReadiness??"setup-required",h(null)}catch(fe){h(fe instanceof Error?fe.message:String(fe))}if(!_){Y(re);return}try{const fe=await fetch(`/api/operator/v1/readiness?workspaceId=${encodeURIComponent(_)}`);if(!fe.ok){Y(re);return}const j=await fe.json();d(j),Y(j.state??re)}catch{Y(re)}},[$]);return{nav:e,setNav:t,selectNav:oe,health:n,readiness:s,setReadiness:o,readinessReport:c,healthError:m,loadHealth:J,busy:p,setBusy:b,observeBusy:x,setObserveBusy:y,opError:S,setOpError:T,opMessage:A,setOpMessage:C,opErrorCode:M,setOpErrorCode:I,lastOpState:P,setLastOpState:U,layers:N,setLayers:z,step:X,setStep:$,setupBlocked:F,degraded:K}}const W9=[{pattern:/invalid (boot capability|confirmation header) token/i,copy:"页面凭证已失效(控制台可能已重启),请刷新页面(F5)后重试。"},{pattern:/mutation requires boot capability cookie|mutation requires confirmation header token/i,copy:"页面状态异常,请刷新页面(F5)后重试。"},{pattern:/Host header is required for non-loopback/i,copy:"请求主机校验失败:非回环绑定时要求 Host 头,请刷新页面或检查访问地址。"}];function Xa(e){const t=(e??"").trim();if(!t)return"操作失败";const n=E9(t);if(n)return n;if(/controller identity changed|package fingerprint changed|entry binary sha256 changed/i.test(t))return"控制器版本已变更(Console 启动后代码被重新编译,或提交了 package.json / bin / dist / skills 等指纹范围文件)。请重启 Console 进程使其重新加载当前构建后再重试本操作;一次会话中途不要重建控制器。";if(/Pi session file missing or not openable|cannot reopen chat session .* no persisted Pi session file/i.test(t))return"该对话的 Pi 会话文件已丢失,无法恢复上下文。请新建对话继续(历史记录无法重开)。";if(/reopened Pi sessionId mismatch/i.test(t))return"重开对话失败:Pi 会话身份与记录不一致(常见于会话文件丢失后被误建)。请新建对话继续。";if(/base HEAD .+ != frozen baseCommit|exact-base|not a descendant of frozen baseCommit/i.test(t))return"主分支已相对夜间冻结的 baseCommit 前进,无法安全 fast-forward harvest。请人工核对后使用 Discard(必要时勾选强制),或改走日间合并流程。";if(/force-required|requires --force/i.test(t))return"该终态需要强制 Discard。请确认后勾选强制再试。";for(const a of W9)if(a.pattern.test(t))return a.copy;return t}const Z9={bootstrapFromPrd:"正在导入 PRD 并创建任务:归档文档 → 确定性解析 → 语义结构化(MED→HIGH→LOW,每档最多 300 秒,请勿关闭页面)",importPrd:"正在导入 PRD:归档文档 → 确定性解析 → 语义结构化(MED→HIGH→LOW,每档最多 300 秒,请勿关闭页面)",interviewStart:"正在启动需求访谈…",interviewTurn:"正在提交访谈回答…",interviewSkip:"正在跳过访谈并生成评估…",contractValidate:"正在校验契约草稿…",contractDiff:"正在计算契约差异…",contractApply:"正在应用契约(写入需求与执行约束)…",spineCheck:"正在运行 Spine 审计…",dagGenerate:"正在生成 DAG…",standaloneTaskRerun:"正在带反馈重新执行任务:服务端校验资格后生成并启动新 DAG…",consoleUpdateAndInit:"正在检查活动运行、所选 npm 渠道与安全初始化;完成后 Console 将自动刷新…",workerTaskRetry:"正在重新排队 Worker Task…"};function X9(e){const{shell:t,applyInterviewPayload:n,workspaceId:a}=e,{setBusy:s,setOpError:o,setOpErrorCode:c,setOpMessage:d,setReadiness:m,setStep:h,setNav:p,setLastOpState:b,setLayers:x,step:y,nav:S}=t,[T,A]=w.useState(null),[C,M]=w.useState(null),[I,P]=w.useState([]),[U,N]=w.useState(!0),z=w.useRef(null),[X,B]=w.useState(null),[$,F]=w.useState(null),K=w.useCallback(async(re,fe={},j)=>{const G=a?.trim()||null;if(!G){const W="当前 Workspace 不可用;请先选择有效 Workspace 后再执行操作";return o(W),c("WORKSPACE_REQUIRED"),{ok:!1,error:{code:"WORKSPACE_REQUIRED",message:W}}}s(!0),o(null),c(null),d(Z9[re]??null);try{const{status:W,body:O}=await Ll(re,fe,j?.clientRequestId,G);if(W===412||O.error?.code==="PI_SETUP_REQUIRED")return o(Xa(O.error?.message??"Pi 未就绪或已降级:该操作暂不可用")),c(O.error?.code??"PI_SETUP_REQUIRED"),m("setup-required"),h("setup"),p("models"),O;if(W>=400||O.ok===!1)return o(Xa(O.error?.message??O.message??`操作失败(HTTP ${W})`)),c(O.error?.code??String(W)),b(O.state??`failed:${W}`),x(V=>({...V,command:O.error?.message??`failed:${O.error?.code??W}`})),O;if(O.operationId){M(G??null);const V=window.localStorage.getItem(Qa)?.trim();if(V&&fetch(`/api/operator/v1/chat/sessions/${encodeURIComponent(V)}/operation-links`,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json",[O1]:j1()},body:JSON.stringify({operationId:O.operationId})}).then(Z=>{Z.ok||console.warn("Operator Chat operation link failed",Z.status)}).catch(Z=>console.warn("Operator Chat operation link failed",Z)),A(O.operationId),b(O.state??"accepted"),x(Z=>({...Z,command:O.state??"accepted",dag:re==="runDag"?"running":Z.dag})),O9.has(re)){N(!0),d(`操作已接受,后台运行中:${O.operationId}(请看事件流;可同时打开 Observe)`);const Z=O.operationId;vb(Z,30*6e4,G).then(ne=>{if(ne){if(b(ne.state??null),ne.state==="failed"||ne.state==="needs-reconcile"||ne.state==="timed-out"){o(Xa(ne.errorMessage??ne.stderrPreview??`操作失败:${ne.state}`)),c(ne.errorCode??ne.state??null),x(ue=>({...ue,command:`failed:${ne.errorCode??ne.state}`}));return}ne.state==="succeeded"&&(d(`${re} 已成功`),x(ue=>({...ue,command:"succeeded"}))),re==="consoleUpdateAndInit"&&ne.state==="restarting"&&(d("新 Console 正在接棒,页面即将刷新…"),setTimeout(()=>window.location.reload(),800))}})}else{d(`操作已接受:${O.operationId}`);const Z=await vb(O.operationId,3e5,G);if(Z){if(b(Z.state??null),Z.state==="failed"||Z.state==="needs-reconcile"||Z.state==="timed-out")return o(Xa(Z.errorMessage??Z.stderrPreview??`操作失败:${Z.state}`)),c(Z.errorCode??Z.state??null),x(Re=>({...Re,command:`failed:${Z.errorCode??Z.state}`})),{ok:!1,operationId:O.operationId,state:Z.state,error:{code:Z.errorCode??Z.state??"INTERNAL_ERROR",message:Z.errorMessage??Z.stderrPreview??`操作失败:${Z.state}`}};d(Z.errorMessage?`${re}:${Z.errorMessage}`:`${re} 已成功`),x(Re=>({...Re,command:Z.state??"succeeded"}));const ne=Z.result??{},ue={ok:!0,operationId:O.operationId,state:Z.state??"succeeded",result:ne};(re==="interviewStart"||re==="interviewTurn"||re==="interviewSkip")&&n(ne);const he=ne.confirmation;return he?.confirmationId&&(B(he.confirmationId),F(ne)),j?.advanceTo&&h(j.advanceTo),ue}}}else d(`${re} 已完成`),b(O.state??"succeeded"),x(V=>({...V,command:"succeeded",verification:re==="contractValidate"||re==="spineCheck"?"ran":V.verification}));const be=O.result??{};(re==="interviewStart"||re==="interviewTurn"||re==="interviewSkip")&&n(be);const se=be.confirmation;return se?.confirmationId&&(B(se.confirmationId),F(be)),j?.advanceTo&&h(j.advanceTo),O}catch(W){o(W instanceof Error?W.message:String(W));return}finally{s(!1)}},[n,s,o,c,d,m,h,p,b,x,a]),oe=w.useCallback(re=>{if(!re)return"无响应";if(re.error?.message)return re.error.message;if(re.message)return re.message;const fe=re.result;if(fe&&typeof fe=="object")try{return JSON.stringify(fe).slice(0,1200)}catch{return"已返回结果"}return re.ok===!1?"失败":"成功"},[]),J=w.useCallback(re=>{if(!re||re.ok===!1||re.error)return!1;const fe=re.result;if(!fe)return!0;if(typeof fe.valid=="boolean")return fe.valid;const j=fe.result;return j&&typeof j.valid=="boolean"?j.valid:!0},[]),H=w.useCallback(async re=>{z.current?.abort();const fe=new AbortController;z.current=fe,P(j=>[...j,`开始跟随事件流 ${re}`]);try{const j=C?`?workspaceId=${encodeURIComponent(C)}`:"",G=await fetch(`/api/operator/v1/operations/${encodeURIComponent(re)}/events${j}`,{credentials:"same-origin",signal:fe.signal});if(!G.ok||!G.body){P(se=>[...se,`事件流 HTTP ${G.status}`]);return}const W=G.body.getReader(),O=new TextDecoder;let be="";for(;U;){const{done:se,value:V}=await W.read();if(se)break;be+=O.decode(V,{stream:!0});const Z=be.split(`
|
|
13
|
-
|
|
14
|
-
`);be=Z.pop()??"";for(const ne of Z){const ue=ne.split(`
|
|
15
|
-
`).find(Re=>Re.startsWith("data:"));if(!ue)continue;const he=ue.slice(5).trim();P(Re=>[...Re.slice(-80),he.slice(0,240)])}}}catch(j){j.name!=="AbortError"&&P(G=>[...G,`事件流错误:${j instanceof Error?j.message:String(j)}`])}},[U,C]);w.useEffect(()=>(T&&U&&(y==="run"||S==="recovery")&&H(T),()=>z.current?.abort()),[T,U,y,S,H]);const _=w.useCallback(()=>{N(!1),z.current?.abort(),d("已停止跟随日志(未取消子进程)")},[d]),Y=w.useCallback(()=>{z.current?.abort(),A(null),M(null),P([]),N(!0),B(null),F(null)},[]);return{runAction:K,summarizeEnvelope:oe,isActionSuccess:J,operationId:T,setOperationId:A,sseLog:I,followSse:U,setFollowSse:N,stopFollowSse:_,resetForWorkspaceScope:Y,confirmationId:X,setConfirmationId:B,confirmationDetails:$,setConfirmationDetails:F}}const Hh=8*1024*1024,Q9=10*1024*1024,Vu=8,J9=".md,.markdown,.txt,text/markdown,text/plain",ew=[".md",".markdown",".txt"],z1=/\.[^.]+$/;function tw(e){const t=z1.exec(e.trim());return t?t[0].toLowerCase():""}function nw(e){const t=tw(e);return ew.includes(t)}function Uh(e){if(!Number.isFinite(e)||e<0)return"0 B";if(e<1024)return`${e} B`;if(e<1024*1024){const n=e/1024;return`${n>=10?n.toFixed(0):n.toFixed(1)} KiB`}const t=e/(1024*1024);return`${t>=10?t.toFixed(1):t.toFixed(2)} MiB`}function Za(e,t){return{ok:!1,code:e,message:t}}function rw(e,t){const n=e?Array.from(e):[],a=t?.maxFiles??Vu,s=t?.existingCount??0;return n.length===0?Za("file-count","请选择至少一个 .md / .markdown / .txt 文件"):s+n.length>a?Za("file-count",`最多支持 ${a} 个文件(当前已有 ${s} 个)`):null}async function aw(e){const t=e.name?.trim()||"untitled.md";if(!nw(t))return Za("unsupported-extension","仅支持 .md、.markdown、.txt 文件");if(e.size>Hh)return Za("file-too-large",`文件不能超过 ${Uh(Hh)}`);let n;try{n=await e.arrayBuffer()}catch{return Za("read-failed","文件读取失败,请重试或直接粘贴")}let a;try{a=new TextDecoder("utf-8",{fatal:!0}).decode(n)}catch{return Za("invalid-utf8","文件不是有效 UTF-8,请另存为 UTF-8")}if(a.trim().length===0)return Za("empty-content","文件内容不能为空或只有空白");const s=new TextEncoder().encode(a).byteLength;return{ok:!0,text:a,fileName:t,sourceBytes:e.size,textBytes:s}}async function iw(e){if(e.length===0)return Za("file-count","请选择至少一个 .md / .markdown / .txt 文件");if(e.length>Vu)return Za("file-count",`最多支持 ${Vu} 个文件`);const t=[];for(const n of e){const a=await aw(n);if(!a.ok)return a;t.push({fileName:a.fileName,text:a.text,sourceBytes:a.sourceBytes,textBytes:a.textBytes})}return{ok:!0,documents:t}}function sw(e,t){const n=e.split(/\r?\n/);for(const s of n){const o=/^(#{1,6})\s+(.+)$/.exec(s.trim());if(o?.[2])return o[2].trim()}for(const s of n){const o=s.trim();if(o&&!/^---+$/.test(o)&&!/^```/.test(o)&&!/^<!--/.test(o))return o.replace(/^>\s+/,"").slice(0,120)}return t.replace(z1,"").trim()||"需求"}function ow(e){return e.trim().toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"").replace(/-{2,}/g,"-")||"requirement"}function lw(e,t){const n=e.replace(z1,"").trim(),a=ow(n);return a==="requirement"&&/[^\u0000-\u007f]/.test(n)?`part-${t+1}`:a==="requirement"?n?`part-${t+1}`:`part-${t+1}`:a}function cw(e){const t=new Set;return e.map((n,a)=>{let s=lw(n.fileName,a);if(t.has(s)){let o=2;for(;t.has(`${s}-${o}`);)o+=1;s=`${s}-${o}`}return t.add(s),{name:s,content:n.text,fileName:n.fileName}})}function uw(e,t){if(e.length===0)return"";if(e.length===1)return e[0].text;const n=Math.min(Math.max(0,t?.primaryIndex??0),e.length-1),a=e[n],s=sw(a.text,a.fileName),c=[`<!-- composed-from: ${e.map(d=>d.fileName).join(", ")} -->`,"",`# ${s}`,""];for(const d of e)c.push(`## 来源:${d.fileName}`,"",d.text.trim(),"");return`${c.join(`
|
|
16
|
-
`).trimEnd()}
|
|
17
|
-
`}function dw(e,t,n){const a={action:e,actionParams:t};return new TextEncoder().encode(JSON.stringify(a)).byteLength<=Q9}function fw(){return"最终内容导致请求体超过服务端限制,请缩小文档或减少文件数量"}function mw(){const[e,t]=w.useState(""),[n,a]=w.useState([]),[s,o]=w.useState(0),[c,d]=w.useState(!1),[m,h]=w.useState(null),[p,b]=w.useState(!1),[x,y]=w.useState(!1),S=w.useRef(0),T=w.useRef(0),A=w.useCallback((F,K)=>{const oe=F.length===0?0:Math.min(Math.max(0,K),F.length-1);o(oe),t(uw(F,{primaryIndex:oe})),d(!1)},[]),C=w.useCallback(async F=>{const K=rw(F,{existingCount:n.length});if(K){h(K.message);return}const oe=Array.from(F),J=++T.current;b(!0),h(null);try{const H=await iw(oe);if(J!==T.current)return;if(!H.ok){h(H.message);return}const _=[...n,...H.documents],Y=n.length===0?0:s;a(_),n.length===0||!c?(A(_,Y),h(null)):h("已追加文件,未改正文(正文已手动编辑);可点「按文件重新合成」覆盖。")}catch{if(J!==T.current)return;h("文件读取失败,请重试或直接粘贴")}finally{J===T.current&&b(!1)}},[A,c,n,s]),M=w.useCallback(F=>{t(F),n.length>0&&d(!0)},[n.length]),I=w.useCallback(F=>{o(F),c||A(n,F)},[A,c,n]),P=w.useCallback((F,K)=>{const oe=F+K,J=[...n],H=J[oe];J[oe]=J[F],J[F]=H;const _=s===F?oe:s===oe?F:s;a(J),o(_),c||A(J,_)},[A,c,n,s]),U=w.useCallback(F=>{const K=n.filter((J,H)=>H!==F),oe=K.length===0?0:Math.min(s>=F?Math.max(0,s-1):s,Math.max(0,K.length-1));a(K),o(oe),K.length===0?d(!1):c||A(K,oe)},[A,c,n,s]),N=w.useCallback(()=>{a([]),o(0),d(!1),h(null)},[]),z=w.useCallback(()=>{c&&!window.confirm("将用当前文件列表重新合成正文,覆盖你在编辑区的修改。继续?")||(A(n,s),h(null))},[A,c,n,s]),X=w.useCallback((F,K)=>{F.preventDefault(),F.stopPropagation(),!K&&(S.current+=1,y(!0))},[]),B=w.useCallback(F=>{F.preventDefault(),F.stopPropagation(),S.current=Math.max(0,S.current-1),S.current===0&&y(!1)},[]),$=w.useCallback((F,K)=>{F.preventDefault(),F.stopPropagation(),S.current=0,y(!1),!K&&C(F.dataTransfer.files)},[C]);return{prdText:e,setPrdText:t,onPrdTextChange:M,prdDocuments:n,prdPrimaryIndex:s,prdComposedDirty:c,prdFileError:m,setPrdFileError:h,prdFileReading:p,prdDragOver:x,loadPrdFromFiles:C,applyPrdComposition:A,setPrimaryDocument:I,moveDocument:P,removeDocument:U,clearDocuments:N,recomposeDocuments:z,onDragEnter:X,onDragLeave:B,onDrop:$}}const hw={report:{id:"report",label:"查看报告",action:"dagReport",lane:"dag",guide:"看失败分类与建议动作(交接报告摘要)",commandHint:"loop-agent dag report --run-id <run-id> --json"},doctor:{id:"doctor",label:"Doctor 诊断",action:"doctor",lane:"dag",guide:"只读诊断:检查 Console / Pi / 仓库就绪,不是重跑前置",commandHint:"agent-worker console doctor --repo ."},decision:{id:"decision",label:"人工决策",lane:"dag",guide:"暂停等人时:先看 doctor 输出再做决策(经 CLI)",commandHint:"loop-agent dag doctor --run-id <run-id> --markdown"},resume:{id:"resume",label:"恢复运行",lane:"dag",guide:"仅当运行可安全 resume 时使用(经 CLI)",commandHint:"loop-agent task advance <task-id> --json"},reconcile:{id:"reconcile",label:"对账 / reconcile",requiresReason:!0,action:"dagReconcileRun",lane:"dag",guide:"Orphan/中断时先对账归档(默认 supersede);runner 仍存活时勿盲 supersede",commandHint:"loop-agent dag reconcile-run --run-id <run-id> --action supersede --reason <structured-reason>"},regenerate:{id:"regenerate",label:"重新生成契约/计划",lane:"dag",guide:"契约/计划过期时:回任务页或经 CLI 重新 task advance(本页仅提示)",commandHint:"loop-agent task advance <task-id> --json"},observeLink:{id:"observeLink",label:"全屏观测",action:"observeLink",lane:"dag",guide:"打开完整 Inspect 画布;顶栏可返回操作台",commandHint:"agent-worker console --repo . --port 8790"},dagRerun:{id:"dagRerun",label:"从失败节点恢复",requiresReason:!0,action:"dagRerun",lane:"dag",guide:"Provider、网络、限流或超时等非代码问题的首选:先评估安全子图,合格后创建 continuation run 从有效节点恢复(无需 Human Gate)。Worker 持有的 run、workspace/controller 漂移或含 unsafe shell 时不要强跑子图",commandHint:"loop-agent dag rerun --run-id <run-id> --from-node <node-id> --plan"},standaloneTaskRerun:{id:"standaloneTaskRerun",label:"带反馈重新执行任务",requiresReason:!0,action:"standaloneTaskRerun",lane:"dag",guide:"独立 DAG run 无法安全从节点恢复时,重新生成完整 DAG,并带入上一轮仍未解决的 verify/review 反馈;没有可继承反馈时会明确说明(无需 Human Gate)。Worker 持有的 run 请用下方「重新排队 Worker Task」",commandHint:"loop-agent dag rerun-task --run-id <run-id> --reason <text> --json"},workerTaskRetry:{id:"workerTaskRetry",label:"重新排队 Worker Task",requiresReason:!0,action:"workerTaskRetry",lane:"worker",guide:"仅 Worker 队列任务失败时直调执行,服务端校验 Failed 状态,无需 Human Gate;不要与 DAG 完整重跑混用",commandHint:"agent-worker task retry <task-id> --feature-id <feature-id> --repo . --reason <reason>"},interrupt:{id:"interrupt",label:"中止运行",requiresReason:!0,action:"dagRequestInterrupt",lane:"dag",guide:"仅本机 Console 持有的正在运行 DAG:经 Human Gate 登记协作中止,等待当前节点安全收敛。不会立即强杀进程",commandHint:"loop-agent dag request-interrupt --run-id <run-id> --reason-code operator-request --reason <structured-reason>"}},xb={"validation-failed":["report","doctor","regenerate"],"contract-drift":["report","doctor","decision","reconcile","regenerate"],"runtime-mismatch":["report","doctor","reconcile","regenerate"],"pause-on-human":["decision","resume","report","doctor"],"verification-failed":["report","doctor","dagRerun","standaloneTaskRerun","resume","regenerate"],"orphan-unknown":["report","doctor"],"terminal-failed":["report","doctor","dagRerun","standaloneTaskRerun","workerTaskRetry","regenerate"],"terminal-succeeded":["report","observeLink"],"needs-reconcile":["report","doctor","reconcile","regenerate"],"running-active":["interrupt","report","doctor","observeLink"]},pw=new Set(["succeeded","failed","timed-out"]);function gw(e){const t=(e.interruptStatus??"").trim();if(!t||t==="none")return null;if(t==="requested")return"请求已登记,等待 runner 确认。";if(t==="acknowledged")return"等待当前节点安全收敛(不会立即强杀)。";if(t==="needs-reconcile")return"需要对账:中止请求未能确认。";if(t==="settled"){const n=e.dagStatus==="failed"||e.dagStatus==="partial_failed",a=(e.failureCategory??"").includes("controller-interrupted"),s=pw.has(e.targetOperationState??"");return n&&a&&s?"已中止。":"正在对账,尚未确认退出。"}return null}function bw(e){return(xb[e]??xb["orphan-unknown"]).map(n=>hw[n])}function vw(e){const t=[],n=[];for(const a of e)a.lane==="worker"?n.push(a):t.push(a);return{dag:t,worker:n}}function yw(e){return typeof e.action=="string"&&e.action.trim().length>0}function Q3(e){return bw(e).filter(yw)}function xw(e){const t=new Set(Q3(e).map(a=>a.id)),n=(...a)=>{for(const s of a)if(t.has(s))return s;return null};switch(e){case"terminal-failed":case"verification-failed":return n("dagRerun","standaloneTaskRerun","doctor","report");case"pause-on-human":return n("doctor","report");case"needs-reconcile":return n("doctor","reconcile","report");case"running-active":return n("interrupt","doctor","report");case"runtime-mismatch":case"contract-drift":return n("doctor","report");case"validation-failed":return n("doctor","report");case"terminal-succeeded":return n("observeLink","report");default:return n("doctor","report")}}function ww(e){if(e.needsReconcile)return"needs-reconcile";const t=(e.errorCode??"").toLowerCase(),n=(e.operationState??"").toLowerCase(),a=(e.dagStatus??"").toLowerCase(),s=(e.failureCategory??"").toLowerCase();return t.includes("validation")||t.includes("invalid")||n.includes("validation")?"validation-failed":t.includes("contract")||t.includes("drift")||t.includes("binding")?"contract-drift":t.includes("runtime")||t.includes("mismatch")||t.includes("fingerprint")?"runtime-mismatch":t.includes("human")||n.includes("paused")||a.includes("paused")||n.includes("awaiting")?"pause-on-human":t.includes("verif")||n.includes("verif")?"verification-failed":s==="controller-interrupted"||t.includes("controller-interrupted")||t.includes("interrupted")||a==="interrupted"||a==="orphaned"||n.includes("controller-interrupted")||n.includes("interrupted")?"needs-reconcile":a==="running-suspected-stall"||a==="running-quiet"||a==="suspected-stall"||a.includes("suspected-stall")||n.includes("suspected-stall")?"orphan-unknown":a==="running"||a==="active"?"running-active":n==="succeeded"||n==="completed"||n==="finished"||a==="succeeded"||a==="completed"||a==="finished"?"terminal-succeeded":n==="failed"||n.includes("fail")||a==="failed"||a==="partial_failed"||t.includes("fail")?"terminal-failed":t.includes("reconcil")||n.includes("reconcil")?"needs-reconcile":"orphan-unknown"}const B1=new Set(["failed","error","partial_failed"]),J3=new Set(["blocked","paused","awaiting_human"]);function fd(e){return(e??"").trim().toLowerCase()}function kw(e){return B1.has(fd(e))}function wb(e){const t=fd(e.status);return B1.has(t)||t.includes("fail")?0:e.lifecycle==="paused"||t==="paused"?1:e.lifecycle==="active"?2:3}function Sw(e){return[...e].sort((t,n)=>{const a=wb(t)-wb(n);return a!==0?a:n.mtimeMs-t.mtimeMs})}function Ew(e){return Sw(e)[0]?.dagRunId}function kb(e){const t=fd(e.status);return B1.has(t)?0:J3.has(t)?1:2}function e5(e){return[...e].sort((t,n)=>{const a=kb(t)-kb(n);return a!==0?a:t.nodeId.localeCompare(n.nodeId)})}function Tw(e){const t=e5(e);return t.find(a=>kw(a.status)||J3.has(fd(a.status)))?.nodeId??t[0]?.nodeId}function Cw(e){const t=e.status?.trim()||e.lifecycle;return`${e.dagRunId.length>36?`${e.dagRunId.slice(0,18)}…${e.dagRunId.slice(-8)}`:e.dagRunId} · ${t}`}function Rw(e){const t=e.status?.trim()||"unknown",n=e.label?.trim();return n&&n!==e.nodeId?`${e.nodeId} · ${t} · ${n}`:`${e.nodeId} · ${t}`}function Nw(e){const n=[`operator-recovery: ${e.actionLabel?.trim()||"恢复"}`],a=e.dagRunId?.trim();if(a){const d=e.runStatus?.trim();n.push(d?`run=${a} (${d})`:`run=${a}`)}const s=e.fromNodeId?.trim();if(s){const d=e.nodeStatus?.trim();n.push(d?`from-node=${s} (${d})`:`from-node=${s}`)}const o=e.factClassLabel?.trim();o&&n.push(`fact=${o}`);const c=e.nodeError?.trim()||e.errorMessage?.trim()||(e.errorCode?.trim()?`code=${e.errorCode.trim()}`:"");return c&&n.push(`detail=${c.replace(/\s+/g," ").slice(0,280)}`),n.join(`
|
|
18
|
-
`).slice(0,500)}function t5(e){const t=e.trim();return t?t==="operator-recovery"||t.startsWith("operator-recovery:")||t.startsWith("recovery:"):!0}async function Sb(e){const t=await e.runAction("prepareMutationGate",{action:e.action,actionParams:e.actionParams});if(!e.isActionSuccess(t))return;const n=t?.result??t,a=n.receiptId?n:n.result??n;if(!a.receiptId||!a.humanGateToken){e.setOpError("prepareMutationGate 未返回可消费的 Human Gate receipt");return}await e.runAction(e.action,{...e.actionParams,confirmationId:a.receiptId,humanGateToken:a.humanGateToken},{clientRequestId:e.clientRequestId})}function Aw(e){const{shell:t,actions:n,taskId:a,dagRunId:s,fromNodeId:o,featureId:c,recoveryReason:d,recoveryReasonTouched:m,recoveryConfirm:h,recoveryPlanSummary:p,interruptReasonCode:b,setRecoveryConfirm:x,setRecoveryPlanSummary:y,setRecoveryReport:S,setRecoveryReason:T,setRecoveryReasonTouched:A,buildCurrentRecoveryReason:C,openFullCanvas:M}=e,{setOpError:I,setOpErrorCode:P,setOpMessage:U,setBusy:N}=t,{runAction:z,isActionSuccess:X}=n,B=w.useCallback(async F=>{if(F.requiresReason||(x(null),y(null)),F.action==="doctor"){S(null),z("doctor",{});return}if(F.action==="dagReport"||F.id==="report"){const K=s.trim();if(K){x(null),y(null);const oe=await z("dagReport",{runId:K}),J=oe?.result??{},H=(J.raw?.runs??J.runs)?.[0];oe&&oe.ok!==!1&&!oe.error&&H&&(S({runId:H.runId??K,title:H.title,status:H.status,category:H.productLineFailureCategory,recommendation:H.recoveryRecommendation?.summary??H.recommendedFollowUp??void 0}),U(null));return}if(a.trim()){S(null),z("status",{taskId:a});return}I("查看报告需要先选择 DAG 运行 ID(或填写任务 ID)");return}if(F.action==="observeLink"){S(null),M();return}if(F.requiresReason){if(S(null),x(F),y(null),F.id!=="dagRerun"&&(I(null),P(null)),(!m||t5(d))&&(T(C(F.label)),A(!1)),F.id==="dagRerun"&&s.trim()&&o.trim()){N(!0);try{const{status:K,body:oe}=await Ll("dagRerunPlan",{runId:s.trim(),fromNode:o.trim()}),J=oe.result??{};J&&typeof J=="object"&&("eligible"in J||J.planHash)&&y(J),K<400&&oe.ok!==!1&&J.eligible!==!1?U(null):J.eligible===!1?I(Xa(Pf(J,oe.error?.message))):U(oe.error?.message??"无法预检重跑计划;确认后仍将尝试提交(CLI 可能尚未就绪)")}finally{N(!1)}}return}I(null),P(null),U(`${F.label}:请经 CLI — ${F.commandHint??""}`)},[C,s,o,M,d,m,z,N,I,P,U,x,y,S,T,A,a]),$=w.useCallback(async()=>{const F=h;if(!F)return;const K=d.trim();if(!K){I("恢复操作需要结构化原因");return}const oe=$u(`recovery-${F.id}`);if(x(null),F.id==="dagRerun"){const J=s.trim(),H=o.trim();if(!J||!H){I("从失败节点恢复需要 DAG 运行 ID 与起始节点 ID");return}let _=p?.planHash?.trim(),Y=p?.eligible;if(!_||Y===void 0){const re=await z("dagRerunPlan",{runId:J,fromNode:H}),fe=re?.result??{};if((fe.planHash||fe.eligible!==void 0)&&y(fe),_=fe.planHash?.trim()||_,Y=fe.eligible,fe.eligible===!1){I(Xa(Pf(fe,re?.error?.message)));return}if(re&&re.ok===!1&&!_){I(re.error?.message??"无法获取 planHash;请确认 loop-agent dag rerun --plan 可用");return}}if(Y===!1){I(Xa(Pf(p??{})));return}if(!_){I("无法获取 planHash;请确认 loop-agent dag rerun --plan 可用");return}await z("dagRerun",{runId:J,fromNode:H,planHash:_,reason:K},{clientRequestId:oe});return}if(F.id==="standaloneTaskRerun"){const J=s.trim();if(!J){I("带反馈重新执行任务需要 DAG 运行 ID");return}await z("standaloneTaskRerun",{runId:J,reason:K,...a.trim()?{taskId:a.trim()}:{}},{clientRequestId:oe});return}if(F.id==="workerTaskRetry"){const J=a.trim();if(!J){I("重新排队 Worker Task 需要任务 ID");return}await z("workerTaskRetry",{taskId:J,reason:K,...c.trim()?{featureId:c.trim()}:{}},{clientRequestId:oe});return}if(F.id==="interrupt"){const J=s.trim();if(!J){I("中止运行需要 DAG 运行 ID");return}if(K.trim().length<10||K.trim().length>500){I("中止原因去首尾空白后必须是 10–500 个字符,请手写说明,不要用占位句。");return}await Sb({runAction:z,isActionSuccess:X,setOpError:I,action:"dagRequestInterrupt",actionParams:{runId:J,reasonCode:b.trim()||"operator-request",reasonDetail:K},clientRequestId:oe});return}if(F.id==="reconcile"){const J=s.trim();if(!J){I("对账恢复需要 DAG 运行 ID");return}await Sb({runAction:z,isActionSuccess:X,setOpError:I,action:"dagReconcileRun",actionParams:{runId:J,reason:K,reconcileAction:"supersede"},clientRequestId:oe});return}U(`${F.label}:请经 CLI — ${F.commandHint??""}`)},[s,c,o,h,p?.planHash,d,b,z,X,I,U,x,y,a]);return{handleRecoveryCta:B,submitRecoveryConfirm:$}}function Iw(e,t){const n=e?.trim();return n?t.includes(n)?{status:"ok",workspaceId:n}:{status:"unknown-workspace",workspaceId:n}:{status:"ok",workspaceId:void 0}}const n5="loop-console.operator-shell.last-operate-tab.v1",r5="loop-console.operator-shell.last-inspect-hash.v1",yo="tasks",q1="/#/chat",zl="/#/inspect",Fh=/^(dag|run|task|feature|batch|night|pool|failures|dags)(\/|$)/;function Bl(e){const t=String(e??"").replace(/^#/,""),n=t.indexOf("?"),a=n>=0?t.slice(0,n):t,s=a?a.startsWith("/")?a:`/${a}`:"/",o=new URLSearchParams(n>=0?t.slice(n+1):"");return{path:s,query:o}}function ql(e){return e==="/inspect"||e==="/inspect/"?"/":e.startsWith("/inspect/")?e.slice(8)||"/":e}function $h(e){return e==="tasks"||e==="recovery"||e==="night"||e==="models"||e==="settings"}function Sr(e,t){return e.get(t)?.trim()||void 0}function Ku(e){return{...Sr(e,"taskId")?{taskId:Sr(e,"taskId")}:{},...Sr(e,"dagRunId")?{dagRunId:Sr(e,"dagRunId")}:{},...Sr(e,"fromNodeId")?{fromNodeId:Sr(e,"fromNodeId")}:{},...Sr(e,"featureId")?{featureId:Sr(e,"featureId")}:{},...Sr(e,"intent")?{intent:Sr(e,"intent")}:{},...Sr(e,"workspaceId")?{workspaceId:Sr(e,"workspaceId")}:{},...Sr(e,"sessionId")?{sessionId:Sr(e,"sessionId")}:{}}}function a5(e){const t=new URLSearchParams;for(const n of["taskId","dagRunId","fromNodeId","featureId","intent","workspaceId","sessionId"]){const a=e[n]?.trim();a&&t.set(n,a)}return t.toString()}function Kf(e){try{const t=e?.getItem(n5);if($h(t))return t}catch{}return yo}function _w(e,t){try{t?.setItem(n5,e)}catch{}}function Mw(e){try{const t=e?.getItem(r5)?.trim();if(t?.startsWith("/#/inspect"))return t}catch{}return zl}function Ow(e,t){const n=e.startsWith("/#/inspect")?e:qi(e);if(n.startsWith("/#/inspect"))try{t?.setItem(r5,n)}catch{}}function Yu(e=yo,t={}){const n=a5(t);return`/#/operate/${e}${n?`?${n}`:""}`}function ca(e="/",t){const n=ql(e.startsWith("/")?e:`/${e}`),a=n==="/"||n===""?"/inspect":`/inspect${n}`,s=typeof t=="string"?t.replace(/^\?/,""):t?.toString()??"";return`/#${a}${s?`?${s}`:""}`}function H1(e={}){return q1}function Yf(e,t){const n=e.startsWith("/#")?e:e.startsWith("#")?`/${e}`:qi(e),{path:a,query:s}=Bl(n.slice(2));if(a==="/chat")return q1;const o=t?.trim();o?s.set("workspaceId",o):s.delete("workspaceId");const c=s.toString();return`/#${a}${c?`?${c}`:""}`}function Wf(e){return e.workspace==="chat"?H1(e):e.workspace==="operate"?Yu(e.operateTab??yo,e):ca(e.inspectPath??"/",e.inspectQuery)}function Zf(e,t,n){const a=t.toString(),s=ca(e,a);return{workspace:"inspect",operateTab:yo,inspectPath:ql(e),canonicalHash:s.slice(2),canonicalHref:s,replace:n,...Ku(t)}}function gu(e,t,n){const a=Yu(e,Ku(t));return{workspace:"operate",operateTab:e,inspectPath:"/",canonicalHash:a.slice(2),canonicalHref:a,replace:n,...Ku(t)}}function Dw(e,t){const n=t??{},a=q1;return{workspace:"chat",operateTab:yo,inspectPath:"/",canonicalHash:a.slice(2),canonicalHref:a,replace:e||a5(n).length>0,...n}}function Xf(e,t={}){const n=String(e.pathname??"/").replace(/\/+$/,"")||"/",a=t.lastOperateTab??yo;if(n==="/inspect"){const{path:d,query:m}=Bl(e.hash??"#/");return Zf(d,m,!0)}const{path:s,query:o}=Bl(e.hash??"");if(!e.hash||s==="/")return null;if(s==="/inspect"||s.startsWith("/inspect/"))return Zf(ql(s),o,!1);if(s==="/chat")return Dw(!1,Ku(o));if(s==="/operate")return gu(a,o,!0);if(s.startsWith("/operate/")){const d=s.slice(9).split("/")[0]??"";return $h(d)?gu(d,o,!1):gu(a,o,!0)}if($h(s.replace(/^\//,"").split("/")[0]??"")){const d=s.replace(/^\//,"").split("/")[0];return gu(d,o,!0)}const c=ql(s).replace(/^\//,"");return Fh.test(c)?Zf(s,o,!0):null}function qi(e,t=typeof globalThis.location?.href=="string"?globalThis.location.href:"http://local.invalid/"){const n=String(e??"").trim();if(!n)return zl;if(n.startsWith("/#/inspect"))return n;if(n.startsWith("#/inspect"))return`/${n}`;if(n.startsWith("/#/operate")||n.startsWith("/#/chat"))return n;if(n.startsWith("#/operate")||n.startsWith("#/chat"))return`/${n}`;try{const a=new URL(n,t);if((a.pathname.replace(/\/+$/,"")||"/")==="/inspect"){const{path:m,query:h}=Bl(a.hash||"#/"),p=new URLSearchParams(a.search);for(const[b,x]of h)p.set(b,x);return ca(m,p)}const{path:o,query:c}=Bl(a.hash||"");if(o==="/inspect"||o.startsWith("/inspect/"))return ca(ql(o),c);const d=o.replace(/^\//,"");if(Fh.test(d))return ca(o,c)}catch{}return n.startsWith("#/")&&Fh.test(n.slice(2))?ca(n.slice(1)):zl}function jw(e){const t=e.startsWith("/#")?e:e.startsWith("#")?`/${e}`:qi(e);return t.startsWith("/#")?t.slice(1):t}function ks(e){const t=jw(e);if(typeof window>"u")return t;const n=window.location.hash||"",a=n.startsWith("#")?n:`#${n}`,s=t.startsWith("#")?t:`#${t}`;return a!==s&&(window.location.hash=s),s}function Lw(e){const{shell:t,actions:n,wizard:a}=e,{nav:s,opError:o,opErrorCode:c,lastOpState:d,setOpError:m,setObserveBusy:h}=t,{taskId:p}=a,[b,x]=w.useState(""),[y,S]=w.useState(""),[T,A]=w.useState(""),[C,M]=w.useState(""),[I,P]=w.useState(!1),[U,N]=w.useState(null),[z,X]=w.useState(null),[B,$]=w.useState(!1),[F,K]=w.useState("operator-request"),[oe,J]=w.useState(null),[H,_]=w.useState([]),[Y,re]=w.useState([]),[fe,j]=w.useState(!1),[G,W]=w.useState(!1),[O,be]=w.useState(null),[se,V]=w.useState(null),[Z,ne]=w.useState(null),[ue,he]=w.useState(!1),[Re,Le]=w.useState(!1),[Ye,ut]=w.useState(null),[pt,Rt]=w.useState("idle"),[Ht,at]=w.useState(null),[Mt,ft]=w.useState(null),[Ut,ze]=w.useState(!1),Qe=w.useCallback(()=>b.trim()?ca(`/dag/${encodeURIComponent(b.trim())}`,"from=recovery"):"/#/inspect",[b]),Ue=w.useCallback(()=>{ks(Qe())},[Qe]),mt=w.useCallback(async()=>{if(b.trim())return b.trim();const st=p.trim();if(!st)return m("打开 DAG 检视需要任务 ID 或 DAG 运行 ID"),null;h(!0),m(null);try{const{status:je,body:wt}=await Ll("observeLink",{taskId:st}),bt=wt.result??{};if(je>=400||wt.ok===!1)return m(wt.error?.message??"无法解析 DAG 画布地址"),Rt("unavailable"),at(wt.error?.message??null),null;const Gt=typeof bt.dagRunId=="string"?bt.dagRunId.trim():"";return Gt?(x(Gt),Rt("match"),at(null),ft(ca(`/dag/${encodeURIComponent(Gt)}`)),Gt):(m("尚未找到该任务的 DAG 运行,请稍后再打开检视"),Rt("unavailable"),at(bt.message??"未解析到 DAG run"),null)}catch(je){return m(je instanceof Error?je.message:String(je)),null}finally{h(!1)}},[b,p,m,h]),pe=w.useCallback(async()=>{await mt()&&ze(!0)},[mt]),me=w.useCallback(async()=>{const st=await mt();st&&ks(ca(`/dag/${encodeURIComponent(st)}`,"from=recovery"))},[mt]),He=w.useCallback(async()=>{j(!0);try{const st=p.trim(),je=new URLSearchParams;st&&je.set("taskId",st),je.set("limit","40");const wt=await fetch(Cr(`/api/operator/v1/recovery/candidates?${je.toString()}`),{credentials:"same-origin"});if(!wt.ok){_([]);return}const bt=await wt.json();_(Array.isArray(bt.runs)?bt.runs:[])}catch{_([])}finally{j(!1)}},[p]),we=w.useCallback(async st=>{const je=st.trim();if(!je){re([]),be(null),V(null),ne(null);return}W(!0);try{const wt=await fetch(Cr(`/api/dag-runs/${encodeURIComponent(je)}`),{credentials:"same-origin"});if(!wt.ok){re([]),be(null),V(null);return}const bt=await wt.json(),Gt=typeof bt.effectiveStatus=="string"&&bt.effectiveStatus||typeof bt.status=="string"&&bt.status||null;be(Gt);const Q=Array.isArray(bt.nodes)?bt.nodes:[],ke=e5(Q.map(St=>{const jt=(St.nodeId??St.id??"").trim();return jt?{nodeId:jt,status:St.status,label:St.label??St.name,errorPreview:St.errorPreview}:null}).filter(St=>St!==null));re(ke);const qe=typeof bt.failureCategory=="string"&&bt.failureCategory||void 0,et=Q.find(St=>typeof St.failureCategory=="string"&&St.failureCategory&&St.failureCategory!=="success")?.failureCategory;V(qe??et??null),ne(bt.frontendRecovery??null)}catch{re([]),be(null),V(null),ne(null)}finally{W(!1)}},[]);w.useEffect(()=>{s==="recovery"&&He()},[s,p,He]),w.useEffect(()=>{if(s!=="recovery"||ue||H.length===0)return;const st=b.trim(),je=st?H.some(wt=>wt.dagRunId===st):!1;if(!st||!je){const wt=Ew(H);wt&&wt!==st&&x(wt)}},[s,H,b,ue]),w.useEffect(()=>{s==="recovery"&&we(b)},[s,b,we]),w.useEffect(()=>{if(s!=="recovery")return;const st=b.trim();if(!st){J(null);return}const wt=O&&new Set(["finished","failed","partial_failed","superseded","abandoned","interrupted"]).has(O)?3e4:4e3,bt=wt===4e3;let Gt=!1;const Q=async()=>{const{body:qe}=await Ll("dagInterruptEligibility",{runId:st});if(Gt)return;const et=qe.result??qe;if(J({eligible:et.eligible===!0,ownerKind:et.ownerKind,message:et.message,interruptStatus:et.interruptStatus,reasonCodes:et.reasonCodes,targetOperationId:et.targetOperationId,targetOperationState:et.targetOperationState}),!!bt)try{const St=await fetch(Cr(`/api/dag-runs/${encodeURIComponent(st)}`),{credentials:"same-origin"});if(!St.ok||Gt)return;const jt=await St.json();if(Gt)return;const Ke=typeof jt.effectiveStatus=="string"&&jt.effectiveStatus||typeof jt.status=="string"&&jt.status||null;be(Ke)}catch{}};Q();const ke=window.setInterval(()=>{Q()},wt);return()=>{Gt=!0,window.clearInterval(ke)}},[s,b,O]),w.useEffect(()=>{if(s!=="recovery"||Re||Y.length===0)return;const st=y.trim(),je=st?Y.some(wt=>wt.nodeId===st):!1;if(!st||!je){const wt=Tw(Y);wt&&wt!==st&&S(wt)}},[s,Y,y,Re]);const Fe=ww({operationState:O?null:d,errorCode:O?null:c,dagStatus:O,failureCategory:se}),lt=w.useMemo(()=>{const st=Q3(Fe);return Fe!=="running-active"||oe?.eligible?st:st.filter(je=>je.id!=="interrupt")},[Fe,oe?.eligible]),Ae=w.useMemo(()=>vw(lt),[lt]),Kt=w.useMemo(()=>xw(Fe),[Fe]),gt=w.useMemo(()=>Y.find(st=>st.nodeId===y.trim()),[Y,y]),_t=w.useRef(null);w.useEffect(()=>{z&&_t.current?.scrollIntoView({behavior:"smooth",block:"nearest"})},[z?.id]);const Tt=w.useCallback(st=>Nw({actionLabel:st,dagRunId:b.trim()||void 0,fromNodeId:y.trim()||void 0,runStatus:O,nodeStatus:gt?.status,nodeError:gt?.errorPreview,factClassLabel:W3[Fe],errorMessage:o,errorCode:c}),[b,y,o,c,Fe,O,gt?.errorPreview,gt?.status]);w.useEffect(()=>{if(s!=="recovery"||I&&!t5(C))return;const st=Tt(z?.label);st&&st!==C&&M(st)},[s,b,y,O,gt,Fe,o,c,z?.label,I,C,Tt]);const{handleRecoveryCta:Mn,submitRecoveryConfirm:pn}=Aw({shell:t,actions:n,taskId:p,dagRunId:b,fromNodeId:y,featureId:T,recoveryReason:C,recoveryReasonTouched:I,recoveryConfirm:z,recoveryPlanSummary:U,interruptReasonCode:F,setRecoveryConfirm:X,setRecoveryPlanSummary:N,setRecoveryReport:ut,setRecoveryReason:M,setRecoveryReasonTouched:P,buildCurrentRecoveryReason:Tt,openFullCanvas:me});return w.useEffect(()=>{if(s!=="recovery"||!B||!oe?.eligible)return;const st=lt.find(je=>je.id==="interrupt");st&&(X(st),M(Tt(st.label)),P(!1),$(!1))},[s,B,oe?.eligible,lt,Tt]),{dagRunId:b,setDagRunId:x,fromNodeId:y,setFromNodeId:S,featureId:T,setFeatureId:A,recoveryReason:C,setRecoveryReason:M,recoveryReasonTouched:I,setRecoveryReasonTouched:P,recoveryPlanSummary:U,recoveryConfirm:z,setRecoveryConfirm:X,setRecoveryPlanSummary:N,recoveryRuns:H,recoveryNodes:Y,recoveryRunsLoading:fe,recoveryNodesLoading:G,recoveryRunStatus:O,recoveryFailureCategory:se,frontendRecovery:Z,manualRunId:ue,setManualRunId:he,manualNodeId:Re,setManualNodeId:Le,recoveryReport:Ye,setRecoveryReport:ut,observeLinkStatus:pt,observeLinkMessage:Ht,observeUrl:Mt,inspectSplitOpen:Ut,setInspectSplitOpen:ze,inspectPath:Qe,openFullInspect:Ue,resolveDagRunForInspect:mt,openInspectSplit:pe,openFullCanvas:me,loadRecoveryRuns:He,loadRecoveryNodes:we,recoveryFact:Fe,recoveryCtas:lt,recoveryLanes:Ae,recommendedCtaId:Kt,interruptIntent:B,setInterruptIntent:$,interruptReasonCode:F,setInterruptReasonCode:K,interruptEligibility:oe,recoveryConfirmRef:_t,buildCurrentRecoveryReason:Tt,handleRecoveryCta:Mn,submitRecoveryConfirm:pn}}async function zw(e,t){const a=await fetch(Cr(`/api/tasks/${encodeURIComponent(e)}/ledger`),{credentials:"same-origin"});return a.ok?{ok:!0,summary:await a.json()}:{ok:!1}}function Bw(e){const{shell:t,actions:n,prd:a}=e,{step:s,setStep:o,setOpMessage:c}=t,{runAction:d,isActionSuccess:m,summarizeEnvelope:h}=n,[p,b]=w.useState(""),[x,y]=w.useState(""),[S,T]=w.useState("standard"),[A,C]=w.useState(""),[M,I]=w.useState(""),[P,U]=w.useState(""),N=Bh.find(we=>we.kind===S)??Bh[0],[z,X]=w.useState(null),[B,$]=w.useState(null),[F,K]=w.useState(""),[oe,J]=w.useState(null),[H,_]=w.useState(null),[Y,re]=w.useState(null),[fe,j]=w.useState(null),[G,W]=w.useState(null),[O,be]=w.useState(!1),[se,V]=w.useState(null),[Z,ne]=w.useState(!1),[ue,he]=w.useState(null),[Re,Le]=w.useState(null),[Ye,ut]=w.useState(null),pt=w.useRef(!1),Rt=w.useRef(0),Ht=w.useCallback(()=>{re(null),j(null),W(null),be(!1),V(null),ne(!1),he(null),Le(null),ut(null),pt.current=!1,Rt.current=0},[]),at=w.useCallback(()=>{Ht(),o("contract")},[Ht,o]),Mt=w.useCallback(we=>{const Fe=we.session;Fe?.sessionId&&X(Fe.sessionId);const lt=we.question;$(lt),J(we.summary??null);const Ae=we.assessmentId;typeof Ae=="string"&&Ae&&_(Ae),(we.complete===!0||typeof Ae=="string"&&Ae)&&(at(),c(we.skipped===!0?"已跳过访谈:已按推荐补齐草稿并签发评估":"访谈已完成:草稿已绑定完整评估结果"))},[at,c]),ft=w.useCallback(async(we,Fe)=>{const lt=++Rt.current;ne(!0),he(null);try{const Ae=await zw(we);if(Rt.current!==lt)return;if(!Ae.ok){Le(null),Fe&&he("ledger 接口不可达(安全降级)");return}Le(Ae.summary)}catch{if(Rt.current!==lt)return;he("ledger 接口不可达(安全降级)"),Le(null)}finally{Rt.current===lt&&ne(!1)}},[]),Ut=w.useCallback(async(we=!1)=>{const Fe=p.trim();if(!Fe)return;const lt=`${Fe}:${H??""}`;if(!(!we&&Ye===lt&&Y!==null)&&!pt.current){pt.current=!0,re(null),j(null),W(null),V(null),be(!1),await ft(Fe,!1);try{const Ae=await d("contractValidate",{taskId:Fe}),Kt=m(Ae);if(re(Kt),j(h(Ae)),!Kt){ut(lt),c("契约校验未通过:请先修正草稿后再应用");return}const gt=await d("contractDiff",{taskId:Fe});W(h(gt)),ut(lt),c(m(gt)?"校验与差异已就绪:确认后可应用契约":"校验通过,但差异查询失败(仍可查看下方摘要)")}finally{pt.current=!1}}},[H,Ye,Y,m,ft,d,c,h,p]),ze=w.useCallback(async()=>{const we=p.trim();if(!we||!H)return;const Fe=await d("contractApply",{taskId:we,assessmentId:H},{clientRequestId:$u("apply")});if(!m(Fe)){be(!1);return}be(!0),await ft(we,!0);const lt=await d("spineCheck",{taskId:we});if(m(lt)){V(!0),o("dag-confirm"),c("契约已应用并通过 Spine 审计,可生成并运行 DAG");return}V(!1),c("契约已应用,但 Spine 审计未通过:可重试 Spine")},[H,m,ft,d,c,o,p]),Qe=w.useCallback(async()=>{const we=p.trim();if(!we)return;const Fe=await d("spineCheck",{taskId:we});if(m(Fe)){V(!0),o("dag-confirm"),c("Spine 审计已通过,可生成并运行 DAG");return}V(!1)},[m,d,c,o,p]),Ue=w.useCallback(async()=>{const we=n.confirmationId?.trim();if(!we)return;const Fe=n.confirmationDetails?.confirmation?.humanGateToken,lt=await d("confirmDagConfirmation",{confirmationId:we,humanGateToken:Fe});m(lt)&&(o("run"),await d("runDag",{confirmationId:we},{clientRequestId:$u("run")}))},[n.confirmationId,n.confirmationDetails,m,d,o]);w.useEffect(()=>{s==="contract"&&p.trim()&&Ut(!1)},[s,p,H,Ut]);const mt=w.useCallback(we=>we.split(/[\n,;,;]+/).map(Fe=>Fe.trim()).filter(Boolean),[]),pe=w.useCallback(async()=>{const we=a.prdDocuments.length>0?cw(a.prdDocuments):void 0,Fe=mt(A),lt=mt(M),Ae=mt(P),Kt={content:a.prdText,taskKind:S,...we?{documents:we}:{},...Fe.length>0?{allowedPaths:Fe}:{},...lt.length>0?{forbiddenPaths:lt}:{},...Ae.length>0?{verifyCommands:Ae}:{}};if(!dw("bootstrapFromPrd",Kt)){a.setPrdFileError(fw());return}const gt=await d("bootstrapFromPrd",Kt);if(!gt||gt.ok===!1)return;const _t=gt.result??{};_t.taskId&&b(_t.taskId),_t.title&&y(_t.title);const Tt=_t.parseStatus??"pending",Mn=_t.draftPreview?.objective?.trim(),pn=Array.isArray(_t.gaps)?_t.gaps.length:0,st=_t.semanticIntake?.applied?"semantic":_t.semanticIntake?.code??"no-semantic",je=(_t.autoImportedReferences??[]).filter(bt=>bt.repoRelative),wt=(_t.unresolvedReferences??[]).filter(bt=>bt.token);c([`已创建任务「${_t.title??""}」(${_t.taskId??""})`,`来源:${_t.identitySource??"prd"}`,`解析:${Tt}(${st})`,Mn?`目标:${Mn.slice(0,120)}`:null,pn>0?`缺口 ${pn} 项待确认`:null,je.length>0?`已自动导入 ${je.length} 个引用文档(${je.map(bt=>`${bt.repoRelative}${bt.role?`:${bt.role}`:""}`).join("、")})`:null,wt.length>0?`有 ${wt.length} 个引用未能解析:${wt.map(bt=>`${bt.token}(${bt.reason??"未知原因"})`).join("、")}`:null].filter(Boolean).join(" · ")),o("interview")},[A,M,a,d,c,o,mt,S,P]),me=[{id:"setup",label:"就绪检查"},{id:"import-prd",label:"导入需求"},{id:"interview",label:"需求访谈(可跳过)"},{id:"contract",label:"契约落地"},{id:"dag-confirm",label:"确认 DAG"},{id:"run",label:"运行"}],He=me.findIndex(we=>we.id===s);return{taskId:p,setTaskId:b,taskTitle:x,taskKind:S,setTaskKind:T,engineering:{allowedPathsText:A,forbiddenPathsText:M,verifyCommandsText:P},setEngineering:we=>{we.allowedPathsText!==void 0&&C(we.allowedPathsText),we.forbiddenPathsText!==void 0&&I(we.forbiddenPathsText),we.verifyCommandsText!==void 0&&U(we.verifyCommandsText)},workflowMeta:N,sessionId:z,question:B,answerText:F,setAnswerText:K,draftSummary:oe,assessmentId:H,contractValidateOk:Y,contractValidateSummary:fe,contractDiffSummary:G,ledgerLoading:Z,ledgerError:ue,ledgerSummary:Re,contractApplied:O,spineOk:se,applyInterviewPayload:Mt,runContractPreflight:Ut,applyContractThenSpine:ze,retrySpineOnly:Qe,confirmAndRunDag:Ue,importPrdAndCreate:pe,wizardSteps:me,stepIndex:He}}async function qw(e){return await import(e)}function Hw(e){const{nav:t,primary:n,chatHref:a,operateHref:s,readiness:o,setupBlocked:c,degraded:d,inspectHref:m,workspaces:h,workspaceId:p,workspacesLoading:b,onSelectWorkspace:x,onNavigate:y}=e,S=c||d?"models":"settings",T=c?"Pi SDK / 认证 / 模型未就绪。不提供纯表单兜底。点击前往模型与认证。":d?"Pi 暂时降级:仍可恢复草稿与需求访谈。点击查看详情。":"Pi 已就绪。点击打开设置查看详情。",A=n==="operate"?`/#/operate/${t==="chat"?"tasks":t}`:n==="inspect"?m:null,C=n==="chat";return{mode:n,activeTabHref:A,chatHref:a,operateHref:s,inspectHref:m||zl,freshness:!1,readinessState:o,readinessHref:`/#/operate/${S}`,readinessTitle:T,onNavigate:y,repo:null,statusVisible:!1,workspaceSwitcher:C?null:{activeId:p,loading:b,items:h.map(M=>({workspaceId:M.workspaceId,name:M.name,displayPath:M.displayPath}))},onSelectWorkspace:x}}function Uw(e){const t=w.useRef(null),n=w.useRef(null),[a,s]=w.useState(!1),o=w.useMemo(()=>Hw(e),[e.nav,e.primary,e.chatHref,e.operateHref,e.readiness,e.setupBlocked,e.degraded,e.inspectHref,e.workspaces,e.workspaceId,e.workspacesLoading,e.onSelectWorkspace,e.onNavigate]),c=w.useRef(o);c.current=o,w.useEffect(()=>{let m=!1;return qw("/inspect/operator-chrome.js").then(h=>{m||!t.current||(n.current=h.mountOperatorChrome(t.current,c.current))}).catch(()=>{m||s(!0)}),()=>{m=!0,n.current?.destroy(),n.current=null}},[]),w.useEffect(()=>{n.current?.update(o)},[o]);const d=m=>{e.onNavigate?e.onNavigate(m):window.location.hash=m.startsWith("/#")?m.slice(1):m};return u.jsxs(u.Fragment,{children:[u.jsx("div",{ref:t,"data-testid":"operator-chrome"}),a?u.jsxs("nav",{className:"operator-chrome-fallback","aria-label":"产品模式",children:[u.jsx("select",{"aria-label":"切换工作区",value:e.workspaceId??"",onChange:m=>e.onSelectWorkspace(m.target.value),children:e.workspaces.map(m=>u.jsx("option",{value:m.workspaceId,children:m.name},m.workspaceId))}),u.jsx("button",{type:"button",onClick:()=>d(e.chatHref),children:"对话"}),u.jsx("button",{type:"button",onClick:()=>d(e.operateHref),children:"操作"}),u.jsx("button",{type:"button",onClick:()=>d(e.inspectHref),children:"观测"}),u.jsx("span",{role:"status",children:"共享导航加载失败,请刷新页面"})]}):null]})}function Fw(e){const[t,n]=w.useState(!1),[a,s]=w.useState("latest"),o=w.useId(),c=e.busy||t;return u.jsxs("div",{className:"console-update-control","aria-live":"polite",children:[u.jsx("span",{className:"console-update-badge",children:a==="latest"?"稳定版更新":"预发布更新"}),u.jsx("label",{className:"console-update-channel-label",htmlFor:o,children:"更新渠道"}),u.jsxs("select",{id:o,className:"console-update-channel",value:a,disabled:c,onChange:d=>s(d.target.value==="next"?"next":"latest"),children:[u.jsx("option",{value:"latest",children:"稳定版(latest)"}),u.jsx("option",{value:"next",children:"预发布版(next)"})]}),u.jsx("button",{type:"button",className:"console-update-button",disabled:c,onClick:()=>{n(!0),e.runAction("consoleUpdateAndInit",{channel:a},{clientRequestId:`console-update-${crypto.randomUUID()}`}).then(d=>{if(d?.state==="restarting"){setTimeout(()=>window.location.reload(),800);return}n(!1)})},children:t?"正在更新…":"更新并初始化"})]})}function $w(e){return u.jsxs(u.Fragment,{children:[e.opError?u.jsxs("div",{className:"flash flash-error","data-testid":"op-error",children:[u.jsx("span",{className:"flash-label",children:"错误"}),u.jsx("p",{className:"flash-body",children:e.opError})]}):null,e.opMessage?u.jsxs("div",{className:"flash flash-info","data-testid":"op-message",children:[u.jsx("span",{className:"flash-label",children:"状态"}),u.jsx("p",{className:"flash-body",children:e.opMessage})]}):null]})}const Wu=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M11 11V5H13V11H19V13H13V19H11V13H5V11H11Z"})),md=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"})),Pw=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z"})),i5=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M11.9999 10.8284L7.0502 15.7782L5.63599 14.364L11.9999 8L18.3639 14.364L16.9497 15.7782L11.9999 10.8284Z"})),Gw=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M9.9997 15.1709L19.1921 5.97852L20.6063 7.39273L9.9997 17.9993L3.63574 11.6354L5.04996 10.2212L9.9997 15.1709Z"})),Vw=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12ZM12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2ZM17.4571 9.45711L16.0429 8.04289L11 13.0858L8.20711 10.2929L6.79289 11.7071L11 15.9142L17.4571 9.45711Z"})),s5=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M6.99979 7V3C6.99979 2.44772 7.4475 2 7.99979 2H20.9998C21.5521 2 21.9998 2.44772 21.9998 3V16C21.9998 16.5523 21.5521 17 20.9998 17H17V20.9925C17 21.5489 16.551 22 15.9925 22H3.00728C2.45086 22 2 21.5511 2 20.9925L2.00276 8.00748C2.00288 7.45107 2.4518 7 3.01025 7H6.99979ZM8.99979 7H15.9927C16.549 7 17 7.44892 17 8.00748V15H19.9998V4H8.99979V7ZM15 9H4.00255L4.00021 20H15V9ZM8.50242 18L4.96689 14.4645L6.3811 13.0503L8.50242 15.1716L12.7451 10.9289L14.1593 12.3431L8.50242 18Z"})),Ss=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"})),U1=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM18 8H6V20H18V8ZM9 11H11V17H9V11ZM13 11H15V17H13V11ZM9 4V6H15V4H9Z"})),F1=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M6.41421 15.89L16.5563 5.74785L15.1421 4.33363L5 14.4758V15.89H6.41421ZM7.24264 17.89H3V13.6473L14.435 2.21231C14.8256 1.82179 15.4587 1.82179 15.8492 2.21231L18.6777 5.04074C19.0682 5.43126 19.0682 6.06443 18.6777 6.45495L7.24264 17.89ZM3 19.89H21V21.89H3V19.89Z"})),Kw=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 15H13V17H11V15ZM11 7H13V13H11V7Z"})),Yw=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M21 8V20.9932C21 21.5501 20.5552 22 20.0066 22H3.9934C3.44495 22 3 21.556 3 21.0082V2.9918C3 2.45531 3.4487 2 4.00221 2H14.9968L21 8ZM19 9H14V4H5V20H19V9ZM8 7H11V9H8V7ZM8 11H16V13H8V11ZM8 15H16V17H8V15Z"})),Ww=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM9.71002 19.6674C8.74743 17.6259 8.15732 15.3742 8.02731 13H4.06189C4.458 16.1765 6.71639 18.7747 9.71002 19.6674ZM10.0307 13C10.1811 15.4388 10.8778 17.7297 12 19.752C13.1222 17.7297 13.8189 15.4388 13.9693 13H10.0307ZM19.9381 13H15.9727C15.8427 15.3742 15.2526 17.6259 14.29 19.6674C17.2836 18.7747 19.542 16.1765 19.9381 13ZM4.06189 11H8.02731C8.15732 8.62577 8.74743 6.37407 9.71002 4.33256C6.71639 5.22533 4.458 7.8235 4.06189 11ZM10.0307 11H13.9693C13.8189 8.56122 13.1222 6.27025 12 4.24799C10.8778 6.27025 10.1811 8.56122 10.0307 11ZM14.29 4.33256C15.2526 6.37407 15.8427 8.62577 15.9727 11H19.9381C19.542 7.8235 17.2836 5.22533 14.29 4.33256Z"})),Zw=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12H4C4 16.4183 7.58172 20 12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C9.25022 4 6.82447 5.38734 5.38451 7.50024L8 7.5V9.5H2V3.5H4L3.99989 5.99918C5.82434 3.57075 8.72873 2 12 2ZM13 7L12.9998 11.585L16.2426 14.8284L14.8284 16.2426L10.9998 12.413L11 7H13Z"})),o5=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 7H13V9H11V7ZM11 11H13V17H11V11Z"})),Xw=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M18.364 5.63604L16.9497 7.05025C15.683 5.7835 13.933 5 12 5C8.13401 5 5 8.13401 5 12C5 15.866 8.13401 19 12 19C15.866 19 19 15.866 19 12H21C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C14.4853 3 16.7353 4.00736 18.364 5.63604Z"})),l5=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M12 3C10.9 3 10 3.9 10 5C10 6.1 10.9 7 12 7C13.1 7 14 6.1 14 5C14 3.9 13.1 3 12 3ZM12 17C10.9 17 10 17.9 10 19C10 20.1 10.9 21 12 21C13.1 21 14 20.1 14 19C14 17.9 13.1 17 12 17ZM12 10C10.9 10 10 10.9 10 12C10 13.1 10.9 14 12 14C13.1 14 14 13.1 14 12C14 10.9 13.1 10 12 10Z"})),Qw=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M13 18V20H19V22H13C11.8954 22 11 21.1046 11 20V18H8C5.79086 18 4 16.2091 4 14V7C4 6.44772 4.44772 6 5 6H8V2H10V6H14V2H16V6H19C19.5523 6 20 6.44772 20 7V14C20 16.2091 18.2091 18 16 18H13ZM8 16H16C17.1046 16 18 15.1046 18 14V11H6V14C6 15.1046 6.89543 16 8 16ZM18 8H6V9H18V8ZM12 14.5C11.4477 14.5 11 14.0523 11 13.5C11 12.9477 11.4477 12.5 12 12.5C12.5523 12.5 13 12.9477 13 13.5C13 14.0523 12.5523 14.5 12 14.5Z"})),Jw=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M5.46257 4.43262C7.21556 2.91688 9.5007 2 12 2C17.5228 2 22 6.47715 22 12C22 14.1361 21.3302 16.1158 20.1892 17.7406L17 12H20C20 7.58172 16.4183 4 12 4C9.84982 4 7.89777 4.84827 6.46023 6.22842L5.46257 4.43262ZM18.5374 19.5674C16.7844 21.0831 14.4993 22 12 22C6.47715 22 2 17.5228 2 12C2 9.86386 2.66979 7.88416 3.8108 6.25944L7 12H4C4 16.4183 7.58172 20 12 20C14.1502 20 16.1022 19.1517 17.5398 17.7716L18.5374 19.5674Z"})),Ph=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M18.031 16.6168L22.3137 20.8995L20.8995 22.3137L16.6168 18.031C15.0769 19.263 13.124 20 11 20C6.032 20 2 15.968 2 11C2 6.032 6.032 2 11 2C15.968 2 20 6.032 20 11C20 13.124 19.263 15.0769 18.031 16.6168ZM16.0247 15.8748C17.2475 14.6146 18 12.8956 18 11C18 7.1325 14.8675 4 11 4C7.1325 4 4 7.1325 4 11C4 14.8675 7.1325 18 11 18C12.8956 18 14.6146 17.2475 15.8748 16.0247L16.0247 15.8748Z"})),ek=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M3.5 1.34558C3.58425 1.34558 3.66714 1.36687 3.74096 1.40747L22.2034 11.5618C22.4454 11.6949 22.5337 11.9989 22.4006 12.2409C22.3549 12.324 22.2865 12.3924 22.2034 12.4381L3.74096 22.5924C3.499 22.7255 3.19497 22.6372 3.06189 22.3953C3.02129 22.3214 3 22.2386 3 22.1543V1.84558C3 1.56944 3.22386 1.34558 3.5 1.34558ZM5 4.38249V10.9999H10V12.9999H5V19.6174L18.8499 11.9999L5 4.38249Z"})),c5=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M3.33946 17.0002C2.90721 16.2515 2.58277 15.4702 2.36133 14.6741C3.3338 14.1779 3.99972 13.1668 3.99972 12.0002C3.99972 10.8345 3.3348 9.824 2.36353 9.32741C2.81025 7.71651 3.65857 6.21627 4.86474 4.99001C5.7807 5.58416 6.98935 5.65534 7.99972 5.072C9.01009 4.48866 9.55277 3.40635 9.4962 2.31604C11.1613 1.8846 12.8847 1.90004 14.5031 2.31862C14.4475 3.40806 14.9901 4.48912 15.9997 5.072C17.0101 5.65532 18.2187 5.58416 19.1346 4.99007C19.7133 5.57986 20.2277 6.25151 20.66 7.00021C21.0922 7.7489 21.4167 8.53025 21.6381 9.32628C20.6656 9.82247 19.9997 10.8336 19.9997 12.0002C19.9997 13.166 20.6646 14.1764 21.6359 14.673C21.1892 16.2839 20.3409 17.7841 19.1347 19.0104C18.2187 18.4163 17.0101 18.3451 15.9997 18.9284C14.9893 19.5117 14.4467 20.5941 14.5032 21.6844C12.8382 22.1158 11.1148 22.1004 9.49633 21.6818C9.55191 20.5923 9.00929 19.5113 7.99972 18.9284C6.98938 18.3451 5.78079 18.4162 4.86484 19.0103C4.28617 18.4205 3.77172 17.7489 3.33946 17.0002ZM8.99972 17.1964C10.0911 17.8265 10.8749 18.8227 11.2503 19.9659C11.7486 20.0133 12.2502 20.014 12.7486 19.9675C13.1238 18.8237 13.9078 17.8268 14.9997 17.1964C16.0916 16.5659 17.347 16.3855 18.5252 16.6324C18.8146 16.224 19.0648 15.7892 19.2729 15.334C18.4706 14.4373 17.9997 13.2604 17.9997 12.0002C17.9997 10.74 18.4706 9.5632 19.2729 8.6665C19.1688 8.4405 19.0538 8.21822 18.9279 8.00021C18.802 7.78219 18.667 7.57148 18.5233 7.36842C17.3457 7.61476 16.0911 7.43414 14.9997 6.80405C13.9083 6.17395 13.1246 5.17768 12.7491 4.03455C12.2509 3.98714 11.7492 3.98646 11.2509 4.03292C10.8756 5.17671 10.0916 6.17364 8.99972 6.80405C7.9078 7.43447 6.65245 7.61494 5.47428 7.36803C5.18485 7.77641 4.93463 8.21117 4.72656 8.66637C5.52881 9.56311 5.99972 10.74 5.99972 12.0002C5.99972 13.2604 5.52883 14.4372 4.72656 15.3339C4.83067 15.5599 4.94564 15.7822 5.07152 16.0002C5.19739 16.2182 5.3324 16.4289 5.47612 16.632C6.65377 16.3857 7.90838 16.5663 8.99972 17.1964ZM11.9997 15.0002C10.3429 15.0002 8.99972 13.6571 8.99972 12.0002C8.99972 10.3434 10.3429 9.00021 11.9997 9.00021C13.6566 9.00021 14.9997 10.3434 14.9997 12.0002C14.9997 13.6571 13.6566 15.0002 11.9997 15.0002ZM11.9997 13.0002C12.552 13.0002 12.9997 12.5525 12.9997 12.0002C12.9997 11.4479 12.552 11.0002 11.9997 11.0002C11.4474 11.0002 10.9997 11.4479 10.9997 12.0002C10.9997 12.5525 11.4474 13.0002 11.9997 13.0002Z"})),tk=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M10 3V5H5V19H19V14H21V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H10ZM17.5858 5H13V3H21V11H19V6.41421L12 13.4142L10.5858 12L17.5858 5Z"})),nk=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M20.0833 15.1999L21.2854 15.9212C21.5221 16.0633 21.5989 16.3704 21.4569 16.6072C21.4146 16.6776 21.3557 16.7365 21.2854 16.7787L12.5144 22.0412C12.1977 22.2313 11.8021 22.2313 11.4854 22.0412L2.71451 16.7787C2.47772 16.6366 2.40093 16.3295 2.54301 16.0927C2.58523 16.0223 2.64413 15.9634 2.71451 15.9212L3.9166 15.1999L11.9999 20.0499L20.0833 15.1999ZM20.0833 10.4999L21.2854 11.2212C21.5221 11.3633 21.5989 11.6704 21.4569 11.9072C21.4146 11.9776 21.3557 12.0365 21.2854 12.0787L11.9999 17.6499L2.71451 12.0787C2.47772 11.9366 2.40093 11.6295 2.54301 11.3927C2.58523 11.3223 2.64413 11.2634 2.71451 11.2212L3.9166 10.4999L11.9999 15.3499L20.0833 10.4999ZM12.5144 1.30864L21.2854 6.5712C21.5221 6.71327 21.5989 7.0204 21.4569 7.25719C21.4146 7.32757 21.3557 7.38647 21.2854 7.42869L11.9999 12.9999L2.71451 7.42869C2.47772 7.28662 2.40093 6.97949 2.54301 6.7427C2.58523 6.67232 2.64413 6.61343 2.71451 6.5712L11.4854 1.30864C11.8021 1.11864 12.1977 1.11864 12.5144 1.30864ZM11.9999 3.33233L5.88723 6.99995L11.9999 10.6676L18.1126 6.99995L11.9999 3.33233Z"})),rk=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M3 3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3ZM4 5V19H20V5H4ZM12 15H18V17H12V15ZM8.66685 12L5.83842 9.17157L7.25264 7.75736L11.4953 12L7.25264 16.2426L5.83842 14.8284L8.66685 12Z"})),ak=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M9 4C10.1046 4 11 4.89543 11 6V12.8271C10.1058 12.1373 8.96602 11.7305 7.6644 11.5136L7.3356 13.4864C8.71622 13.7165 9.59743 14.1528 10.1402 14.7408C10.67 15.3147 11 16.167 11 17.5C11 18.8807 9.88071 20 8.5 20C7.11929 20 6 18.8807 6 17.5V17.1493C6.43007 17.2926 6.87634 17.4099 7.3356 17.4864L7.6644 15.5136C6.92149 15.3898 6.1752 15.1144 5.42909 14.7599C4.58157 14.3573 4 13.499 4 12.5C4 11.6653 4.20761 11.0085 4.55874 10.5257C4.90441 10.0504 5.4419 9.6703 6.24254 9.47014L7 9.28078V6C7 4.89543 7.89543 4 9 4ZM12 3.35418C11.2671 2.52376 10.1947 2 9 2C6.79086 2 5 3.79086 5 6V7.77422C4.14895 8.11644 3.45143 8.64785 2.94126 9.34933C2.29239 10.2415 2 11.3347 2 12.5C2 14.0652 2.79565 15.4367 4 16.2422V17.5C4 19.9853 6.01472 22 8.5 22C9.91363 22 11.175 21.3482 12 20.3287C12.825 21.3482 14.0864 22 15.5 22C17.9853 22 20 19.9853 20 17.5V16.2422C21.2044 15.4367 22 14.0652 22 12.5C22 11.3347 21.7076 10.2415 21.0587 9.34933C20.5486 8.64785 19.8511 8.11644 19 7.77422V6C19 3.79086 17.2091 2 15 2C13.8053 2 12.7329 2.52376 12 3.35418ZM18 17.1493V17.5C18 18.8807 16.8807 20 15.5 20C14.1193 20 13 18.8807 13 17.5C13 16.167 13.33 15.3147 13.8598 14.7408C14.4026 14.1528 15.2838 13.7165 16.6644 13.4864L16.3356 11.5136C15.034 11.7305 13.8942 12.1373 13 12.8271V6C13 4.89543 13.8954 4 15 4C16.1046 4 17 4.89543 17 6V9.28078L17.7575 9.47014C18.5581 9.6703 19.0956 10.0504 19.4413 10.5257C19.7924 11.0085 20 11.6653 20 12.5C20 13.499 19.4184 14.3573 18.5709 14.7599C17.8248 15.1144 17.0785 15.3898 16.3356 15.5136L16.6644 17.4864C17.1237 17.4099 17.5699 17.2926 18 17.1493Z"})),ik=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M18.793 5.79285 12.5859 12 18.793 18.2071 20.2072 16.7928 15.4143 12 20.2072 7.20706 18.793 5.79285ZM5.20694 18.2072 11.414 12.0001 5.20694 5.793 3.79272 7.20721 8.58562 12.0001 3.79272 16.793 5.20694 18.2072Z"})),sk=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M14 4.4375C15.3462 4.4375 16.4375 3.34619 16.4375 2H17.5625C17.5625 3.34619 18.6538 4.4375 20 4.4375V5.5625C18.6538 5.5625 17.5625 6.65381 17.5625 8H16.4375C16.4375 6.65381 15.3462 5.5625 14 5.5625V4.4375ZM1 11C4.31371 11 7 8.31371 7 5H9C9 8.31371 11.6863 11 15 11V13C11.6863 13 9 15.6863 9 19H7C7 15.6863 4.31371 13 1 13V11ZM4.87601 12C6.18717 12.7276 7.27243 13.8128 8 15.124 8.72757 13.8128 9.81283 12.7276 11.124 12 9.81283 11.2724 8.72757 10.1872 8 8.87601 7.27243 10.1872 6.18717 11.2724 4.87601 12ZM17.25 14C17.25 15.7949 15.7949 17.25 14 17.25V18.75C15.7949 18.75 17.25 20.2051 17.25 22H18.75C18.75 20.2051 20.2051 18.75 22 18.75V17.25C20.2051 17.25 18.75 15.7949 18.75 14H17.25Z"})),Eb=({color:e="currentColor",size:t=24,className:n,...a})=>nt.createElement("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:e,...a,className:"remixicon "+(n||"")},nt.createElement("path",{d:"M8.00008 6V9H5.00008V6H8.00008ZM3.00008 4V11H10.0001V4H3.00008ZM13.0001 4H21.0001V6H13.0001V4ZM13.0001 11H21.0001V13H13.0001V11ZM13.0001 18H21.0001V20H13.0001V18ZM10.7072 16.2071L9.29297 14.7929L6.00008 18.0858L4.20718 16.2929L2.79297 17.7071L6.00008 20.9142L10.7072 16.2071Z"}));var hd=P3();const $1=10,Tb='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function pd(e){const{open:t,containerRef:n,triggerRef:a,onEscape:s}=e,o=w.useRef(null),c=w.useRef(!1);w.useEffect(()=>{if(t){if(!c.current){const d=document.activeElement;o.current=a?.current??(d instanceof HTMLElement?d:null);const m=n.current;m&&(m.querySelector(Tb)??m).focus?.(),c.current=!0}return()=>{if(!c.current)return;const d=a?.current??o.current;d&&document.contains(d)&&d.focus(),o.current=null,c.current=!1}}c.current=!1},[t,n,a]),w.useEffect(()=>{if(!t)return;const d=n.current;if(!d)return;const m=h=>{if(h.key==="Escape"){h.preventDefault(),s?.();return}if(h.key!=="Tab")return;const p=Array.from(d.querySelectorAll(Tb)).filter(S=>!S.hasAttribute("disabled")&&S.tabIndex!==-1);if(p.length===0){h.preventDefault(),d.focus?.();return}const b=p[0],x=p[p.length-1],y=document.activeElement;h.shiftKey?(y===b||!d.contains(y))&&(h.preventDefault(),x.focus()):(y===x||!d.contains(y))&&(h.preventDefault(),b.focus())};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[t,n,s])}const ok=["command","query","operation","tool","server","symbol","path","file_path","filePath","pattern","glob","url"],lk=120,ck=800;function Zu(e){if(!(!e||typeof e!="object"||Array.isArray(e)))return e}function uk(e){if(e!=null){if(typeof e=="string"){const t=e.trim();if(!t)return;try{return Zu(JSON.parse(t))}catch{return}}return Zu(e)}}function Ya(e,t){const n=e.replace(/\s+/g," ").trim();return n?n.length>t?`${n.slice(0,t)}…`:n:""}function Pn(e,t){const n=e[t];if(typeof n=="string"&&n.trim())return n.trim();if(typeof n=="number"&&Number.isFinite(n))return String(n)}function dk(e,t,n){const a=(e??"").toLowerCase();if(a==="bash"||a==="shell"){const s=Pn(t,"command");return s?Ya(s,n):void 0}if(a==="mcp"||a.startsWith("mcp_")){const s=Pn(t,"server"),o=Pn(t,"tool")??Pn(t,"name"),c=Pn(t,"query");return s&&o?Ya(`${s} · ${o}`,n):o?Ya(o,n):c?Ya(c,n):s?Ya(s,n):void 0}if(a==="lsp_navigation"||a.includes("lsp")){const s=[Pn(t,"operation"),Pn(t,"symbol"),Pn(t,"path")??Pn(t,"file_path")??Pn(t,"filePath")].filter(Boolean),o=Pn(t,"line")??Pn(t,"position");if(s.length===0&&!o)return;const c=s.join(" · ");return Ya(o?`${c}${c?":":""}${o}`:c,n)}if(a==="symbol_search"||a.includes("symbol_search")){const s=Pn(t,"query")??Pn(t,"symbol");return s?Ya(s,n):void 0}if(a==="read"||a==="read_symbol"||a==="read_enclosing"||a.startsWith("read_")){const s=Pn(t,"path")??Pn(t,"file_path")??Pn(t,"filePath"),o=Pn(t,"symbol"),c=Pn(t,"line");if(!s&&!o)return;const d=[s,o,c].filter(Boolean);return Ya(d.join(" · "),n)}}function fk(e,t){const n=t?.maxLen??lk,a=uk(e);if(!a){if(typeof e=="string"){const m=e.replace(/\s+/g," ").trim();return!m||m==="{}"?"":m.length>n?`${m.slice(0,n)}…`:m}return""}const s=dk(t?.toolName,a,n);if(s)return s;for(const m of ok){const h=a[m];if(typeof h=="string"&&h.trim())return Ya(h,n)}const o=Object.keys(a);if(o.length===0)return"";const c=a[o[0]],d=String(c??"").replace(/\s+/g," ").trim();return d?d.length>n?`${d.slice(0,n)}…`:d:""}function mk(e){const t=e?.trim()||"Tool",n=t.toLowerCase();return n==="bash"||n==="shell"||n.includes("exec_command")?{kind:"bash",label:"Bash"}:n==="read"||n==="read_file"||n.startsWith("read_")||n.includes("view_file")?{kind:"read",label:"Read"}:n==="search"||n==="grep"||n==="glob"||n.includes("search")||n.includes("codegraph")||n.includes("lsp")?{kind:"search",label:n==="glob"?"Glob":"Search"}:n==="write"||n==="edit"||n.includes("apply_patch")||n.includes("write_file")||n.includes("edit_file")?{kind:"write",label:n==="write"||n.includes("write_file")?"Write":"Edit"}:n==="web"||n.includes("browser")||n.includes("fetch")||n.includes("web_")?{kind:"web",label:"Web"}:n==="mcp"||n.startsWith("mcp_")||n.includes("__")?{kind:"mcp",label:n==="mcp"?"MCP":t}:{kind:"tool",label:t}}function hk(e){const t=(e??"").toLowerCase();return t==="bash"||t==="shell"?{argsLabel:"命令",resultLabel:"输出"}:t==="mcp"||t.startsWith("mcp_")?{argsLabel:"参数",resultLabel:"结果"}:{argsLabel:"入参",resultLabel:"结果"}}function u5(e){if(e==null)return"";if(typeof e=="string"){const a=e.trim();if(!a)return"";if(a.startsWith("{")&&a.endsWith("}")||a.startsWith("[")&&a.endsWith("]"))try{return u5(JSON.parse(a))}catch{return e}return e}if(typeof e=="number"||typeof e=="boolean")return String(e);const t=Zu(e);if(!t)try{return JSON.stringify(e,null,2)}catch{return String(e)}const n=t.content;if(Array.isArray(n)){const a=[];for(const s of n){const o=Zu(s);o&&(o.type==="text"&&typeof o.text=="string"||typeof o.text=="string")&&a.push(o.text)}if(a.length>0)return a.join(`
|
|
19
|
-
`)}if(typeof t.text=="string")return t.text;if(typeof t.output=="string")return t.output;if(typeof t.message=="string")return t.message;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function pk(e){if(e==null)return"";try{return typeof e=="string"?e:JSON.stringify(e,null,2)}catch{return String(e)}}function gk(e,t){if(e===void 0)return{text:"",truncated:!1};const n=t?.maxLen??ck;return e.length<=n?{text:e,truncated:!1}:{text:`${e.slice(0,n)}…`,truncated:!0}}function bk(e,t){if(t===void 0||!Number.isFinite(e)||!Number.isFinite(t))return;const n=Math.round((t-e)/1e3);return n>0?n:void 0}function qn(){return window.__CONSOLE_CONFIRMATION_TOKEN__??""}function Li(e){return`${e}-${Math.random().toString(36).slice(2,10)}`}function Qf(e,t){return new Promise((n,a)=>{if(t?.aborted){a(new DOMException("Aborted","AbortError"));return}const s=setTimeout(()=>{t?.removeEventListener("abort",o),n()},e),o=()=>{clearTimeout(s),a(new DOMException("Aborted","AbortError"))};t?.addEventListener("abort",o)})}function Hl(e){return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function Jf(e){const t=new Date(e),n=new Date;return t.getFullYear()===n.getFullYear()&&t.getMonth()===n.getMonth()&&t.getDate()===n.getDate()?"今天":t.toLocaleDateString([],{month:"long",day:"numeric"})}function vk(e,t){return e?e.taskId===t.taskId&&e.updatedAt===t.updatedAt&&e.lastEventId===t.lastEventId&&e.operations.length===t.operations.length:!1}const d5={status:"idle",snapshot:null,error:null,reloading:!1,reloadError:null,mutationBusy:!1,mutationToken:null};function P1(e){if(!e||typeof e!="object")return{message:"runtime snapshot request failed"};const t=e,n=t.error;if(n&&typeof n=="object"){const a=n;return{...typeof a.code=="string"&&a.code?{code:a.code}:{},...typeof t.status=="number"?{status:t.status}:{},message:typeof a.message=="string"&&a.message?a.message:"runtime snapshot request failed"}}return{...typeof t.status=="number"?{status:t.status}:{},message:typeof t=="object"&&"message"in t&&typeof t.message=="string"&&t.message?t.message:"runtime snapshot request failed"}}function yk(e,t){switch(t.type){case"load-start":return{...e,sessionId:t.sessionId,status:"loading",error:null};case"load-success":return e.snapshot&&e.sessionId===t.sessionId&&t.snapshot.revision<e.snapshot.revision?e:{...e,sessionId:t.sessionId,status:"ready",snapshot:t.snapshot,error:null,reloadError:null,reloading:!1};case"load-failure":return{...e,sessionId:t.sessionId,status:"error",error:t.error,snapshot:null};case"reload-start":return e.reloading?e:{...e,reloading:!0,reloadError:null,...e.status==="error"?{error:null}:{}};case"reload-success":return{...e,status:"ready",snapshot:t.snapshot,reloading:!1,reloadError:null,error:null,sessionId:t.snapshot.sessionId||e.sessionId};case"reload-failure":return{...e,reloading:!1,reloadError:t.error};case"mutation-start":return{...e,mutationBusy:!0,mutationToken:t.token};case"mutation-adopt":return e.mutationToken!==t.token||e.sessionId!==void 0&&e.sessionId!==t.sessionId||e.snapshot&&t.snapshot.revision<e.snapshot.revision?e:{...e,sessionId:t.sessionId,status:"ready",snapshot:t.snapshot,error:null,reloadError:null,reloading:!1};case"mutation-settle":return e.mutationToken!==t.token?e:{...e,mutationBusy:!1,mutationToken:null};case"mutation-reset":return{...e,mutationBusy:!1,mutationToken:null};case"reset":return{...d5};default:return e}}function f5(e){const t=e.selection;return{...t.model?{model:{provider:t.model.provider,modelId:t.model.id}}:{},...t.thinkingSelection==="auto"?t.effectiveThinkingLevel?{thinkingLevel:t.effectiveThinkingLevel}:{}:{thinkingLevel:t.thinkingSelection}}}function xk(e,t,n,a){const s=n&&n.sessionId===a?f5(n):{},o=s.model??e?.model,c=s.thinkingLevel??e?.thinkingLevel;return{readOnly:t.readOnly,systemPrompt:t.systemPrompt,resources:t.resources,suffix:t.suffix,...o?{model:o}:{},...c?{thinkingLevel:c}:{}}}function wk(e=d5){let t=e;const n=new Set;return{getState:()=>t,dispatch:a=>{t=yk(t,a);for(const s of n)s();return t},subscribe:a=>(n.add(a),()=>n.delete(a))}}function kk(e,t,n){return`${e}/api/operator/v1/chat/sessions/${encodeURIComponent(t)}/skills/${encodeURIComponent(n)}/auto-invocation`}async function Sk(e){const t=e.fetchImpl??fetch;try{const n=await t(kk(e.origin,e.sessionId,e.resourceId),{method:"PATCH",credentials:"include",headers:{"content-type":"application/json","x-loop-console-confirmation":e.confirmationToken},body:JSON.stringify({autoInvocationEnabled:e.autoInvocationEnabled})}),a=await n.json().catch(()=>({}));if(!n.ok||a.ok===!1)return{ok:!1,error:{...P1(a),status:n.status}};const s=a.preferenceSaved===!0,o=a.reloadApplied===!0;if(!s)return{ok:!1,error:{status:n.status,code:"PI_RESOURCE_PREFERENCES_WRITE_FAILED",message:"preference was not saved"}};if(!o){const c=a.error?.code??"PI_SESSION_BUSY",d=a.error?.message??"preference saved; current session is busy and was not reloaded";return{ok:!0,preferenceSaved:!0,reloadApplied:!1,...a.snapshot?{snapshot:a.snapshot}:{},partialBusy:{code:c,message:d}}}return{ok:!0,preferenceSaved:!0,reloadApplied:!0,...a.snapshot?{snapshot:a.snapshot}:{}}}catch(n){return{ok:!1,error:{message:n instanceof Error?n.message:String(n)}}}}const Nn=wk();let Bi;function m5(e){return`/api/operator/v1/chat/sessions/${encodeURIComponent(e)}`}function Ek(e){const t=Bi;if(Bi=e,!(t&&t.sessionId===e.sessionId&&t.origin===e.origin)){if((!t||t.sessionId!==e.sessionId)&&Nn.dispatch({type:"mutation-reset"}),!e.sessionId){Nn.dispatch({type:"reset"});return}Nn.dispatch({type:"load-start",sessionId:e.sessionId}),h5(e.sessionId,e.origin)}}async function h5(e,t){try{const n=await fetch(`${t}${m5(e)}/runtime-snapshot`,{credentials:"include"}),a=await n.json().catch(()=>({}));if(Bi?.sessionId!==e)return;if(!n.ok){Nn.dispatch({type:"load-failure",sessionId:e,error:{...P1(a),status:n.status}});return}if(!a.snapshot){Nn.dispatch({type:"load-failure",sessionId:e,error:{status:n.status,message:"runtime snapshot missing in response"}});return}Nn.dispatch({type:"load-success",sessionId:e,snapshot:a.snapshot})}catch(n){if(Bi?.sessionId!==e)return;Nn.dispatch({type:"load-failure",sessionId:e,error:{message:n instanceof Error?n.message:String(n)}})}}async function Xu(){const e=Bi;if(!e?.sessionId||Nn.getState().reloading)return!1;const t=e.sessionId;Nn.dispatch({type:"reload-start"});try{const n=await fetch(`${e.origin}${m5(t)}/reload`,{method:"POST",credentials:"include",headers:{"content-type":"application/json","x-loop-console-confirmation":qn()},body:"{}"}),a=await n.json().catch(()=>({}));return Bi?.sessionId!==t?!1:n.ok?a.snapshot?(Nn.dispatch({type:"reload-success",snapshot:a.snapshot}),!0):(Nn.dispatch({type:"reload-failure",error:{status:n.status,message:"reload succeeded but snapshot missing"}}),!1):(Nn.dispatch({type:"reload-failure",error:{...P1(a),status:n.status}}),!1)}catch(n){return Bi?.sessionId!==t||Nn.dispatch({type:"reload-failure",error:{message:n instanceof Error?n.message:String(n)}}),!1}}async function Gh(){const e=Bi;if(!e?.sessionId)return!1;const t=e.sessionId;return Nn.dispatch({type:"load-start",sessionId:t}),h5(t,e.origin),!0}function Tk(e,t,n){return n?(Nn.dispatch({type:"mutation-adopt",token:e,sessionId:t,snapshot:n}),Nn.getState().snapshot===n):!1}function Ck(e,t,n){return n.sessionRef.current?.sessionId!==t||Nn.getState().mutationToken!==e?!1:(Nn.dispatch({type:"mutation-settle",token:e}),!0)}function Wl(){return w.useSyncExternalStore(Nn.subscribe,Nn.getState)}function p5(e){Nn.dispatch(e)}function Rk(){return Nn.getState()}const Cb=[{id:"version",label:"版本信息"},{id:"models",label:"模型"},{id:"skills",label:"技能"},{id:"plugins",label:"插件"},{id:"mcp",label:"MCP"}];function fs({children:e}){return u.jsx("p",{className:"oc-settings-empty",children:e})}function Nk(e){return e==="loaded"?"已加载":e==="configured"?"已配置":e==="disabled"?"未启用":"状态未知"}function Ak(e){return e==="ready"?"可正常使用":e==="setup-required"?"需要完成模型设置":e==="degraded"?"部分功能暂时不可用":"正在检查…"}function Ik(e){const[t,n]=w.useState("version"),[a,s]=w.useState(null),[o,c]=w.useState(null),[d,m]=w.useState(null),[h,p]=w.useState({}),[b,x]=w.useState(null),[y,S]=w.useState(null),T=w.useRef(null),A=Wl(),C=A.snapshot;pd({open:e.open,containerRef:T,triggerRef:e.triggerRef,onEscape:e.onClose}),w.useEffect(()=>{if(!e.open)return;let N=!0;return c(null),fetch(`${e.origin}/api/health`,{credentials:"include"}).then(async z=>{const X=await z.json();if(!z.ok)throw new Error("版本信息读取失败");N&&s(X)}).catch(z=>{N&&c(z instanceof Error?z.message:String(z))}),()=>{N=!1}},[e.open,e.origin]);const M=w.useMemo(()=>[...C?.packages.map(N=>({name:N.packageName??N.spec,detail:N.version?`v${N.version}`:N.spec,enabled:N.enabled}))??[],...C?.extensions.map(N=>({name:N.name,detail:N.scope,enabled:N.enabled}))??[]],[C]);w.useEffect(()=>{m(null),p({}),x(null),S(null)},[C?.sessionId]);const I=(N,z)=>Object.hasOwn(h,N)?h[N]:z,P=async N=>{if(!C?.sessionId||!N.resourceId||d)return;const z=!I(N.resourceId,N.autoInvocationEnabled);m(N.resourceId),S(null),x(null),p(B=>({...B,[N.resourceId]:z}));const X=await Sk({origin:e.origin,sessionId:C.sessionId,resourceId:N.resourceId,autoInvocationEnabled:z,confirmationToken:qn()});if(m(null),!X.ok){p(B=>{const $={...B};return delete $[N.resourceId],$}),S(`${X.error.code?`${X.error.code}:`:""}${X.error.message}`);return}if(X.reloadApplied&&X.snapshot){p5({type:"load-success",sessionId:C.sessionId,snapshot:X.snapshot}),p(B=>{const $={...B};return delete $[N.resourceId],$});return}X.partialBusy&&x("设置已保存,将在本轮对话结束并重新加载会话后生效。")};if(!e.open||typeof document>"u")return null;const U=()=>{if(t==="version")return u.jsxs("div",{className:"oc-settings-version-grid",children:[u.jsxs("div",{children:[u.jsx("span",{children:"产品"}),u.jsx("strong",{children:a?.productName??a?.product??"Loop Agent"})]}),u.jsxs("div",{children:[u.jsx("span",{children:"版本"}),u.jsx("strong",{children:a?.packageVersion??(o?"读取失败":"读取中…")})]}),u.jsxs("div",{children:[u.jsx("span",{children:"Pi 状态"}),u.jsx("strong",{children:Ak(e.readiness)})]}),o?u.jsx("p",{className:"oc-settings-error",children:o}):null]});if(A.status==="loading"||A.status==="idle")return u.jsx(fs,{children:"正在读取当前会话的运行配置…"});if(A.status==="error")return u.jsx(fs,{children:A.error?.message??"运行配置读取失败"});if(!C)return u.jsx(fs,{children:"新建或打开一个会话后即可查看。"});if(t==="models")return C.models.length?u.jsx("ul",{className:"oc-settings-list",children:C.models.map(z=>{const X=C.selection.model?.provider===z.provider&&C.selection.model.id===z.id;return u.jsxs("li",{children:[u.jsxs("div",{children:[u.jsx("strong",{children:z.name??z.id}),u.jsxs("span",{children:[z.provider," / ",z.id]})]}),X?u.jsx("em",{children:"当前"}):null]},`${z.provider}/${z.id}`)})}):u.jsx(fs,{children:"当前会话没有可用模型。"});if(t==="skills")return C.skills.length?u.jsxs("div",{className:"oc-settings-skill-section",children:[u.jsx("p",{className:"oc-settings-help",children:"开启后允许模型自动选择并注入该技能上下文;关闭后仍可手动调用。"}),y?u.jsx("p",{className:"oc-settings-error",role:"alert",children:y}):null,b?u.jsx("p",{className:"oc-settings-notice",role:"status",children:b}):null,u.jsx("ul",{className:"oc-settings-list",children:C.skills.map(z=>{const X=I(z.resourceId,z.autoInvocationEnabled),B=d===z.resourceId;return u.jsxs("li",{children:[u.jsxs("div",{children:[u.jsx("strong",{children:z.name}),u.jsx("span",{children:z.description||z.scope})]}),u.jsxs("div",{className:"oc-settings-skill-control",children:[u.jsx("em",{children:X?"已启用":"未启用"}),u.jsx("button",{type:"button",className:`oc-toggle${X?" is-on":""}`,role:"switch","aria-checked":X,"aria-label":`${X?"关闭":"开启"} ${z.name} 自动注入上下文`,disabled:B||!!d||!z.resourceId,title:B?"保存中…":"控制模型是否可自动选择该技能",onClick:()=>{P(z)},children:u.jsx("span",{className:"oc-toggle-knob","aria-hidden":"true"})})]})]},z.resourceId)})})]}):u.jsx(fs,{children:"当前会话没有加载技能。"});if(t==="plugins")return M.length?u.jsx("ul",{className:"oc-settings-list",children:M.map((z,X)=>u.jsxs("li",{children:[u.jsxs("div",{children:[u.jsx("strong",{children:z.name}),u.jsx("span",{children:z.detail})]}),u.jsx("em",{children:z.enabled?"已启用":"未启用"})]},`${z.name}-${X}`))}):u.jsx(fs,{children:"当前会话没有加载插件。"});const N=C.mcp?.servers??[];return N.length?u.jsx("ul",{className:"oc-settings-list",children:N.map(z=>u.jsxs("li",{children:[u.jsxs("div",{children:[u.jsx("strong",{children:z.name}),u.jsxs("span",{children:[z.tools.length," 个工具 · ",z.transport??z.scope]})]}),u.jsx("em",{children:Nk(z.status)})]},z.name))}):u.jsx(fs,{children:"当前会话没有加载 MCP 服务。"})};return hd.createPortal(u.jsx("div",{className:"oc-settings-backdrop",onMouseDown:N=>{N.target===N.currentTarget&&e.onClose()},children:u.jsxs("section",{ref:T,className:"oc-settings-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"oc-settings-title",tabIndex:-1,children:[u.jsxs("header",{className:"oc-settings-head",children:[u.jsxs("div",{children:[u.jsx("h2",{id:"oc-settings-title",children:"设置"}),u.jsx("p",{children:"Loop Agent Console"})]}),u.jsx("button",{type:"button",onClick:e.onClose,"aria-label":"关闭设置",title:"关闭",children:u.jsx(Ss,{size:18,"aria-hidden":"true"})})]}),u.jsxs("div",{className:"oc-settings-layout",children:[u.jsx("nav",{"aria-label":"设置分类",children:Cb.map(N=>u.jsx("button",{type:"button",className:t===N.id?"is-active":"","aria-current":t===N.id?"page":void 0,onClick:()=>n(N.id),children:N.label},N.id))}),u.jsxs("div",{className:"oc-settings-content",children:[u.jsx("h3",{children:Cb.find(N=>N.id===t)?.label}),U()]})]})]})}),document.body)}function _k(){return u.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[u.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),u.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}function Mk(){return u.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:u.jsx("polyline",{points:"20 6 9 17 4 12"})})}function Rb(){return u.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[u.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),u.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})}function Ok(){return u.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:u.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}function Vh({side:e="left"}){return u.jsx("svg",{className:`oc-panel-icon${e==="right"?" is-right":""}`,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.67272 0.522841C10.8339 0.522841 11.76 0.522714 12.4963 0.602493C13.2453 0.683657 13.8789 0.854248 14.4264 1.25197C14.7504 1.48739 15.0355 1.77247 15.2709 2.0965C15.6686 2.64394 15.8392 3.27758 15.9204 4.02655C16.0002 4.7629 16 5.68895 16 6.85014V9.14986C16 10.3111 16.0002 11.2371 15.9204 11.9735C15.8392 12.7224 15.6686 13.3561 15.2709 13.9035C15.0355 14.2275 14.7504 14.5126 14.4264 14.748C13.8789 15.1458 13.2453 15.3163 12.4963 15.3975C11.76 15.4773 10.8339 15.4772 9.67272 15.4772H6.3273C5.16611 15.4772 4.24006 15.4773 3.50371 15.3975C2.75474 15.3163 2.1211 15.1458 1.57366 14.748C1.24963 14.5126 0.964549 14.2275 0.729131 13.9035C0.331407 13.3561 0.160817 12.7224 0.0796529 11.9735C-0.000126137 11.2371 0 10.3111 0 9.14986V6.85014C0 5.68895-0.000126137 4.7629 0.0796529 4.02655C0.160817 3.27758 0.331407 2.64394 0.729131 2.0965C0.964549 1.77247 1.24963 1.48739 1.57366 1.25197C2.1211 0.854248 2.75474 0.683657 3.50371 0.602493C4.24006 0.522714 5.16611 0.522841 6.3273 0.522841H9.67272ZM5.54303 1.88715V14.1118C5.78636 14.1128 6.04709 14.1169 6.3273 14.1169H9.67272C10.8639 14.1169 11.7032 14.1164 12.3493 14.0465C12.9824 13.9779 13.3497 13.8494 13.6268 13.6482C13.8354 13.4966 14.0195 13.3125 14.1711 13.1039C14.3723 12.8268 14.5007 12.4595 14.5693 11.8264C14.6393 11.1803 14.6398 10.341 14.6398 9.14986V6.85014C14.6398 5.65896 14.6393 4.81967 14.5693 4.1736C14.5007 3.54048 14.3723 3.17318 14.1711 2.89609C14.0195 2.68747 13.8354 2.50337 13.6268 2.35179C13.3497 2.1506 12.9824 2.02212 12.3493 1.95353C11.7032 1.88358 10.8639 1.88307 9.67272 1.88307H6.3273C6.04709 1.88307 5.78636 1.8862 5.54303 1.88715ZM4.1828 1.91166C3.99125 1.9216 3.8148 1.93577 3.65076 1.95353C3.01764 2.02212 2.65034 2.1506 2.37325 2.35179C2.16463 2.50337 1.98052 2.68747 1.82895 2.89609C1.62776 3.17318 1.49928 3.54048 1.43069 4.1736C1.36074 4.81967 1.36023 5.65896 1.36023 6.85014V9.14986C1.36023 10.341 1.36074 11.1803 1.43069 11.8264C1.49928 12.4595 1.62776 12.8268 1.82895 13.1039C1.98052 13.3125 2.16463 13.4966 2.37325 13.6482C2.65034 13.8494 3.01764 13.9779 3.65076 14.0465C3.81478 14.0642 3.99127 14.0774 4.1828 14.0873V1.91166Z",fill:"currentColor"})})}function Dk(){return u.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("path",{d:"M4 4l8 8M12 4l-8 8",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function g5(){return u.jsx("svg",{className:"oc-tool-chevron",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:u.jsx("polyline",{points:"2.5 4 6 7.5 9.5 4"})})}function jk({open:e}){return u.jsx("svg",{className:`oc-tree-chevron${e?" is-open":""}`,width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",children:u.jsx("path",{d:"M4.2 2.4 7.8 6 4.2 9.6",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function Lk({open:e}){return u.jsx("svg",{className:`oc-workspace-chevron${e?" is-open":""}`,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:u.jsx("path",{d:"M4.25 2.82782V11.1722C4.25 11.6622 4.84243 11.9076 5.18891 11.5611L9.36109 7.38891C9.57588 7.17412 9.57588 6.82588 9.36109 6.61109L5.18891 2.43891C4.84243 2.09243 4.25 2.33782 4.25 2.82782Z",fill:"currentColor"})})}function zk(){return u.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("path",{d:"M3 3.5h10v2H3v-2Zm0 3.5h10v2H3V7Zm0 3.5h7V13H3v-2Z",fill:"currentColor"})})}function Bk(){return u.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("path",{d:"M8 3v10M3 8h10",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})})}function b5(){return u.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("path",{d:"M2 4h5l1 1.5h6V13H2V4Z",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"})})}function qk({open:e}){return u.jsx("svg",{className:`oc-tree-glyph${e?" is-folder-open":" is-folder"}`,width:"14",height:"14",viewBox:"0 0 14 14","aria-hidden":"true",children:u.jsx("path",{d:"M1.5 4h3.2l1 1.1H12a.8.8 0 0 1 .8.8v5.3a.8.8 0 0 1-.8.8H2a.8.8 0 0 1-.8-.8V4.8a.8.8 0 0 1 .8-.8Z",fill:"currentColor",opacity:e?.9:.68})})}function Hk(){return u.jsx("svg",{className:"oc-tree-glyph is-file",width:"14",height:"14",viewBox:"0 0 14 14","aria-hidden":"true",children:u.jsx("path",{d:"M3.2 1.6h5.1L10.8 4v8.4a.8.8 0 0 1-.8.8H3.2a.8.8 0 0 1-.8-.8V2.4a.8.8 0 0 1 .8-.8Z",fill:"currentColor",opacity:"0.55"})})}function Uk(e){return[...e].sort((t,n)=>t.kind!==n.kind?t.kind==="directory"?-1:1:t.name.localeCompare(n.name,void 0,{sensitivity:"base"}))}function v5(e){const t=w.useMemo(()=>Uk(e.entries),[e.entries]);return t.length?u.jsx("ul",{className:"oc-tree",role:e.depth===0?"tree":"group",children:t.map(n=>{const a=n.kind==="directory"&&e.expanded.has(n.path);return u.jsxs("li",{className:`oc-tree-node is-${n.kind}${a?" is-open":""}`,role:"treeitem","aria-expanded":n.kind==="directory"?a:void 0,children:[u.jsxs("button",{type:"button",className:`oc-tree-row oc-tree-${n.kind==="directory"?"dir":"file"}`,style:{paddingLeft:`${8+e.depth*12}px`},onClick:()=>n.kind==="directory"?e.onToggle(n.path):e.onPreview(n.path),children:[n.kind==="directory"?u.jsxs(u.Fragment,{children:[u.jsx(jk,{open:a}),u.jsx(qk,{open:a})]}):u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"oc-tree-chevron-spacer","aria-hidden":"true"}),u.jsx(Hk,{})]}),u.jsx("span",{className:"oc-tree-label",children:n.name}),u.jsx("span",{className:"oc-tree-at",role:"button",tabIndex:0,"aria-label":`插入 ${n.name} 引用`,onClick:s=>{s.stopPropagation(),e.onInsert(n.kind==="directory"?`${n.path}/`:n.path)},onKeyDown:s=>{s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),e.onInsert(n.kind==="directory"?`${n.path}/`:n.path))},children:"@"})]}),n.kind==="directory"&&a?u.jsx(v5,{...e,entries:e.tree[n.path]??[],depth:e.depth+1}):null]},n.path)})}):u.jsx("p",{className:"oc-tree-empty",children:"此目录为空或没有可安全浏览的文件。"})}function Nb(e){return u.jsxs("section",{className:"oc-details-files","aria-label":"Workspace 文件",children:[u.jsxs("header",{children:[u.jsx("span",{className:"oc-details-workspace-name",title:e.workspaceName,children:e.workspaceName}),u.jsx("button",{type:"button",className:"btn btn-ghost",onClick:e.onRefresh,"aria-label":"刷新文件",title:"刷新文件",children:u.jsx(Jw,{size:15,"aria-hidden":"true"})})]}),e.treeError?u.jsx("p",{className:"oc-sidebar-error",role:"alert",children:e.treeError}):null,u.jsx("div",{className:"oc-details-tree-scroll",children:u.jsx(v5,{entries:e.tree[""]??[],tree:e.tree,expanded:e.expanded,depth:0,onToggle:e.onToggle,onInsert:e.onInsert,onPreview:e.onPreview})})]})}function Ab(e,t=Date.now()){const n=new Date(e).getTime();if(!Number.isFinite(n))return"";const a=Math.max(0,t-n),s=Math.floor(a/6e4);if(s<1)return"刚刚";if(s<60)return`${s}分钟`;const o=Math.floor(s/60);if(o<24)return`${o}小时`;const c=Math.floor(o/24);if(c<30)return`${c}天`;const d=Math.floor(c/30);return d<12?`${d}个月`:`${Math.floor(d/12)}年`}function y5(e){const t=new Date(e);return Number.isFinite(t.getTime())?t.toLocaleString("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):"时间未知"}function x5(e=!1){const[t,n]=w.useState(null),a=w.useRef(null),s=w.useRef(null),o=w.useCallback(()=>{a.current!==null&&window.clearTimeout(a.current),s.current!==null&&window.clearTimeout(s.current),a.current=null,s.current=null},[]),c=w.useCallback(()=>{o(),n(null)},[o]);w.useEffect(()=>{e&&c()},[c,e]),w.useEffect(()=>c,[c]);const d=w.useCallback(p=>{if(e||(s.current!==null&&(window.clearTimeout(s.current),s.current=null),t))return;const b=p.currentTarget.getBoundingClientRect();a.current=window.setTimeout(()=>{n({left:Math.min(b.right+8,window.innerWidth-252),top:Math.max(8,Math.min(b.top,window.innerHeight-180))})},500)},[e,t]),m=w.useCallback(()=>{a.current!==null&&(window.clearTimeout(a.current),a.current=null),t&&(s.current=window.setTimeout(c,180))},[c,t]),h=w.useCallback(()=>{s.current!==null&&(window.clearTimeout(s.current),s.current=null)},[]);return{position:t,close:c,onPointerEnter:d,onPointerLeave:m,onCardPointerEnter:h}}function w5(e){return!e.position||typeof document>"u"?null:hd.createPortal(u.jsx("div",{className:"oc-sidebar-hover-card",style:{left:e.position.left,top:e.position.top},onPointerEnter:e.onPointerEnter,onPointerLeave:e.onPointerLeave,children:e.children}),document.body)}function Fk(e){const{item:t,active:n,streamingNow:a,turnPhaseNow:s,state:o,deleteConfirming:c,deleting:d}=e,m=s??t.turnPhase,h=a||m==="running"||m==="stopping"||!!t.activeTurnId,p=t.deferredTurn?.state==="failed"?"发送失败":t.deferredTurn?.state==="dispatching"||t.deferredTurn?.state==="accepted"?"发送中":t.deferredTurn?.state==="queued"?"待发送":null,b=t.title||t.displayTitle||"未命名对话",x=y5(t.updatedAt),y=new Date(t.updatedAt),S=Number.isFinite(y.getTime())?y.toISOString():void 0,T=w.useRef(null),A=w.useRef(null),C=w.useRef(null),[M,I]=w.useState(null),P=x5(!!M||c);return w.useEffect(()=>{const U=X=>{C.current?.contains(X.target)||A.current?.contains(X.target)||(c&&e.onCancelDelete(),I(null))},N=()=>{P.close(),I(null)},z=X=>{X.key==="Escape"&&(P.close(),c&&e.onCancelDelete(),I(null))};return document.addEventListener("mousedown",U),window.addEventListener("scroll",N,!0),window.addEventListener("keydown",z),()=>{document.removeEventListener("mousedown",U),window.removeEventListener("scroll",N,!0),window.removeEventListener("keydown",z)}},[c,P.close,e.onCancelDelete]),w.useEffect(()=>{c&&T.current?.focus()},[c]),u.jsxs("div",{className:`oc-session-item${n?" is-active":""}${c?" is-delete-confirming":""}${M?" is-menu-open":""}`,"data-session-id":t.sessionId,onPointerEnter:P.onPointerEnter,onPointerLeave:P.onPointerLeave,children:[u.jsxs("a",{href:e.href,className:"oc-session-main","aria-disabled":d||void 0,tabIndex:d?-1:void 0,onClick:U=>{if(d){U.preventDefault();return}e.onActivate()},children:[u.jsx("strong",{children:b}),u.jsx("time",{dateTime:S,title:x,children:Ab(t.updatedAt,e.now)})]}),h?u.jsx("span",{className:"oc-session-running","aria-label":"对话进行中",title:"对话进行中",children:u.jsx("span",{className:"oc-spinner","aria-hidden":"true"})}):null,p?u.jsx("span",{className:`oc-session-queue-state is-${t.deferredTurn?.state}`,children:p}):null,u.jsx("div",{className:"oc-session-actions",children:u.jsx("button",{type:"button",ref:A,className:"oc-session-menu","data-session-delete-id":t.sessionId,title:"更多","aria-label":`${b} 更多操作`,"aria-expanded":!!M,onClick:U=>{if(U.stopPropagation(),P.close(),M){I(null);return}const N=U.currentTarget.getBoundingClientRect();I({left:Math.max(8,Math.min(N.right-176,window.innerWidth-184)),top:Math.min(N.bottom+5,window.innerHeight-128)})},children:u.jsx(l5,{size:16,"aria-hidden":"true"})})}),u.jsxs(w5,{position:P.position,onPointerEnter:P.onCardPointerEnter,onPointerLeave:P.onPointerLeave,children:[u.jsx("strong",{children:b}),u.jsxs("span",{children:[Ab(t.updatedAt,e.now)," · ",x]}),u.jsxs("span",{className:"oc-sidebar-hover-status",children:[u.jsx("i",{className:h?"is-running":""}),p??(h?"对话进行中":o==="archived"?"已归档":"空闲")]})]}),M&&typeof document<"u"?hd.createPortal(u.jsx("div",{ref:C,className:"oc-session-popover-menu",role:"menu",style:{left:M.left,top:M.top},children:c?u.jsxs("div",{className:"oc-session-menu-confirm",children:[u.jsx("span",{children:"确定删除这个会话?"}),u.jsxs("div",{children:[u.jsx("button",{type:"button",ref:T,className:"is-danger",disabled:d,"aria-label":`确认删除会话:${b}`,"aria-busy":d||void 0,onClick:()=>e.onConfirmDelete(),children:d?"删除中…":"删除"}),u.jsx("button",{type:"button",disabled:d,"aria-label":"取消删除会话",onClick:()=>{e.onCancelDelete(),I(null)},children:"取消"})]})]}):u.jsxs(u.Fragment,{children:[u.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{I(null);const U=window.prompt("会话名称",t.title||t.displayTitle||"");U!==null&&e.onRename(U)},children:[u.jsx(F1,{size:16,"aria-hidden":"true"}),"编辑标题"]}),u.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{I(null),e.onSetState(o==="active"?"archived":"active")},children:[u.jsx(Zw,{size:16,"aria-hidden":"true"}),o==="active"?"归档会话":"恢复会话"]}),u.jsxs("button",{type:"button",role:"menuitem",className:"is-danger",onClick:()=>e.onRequestDelete(),children:[u.jsx(U1,{size:16,"aria-hidden":"true"}),"删除会话"]})]})}),document.body):null]})}function $k(e){const{workspace:t,active:n}=e,a=e.deletingSessionId,s=e.cancelDelete,[o,c]=w.useState(!0),[d,m]=w.useState(!1),h=w.useRef(null),p=x5(d);w.useEffect(()=>{if(!d)return;const x=S=>{h.current?.contains(S.target)||m(!1)},y=S=>{S.key==="Escape"&&m(!1)};return document.addEventListener("mousedown",x),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",x),document.removeEventListener("keydown",y)}},[d]);const b=w.useMemo(()=>e.sessions.filter(x=>x.workspaceId===t.workspaceId||n&&!x.workspaceId),[n,e.sessions,t.workspaceId]);return u.jsxs("div",{className:`oc-workspace-item${n?" is-active":""}`,"data-workspace-id":t.workspaceId,"aria-current":n?"true":void 0,children:[u.jsxs("div",{className:"oc-workspace-row",children:[u.jsxs("button",{type:"button",className:"oc-workspace-main",onMouseDown:x=>x.preventDefault(),onClick:()=>{if(n){c(x=>!x);return}c(!0),e.onActivateWorkspaceRow()},"aria-expanded":n&&o,onPointerEnter:p.onPointerEnter,onPointerLeave:p.onPointerLeave,children:[u.jsx("span",{className:"oc-workspace-caret","aria-hidden":"true",children:u.jsx(Lk,{open:o&&n})}),u.jsx("span",{className:"oc-workspace-folder","aria-hidden":"true",children:u.jsx(b5,{})}),u.jsx("strong",{children:t.name})]}),u.jsxs("div",{className:"oc-workspace-actions",ref:h,children:[u.jsx("button",{type:"button",title:"更多","aria-label":`${t.name} 更多操作`,"aria-expanded":d,onClick:x=>{x.stopPropagation(),m(y=>!y)},children:u.jsx(l5,{size:16,"aria-hidden":"true"})}),u.jsx("button",{type:"button",title:"新建对话","aria-label":`在 ${t.name} 新建对话`,disabled:e.creatingSession,onClick:x=>{x.stopPropagation(),e.onCreateSession()},children:e.creatingSession?u.jsx("span",{className:"oc-spinner","aria-hidden":"true"}):u.jsx(Wu,{size:16,"aria-hidden":"true"})}),d?u.jsxs("div",{className:"oc-workspace-menu",role:"menu",children:[u.jsxs("button",{type:"button",role:"menuitem",onClick:()=>{m(!1),e.onCreateSession()},children:[u.jsx(Wu,{size:15,"aria-hidden":"true"}),"新建对话"]}),u.jsxs("button",{type:"button",role:"menuitem",className:"is-danger",disabled:e.removing,onClick:()=>{m(!1),e.onRemove()},children:[u.jsx(U1,{size:15,"aria-hidden":"true"}),e.removing?"移除中…":"移除工作区"]})]}):null]}),u.jsxs(w5,{position:p.position,onPointerEnter:p.onCardPointerEnter,onPointerLeave:p.onPointerLeave,children:[u.jsx("strong",{children:t.name}),u.jsx("span",{className:"oc-sidebar-hover-path",children:t.displayPath}),t.createdAt?u.jsxs("span",{children:["添加于 ",y5(t.createdAt)]}):null]})]}),n&&o?u.jsxs("div",{className:"oc-workspace-sessions",children:[["active","archived"].map(x=>{const y=b.filter(S=>S.state===x);return y.length?u.jsx("div",{className:"oc-session-group",children:y.map(S=>u.jsx(Fk,{item:S,href:H1(),active:e.activeSessionId===S.sessionId,streamingNow:e.activeSessionId===S.sessionId&&e.activeSessionStreaming===!0,turnPhaseNow:e.activeSessionId===S.sessionId?e.activeSessionTurnPhase:void 0,state:x,deleteConfirming:e.pendingDeleteSessionId===S.sessionId,deleting:e.deletingSessionId===S.sessionId,onActivate:()=>{a||(s(!1),e.onActivate(S.sessionId))},onRename:T=>e.onRenameSession(S.sessionId,T),onSetState:T=>e.onSetSessionState(S.sessionId,T),onRequestDelete:()=>e.onRequestDeleteSession(S),onConfirmDelete:()=>e.onConfirmDeleteSession(S.sessionId),onCancelDelete:()=>e.onCancelDeleteSession(),now:e.now},S.sessionId))},x):null}),b.length===0?u.jsx("p",{className:"oc-tree-empty",children:"此工作区暂无会话。"}):null]}):null]})}function Pk(e){const[t,n]=w.useState(!1),[a,s]=w.useState(""),[o,c]=w.useState(!1),[d,m]=w.useState(()=>Date.now()),h=w.useRef(null),p=w.useMemo(()=>{const H=a.trim().toLocaleLowerCase();return e.sessions.slice(0,$1).filter(_=>!H||(_.title||_.displayTitle||"未命名对话").toLocaleLowerCase().includes(H))},[e.sessions,a]);w.useEffect(()=>{const H=window.setInterval(()=>m(Date.now()),6e4);return()=>window.clearInterval(H)},[]);const[b,x]=w.useState(null),[y,S]=w.useState(null),T=w.useRef(null),A=w.useRef(!1),C=e.layoutMode==="comfortable"&&e.open,M=e.layoutMode==="compact",I=e.drawerOpen&&(e.layoutMode==="compact"||e.layoutMode==="narrow"),P=w.useCallback((H=!0)=>{if(y)return;const _=b;x(null),!(!H||!_)&&window.requestAnimationFrame(()=>{const Y=typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(_):_.replace(/["\\]/g,"\\$&");document.querySelector(`[data-session-delete-id="${Y}"]`)?.focus()})},[y,b]),U=w.useCallback(()=>{y||(x(null),e.onCloseDrawer())},[y,e.onCloseDrawer]),N=w.useCallback(()=>{if(b){P();return}U()},[P,U,b]);pd({open:I,containerRef:T,triggerRef:e.drawerTriggerRef,onEscape:N}),w.useEffect(()=>{A.current&&!I&&!y&&x(null),A.current=I},[y,I]),w.useEffect(()=>{b&&!p.some(H=>H.sessionId===b)&&x(null),y&&!p.some(H=>H.sessionId===y)&&S(null)},[y,b,p]),w.useEffect(()=>{if(I||!b)return;const H=_=>{_.key==="Escape"&&(_.preventDefault(),P())};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[P,b,I]);const z=w.useCallback(async H=>{if(!(y||b!==H)){S(H);try{await e.onDelete(H)}finally{S(null),x(null)}}},[y,b,e.onDelete]),X=w.useCallback(()=>{y||(P(!1),e.onCreate())},[P,y,e.onCreate]),B=w.useCallback(H=>{y||(P(!1),e.onCreateInWorkspace?e.onCreateInWorkspace(H):e.onCreate())},[P,y,e.onCreateInWorkspace,e.onCreate]),$=w.useCallback(()=>{y||(P(!1),e.onToggleOpen())},[P,y,e.onToggleOpen]),[F,K]=w.useState(!1),oe=w.useCallback(async()=>{if(!(F||e.addingWorkspace)){K(!0);try{const H=await e.onPickWorkspaceDirectory();H&&await e.onAddWorkspace(H)}finally{K(!1)}}},[F,e.addingWorkspace,e.onAddWorkspace,e.onPickWorkspaceDirectory]),J=u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"oc-sidebar-primary-actions",children:[u.jsxs("button",{type:"button",className:"oc-sidebar-new-session",onClick:X,disabled:e.creatingSession,"aria-busy":e.creatingSession||void 0,children:[u.jsx(Wu,{size:17,"aria-hidden":"true"}),e.creatingSession?"创建中…":"新会话"]}),e.layoutMode==="comfortable"?u.jsx("button",{type:"button",className:"oc-sidebar-toggle",onClick:$,"aria-expanded":!0,"aria-label":"收起侧栏",title:"收起侧栏",children:u.jsx(Vh,{})}):u.jsx("button",{type:"button",className:"oc-sidebar-toggle",onClick:U,"aria-label":"关闭侧栏抽屉",title:"关闭",children:u.jsx(Ss,{size:16,"aria-hidden":"true"})})]}),u.jsxs("section",{className:"oc-sidebar-section oc-workspaces","aria-busy":e.workspacesLoading||void 0,"aria-label":"Workspace 与会话",children:[u.jsxs("header",{children:[u.jsx("strong",{children:"工作区"}),u.jsxs("div",{className:"oc-sidebar-header-actions",children:[u.jsx("button",{type:"button",className:"oc-sidebar-icon-action","aria-label":"搜索会话",title:"搜索会话","aria-expanded":t,"aria-controls":"oc-session-search",onClick:()=>n(H=>!H),children:u.jsx(Ph,{size:16,"aria-hidden":"true"})}),u.jsx("button",{type:"button",className:"oc-sidebar-icon-action","aria-label":"添加工作区",title:F?"选择目录中…":"添加工作区","aria-busy":F||void 0,disabled:F||e.addingWorkspace,onClick:()=>{oe()},children:u.jsx(Wu,{size:16,"aria-hidden":"true"})})]})]}),t?u.jsxs("div",{className:"oc-session-search-wrap",children:[u.jsx(Ph,{size:15,"aria-hidden":"true"}),u.jsx("input",{id:"oc-session-search",type:"search",value:a,onChange:H=>s(H.target.value),placeholder:"搜索会话…","aria-label":"搜索会话",autoFocus:!0})]}):null,e.workspacesError?u.jsxs("p",{className:"oc-sidebar-error",role:"alert",children:[e.workspacesError," ",u.jsx("button",{type:"button",className:"btn btn-ghost",onClick:e.onDismissWorkspaceError,"aria-label":"关闭错误提示",children:u.jsx(Ss,{size:12,"aria-hidden":"true"})})]}):null,u.jsx("div",{className:"oc-workspace-list",children:e.workspacesLoading&&e.workspaces.length===0?u.jsx("p",{className:"oc-workspace-loading",children:"正在加载 Workspace…"}):e.workspaces.length===0?u.jsx("p",{className:"oc-workspace-empty",children:"还没有工作区。点击右上角的 + 选择一个文件夹开始。"}):e.workspaces.map(H=>u.jsx($k,{workspace:H,active:e.activeWorkspaceId===H.workspaceId,removing:e.removingWorkspaceId===H.workspaceId,sessions:p,activeSessionId:e.activeSessionId,activeSessionStreaming:e.activeSessionStreaming,activeSessionTurnPhase:e.activeSessionTurnPhase,creatingSession:e.creatingSession,pendingDeleteSessionId:b,deletingSessionId:y,cancelDelete:P,onActivateWorkspaceRow:()=>e.onActivateWorkspace(H.workspaceId),onRemove:()=>e.onRemoveWorkspace(H.workspaceId),onCreateSession:()=>B(H.workspaceId),onActivate:_=>{y||(P(!1),e.onActivate(_))},onRenameSession:e.onRename,onSetSessionState:e.onSetState,onRequestDeleteSession:_=>{y||x(_.sessionId)},onConfirmDeleteSession:_=>{z(_)},onCancelDeleteSession:()=>P(),now:d},H.workspaceId))})]}),u.jsx("div",{className:"oc-sidebar-footer",children:u.jsxs("button",{type:"button",ref:h,className:"oc-sidebar-settings",onClick:()=>c(!0),"aria-label":"打开设置",title:"设置",children:[u.jsx(c5,{size:16,"aria-hidden":"true"}),"设置"]})}),u.jsx(Ik,{open:o,origin:e.origin,readiness:e.readiness,onClose:()=>c(!1),triggerRef:h})]});return u.jsxs(u.Fragment,{children:[M?u.jsxs("nav",{className:"oc-sidebar-rail","aria-label":"紧凑侧栏",children:[u.jsx("button",{type:"button",className:"oc-sidebar-rail-btn","aria-label":"打开 Workspace 与会话",title:"Workspace 与会话","aria-expanded":I,onClick:()=>I?U():e.onOpenDrawer(),children:u.jsx(zk,{})}),u.jsx("button",{type:"button",className:"oc-sidebar-rail-btn","aria-label":e.creatingSession?"创建会话中":"新建会话",title:e.creatingSession?"创建中…":"新建会话",onClick:X,disabled:e.creatingSession,"aria-busy":e.creatingSession||void 0,children:u.jsx(Bk,{})}),u.jsx("button",{type:"button",className:"oc-sidebar-rail-btn","aria-label":"Workspace",title:"Workspace",onClick:()=>I?U():e.onOpenDrawer(),children:u.jsx(b5,{})})]}):null,e.layoutMode==="comfortable"?u.jsx("aside",{className:`oc-sidebar${C?"":" is-collapsed"}`,"aria-label":"Workspace 与会话",children:C?J:u.jsx("button",{type:"button",className:"oc-sidebar-toggle is-collapsed",onClick:$,"aria-expanded":!1,"aria-label":"展开侧栏",title:"展开侧栏",children:u.jsx(Vh,{})})}):null,I?u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",className:"oc-overlay-backdrop","aria-label":"关闭侧栏遮罩",onClick:U}),u.jsx("aside",{ref:T,className:"oc-sidebar oc-sidebar-drawer","aria-label":"Workspace 与会话抽屉",role:"dialog","aria-modal":"true",tabIndex:-1,children:J})]}):null]})}const Gk="modulepreload",Vk=function(e){return"/"+e},Ib={},Kk=function(t,n,a){let s=Promise.resolve();if(n&&n.length>0){let m=function(h){return Promise.all(h.map(p=>Promise.resolve(p).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),d=c?.nonce||c?.getAttribute("nonce");s=m(n.map(h=>{if(h=Vk(h),h in Ib)return;Ib[h]=!0;const p=h.endsWith(".css"),b=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${b}`))return;const x=document.createElement("link");if(x.rel=p?"stylesheet":Gk,p||(x.as="script"),x.crossOrigin="",x.href=h,d&&x.setAttribute("nonce",d),document.head.appendChild(x),p)return new Promise((y,S)=>{x.addEventListener("load",y),x.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${h}`)))})}))}function o(c){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=c,window.dispatchEvent(d),!d.defaultPrevented)throw c}return s.then(c=>{for(const d of c||[])d.status==="rejected"&&o(d.reason);return t().catch(o)})};function _b(e){const t=[],n=String(e||"");let a=n.indexOf(","),s=0,o=!1;for(;!o;){a===-1&&(a=n.length,o=!0);const c=n.slice(s,a).trim();(c||!o)&&t.push(c),s=a+1,a=n.indexOf(",",s)}return t}function Yk(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Wk=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Zk=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Xk={};function Mb(e,t){return(Xk.jsx?Zk:Wk).test(e)}const Qk=/[ \t\n\f\r]/g;function Jk(e){return typeof e=="object"?e.type==="text"?Ob(e.value):!1:Ob(e)}function Ob(e){return e.replace(Qk,"")===""}class Zl{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}Zl.prototype.normal={};Zl.prototype.property={};Zl.prototype.space=void 0;function k5(e,t){const n={},a={};for(const s of e)Object.assign(n,s.property),Object.assign(a,s.normal);return new Zl(n,a,t)}function Ul(e){return e.toLowerCase()}class Rr{constructor(t,n){this.attribute=n,this.property=t}}Rr.prototype.attribute="";Rr.prototype.booleanish=!1;Rr.prototype.boolean=!1;Rr.prototype.commaOrSpaceSeparated=!1;Rr.prototype.commaSeparated=!1;Rr.prototype.defined=!1;Rr.prototype.mustUseProperty=!1;Rr.prototype.number=!1;Rr.prototype.overloadedBoolean=!1;Rr.prototype.property="";Rr.prototype.spaceSeparated=!1;Rr.prototype.space=void 0;let eS=0;const yt=Cs(),Bn=Cs(),Kh=Cs(),Oe=Cs(),cn=Cs(),ws=Cs(),zr=Cs();function Cs(){return 2**++eS}const Yh=Object.freeze(Object.defineProperty({__proto__:null,boolean:yt,booleanish:Bn,commaOrSpaceSeparated:zr,commaSeparated:ws,number:Oe,overloadedBoolean:Kh,spaceSeparated:cn},Symbol.toStringTag,{value:"Module"})),em=Object.keys(Yh);class G1 extends Rr{constructor(t,n,a,s){let o=-1;if(super(t,n),Db(this,"space",s),typeof a=="number")for(;++o<em.length;){const c=em[o];Db(this,em[o],(a&Yh[c])===Yh[c])}}}G1.prototype.defined=!0;function Db(e,t,n){n&&(e[t]=n)}function xo(e){const t={},n={};for(const[a,s]of Object.entries(e.properties)){const o=new G1(a,e.transform(e.attributes||{},a),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(o.mustUseProperty=!0),t[a]=o,n[Ul(a)]=a,n[Ul(o.attribute)]=a}return new Zl(t,n,e.space)}const S5=xo({properties:{ariaActiveDescendant:null,ariaAtomic:Bn,ariaAutoComplete:null,ariaBusy:Bn,ariaChecked:Bn,ariaColCount:Oe,ariaColIndex:Oe,ariaColSpan:Oe,ariaControls:cn,ariaCurrent:null,ariaDescribedBy:cn,ariaDetails:null,ariaDisabled:Bn,ariaDropEffect:cn,ariaErrorMessage:null,ariaExpanded:Bn,ariaFlowTo:cn,ariaGrabbed:Bn,ariaHasPopup:null,ariaHidden:Bn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:cn,ariaLevel:Oe,ariaLive:null,ariaModal:Bn,ariaMultiLine:Bn,ariaMultiSelectable:Bn,ariaOrientation:null,ariaOwns:cn,ariaPlaceholder:null,ariaPosInSet:Oe,ariaPressed:Bn,ariaReadOnly:Bn,ariaRelevant:null,ariaRequired:Bn,ariaRoleDescription:cn,ariaRowCount:Oe,ariaRowIndex:Oe,ariaRowSpan:Oe,ariaSelected:Bn,ariaSetSize:Oe,ariaSort:null,ariaValueMax:Oe,ariaValueMin:Oe,ariaValueNow:Oe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function E5(e,t){return t in e?e[t]:t}function T5(e,t){return E5(e,t.toLowerCase())}const tS=xo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ws,acceptCharset:cn,accessKey:cn,action:null,allow:null,allowFullScreen:yt,allowPaymentRequest:yt,allowUserMedia:yt,alpha:yt,alt:null,as:null,async:yt,autoCapitalize:null,autoComplete:cn,autoFocus:yt,autoPlay:yt,blocking:cn,capture:null,charSet:null,checked:yt,cite:null,className:cn,closedBy:null,colorSpace:null,cols:Oe,colSpan:Oe,command:null,commandFor:null,content:null,contentEditable:Bn,controls:yt,controlsList:cn,coords:Oe|ws,crossOrigin:null,data:null,dateTime:null,decoding:null,default:yt,defer:yt,dir:null,dirName:null,disabled:yt,download:Kh,draggable:Bn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:yt,formTarget:null,headers:cn,height:Oe,hidden:Kh,high:Oe,href:null,hrefLang:null,htmlFor:cn,httpEquiv:cn,id:null,imageSizes:null,imageSrcSet:null,inert:yt,inputMode:null,integrity:null,is:null,isMap:yt,itemId:null,itemProp:cn,itemRef:cn,itemScope:yt,itemType:cn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:yt,low:Oe,manifest:null,max:null,maxLength:Oe,media:null,method:null,min:null,minLength:Oe,multiple:yt,muted:yt,name:null,nonce:null,noModule:yt,noValidate:yt,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:yt,optimum:Oe,pattern:null,ping:cn,placeholder:null,playsInline:yt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:yt,referrerPolicy:null,rel:cn,required:yt,reversed:yt,rows:Oe,rowSpan:Oe,sandbox:cn,scope:null,scoped:yt,seamless:yt,selected:yt,shadowRootClonable:yt,shadowRootCustomElementRegistry:yt,shadowRootDelegatesFocus:yt,shadowRootMode:null,shadowRootSerializable:yt,shape:null,size:Oe,sizes:null,slot:null,span:Oe,spellCheck:Bn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Oe,step:null,style:null,tabIndex:Oe,target:null,title:null,translate:null,type:null,typeMustMatch:yt,useMap:null,value:Bn,width:Oe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:cn,axis:null,background:null,bgColor:null,border:Oe,borderColor:null,bottomMargin:Oe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:yt,declare:yt,event:null,face:null,frame:null,frameBorder:null,hSpace:Oe,leftMargin:Oe,link:null,longDesc:null,lowSrc:null,marginHeight:Oe,marginWidth:Oe,noResize:yt,noHref:yt,noShade:yt,noWrap:yt,object:null,profile:null,prompt:null,rev:null,rightMargin:Oe,rules:null,scheme:null,scrolling:Bn,standby:null,summary:null,text:null,topMargin:Oe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Oe,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:yt,disablePictureInPicture:yt,disableRemotePlayback:yt,exportParts:ws,part:cn,prefix:null,property:null,results:Oe,security:null,unselectable:null},space:"html",transform:T5}),nS=xo({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:zr,accentHeight:Oe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Oe,amplitude:Oe,arabicForm:null,ascent:Oe,attributeName:null,attributeType:null,azimuth:Oe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Oe,by:null,calcMode:null,capHeight:Oe,className:cn,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:Oe,diffuseConstant:Oe,direction:null,display:null,dur:null,divisor:Oe,dominantBaseline:null,download:yt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Oe,enableBackground:null,end:null,event:null,exponent:Oe,externalResourcesRequired:null,fill:null,fillOpacity:Oe,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:ws,g2:ws,glyphName:ws,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Oe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Oe,horizOriginX:Oe,horizOriginY:Oe,id:null,ideographic:Oe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Oe,k:Oe,k1:Oe,k2:Oe,k3:Oe,k4:Oe,kernelMatrix:zr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Oe,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:Oe,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:Oe,overlineThickness:Oe,paintOrder:null,panose1:null,path:null,pathLength:Oe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:cn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Oe,pointsAtY:Oe,pointsAtZ:Oe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:zr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:zr,rev:zr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:zr,requiredFeatures:zr,requiredFonts:zr,requiredFormats:zr,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:Oe,specularExponent:Oe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Oe,strikethroughThickness:Oe,string:null,stroke:null,strokeDashArray:zr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Oe,strokeOpacity:Oe,strokeWidth:null,style:null,surfaceScale:Oe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:zr,tabIndex:Oe,tableValues:null,target:null,targetX:Oe,targetY:Oe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:zr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Oe,underlineThickness:Oe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Oe,values:null,vAlphabetic:Oe,vMathematical:Oe,vectorEffect:null,vHanging:Oe,vIdeographic:Oe,version:null,vertAdvY:Oe,vertOriginX:Oe,vertOriginY:Oe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Oe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:E5}),C5=xo({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()}}),R5=xo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:T5}),N5=xo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),rS={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"},aS=/[A-Z]/g,jb=/-[a-z]/g,iS=/^data[-\w.:]+$/i;function A5(e,t){const n=Ul(t);let a=t,s=Rr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&iS.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(jb,oS);a="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!jb.test(o)){let c=o.replace(aS,sS);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}s=G1}return new s(a,t)}function sS(e){return"-"+e.toLowerCase()}function oS(e){return e.charAt(1).toUpperCase()}const I5=k5([S5,tS,C5,R5,N5],"html"),gd=k5([S5,nS,C5,R5,N5],"svg");function Lb(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function lS(e){return e.join(" ").trim()}var lo={},tm,zb;function cS(){if(zb)return tm;zb=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,d=/^\s+|\s+$/g,m=`
|
|
20
|
-
`,h="/",p="*",b="",x="comment",y="declaration";function S(A,C){if(typeof A!="string")throw new TypeError("First argument must be a string");if(!A)return[];C=C||{};var M=1,I=1;function P(J){var H=J.match(t);H&&(M+=H.length);var _=J.lastIndexOf(m);I=~_?J.length-_:I+J.length}function U(){var J={line:M,column:I};return function(H){return H.position=new N(J),B(),H}}function N(J){this.start=J,this.end={line:M,column:I},this.source=C.source}N.prototype.content=A;function z(J){var H=new Error(C.source+":"+M+":"+I+": "+J);if(H.reason=J,H.filename=C.source,H.line=M,H.column=I,H.source=A,!C.silent)throw H}function X(J){var H=J.exec(A);if(H){var _=H[0];return P(_),A=A.slice(_.length),H}}function B(){X(n)}function $(J){var H;for(J=J||[];H=F();)H!==!1&&J.push(H);return J}function F(){var J=U();if(!(h!=A.charAt(0)||p!=A.charAt(1))){for(var H=2;b!=A.charAt(H)&&(p!=A.charAt(H)||h!=A.charAt(H+1));)++H;if(H+=2,b===A.charAt(H-1))return z("End of comment missing");var _=A.slice(2,H-2);return I+=2,P(_),A=A.slice(H),I+=2,J({type:x,comment:_})}}function K(){var J=U(),H=X(a);if(H){if(F(),!X(s))return z("property missing ':'");var _=X(o),Y=J({type:y,property:T(H[0].replace(e,b)),value:_?T(_[0].replace(e,b)):b});return X(c),Y}}function oe(){var J=[];$(J);for(var H;H=K();)H!==!1&&(J.push(H),$(J));return J}return B(),oe()}function T(A){return A?A.replace(d,b):b}return tm=S,tm}var Bb;function uS(){if(Bb)return lo;Bb=1;var e=lo&&lo.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(lo,"__esModule",{value:!0}),lo.default=n;const t=e(cS());function n(a,s){let o=null;if(!a||typeof a!="string")return o;const c=(0,t.default)(a),d=typeof s=="function";return c.forEach(m=>{if(m.type!=="declaration")return;const{property:h,value:p}=m;d?s(h,p,m):p&&(o=o||{},o[h]=p)}),o}return lo}var vl={},qb;function dS(){if(qb)return vl;qb=1,Object.defineProperty(vl,"__esModule",{value:!0}),vl.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,o=function(h){return!h||n.test(h)||e.test(h)},c=function(h,p){return p.toUpperCase()},d=function(h,p){return"".concat(p,"-")},m=function(h,p){return p===void 0&&(p={}),o(h)?h:(h=h.toLowerCase(),p.reactCompat?h=h.replace(s,d):h=h.replace(a,d),h.replace(t,c))};return vl.camelCase=m,vl}var yl,Hb;function fS(){if(Hb)return yl;Hb=1;var e=yl&&yl.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(uS()),n=dS();function a(s,o){var c={};return!s||typeof s!="string"||(0,t.default)(s,function(d,m){d&&m&&(c[(0,n.camelCase)(d,o)]=m)}),c}return a.default=a,yl=a,yl}var mS=fS();const hS=dd(mS),_5=M5("end"),V1=M5("start");function M5(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 pS(e){const t=V1(e),n=_5(e);if(t&&n)return{start:t,end:n}}function _l(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ub(e.position):"start"in e||"end"in e?Ub(e):"line"in e||"column"in e?Wh(e):""}function Wh(e){return Fb(e&&e.line)+":"+Fb(e&&e.column)}function Ub(e){return Wh(e&&e.start)+"-"+Wh(e&&e.end)}function Fb(e){return e&&typeof e=="number"?e:1}class ar extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let s="",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"?s=t:!o.cause&&t&&(c=!0,s=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof a=="string"){const m=a.indexOf(":");m===-1?o.ruleId=a:(o.source=a.slice(0,m),o.ruleId=a.slice(m+1))}if(!o.place&&o.ancestors&&o.ancestors){const m=o.ancestors[o.ancestors.length-1];m&&(o.place=m.position)}const d=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=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=d?d.line:void 0,this.name=_l(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}}ar.prototype.file="";ar.prototype.name="";ar.prototype.reason="";ar.prototype.message="";ar.prototype.stack="";ar.prototype.column=void 0;ar.prototype.line=void 0;ar.prototype.ancestors=void 0;ar.prototype.cause=void 0;ar.prototype.fatal=void 0;ar.prototype.place=void 0;ar.prototype.ruleId=void 0;ar.prototype.source=void 0;const K1={}.hasOwnProperty,gS=new Map,bS=/[A-Z]/g,vS=new Set(["table","tbody","thead","tfoot","tr"]),yS=new Set(["td","th"]),O5="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function xS(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=NS(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=RS(n,t.jsx,t.jsxs)}const s={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"?gd:I5,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=D5(s,e,void 0);return o&&typeof o!="string"?o:s.create(e,s.Fragment,{children:o||void 0},void 0)}function D5(e,t,n){if(t.type==="element")return wS(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return kS(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return ES(e,t,n);if(t.type==="mdxjsEsm")return SS(e,t);if(t.type==="root")return TS(e,t,n);if(t.type==="text")return CS(e,t)}function wS(e,t,n){const a=e.schema;let s=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(s=gd,e.schema=s),e.ancestors.push(t);const o=L5(e,t.tagName,!1),c=AS(e,t);let d=W1(e,t);return vS.has(t.tagName)&&(d=d.filter(function(m){return typeof m=="string"?!Jk(m):!0})),j5(e,c,o,t),Y1(c,d),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function kS(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)}Fl(e,t.position)}function SS(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Fl(e,t.position)}function ES(e,t,n){const a=e.schema;let s=a;t.name==="svg"&&a.space==="html"&&(s=gd,e.schema=s),e.ancestors.push(t);const o=t.name===null?e.Fragment:L5(e,t.name,!0),c=IS(e,t),d=W1(e,t);return j5(e,c,o,t),Y1(c,d),e.ancestors.pop(),e.schema=a,e.create(t,o,c,n)}function TS(e,t,n){const a={};return Y1(a,W1(e,t)),e.create(t,e.Fragment,a,n)}function CS(e,t){return t.value}function j5(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function Y1(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function RS(e,t,n){return a;function a(s,o,c,d){const h=Array.isArray(c.children)?n:t;return d?h(o,c,d):h(o,c)}}function NS(e,t){return n;function n(a,s,o,c){const d=Array.isArray(o.children),m=V1(a);return t(s,o,c,d,{columnNumber:m?m.column-1:void 0,fileName:e,lineNumber:m?m.line:void 0},void 0)}}function AS(e,t){const n={};let a,s;for(s in t.properties)if(s!=="children"&&K1.call(t.properties,s)){const o=_S(e,s,t.properties[s]);if(o){const[c,d]=o;e.tableCellAlignToStyle&&c==="align"&&typeof d=="string"&&yS.has(t.tagName)?a=d:n[c]=d}}if(a){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function IS(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 d=c.properties[0];d.type,Object.assign(n,e.evaluater.evaluateExpression(d.argument))}else Fl(e,t.position);else{const s=a.name;let o;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const d=a.value.data.estree.body[0];d.type,o=e.evaluater.evaluateExpression(d.expression)}else Fl(e,t.position);else o=a.value===null?!0:a.value;n[s]=o}return n}function W1(e,t){const n=[];let a=-1;const s=e.passKeys?new Map:gS;for(;++a<t.children.length;){const o=t.children[a];let c;if(e.passKeys){const m=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(m){const h=s.get(m)||0;c=m+"-"+h,s.set(m,h+1)}}const d=D5(e,o,c);d!==void 0&&n.push(d)}return n}function _S(e,t,n){const a=A5(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?Yk(n):lS(n)),a.property==="style"){let s=typeof n=="object"?n:MS(e,String(n));return e.stylePropertyNameCase==="css"&&(s=OS(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&a.space?rS[a.property]||a.property:a.attribute,n]}}function MS(e,t){try{return hS(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,s=new ar("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=O5+"#cannot-parse-style-attribute",s}}function L5(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let o=-1,c;for(;++o<s.length;){const d=Mb(s[o])?{type:"Identifier",name:s[o]}:{type:"Literal",value:s[o]};c=c?{type:"MemberExpression",object:c,property:d,computed:!!(o&&d.type==="Literal"),optional:!1}:d}a=c}else a=Mb(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const s=a.value;return K1.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(a);Fl(e)}function Fl(e,t){const n=new ar("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=O5+"#cannot-handle-mdx-estrees-without-createevaluater",n}function OS(e){const t={};let n;for(n in e)K1.call(e,n)&&(t[DS(n)]=e[n]);return t}function DS(e){let t=e.replace(bS,jS);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function jS(e){return"-"+e.toLowerCase()}const nm={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"]},LS={};function Z1(e,t){const n=LS,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return z5(e,a,s)}function z5(e,t,n){if(zS(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 $b(e.children,t,n)}return Array.isArray(e)?$b(e,t,n):""}function $b(e,t,n){const a=[];let s=-1;for(;++s<e.length;)a[s]=z5(e[s],t,n);return a.join("")}function zS(e){return!!(e&&typeof e=="object")}const Pb=document.createElement("i");function X1(e){const t="&"+e+";";Pb.innerHTML=t;const n=Pb.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Br(e,t,n,a){const s=e.length;let o=0,c;if(t<0?t=-t>s?0:s+t:t=t>s?s: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 Jr(e,t){return e.length>0?(Br(e,e.length,0,t),e):t}const Gb={}.hasOwnProperty;function B5(e){const t={};let n=-1;for(;++n<e.length;)BS(t,e[n]);return t}function BS(e,t){let n;for(n in t){const s=(Gb.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let c;if(o)for(c in o){Gb.call(s,c)||(s[c]=[]);const d=o[c];qS(s[c],Array.isArray(d)?d:d?[d]:[])}}}function qS(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);Br(e,0,0,a)}function q5(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 ua(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ur=Gi(/[A-Za-z]/),nr=Gi(/[\dA-Za-z]/),HS=Gi(/[#-'*+\--9=?A-Z^-~]/);function Qu(e){return e!==null&&(e<32||e===127)}const Zh=Gi(/\d/),US=Gi(/[\dA-Fa-f]/),FS=Gi(/[!-/:-@[-`{-~]/);function tt(e){return e!==null&&e<-2}function un(e){return e!==null&&(e<0||e===32)}function qt(e){return e===-2||e===-1||e===32}const bd=Gi(new RegExp("\\p{P}|\\p{S}","u")),Es=Gi(/\s/);function Gi(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function wo(e){const t=[];let n=-1,a=0,s=0;for(;++n<e.length;){const o=e.charCodeAt(n);let c="";if(o===37&&nr(e.charCodeAt(n+1))&&nr(e.charCodeAt(n+2)))s=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(c=String.fromCharCode(o));else if(o>55295&&o<57344){const d=e.charCodeAt(n+1);o<56320&&d>56319&&d<57344?(c=String.fromCharCode(o,d),s=1):c="�"}else c=String.fromCharCode(o);c&&(t.push(e.slice(a,n),encodeURIComponent(c)),a=n+s+1,c=""),s&&(n+=s,s=0)}return t.join("")+e.slice(a)}function Dt(e,t,n,a){const s=a?a-1:Number.POSITIVE_INFINITY;let o=0;return c;function c(m){return qt(m)?(e.enter(n),d(m)):t(m)}function d(m){return qt(m)&&o++<s?(e.consume(m),d):(e.exit(n),t(m))}}const $S={tokenize:PS};function PS(e){const t=e.attempt(this.parser.constructs.contentInitial,a,s);let n;return t;function a(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),Dt(e,t,"linePrefix")}function s(d){return e.enter("paragraph"),o(d)}function o(d){const m=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=m),n=m,c(d)}function c(d){if(d===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(d);return}return tt(d)?(e.consume(d),e.exit("chunkText"),o):(e.consume(d),c)}}const GS={tokenize:VS},Vb={tokenize:KS};function VS(e){const t=this,n=[];let a=0,s,o,c;return d;function d(I){if(a<n.length){const P=n[a];return t.containerState=P[1],e.attempt(P[0].continuation,m,h)(I)}return h(I)}function m(I){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&M();const P=t.events.length;let U=P,N;for(;U--;)if(t.events[U][0]==="exit"&&t.events[U][1].type==="chunkFlow"){N=t.events[U][1].end;break}C(a);let z=P;for(;z<t.events.length;)t.events[z][1].end={...N},z++;return Br(t.events,U+1,0,t.events.slice(P)),t.events.length=z,h(I)}return d(I)}function h(I){if(a===n.length){if(!s)return x(I);if(s.currentConstruct&&s.currentConstruct.concrete)return S(I);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Vb,p,b)(I)}function p(I){return s&&M(),C(a),x(I)}function b(I){return t.parser.lazy[t.now().line]=a!==n.length,c=t.now().offset,S(I)}function x(I){return t.containerState={},e.attempt(Vb,y,S)(I)}function y(I){return a++,n.push([t.currentConstruct,t.containerState]),x(I)}function S(I){if(I===null){s&&M(),C(0),e.consume(I);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:o}),T(I)}function T(I){if(I===null){A(e.exit("chunkFlow"),!0),C(0),e.consume(I);return}return tt(I)?(e.consume(I),A(e.exit("chunkFlow")),a=0,t.interrupt=void 0,d):(e.consume(I),T)}function A(I,P){const U=t.sliceStream(I);if(P&&U.push(null),I.previous=o,o&&(o.next=I),o=I,s.defineSkip(I.start),s.write(U),t.parser.lazy[I.start.line]){let N=s.events.length;for(;N--;)if(s.events[N][1].start.offset<c&&(!s.events[N][1].end||s.events[N][1].end.offset>c))return;const z=t.events.length;let X=z,B,$;for(;X--;)if(t.events[X][0]==="exit"&&t.events[X][1].type==="chunkFlow"){if(B){$=t.events[X][1].end;break}B=!0}for(C(a),N=z;N<t.events.length;)t.events[N][1].end={...$},N++;Br(t.events,X+1,0,t.events.slice(z)),t.events.length=N}}function C(I){let P=n.length;for(;P-- >I;){const U=n[P];t.containerState=U[1],U[0].exit.call(t,e)}n.length=I}function M(){s.write([null]),o=void 0,s=void 0,t.containerState._closeFlow=void 0}}function KS(e,t,n){return Dt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ho(e){if(e===null||un(e)||Es(e))return 1;if(bd(e))return 2}function vd(e,t,n){const a=[];let s=-1;for(;++s<e.length;){const o=e[s].resolveAll;o&&!a.includes(o)&&(t=o(t,n),a.push(o))}return t}const Xh={name:"attention",resolveAll:YS,tokenize:WS};function YS(e,t){let n=-1,a,s,o,c,d,m,h,p;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;m=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 b={...e[a][1].end},x={...e[n][1].start};Kb(b,-m),Kb(x,m),c={type:m>1?"strongSequence":"emphasisSequence",start:b,end:{...e[a][1].end}},d={type:m>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:x},o={type:m>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},s={type:m>1?"strong":"emphasis",start:{...c.start},end:{...d.end}},e[a][1].end={...c.start},e[n][1].start={...d.end},h=[],e[a][1].end.offset-e[a][1].start.offset&&(h=Jr(h,[["enter",e[a][1],t],["exit",e[a][1],t]])),h=Jr(h,[["enter",s,t],["enter",c,t],["exit",c,t],["enter",o,t]]),h=Jr(h,vd(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),h=Jr(h,[["exit",o,t],["enter",d,t],["exit",d,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,h=Jr(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Br(e,a-1,n-a+3,h),n=a+h.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function WS(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,s=ho(a);let o;return c;function c(m){return o=m,e.enter("attentionSequence"),d(m)}function d(m){if(m===o)return e.consume(m),d;const h=e.exit("attentionSequence"),p=ho(m),b=!p||p===2&&s||n.includes(m),x=!s||s===2&&p||n.includes(a);return h._open=!!(o===42?b:b&&(s||!x)),h._close=!!(o===42?x:x&&(p||!b)),t(m)}}function Kb(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const ZS={name:"autolink",tokenize:XS};function XS(e,t,n){let a=0;return s;function s(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(y){return ur(y)?(e.consume(y),c):y===64?n(y):h(y)}function c(y){return y===43||y===45||y===46||nr(y)?(a=1,d(y)):h(y)}function d(y){return y===58?(e.consume(y),a=0,m):(y===43||y===45||y===46||nr(y))&&a++<32?(e.consume(y),d):(a=0,h(y))}function m(y){return y===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):y===null||y===32||y===60||Qu(y)?n(y):(e.consume(y),m)}function h(y){return y===64?(e.consume(y),p):HS(y)?(e.consume(y),h):n(y)}function p(y){return nr(y)?b(y):n(y)}function b(y){return y===46?(e.consume(y),a=0,p):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):x(y)}function x(y){if((y===45||nr(y))&&a++<63){const S=y===45?x:b;return e.consume(y),S}return n(y)}}const Xl={partial:!0,tokenize:QS};function QS(e,t,n){return a;function a(o){return qt(o)?Dt(e,s,"linePrefix")(o):s(o)}function s(o){return o===null||tt(o)?t(o):n(o)}}const H5={continuation:{tokenize:eE},exit:tE,name:"blockQuote",tokenize:JS};function JS(e,t,n){const a=this;return s;function s(c){if(c===62){const d=a.containerState;return d.open||(e.enter("blockQuote",{_container:!0}),d.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),o}return n(c)}function o(c){return qt(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function eE(e,t,n){const a=this;return s;function s(c){return qt(c)?Dt(e,o,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):o(c)}function o(c){return e.attempt(H5,t,n)(c)}}function tE(e){e.exit("blockQuote")}const U5={name:"characterEscape",tokenize:nE};function nE(e,t,n){return a;function a(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),s}function s(o){return FS(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const F5={name:"characterReference",tokenize:rE};function rE(e,t,n){const a=this;let s=0,o,c;return d;function d(b){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(b),e.exit("characterReferenceMarker"),m}function m(b){return b===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(b),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),o=31,c=nr,p(b))}function h(b){return b===88||b===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(b),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,c=US,p):(e.enter("characterReferenceValue"),o=7,c=Zh,p(b))}function p(b){if(b===59&&s){const x=e.exit("characterReferenceValue");return c===nr&&!X1(a.sliceSerialize(x))?n(b):(e.enter("characterReferenceMarker"),e.consume(b),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(b)&&s++<o?(e.consume(b),p):n(b)}}const Yb={partial:!0,tokenize:iE},Wb={concrete:!0,name:"codeFenced",tokenize:aE};function aE(e,t,n){const a=this,s={partial:!0,tokenize:U};let o=0,c=0,d;return m;function m(N){return h(N)}function h(N){const z=a.events[a.events.length-1];return o=z&&z[1].type==="linePrefix"?z[2].sliceSerialize(z[1],!0).length:0,d=N,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(N)}function p(N){return N===d?(c++,e.consume(N),p):c<3?n(N):(e.exit("codeFencedFenceSequence"),qt(N)?Dt(e,b,"whitespace")(N):b(N))}function b(N){return N===null||tt(N)?(e.exit("codeFencedFence"),a.interrupt?t(N):e.check(Yb,T,P)(N)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(N))}function x(N){return N===null||tt(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),b(N)):qt(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Dt(e,y,"whitespace")(N)):N===96&&N===d?n(N):(e.consume(N),x)}function y(N){return N===null||tt(N)?b(N):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(N))}function S(N){return N===null||tt(N)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),b(N)):N===96&&N===d?n(N):(e.consume(N),S)}function T(N){return e.attempt(s,P,A)(N)}function A(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),C}function C(N){return o>0&&qt(N)?Dt(e,M,"linePrefix",o+1)(N):M(N)}function M(N){return N===null||tt(N)?e.check(Yb,T,P)(N):(e.enter("codeFlowValue"),I(N))}function I(N){return N===null||tt(N)?(e.exit("codeFlowValue"),M(N)):(e.consume(N),I)}function P(N){return e.exit("codeFenced"),t(N)}function U(N,z,X){let B=0;return $;function $(H){return N.enter("lineEnding"),N.consume(H),N.exit("lineEnding"),F}function F(H){return N.enter("codeFencedFence"),qt(H)?Dt(N,K,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):K(H)}function K(H){return H===d?(N.enter("codeFencedFenceSequence"),oe(H)):X(H)}function oe(H){return H===d?(B++,N.consume(H),oe):B>=c?(N.exit("codeFencedFenceSequence"),qt(H)?Dt(N,J,"whitespace")(H):J(H)):X(H)}function J(H){return H===null||tt(H)?(N.exit("codeFencedFence"),z(H)):X(H)}}}function iE(e,t,n){const a=this;return s;function s(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 rm={name:"codeIndented",tokenize:oE},sE={partial:!0,tokenize:lE};function oE(e,t,n){const a=this;return s;function s(h){return e.enter("codeIndented"),Dt(e,o,"linePrefix",5)(h)}function o(h){const p=a.events[a.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?c(h):n(h)}function c(h){return h===null?m(h):tt(h)?e.attempt(sE,c,m)(h):(e.enter("codeFlowValue"),d(h))}function d(h){return h===null||tt(h)?(e.exit("codeFlowValue"),c(h)):(e.consume(h),d)}function m(h){return e.exit("codeIndented"),t(h)}}function lE(e,t,n){const a=this;return s;function s(c){return a.parser.lazy[a.now().line]?n(c):tt(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),s):Dt(e,o,"linePrefix",5)(c)}function o(c){const d=a.events[a.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(c):tt(c)?s(c):n(c)}}const cE={name:"codeText",previous:dE,resolve:uE,tokenize:fE};function uE(e){let t=e.length-4,n=3,a,s;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;)s===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(s=a):(a===t||e[a][1].type==="lineEnding")&&(e[s][1].type="codeTextData",a!==s+2&&(e[s][1].end=e[a-1][1].end,e.splice(s+2,a-s-2),t-=a-s-2,a=s+2),s=void 0);return e}function dE(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function fE(e,t,n){let a=0,s,o;return c;function c(b){return e.enter("codeText"),e.enter("codeTextSequence"),d(b)}function d(b){return b===96?(e.consume(b),a++,d):(e.exit("codeTextSequence"),m(b))}function m(b){return b===null?n(b):b===32?(e.enter("space"),e.consume(b),e.exit("space"),m):b===96?(o=e.enter("codeTextSequence"),s=0,p(b)):tt(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),m):(e.enter("codeTextData"),h(b))}function h(b){return b===null||b===32||b===96||tt(b)?(e.exit("codeTextData"),m(b)):(e.consume(b),h)}function p(b){return b===96?(e.consume(b),s++,p):s===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(b)):(o.type="codeTextData",h(b))}}class mE{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 s=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return a&&xl(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),xl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),xl(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);xl(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);xl(this.left,n.reverse())}}}function xl(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 $5(e){const t={};let n=-1,a,s,o,c,d,m,h;const p=new mE(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(a=p.get(n),n&&a[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(m=a[1]._tokenizer.events,o=0,o<m.length&&m[o][1].type==="lineEndingBlank"&&(o+=2),o<m.length&&m[o][1].type==="content"))for(;++o<m.length&&m[o][1].type!=="content";)m[o][1].type==="chunkText"&&(m[o][1]._isInFirstContentOfListItem=!0,o++);if(a[0]==="enter")a[1].contentType&&(Object.assign(t,hE(p,n)),n=t[n],h=!0);else if(a[1]._container){for(o=n,s=void 0;o--;)if(c=p.get(o),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(s&&(p.get(s)[1].type="lineEndingBlank"),c[1].type="lineEnding",s=o);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;s&&(a[1].end={...p.get(s)[1].start},d=p.slice(s,n),d.unshift(a),p.splice(s,n-s+1,d))}}return Br(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!h}function hE(e,t){const n=e.get(t)[1],a=e.get(t)[2];let s=t-1;const o=[];let c=n._tokenizer;c||(c=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const d=c.events,m=[],h={};let p,b,x=-1,y=n,S=0,T=0;const A=[T];for(;y;){for(;e.get(++s)[1]!==y;);o.push(s),y._tokenizer||(p=a.sliceStream(y),y.next||p.push(null),b&&c.defineSkip(y.start),y._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(p),y._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),b=y,y=y.next}for(y=n;++x<d.length;)d[x][0]==="exit"&&d[x-1][0]==="enter"&&d[x][1].type===d[x-1][1].type&&d[x][1].start.line!==d[x][1].end.line&&(T=x+1,A.push(T),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(c.events=[],y?(y._tokenizer=void 0,y.previous=void 0):A.pop(),x=A.length;x--;){const C=d.slice(A[x],A[x+1]),M=o.pop();m.push([M,M+C.length-1]),e.splice(M,2,C)}for(m.reverse(),x=-1;++x<m.length;)h[S+m[x][0]]=S+m[x][1],S+=m[x][1]-m[x][0]-1;return h}const pE={resolve:bE,tokenize:vE},gE={partial:!0,tokenize:yE};function bE(e){return $5(e),e}function vE(e,t){let n;return a;function a(d){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(d)}function s(d){return d===null?o(d):tt(d)?e.check(gE,c,o)(d):(e.consume(d),s)}function o(d){return e.exit("chunkContent"),e.exit("content"),t(d)}function c(d){return e.consume(d),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function yE(e,t,n){const a=this;return s;function s(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Dt(e,o,"linePrefix")}function o(c){if(c===null||tt(c))return n(c);const d=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(c):e.interrupt(a.parser.constructs.flow,n,t)(c)}}function P5(e,t,n,a,s,o,c,d,m){const h=m||Number.POSITIVE_INFINITY;let p=0;return b;function b(C){return C===60?(e.enter(a),e.enter(s),e.enter(o),e.consume(C),e.exit(o),x):C===null||C===32||C===41||Qu(C)?n(C):(e.enter(a),e.enter(c),e.enter(d),e.enter("chunkString",{contentType:"string"}),T(C))}function x(C){return C===62?(e.enter(o),e.consume(C),e.exit(o),e.exit(s),e.exit(a),t):(e.enter(d),e.enter("chunkString",{contentType:"string"}),y(C))}function y(C){return C===62?(e.exit("chunkString"),e.exit(d),x(C)):C===null||C===60||tt(C)?n(C):(e.consume(C),C===92?S:y)}function S(C){return C===60||C===62||C===92?(e.consume(C),y):y(C)}function T(C){return!p&&(C===null||C===41||un(C))?(e.exit("chunkString"),e.exit(d),e.exit(c),e.exit(a),t(C)):p<h&&C===40?(e.consume(C),p++,T):C===41?(e.consume(C),p--,T):C===null||C===32||C===40||Qu(C)?n(C):(e.consume(C),C===92?A:T)}function A(C){return C===40||C===41||C===92?(e.consume(C),T):T(C)}}function G5(e,t,n,a,s,o){const c=this;let d=0,m;return h;function h(y){return e.enter(a),e.enter(s),e.consume(y),e.exit(s),e.enter(o),p}function p(y){return d>999||y===null||y===91||y===93&&!m||y===94&&!d&&"_hiddenFootnoteSupport"in c.parser.constructs?n(y):y===93?(e.exit(o),e.enter(s),e.consume(y),e.exit(s),e.exit(a),t):tt(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),b(y))}function b(y){return y===null||y===91||y===93||tt(y)||d++>999?(e.exit("chunkString"),p(y)):(e.consume(y),m||(m=!qt(y)),y===92?x:b)}function x(y){return y===91||y===92||y===93?(e.consume(y),d++,b):b(y)}}function V5(e,t,n,a,s,o){let c;return d;function d(x){return x===34||x===39||x===40?(e.enter(a),e.enter(s),e.consume(x),e.exit(s),c=x===40?41:x,m):n(x)}function m(x){return x===c?(e.enter(s),e.consume(x),e.exit(s),e.exit(a),t):(e.enter(o),h(x))}function h(x){return x===c?(e.exit(o),m(c)):x===null?n(x):tt(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),Dt(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===c||x===null||tt(x)?(e.exit("chunkString"),h(x)):(e.consume(x),x===92?b:p)}function b(x){return x===c||x===92?(e.consume(x),p):p(x)}}function Ml(e,t){let n;return a;function a(s){return tt(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,a):qt(s)?Dt(e,a,n?"linePrefix":"lineSuffix")(s):t(s)}}const xE={name:"definition",tokenize:kE},wE={partial:!0,tokenize:SE};function kE(e,t,n){const a=this;let s;return o;function o(y){return e.enter("definition"),c(y)}function c(y){return G5.call(a,e,d,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function d(y){return s=ua(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),m):n(y)}function m(y){return un(y)?Ml(e,h)(y):h(y)}function h(y){return P5(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function p(y){return e.attempt(wE,b,b)(y)}function b(y){return qt(y)?Dt(e,x,"whitespace")(y):x(y)}function x(y){return y===null||tt(y)?(e.exit("definition"),a.parser.defined.push(s),t(y)):n(y)}}function SE(e,t,n){return a;function a(d){return un(d)?Ml(e,s)(d):n(d)}function s(d){return V5(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function o(d){return qt(d)?Dt(e,c,"whitespace")(d):c(d)}function c(d){return d===null||tt(d)?t(d):n(d)}}const EE={name:"hardBreakEscape",tokenize:TE};function TE(e,t,n){return a;function a(o){return e.enter("hardBreakEscape"),e.consume(o),s}function s(o){return tt(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const CE={name:"headingAtx",resolve:RE,tokenize:NE};function RE(e,t){let n=e.length-2,a=3,s,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&&(s={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"},Br(e,a,n-a+1,[["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t]])),e}function NE(e,t,n){let a=0;return s;function s(p){return e.enter("atxHeading"),o(p)}function o(p){return e.enter("atxHeadingSequence"),c(p)}function c(p){return p===35&&a++<6?(e.consume(p),c):p===null||un(p)?(e.exit("atxHeadingSequence"),d(p)):n(p)}function d(p){return p===35?(e.enter("atxHeadingSequence"),m(p)):p===null||tt(p)?(e.exit("atxHeading"),t(p)):qt(p)?Dt(e,d,"whitespace")(p):(e.enter("atxHeadingText"),h(p))}function m(p){return p===35?(e.consume(p),m):(e.exit("atxHeadingSequence"),d(p))}function h(p){return p===null||p===35||un(p)?(e.exit("atxHeadingText"),d(p)):(e.consume(p),h)}}const AE=["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"],Zb=["pre","script","style","textarea"],IE={concrete:!0,name:"htmlFlow",resolveTo:OE,tokenize:DE},_E={partial:!0,tokenize:LE},ME={partial:!0,tokenize:jE};function OE(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 DE(e,t,n){const a=this;let s,o,c,d,m;return h;function h(O){return p(O)}function p(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),b}function b(O){return O===33?(e.consume(O),x):O===47?(e.consume(O),o=!0,T):O===63?(e.consume(O),s=3,a.interrupt?t:j):ur(O)?(e.consume(O),c=String.fromCharCode(O),A):n(O)}function x(O){return O===45?(e.consume(O),s=2,y):O===91?(e.consume(O),s=5,d=0,S):ur(O)?(e.consume(O),s=4,a.interrupt?t:j):n(O)}function y(O){return O===45?(e.consume(O),a.interrupt?t:j):n(O)}function S(O){const be="CDATA[";return O===be.charCodeAt(d++)?(e.consume(O),d===be.length?a.interrupt?t:K:S):n(O)}function T(O){return ur(O)?(e.consume(O),c=String.fromCharCode(O),A):n(O)}function A(O){if(O===null||O===47||O===62||un(O)){const be=O===47,se=c.toLowerCase();return!be&&!o&&Zb.includes(se)?(s=1,a.interrupt?t(O):K(O)):AE.includes(c.toLowerCase())?(s=6,be?(e.consume(O),C):a.interrupt?t(O):K(O)):(s=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(O):o?M(O):I(O))}return O===45||nr(O)?(e.consume(O),c+=String.fromCharCode(O),A):n(O)}function C(O){return O===62?(e.consume(O),a.interrupt?t:K):n(O)}function M(O){return qt(O)?(e.consume(O),M):$(O)}function I(O){return O===47?(e.consume(O),$):O===58||O===95||ur(O)?(e.consume(O),P):qt(O)?(e.consume(O),I):$(O)}function P(O){return O===45||O===46||O===58||O===95||nr(O)?(e.consume(O),P):U(O)}function U(O){return O===61?(e.consume(O),N):qt(O)?(e.consume(O),U):I(O)}function N(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),m=O,z):qt(O)?(e.consume(O),N):X(O)}function z(O){return O===m?(e.consume(O),m=null,B):O===null||tt(O)?n(O):(e.consume(O),z)}function X(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||un(O)?U(O):(e.consume(O),X)}function B(O){return O===47||O===62||qt(O)?I(O):n(O)}function $(O){return O===62?(e.consume(O),F):n(O)}function F(O){return O===null||tt(O)?K(O):qt(O)?(e.consume(O),F):n(O)}function K(O){return O===45&&s===2?(e.consume(O),_):O===60&&s===1?(e.consume(O),Y):O===62&&s===4?(e.consume(O),G):O===63&&s===3?(e.consume(O),j):O===93&&s===5?(e.consume(O),fe):tt(O)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(_E,W,oe)(O)):O===null||tt(O)?(e.exit("htmlFlowData"),oe(O)):(e.consume(O),K)}function oe(O){return e.check(ME,J,W)(O)}function J(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),H}function H(O){return O===null||tt(O)?oe(O):(e.enter("htmlFlowData"),K(O))}function _(O){return O===45?(e.consume(O),j):K(O)}function Y(O){return O===47?(e.consume(O),c="",re):K(O)}function re(O){if(O===62){const be=c.toLowerCase();return Zb.includes(be)?(e.consume(O),G):K(O)}return ur(O)&&c.length<8?(e.consume(O),c+=String.fromCharCode(O),re):K(O)}function fe(O){return O===93?(e.consume(O),j):K(O)}function j(O){return O===62?(e.consume(O),G):O===45&&s===2?(e.consume(O),j):K(O)}function G(O){return O===null||tt(O)?(e.exit("htmlFlowData"),W(O)):(e.consume(O),G)}function W(O){return e.exit("htmlFlow"),t(O)}}function jE(e,t,n){const a=this;return s;function s(c){return tt(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 LE(e,t,n){return a;function a(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Xl,t,n)}}const zE={name:"htmlText",tokenize:BE};function BE(e,t,n){const a=this;let s,o,c;return d;function d(j){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(j),m}function m(j){return j===33?(e.consume(j),h):j===47?(e.consume(j),U):j===63?(e.consume(j),I):ur(j)?(e.consume(j),X):n(j)}function h(j){return j===45?(e.consume(j),p):j===91?(e.consume(j),o=0,S):ur(j)?(e.consume(j),M):n(j)}function p(j){return j===45?(e.consume(j),y):n(j)}function b(j){return j===null?n(j):j===45?(e.consume(j),x):tt(j)?(c=b,Y(j)):(e.consume(j),b)}function x(j){return j===45?(e.consume(j),y):b(j)}function y(j){return j===62?_(j):j===45?x(j):b(j)}function S(j){const G="CDATA[";return j===G.charCodeAt(o++)?(e.consume(j),o===G.length?T:S):n(j)}function T(j){return j===null?n(j):j===93?(e.consume(j),A):tt(j)?(c=T,Y(j)):(e.consume(j),T)}function A(j){return j===93?(e.consume(j),C):T(j)}function C(j){return j===62?_(j):j===93?(e.consume(j),C):T(j)}function M(j){return j===null||j===62?_(j):tt(j)?(c=M,Y(j)):(e.consume(j),M)}function I(j){return j===null?n(j):j===63?(e.consume(j),P):tt(j)?(c=I,Y(j)):(e.consume(j),I)}function P(j){return j===62?_(j):I(j)}function U(j){return ur(j)?(e.consume(j),N):n(j)}function N(j){return j===45||nr(j)?(e.consume(j),N):z(j)}function z(j){return tt(j)?(c=z,Y(j)):qt(j)?(e.consume(j),z):_(j)}function X(j){return j===45||nr(j)?(e.consume(j),X):j===47||j===62||un(j)?B(j):n(j)}function B(j){return j===47?(e.consume(j),_):j===58||j===95||ur(j)?(e.consume(j),$):tt(j)?(c=B,Y(j)):qt(j)?(e.consume(j),B):_(j)}function $(j){return j===45||j===46||j===58||j===95||nr(j)?(e.consume(j),$):F(j)}function F(j){return j===61?(e.consume(j),K):tt(j)?(c=F,Y(j)):qt(j)?(e.consume(j),F):B(j)}function K(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(e.consume(j),s=j,oe):tt(j)?(c=K,Y(j)):qt(j)?(e.consume(j),K):(e.consume(j),J)}function oe(j){return j===s?(e.consume(j),s=void 0,H):j===null?n(j):tt(j)?(c=oe,Y(j)):(e.consume(j),oe)}function J(j){return j===null||j===34||j===39||j===60||j===61||j===96?n(j):j===47||j===62||un(j)?B(j):(e.consume(j),J)}function H(j){return j===47||j===62||un(j)?B(j):n(j)}function _(j){return j===62?(e.consume(j),e.exit("htmlTextData"),e.exit("htmlText"),t):n(j)}function Y(j){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),re}function re(j){return qt(j)?Dt(e,fe,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):fe(j)}function fe(j){return e.enter("htmlTextData"),c(j)}}const Q1={name:"labelEnd",resolveAll:FE,resolveTo:$E,tokenize:PE},qE={tokenize:GE},HE={tokenize:VE},UE={tokenize:KE};function FE(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 s=a.type==="labelImage"?4:2;a.type="data",t+=s}}return e.length!==n.length&&Br(e,0,e.length,n),e}function $E(e,t){let n=e.length,a=0,s,o,c,d;for(;n--;)if(s=e[n][1],o){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(c){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(o=n,s.type!=="labelLink")){a=2;break}}else s.type==="labelEnd"&&(c=n);const m={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[o][1].start},end:{...e[c][1].end}},p={type:"labelText",start:{...e[o+a+2][1].end},end:{...e[c-2][1].start}};return d=[["enter",m,t],["enter",h,t]],d=Jr(d,e.slice(o+1,o+a+3)),d=Jr(d,[["enter",p,t]]),d=Jr(d,vd(t.parser.constructs.insideSpan.null,e.slice(o+a+4,c-3),t)),d=Jr(d,[["exit",p,t],e[c-2],e[c-1],["exit",h,t]]),d=Jr(d,e.slice(c+1)),d=Jr(d,[["exit",m,t]]),Br(e,o,e.length,d),e}function PE(e,t,n){const a=this;let s=a.events.length,o,c;for(;s--;)if((a.events[s][1].type==="labelImage"||a.events[s][1].type==="labelLink")&&!a.events[s][1]._balanced){o=a.events[s][1];break}return d;function d(x){return o?o._inactive?b(x):(c=a.parser.defined.includes(ua(a.sliceSerialize({start:o.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),m):n(x)}function m(x){return x===40?e.attempt(qE,p,c?p:b)(x):x===91?e.attempt(HE,p,c?h:b)(x):c?p(x):b(x)}function h(x){return e.attempt(UE,p,b)(x)}function p(x){return t(x)}function b(x){return o._balanced=!0,n(x)}}function GE(e,t,n){return a;function a(b){return e.enter("resource"),e.enter("resourceMarker"),e.consume(b),e.exit("resourceMarker"),s}function s(b){return un(b)?Ml(e,o)(b):o(b)}function o(b){return b===41?p(b):P5(e,c,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(b)}function c(b){return un(b)?Ml(e,m)(b):p(b)}function d(b){return n(b)}function m(b){return b===34||b===39||b===40?V5(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(b):p(b)}function h(b){return un(b)?Ml(e,p)(b):p(b)}function p(b){return b===41?(e.enter("resourceMarker"),e.consume(b),e.exit("resourceMarker"),e.exit("resource"),t):n(b)}}function VE(e,t,n){const a=this;return s;function s(d){return G5.call(a,e,o,c,"reference","referenceMarker","referenceString")(d)}function o(d){return a.parser.defined.includes(ua(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(d):n(d)}function c(d){return n(d)}}function KE(e,t,n){return a;function a(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),s}function s(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const YE={name:"labelStartImage",resolveAll:Q1.resolveAll,tokenize:WE};function WE(e,t,n){const a=this;return s;function s(d){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(d),e.exit("labelImageMarker"),o}function o(d){return d===91?(e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelImage"),c):n(d)}function c(d){return d===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(d):t(d)}}const ZE={name:"labelStartLink",resolveAll:Q1.resolveAll,tokenize:XE};function XE(e,t,n){const a=this;return s;function s(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 am={name:"lineEnding",tokenize:QE};function QE(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Dt(e,t,"linePrefix")}}const qu={name:"thematicBreak",tokenize:JE};function JE(e,t,n){let a=0,s;return o;function o(h){return e.enter("thematicBreak"),c(h)}function c(h){return s=h,d(h)}function d(h){return h===s?(e.enter("thematicBreakSequence"),m(h)):a>=3&&(h===null||tt(h))?(e.exit("thematicBreak"),t(h)):n(h)}function m(h){return h===s?(e.consume(h),a++,m):(e.exit("thematicBreakSequence"),qt(h)?Dt(e,d,"whitespace")(h):d(h))}}const Er={continuation:{tokenize:rT},exit:iT,name:"list",tokenize:nT},eT={partial:!0,tokenize:sT},tT={partial:!0,tokenize:aT};function nT(e,t,n){const a=this,s=a.events[a.events.length-1];let o=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,c=0;return d;function d(y){const S=a.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!a.containerState.marker||y===a.containerState.marker:Zh(y)){if(a.containerState.type||(a.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(qu,n,h)(y):h(y);if(!a.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),m(y)}return n(y)}function m(y){return Zh(y)&&++c<10?(e.consume(y),m):(!a.interrupt||c<2)&&(a.containerState.marker?y===a.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),h(y)):n(y)}function h(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||y,e.check(Xl,a.interrupt?n:p,e.attempt(eT,x,b))}function p(y){return a.containerState.initialBlankLine=!0,o++,x(y)}function b(y){return qt(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),x):n(y)}function x(y){return a.containerState.size=o+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function rT(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(Xl,s,o);function s(d){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,Dt(e,t,"listItemIndent",a.containerState.size+1)(d)}function o(d){return a.containerState.furtherBlankLines||!qt(d)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,c(d)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(tT,t,c)(d))}function c(d){return a.containerState._closeFlow=!0,a.interrupt=void 0,Dt(e,e.attempt(Er,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function aT(e,t,n){const a=this;return Dt(e,s,"listItemIndent",a.containerState.size+1);function s(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 iT(e){e.exit(this.containerState.type)}function sT(e,t,n){const a=this;return Dt(e,s,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(o){const c=a.events[a.events.length-1];return!qt(o)&&c&&c[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Xb={name:"setextUnderline",resolveTo:oT,tokenize:lT};function oT(e,t){let n=e.length,a,s,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){a=n;break}e[n][1].type==="paragraph"&&(s=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[s][1].type="setextHeadingText",o?(e.splice(s,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 lT(e,t,n){const a=this;let s;return o;function o(h){let p=a.events.length,b;for(;p--;)if(a.events[p][1].type!=="lineEnding"&&a.events[p][1].type!=="linePrefix"&&a.events[p][1].type!=="content"){b=a.events[p][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||b)?(e.enter("setextHeadingLine"),s=h,c(h)):n(h)}function c(h){return e.enter("setextHeadingLineSequence"),d(h)}function d(h){return h===s?(e.consume(h),d):(e.exit("setextHeadingLineSequence"),qt(h)?Dt(e,m,"lineSuffix")(h):m(h))}function m(h){return h===null||tt(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const cT={tokenize:uT};function uT(e){const t=this,n=e.attempt(Xl,a,e.attempt(this.parser.constructs.flowInitial,s,Dt(e,e.attempt(this.parser.constructs.flow,s,e.attempt(pE,s)),"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 s(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const dT={resolveAll:Y5()},fT=K5("string"),mT=K5("text");function K5(e){return{resolveAll:Y5(e==="text"?hT:void 0),tokenize:t};function t(n){const a=this,s=this.parser.constructs[e],o=n.attempt(s,c,d);return c;function c(p){return h(p)?o(p):d(p)}function d(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),m}function m(p){return h(p)?(n.exit("data"),o(p)):(n.consume(p),m)}function h(p){if(p===null)return!0;const b=s[p];let x=-1;if(b)for(;++x<b.length;){const y=b[x];if(!y.previous||y.previous.call(a,a.previous))return!0}return!1}}}function Y5(e){return t;function t(n,a){let s=-1,o;for(;++s<=n.length;)o===void 0?n[s]&&n[s][1].type==="data"&&(o=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==o+2&&(n[o][1].end=n[s-1][1].end,n.splice(o+2,s-o-2),s=o+2),o=void 0);return e?e(n,a):n}}function hT(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],s=t.sliceStream(a);let o=s.length,c=-1,d=0,m;for(;o--;){const h=s[o];if(typeof h=="string"){for(c=h.length;h.charCodeAt(c-1)===32;)d++,c--;if(c)break;c=-1}else if(h===-2)m=!0,d++;else if(h!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(d=0),d){const h={type:n===e.length||m||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?c:a.start._bufferIndex+c,_index:a.start._index+o,line:a.end.line,column:a.end.column-d,offset:a.end.offset-d},end:{...a.end}};a.end={...h.start},a.start.offset===a.end.offset?Object.assign(a,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const pT={42:Er,43:Er,45:Er,48:Er,49:Er,50:Er,51:Er,52:Er,53:Er,54:Er,55:Er,56:Er,57:Er,62:H5},gT={91:xE},bT={[-2]:rm,[-1]:rm,32:rm},vT={35:CE,42:qu,45:[Xb,qu],60:IE,61:Xb,95:qu,96:Wb,126:Wb},yT={38:F5,92:U5},xT={[-5]:am,[-4]:am,[-3]:am,33:YE,38:F5,42:Xh,60:[ZS,zE],91:ZE,92:[EE,U5],93:Q1,95:Xh,96:cE},wT={null:[Xh,dT]},kT={null:[42,95]},ST={null:[]},ET=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:kT,contentInitial:gT,disable:ST,document:pT,flow:vT,flowInitial:bT,insideSpan:wT,string:yT,text:xT},Symbol.toStringTag,{value:"Module"}));function TT(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 s={},o=[];let c=[],d=[];const m={attempt:z(U),check:z(N),consume:M,enter:I,exit:P,interrupt:z(N,{interrupt:!0})},h={code:null,containerState:{},defineSkip:T,events:[],now:S,parser:e,previous:null,sliceSerialize:x,sliceStream:y,write:b};let p=t.tokenize.call(h,m);return t.resolveAll&&o.push(t),h;function b(F){return c=Jr(c,F),A(),c[c.length-1]!==null?[]:(X(t,0),h.events=vd(o,h.events,h),h.events)}function x(F,K){return RT(y(F),K)}function y(F){return CT(c,F)}function S(){const{_bufferIndex:F,_index:K,line:oe,column:J,offset:H}=a;return{_bufferIndex:F,_index:K,line:oe,column:J,offset:H}}function T(F){s[F.line]=F.column,$()}function A(){let F;for(;a._index<c.length;){const K=c[a._index];if(typeof K=="string")for(F=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===F&&a._bufferIndex<K.length;)C(K.charCodeAt(a._bufferIndex));else C(K)}}function C(F){p=p(F)}function M(F){tt(F)?(a.line++,a.column=1,a.offset+=F===-3?2:1,$()):F!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===c[a._index].length&&(a._bufferIndex=-1,a._index++)),h.previous=F}function I(F,K){const oe=K||{};return oe.type=F,oe.start=S(),h.events.push(["enter",oe,h]),d.push(oe),oe}function P(F){const K=d.pop();return K.end=S(),h.events.push(["exit",K,h]),K}function U(F,K){X(F,K.from)}function N(F,K){K.restore()}function z(F,K){return oe;function oe(J,H,_){let Y,re,fe,j;return Array.isArray(J)?W(J):"tokenize"in J?W([J]):G(J);function G(V){return Z;function Z(ne){const ue=ne!==null&&V[ne],he=ne!==null&&V.null,Re=[...Array.isArray(ue)?ue:ue?[ue]:[],...Array.isArray(he)?he:he?[he]:[]];return W(Re)(ne)}}function W(V){return Y=V,re=0,V.length===0?_:O(V[re])}function O(V){return Z;function Z(ne){return j=B(),fe=V,V.partial||(h.currentConstruct=V),V.name&&h.parser.constructs.disable.null.includes(V.name)?se():V.tokenize.call(K?Object.assign(Object.create(h),K):h,m,be,se)(ne)}}function be(V){return F(fe,j),H}function se(V){return j.restore(),++re<Y.length?O(Y[re]):_}}}function X(F,K){F.resolveAll&&!o.includes(F)&&o.push(F),F.resolve&&Br(h.events,K,h.events.length-K,F.resolve(h.events.slice(K),h)),F.resolveTo&&(h.events=F.resolveTo(h.events,h))}function B(){const F=S(),K=h.previous,oe=h.currentConstruct,J=h.events.length,H=Array.from(d);return{from:J,restore:_};function _(){a=F,h.previous=K,h.currentConstruct=oe,h.events.length=J,d=H,$()}}function $(){a.line in s&&a.column<2&&(a.column=s[a.line],a.offset+=s[a.line]-1)}}function CT(e,t){const n=t.start._index,a=t.start._bufferIndex,s=t.end._index,o=t.end._bufferIndex;let c;if(n===s)c=[e[n].slice(a,o)];else{if(c=e.slice(n,s),a>-1){const d=c[0];typeof d=="string"?c[0]=d.slice(a):c.shift()}o>0&&c.push(e[s].slice(0,o))}return c}function RT(e,t){let n=-1;const a=[];let s;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=`
|
|
21
|
-
`;break}case-3:{c=`\r
|
|
22
|
-
`;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&s)continue;c=" ";break}default:c=String.fromCharCode(o)}s=o===-2,a.push(c)}return a.join("")}function NT(e){const a={constructs:B5([ET,...(e||{}).extensions||[]]),content:s($S),defined:[],document:s(GS),flow:s(cT),lazy:{},string:s(fT),text:s(mT)};return a;function s(o){return c;function c(d){return TT(a,o,d)}}}function AT(e){for(;!$5(e););return e}const Qb=/[\0\t\n\r]/g;function IT(){let e=1,t="",n=!0,a;return s;function s(o,c,d){const m=[];let h,p,b,x,y;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(c||void 0).decode(o)),b=0,t="",n&&(o.charCodeAt(0)===65279&&b++,n=void 0);b<o.length;){if(Qb.lastIndex=b,h=Qb.exec(o),x=h&&h.index!==void 0?h.index:o.length,y=o.charCodeAt(x),!h){t=o.slice(b);break}if(y===10&&b===x&&a)m.push(-3),a=void 0;else switch(a&&(m.push(-5),a=void 0),b<x&&(m.push(o.slice(b,x)),e+=x-b),y){case 0:{m.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,m.push(-2);e++<p;)m.push(-1);break}case 10:{m.push(-4),e=1;break}default:a=!0,e=1}b=x+1}return d&&(a&&m.push(-5),t&&m.push(t),m.push(null)),m}}const _T=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function MT(e){return e.replace(_T,OT)}function OT(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),o=s===120||s===88;return q5(n.slice(o?2:1),o?16:10)}return X1(n)||e}const W5={}.hasOwnProperty;function DT(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),jT(n)(AT(NT(n).document().write(IT()(e,t,!0))))}function jT(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Mt),autolinkProtocol:B,autolinkEmail:B,atxHeading:o(pt),blockQuote:o(he),characterEscape:B,characterReference:B,codeFenced:o(Re),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:o(Re,c),codeText:o(Le,c),codeTextData:B,data:B,codeFlowValue:B,definition:o(Ye),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:o(ut),hardBreakEscape:o(Rt),hardBreakTrailing:o(Rt),htmlFlow:o(Ht,c),htmlFlowData:B,htmlText:o(Ht,c),htmlTextData:B,image:o(at),label:c,link:o(Mt),listItem:o(Ut),listItemValue:x,listOrdered:o(ft,b),listUnordered:o(ft),paragraph:o(ze),reference:O,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:o(pt),strong:o(Qe),thematicBreak:o(mt)},exit:{atxHeading:m(),atxHeadingSequence:U,autolink:m(),autolinkEmail:ue,autolinkProtocol:ne,blockQuote:m(),characterEscapeValue:$,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:V,characterReference:Z,codeFenced:m(A),codeFencedFence:T,codeFencedFenceInfo:y,codeFencedFenceMeta:S,codeFlowValue:$,codeIndented:m(C),codeText:m(H),codeTextData:$,data:$,definition:m(),definitionDestinationString:P,definitionLabelString:M,definitionTitleString:I,emphasis:m(),hardBreakEscape:m(K),hardBreakTrailing:m(K),htmlFlow:m(oe),htmlFlowData:$,htmlText:m(J),htmlTextData:$,image:m(Y),label:fe,labelText:re,lineEnding:F,link:m(_),listItem:m(),listOrdered:m(),listUnordered:m(),paragraph:m(),referenceString:be,resourceDestinationString:j,resourceTitleString:G,resource:W,setextHeading:m(X),setextHeadingLineSequence:z,setextHeadingText:N,strong:m(),thematicBreak:m()}};Z5(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(pe){let me={type:"root",children:[]};const He={stack:[me],tokenStack:[],config:t,enter:d,exit:h,buffer:c,resume:p,data:n},we=[];let Fe=-1;for(;++Fe<pe.length;)if(pe[Fe][1].type==="listOrdered"||pe[Fe][1].type==="listUnordered")if(pe[Fe][0]==="enter")we.push(Fe);else{const lt=we.pop();Fe=s(pe,lt,Fe)}for(Fe=-1;++Fe<pe.length;){const lt=t[pe[Fe][0]];W5.call(lt,pe[Fe][1].type)&<[pe[Fe][1].type].call(Object.assign({sliceSerialize:pe[Fe][2].sliceSerialize},He),pe[Fe][1])}if(He.tokenStack.length>0){const lt=He.tokenStack[He.tokenStack.length-1];(lt[1]||Jb).call(He,void 0,lt[0])}for(me.position={start:Mi(pe.length>0?pe[0][1].start:{line:1,column:1,offset:0}),end:Mi(pe.length>0?pe[pe.length-2][1].end:{line:1,column:1,offset:0})},Fe=-1;++Fe<t.transforms.length;)me=t.transforms[Fe](me)||me;return me}function s(pe,me,He){let we=me-1,Fe=-1,lt=!1,Ae,Kt,gt,_t;for(;++we<=He;){const Tt=pe[we];switch(Tt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Tt[0]==="enter"?Fe++:Fe--,_t=void 0;break}case"lineEndingBlank":{Tt[0]==="enter"&&(Ae&&!_t&&!Fe&&!gt&&(gt=we),_t=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:_t=void 0}if(!Fe&&Tt[0]==="enter"&&Tt[1].type==="listItemPrefix"||Fe===-1&&Tt[0]==="exit"&&(Tt[1].type==="listUnordered"||Tt[1].type==="listOrdered")){if(Ae){let Mn=we;for(Kt=void 0;Mn--;){const pn=pe[Mn];if(pn[1].type==="lineEnding"||pn[1].type==="lineEndingBlank"){if(pn[0]==="exit")continue;Kt&&(pe[Kt][1].type="lineEndingBlank",lt=!0),pn[1].type="lineEnding",Kt=Mn}else if(!(pn[1].type==="linePrefix"||pn[1].type==="blockQuotePrefix"||pn[1].type==="blockQuotePrefixWhitespace"||pn[1].type==="blockQuoteMarker"||pn[1].type==="listItemIndent"))break}gt&&(!Kt||gt<Kt)&&(Ae._spread=!0),Ae.end=Object.assign({},Kt?pe[Kt][1].start:Tt[1].end),pe.splice(Kt||we,0,["exit",Ae,Tt[2]]),we++,He++}if(Tt[1].type==="listItemPrefix"){const Mn={type:"listItem",_spread:!1,start:Object.assign({},Tt[1].start),end:void 0};Ae=Mn,pe.splice(we,0,["enter",Mn,Tt[2]]),we++,He++,gt=void 0,_t=!0}}}return pe[me][1]._spread=lt,He}function o(pe,me){return He;function He(we){d.call(this,pe(we),we),me&&me.call(this,we)}}function c(){this.stack.push({type:"fragment",children:[]})}function d(pe,me,He){this.stack[this.stack.length-1].children.push(pe),this.stack.push(pe),this.tokenStack.push([me,He||void 0]),pe.position={start:Mi(me.start),end:void 0}}function m(pe){return me;function me(He){pe&&pe.call(this,He),h.call(this,He)}}function h(pe,me){const He=this.stack.pop(),we=this.tokenStack.pop();if(we)we[0].type!==pe.type&&(me?me.call(this,pe,we[0]):(we[1]||Jb).call(this,pe,we[0]));else throw new Error("Cannot close `"+pe.type+"` ("+_l({start:pe.start,end:pe.end})+"): it’s not open");He.position.end=Mi(pe.end)}function p(){return Z1(this.stack.pop())}function b(){this.data.expectingFirstListItemValue=!0}function x(pe){if(this.data.expectingFirstListItemValue){const me=this.stack[this.stack.length-2];me.start=Number.parseInt(this.sliceSerialize(pe),10),this.data.expectingFirstListItemValue=void 0}}function y(){const pe=this.resume(),me=this.stack[this.stack.length-1];me.lang=pe}function S(){const pe=this.resume(),me=this.stack[this.stack.length-1];me.meta=pe}function T(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function A(){const pe=this.resume(),me=this.stack[this.stack.length-1];me.value=pe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const pe=this.resume(),me=this.stack[this.stack.length-1];me.value=pe.replace(/(\r?\n|\r)$/g,"")}function M(pe){const me=this.resume(),He=this.stack[this.stack.length-1];He.label=me,He.identifier=ua(this.sliceSerialize(pe)).toLowerCase()}function I(){const pe=this.resume(),me=this.stack[this.stack.length-1];me.title=pe}function P(){const pe=this.resume(),me=this.stack[this.stack.length-1];me.url=pe}function U(pe){const me=this.stack[this.stack.length-1];if(!me.depth){const He=this.sliceSerialize(pe).length;me.depth=He}}function N(){this.data.setextHeadingSlurpLineEnding=!0}function z(pe){const me=this.stack[this.stack.length-1];me.depth=this.sliceSerialize(pe).codePointAt(0)===61?1:2}function X(){this.data.setextHeadingSlurpLineEnding=void 0}function B(pe){const He=this.stack[this.stack.length-1].children;let we=He[He.length-1];(!we||we.type!=="text")&&(we=Ue(),we.position={start:Mi(pe.start),end:void 0},He.push(we)),this.stack.push(we)}function $(pe){const me=this.stack.pop();me.value+=this.sliceSerialize(pe),me.position.end=Mi(pe.end)}function F(pe){const me=this.stack[this.stack.length-1];if(this.data.atHardBreak){const He=me.children[me.children.length-1];He.position.end=Mi(pe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(me.type)&&(B.call(this,pe),$.call(this,pe))}function K(){this.data.atHardBreak=!0}function oe(){const pe=this.resume(),me=this.stack[this.stack.length-1];me.value=pe}function J(){const pe=this.resume(),me=this.stack[this.stack.length-1];me.value=pe}function H(){const pe=this.resume(),me=this.stack[this.stack.length-1];me.value=pe}function _(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=me,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function Y(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=me,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function re(pe){const me=this.sliceSerialize(pe),He=this.stack[this.stack.length-2];He.label=MT(me),He.identifier=ua(me).toLowerCase()}function fe(){const pe=this.stack[this.stack.length-1],me=this.resume(),He=this.stack[this.stack.length-1];if(this.data.inReference=!0,He.type==="link"){const we=pe.children;He.children=we}else He.alt=me}function j(){const pe=this.resume(),me=this.stack[this.stack.length-1];me.url=pe}function G(){const pe=this.resume(),me=this.stack[this.stack.length-1];me.title=pe}function W(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function be(pe){const me=this.resume(),He=this.stack[this.stack.length-1];He.label=me,He.identifier=ua(this.sliceSerialize(pe)).toLowerCase(),this.data.referenceType="full"}function se(pe){this.data.characterReferenceType=pe.type}function V(pe){const me=this.sliceSerialize(pe),He=this.data.characterReferenceType;let we;He?(we=q5(me,He==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):we=X1(me);const Fe=this.stack[this.stack.length-1];Fe.value+=we}function Z(pe){const me=this.stack.pop();me.position.end=Mi(pe.end)}function ne(pe){$.call(this,pe);const me=this.stack[this.stack.length-1];me.url=this.sliceSerialize(pe)}function ue(pe){$.call(this,pe);const me=this.stack[this.stack.length-1];me.url="mailto:"+this.sliceSerialize(pe)}function he(){return{type:"blockquote",children:[]}}function Re(){return{type:"code",lang:null,meta:null,value:""}}function Le(){return{type:"inlineCode",value:""}}function Ye(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ut(){return{type:"emphasis",children:[]}}function pt(){return{type:"heading",depth:0,children:[]}}function Rt(){return{type:"break"}}function Ht(){return{type:"html",value:""}}function at(){return{type:"image",title:null,url:"",alt:null}}function Mt(){return{type:"link",title:null,url:"",children:[]}}function ft(pe){return{type:"list",ordered:pe.type==="listOrdered",start:null,spread:pe._spread,children:[]}}function Ut(pe){return{type:"listItem",spread:pe._spread,checked:null,children:[]}}function ze(){return{type:"paragraph",children:[]}}function Qe(){return{type:"strong",children:[]}}function Ue(){return{type:"text",value:""}}function mt(){return{type:"thematicBreak"}}}function Mi(e){return{line:e.line,column:e.column,offset:e.offset}}function Z5(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?Z5(e,a):LT(e,a)}}function LT(e,t){let n;for(n in t)if(W5.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 Jb(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+_l({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+_l({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+_l({start:t.start,end:t.end})+") is still open")}function zT(e){const t=this;t.parser=n;function n(a){return DT(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function BT(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 qT(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
23
|
-
`}]}function HT(e,t){const n=t.value?t.value+`
|
|
24
|
-
`:"",a={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(a.className=["language-"+s[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 UT(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function FT(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $T(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),s=wo(a.toLowerCase()),o=e.footnoteOrder.indexOf(a);let c,d=e.footnoteCounts.get(a);d===void 0?(d=0,e.footnoteOrder.push(a),c=e.footnoteOrder.length):c=o+1,d+=1,e.footnoteCounts.set(a,d);const m={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(t,m);const h={type:"element",tagName:"sup",properties:{},children:[m]};return e.patch(t,h),e.applyData(t,h)}function PT(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 GT(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function X5(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 s=e.all(t),o=s[0];o&&o.type==="text"?o.value="["+o.value:s.unshift({type:"text",value:"["});const c=s[s.length-1];return c&&c.type==="text"?c.value+=a:s.push({type:"text",value:a}),s}function VT(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return X5(e,t);const s={src:wo(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(s.title=a.title);const o={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,o),e.applyData(t,o)}function KT(e,t){const n={src:wo(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 YT(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 WT(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return X5(e,t);const s={href:wo(a.url||"")};a.title!==null&&a.title!==void 0&&(s.title=a.title);const o={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function ZT(e,t){const n={href:wo(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 XT(e,t,n){const a=e.all(t),s=n?QT(n):Q5(t),o={},c=[];if(typeof t.checked=="boolean"){const p=a[0];let b;p&&p.type==="element"&&p.tagName==="p"?b=p:(b={type:"element",tagName:"p",properties:{},children:[]},a.unshift(b)),b.children.length>0&&b.children.unshift({type:"text",value:" "}),b.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let d=-1;for(;++d<a.length;){const p=a[d];(s||d!==0||p.type!=="element"||p.tagName!=="p")&&c.push({type:"text",value:`
|
|
25
|
-
`}),p.type==="element"&&p.tagName==="p"&&!s?c.push(...p.children):c.push(p)}const m=a[a.length-1];m&&(s||m.type!=="element"||m.tagName!=="p")&&c.push({type:"text",value:`
|
|
26
|
-
`});const h={type:"element",tagName:"li",properties:o,children:c};return e.patch(t,h),e.applyData(t,h)}function QT(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let a=-1;for(;!t&&++a<n.length;)t=Q5(n[a])}return t}function Q5(e){const t=e.spread;return t??e.children.length>1}function JT(e,t){const n={},a=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<a.length;){const c=a[s];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(a,!0)};return e.patch(t,o),e.applyData(t,o)}function eC(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function tC(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function nC(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rC(e,t){const n=e.all(t),a=n.shift(),s=[];if(a){const c={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],c),s.push(c)}if(n.length>0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},d=V1(t.children[1]),m=_5(t.children[t.children.length-1]);d&&m&&(c.position={start:d,end:m}),s.push(c)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,o),e.applyData(t,o)}function aC(e,t,n){const a=n?n.children:void 0,o=(a?a.indexOf(t):1)===0?"th":"td",c=n&&n.type==="table"?n.align:void 0,d=c?c.length:t.children.length;let m=-1;const h=[];for(;++m<d;){const b=t.children[m],x={},y=c?c[m]:void 0;y&&(x.align=y);let S={type:"element",tagName:o,properties:x,children:[]};b&&(S.children=e.all(b),e.patch(b,S),S=e.applyData(b,S)),h.push(S)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,p),e.applyData(t,p)}function iC(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const ev=9,tv=32;function sC(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),s=0;const o=[];for(;a;)o.push(nv(t.slice(s,a.index),s>0,!0),a[0]),s=a.index+a[0].length,a=n.exec(t);return o.push(nv(t.slice(s),s>0,!1)),o.join("")}function nv(e,t,n){let a=0,s=e.length;if(t){let o=e.codePointAt(a);for(;o===ev||o===tv;)a++,o=e.codePointAt(a)}if(n){let o=e.codePointAt(s-1);for(;o===ev||o===tv;)s--,o=e.codePointAt(s-1)}return s>a?e.slice(a,s):""}function oC(e,t){const n={type:"text",value:sC(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function lC(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const cC={blockquote:BT,break:qT,code:HT,delete:UT,emphasis:FT,footnoteReference:$T,heading:PT,html:GT,imageReference:VT,image:KT,inlineCode:YT,linkReference:WT,link:ZT,listItem:XT,list:JT,paragraph:eC,root:tC,strong:nC,table:rC,tableCell:iC,tableRow:aC,text:oC,thematicBreak:lC,toml:bu,yaml:bu,definition:bu,footnoteDefinition:bu};function bu(){}const J5=-1,yd=0,Ol=1,Ju=2,J1=3,ep=4,tp=5,np=6,e6=7,t6=8,n6=typeof self=="object"?self:globalThis,rv=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new n6[e](t)},uC=(e,t)=>{const n=(s,o)=>(e.set(o,s),s),a=s=>{if(e.has(s))return e.get(s);const[o,c]=t[s];switch(o){case yd:case J5:return n(c,s);case Ol:{const d=n([],s);for(const m of c)d.push(a(m));return d}case Ju:{const d=n({},s);for(const[m,h]of c)d[a(m)]=a(h);return d}case J1:return n(new Date(c),s);case ep:{const{source:d,flags:m}=c;return n(new RegExp(d,m),s)}case tp:{const d=n(new Map,s);for(const[m,h]of c)d.set(a(m),a(h));return d}case np:{const d=n(new Set,s);for(const m of c)d.add(a(m));return d}case e6:{const{name:d,message:m}=c;return n(typeof n6[d]=="function"?rv(d,m):new Error(m),s)}case t6:return n(BigInt(c),s);case"BigInt":return n(Object(BigInt(c)),s);case"ArrayBuffer":return n(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:d}=new Uint8Array(c);return n(new DataView(d),c)}}return n(rv(o,c),s)};return a},av=e=>uC(new Map,e)(0),gs="",{toString:dC}={},{keys:fC}=Object,wl=e=>{const t=typeof e;if(t!=="object"||!e)return[yd,t];const n=dC.call(e).slice(8,-1);switch(n){case"Array":return[Ol,gs];case"Object":return[Ju,gs];case"Date":return[J1,gs];case"RegExp":return[ep,gs];case"Map":return[tp,gs];case"Set":return[np,gs];case"DataView":return[Ol,n]}return n.includes("Array")?[Ol,n]:e instanceof Error?[e6,e.name||"Error"]:[Ju,n]},vu=([e,t])=>e===yd&&(t==="function"||t==="symbol"),mC=(e,t,n,a)=>{const s=(c,d)=>{const m=a.push(c)-1;return n.set(d,m),m},o=c=>{if(n.has(c))return n.get(c);let[d,m]=wl(c);switch(d){case yd:{let p=c;switch(m){case"bigint":d=t6,p=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+m);p=null;break;case"undefined":return s([J5],c)}return s([d,p],c)}case Ol:{if(m){let x=c;return m==="DataView"?x=new Uint8Array(c.buffer):m==="ArrayBuffer"&&(x=new Uint8Array(c)),s([m,[...x]],c)}const p=[],b=s([d,p],c);for(const x of c)p.push(o(x));return b}case Ju:{if(m)switch(m){case"BigInt":return s([m,c.toString()],c);case"Boolean":case"Number":case"String":return s([m,c.valueOf()],c)}if(t&&"toJSON"in c)return o(c.toJSON());const p=[],b=s([d,p],c);for(const x of fC(c))(e||!vu(wl(c[x])))&&p.push([o(x),o(c[x])]);return b}case J1:return s([d,isNaN(c.getTime())?gs:c.toISOString()],c);case ep:{const{source:p,flags:b}=c;return s([d,{source:p,flags:b}],c)}case tp:{const p=[],b=s([d,p],c);for(const[x,y]of c)(e||!(vu(wl(x))||vu(wl(y))))&&p.push([o(x),o(y)]);return b}case np:{const p=[],b=s([d,p],c);for(const x of c)(e||!vu(wl(x)))&&p.push(o(x));return b}}const{message:h}=c;return s([d,{name:m,message:h}],c)};return o},iv=(e,{json:t,lossy:n}={})=>{const a=[];return mC(!(t||n),!!t,new Map,a)(e),a},ed=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?av(iv(e,t)):structuredClone(e):(e,t)=>av(iv(e,t));function hC(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function pC(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function gC(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||hC,a=e.options.footnoteBackLabel||pC,s=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let m=-1;for(;++m<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[m]);if(!h)continue;const p=e.all(h),b=String(h.identifier).toUpperCase(),x=wo(b.toLowerCase());let y=0;const S=[],T=e.footnoteCounts.get(b);for(;T!==void 0&&++y<=T;){S.length>0&&S.push({type:"text",value:" "});let M=typeof n=="string"?n:n(m,y);typeof M=="string"&&(M={type:"text",value:M}),S.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+x+(y>1?"-"+y:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(m,y),className:["data-footnote-backref"]},children:Array.isArray(M)?M:[M]})}const A=p[p.length-1];if(A&&A.type==="element"&&A.tagName==="p"){const M=A.children[A.children.length-1];M&&M.type==="text"?M.value+=" ":A.children.push({type:"text",value:" "}),A.children.push(...S)}else p.push(...S);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+x},children:e.wrap(p,!0)};e.patch(h,C),d.push(C)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...ed(c),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
27
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
|
|
28
|
-
`}]}}const Ql=(function(e){if(e==null)return xC;if(typeof e=="function")return xd(e);if(typeof e=="object")return Array.isArray(e)?bC(e):vC(e);if(typeof e=="string")return yC(e);throw new Error("Expected function, string, or object as test")});function bC(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Ql(e[n]);return xd(a);function a(...s){let o=-1;for(;++o<t.length;)if(t[o].apply(this,s))return!0;return!1}}function vC(e){const t=e;return xd(n);function n(a){const s=a;let o;for(o in e)if(s[o]!==t[o])return!1;return!0}}function yC(e){return xd(t);function t(n){return n&&n.type===e}}function xd(e){return t;function t(n,a,s){return!!(wC(n)&&e.call(this,n,typeof a=="number"?a:void 0,s||void 0))}}function xC(){return!0}function wC(e){return e!==null&&typeof e=="object"&&"type"in e}const r6=[],kC=!0,Qh=!1,a6="skip";function rp(e,t,n,a){let s;typeof t=="function"&&typeof n!="function"?(a=n,n=t):s=t;const o=Ql(s),c=a?-1:1;d(e,void 0,[])();function d(m,h,p){const b=m&&typeof m=="object"?m:{};if(typeof b.type=="string"){const y=typeof b.tagName=="string"?b.tagName:typeof b.name=="string"?b.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(m.type+(y?"<"+y+">":""))+")"})}return x;function x(){let y=r6,S,T,A;if((!t||o(m,h,p[p.length-1]||void 0))&&(y=SC(n(m,p)),y[0]===Qh))return y;if("children"in m&&m.children){const C=m;if(C.children&&y[0]!==a6)for(T=(a?C.children.length:-1)+c,A=p.concat(C);T>-1&&T<C.children.length;){const M=C.children[T];if(S=d(M,T,A)(),S[0]===Qh)return S;T=typeof S[1]=="number"?S[1]:T+c}}return y}}}function SC(e){return Array.isArray(e)?e:typeof e=="number"?[kC,e]:e==null?r6:[e]}function ap(e,t,n,a){let s,o,c;typeof t=="function"&&typeof n!="function"?(o=void 0,c=t,s=n):(o=t,c=n,s=a),rp(e,o,d,s);function d(m,h){const p=h[h.length-1],b=p?p.children.indexOf(m):void 0;return c(m,b,p)}}const Jh={}.hasOwnProperty,EC={};function TC(e,t){const n=t||EC,a=new Map,s=new Map,o=new Map,c={...cC,...n.handlers},d={all:h,applyData:RC,definitionById:a,footnoteById:s,footnoteCounts:o,footnoteOrder:[],handlers:c,one:m,options:n,patch:CC,wrap:AC};return ap(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const b=p.type==="definition"?a:s,x=String(p.identifier).toUpperCase();b.has(x)||b.set(x,p)}}),d;function m(p,b){const x=p.type,y=d.handlers[x];if(Jh.call(d.handlers,x)&&y)return y(d,p,b);if(d.options.passThrough&&d.options.passThrough.includes(x)){if("children"in p){const{children:T,...A}=p,C=ed(A);return C.children=d.all(p),C}return ed(p)}return(d.options.unknownHandler||NC)(d,p,b)}function h(p){const b=[];if("children"in p){const x=p.children;let y=-1;for(;++y<x.length;){const S=d.one(x[y],p);if(S){if(y&&x[y-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=sv(S.value)),!Array.isArray(S)&&S.type==="element")){const T=S.children[0];T&&T.type==="text"&&(T.value=sv(T.value))}Array.isArray(S)?b.push(...S):b.push(S)}}}return b}}function CC(e,t){e.position&&(t.position=pS(e))}function RC(e,t){let n=t;if(e&&e.data){const a=e.data.hName,s=e.data.hChildren,o=e.data.hProperties;if(typeof a=="string")if(n.type==="element")n.tagName=a;else{const c="children"in n?n.children:[n];n={type:"element",tagName:a,properties:{},children:c}}n.type==="element"&&o&&Object.assign(n.properties,ed(o)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function NC(e,t){const n=t.data||{},a="value"in t&&!(Jh.call(n,"hProperties")||Jh.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function AC(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
|
|
29
|
-
`});++a<e.length;)a&&n.push({type:"text",value:`
|
|
30
|
-
`}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
31
|
-
`}),n}function sv(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function ov(e,t){const n=TC(e,t),a=n.one(e,void 0),s=gC(n),o=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return s&&o.children.push({type:"text",value:`
|
|
32
|
-
`},s),o}function IC(e,t){return e&&"run"in e?async function(n,a){const s=ov(n,{file:a,...t});await e.run(s,a)}:function(n,a){return ov(n,{file:a,...e||t})}}function lv(e){if(e)throw e}var im,cv;function _C(){if(cv)return im;cv=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},o=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var p=e.call(h,"constructor"),b=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!p&&!b)return!1;var x;for(x in h);return typeof x>"u"||e.call(h,x)},c=function(h,p){n&&p.name==="__proto__"?n(h,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):h[p.name]=p.newValue},d=function(h,p){if(p==="__proto__")if(e.call(h,p)){if(a)return a(h,p).value}else return;return h[p]};return im=function m(){var h,p,b,x,y,S,T=arguments[0],A=1,C=arguments.length,M=!1;for(typeof T=="boolean"&&(M=T,T=arguments[1]||{},A=2),(T==null||typeof T!="object"&&typeof T!="function")&&(T={});A<C;++A)if(h=arguments[A],h!=null)for(p in h)b=d(T,p),x=d(h,p),T!==x&&(M&&x&&(o(x)||(y=s(x)))?(y?(y=!1,S=b&&s(b)?b:[]):S=b&&o(b)?b:{},c(T,{name:p,newValue:m(M,S,x)})):typeof x<"u"&&c(T,{name:p,newValue:x}));return T},im}var MC=_C();const sm=dd(MC);function e1(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 OC(){const e=[],t={run:n,use:a};return t;function n(...s){let o=-1;const c=s.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);d(null,...s);function d(m,...h){const p=e[++o];let b=-1;if(m){c(m);return}for(;++b<s.length;)(h[b]===null||h[b]===void 0)&&(h[b]=s[b]);s=h,p?DC(p,d)(...h):c(null,...h)}}function a(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function DC(e,t){let n;return a;function a(...c){const d=e.length>c.length;let m;d&&c.push(s);try{m=e.apply(this,c)}catch(h){const p=h;if(d&&n)throw p;return s(p)}d||(m&&m.then&&typeof m.then=="function"?m.then(o,s):m instanceof Error?s(m):o(m))}function s(c,...d){n||(n=!0,t(c,...d))}function o(c){s(null,c)}}const wa={basename:jC,dirname:LC,extname:zC,join:BC,sep:"/"};function jC(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Jl(e);let n=0,a=-1,s=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(o){n=s+1;break}}else a<0&&(o=!0,a=s+1);return a<0?"":e.slice(n,a)}if(t===e)return"";let c=-1,d=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(o){n=s+1;break}}else c<0&&(o=!0,c=s+1),d>-1&&(e.codePointAt(s)===t.codePointAt(d--)?d<0&&(a=s):(d=-1,a=c));return n===a?a=c:a<0&&(a=e.length),e.slice(n,a)}function LC(e){if(Jl(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 zC(e){Jl(e);let t=e.length,n=-1,a=0,s=-1,o=0,c;for(;t--;){const d=e.codePointAt(t);if(d===47){if(c){a=t+1;break}continue}n<0&&(c=!0,n=t+1),d===46?s<0?s=t:o!==1&&(o=1):s>-1&&(o=-1)}return s<0||n<0||o===0||o===1&&s===n-1&&s===a+1?"":e.slice(s,n)}function BC(...e){let t=-1,n;for(;++t<e.length;)Jl(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":qC(n)}function qC(e){Jl(e);const t=e.codePointAt(0)===47;let n=HC(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function HC(e,t){let n="",a=0,s=-1,o=0,c=-1,d,m;for(;++c<=e.length;){if(c<e.length)d=e.codePointAt(c);else{if(d===47)break;d=47}if(d===47){if(!(s===c-1||o===1))if(s!==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(m=n.lastIndexOf("/"),m!==n.length-1){m<0?(n="",a=0):(n=n.slice(0,m),a=n.length-1-n.lastIndexOf("/")),s=c,o=0;continue}}else if(n.length>0){n="",a=0,s=c,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(s+1,c):n=e.slice(s+1,c),a=c-s-1;s=c,o=0}else d===46&&o>-1?o++:o=-1}return n}function Jl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const UC={cwd:FC};function FC(){return"/"}function t1(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function $C(e){if(typeof e=="string")e=new URL(e);else if(!t1(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 PC(e)}function PC(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 s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const om=["history","path","basename","stem","extname","dirname"];class i6{constructor(t){let n;t?t1(t)?n={path:t}:typeof t=="string"||GC(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":UC.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<om.length;){const o=om[a];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let s;for(s in n)om.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?wa.basename(this.path):void 0}set basename(t){cm(t,"basename"),lm(t,"basename"),this.path=wa.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?wa.dirname(this.path):void 0}set dirname(t){uv(this.basename,"dirname"),this.path=wa.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?wa.extname(this.path):void 0}set extname(t){if(lm(t,"extname"),uv(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=wa.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){t1(t)&&(t=$C(t)),cm(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?wa.basename(this.path,this.extname):void 0}set stem(t){cm(t,"stem"),lm(t,"stem"),this.path=wa.join(this.dirname||"",t+(this.extname||""))}fail(t,n,a){const s=this.message(t,n,a);throw s.fatal=!0,s}info(t,n,a){const s=this.message(t,n,a);return s.fatal=void 0,s}message(t,n,a){const s=new ar(t,n,a);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function lm(e,t){if(e&&e.includes(wa.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+wa.sep+"`")}function cm(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function uv(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function GC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const VC=(function(e){const a=this.constructor.prototype,s=a[e],o=function(){return s.apply(o,arguments)};return Object.setPrototypeOf(o,a),o}),KC={}.hasOwnProperty;class ip extends VC{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=OC()}copy(){const t=new ip;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(sm(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(fm("data",this.frozen),this.namespace[t]=n,this):KC.call(this.namespace,t)&&this.namespace[t]||void 0:t?(fm("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 s=n.call(t,...a);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=yu(t),a=this.parser||this.Parser;return um("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),um("process",this.parser||this.Parser),dm("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(o,c){const d=yu(t),m=a.parse(d);a.run(m,d,function(p,b,x){if(p||!b||!x)return h(p);const y=b,S=a.stringify(y,x);ZC(S)?x.value=S:x.result=S,h(p,x)});function h(p,b){p||!b?c(p):o?o(b):n(void 0,b)}}}processSync(t){let n=!1,a;return this.freeze(),um("processSync",this.parser||this.Parser),dm("processSync",this.compiler||this.Compiler),this.process(t,s),fv("processSync","process",n),a;function s(o,c){n=!0,lv(o),a=c}}run(t,n,a){dv(t),this.freeze();const s=this.transformers;return!a&&typeof n=="function"&&(a=n,n=void 0),a?o(void 0,a):new Promise(o);function o(c,d){const m=yu(n);s.run(t,m,h);function h(p,b,x){const y=b||t;p?d(p):c?c(y):a(void 0,y,x)}}}runSync(t,n){let a=!1,s;return this.run(t,n,o),fv("runSync","run",a),s;function o(c,d){lv(c),s=d,a=!0}}stringify(t,n){this.freeze();const a=yu(n),s=this.compiler||this.Compiler;return dm("stringify",s),dv(t),s(t,a)}use(t,...n){const a=this.attachers,s=this.namespace;if(fm("use",this.frozen),t!=null)if(typeof t=="function")m(t,n);else if(typeof t=="object")Array.isArray(t)?d(t):c(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(h){if(typeof h=="function")m(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[p,...b]=h;m(p,b)}else c(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function c(h){if(!("plugins"in h)&&!("settings"in h))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");d(h.plugins),h.settings&&(s.settings=sm(!0,s.settings,h.settings))}function d(h){let p=-1;if(h!=null)if(Array.isArray(h))for(;++p<h.length;){const b=h[p];o(b)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function m(h,p){let b=-1,x=-1;for(;++b<a.length;)if(a[b][0]===h){x=b;break}if(x===-1)a.push([h,...p]);else if(p.length>0){let[y,...S]=p;const T=a[x][1];e1(T)&&e1(y)&&(y=sm(!0,T,y)),a[x]=[h,y,...S]}}}}const YC=new ip().freeze();function um(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 fm(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 dv(e){if(!e1(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function fv(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function yu(e){return WC(e)?e:new i6(e)}function WC(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function ZC(e){return typeof e=="string"||XC(e)}function XC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const QC="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",mv=[],hv={allowDangerousHtml:!0},JC=/^(https?|ircs?|mailto|xmpp)$/i,eR=[{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 tR(e){const t=nR(e),n=rR(e);return aR(t.runSync(t.parse(n),n),e)}function nR(e){const t=e.rehypePlugins||mv,n=e.remarkPlugins||mv,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...hv}:hv;return YC().use(zT).use(n).use(IC,a).use(t)}function rR(e){const t=e.children||"",n=new i6;return typeof t=="string"&&(n.value=t),n}function aR(e,t){const n=t.allowedElements,a=t.allowElement,s=t.components,o=t.disallowedElements,c=t.skipHtml,d=t.unwrapDisallowed,m=t.urlTransform||iR;for(const p of eR)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+QC+p.id,void 0);return ap(e,h),xS(e,{Fragment:u.Fragment,components:s,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function h(p,b,x){if(p.type==="raw"&&x&&typeof b=="number")return c?x.children.splice(b,1):x.children[b]={type:"text",value:p.value},b;if(p.type==="element"){let y;for(y in nm)if(Object.hasOwn(nm,y)&&Object.hasOwn(p.properties,y)){const S=p.properties[y],T=nm[y];(T===null||T.includes(p.tagName))&&(p.properties[y]=m(String(S||""),y,p))}}if(p.type==="element"){let y=n?!n.includes(p.tagName):o?o.includes(p.tagName):!1;if(!y&&a&&typeof b=="number"&&(y=!a(p,b,x)),y&&x&&typeof b=="number")return d&&p.children?x.children.splice(b,1,...p.children):x.children.splice(b,1),b}}}function iR(e){const t=e.indexOf(":"),n=e.indexOf("?"),a=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||a!==-1&&t>a||JC.test(e.slice(0,t))?e:""}function pv(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let a=0,s=n.indexOf(t);for(;s!==-1;)a++,s=n.indexOf(t,s+t.length);return a}function sR(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function oR(e,t,n){const s=Ql((n||{}).ignore||[]),o=lR(t);let c=-1;for(;++c<o.length;)rp(e,"text",d);function d(h,p){let b=-1,x;for(;++b<p.length;){const y=p[b],S=x?x.children:void 0;if(s(y,S?S.indexOf(y):void 0,x))return;x=y}if(x)return m(h,p)}function m(h,p){const b=p[p.length-1],x=o[c][0],y=o[c][1];let S=0;const A=b.children.indexOf(h);let C=!1,M=[];x.lastIndex=0;let I=x.exec(h.value);for(;I;){const P=I.index,U={index:I.index,input:I.input,stack:[...p,h]};let N=y(...I,U);if(typeof N=="string"&&(N=N.length>0?{type:"text",value:N}:void 0),N===!1?x.lastIndex=P+1:(S!==P&&M.push({type:"text",value:h.value.slice(S,P)}),Array.isArray(N)?M.push(...N):N&&M.push(N),S=P+I[0].length,C=!0),!x.global)break;I=x.exec(h.value)}return C?(S<h.value.length&&M.push({type:"text",value:h.value.slice(S)}),b.children.splice(A,1,...M)):M=[h],A+M.length}}function lR(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 s=n[a];t.push([cR(s[0]),uR(s[1])])}return t}function cR(e){return typeof e=="string"?new RegExp(sR(e),"g"):e}function uR(e){return typeof e=="function"?e:function(){return e}}const mm="phrasing",hm=["autolink","link","image","label"];function dR(){return{transforms:[vR],enter:{literalAutolink:mR,literalAutolinkEmail:pm,literalAutolinkHttp:pm,literalAutolinkWww:pm},exit:{literalAutolink:bR,literalAutolinkEmail:gR,literalAutolinkHttp:hR,literalAutolinkWww:pR}}}function fR(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:mm,notInConstruct:hm},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:mm,notInConstruct:hm},{character:":",before:"[ps]",after:"\\/",inConstruct:mm,notInConstruct:hm}]}}function mR(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function pm(e){this.config.enter.autolinkProtocol.call(this,e)}function hR(e){this.config.exit.autolinkProtocol.call(this,e)}function pR(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 gR(e){this.config.exit.autolinkEmail.call(this,e)}function bR(e){this.exit(e)}function vR(e){oR(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,yR],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),xR]],{ignore:["link","linkReference"]})}function yR(e,t,n,a,s){let o="";if(!s6(s)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!wR(n)))return!1;const c=kR(n+a);if(!c[0])return!1;const d={type:"link",title:null,url:o+t+c[0],children:[{type:"text",value:t+c[0]}]};return c[1]?[d,{type:"text",value:c[1]}]:d}function xR(e,t,n,a){return!s6(a,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function wR(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 kR(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 s=pv(e,"(");let o=pv(e,")");for(;a!==-1&&s>o;)e+=n.slice(0,a+1),n=n.slice(a+1),a=n.indexOf(")"),o++;return[e,n]}function s6(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Es(n)||bd(n))&&(!t||n!==47)}o6.peek=_R;function SR(){this.buffer()}function ER(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function TR(){this.buffer()}function CR(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function RR(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ua(this.sliceSerialize(e)).toLowerCase(),n.label=t}function NR(e){this.exit(e)}function AR(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ua(this.sliceSerialize(e)).toLowerCase(),n.label=t}function IR(e){this.exit(e)}function _R(){return"["}function o6(e,t,n,a){const s=n.createTracker(a);let o=s.move("[^");const c=n.enter("footnoteReference"),d=n.enter("reference");return o+=s.move(n.safe(n.associationId(e),{after:"]",before:o})),d(),c(),o+=s.move("]"),o}function MR(){return{enter:{gfmFootnoteCallString:SR,gfmFootnoteCall:ER,gfmFootnoteDefinitionLabelString:TR,gfmFootnoteDefinition:CR},exit:{gfmFootnoteCallString:RR,gfmFootnoteCall:NR,gfmFootnoteDefinitionLabelString:AR,gfmFootnoteDefinition:IR}}}function OR(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:o6},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(a,s,o,c){const d=o.createTracker(c);let m=d.move("[^");const h=o.enter("footnoteDefinition"),p=o.enter("label");return m+=d.move(o.safe(o.associationId(a),{before:m,after:"]"})),p(),m+=d.move("]:"),a.children&&a.children.length>0&&(d.shift(4),m+=d.move((t?`
|
|
33
|
-
`:" ")+o.indentLines(o.containerFlow(a,d.current()),t?l6:DR))),h(),m}}function DR(e,t,n){return t===0?e:l6(e,t,n)}function l6(e,t,n){return(n?"":" ")+e}const jR=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];c6.peek=HR;function LR(){return{canContainEols:["delete"],enter:{strikethrough:BR},exit:{strikethrough:qR}}}function zR(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:jR}],handlers:{delete:c6}}}function BR(e){this.enter({type:"delete",children:[]},e)}function qR(e){this.exit(e)}function c6(e,t,n,a){const s=n.createTracker(a),o=n.enter("strikethrough");let c=s.move("~~");return c+=n.containerPhrasing(e,{...s.current(),before:c,after:"~"}),c+=s.move("~~"),o(),c}function HR(){return"~"}function UR(e){return e.length}function FR(e,t){const n=t||{},a=(n.align||[]).concat(),s=n.stringLength||UR,o=[],c=[],d=[],m=[];let h=0,p=-1;for(;++p<e.length;){const T=[],A=[];let C=-1;for(e[p].length>h&&(h=e[p].length);++C<e[p].length;){const M=$R(e[p][C]);if(n.alignDelimiters!==!1){const I=s(M);A[C]=I,(m[C]===void 0||I>m[C])&&(m[C]=I)}T.push(M)}c[p]=T,d[p]=A}let b=-1;if(typeof a=="object"&&"length"in a)for(;++b<h;)o[b]=gv(a[b]);else{const T=gv(a);for(;++b<h;)o[b]=T}b=-1;const x=[],y=[];for(;++b<h;){const T=o[b];let A="",C="";T===99?(A=":",C=":"):T===108?A=":":T===114&&(C=":");let M=n.alignDelimiters===!1?1:Math.max(1,m[b]-A.length-C.length);const I=A+"-".repeat(M)+C;n.alignDelimiters!==!1&&(M=A.length+M+C.length,M>m[b]&&(m[b]=M),y[b]=M),x[b]=I}c.splice(1,0,x),d.splice(1,0,y),p=-1;const S=[];for(;++p<c.length;){const T=c[p],A=d[p];b=-1;const C=[];for(;++b<h;){const M=T[b]||"";let I="",P="";if(n.alignDelimiters!==!1){const U=m[b]-(A[b]||0),N=o[b];N===114?I=" ".repeat(U):N===99?U%2?(I=" ".repeat(U/2+.5),P=" ".repeat(U/2-.5)):(I=" ".repeat(U/2),P=I):P=" ".repeat(U)}n.delimiterStart!==!1&&!b&&C.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&M==="")&&(n.delimiterStart!==!1||b)&&C.push(" "),n.alignDelimiters!==!1&&C.push(I),C.push(M),n.alignDelimiters!==!1&&C.push(P),n.padding!==!1&&C.push(" "),(n.delimiterEnd!==!1||b!==h-1)&&C.push("|")}S.push(n.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return S.join(`
|
|
34
|
-
`)}function $R(e){return e==null?"":String(e)}function gv(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 PR(e,t,n,a){const s=n.enter("blockquote"),o=n.createTracker(a);o.move("> "),o.shift(2);const c=n.indentLines(n.containerFlow(e,o.current()),GR);return s(),c}function GR(e,t,n){return">"+(n?"":" ")+e}function VR(e,t){return bv(e,t.inConstruct,!0)&&!bv(e,t.notInConstruct,!1)}function bv(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 vv(e,t,n,a){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
|
|
35
|
-
`&&VR(n.stack,n.unsafe[s]))return/[ \t]/.test(a.before)?"":" ";return`\\
|
|
36
|
-
`}function u6(e,t){const n=String(e);let a=n.indexOf(t),s=a,o=0,c=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===s?++o>c&&(c=o):o=1,s=a+t.length,a=n.indexOf(t,s);return c}function KR(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 YR(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 WR(e,t,n,a){const s=YR(n),o=e.value||"",c=s==="`"?"GraveAccent":"Tilde";if(KR(e,n)){const b=n.enter("codeIndented"),x=n.indentLines(o,ZR);return b(),x}const d=n.createTracker(a),m=s.repeat(Math.max(u6(o,s)+1,3)),h=n.enter("codeFenced");let p=d.move(m);if(e.lang){const b=n.enter(`codeFencedLang${c}`);p+=d.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...d.current()})),b()}if(e.lang&&e.meta){const b=n.enter(`codeFencedMeta${c}`);p+=d.move(" "),p+=d.move(n.safe(e.meta,{before:p,after:`
|
|
37
|
-
`,encode:["`"],...d.current()})),b()}return p+=d.move(`
|
|
38
|
-
`),o&&(p+=d.move(o+`
|
|
39
|
-
`)),p+=d.move(m),h(),p}function ZR(e,t,n){return(n?"":" ")+e}function sp(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function XR(e,t,n,a){const s=sp(n),o=s==='"'?"Quote":"Apostrophe",c=n.enter("definition");let d=n.enter("label");const m=n.createTracker(a);let h=m.move("[");return h+=m.move(n.safe(n.associationId(e),{before:h,after:"]",...m.current()})),h+=m.move("]: "),d(),!e.url||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(n.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(d=n.enter("destinationRaw"),h+=m.move(n.safe(e.url,{before:h,after:e.title?" ":`
|
|
40
|
-
`,...m.current()}))),d(),e.title&&(d=n.enter(`title${o}`),h+=m.move(" "+s),h+=m.move(n.safe(e.title,{before:h,after:s,...m.current()})),h+=m.move(s),d()),c(),h}function QR(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function $l(e){return"&#x"+e.toString(16).toUpperCase()+";"}function td(e,t,n){const a=ho(e),s=ho(t);return a===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:a===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}d6.peek=JR;function d6(e,t,n,a){const s=QR(n),o=n.enter("emphasis"),c=n.createTracker(a),d=c.move(s);let m=c.move(n.containerPhrasing(e,{after:s,before:d,...c.current()}));const h=m.charCodeAt(0),p=td(a.before.charCodeAt(a.before.length-1),h,s);p.inside&&(m=$l(h)+m.slice(1));const b=m.charCodeAt(m.length-1),x=td(a.after.charCodeAt(0),b,s);x.inside&&(m=m.slice(0,-1)+$l(b));const y=c.move(s);return o(),n.attentionEncodeSurroundingInfo={after:x.outside,before:p.outside},d+m+y}function JR(e,t,n){return n.options.emphasis||"*"}function eN(e,t){let n=!1;return ap(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return n=!0,Qh}),!!((!e.depth||e.depth<3)&&Z1(e)&&(t.options.setext||n))}function tN(e,t,n,a){const s=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(a);if(eN(e,n)){const p=n.enter("headingSetext"),b=n.enter("phrasing"),x=n.containerPhrasing(e,{...o.current(),before:`
|
|
41
|
-
`,after:`
|
|
42
|
-
`});return b(),p(),x+`
|
|
43
|
-
`+(s===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
|
|
44
|
-
`))+1))}const c="#".repeat(s),d=n.enter("headingAtx"),m=n.enter("phrasing");o.move(c+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
|
|
45
|
-
`,...o.current()});return/^[\t ]/.test(h)&&(h=$l(h.charCodeAt(0))+h.slice(1)),h=h?c+" "+h:c,n.options.closeAtx&&(h+=" "+c),m(),d(),h}f6.peek=nN;function f6(e){return e.value||""}function nN(){return"<"}m6.peek=rN;function m6(e,t,n,a){const s=sp(n),o=s==='"'?"Quote":"Apostrophe",c=n.enter("image");let d=n.enter("label");const m=n.createTracker(a);let h=m.move("![");return h+=m.move(n.safe(e.alt,{before:h,after:"]",...m.current()})),h+=m.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),h+=m.move("<"),h+=m.move(n.safe(e.url,{before:h,after:">",...m.current()})),h+=m.move(">")):(d=n.enter("destinationRaw"),h+=m.move(n.safe(e.url,{before:h,after:e.title?" ":")",...m.current()}))),d(),e.title&&(d=n.enter(`title${o}`),h+=m.move(" "+s),h+=m.move(n.safe(e.title,{before:h,after:s,...m.current()})),h+=m.move(s),d()),h+=m.move(")"),c(),h}function rN(){return"!"}h6.peek=aN;function h6(e,t,n,a){const s=e.referenceType,o=n.enter("imageReference");let c=n.enter("label");const d=n.createTracker(a);let m=d.move("![");const h=n.safe(e.alt,{before:m,after:"]",...d.current()});m+=d.move(h+"]["),c();const p=n.stack;n.stack=[],c=n.enter("reference");const b=n.safe(n.associationId(e),{before:m,after:"]",...d.current()});return c(),n.stack=p,o(),s==="full"||!h||h!==b?m+=d.move(b+"]"):s==="shortcut"?m=m.slice(0,-1):m+=d.move("]"),m}function aN(){return"!"}p6.peek=iN;function p6(e,t,n){let a=e.value||"",s="`",o=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(a);)s+="`";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],d=n.compilePattern(c);let m;if(c.atBreak)for(;m=d.exec(a);){let h=m.index;a.charCodeAt(h)===10&&a.charCodeAt(h-1)===13&&h--,a=a.slice(0,h)+" "+a.slice(m.index+1)}}return s+a+s}function iN(){return"`"}function g6(e,t){const n=Z1(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))}b6.peek=sN;function b6(e,t,n,a){const s=sp(n),o=s==='"'?"Quote":"Apostrophe",c=n.createTracker(a);let d,m;if(g6(e,n)){const p=n.stack;n.stack=[],d=n.enter("autolink");let b=c.move("<");return b+=c.move(n.containerPhrasing(e,{before:b,after:">",...c.current()})),b+=c.move(">"),d(),n.stack=p,b}d=n.enter("link"),m=n.enter("label");let h=c.move("[");return h+=c.move(n.containerPhrasing(e,{before:h,after:"](",...c.current()})),h+=c.move("]("),m(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(m=n.enter("destinationLiteral"),h+=c.move("<"),h+=c.move(n.safe(e.url,{before:h,after:">",...c.current()})),h+=c.move(">")):(m=n.enter("destinationRaw"),h+=c.move(n.safe(e.url,{before:h,after:e.title?" ":")",...c.current()}))),m(),e.title&&(m=n.enter(`title${o}`),h+=c.move(" "+s),h+=c.move(n.safe(e.title,{before:h,after:s,...c.current()})),h+=c.move(s),m()),h+=c.move(")"),d(),h}function sN(e,t,n){return g6(e,n)?"<":"["}v6.peek=oN;function v6(e,t,n,a){const s=e.referenceType,o=n.enter("linkReference");let c=n.enter("label");const d=n.createTracker(a);let m=d.move("[");const h=n.containerPhrasing(e,{before:m,after:"]",...d.current()});m+=d.move(h+"]["),c();const p=n.stack;n.stack=[],c=n.enter("reference");const b=n.safe(n.associationId(e),{before:m,after:"]",...d.current()});return c(),n.stack=p,o(),s==="full"||!h||h!==b?m+=d.move(b+"]"):s==="shortcut"?m=m.slice(0,-1):m+=d.move("]"),m}function oN(){return"["}function op(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 lN(e){const t=op(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 cN(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 y6(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 uN(e,t,n,a){const s=n.enter("list"),o=n.bulletCurrent;let c=e.ordered?cN(n):op(n);const d=e.ordered?c==="."?")":".":lN(n);let m=t&&n.bulletLastUsed?c===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((c==="*"||c==="-")&&p&&(!p.children||!p.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&&(m=!0),y6(n)===c&&p){let b=-1;for(;++b<e.children.length;){const x=e.children[b];if(x&&x.type==="listItem"&&x.children&&x.children[0]&&x.children[0].type==="thematicBreak"){m=!0;break}}}}m&&(c=d),n.bulletCurrent=c;const h=n.containerFlow(e,a);return n.bulletLastUsed=c,n.bulletCurrent=o,s(),h}function dN(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 fN(e,t,n,a){const s=dN(n);let o=n.bulletCurrent||op(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;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(c=Math.ceil(c/4)*4);const d=n.createTracker(a);d.move(o+" ".repeat(c-o.length)),d.shift(c);const m=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,d.current()),p);return m(),h;function p(b,x,y){return x?(y?"":" ".repeat(c))+b:(y?o:o+" ".repeat(c-o.length))+b}}function mN(e,t,n,a){const s=n.enter("paragraph"),o=n.enter("phrasing"),c=n.containerPhrasing(e,a);return o(),s(),c}const hN=Ql(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function pN(e,t,n,a){return(e.children.some(function(c){return hN(c)})?n.containerPhrasing:n.containerFlow).call(n,e,a)}function gN(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}x6.peek=bN;function x6(e,t,n,a){const s=gN(n),o=n.enter("strong"),c=n.createTracker(a),d=c.move(s+s);let m=c.move(n.containerPhrasing(e,{after:s,before:d,...c.current()}));const h=m.charCodeAt(0),p=td(a.before.charCodeAt(a.before.length-1),h,s);p.inside&&(m=$l(h)+m.slice(1));const b=m.charCodeAt(m.length-1),x=td(a.after.charCodeAt(0),b,s);x.inside&&(m=m.slice(0,-1)+$l(b));const y=c.move(s+s);return o(),n.attentionEncodeSurroundingInfo={after:x.outside,before:p.outside},d+m+y}function bN(e,t,n){return n.options.strong||"*"}function vN(e,t,n,a){return n.safe(e.value,a)}function yN(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 xN(e,t,n){const a=(y6(n)+(n.options.ruleSpaces?" ":"")).repeat(yN(n));return n.options.ruleSpaces?a.slice(0,-1):a}const w6={blockquote:PR,break:vv,code:WR,definition:XR,emphasis:d6,hardBreak:vv,heading:tN,html:f6,image:m6,imageReference:h6,inlineCode:p6,link:b6,linkReference:v6,list:uN,listItem:fN,paragraph:mN,root:pN,strong:x6,text:vN,thematicBreak:xN};function wN(){return{enter:{table:kN,tableData:yv,tableHeader:yv,tableRow:EN},exit:{codeText:TN,table:SN,tableData:gm,tableHeader:gm,tableRow:gm}}}function kN(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 SN(e){this.exit(e),this.data.inTable=void 0}function EN(e){this.enter({type:"tableRow",children:[]},e)}function gm(e){this.exit(e)}function yv(e){this.enter({type:"tableCell",children:[]},e)}function TN(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,CN));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function CN(e,t){return t==="|"?t:e}function RN(e){const t=e||{},n=t.tableCellPadding,a=t.tablePipeAlign,s=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
46
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:x,table:c,tableCell:m,tableRow:d}};function c(y,S,T,A){return h(p(y,T,A),y.align)}function d(y,S,T,A){const C=b(y,T,A),M=h([C]);return M.slice(0,M.indexOf(`
|
|
47
|
-
`))}function m(y,S,T,A){const C=T.enter("tableCell"),M=T.enter("phrasing"),I=T.containerPhrasing(y,{...A,before:o,after:o});return M(),C(),I}function h(y,S){return FR(y,{align:S,alignDelimiters:a,padding:n,stringLength:s})}function p(y,S,T){const A=y.children;let C=-1;const M=[],I=S.enter("table");for(;++C<A.length;)M[C]=b(A[C],S,T);return I(),M}function b(y,S,T){const A=y.children;let C=-1;const M=[],I=S.enter("tableRow");for(;++C<A.length;)M[C]=m(A[C],y,S,T);return I(),M}function x(y,S,T){let A=w6.inlineCode(y,S,T);return T.stack.includes("tableCell")&&(A=A.replace(/\|/g,"\\$&")),A}}function NN(){return{exit:{taskListCheckValueChecked:xv,taskListCheckValueUnchecked:xv,paragraph:IN}}}function AN(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:_N}}}function xv(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function IN(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 s=t.children;let o=-1,c;for(;++o<s.length;){const d=s[o];if(d.type==="paragraph"){c=d;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 _N(e,t,n,a){const s=e.children[0],o=typeof e.checked=="boolean"&&s&&s.type==="paragraph",c="["+(e.checked?"x":" ")+"] ",d=n.createTracker(a);o&&d.move(c);let m=w6.listItem(e,t,n,{...a,...d.current()});return o&&(m=m.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),m;function h(p){return p+c}}function MN(){return[dR(),MR(),LR(),wN(),NN()]}function ON(e){return{extensions:[fR(),OR(e),zR(),RN(e),AN()]}}const DN={tokenize:HN,partial:!0},k6={tokenize:UN,partial:!0},S6={tokenize:FN,partial:!0},E6={tokenize:$N,partial:!0},jN={tokenize:PN,partial:!0},T6={name:"wwwAutolink",tokenize:BN,previous:R6},C6={name:"protocolAutolink",tokenize:qN,previous:N6},ti={name:"emailAutolink",tokenize:zN,previous:A6},Ea={};function LN(){return{text:Ea}}let ms=48;for(;ms<123;)Ea[ms]=ti,ms++,ms===58?ms=65:ms===91&&(ms=97);Ea[43]=ti;Ea[45]=ti;Ea[46]=ti;Ea[95]=ti;Ea[72]=[ti,C6];Ea[104]=[ti,C6];Ea[87]=[ti,T6];Ea[119]=[ti,T6];function zN(e,t,n){const a=this;let s,o;return c;function c(b){return!n1(b)||!A6.call(a,a.previous)||lp(a.events)?n(b):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),d(b))}function d(b){return n1(b)?(e.consume(b),d):b===64?(e.consume(b),m):n(b)}function m(b){return b===46?e.check(jN,p,h)(b):b===45||b===95||nr(b)?(o=!0,e.consume(b),m):p(b)}function h(b){return e.consume(b),s=!0,m}function p(b){return o&&s&&ur(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(b)):n(b)}}function BN(e,t,n){const a=this;return s;function s(c){return c!==87&&c!==119||!R6.call(a,a.previous)||lp(a.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(DN,e.attempt(k6,e.attempt(S6,o),n),n)(c))}function o(c){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(c)}}function qN(e,t,n){const a=this;let s="",o=!1;return c;function c(b){return(b===72||b===104)&&N6.call(a,a.previous)&&!lp(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(b),e.consume(b),d):n(b)}function d(b){if(ur(b)&&s.length<5)return s+=String.fromCodePoint(b),e.consume(b),d;if(b===58){const x=s.toLowerCase();if(x==="http"||x==="https")return e.consume(b),m}return n(b)}function m(b){return b===47?(e.consume(b),o?h:(o=!0,m)):n(b)}function h(b){return b===null||Qu(b)||un(b)||Es(b)||bd(b)?n(b):e.attempt(k6,e.attempt(S6,p),n)(b)}function p(b){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(b)}}function HN(e,t,n){let a=0;return s;function s(c){return(c===87||c===119)&&a<3?(a++,e.consume(c),s):c===46&&a===3?(e.consume(c),o):n(c)}function o(c){return c===null?n(c):t(c)}}function UN(e,t,n){let a,s,o;return c;function c(h){return h===46||h===95?e.check(E6,m,d)(h):h===null||un(h)||Es(h)||h!==45&&bd(h)?m(h):(o=!0,e.consume(h),c)}function d(h){return h===95?a=!0:(s=a,a=void 0),e.consume(h),c}function m(h){return s||a||!o?n(h):t(h)}}function FN(e,t){let n=0,a=0;return s;function s(c){return c===40?(n++,e.consume(c),s):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(E6,t,o)(c):c===null||un(c)||Es(c)?t(c):(e.consume(c),s)}function o(c){return c===41&&a++,e.consume(c),s}}function $N(e,t,n){return a;function a(d){return d===33||d===34||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===63||d===95||d===126?(e.consume(d),a):d===38?(e.consume(d),o):d===93?(e.consume(d),s):d===60||d===null||un(d)||Es(d)?t(d):n(d)}function s(d){return d===null||d===40||d===91||un(d)||Es(d)?t(d):a(d)}function o(d){return ur(d)?c(d):n(d)}function c(d){return d===59?(e.consume(d),a):ur(d)?(e.consume(d),c):n(d)}}function PN(e,t,n){return a;function a(o){return e.consume(o),s}function s(o){return nr(o)?n(o):t(o)}}function R6(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||un(e)}function N6(e){return!ur(e)}function A6(e){return!(e===47||n1(e))}function n1(e){return e===43||e===45||e===46||e===95||nr(e)}function lp(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 GN={tokenize:JN,partial:!0};function VN(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:ZN,continuation:{tokenize:XN},exit:QN}},text:{91:{name:"gfmFootnoteCall",tokenize:WN},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:KN,resolveTo:YN}}}}function KN(e,t,n){const a=this;let s=a.events.length;const o=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let c;for(;s--;){const m=a.events[s][1];if(m.type==="labelImage"){c=m;break}if(m.type==="gfmFootnoteCall"||m.type==="labelLink"||m.type==="label"||m.type==="image"||m.type==="link")break}return d;function d(m){if(!c||!c._balanced)return n(m);const h=ua(a.sliceSerialize({start:c.end,end:a.now()}));return h.codePointAt(0)!==94||!o.includes(h.slice(1))?n(m):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),t(m))}}function YN(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)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},s.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)},d=[e[n+1],e[n+2],["enter",a,t],e[n+3],e[n+4],["enter",s,t],["exit",s,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,...d),e}function WN(e,t,n){const a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o=0,c;return d;function d(b){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(b),e.exit("gfmFootnoteCallLabelMarker"),m}function m(b){return b!==94?n(b):(e.enter("gfmFootnoteCallMarker"),e.consume(b),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(b){if(o>999||b===93&&!c||b===null||b===91||un(b))return n(b);if(b===93){e.exit("chunkString");const x=e.exit("gfmFootnoteCallString");return s.includes(ua(a.sliceSerialize(x)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(b),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(b)}return un(b)||(c=!0),o++,e.consume(b),b===92?p:h}function p(b){return b===91||b===92||b===93?(e.consume(b),o++,h):h(b)}}function ZN(e,t,n){const a=this,s=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let o,c=0,d;return m;function m(S){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(S){return S===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(S)}function p(S){if(c>999||S===93&&!d||S===null||S===91||un(S))return n(S);if(S===93){e.exit("chunkString");const T=e.exit("gfmFootnoteDefinitionLabelString");return o=ua(a.sliceSerialize(T)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),x}return un(S)||(d=!0),c++,e.consume(S),S===92?b:p}function b(S){return S===91||S===92||S===93?(e.consume(S),c++,p):p(S)}function x(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),s.includes(o)||s.push(o),Dt(e,y,"gfmFootnoteDefinitionWhitespace")):n(S)}function y(S){return t(S)}}function XN(e,t,n){return e.check(Xl,t,e.attempt(GN,t,n))}function QN(e){e.exit("gfmFootnoteDefinition")}function JN(e,t,n){const a=this;return Dt(e,s,"gfmFootnoteDefinitionIndent",5);function s(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 eA(e){let n=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:o,resolveAll:s};return n==null&&(n=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function s(c,d){let m=-1;for(;++m<c.length;)if(c[m][0]==="enter"&&c[m][1].type==="strikethroughSequenceTemporary"&&c[m][1]._close){let h=m;for(;h--;)if(c[h][0]==="exit"&&c[h][1].type==="strikethroughSequenceTemporary"&&c[h][1]._open&&c[m][1].end.offset-c[m][1].start.offset===c[h][1].end.offset-c[h][1].start.offset){c[m][1].type="strikethroughSequence",c[h][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},c[h][1].start),end:Object.assign({},c[m][1].end)},b={type:"strikethroughText",start:Object.assign({},c[h][1].end),end:Object.assign({},c[m][1].start)},x=[["enter",p,d],["enter",c[h][1],d],["exit",c[h][1],d],["enter",b,d]],y=d.parser.constructs.insideSpan.null;y&&Br(x,x.length,0,vd(y,c.slice(h+1,m),d)),Br(x,x.length,0,[["exit",b,d],["enter",c[m][1],d],["exit",c[m][1],d],["exit",p,d]]),Br(c,h-1,m-h+3,x),m=h+x.length-2;break}}for(m=-1;++m<c.length;)c[m][1].type==="strikethroughSequenceTemporary"&&(c[m][1].type="data");return c}function o(c,d,m){const h=this.previous,p=this.events;let b=0;return x;function x(S){return h===126&&p[p.length-1][1].type!=="characterEscape"?m(S):(c.enter("strikethroughSequenceTemporary"),y(S))}function y(S){const T=ho(h);if(S===126)return b>1?m(S):(c.consume(S),b++,y);if(b<2&&!n)return m(S);const A=c.exit("strikethroughSequenceTemporary"),C=ho(S);return A._open=!C||C===2&&!!T,A._close=!T||T===2&&!!C,d(S)}}}class tA{constructor(){this.map=[]}add(t,n,a){nA(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 s=a.pop();for(;s;){for(const o of s)t.push(o);s=a.pop()}this.map.length=0}}function nA(e,t,n,a){let s=0;if(!(n===0&&a.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...a);return}s+=1}e.map.push([t,n,a])}}function rA(e,t){let n=!1;const a=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&a.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=a.length-1;a[o]=a[o]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return a}function aA(){return{flow:{null:{name:"table",tokenize:iA,resolveAll:sA}}}}function iA(e,t,n){const a=this;let s=0,o=0,c;return d;function d($){let F=a.events.length-1;for(;F>-1;){const J=a.events[F][1].type;if(J==="lineEnding"||J==="linePrefix")F--;else break}const K=F>-1?a.events[F][1].type:null,oe=K==="tableHead"||K==="tableRow"?N:m;return oe===N&&a.parser.lazy[a.now().line]?n($):oe($)}function m($){return e.enter("tableHead"),e.enter("tableRow"),h($)}function h($){return $===124||(c=!0,o+=1),p($)}function p($){return $===null?n($):tt($)?o>1?(o=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume($),e.exit("lineEnding"),y):n($):qt($)?Dt(e,p,"whitespace")($):(o+=1,c&&(c=!1,s+=1),$===124?(e.enter("tableCellDivider"),e.consume($),e.exit("tableCellDivider"),c=!0,p):(e.enter("data"),b($)))}function b($){return $===null||$===124||un($)?(e.exit("data"),p($)):(e.consume($),$===92?x:b)}function x($){return $===92||$===124?(e.consume($),b):b($)}function y($){return a.interrupt=!1,a.parser.lazy[a.now().line]?n($):(e.enter("tableDelimiterRow"),c=!1,qt($)?Dt(e,S,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):S($))}function S($){return $===45||$===58?A($):$===124?(c=!0,e.enter("tableCellDivider"),e.consume($),e.exit("tableCellDivider"),T):U($)}function T($){return qt($)?Dt(e,A,"whitespace")($):A($)}function A($){return $===58?(o+=1,c=!0,e.enter("tableDelimiterMarker"),e.consume($),e.exit("tableDelimiterMarker"),C):$===45?(o+=1,C($)):$===null||tt($)?P($):U($)}function C($){return $===45?(e.enter("tableDelimiterFiller"),M($)):U($)}function M($){return $===45?(e.consume($),M):$===58?(c=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume($),e.exit("tableDelimiterMarker"),I):(e.exit("tableDelimiterFiller"),I($))}function I($){return qt($)?Dt(e,P,"whitespace")($):P($)}function P($){return $===124?S($):$===null||tt($)?!c||s!==o?U($):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t($)):U($)}function U($){return n($)}function N($){return e.enter("tableRow"),z($)}function z($){return $===124?(e.enter("tableCellDivider"),e.consume($),e.exit("tableCellDivider"),z):$===null||tt($)?(e.exit("tableRow"),t($)):qt($)?Dt(e,z,"whitespace")($):(e.enter("data"),X($))}function X($){return $===null||$===124||un($)?(e.exit("data"),z($)):(e.consume($),$===92?B:X)}function B($){return $===92||$===124?(e.consume($),X):X($)}}function sA(e,t){let n=-1,a=!0,s=0,o=[0,0,0,0],c=[0,0,0,0],d=!1,m=0,h,p,b;const x=new tA;for(;++n<e.length;){const y=e[n],S=y[1];y[0]==="enter"?S.type==="tableHead"?(d=!1,m!==0&&(wv(x,t,m,h,p),p=void 0,m=0),h={type:"table",start:Object.assign({},S.start),end:Object.assign({},S.end)},x.add(n,0,[["enter",h,t]])):S.type==="tableRow"||S.type==="tableDelimiterRow"?(a=!0,b=void 0,o=[0,0,0,0],c=[0,n+1,0,0],d&&(d=!1,p={type:"tableBody",start:Object.assign({},S.start),end:Object.assign({},S.end)},x.add(n,0,[["enter",p,t]])),s=S.type==="tableDelimiterRow"?2:p?3:1):s&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")?(a=!1,c[2]===0&&(o[1]!==0&&(c[0]=c[1],b=xu(x,t,o,s,void 0,b),o=[0,0,0,0]),c[2]=n)):S.type==="tableCellDivider"&&(a?a=!1:(o[1]!==0&&(c[0]=c[1],b=xu(x,t,o,s,void 0,b)),o=c,c=[o[1],n,0,0])):S.type==="tableHead"?(d=!0,m=n):S.type==="tableRow"||S.type==="tableDelimiterRow"?(m=n,o[1]!==0?(c[0]=c[1],b=xu(x,t,o,s,n,b)):c[1]!==0&&(b=xu(x,t,c,s,n,b)),s=0):s&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(c[3]=n)}for(m!==0&&wv(x,t,m,h,p),x.consume(t.events),n=-1;++n<t.events.length;){const y=t.events[n];y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=rA(t.events,n))}return e}function xu(e,t,n,a,s,o){const c=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",d="tableContent";n[0]!==0&&(o.end=Object.assign({},uo(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const m=uo(t.events,n[1]);if(o={type:c,start:Object.assign({},m),end:Object.assign({},m)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const h=uo(t.events,n[2]),p=uo(t.events,n[3]),b={type:d,start:Object.assign({},h),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",b,t]]),a!==2){const x=t.events[n[2]],y=t.events[n[3]];if(x[1].end=Object.assign({},y[1].end),x[1].type="chunkText",x[1].contentType="text",n[3]>n[2]+1){const S=n[2]+1,T=n[3]-n[2]-1;e.add(S,T,[])}}e.add(n[3]+1,0,[["exit",b,t]])}return s!==void 0&&(o.end=Object.assign({},uo(t.events,s)),e.add(s,0,[["exit",o,t]]),o=void 0),o}function wv(e,t,n,a,s){const o=[],c=uo(t.events,n);s&&(s.end=Object.assign({},c),o.push(["exit",s,t])),a.end=Object.assign({},c),o.push(["exit",a,t]),e.add(n+1,0,o)}function uo(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const oA={name:"tasklistCheck",tokenize:cA};function lA(){return{text:{91:oA}}}function cA(e,t,n){const a=this;return s;function s(m){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?n(m):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),o)}function o(m){return un(m)?(e.enter("taskListCheckValueUnchecked"),e.consume(m),e.exit("taskListCheckValueUnchecked"),c):m===88||m===120?(e.enter("taskListCheckValueChecked"),e.consume(m),e.exit("taskListCheckValueChecked"),c):n(m)}function c(m){return m===93?(e.enter("taskListCheckMarker"),e.consume(m),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),d):n(m)}function d(m){return tt(m)?t(m):qt(m)?e.check({tokenize:uA},t,n)(m):n(m)}}function uA(e,t,n){return Dt(e,a,"whitespace");function a(s){return s===null?n(s):t(s)}}function dA(e){return B5([LN(),VN(),eA(e),aA(),lA()])}const fA={};function mA(e){const t=this,n=e||fA,a=t.data(),s=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),c=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);s.push(dA(n)),o.push(MN()),c.push(ON(n))}function hA(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:o},exit:{mathFlow:s,mathFlowFence:a,mathFlowFenceMeta:n,mathFlowValue:d,mathText:c,mathTextData:d}};function e(m){const h={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[h]}},m)}function t(){this.buffer()}function n(){const m=this.resume(),h=this.stack[this.stack.length-1];h.type,h.meta=m}function a(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function s(m){const h=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),p=this.stack[this.stack.length-1];p.type,this.exit(m),p.value=h;const b=p.data.hChildren[0];b.type,b.tagName,b.children.push({type:"text",value:h}),this.data.mathFlowInside=void 0}function o(m){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},m),this.buffer()}function c(m){const h=this.resume(),p=this.stack[this.stack.length-1];p.type,this.exit(m),p.value=h,p.data.hChildren.push({type:"text",value:h})}function d(m){this.config.enter.data.call(this,m),this.config.exit.data.call(this,m)}}function pA(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),a.peek=s,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
|
|
48
|
-
`,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,d,m){const h=o.value||"",p=d.createTracker(m),b="$".repeat(Math.max(u6(h,"$")+1,2)),x=d.enter("mathFlow");let y=p.move(b);if(o.meta){const S=d.enter("mathFlowMeta");y+=p.move(d.safe(o.meta,{after:`
|
|
49
|
-
`,before:y,encode:["$"],...p.current()})),S()}return y+=p.move(`
|
|
50
|
-
`),h&&(y+=p.move(h+`
|
|
51
|
-
`)),y+=p.move(b),x(),y}function a(o,c,d){let m=o.value||"",h=1;for(t||h++;new RegExp("(^|[^$])"+"\\$".repeat(h)+"([^$]|$)").test(m);)h++;const p="$".repeat(h);/[^ \r\n]/.test(m)&&(/^[ \r\n]/.test(m)&&/[ \r\n]$/.test(m)||/^\$|\$$/.test(m))&&(m=" "+m+" ");let b=-1;for(;++b<d.unsafe.length;){const x=d.unsafe[b];if(!x.atBreak)continue;const y=d.compilePattern(x);let S;for(;S=y.exec(m);){let T=S.index;m.codePointAt(T)===10&&m.codePointAt(T-1)===13&&T--,m=m.slice(0,T)+" "+m.slice(S.index+1)}}return p+m+p}function s(){return"$"}}const gA={tokenize:bA,concrete:!0,name:"mathFlow"},kv={tokenize:vA,partial:!0};function bA(e,t,n){const a=this,s=a.events[a.events.length-1],o=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0;let c=0;return d;function d(M){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),m(M)}function m(M){return M===36?(e.consume(M),c++,m):c<2?n(M):(e.exit("mathFlowFenceSequence"),Dt(e,h,"whitespace")(M))}function h(M){return M===null||tt(M)?b(M):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(M))}function p(M){return M===null||tt(M)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),b(M)):M===36?n(M):(e.consume(M),p)}function b(M){return e.exit("mathFlowFence"),a.interrupt?t(M):e.attempt(kv,x,A)(M)}function x(M){return e.attempt({tokenize:C,partial:!0},A,y)(M)}function y(M){return(o?Dt(e,S,"linePrefix",o+1):S)(M)}function S(M){return M===null?A(M):tt(M)?e.attempt(kv,x,A)(M):(e.enter("mathFlowValue"),T(M))}function T(M){return M===null||tt(M)?(e.exit("mathFlowValue"),S(M)):(e.consume(M),T)}function A(M){return e.exit("mathFlow"),t(M)}function C(M,I,P){let U=0;return Dt(M,N,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function N(B){return M.enter("mathFlowFence"),M.enter("mathFlowFenceSequence"),z(B)}function z(B){return B===36?(U++,M.consume(B),z):U<c?P(B):(M.exit("mathFlowFenceSequence"),Dt(M,X,"whitespace")(B))}function X(B){return B===null||tt(B)?(M.exit("mathFlowFence"),I(B)):P(B)}}}function vA(e,t,n){const a=this;return s;function s(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 yA(e){let n=(e||{}).singleDollarTextMath;return n==null&&(n=!0),{tokenize:a,resolve:xA,previous:wA,name:"mathText"};function a(s,o,c){let d=0,m,h;return p;function p(T){return s.enter("mathText"),s.enter("mathTextSequence"),b(T)}function b(T){return T===36?(s.consume(T),d++,b):d<2&&!n?c(T):(s.exit("mathTextSequence"),x(T))}function x(T){return T===null?c(T):T===36?(h=s.enter("mathTextSequence"),m=0,S(T)):T===32?(s.enter("space"),s.consume(T),s.exit("space"),x):tt(T)?(s.enter("lineEnding"),s.consume(T),s.exit("lineEnding"),x):(s.enter("mathTextData"),y(T))}function y(T){return T===null||T===32||T===36||tt(T)?(s.exit("mathTextData"),x(T)):(s.consume(T),y)}function S(T){return T===36?(s.consume(T),m++,S):m===d?(s.exit("mathTextSequence"),s.exit("mathText"),o(T)):(h.type="mathTextData",y(T))}}}function xA(e){let t=e.length-4,n=3,a,s;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;)s===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(s=a):(a===t||e[a][1].type==="lineEnding")&&(e[s][1].type="mathTextData",a!==s+2&&(e[s][1].end=e[a-1][1].end,e.splice(s+2,a-s-2),t-=a-s-2,a=s+2),s=void 0);return e}function wA(e){return e!==36||this.events[this.events.length-1][1].type==="characterEscape"}function kA(e){return{flow:{36:gA},text:{36:yA(e)}}}class Me extends Error{constructor(t,n){var a="KaTeX parse error: "+t,s,o,c=n&&n.loc;if(c&&c.start<=c.end){var d=c.lexer.input;s=c.start,o=c.end,s===d.length?a+=" at end of input: ":a+=" at position "+(s+1)+": ";var m=d.slice(s,o).replace(/[^]/g,"$&̲"),h;s>15?h="…"+d.slice(s-15,s):h=d.slice(0,s);var p;o+15<d.length?p=d.slice(o,o+15)+"…":p=d.slice(o),a+=h+m+p}super(a),this.name="ParseError",this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,Me.prototype),this.position=s,s!=null&&o!=null&&(this.length=o-s),this.rawMessage=t}}var SA=/([A-Z])/g,EA=e=>e.replace(SA,"-$1").toLowerCase(),TA={"&":"&",">":">","<":"<",'"':""","'":"'"},CA=/[&><"']/g,rr=e=>String(e).replace(CA,t=>TA[t]),Hu=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?Hu(e.body[0]):e:e.type==="font"?Hu(e.body):e,RA=new Set(["mathord","textord","atom"]),ni=e=>RA.has(Hu(e).type),NA=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"},nd={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 AA(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 IA(e){if(e.default!==void 0)return e.default;var t=Array.isArray(e.type)?e.type[0]:e.type;return AA(t)}function _A(e,t,n,a){var s=n[t];e[t]=s!==void 0?a.processor?a.processor(s):s:IA(a)}class cp{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(nd)){var a=nd[n];a&&_A(this,n,t,a)}}reportNonstrict(t,n,a){var s=this.strict;if(typeof s=="function"&&(s=s(t,n,a)),!(!s||s==="ignore")){if(s===!0||s==="error")throw new Me("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+t+"]"),a);s==="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 '"+s+"': "+n+" ["+t+"]"))}}useStrictBehavior(t,n,a){var s=this.strict;if(typeof s=="function")try{s=s(t,n,a)}catch{s="error"}return!s||s==="ignore"?!1:s===!0||s==="error"?!0:s==="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 '"+s+"': "+n+" ["+t+"]")),!1)}isTrusted(t){if("url"in t&&t.url&&!t.protocol){var n=NA(t.url);if(n==null)return!1;t.protocol=n}var a=typeof this.trust=="function"?this.trust(t):this.trust;return!!a}}class Oi{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 ka[MA[this.id]]}sub(){return ka[OA[this.id]]}fracNum(){return ka[DA[this.id]]}fracDen(){return ka[jA[this.id]]}cramp(){return ka[LA[this.id]]}text(){return ka[zA[this.id]]}isTight(){return this.size>=2}}var up=0,rd=1,fo=2,Ja=3,Pl=4,ea=5,po=6,dr=7,ka=[new Oi(up,0,!1),new Oi(rd,0,!0),new Oi(fo,1,!1),new Oi(Ja,1,!0),new Oi(Pl,2,!1),new Oi(ea,2,!0),new Oi(po,3,!1),new Oi(dr,3,!0)],MA=[Pl,ea,Pl,ea,po,dr,po,dr],OA=[ea,ea,ea,ea,dr,dr,dr,dr],DA=[fo,Ja,Pl,ea,po,dr,po,dr],jA=[Ja,Ja,ea,ea,dr,dr,dr,dr],LA=[rd,rd,Ja,Ja,ea,ea,dr,dr],zA=[up,rd,fo,Ja,fo,Ja,fo,Ja],xt={DISPLAY:ka[up],TEXT:ka[fo],SCRIPT:ka[Pl],SCRIPTSCRIPT:ka[po]},r1=[{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 BA(e){for(var t=0;t<r1.length;t++)for(var n=r1[t],a=0;a<n.blocks.length;a++){var s=n.blocks[a];if(e>=s[0]&&e<=s[1])return n.name}return null}var Uu=[];r1.forEach(e=>e.blocks.forEach(t=>Uu.push(...t)));function I6(e){for(var t=0;t<Uu.length;t+=2)if(e>=Uu[t]&&e<=Uu[t+1])return!0;return!1}var Gn=e=>e+" "+e,co=80,qA=function(t,n){return"M95,"+(622+t+n)+`
|
|
52
|
-
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
|
53
|
-
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
|
|
54
|
-
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
|
|
55
|
-
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
|
|
56
|
-
c69,-144,104.5,-217.7,106.5,-221
|
|
57
|
-
l`+t/2.075+" -"+t+`
|
|
58
|
-
c5.3,-9.3,12,-14,20,-14
|
|
59
|
-
H400000v`+(40+t)+`H845.2724
|
|
60
|
-
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
|
|
61
|
-
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
|
|
62
|
-
M`+(834+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},HA=function(t,n){return"M263,"+(601+t+n)+`c0.7,0,18,39.7,52,119
|
|
63
|
-
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
|
|
64
|
-
c340,-704.7,510.7,-1060.3,512,-1067
|
|
65
|
-
l`+t/2.084+" -"+t+`
|
|
66
|
-
c4.7,-7.3,11,-11,19,-11
|
|
67
|
-
H40000v`+(40+t)+`H1012.3
|
|
68
|
-
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
|
|
69
|
-
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
|
|
70
|
-
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
|
|
71
|
-
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
|
|
72
|
-
M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},UA=function(t,n){return"M983 "+(10+t+n)+`
|
|
73
|
-
l`+t/3.13+" -"+t+`
|
|
74
|
-
c4,-6.7,10,-10,18,-10 H400000v`+(40+t)+`
|
|
75
|
-
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
|
|
76
|
-
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
|
|
77
|
-
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
|
|
78
|
-
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
|
|
79
|
-
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
|
|
80
|
-
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
|
|
81
|
-
M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},FA=function(t,n){return"M424,"+(2398+t+n)+`
|
|
82
|
-
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
|
|
83
|
-
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
|
|
84
|
-
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
|
|
85
|
-
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
|
|
86
|
-
l`+t/4.223+" -"+t+`c4,-6.7,10,-10,18,-10 H400000
|
|
87
|
-
v`+(40+t)+`H1014.6
|
|
88
|
-
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
|
|
89
|
-
c-2,6,-10,9,-24,9
|
|
90
|
-
c-8,0,-12,-0.7,-12,-2z M`+(1001+t)+" "+n+`
|
|
91
|
-
h400000v`+(40+t)+"h-400000z"},$A=function(t,n){return"M473,"+(2713+t+n)+`
|
|
92
|
-
c339.3,-1799.3,509.3,-2700,510,-2702 l`+t/5.298+" -"+t+`
|
|
93
|
-
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+t)+`H1017.7
|
|
94
|
-
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
|
|
95
|
-
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
|
|
96
|
-
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
|
|
97
|
-
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
|
|
98
|
-
606zM`+(1001+t)+" "+n+"h400000v"+(40+t)+"H1017.7z"},PA=function(t){var n=t/2;return"M400000 "+t+" H0 L"+n+" 0 l65 45 L145 "+(t-80)+" H400000z"},GA=function(t,n,a){var s=a-54-n-t;return"M702 "+(t+n)+"H400000"+(40+t)+`
|
|
99
|
-
H742v`+s+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
|
|
100
|
-
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
|
|
101
|
-
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
|
|
102
|
-
219 661 l218 661zM702 `+n+"H400000v"+(40+t)+"H742z"},VA=function(t,n,a){n=1e3*n;var s="";switch(t){case"sqrtMain":s=qA(n,co);break;case"sqrtSize1":s=HA(n,co);break;case"sqrtSize2":s=UA(n,co);break;case"sqrtSize3":s=FA(n,co);break;case"sqrtSize4":s=$A(n,co);break;case"sqrtTall":s=GA(n,co,a)}return s},KA=function(t,n){switch(t){case"⎜":return Gn("M291 0 H417 V"+n+" H291z");case"∣":return Gn("M145 0 H188 V"+n+" H145z");case"∥":return Gn("M145 0 H188 V"+n+" H145z")+Gn("M367 0 H410 V"+n+" H367z");case"⎟":return Gn("M457 0 H583 V"+n+" H457z");case"⎢":return Gn("M319 0 H403 V"+n+" H319z");case"⎥":return Gn("M263 0 H347 V"+n+" H263z");case"⎪":return Gn("M384 0 H504 V"+n+" H384z");case"⏐":return Gn("M312 0 H355 V"+n+" H312z");case"‖":return Gn("M257 0 H300 V"+n+" H257z")+Gn("M478 0 H521 V"+n+" H478z");default:return""}},Sv={doubleleftarrow:`M262 157
|
|
103
|
-
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
|
|
104
|
-
0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
|
|
105
|
-
14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
|
|
106
|
-
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
|
|
107
|
-
157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
|
|
108
|
-
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
|
|
109
|
-
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
|
|
110
|
-
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
|
|
111
|
-
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
|
|
112
|
-
14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
|
|
113
|
-
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
|
|
114
|
-
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
|
|
115
|
-
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
|
|
116
|
-
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
|
|
117
|
-
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
|
|
118
|
-
135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
|
|
119
|
-
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
|
|
120
|
-
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
|
|
121
|
-
490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
|
|
122
|
-
1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
|
|
123
|
-
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
|
|
124
|
-
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
|
|
125
|
-
5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
|
|
126
|
-
35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
|
|
127
|
-
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
|
|
128
|
-
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
|
|
129
|
-
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
|
|
130
|
-
435 0h399565z`,leftgroupunder:`M400000 262
|
|
131
|
-
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
|
|
132
|
-
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
|
|
133
|
-
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
|
|
134
|
-
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
|
|
135
|
-
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
|
|
136
|
-
20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
|
|
137
|
-
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
|
|
138
|
-
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
|
|
139
|
-
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
|
|
140
|
-
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
|
|
141
|
-
1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
|
|
142
|
-
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
|
|
143
|
-
10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
|
|
144
|
-
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
|
|
145
|
-
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
|
|
146
|
-
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
|
|
147
|
-
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
|
|
148
|
-
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:Gn("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:Gn("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:Gn("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:Gn("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
|
|
149
|
-
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
|
|
150
|
-
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
|
|
151
|
-
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:Gn("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334
|
|
152
|
-
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
|
|
153
|
-
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
|
|
154
|
-
311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
|
|
155
|
-
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
|
|
156
|
-
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
|
|
157
|
-
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
|
|
158
|
-
11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
|
|
159
|
-
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
|
|
160
|
-
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
|
|
161
|
-
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
|
|
162
|
-
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
|
|
163
|
-
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
|
|
164
|
-
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
|
|
165
|
-
c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
|
|
166
|
-
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
|
|
167
|
-
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
|
|
168
|
-
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
|
|
169
|
-
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
|
|
170
|
-
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
|
|
171
|
-
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
|
|
172
|
-
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
|
|
173
|
-
11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
|
|
174
|
-
39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
|
|
175
|
-
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
|
176
|
-
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
|
177
|
-
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
|
|
178
|
-
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
|
|
179
|
-
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
|
|
180
|
-
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
|
|
181
|
-
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
|
|
182
|
-
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
|
|
183
|
-
3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
|
|
184
|
-
0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
|
|
185
|
-
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
|
|
186
|
-
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
|
|
187
|
-
69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
|
|
188
|
-
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
|
|
189
|
-
2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
|
|
190
|
-
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
|
|
191
|
-
8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
|
|
192
|
-
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
|
|
193
|
-
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
|
|
194
|
-
15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
|
|
195
|
-
8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
|
|
196
|
-
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
|
|
197
|
-
m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
|
|
198
|
-
15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
|
|
199
|
-
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
|
|
200
|
-
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:Gn("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:Gn("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:Gn("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
|
|
201
|
-
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
|
|
202
|
-
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
|
|
203
|
-
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
|
|
204
|
-
115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
|
|
205
|
-
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
|
|
206
|
-
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
|
|
207
|
-
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
|
|
208
|
-
10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
|
|
209
|
-
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
|
|
210
|
-
41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
|
|
211
|
-
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
|
|
212
|
-
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
|
|
213
|
-
101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
|
|
214
|
-
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
|
|
215
|
-
114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
|
|
216
|
-
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
|
|
217
|
-
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
|
|
218
|
-
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
|
|
219
|
-
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
|
|
220
|
-
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
|
|
221
|
-
181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
|
|
222
|
-
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
|
|
223
|
-
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
|
|
224
|
-
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
|
|
225
|
-
-338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
|
|
226
|
-
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
|
|
227
|
-
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
|
|
228
|
-
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
|
|
229
|
-
-175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
|
|
230
|
-
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
|
|
231
|
-
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
|
|
232
|
-
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
|
|
233
|
-
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
|
|
234
|
-
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
|
|
235
|
-
c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
|
|
236
|
-
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
237
|
-
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
238
|
-
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
|
|
239
|
-
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
|
|
240
|
-
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
241
|
-
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
242
|
-
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
|
|
243
|
-
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
|
|
244
|
-
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
|
|
245
|
-
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
|
|
246
|
-
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
|
|
247
|
-
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
|
|
248
|
-
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
|
|
249
|
-
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
|
|
250
|
-
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
|
|
251
|
-
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
|
|
252
|
-
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
|
|
253
|
-
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
|
|
254
|
-
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
|
|
255
|
-
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
|
|
256
|
-
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|
257
|
-
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
|
|
258
|
-
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
|
|
259
|
-
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
|
|
260
|
-
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
|
|
261
|
-
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
|
|
262
|
-
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|
263
|
-
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|
264
|
-
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|
265
|
-
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|
266
|
-
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
|
|
267
|
-
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
|
|
268
|
-
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
|
|
269
|
-
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
|
|
270
|
-
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
|
|
271
|
-
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
|
|
272
|
-
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
|
|
273
|
-
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},YA=function(t,n){switch(t){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 v84 h347 v-84
|
|
274
|
-
H403z M403 1759 V0 H319 V1759 v`+n+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v1759 H0 v84 H347z
|
|
275
|
-
M347 1759 V0 H263 V1759 v`+n+" v1759 h84z";case"vert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
|
|
276
|
-
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
277
|
-
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+" v585 h43z";case"doublevert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
|
|
278
|
-
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
279
|
-
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+` v585 h43z
|
|
280
|
-
M367 15 v585 v`+n+` v585 c2.667,10,9.667,15,21,15
|
|
281
|
-
c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
282
|
-
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+n+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+n+` v1715 h263 v84 H319z
|
|
283
|
-
MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+n+` v1799 H0 v-84 H319z
|
|
284
|
-
MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v602 h84z
|
|
285
|
-
M403 1759 V0 H319 V1759 v`+n+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v602 h84z
|
|
286
|
-
M347 1759 V0 h-84 V1759 v`+n+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
|
|
287
|
-
c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
|
|
288
|
-
-36,557 l0,`+(n+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
|
|
289
|
-
949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
|
|
290
|
-
c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
|
|
291
|
-
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
|
|
292
|
-
l0,-`+(n+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
|
|
293
|
-
-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
|
|
294
|
-
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
|
|
295
|
-
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(n+9)+`
|
|
296
|
-
c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
|
|
297
|
-
c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
|
|
298
|
-
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
|
|
299
|
-
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
|
|
300
|
-
l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
|
|
301
|
-
-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 WA(e){return"toText"in e}class ko{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(WA(t))return t.toText();throw new Error("Expected MathDomNode with toText, got "+t.constructor.name)}).join("")}}var a1={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},ZA={ex:!0,em:!0,mu:!0},_6=function(t){return typeof t!="string"&&(t=t.unit),t in a1||t in ZA||t==="ex"},En=function(t,n){var a;if(t.unit in a1)a=a1[t.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(t.unit==="mu")a=n.fontMetrics().cssEmPerMu;else{var s;if(n.style.isTight()?s=n.havingStyle(n.style.text()):s=n,t.unit==="ex")a=s.fontMetrics().xHeight;else if(t.unit==="em")a=s.fontMetrics().quad;else throw new Me("Invalid unit: '"+t.unit+"'");s!==n&&(a*=s.sizeMultiplier/n.sizeMultiplier)}return Math.min(t.number*a,n.maxSize)},Be=function(t){return+t.toFixed(4)+"em"},Hi=function(t){return t.filter(n=>n).join(" ")},dp=function(t){var n="";for(var a of Object.keys(t)){var s=t[a];s!==void 0&&(n+=EA(a)+":"+s+";")}return n},M6=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 s=n.getColor();s&&(this.style.color=s)}},O6=function(t){var n=document.createElement(t);n.className=Hi(this.classes),Object.assign(n.style,this.style);for(var a of Object.keys(this.attributes))n.setAttribute(a,this.attributes[a]);for(var s=0;s<this.children.length;s++)n.appendChild(this.children[s].toNode());return n},XA=/[\s"'>/=\x00-\x1f]/,D6=function(t){var n="<"+t;this.classes.length&&(n+=' class="'+rr(Hi(this.classes))+'"');var a=dp(this.style);a&&(n+=' style="'+rr(a)+'"');for(var s of Object.keys(this.attributes)){if(XA.test(s))throw new Me("Invalid attribute name '"+s+"'");n+=" "+s+'="'+rr(this.attributes[s])+'"'}n+=">";for(var o=0;o<this.children.length;o++)n+=this.children[o].toMarkup();return n+="</"+t+">",n};class So{constructor(t,n,a,s){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,M6.call(this,t,a,s),this.children=n||[]}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return O6.call(this,"span")}toMarkup(){return D6.call(this,"span")}}class wd{constructor(t,n,a,s){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,M6.call(this,n,s),this.children=a||[],this.setAttribute("href",t)}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return O6.call(this,"a")}toMarkup(){return D6.call(this,"a")}}class QA{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="'+rr(this.src)+'"'+(' alt="'+rr(this.alt)+'"'),n=dp(this.style);return n&&(t+=' style="'+rr(n)+'"'),t+="'/>",t}}var JA={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class Hr{constructor(t,n,a,s,o,c,d,m){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=s||0,this.skew=o||0,this.width=c||0,this.classes=d||[],this.style=m||{},this.maxFontSize=0;var h=BA(this.text.charCodeAt(0));h&&this.classes.push(h+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=JA[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=Be(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=Hi(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+=rr(Hi(this.classes)),n+='"');var a="";this.italic>0&&(a+="margin-right:"+Be(this.italic)+";"),a+=dp(this.style),a&&(t=!0,n+=' style="'+rr(a)+'"');var s=rr(this.text);return t?(n+=">",n+=s,n+="</span>",n):s}}class ei{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 s=0;s<this.children.length;s++)n.appendChild(this.children[s].toNode());return n}toMarkup(){var t='<svg xmlns="http://www.w3.org/2000/svg"';for(var n of Object.keys(this.attributes))t+=" "+n+'="'+rr(this.attributes[n])+'"';t+=">";for(var a=0;a<this.children.length;a++)t+=this.children[a].toMarkup();return t+="</svg>",t}}class Ui{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",Sv[this.pathName]),n}toMarkup(){return this.alternate?'<path d="'+rr(this.alternate)+'"/>':'<path d="'+rr(Sv[this.pathName])+'"/>'}}class i1{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+'="'+rr(this.attributes[n])+'"';return t+="/>",t}}function eI(e){if(e instanceof Hr)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}function tI(e){if(e instanceof So)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}var nI=e=>e instanceof So||e instanceof wd||e instanceof ko,Sa={"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]}},wu={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]},Ev={Å:"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 j6(e,t){Sa[e]=t}function fp(e,t,n){if(!Sa[t])throw new Error("Font metrics not found for font: "+t+".");var a=e.charCodeAt(0),s=Sa[t][a];if(!s&&e[0]in Ev&&(a=Ev[e[0]].charCodeAt(0),s=Sa[t][a]),!s&&n==="text"&&I6(a)&&(s=Sa[t][77]),s)return{depth:s[0],height:s[1],italic:s[2],skew:s[3],width:s[4]}}var bm={};function rI(e){var t;if(e>=5?t=0:e>=3?t=1:t=2,!bm[t]){var n=bm[t]={cssEmPerMu:wu.quad[t]/18};for(var a in wu)wu.hasOwnProperty(a)&&(n[a]=wu[a][t])}return bm[t]}var vn={math:{},text:{}};function k(e,t,n,a,s,o){vn[e][s]={font:t,group:n,replace:a},o&&a&&(vn[e][a]=vn[e][s])}var E="math",Ne="text",D="main",te="ams",yn="accent-token",Ve="bin",fr="close",Eo="inner",ot="mathord",Fn="op-token",Ur="open",ec="punct",ae="rel",ri="spacing",ce="textord";k(E,D,ae,"≡","\\equiv",!0);k(E,D,ae,"≺","\\prec",!0);k(E,D,ae,"≻","\\succ",!0);k(E,D,ae,"∼","\\sim",!0);k(E,D,ae,"⊥","\\perp");k(E,D,ae,"⪯","\\preceq",!0);k(E,D,ae,"⪰","\\succeq",!0);k(E,D,ae,"≃","\\simeq",!0);k(E,D,ae,"∣","\\mid",!0);k(E,D,ae,"≪","\\ll",!0);k(E,D,ae,"≫","\\gg",!0);k(E,D,ae,"≍","\\asymp",!0);k(E,D,ae,"∥","\\parallel");k(E,D,ae,"⋈","\\bowtie",!0);k(E,D,ae,"⌣","\\smile",!0);k(E,D,ae,"⊑","\\sqsubseteq",!0);k(E,D,ae,"⊒","\\sqsupseteq",!0);k(E,D,ae,"≐","\\doteq",!0);k(E,D,ae,"⌢","\\frown",!0);k(E,D,ae,"∋","\\ni",!0);k(E,D,ae,"∝","\\propto",!0);k(E,D,ae,"⊢","\\vdash",!0);k(E,D,ae,"⊣","\\dashv",!0);k(E,D,ae,"∋","\\owns");k(E,D,ec,".","\\ldotp");k(E,D,ec,"⋅","\\cdotp");k(E,D,ec,"⋅","·");k(Ne,D,ce,"⋅","·");k(E,D,ce,"#","\\#");k(Ne,D,ce,"#","\\#");k(E,D,ce,"&","\\&");k(Ne,D,ce,"&","\\&");k(E,D,ce,"ℵ","\\aleph",!0);k(E,D,ce,"∀","\\forall",!0);k(E,D,ce,"ℏ","\\hbar",!0);k(E,D,ce,"∃","\\exists",!0);k(E,D,ce,"∇","\\nabla",!0);k(E,D,ce,"♭","\\flat",!0);k(E,D,ce,"ℓ","\\ell",!0);k(E,D,ce,"♮","\\natural",!0);k(E,D,ce,"♣","\\clubsuit",!0);k(E,D,ce,"℘","\\wp",!0);k(E,D,ce,"♯","\\sharp",!0);k(E,D,ce,"♢","\\diamondsuit",!0);k(E,D,ce,"ℜ","\\Re",!0);k(E,D,ce,"♡","\\heartsuit",!0);k(E,D,ce,"ℑ","\\Im",!0);k(E,D,ce,"♠","\\spadesuit",!0);k(E,D,ce,"§","\\S",!0);k(Ne,D,ce,"§","\\S");k(E,D,ce,"¶","\\P",!0);k(Ne,D,ce,"¶","\\P");k(E,D,ce,"†","\\dag");k(Ne,D,ce,"†","\\dag");k(Ne,D,ce,"†","\\textdagger");k(E,D,ce,"‡","\\ddag");k(Ne,D,ce,"‡","\\ddag");k(Ne,D,ce,"‡","\\textdaggerdbl");k(E,D,fr,"⎱","\\rmoustache",!0);k(E,D,Ur,"⎰","\\lmoustache",!0);k(E,D,fr,"⟯","\\rgroup",!0);k(E,D,Ur,"⟮","\\lgroup",!0);k(E,D,Ve,"∓","\\mp",!0);k(E,D,Ve,"⊖","\\ominus",!0);k(E,D,Ve,"⊎","\\uplus",!0);k(E,D,Ve,"⊓","\\sqcap",!0);k(E,D,Ve,"∗","\\ast");k(E,D,Ve,"⊔","\\sqcup",!0);k(E,D,Ve,"◯","\\bigcirc",!0);k(E,D,Ve,"∙","\\bullet",!0);k(E,D,Ve,"‡","\\ddagger");k(E,D,Ve,"≀","\\wr",!0);k(E,D,Ve,"⨿","\\amalg");k(E,D,Ve,"&","\\And");k(E,D,ae,"⟵","\\longleftarrow",!0);k(E,D,ae,"⇐","\\Leftarrow",!0);k(E,D,ae,"⟸","\\Longleftarrow",!0);k(E,D,ae,"⟶","\\longrightarrow",!0);k(E,D,ae,"⇒","\\Rightarrow",!0);k(E,D,ae,"⟹","\\Longrightarrow",!0);k(E,D,ae,"↔","\\leftrightarrow",!0);k(E,D,ae,"⟷","\\longleftrightarrow",!0);k(E,D,ae,"⇔","\\Leftrightarrow",!0);k(E,D,ae,"⟺","\\Longleftrightarrow",!0);k(E,D,ae,"↦","\\mapsto",!0);k(E,D,ae,"⟼","\\longmapsto",!0);k(E,D,ae,"↗","\\nearrow",!0);k(E,D,ae,"↩","\\hookleftarrow",!0);k(E,D,ae,"↪","\\hookrightarrow",!0);k(E,D,ae,"↘","\\searrow",!0);k(E,D,ae,"↼","\\leftharpoonup",!0);k(E,D,ae,"⇀","\\rightharpoonup",!0);k(E,D,ae,"↙","\\swarrow",!0);k(E,D,ae,"↽","\\leftharpoondown",!0);k(E,D,ae,"⇁","\\rightharpoondown",!0);k(E,D,ae,"↖","\\nwarrow",!0);k(E,D,ae,"⇌","\\rightleftharpoons",!0);k(E,te,ae,"≮","\\nless",!0);k(E,te,ae,"","\\@nleqslant");k(E,te,ae,"","\\@nleqq");k(E,te,ae,"⪇","\\lneq",!0);k(E,te,ae,"≨","\\lneqq",!0);k(E,te,ae,"","\\@lvertneqq");k(E,te,ae,"⋦","\\lnsim",!0);k(E,te,ae,"⪉","\\lnapprox",!0);k(E,te,ae,"⊀","\\nprec",!0);k(E,te,ae,"⋠","\\npreceq",!0);k(E,te,ae,"⋨","\\precnsim",!0);k(E,te,ae,"⪹","\\precnapprox",!0);k(E,te,ae,"≁","\\nsim",!0);k(E,te,ae,"","\\@nshortmid");k(E,te,ae,"∤","\\nmid",!0);k(E,te,ae,"⊬","\\nvdash",!0);k(E,te,ae,"⊭","\\nvDash",!0);k(E,te,ae,"⋪","\\ntriangleleft");k(E,te,ae,"⋬","\\ntrianglelefteq",!0);k(E,te,ae,"⊊","\\subsetneq",!0);k(E,te,ae,"","\\@varsubsetneq");k(E,te,ae,"⫋","\\subsetneqq",!0);k(E,te,ae,"","\\@varsubsetneqq");k(E,te,ae,"≯","\\ngtr",!0);k(E,te,ae,"","\\@ngeqslant");k(E,te,ae,"","\\@ngeqq");k(E,te,ae,"⪈","\\gneq",!0);k(E,te,ae,"≩","\\gneqq",!0);k(E,te,ae,"","\\@gvertneqq");k(E,te,ae,"⋧","\\gnsim",!0);k(E,te,ae,"⪊","\\gnapprox",!0);k(E,te,ae,"⊁","\\nsucc",!0);k(E,te,ae,"⋡","\\nsucceq",!0);k(E,te,ae,"⋩","\\succnsim",!0);k(E,te,ae,"⪺","\\succnapprox",!0);k(E,te,ae,"≆","\\ncong",!0);k(E,te,ae,"","\\@nshortparallel");k(E,te,ae,"∦","\\nparallel",!0);k(E,te,ae,"⊯","\\nVDash",!0);k(E,te,ae,"⋫","\\ntriangleright");k(E,te,ae,"⋭","\\ntrianglerighteq",!0);k(E,te,ae,"","\\@nsupseteqq");k(E,te,ae,"⊋","\\supsetneq",!0);k(E,te,ae,"","\\@varsupsetneq");k(E,te,ae,"⫌","\\supsetneqq",!0);k(E,te,ae,"","\\@varsupsetneqq");k(E,te,ae,"⊮","\\nVdash",!0);k(E,te,ae,"⪵","\\precneqq",!0);k(E,te,ae,"⪶","\\succneqq",!0);k(E,te,ae,"","\\@nsubseteqq");k(E,te,Ve,"⊴","\\unlhd");k(E,te,Ve,"⊵","\\unrhd");k(E,te,ae,"↚","\\nleftarrow",!0);k(E,te,ae,"↛","\\nrightarrow",!0);k(E,te,ae,"⇍","\\nLeftarrow",!0);k(E,te,ae,"⇏","\\nRightarrow",!0);k(E,te,ae,"↮","\\nleftrightarrow",!0);k(E,te,ae,"⇎","\\nLeftrightarrow",!0);k(E,te,ae,"△","\\vartriangle");k(E,te,ce,"ℏ","\\hslash");k(E,te,ce,"▽","\\triangledown");k(E,te,ce,"◊","\\lozenge");k(E,te,ce,"Ⓢ","\\circledS");k(E,te,ce,"®","\\circledR");k(Ne,te,ce,"®","\\circledR");k(E,te,ce,"∡","\\measuredangle",!0);k(E,te,ce,"∄","\\nexists");k(E,te,ce,"℧","\\mho");k(E,te,ce,"Ⅎ","\\Finv",!0);k(E,te,ce,"⅁","\\Game",!0);k(E,te,ce,"‵","\\backprime");k(E,te,ce,"▲","\\blacktriangle");k(E,te,ce,"▼","\\blacktriangledown");k(E,te,ce,"■","\\blacksquare");k(E,te,ce,"⧫","\\blacklozenge");k(E,te,ce,"★","\\bigstar");k(E,te,ce,"∢","\\sphericalangle",!0);k(E,te,ce,"∁","\\complement",!0);k(E,te,ce,"ð","\\eth",!0);k(Ne,D,ce,"ð","ð");k(E,te,ce,"╱","\\diagup");k(E,te,ce,"╲","\\diagdown");k(E,te,ce,"□","\\square");k(E,te,ce,"□","\\Box");k(E,te,ce,"◊","\\Diamond");k(E,te,ce,"¥","\\yen",!0);k(Ne,te,ce,"¥","\\yen",!0);k(E,te,ce,"✓","\\checkmark",!0);k(Ne,te,ce,"✓","\\checkmark");k(E,te,ce,"ℶ","\\beth",!0);k(E,te,ce,"ℸ","\\daleth",!0);k(E,te,ce,"ℷ","\\gimel",!0);k(E,te,ce,"ϝ","\\digamma",!0);k(E,te,ce,"ϰ","\\varkappa");k(E,te,Ur,"┌","\\@ulcorner",!0);k(E,te,fr,"┐","\\@urcorner",!0);k(E,te,Ur,"└","\\@llcorner",!0);k(E,te,fr,"┘","\\@lrcorner",!0);k(E,te,ae,"≦","\\leqq",!0);k(E,te,ae,"⩽","\\leqslant",!0);k(E,te,ae,"⪕","\\eqslantless",!0);k(E,te,ae,"≲","\\lesssim",!0);k(E,te,ae,"⪅","\\lessapprox",!0);k(E,te,ae,"≊","\\approxeq",!0);k(E,te,Ve,"⋖","\\lessdot");k(E,te,ae,"⋘","\\lll",!0);k(E,te,ae,"≶","\\lessgtr",!0);k(E,te,ae,"⋚","\\lesseqgtr",!0);k(E,te,ae,"⪋","\\lesseqqgtr",!0);k(E,te,ae,"≑","\\doteqdot");k(E,te,ae,"≓","\\risingdotseq",!0);k(E,te,ae,"≒","\\fallingdotseq",!0);k(E,te,ae,"∽","\\backsim",!0);k(E,te,ae,"⋍","\\backsimeq",!0);k(E,te,ae,"⫅","\\subseteqq",!0);k(E,te,ae,"⋐","\\Subset",!0);k(E,te,ae,"⊏","\\sqsubset",!0);k(E,te,ae,"≼","\\preccurlyeq",!0);k(E,te,ae,"⋞","\\curlyeqprec",!0);k(E,te,ae,"≾","\\precsim",!0);k(E,te,ae,"⪷","\\precapprox",!0);k(E,te,ae,"⊲","\\vartriangleleft");k(E,te,ae,"⊴","\\trianglelefteq");k(E,te,ae,"⊨","\\vDash",!0);k(E,te,ae,"⊪","\\Vvdash",!0);k(E,te,ae,"⌣","\\smallsmile");k(E,te,ae,"⌢","\\smallfrown");k(E,te,ae,"≏","\\bumpeq",!0);k(E,te,ae,"≎","\\Bumpeq",!0);k(E,te,ae,"≧","\\geqq",!0);k(E,te,ae,"⩾","\\geqslant",!0);k(E,te,ae,"⪖","\\eqslantgtr",!0);k(E,te,ae,"≳","\\gtrsim",!0);k(E,te,ae,"⪆","\\gtrapprox",!0);k(E,te,Ve,"⋗","\\gtrdot");k(E,te,ae,"⋙","\\ggg",!0);k(E,te,ae,"≷","\\gtrless",!0);k(E,te,ae,"⋛","\\gtreqless",!0);k(E,te,ae,"⪌","\\gtreqqless",!0);k(E,te,ae,"≖","\\eqcirc",!0);k(E,te,ae,"≗","\\circeq",!0);k(E,te,ae,"≜","\\triangleq",!0);k(E,te,ae,"∼","\\thicksim");k(E,te,ae,"≈","\\thickapprox");k(E,te,ae,"⫆","\\supseteqq",!0);k(E,te,ae,"⋑","\\Supset",!0);k(E,te,ae,"⊐","\\sqsupset",!0);k(E,te,ae,"≽","\\succcurlyeq",!0);k(E,te,ae,"⋟","\\curlyeqsucc",!0);k(E,te,ae,"≿","\\succsim",!0);k(E,te,ae,"⪸","\\succapprox",!0);k(E,te,ae,"⊳","\\vartriangleright");k(E,te,ae,"⊵","\\trianglerighteq");k(E,te,ae,"⊩","\\Vdash",!0);k(E,te,ae,"∣","\\shortmid");k(E,te,ae,"∥","\\shortparallel");k(E,te,ae,"≬","\\between",!0);k(E,te,ae,"⋔","\\pitchfork",!0);k(E,te,ae,"∝","\\varpropto");k(E,te,ae,"◀","\\blacktriangleleft");k(E,te,ae,"∴","\\therefore",!0);k(E,te,ae,"∍","\\backepsilon");k(E,te,ae,"▶","\\blacktriangleright");k(E,te,ae,"∵","\\because",!0);k(E,te,ae,"⋘","\\llless");k(E,te,ae,"⋙","\\gggtr");k(E,te,Ve,"⊲","\\lhd");k(E,te,Ve,"⊳","\\rhd");k(E,te,ae,"≂","\\eqsim",!0);k(E,D,ae,"⋈","\\Join");k(E,te,ae,"≑","\\Doteq",!0);k(E,te,Ve,"∔","\\dotplus",!0);k(E,te,Ve,"∖","\\smallsetminus");k(E,te,Ve,"⋒","\\Cap",!0);k(E,te,Ve,"⋓","\\Cup",!0);k(E,te,Ve,"⩞","\\doublebarwedge",!0);k(E,te,Ve,"⊟","\\boxminus",!0);k(E,te,Ve,"⊞","\\boxplus",!0);k(E,te,Ve,"⋇","\\divideontimes",!0);k(E,te,Ve,"⋉","\\ltimes",!0);k(E,te,Ve,"⋊","\\rtimes",!0);k(E,te,Ve,"⋋","\\leftthreetimes",!0);k(E,te,Ve,"⋌","\\rightthreetimes",!0);k(E,te,Ve,"⋏","\\curlywedge",!0);k(E,te,Ve,"⋎","\\curlyvee",!0);k(E,te,Ve,"⊝","\\circleddash",!0);k(E,te,Ve,"⊛","\\circledast",!0);k(E,te,Ve,"⋅","\\centerdot");k(E,te,Ve,"⊺","\\intercal",!0);k(E,te,Ve,"⋒","\\doublecap");k(E,te,Ve,"⋓","\\doublecup");k(E,te,Ve,"⊠","\\boxtimes",!0);k(E,te,ae,"⇢","\\dashrightarrow",!0);k(E,te,ae,"⇠","\\dashleftarrow",!0);k(E,te,ae,"⇇","\\leftleftarrows",!0);k(E,te,ae,"⇆","\\leftrightarrows",!0);k(E,te,ae,"⇚","\\Lleftarrow",!0);k(E,te,ae,"↞","\\twoheadleftarrow",!0);k(E,te,ae,"↢","\\leftarrowtail",!0);k(E,te,ae,"↫","\\looparrowleft",!0);k(E,te,ae,"⇋","\\leftrightharpoons",!0);k(E,te,ae,"↶","\\curvearrowleft",!0);k(E,te,ae,"↺","\\circlearrowleft",!0);k(E,te,ae,"↰","\\Lsh",!0);k(E,te,ae,"⇈","\\upuparrows",!0);k(E,te,ae,"↿","\\upharpoonleft",!0);k(E,te,ae,"⇃","\\downharpoonleft",!0);k(E,D,ae,"⊶","\\origof",!0);k(E,D,ae,"⊷","\\imageof",!0);k(E,te,ae,"⊸","\\multimap",!0);k(E,te,ae,"↭","\\leftrightsquigarrow",!0);k(E,te,ae,"⇉","\\rightrightarrows",!0);k(E,te,ae,"⇄","\\rightleftarrows",!0);k(E,te,ae,"↠","\\twoheadrightarrow",!0);k(E,te,ae,"↣","\\rightarrowtail",!0);k(E,te,ae,"↬","\\looparrowright",!0);k(E,te,ae,"↷","\\curvearrowright",!0);k(E,te,ae,"↻","\\circlearrowright",!0);k(E,te,ae,"↱","\\Rsh",!0);k(E,te,ae,"⇊","\\downdownarrows",!0);k(E,te,ae,"↾","\\upharpoonright",!0);k(E,te,ae,"⇂","\\downharpoonright",!0);k(E,te,ae,"⇝","\\rightsquigarrow",!0);k(E,te,ae,"⇝","\\leadsto");k(E,te,ae,"⇛","\\Rrightarrow",!0);k(E,te,ae,"↾","\\restriction");k(E,D,ce,"‘","`");k(E,D,ce,"$","\\$");k(Ne,D,ce,"$","\\$");k(Ne,D,ce,"$","\\textdollar");k(E,D,ce,"%","\\%");k(Ne,D,ce,"%","\\%");k(E,D,ce,"_","\\_");k(Ne,D,ce,"_","\\_");k(Ne,D,ce,"_","\\textunderscore");k(E,D,ce,"∠","\\angle",!0);k(E,D,ce,"∞","\\infty",!0);k(E,D,ce,"′","\\prime");k(E,D,ce,"△","\\triangle");k(E,D,ce,"Γ","\\Gamma",!0);k(E,D,ce,"Δ","\\Delta",!0);k(E,D,ce,"Θ","\\Theta",!0);k(E,D,ce,"Λ","\\Lambda",!0);k(E,D,ce,"Ξ","\\Xi",!0);k(E,D,ce,"Π","\\Pi",!0);k(E,D,ce,"Σ","\\Sigma",!0);k(E,D,ce,"Υ","\\Upsilon",!0);k(E,D,ce,"Φ","\\Phi",!0);k(E,D,ce,"Ψ","\\Psi",!0);k(E,D,ce,"Ω","\\Omega",!0);k(E,D,ce,"A","Α");k(E,D,ce,"B","Β");k(E,D,ce,"E","Ε");k(E,D,ce,"Z","Ζ");k(E,D,ce,"H","Η");k(E,D,ce,"I","Ι");k(E,D,ce,"K","Κ");k(E,D,ce,"M","Μ");k(E,D,ce,"N","Ν");k(E,D,ce,"O","Ο");k(E,D,ce,"P","Ρ");k(E,D,ce,"T","Τ");k(E,D,ce,"X","Χ");k(E,D,ce,"¬","\\neg",!0);k(E,D,ce,"¬","\\lnot");k(E,D,ce,"⊤","\\top");k(E,D,ce,"⊥","\\bot");k(E,D,ce,"∅","\\emptyset");k(E,te,ce,"∅","\\varnothing");k(E,D,ot,"α","\\alpha",!0);k(E,D,ot,"β","\\beta",!0);k(E,D,ot,"γ","\\gamma",!0);k(E,D,ot,"δ","\\delta",!0);k(E,D,ot,"ϵ","\\epsilon",!0);k(E,D,ot,"ζ","\\zeta",!0);k(E,D,ot,"η","\\eta",!0);k(E,D,ot,"θ","\\theta",!0);k(E,D,ot,"ι","\\iota",!0);k(E,D,ot,"κ","\\kappa",!0);k(E,D,ot,"λ","\\lambda",!0);k(E,D,ot,"μ","\\mu",!0);k(E,D,ot,"ν","\\nu",!0);k(E,D,ot,"ξ","\\xi",!0);k(E,D,ot,"ο","\\omicron",!0);k(E,D,ot,"π","\\pi",!0);k(E,D,ot,"ρ","\\rho",!0);k(E,D,ot,"σ","\\sigma",!0);k(E,D,ot,"τ","\\tau",!0);k(E,D,ot,"υ","\\upsilon",!0);k(E,D,ot,"ϕ","\\phi",!0);k(E,D,ot,"χ","\\chi",!0);k(E,D,ot,"ψ","\\psi",!0);k(E,D,ot,"ω","\\omega",!0);k(E,D,ot,"ε","\\varepsilon",!0);k(E,D,ot,"ϑ","\\vartheta",!0);k(E,D,ot,"ϖ","\\varpi",!0);k(E,D,ot,"ϱ","\\varrho",!0);k(E,D,ot,"ς","\\varsigma",!0);k(E,D,ot,"φ","\\varphi",!0);k(E,D,Ve,"∗","*",!0);k(E,D,Ve,"+","+");k(E,D,Ve,"−","-",!0);k(E,D,Ve,"⋅","\\cdot",!0);k(E,D,Ve,"∘","\\circ",!0);k(E,D,Ve,"÷","\\div",!0);k(E,D,Ve,"±","\\pm",!0);k(E,D,Ve,"×","\\times",!0);k(E,D,Ve,"∩","\\cap",!0);k(E,D,Ve,"∪","\\cup",!0);k(E,D,Ve,"∖","\\setminus",!0);k(E,D,Ve,"∧","\\land");k(E,D,Ve,"∨","\\lor");k(E,D,Ve,"∧","\\wedge",!0);k(E,D,Ve,"∨","\\vee",!0);k(E,D,ce,"√","\\surd");k(E,D,Ur,"⟨","\\langle",!0);k(E,D,Ur,"∣","\\lvert");k(E,D,Ur,"∥","\\lVert");k(E,D,fr,"?","?");k(E,D,fr,"!","!");k(E,D,fr,"⟩","\\rangle",!0);k(E,D,fr,"∣","\\rvert");k(E,D,fr,"∥","\\rVert");k(E,D,ae,"=","=");k(E,D,ae,":",":");k(E,D,ae,"≈","\\approx",!0);k(E,D,ae,"≅","\\cong",!0);k(E,D,ae,"≥","\\ge");k(E,D,ae,"≥","\\geq",!0);k(E,D,ae,"←","\\gets");k(E,D,ae,">","\\gt",!0);k(E,D,ae,"∈","\\in",!0);k(E,D,ae,"","\\@not");k(E,D,ae,"⊂","\\subset",!0);k(E,D,ae,"⊃","\\supset",!0);k(E,D,ae,"⊆","\\subseteq",!0);k(E,D,ae,"⊇","\\supseteq",!0);k(E,te,ae,"⊈","\\nsubseteq",!0);k(E,te,ae,"⊉","\\nsupseteq",!0);k(E,D,ae,"⊨","\\models");k(E,D,ae,"←","\\leftarrow",!0);k(E,D,ae,"≤","\\le");k(E,D,ae,"≤","\\leq",!0);k(E,D,ae,"<","\\lt",!0);k(E,D,ae,"→","\\rightarrow",!0);k(E,D,ae,"→","\\to");k(E,te,ae,"≱","\\ngeq",!0);k(E,te,ae,"≰","\\nleq",!0);k(E,D,ri," ","\\ ");k(E,D,ri," ","\\space");k(E,D,ri," ","\\nobreakspace");k(Ne,D,ri," ","\\ ");k(Ne,D,ri," "," ");k(Ne,D,ri," ","\\space");k(Ne,D,ri," ","\\nobreakspace");k(E,D,ri,"","\\nobreak");k(E,D,ri,"","\\allowbreak");k(E,D,ec,",",",");k(E,D,ec,";",";");k(E,te,Ve,"⊼","\\barwedge",!0);k(E,te,Ve,"⊻","\\veebar",!0);k(E,D,Ve,"⊙","\\odot",!0);k(E,D,Ve,"⊕","\\oplus",!0);k(E,D,Ve,"⊗","\\otimes",!0);k(E,D,ce,"∂","\\partial",!0);k(E,D,Ve,"⊘","\\oslash",!0);k(E,te,Ve,"⊚","\\circledcirc",!0);k(E,te,Ve,"⊡","\\boxdot",!0);k(E,D,Ve,"△","\\bigtriangleup");k(E,D,Ve,"▽","\\bigtriangledown");k(E,D,Ve,"†","\\dagger");k(E,D,Ve,"⋄","\\diamond");k(E,D,Ve,"⋆","\\star");k(E,D,Ve,"◃","\\triangleleft");k(E,D,Ve,"▹","\\triangleright");k(E,D,Ur,"{","\\{");k(Ne,D,ce,"{","\\{");k(Ne,D,ce,"{","\\textbraceleft");k(E,D,fr,"}","\\}");k(Ne,D,ce,"}","\\}");k(Ne,D,ce,"}","\\textbraceright");k(E,D,Ur,"{","\\lbrace");k(E,D,fr,"}","\\rbrace");k(E,D,Ur,"[","\\lbrack",!0);k(Ne,D,ce,"[","\\lbrack",!0);k(E,D,fr,"]","\\rbrack",!0);k(Ne,D,ce,"]","\\rbrack",!0);k(E,D,Ur,"(","\\lparen",!0);k(E,D,fr,")","\\rparen",!0);k(Ne,D,ce,"<","\\textless",!0);k(Ne,D,ce,">","\\textgreater",!0);k(E,D,Ur,"⌊","\\lfloor",!0);k(E,D,fr,"⌋","\\rfloor",!0);k(E,D,Ur,"⌈","\\lceil",!0);k(E,D,fr,"⌉","\\rceil",!0);k(E,D,ce,"\\","\\backslash");k(E,D,ce,"∣","|");k(E,D,ce,"∣","\\vert");k(Ne,D,ce,"|","\\textbar",!0);k(E,D,ce,"∥","\\|");k(E,D,ce,"∥","\\Vert");k(Ne,D,ce,"∥","\\textbardbl");k(Ne,D,ce,"~","\\textasciitilde");k(Ne,D,ce,"\\","\\textbackslash");k(Ne,D,ce,"^","\\textasciicircum");k(E,D,ae,"↑","\\uparrow",!0);k(E,D,ae,"⇑","\\Uparrow",!0);k(E,D,ae,"↓","\\downarrow",!0);k(E,D,ae,"⇓","\\Downarrow",!0);k(E,D,ae,"↕","\\updownarrow",!0);k(E,D,ae,"⇕","\\Updownarrow",!0);k(E,D,Fn,"∐","\\coprod");k(E,D,Fn,"⋁","\\bigvee");k(E,D,Fn,"⋀","\\bigwedge");k(E,D,Fn,"⨄","\\biguplus");k(E,D,Fn,"⋂","\\bigcap");k(E,D,Fn,"⋃","\\bigcup");k(E,D,Fn,"∫","\\int");k(E,D,Fn,"∫","\\intop");k(E,D,Fn,"∬","\\iint");k(E,D,Fn,"∭","\\iiint");k(E,D,Fn,"∏","\\prod");k(E,D,Fn,"∑","\\sum");k(E,D,Fn,"⨂","\\bigotimes");k(E,D,Fn,"⨁","\\bigoplus");k(E,D,Fn,"⨀","\\bigodot");k(E,D,Fn,"∮","\\oint");k(E,D,Fn,"∯","\\oiint");k(E,D,Fn,"∰","\\oiiint");k(E,D,Fn,"⨆","\\bigsqcup");k(E,D,Fn,"∫","\\smallint");k(Ne,D,Eo,"…","\\textellipsis");k(E,D,Eo,"…","\\mathellipsis");k(Ne,D,Eo,"…","\\ldots",!0);k(E,D,Eo,"…","\\ldots",!0);k(E,D,Eo,"⋯","\\@cdots",!0);k(E,D,Eo,"⋱","\\ddots",!0);k(E,D,ce,"⋮","\\varvdots");k(Ne,D,ce,"⋮","\\varvdots");k(E,D,yn,"ˊ","\\acute");k(E,D,yn,"ˋ","\\grave");k(E,D,yn,"¨","\\ddot");k(E,D,yn,"~","\\tilde");k(E,D,yn,"ˉ","\\bar");k(E,D,yn,"˘","\\breve");k(E,D,yn,"ˇ","\\check");k(E,D,yn,"^","\\hat");k(E,D,yn,"⃗","\\vec");k(E,D,yn,"˙","\\dot");k(E,D,yn,"˚","\\mathring");k(E,D,ot,"","\\@imath");k(E,D,ot,"","\\@jmath");k(E,D,ce,"ı","ı");k(E,D,ce,"ȷ","ȷ");k(Ne,D,ce,"ı","\\i",!0);k(Ne,D,ce,"ȷ","\\j",!0);k(Ne,D,ce,"ß","\\ss",!0);k(Ne,D,ce,"æ","\\ae",!0);k(Ne,D,ce,"œ","\\oe",!0);k(Ne,D,ce,"ø","\\o",!0);k(Ne,D,ce,"Æ","\\AE",!0);k(Ne,D,ce,"Œ","\\OE",!0);k(Ne,D,ce,"Ø","\\O",!0);k(Ne,D,yn,"ˊ","\\'");k(Ne,D,yn,"ˋ","\\`");k(Ne,D,yn,"ˆ","\\^");k(Ne,D,yn,"˜","\\~");k(Ne,D,yn,"ˉ","\\=");k(Ne,D,yn,"˘","\\u");k(Ne,D,yn,"˙","\\.");k(Ne,D,yn,"¸","\\c");k(Ne,D,yn,"˚","\\r");k(Ne,D,yn,"ˇ","\\v");k(Ne,D,yn,"¨",'\\"');k(Ne,D,yn,"˝","\\H");k(Ne,D,yn,"◯","\\textcircled");var L6={"--":!0,"---":!0,"``":!0,"''":!0};k(Ne,D,ce,"–","--",!0);k(Ne,D,ce,"–","\\textendash");k(Ne,D,ce,"—","---",!0);k(Ne,D,ce,"—","\\textemdash");k(Ne,D,ce,"‘","`",!0);k(Ne,D,ce,"‘","\\textquoteleft");k(Ne,D,ce,"’","'",!0);k(Ne,D,ce,"’","\\textquoteright");k(Ne,D,ce,"“","``",!0);k(Ne,D,ce,"“","\\textquotedblleft");k(Ne,D,ce,"”","''",!0);k(Ne,D,ce,"”","\\textquotedblright");k(E,D,ce,"°","\\degree",!0);k(Ne,D,ce,"°","\\degree");k(Ne,D,ce,"°","\\textdegree",!0);k(E,D,ce,"£","\\pounds");k(E,D,ce,"£","\\mathsterling",!0);k(Ne,D,ce,"£","\\pounds");k(Ne,D,ce,"£","\\textsterling",!0);k(E,te,ce,"✠","\\maltese");k(Ne,te,ce,"✠","\\maltese");var Tv='0123456789/@."';for(var vm=0;vm<Tv.length;vm++){var Cv=Tv.charAt(vm);k(E,D,ce,Cv,Cv)}var Rv='0123456789!@*()-=+";:?/.,';for(var ym=0;ym<Rv.length;ym++){var Nv=Rv.charAt(ym);k(Ne,D,ce,Nv,Nv)}var ad="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(var xm=0;xm<ad.length;xm++){var ku=ad.charAt(xm);k(E,D,ot,ku,ku),k(Ne,D,ce,ku,ku)}k(E,te,ce,"C","ℂ");k(Ne,te,ce,"C","ℂ");k(E,te,ce,"H","ℍ");k(Ne,te,ce,"H","ℍ");k(E,te,ce,"N","ℕ");k(Ne,te,ce,"N","ℕ");k(E,te,ce,"P","ℙ");k(Ne,te,ce,"P","ℙ");k(E,te,ce,"Q","ℚ");k(Ne,te,ce,"Q","ℚ");k(E,te,ce,"R","ℝ");k(Ne,te,ce,"R","ℝ");k(E,te,ce,"Z","ℤ");k(Ne,te,ce,"Z","ℤ");k(E,D,ot,"h","ℎ");k(Ne,D,ot,"h","ℎ");var ht;for(var lr=0;lr<ad.length;lr++){var Rn=ad.charAt(lr);ht=String.fromCharCode(55349,56320+lr),k(E,D,ot,Rn,ht),k(Ne,D,ce,Rn,ht),ht=String.fromCharCode(55349,56372+lr),k(E,D,ot,Rn,ht),k(Ne,D,ce,Rn,ht),ht=String.fromCharCode(55349,56424+lr),k(E,D,ot,Rn,ht),k(Ne,D,ce,Rn,ht),ht=String.fromCharCode(55349,56580+lr),k(E,D,ot,Rn,ht),k(Ne,D,ce,Rn,ht),ht=String.fromCharCode(55349,56684+lr),k(E,D,ot,Rn,ht),k(Ne,D,ce,Rn,ht),ht=String.fromCharCode(55349,56736+lr),k(E,D,ot,Rn,ht),k(Ne,D,ce,Rn,ht),ht=String.fromCharCode(55349,56788+lr),k(E,D,ot,Rn,ht),k(Ne,D,ce,Rn,ht),ht=String.fromCharCode(55349,56840+lr),k(E,D,ot,Rn,ht),k(Ne,D,ce,Rn,ht),ht=String.fromCharCode(55349,56944+lr),k(E,D,ot,Rn,ht),k(Ne,D,ce,Rn,ht),lr<26&&(ht=String.fromCharCode(55349,56632+lr),k(E,D,ot,Rn,ht),k(Ne,D,ce,Rn,ht),ht=String.fromCharCode(55349,56476+lr),k(E,D,ot,Rn,ht),k(Ne,D,ce,Rn,ht))}ht="𝕜";k(E,D,ot,"k",ht);k(Ne,D,ce,"k",ht);for(var hs=0;hs<10;hs++){var Di=hs.toString();ht=String.fromCharCode(55349,57294+hs),k(E,D,ot,Di,ht),k(Ne,D,ce,Di,ht),ht=String.fromCharCode(55349,57314+hs),k(E,D,ot,Di,ht),k(Ne,D,ce,Di,ht),ht=String.fromCharCode(55349,57324+hs),k(E,D,ot,Di,ht),k(Ne,D,ce,Di,ht),ht=String.fromCharCode(55349,57334+hs),k(E,D,ot,Di,ht),k(Ne,D,ce,Di,ht)}var s1="ÐÞþ";for(var wm=0;wm<s1.length;wm++){var Su=s1.charAt(wm);k(E,D,ot,Su,Su),k(Ne,D,ce,Su,Su)}var o1={mathClass:"mathbf",textClass:"textbf",font:"Main-Bold"},Av={mathClass:"mathnormal",textClass:"textit",font:"Math-Italic"},Iv={mathClass:"boldsymbol",textClass:"boldsymbol",font:"Main-BoldItalic"},aI={mathClass:"mathscr",textClass:"textscr",font:"Script-Regular"},vs={mathClass:"",textClass:"",font:""},_v={mathClass:"mathfrak",textClass:"textfrak",font:"Fraktur-Regular"},Mv={mathClass:"mathbb",textClass:"textbb",font:"AMS-Regular"},Ov={mathClass:"mathboldfrak",textClass:"textboldfrak",font:"Fraktur-Regular"},l1={mathClass:"mathsf",textClass:"textsf",font:"SansSerif-Regular"},c1={mathClass:"mathboldsf",textClass:"textboldsf",font:"SansSerif-Bold"},Dv={mathClass:"mathitsf",textClass:"textitsf",font:"SansSerif-Italic"},u1={mathClass:"mathtt",textClass:"texttt",font:"Typewriter-Regular"},jv=[o1,o1,Av,Av,Iv,Iv,aI,vs,vs,vs,_v,_v,Mv,Mv,Ov,Ov,l1,l1,c1,c1,Dv,Dv,vs,vs,u1,u1],iI=[o1,vs,l1,c1,u1],sI=e=>{var t=e.charCodeAt(0),n=e.charCodeAt(1),a=(t-55296)*1024+(n-56320)+65536;if(119808<=a&&a<120484){var s=Math.floor((a-119808)/26);return jv[s]}else if(120782<=a&&a<=120831){var o=Math.floor((a-120782)/10);return iI[o]}else{if(a===120485||a===120486)return jv[0];if(120486<a&&a<120782)return vs;throw new Me("Unsupported character: "+e)}},kd=function(t,n,a){if(vn[a][t]){var s=vn[a][t].replace;s&&(t=s)}return{value:t,metrics:fp(t,n,a)}},cr=function(t,n,a,s,o){var c=kd(t,n,a),d=c.metrics;t=c.value;var m;if(d){var h=d.italic;(a==="text"||s&&s.font==="mathit")&&(h=0),m=new Hr(t,d.height,d.depth,h,d.skew,d.width,o)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+t+"' in style '"+n+"' and mode '"+a+"'")),m=new Hr(t,0,0,0,0,0,o);if(s){m.maxFontSize=s.sizeMultiplier,s.style.isTight()&&m.classes.push("mtight");var p=s.getColor();p&&(m.style.color=p)}return m},mp=function(t,n,a,s){return s===void 0&&(s=[]),a.font==="boldsymbol"&&kd(t,"Main-Bold",n).metrics?cr(t,"Main-Bold",n,a,s.concat(["mathbf"])):t==="\\"||vn[n][t].font==="main"?cr(t,"Main-Regular",n,a,s):cr(t,"AMS-Regular",n,a,s.concat(["amsrm"]))},oI=function(t,n,a){return a!=="textord"&&kd(t,"Math-BoldItalic",n).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},Sd=function(t,n,a){var s=t.mode,o=t.text,c=["mord"],{font:d,fontFamily:m,fontWeight:h,fontShape:p}=n,b=s==="math"||s==="text"&&!!d,x=b?d:m,y="",S="";if(o.charCodeAt(0)===55349){var T=sI(o);y=T.font,S=T[s+"Class"]}if(y)return cr(o,y,s,n,c.concat(S));if(x){var A,C;if(x==="boldsymbol"){var M=oI(o,s,a);A=M.fontName,C=[M.fontClass]}else b?(A=d1[d].fontName,C=[d]):(A=Eu(m,h,p),C=[m,h,p]);if(kd(o,A,s).metrics)return cr(o,A,s,n,c.concat(C));if(L6.hasOwnProperty(o)&&A.slice(0,10)==="Typewriter"){for(var I=[],P=0;P<o.length;P++)I.push(cr(o[P],A,s,n,c.concat(C)));return ai(I)}}if(a==="mathord")return cr(o,"Math-Italic",s,n,c.concat(["mathnormal"]));if(a==="textord"){var U=vn[s][o]&&vn[s][o].font;if(U==="ams"){var N=Eu("amsrm",h,p);return cr(o,N,s,n,c.concat("amsrm",h,p))}else if(U==="main"||!U){var z=Eu("textrm",h,p);return cr(o,z,s,n,c.concat(h,p))}else{var X=Eu(U,h,p);return cr(o,X,s,n,c.concat(X,h,p))}}else throw new Error("unexpected type: "+a+" in makeOrd")},lI=(e,t)=>{if(Hi(e.classes)!==Hi(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 s of Object.keys(t.style))if(e.style[s]!==t.style[s])return!1;return!0},z6=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],a=e[t+1];n instanceof Hr&&a instanceof Hr&&lI(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},hp=function(t){for(var n=0,a=0,s=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>s&&(s=c.maxFontSize)}t.height=n,t.depth=a,t.maxFontSize=s},Ie=function(t,n,a,s){var o=new So(t,n,a,s);return hp(o),o},Fi=(e,t,n,a)=>new So(e,t,n,a),go=function(t,n,a){var s=Ie([t],[],n);return s.height=Math.max(a||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),s.style.borderBottomWidth=Be(s.height),s.maxFontSize=1,s},cI=function(t,n,a,s){var o=new wd(t,n,a,s);return hp(o),o},ai=function(t){var n=new ko(t);return hp(n),n},bo=function(t,n){return t instanceof ko?Ie([],[t],n):t},uI=function(t){if(t.positionType==="individualShift"){for(var n=t.children,a=[n[0]],s=-n[0].shift-n[0].elem.depth,o=s,c=1;c<n.length;c++){var d=-n[c].shift-o-n[c].elem.depth,m=d-(n[c-1].elem.height+n[c-1].elem.depth);o=o+d,a.push({type:"kern",size:m}),a.push(n[c])}return{children:a,depth:s}}var h;if(t.positionType==="top"){for(var p=t.positionData,b=0;b<t.children.length;b++){var x=t.children[b];p-=x.type==="kern"?x.size:x.elem.height+x.elem.depth}h=p}else if(t.positionType==="bottom")h=-t.positionData;else{var y=t.children[0];if(y.type!=="elem")throw new Error('First child must have type "elem".');if(t.positionType==="shift")h=-y.elem.depth-t.positionData;else if(t.positionType==="firstBaseline")h=-y.elem.depth;else throw new Error("Invalid positionType "+t.positionType+".")}return{children:t.children,depth:h}},Jt=function(t,n){for(var{children:a,depth:s}=uI(t),o=0,c=0;c<a.length;c++){var d=a[c];if(d.type==="elem"){var m=d.elem;o=Math.max(o,m.maxFontSize,m.height)}}o+=2;var h=Ie(["pstrut"],[]);h.style.height=Be(o);for(var p=[],b=s,x=s,y=s,S=0;S<a.length;S++){var T=a[S];if(T.type==="kern")y+=T.size;else{var A=T.elem,C=T.wrapperClasses||[],M=T.wrapperStyle||{},I=Ie(C,[h,A],void 0,M);I.style.top=Be(-o-y-A.depth),T.marginLeft&&(I.style.marginLeft=T.marginLeft),T.marginRight&&(I.style.marginRight=T.marginRight),p.push(I),y+=A.height+A.depth}b=Math.min(b,y),x=Math.max(x,y)}var P=Ie(["vlist"],p);P.style.height=Be(x);var U;if(b<0){var N=Ie([],[]),z=Ie(["vlist"],[N]);z.style.height=Be(-b);var X=Ie(["vlist-s"],[new Hr("")]);U=[Ie(["vlist-r"],[P,X]),Ie(["vlist-r"],[z])]}else U=[Ie(["vlist-r"],[P])];var B=Ie(["vlist-t"],U);return U.length===2&&B.classes.push("vlist-t2"),B.height=x,B.depth=-b,B},B6=(e,t)=>{var n=Ie(["mspace"],[],t),a=En(e,t);return n.style.marginRight=Be(a),n},Eu=(e,t,n)=>{var a,s;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"?s="BoldItalic":t==="textbf"?s="Bold":n==="textit"?s="Italic":s="Regular",a+"-"+s},d1={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"}},q6={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},H6=function(t,n){var[a,s,o]=q6[t],c=new Ui(a),d=new ei([c],{width:Be(s),height:Be(o),style:"width:"+Be(s),viewBox:"0 0 "+1e3*s+" "+1e3*o,preserveAspectRatio:"xMinYMin"}),m=Fi(["overlay"],[d],n);return m.height=o,m.style.height=Be(o),m.style.width=Be(s),m},Sn={number:3,unit:"mu"},ps={number:4,unit:"mu"},Ka={number:5,unit:"mu"},dI={mord:{mop:Sn,mbin:ps,mrel:Ka,minner:Sn},mop:{mord:Sn,mop:Sn,mrel:Ka,minner:Sn},mbin:{mord:ps,mop:ps,mopen:ps,minner:ps},mrel:{mord:Ka,mop:Ka,mopen:Ka,minner:Ka},mopen:{},mclose:{mop:Sn,mbin:ps,mrel:Ka,minner:Sn},mpunct:{mord:Sn,mop:Sn,mrel:Ka,mopen:Sn,mclose:Sn,mpunct:Sn,minner:Sn},minner:{mord:Sn,mop:Sn,mbin:ps,mrel:Ka,mopen:Sn,mpunct:Sn,minner:Sn}},fI={mord:{mop:Sn},mop:{mord:Sn,mop:Sn},mbin:{},mrel:{},mopen:{},mclose:{mop:Sn},mpunct:{},minner:{mop:Sn}},U6={},id={},sd={};function Ge(e){for(var{type:t,names:n,props:a,handler:s,htmlBuilder:o,mathmlBuilder:c}=e,d={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:s},m=0;m<n.length;++m)U6[n[m]]=d;t&&(o&&(id[t]=o),c&&(sd[t]=c))}function Rs(e){var{type:t,htmlBuilder:n,mathmlBuilder:a}=e;Ge({type:t,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:a})}var od=function(t){return t.type==="ordgroup"&&t.body.length===1?t.body[0]:t},Hn=function(t){return t.type==="ordgroup"?t.body:[t]},mI=new Set(["leftmost","mbin","mopen","mrel","mop","mpunct"]),hI=new Set(["rightmost","mrel","mclose","mpunct"]),pI={display:xt.DISPLAY,text:xt.TEXT,script:xt.SCRIPT,scriptscript:xt.SCRIPTSCRIPT},gI={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Vn=function(t,n,a,s){s===void 0&&(s=[null,null]);for(var o=[],c=0;c<t.length;c++){var d=en(t[c],n);if(d instanceof ko){var m=d.children;o.push(...m)}else o.push(d)}if(z6(o),!a)return o;var h=n;if(t.length===1){var p=t[0];p.type==="sizing"?h=n.havingSize(p.size):p.type==="styling"&&(h=n.havingStyle(pI[p.style]))}var b=Ie([s[0]||"leftmost"],[],n),x=Ie([s[1]||"rightmost"],[],n),y=a==="root";return f1(o,(S,T)=>{var A=T.classes[0],C=S.classes[0];A==="mbin"&&hI.has(C)?T.classes[0]="mord":C==="mbin"&&mI.has(A)&&(S.classes[0]="mord")},{node:b},x,y),f1(o,(S,T)=>{var A,C,M=h1(T),I=h1(S),P=M&&I?S.hasClass("mtight")?(A=fI[M])==null?void 0:A[I]:(C=dI[M])==null?void 0:C[I]:null;if(P)return B6(P,h)},{node:b},x,y),o},f1=function(t,n,a,s,o){s&&t.push(s);for(var c=0;c<t.length;c++){var d=t[c],m=F6(d);if(m){f1(m.children,n,a,null,o);continue}var h=!d.hasClass("mspace");if(h){var p=n(d,a.node);p&&(a.insertAfter?a.insertAfter(p):(t.unshift(p),c++))}h?a.node=d:o&&d.hasClass("newline")&&(a.node=Ie(["leftmost"])),a.insertAfter=(b=>x=>{t.splice(b+1,0,x),c++})(c)}s&&t.pop()},F6=function(t){return t instanceof ko||t instanceof wd||t instanceof So&&t.hasClass("enclosing")?t:null},m1=function(t,n){var a=F6(t);if(a){var s=a.children;if(s.length){if(n==="right")return m1(s[s.length-1],"right");if(n==="left")return m1(s[0],"left")}}return t},h1=function(t,n){if(!t)return null;n&&(t=m1(t,n));var a=t.classes[0];return gI[a]||null},Gl=function(t,n){var a=["nulldelimiter"].concat(t.baseSizingClasses());return Ie(n.concat(a))},en=function(t,n,a){if(!t)return Ie();if(id[t.type]){var s=id[t.type](t,n);if(a&&n.size!==a.size){s=Ie(n.sizingClasses(a),[s],n);var o=n.sizeMultiplier/a.sizeMultiplier;s.height*=o,s.depth*=o}return s}else throw new Me("Got group of unknown type: '"+t.type+"'")};function Tu(e,t){var n=Ie(["base"],e,t),a=Ie(["strut"]);return a.style.height=Be(n.height+n.depth),n.depth&&(a.style.verticalAlign=Be(-n.depth)),n.children.unshift(a),n}function p1(e,t){var n=null;e.length===1&&e[0].type==="tag"&&(n=e[0].tag,e=e[0].body);var a=Vn(e,t,"root"),s;a.length===2&&a[1].hasClass("tag")&&(s=a.pop());for(var o=[],c=[],d=0;d<a.length;d++)if(c.push(a[d]),a[d].hasClass("mbin")||a[d].hasClass("mrel")||a[d].hasClass("allowbreak")){for(var m=!1;d<a.length-1&&a[d+1].hasClass("mspace")&&!a[d+1].hasClass("newline");)d++,c.push(a[d]),a[d].hasClass("nobreak")&&(m=!0);m||(o.push(Tu(c,t)),c=[])}else a[d].hasClass("newline")&&(c.pop(),c.length>0&&(o.push(Tu(c,t)),c=[]),o.push(a[d]));c.length>0&&o.push(Tu(c,t));var h;n?(h=Tu(Vn(n,t,!0),t),h.classes=["tag"],o.push(h)):s&&o.push(s);var p=Ie(["katex-html"],o);if(p.setAttribute("aria-hidden","true"),h){var b=h.children[0];b.style.height=Be(p.height+p.depth),p.depth&&(b.style.verticalAlign=Be(-p.depth))}return p}function $6(e){return new ko(e)}class De{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=Hi(this.classes));for(var a=0;a<this.children.length;a++)if(this.children[a]instanceof Un&&this.children[a+1]instanceof Un){for(var s=this.children[a].toText()+this.children[++a].toText();this.children[a+1]instanceof Un;)s+=this.children[++a].toText();t.appendChild(new Un(s).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+=rr(this.attributes[n]),t+='"');this.classes.length>0&&(t+=' class ="'+rr(Hi(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 Un{constructor(t){this.text=void 0,this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return rr(this.toText())}toText(){return this.text}}class P6{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",Be(this.width)),t}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+Be(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var bI=new Set(["\\imath","\\jmath"]),vI=new Set(["mrow","mtable"]),ta=function(t,n,a){return vn[n][t]&&vn[n][t].replace&&t.charCodeAt(0)!==55349&&!(L6.hasOwnProperty(t)&&a&&(a.fontFamily&&a.fontFamily.slice(4,6)==="tt"||a.font&&a.font.slice(4,6)==="tt"))&&(t=vn[n][t].replace),new Un(t)},pp=function(t){return t.length===1?t[0]:new De("mrow",t)},yI={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"},gp=(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,s=yI[n];if(s)return typeof s=="function"?s(e):s;var o=e.text;if(bI.has(o))return null;if(vn[a][o]){var c=vn[a][o].replace;c&&(o=c)}var d=d1[n].fontName;return fp(o,d,a)?d1[n].variant:null};function km(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var t=e.children[0];return t instanceof Un&&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 Un&&n.text===","}else return!1}var Fr=function(t,n,a){if(t.length===1){var s=dn(t[0],n);return a&&s instanceof De&&s.type==="mo"&&(s.setAttribute("lspace","0em"),s.setAttribute("rspace","0em")),[s]}for(var o=[],c,d=0;d<t.length;d++){var m=dn(t[d],n);if(m instanceof De&&c instanceof De){if(m.type==="mtext"&&c.type==="mtext"&&m.getAttribute("mathvariant")===c.getAttribute("mathvariant")){c.children.push(...m.children);continue}else if(m.type==="mn"&&c.type==="mn"){c.children.push(...m.children);continue}else if(km(m)&&c.type==="mn"){c.children.push(...m.children);continue}else if(m.type==="mn"&&km(c))m.children=[...c.children,...m.children],o.pop();else if((m.type==="msup"||m.type==="msub")&&m.children.length>=1&&(c.type==="mn"||km(c))){var h=m.children[0];h instanceof De&&h.type==="mn"&&(h.children=[...c.children,...h.children],o.pop())}else if(c.type==="mi"&&c.children.length===1){var p=c.children[0];if(p instanceof Un&&p.text==="̸"&&(m.type==="mo"||m.type==="mi"||m.type==="mn")){var b=m.children[0];b instanceof Un&&b.text.length>0&&(b.text=b.text.slice(0,1)+"̸"+b.text.slice(1),o.pop())}}}o.push(m),c=m}return o},$i=function(t,n,a){return pp(Fr(t,n,a))},dn=function(t,n){if(!t)return new De("mrow");if(sd[t.type])return sd[t.type](t,n);throw new Me("Got group of unknown type: '"+t.type+"'")};function Lv(e,t,n,a,s){var o=Fr(e,n),c;o.length===1&&o[0]instanceof De&&vI.has(o[0].type)?c=o[0]:c=new De("mrow",o);var d=new De("annotation",[new Un(t)]);d.setAttribute("encoding","application/x-tex");var m=new De("semantics",[c,d]),h=new De("math",[m]);h.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),a&&h.setAttribute("display","block");var p=s?"katex":"katex-mathml";return Ie([p],[h])}var xI=[[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]],zv=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Bv=function(t,n){return n.size<2?t:xI[t-1][n.size-1]};class Wa{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||Wa.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=zv[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 Wa(n)}havingStyle(t){return this.style===t?this:this.extend({style:t,size:Bv(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:zv[t-1]})}havingBaseStyle(t){t=t||this.style.text();var n=Bv(Wa.BASESIZE,t);return this.size===n&&this.textSize===Wa.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!==Wa.BASESIZE?["sizing","reset-size"+this.size,"size"+Wa.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=rI(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Wa.BASESIZE=6;var G6=function(t){return new Wa({style:t.displayMode?xt.DISPLAY:xt.TEXT,maxSize:t.maxSize,minRuleThickness:t.minRuleThickness})},V6=function(t,n){if(n.displayMode){var a=["katex-display"];n.leqno&&a.push("leqno"),n.fleqn&&a.push("fleqn"),t=Ie(a,[t])}return t},wI=function(t,n,a){var s=G6(a),o;if(a.output==="mathml")return Lv(t,n,s,a.displayMode,!0);if(a.output==="html"){var c=p1(t,s);o=Ie(["katex"],[c])}else{var d=Lv(t,n,s,a.displayMode,!1),m=p1(t,s);o=Ie(["katex"],[d,m])}return V6(o,a)},kI=function(t,n,a){var s=G6(a),o=p1(t,s),c=Ie(["katex"],[o]);return V6(c,a)},SI={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":"="},Ed=function(t){var n=new De("mo",[new Un(SI[t.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},EI={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]},TI=new Set(["widehat","widecheck","widetilde","utilde"]),Td=function(t,n){function a(){var d=4e5,m=t.label.slice(1);if(TI.has(m)&&"base"in t){var h=t.base.type==="ordgroup"?t.base.body.length:1,p,b,x;if(h>5)m==="widehat"||m==="widecheck"?(p=420,d=2364,x=.42,b=m+"4"):(p=312,d=2340,x=.34,b="tilde4");else{var y=[1,1,2,2,3,3][h];m==="widehat"||m==="widecheck"?(d=[0,1062,2364,2364,2364][y],p=[0,239,300,360,420][y],x=[0,.24,.3,.3,.36,.42][y],b=m+y):(d=[0,600,1033,2339,2340][y],p=[0,260,286,306,312][y],x=[0,.26,.286,.3,.306,.34][y],b="tilde"+y)}var S=new Ui(b),T=new ei([S],{width:"100%",height:Be(x),viewBox:"0 0 "+d+" "+p,preserveAspectRatio:"none"});return{span:Fi([],[T],n),minWidth:0,height:x}}else{var A=[],C=EI[m];if(!C)throw new Error('No SVG data for "'+m+'".');var[M,I,P]=C,U=P/1e3,N=M.length,z,X;if(N===1){if(C.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+m+'".');z=["hide-tail"],X=[C[3]]}else if(N===2)z=["halfarrow-left","halfarrow-right"],X=["xMinYMin","xMaxYMin"];else if(N===3)z=["brace-left","brace-center","brace-right"],X=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
|
|
302
|
-
`+N+" children.");for(var B=0;B<N;B++){var $=new Ui(M[B]),F=new ei([$],{width:"400em",height:Be(U),viewBox:"0 0 "+d+" "+P,preserveAspectRatio:X[B]+" slice"}),K=Fi([z[B]],[F],n);if(N===1)return{span:K,minWidth:I,height:U};K.style.height=Be(U),A.push(K)}return{span:Ie(["stretchy"],A,n),minWidth:I,height:U}}}var{span:s,minWidth:o,height:c}=a();return s.height=c,s.style.height=Be(c),o>0&&(s.style.minWidth=Be(o)),s},CI=function(t,n,a,s,o){var c,d=t.height+t.depth+a+s;if(/fbox|color|angl/.test(n)){if(c=Ie(["stretchy",n],[],o),n==="fbox"){var m=o.color&&o.getColor();m&&(c.style.borderColor=m)}}else{var h=[];/^[bx]cancel$/.test(n)&&h.push(new i1({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&h.push(new i1({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var p=new ei(h,{width:"100%",height:Be(d)});c=Fi([],[p],o)}return c.height=d,c.style.height=Be(d),c},RI={bin:1,close:1,inner:1,open:1,punct:1,rel:1},NI={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function AI(e){return e in RI}function It(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 Cd(e){var t=Rd(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 Rd(e){return e&&(e.type==="atom"||NI.hasOwnProperty(e.type))?e:null}var K6=e=>{if(e instanceof Hr)return e;if(nI(e)&&e.children.length===1)return K6(e.children[0])},bp=(e,t)=>{var n,a,s;e&&e.type==="supsub"?(a=It(e.base,"accent"),n=a.base,e.base=n,s=tI(en(e,t)),e.base=a):(a=It(e,"accent"),n=a.base);var o=en(n,t.havingCrampedStyle()),c=a.isShifty&&ni(n),d=0;if(c){var m,h;d=(m=(h=K6(o))==null?void 0:h.skew)!=null?m:0}var p=a.label==="\\c",b=p?o.height+o.depth:Math.min(o.height,t.fontMetrics().xHeight),x;if(a.isStretchy)x=Td(a,t),x=Jt({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"elem",elem:x,wrapperClasses:["svg-align"],wrapperStyle:d>0?{width:"calc(100% - "+Be(2*d)+")",marginLeft:Be(2*d)}:void 0}]});else{var y,S;a.label==="\\vec"?(y=H6("vec",t),S=q6.vec[1]):(y=Sd({mode:a.mode,text:a.label},t,"textord"),y=eI(y),y.italic=0,S=y.width,p&&(b+=y.depth)),x=Ie(["accent-body"],[y]);var T=a.label==="\\textcircled";T&&(x.classes.push("accent-full"),b=o.height);var A=d;T||(A-=S/2),x.style.left=Be(A),a.label==="\\textcircled"&&(x.style.top=".2em"),x=Jt({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:-b},{type:"elem",elem:x}]})}var C=Ie(["mord","accent"],[x],t);return s?(s.children[0]=C,s.height=Math.max(C.height,s.height),s.classes[0]="mord",s):C},Y6=(e,t)=>{var n=e.isStretchy?Ed(e.label):new De("mo",[ta(e.label,e.mode)]),a=new De("mover",[dn(e.base,t),n]);return a.setAttribute("accent","true"),a},II=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));Ge({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=od(t[0]),a=!II.test(e.funcName),s=!a||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:a,isShifty:s,base:n}},htmlBuilder:bp,mathmlBuilder:Y6});Ge({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:bp,mathmlBuilder:Y6});Ge({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:a}=e,s=t[0];return{type:"accentUnder",mode:n.mode,label:a,base:s}},htmlBuilder:(e,t)=>{var n=en(e.base,t),a=Td(e,t),s=e.label==="\\utilde"?.12:0,o=Jt({positionType:"top",positionData:n.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:s},{type:"elem",elem:n}]});return Ie(["mord","accentunder"],[o],t)},mathmlBuilder:(e,t)=>{var n=Ed(e.label),a=new De("munder",[dn(e.base,t),n]);return a.setAttribute("accentunder","true"),a}});var Cu=e=>{var t=new De("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};Ge({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:s}=e;return{type:"xArrow",mode:a.mode,label:s,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,a=t.havingStyle(n.sup()),s=bo(en(e.body,a,t),t),o=e.label.slice(0,2)==="\\x"?"x":"cd";s.classes.push(o+"-arrow-pad");var c;e.below&&(a=t.havingStyle(n.sub()),c=bo(en(e.below,a,t),t),c.classes.push(o+"-arrow-pad"));var d=Td(e,t),m=-t.fontMetrics().axisHeight+.5*d.height,h=-t.fontMetrics().axisHeight-.5*d.height-.111;(s.depth>.25||e.label==="\\xleftequilibrium")&&(h-=s.depth);var p;if(c){var b=-t.fontMetrics().axisHeight+c.height+.5*d.height+.111;p=Jt({positionType:"individualShift",children:[{type:"elem",elem:s,shift:h},{type:"elem",elem:d,shift:m,wrapperClasses:["svg-align"]},{type:"elem",elem:c,shift:b}]})}else p=Jt({positionType:"individualShift",children:[{type:"elem",elem:s,shift:h},{type:"elem",elem:d,shift:m,wrapperClasses:["svg-align"]}]});return Ie(["mrel","x-arrow"],[p],t)},mathmlBuilder(e,t){var n=Ed(e.label);n.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var a;if(e.body){var s=Cu(dn(e.body,t));if(e.below){var o=Cu(dn(e.below,t));a=new De("munderover",[n,o,s])}else a=new De("mover",[n,s])}else if(e.below){var c=Cu(dn(e.below,t));a=new De("munder",[n,c])}else a=Cu(),a=new De("mover",[n,a]);return a}});function W6(e,t){var n=Vn(e.body,t,!0);return Ie([e.mclass],n,t)}function Z6(e,t){var n,a=Fr(e.body,t);return e.mclass==="minner"?n=new De("mpadded",a):e.mclass==="mord"?e.isCharacterBox?(n=a[0],n.type="mi"):n=new De("mi",a):(e.isCharacterBox?(n=a[0],n.type="mo"):n=new De("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}Ge({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:a}=e,s=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+a.slice(5),body:Hn(s),isCharacterBox:ni(s)}},htmlBuilder:W6,mathmlBuilder:Z6});var Nd=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"};Ge({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:Nd(t[0]),body:Hn(t[1]),isCharacterBox:ni(t[1])}}});Ge({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var{parser:n,funcName:a}=e,s=t[1],o=t[0],c;a!=="\\stackrel"?c=Nd(s):c="mrel";var d={type:"op",mode:s.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:a!=="\\stackrel",body:Hn(s)},m={type:"supsub",mode:o.mode,base:d,sup:a==="\\underset"?null:o,sub:a==="\\underset"?o:null};return{type:"mclass",mode:n.mode,mclass:c,body:[m],isCharacterBox:ni(m)}},htmlBuilder:W6,mathmlBuilder:Z6});Ge({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:Nd(t[0]),body:Hn(t[0])}},htmlBuilder(e,t){var n=Vn(e.body,t,!0),a=Ie([e.mclass],n,t);return a.style.textShadow="0.02em 0.01em 0.04px",a},mathmlBuilder(e,t){var n=Fr(e.body,t),a=new De("mstyle",n);return a.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),a}});var _I={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},qv=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),Hv=e=>e.type==="textord"&&e.text==="@",MI=(e,t)=>(e.type==="mathord"||e.type==="atom")&&e.text===t;function OI(e,t,n){var a=_I[e];switch(a){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(a,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{var s=n.callFunction("\\\\cdleft",[t[0]],[]),o={type:"atom",text:a,mode:"math",family:"rel"},c=n.callFunction("\\Big",[o],[]),d=n.callFunction("\\\\cdright",[t[1]],[]),m={type:"ordgroup",mode:"math",body:[s,c,d]};return n.callFunction("\\\\cdparent",[m],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var h={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[h],[])}default:return{type:"textord",text:" ",mode:"math"}}}function DI(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 Me("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var a=[],s=[a],o=0;o<t.length;o++){for(var c=t[o],d=qv(),m=0;m<c.length;m++)if(!Hv(c[m]))d.body.push(c[m]);else{a.push(d),m+=1;var h=Cd(c[m]).text,p=new Array(2);if(p[0]={type:"ordgroup",mode:"math",body:[]},p[1]={type:"ordgroup",mode:"math",body:[]},!"=|.".includes(h))if("<>AV".includes(h))for(var b=0;b<2;b++){for(var x=!0,y=m+1;y<c.length;y++){if(MI(c[y],h)){x=!1,m=y;break}if(Hv(c[y]))throw new Me("Missing a "+h+" character to complete a CD arrow.",c[y]);p[b].body.push(c[y])}if(x)throw new Me("Missing a "+h+" character to complete a CD arrow.",c[m])}else throw new Me('Expected one of "<>AV=|." after @',c[m]);var S=OI(h,p,e),T={type:"styling",body:[S],mode:"math",style:"display",resetFont:!0};a.push(T),d=qv()}o%2===0?a.push(d):a.shift(),a=[],s.push(a)}e.gullet.endGroup(),e.gullet.endGroup();var A=new Array(s[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:s,arraystretch:1,addJot:!0,rowGaps:[null],cols:A,colSeparationType:"CD",hLinesBeforeRow:new Array(s.length+1).fill([])}}Ge({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=bo(en(e.label,n,t),t);return a.classes.push("cd-label-"+e.side),a.style.bottom=Be(.8-a.depth),a.height=0,a.depth=0,a},mathmlBuilder(e,t){var n=new De("mrow",[dn(e.label,t)]);return n=new De("mpadded",[n]),n.setAttribute("width","0"),e.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new De("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});Ge({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=bo(en(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(e,t){return new De("mrow",[dn(e.fragment,t)])}});Ge({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,a=It(t[0],"ordgroup"),s=a.body,o="",c=0;c<s.length;c++){var d=It(s[c],"textord");o+=d.text}var m=parseInt(o),h;if(isNaN(m))throw new Me("\\@char has non-numeric argument "+o);if(m<0||m>=1114111)throw new Me("\\@char with invalid code point "+o);return m<=65535?h=String.fromCharCode(m):(m-=65536,h=String.fromCharCode((m>>10)+55296,(m&1023)+56320)),{type:"textord",mode:n.mode,text:h}}});var X6=(e,t)=>{var n=Vn(e.body,t.withColor(e.color),!1);return ai(n)},Q6=(e,t)=>{var n=Fr(e.body,t.withColor(e.color)),a=new De("mstyle",n);return a.setAttribute("mathcolor",e.color),a};Ge({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,a=It(t[0],"color-token").color,s=t[1];return{type:"color",mode:n.mode,color:a,body:Hn(s)}},htmlBuilder:X6,mathmlBuilder:Q6});Ge({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:a}=e,s=It(t[0],"color-token").color;n.gullet.macros.set("\\current@color",s);var o=n.parseExpression(!0,a);return{type:"color",mode:n.mode,color:s,body:o}},htmlBuilder:X6,mathmlBuilder:Q6});Ge({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:a}=e,s=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:s&&It(s,"size").value}},htmlBuilder(e,t){var n=Ie(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=Be(En(e.size,t)))),n},mathmlBuilder(e,t){var n=new De("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",Be(En(e.size,t)))),n}});var g1={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},J6=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new Me("Expected a control sequence",e);return t},jI=e=>{var t=e.gullet.popToken();return t.text==="="&&(t=e.gullet.popToken(),t.text===" "&&(t=e.gullet.popToken())),t},e7=(e,t,n,a)=>{var s=e.gullet.macros.get(n.text);s==null&&(n.noexpand=!0,s={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,s,a)};Ge({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(g1[a.text])return(n==="\\global"||n==="\\\\globallong")&&(a.text=g1[a.text]),It(t.parseFunction(),"internal");throw new Me("Invalid token after macro prefix",a)}});Ge({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(),s=a.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(s))throw new Me("Expected a control sequence",a);for(var o=0,c,d=[[]];t.gullet.future().text!=="{";)if(a=t.gullet.popToken(),a.text==="#"){if(t.gullet.future().text==="{"){c=t.gullet.future(),d[o].push("{");break}if(a=t.gullet.popToken(),!/^[1-9]$/.test(a.text))throw new Me('Invalid argument number "'+a.text+'"');if(parseInt(a.text)!==o+1)throw new Me('Argument number "'+a.text+'" out of order');o++,d.push([])}else{if(a.text==="EOF")throw new Me("Expected a macro definition");d[o].push(a.text)}var{tokens:m}=t.gullet.consumeArg();return c&&m.unshift(c),(n==="\\edef"||n==="\\xdef")&&(m=t.gullet.expandTokens(m),m.reverse()),t.gullet.macros.set(s,{tokens:m,numArgs:o,delimiters:d},n===g1[n]),{type:"internal",mode:t.mode}}});Ge({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,a=J6(t.gullet.popToken());t.gullet.consumeSpaces();var s=jI(t);return e7(t,a,s,n==="\\\\globallet"),{type:"internal",mode:t.mode}}});Ge({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,a=J6(t.gullet.popToken()),s=t.gullet.popToken(),o=t.gullet.popToken();return e7(t,a,o,n==="\\\\globalfuture"),t.gullet.pushToken(o),t.gullet.pushToken(s),{type:"internal",mode:t.mode}}});var Tl=function(t,n,a){var s=vn.math[t]&&vn.math[t].replace,o=fp(s||t,n,a);if(!o)throw new Error("Unsupported symbol "+t+" and font size "+n+".");return o},vp=function(t,n,a,s){var o=a.havingBaseStyle(n),c=Ie(s.concat(o.sizingClasses(a)),[t],a),d=o.sizeMultiplier/a.sizeMultiplier;return c.height*=d,c.depth*=d,c.maxFontSize=o.sizeMultiplier,c},t7=function(t,n,a){var s=n.havingBaseStyle(a),o=(1-n.sizeMultiplier/s.sizeMultiplier)*n.fontMetrics().axisHeight;t.classes.push("delimcenter"),t.style.top=Be(o),t.height-=o,t.depth+=o},LI=function(t,n,a,s,o,c){var d=cr(t,"Main-Regular",o,s),m=vp(d,n,s,c);return t7(m,s,n),m},zI=function(t,n,a,s){return cr(t,"Size"+n+"-Regular",a,s)},n7=function(t,n,a,s,o,c){var d=zI(t,n,o,s),m=vp(Ie(["delimsizing","size"+n],[d],s),xt.TEXT,s,c);return a&&t7(m,s,xt.TEXT),m},Sm=function(t,n,a){var s;n==="Size1-Regular"?s="delim-size1":s="delim-size4";var o=Ie(["delimsizinginner",s],[Ie([],[cr(t,n,a)])]);return{type:"elem",elem:o}},Em=function(t,n,a){var s=Sa["Size4-Regular"][t.charCodeAt(0)]?Sa["Size4-Regular"][t.charCodeAt(0)][4]:Sa["Size1-Regular"][t.charCodeAt(0)][4],o=new Ui("inner",KA(t,Math.round(1e3*n))),c=new ei([o],{width:Be(s),height:Be(n),style:"width:"+Be(s),viewBox:"0 0 "+1e3*s+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),d=Fi([],[c],a);return d.height=n,d.style.height=Be(n),d.style.width=Be(s),{type:"elem",elem:d}},b1=.008,Ru={type:"kern",size:-1*b1},BI=new Set(["|","\\lvert","\\rvert","\\vert"]),qI=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),r7=function(t,n,a,s,o,c){var d,m,h,p,b="",x=0;d=h=p=t,m=null;var y="Size1-Regular";t==="\\uparrow"?h=p="⏐":t==="\\Uparrow"?h=p="‖":t==="\\downarrow"?d=h="⏐":t==="\\Downarrow"?d=h="‖":t==="\\updownarrow"?(d="\\uparrow",h="⏐",p="\\downarrow"):t==="\\Updownarrow"?(d="\\Uparrow",h="‖",p="\\Downarrow"):BI.has(t)?(h="∣",b="vert",x=333):qI.has(t)?(h="∥",b="doublevert",x=556):t==="["||t==="\\lbrack"?(d="⎡",h="⎢",p="⎣",y="Size4-Regular",b="lbrack",x=667):t==="]"||t==="\\rbrack"?(d="⎤",h="⎥",p="⎦",y="Size4-Regular",b="rbrack",x=667):t==="\\lfloor"||t==="⌊"?(h=d="⎢",p="⎣",y="Size4-Regular",b="lfloor",x=667):t==="\\lceil"||t==="⌈"?(d="⎡",h=p="⎢",y="Size4-Regular",b="lceil",x=667):t==="\\rfloor"||t==="⌋"?(h=d="⎥",p="⎦",y="Size4-Regular",b="rfloor",x=667):t==="\\rceil"||t==="⌉"?(d="⎤",h=p="⎥",y="Size4-Regular",b="rceil",x=667):t==="("||t==="\\lparen"?(d="⎛",h="⎜",p="⎝",y="Size4-Regular",b="lparen",x=875):t===")"||t==="\\rparen"?(d="⎞",h="⎟",p="⎠",y="Size4-Regular",b="rparen",x=875):t==="\\{"||t==="\\lbrace"?(d="⎧",m="⎨",p="⎩",h="⎪",y="Size4-Regular"):t==="\\}"||t==="\\rbrace"?(d="⎫",m="⎬",p="⎭",h="⎪",y="Size4-Regular"):t==="\\lgroup"||t==="⟮"?(d="⎧",p="⎩",h="⎪",y="Size4-Regular"):t==="\\rgroup"||t==="⟯"?(d="⎫",p="⎭",h="⎪",y="Size4-Regular"):t==="\\lmoustache"||t==="⎰"?(d="⎧",p="⎭",h="⎪",y="Size4-Regular"):(t==="\\rmoustache"||t==="⎱")&&(d="⎫",p="⎩",h="⎪",y="Size4-Regular");var S=Tl(d,y,o),T=S.height+S.depth,A=Tl(h,y,o),C=A.height+A.depth,M=Tl(p,y,o),I=M.height+M.depth,P=0,U=1;if(m!==null){var N=Tl(m,y,o);P=N.height+N.depth,U=2}var z=T+I+P,X=Math.max(0,Math.ceil((n-z)/(U*C))),B=z+X*U*C,$=s.fontMetrics().axisHeight;a&&($*=s.sizeMultiplier);var F=B/2-$,K=[];if(b.length>0){var oe=B-T-I,J=Math.round(B*1e3),H=YA(b,Math.round(oe*1e3)),_=new Ui(b,H),Y=Be(x/1e3),re=Be(J/1e3),fe=new ei([_],{width:Y,height:re,viewBox:"0 0 "+x+" "+J}),j=Fi([],[fe],s);j.height=J/1e3,j.style.width=Y,j.style.height=re,K.push({type:"elem",elem:j})}else{if(K.push(Sm(p,y,o)),K.push(Ru),m===null){var G=B-T-I+2*b1;K.push(Em(h,G,s))}else{var W=(B-T-I-P)/2+2*b1;K.push(Em(h,W,s)),K.push(Ru),K.push(Sm(m,y,o)),K.push(Ru),K.push(Em(h,W,s))}K.push(Ru),K.push(Sm(d,y,o))}var O=s.havingBaseStyle(xt.TEXT),be=Jt({positionType:"bottom",positionData:F,children:K});return vp(Ie(["delimsizing","mult"],[be],O),xt.TEXT,s,c)},Tm=80,Cm=.08,Rm=function(t,n,a,s,o){var c=VA(t,s,a),d=new Ui(t,c),m=new ei([d],{width:"400em",height:Be(n),viewBox:"0 0 400000 "+a,preserveAspectRatio:"xMinYMin slice"});return Fi(["hide-tail"],[m],o)},HI=function(t,n){var a=n.havingBaseSizing(),s=l7("\\surd",t*a.sizeMultiplier,o7,a),o=a.sizeMultiplier,c=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),d,m,h,p,b;return s.type==="small"?(p=1e3+1e3*c+Tm,t<1?o=1:t<1.4&&(o=.7),m=(1+c+Cm)/o,h=(1+c)/o,d=Rm("sqrtMain",m,p,c,n),d.style.minWidth="0.853em",b=.833/o):s.type==="large"?(p=(1e3+Tm)*Dl[s.size],h=(Dl[s.size]+c)/o,m=(Dl[s.size]+c+Cm)/o,d=Rm("sqrtSize"+s.size,m,p,c,n),d.style.minWidth="1.02em",b=1/o):(m=t+c+Cm,h=t+c,p=Math.floor(1e3*t+c)+Tm,d=Rm("sqrtTall",m,p,c,n),d.style.minWidth="0.742em",b=1.056),d.height=h,d.style.height=Be(m),{span:d,advanceWidth:b,ruleWidth:(n.fontMetrics().sqrtRuleThickness+c)*o}},a7=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),UI=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),i7=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),Dl=[0,1.2,1.8,2.4,3],s7=function(t,n,a,s,o){if(t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle"),a7.has(t)||i7.has(t))return n7(t,n,!1,a,s,o);if(UI.has(t))return r7(t,Dl[n],!1,a,s,o);throw new Me("Illegal delimiter: '"+t+"'")},FI=[{type:"small",style:xt.SCRIPTSCRIPT},{type:"small",style:xt.SCRIPT},{type:"small",style:xt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],$I=[{type:"small",style:xt.SCRIPTSCRIPT},{type:"small",style:xt.SCRIPT},{type:"small",style:xt.TEXT},{type:"stack"}],o7=[{type:"small",style:xt.SCRIPTSCRIPT},{type:"small",style:xt.SCRIPT},{type:"small",style:xt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],PI=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.")},l7=function(t,n,a,s){for(var o=Math.min(2,3-s.style.size),c=o;c<a.length;c++){var d=a[c];if(d.type==="stack")break;var m=Tl(t,PI(d),"math"),h=m.height+m.depth;if(d.type==="small"){var p=s.havingBaseStyle(d.style);h*=p.sizeMultiplier}if(h>n)return d}return a[a.length-1]},v1=function(t,n,a,s,o,c){t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle");var d;i7.has(t)?d=FI:a7.has(t)?d=o7:d=$I;var m=l7(t,n,d,s);return m.type==="small"?LI(t,m.style,a,s,o,c):m.type==="large"?n7(t,m.size,a,s,o,c):r7(t,n,a,s,o,c)},Nm=function(t,n,a,s,o,c){var d=s.fontMetrics().axisHeight*s.sizeMultiplier,m=901,h=5/s.fontMetrics().ptPerEm,p=Math.max(n-d,a+d),b=Math.max(p/500*m,2*p-h);return v1(t,b,!0,s,o,c)},Uv={"\\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}},GI=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 Fv(e){return"isMiddle"in e}function Ad(e,t){var n=Rd(e);if(n&&GI.has(n.text))return n;throw n?new Me("Invalid delimiter '"+n.text+"' after '"+t.funcName+"'",e):new Me("Invalid delimiter type '"+e.type+"'",e)}Ge({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=Ad(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:Uv[e.funcName].size,mclass:Uv[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim==="."?Ie([e.mclass]):s7(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!=="."&&t.push(ta(e.delim,e.mode));var n=new De("mo",t);e.mclass==="mopen"||e.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var a=Be(Dl[e.size]);return n.setAttribute("minsize",a),n.setAttribute("maxsize",a),n}});function $v(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Ge({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 Me("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Ad(t[0],e).text,color:n}}});Ge({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Ad(t[0],e),a=e.parser;++a.leftrightDepth;var s=a.parseExpression(!1);--a.leftrightDepth,a.expect("\\right",!1);var o=It(a.parseFunction(),"leftright-right");return{type:"leftright",mode:a.mode,body:s,left:n.text,right:o.delim,rightColor:o.color}},htmlBuilder:(e,t)=>{$v(e);for(var n=Vn(e.body,t,!0,["mopen","mclose"]),a=0,s=0,o=!1,c=0;c<n.length;c++){var d=n[c];Fv(d)?o=!0:(a=Math.max(n[c].height,a),s=Math.max(n[c].depth,s))}a*=t.sizeMultiplier,s*=t.sizeMultiplier;var m;if(e.left==="."?m=Gl(t,["mopen"]):m=Nm(e.left,a,s,t,e.mode,["mopen"]),n.unshift(m),o)for(var h=1;h<n.length;h++){var p=n[h];if(Fv(p)){var b=p.isMiddle;n[h]=Nm(b.delim,a,s,b.options,e.mode,[])}}var x;if(e.right===".")x=Gl(t,["mclose"]);else{var y=e.rightColor?t.withColor(e.rightColor):t;x=Nm(e.right,a,s,y,e.mode,["mclose"])}return n.push(x),Ie(["minner"],n,t)},mathmlBuilder:(e,t)=>{$v(e);var n=Fr(e.body,t);if(e.left!=="."){var a=new De("mo",[ta(e.left,e.mode)]);a.setAttribute("fence","true"),n.unshift(a)}if(e.right!=="."){var s=new De("mo",[ta(e.right,e.mode)]);s.setAttribute("fence","true"),e.rightColor&&s.setAttribute("mathcolor",e.rightColor),n.push(s)}return pp(n)}});Ge({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Ad(t[0],e);if(!e.parser.leftrightDepth)throw new Me("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim==="."?n=Gl(t,[]):(n=s7(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t}),n},mathmlBuilder:(e,t)=>{var n=e.delim==="\\vert"||e.delim==="|"?ta("|","text"):ta(e.delim,e.mode),a=new De("mo",[n]);return a.setAttribute("fence","true"),a.setAttribute("lspace","0.05em"),a.setAttribute("rspace","0.05em"),a}});var Id=(e,t)=>{var n=bo(en(e.body,t),t),a=e.label.slice(1),s=t.sizeMultiplier,o,c,d=ni(e.body);if(a==="sout")o=Ie(["stretchy","sout"]),o.height=t.fontMetrics().defaultRuleThickness/s,c=-.5*t.fontMetrics().xHeight;else if(a==="phase"){var m=En({number:.6,unit:"pt"},t),h=En({number:.35,unit:"ex"},t),p=t.havingBaseSizing();s=s/p.sizeMultiplier;var b=n.height+n.depth+m+h;n.style.paddingLeft=Be(b/2+m);var x=Math.floor(1e3*b*s),y=PA(x),S=new ei([new Ui("phase",y)],{width:"400em",height:Be(x/1e3),viewBox:"0 0 400000 "+x,preserveAspectRatio:"xMinYMin slice"});o=Fi(["hide-tail"],[S],t),o.style.height=Be(b),c=n.depth+m+h}else{/cancel/.test(a)?d||n.classes.push("cancel-pad"):a==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var T,A,C=0;/box/.test(a)?(C=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),T=t.fontMetrics().fboxsep+(a==="colorbox"?0:C),A=T):a==="angl"?(C=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),T=4*C,A=Math.max(0,.25-n.depth)):(T=d?.2:0,A=T),o=CI(n,a,T,A,t),/fbox|boxed|fcolorbox/.test(a)?(o.style.borderStyle="solid",o.style.borderWidth=Be(C)):a==="angl"&&C!==.049&&(o.style.borderTopWidth=Be(C),o.style.borderRightWidth=Be(C)),c=n.depth+A,e.backgroundColor&&(o.style.backgroundColor=e.backgroundColor,e.borderColor&&(o.style.borderColor=e.borderColor))}var M;if(e.backgroundColor)M=Jt({positionType:"individualShift",children:[{type:"elem",elem:o,shift:c},{type:"elem",elem:n,shift:0}]});else{var I=/cancel|phase/.test(a)?["svg-align"]:[];M=Jt({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:o,shift:c,wrapperClasses:I}]})}return/cancel/.test(a)&&(M.height=n.height,M.depth=n.depth),/cancel/.test(a)&&!d?Ie(["mord","cancel-lap"],[M],t):Ie(["mord"],[M],t)},_d=(e,t)=>{var n,a=new De(e.label.includes("colorbox")?"mpadded":"menclose",[dn(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 s=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);a.setAttribute("style","border: "+Be(s)+" solid "+e.borderColor)}break;case"\\xcancel":a.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&a.setAttribute("mathbackground",e.backgroundColor),a};Ge({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,t,n){var{parser:a,funcName:s}=e,o=It(t[0],"color-token").color,c=t[1];return{type:"enclose",mode:a.mode,label:s,backgroundColor:o,body:c}},htmlBuilder:Id,mathmlBuilder:_d});Ge({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,t,n){var{parser:a,funcName:s}=e,o=It(t[0],"color-token").color,c=It(t[1],"color-token").color,d=t[2];return{type:"enclose",mode:a.mode,label:s,backgroundColor:c,borderColor:o,body:d}},htmlBuilder:Id,mathmlBuilder:_d});Ge({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]}}});Ge({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:a}=e,s=t[0];return{type:"enclose",mode:n.mode,label:a,body:s}},htmlBuilder:Id,mathmlBuilder:_d});Ge({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 s=t[0];return{type:"enclose",mode:n.mode,label:a,body:s}},htmlBuilder:Id,mathmlBuilder:_d});Ge({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 c7={};function Ta(e){for(var{type:t,names:n,props:a,handler:s,htmlBuilder:o,mathmlBuilder:c}=e,d={type:t,numArgs:a.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:s},m=0;m<n.length;++m)c7[n[m]]=d;o&&(id[t]=o),c&&(sd[t]=c)}var u7={};function q(e,t){u7[e]=t}class Tr{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 Tr(t.loc.lexer,t.loc.start,n.loc.end):t&&t.loc}}class qr{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 qr(n,Tr.range(this,t))}}function Pv(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 Md=e=>{var t=e.parser.settings;if(!t.displayMode)throw new Me("{"+e.envName+"} can be used only in display mode.")},VI=new Set(["gather","gather*"]);function yp(e){if(!e.includes("ed"))return!e.includes("*")}function Vi(e,t,n){var{hskipBeforeAndAfter:a,addJot:s,cols:o,arraystretch:c,colSeparationType:d,autoTag:m,singleRow:h,emptySingleRow:p,maxNumCols:b,leqno:x}=t;if(e.gullet.beginGroup(),h||e.gullet.macros.set("\\cr","\\\\\\relax"),!c){var y=e.gullet.expandMacroAsText("\\arraystretch");if(y==null)c=1;else if(c=parseFloat(y),!c||c<0)throw new Me("Invalid \\arraystretch: "+y)}e.gullet.beginGroup();var S=[],T=[S],A=[],C=[],M=m!=null?[]:void 0;function I(){m&&e.gullet.macros.set("\\@eqnsw","1",!0)}function P(){M&&(e.gullet.macros.get("\\df@tag")?(M.push(e.subparse([new qr("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):M.push(!!m&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(I(),C.push(Pv(e));;){var U=e.parseExpression(!1,h?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var N={type:"ordgroup",mode:e.mode,body:U};n&&(N={type:"styling",mode:e.mode,style:n,resetFont:!0,body:[N]}),S.push(N);var z=e.fetch().text;if(z==="&"){if(b&&S.length===b){if(h||d)throw new Me("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if(z==="\\end"){P(),S.length===1&&N.type==="styling"&&N.body.length===1&&N.body[0].type==="ordgroup"&&N.body[0].body.length===0&&(T.length>1||!p)&&T.pop(),C.length<T.length+1&&C.push([]);break}else if(z==="\\\\"){e.consume();var X=void 0;e.gullet.future().text!==" "&&(X=e.parseSizeGroup(!0)),A.push(X?X.value:null),P(),C.push(Pv(e)),S=[],T.push(S),I()}else throw new Me("Expected & or \\\\ or \\cr or \\end",e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:s,arraystretch:c,body:T,cols:o,rowGaps:A,hskipBeforeAndAfter:a,hLinesBeforeRow:C,colSeparationType:d,tags:M,leqno:x}}function xp(e){return e.slice(0,1)==="d"?"display":"text"}var Ca=function(t,n){var a,s,o=t.body.length,c=t.hLinesBeforeRow,d=0,m=new Array(o),h=[],p=Math.max(n.fontMetrics().arrayRuleWidth,n.minRuleThickness),b=1/n.fontMetrics().ptPerEm,x=5*b;if(t.colSeparationType&&t.colSeparationType==="small"){var y=n.havingStyle(xt.SCRIPT).sizeMultiplier;x=.2778*(y/n.sizeMultiplier)}var S=t.colSeparationType==="CD"?En({number:3,unit:"ex"},n):12*b,T=3*b,A=t.arraystretch*S,C=.7*A,M=.3*A,I=0;function P(He){for(var we=0;we<He.length;++we)we>0&&(I+=.25),h.push({pos:I,isDashed:He[we]})}for(P(c[0]),a=0;a<t.body.length;++a){var U=t.body[a],N=C,z=M;d<U.length&&(d=U.length);var X={cells:new Array(U.length),height:0,depth:0,pos:0};for(s=0;s<U.length;++s){var B=en(U[s],n);z<B.depth&&(z=B.depth),N<B.height&&(N=B.height),X.cells[s]=B}var $=t.rowGaps[a],F=0;$&&(F=En($,n),F>0&&(F+=M,z<F&&(z=F),F=0)),t.addJot&&a<t.body.length-1&&(z+=T),X.height=N,X.depth=z,I+=N,X.pos=I,I+=z+F,m[a]=X,P(c[a+1])}var K=I/2+n.fontMetrics().axisHeight,oe=t.cols||[],J=[],H,_,Y=[];if(t.tags&&t.tags.some(He=>He))for(a=0;a<o;++a){var re=m[a],fe=re.pos-K,j=t.tags[a],G=void 0;j===!0?G=Ie(["eqn-num"],[],n):j===!1?G=Ie([],[],n):G=Ie([],Vn(j,n,!0),n),G.depth=re.depth,G.height=re.height,Y.push({type:"elem",elem:G,shift:fe})}for(s=0,_=0;s<d||_<oe.length;++s,++_){for(var W,O=oe[_],be=!0;((se=O)==null?void 0:se.type)==="separator";){var se;if(be||(H=Ie(["arraycolsep"],[]),H.style.width=Be(n.fontMetrics().doubleRuleSep),J.push(H)),O.separator==="|"||O.separator===":"){var V=O.separator==="|"?"solid":"dashed",Z=Ie(["vertical-separator"],[],n);Z.style.height=Be(I),Z.style.borderRightWidth=Be(p),Z.style.borderRightStyle=V,Z.style.margin="0 "+Be(-p/2);var ne=I-K;ne&&(Z.style.verticalAlign=Be(-ne)),J.push(Z)}else throw new Me("Invalid separator type: "+O.separator);_++,O=oe[_],be=!1}if(!(s>=d)){var ue=void 0;if(s>0||t.hskipBeforeAndAfter){var he,Re;ue=(he=(Re=O)==null?void 0:Re.pregap)!=null?he:x,ue!==0&&(H=Ie(["arraycolsep"],[]),H.style.width=Be(ue),J.push(H))}var Le=[];for(a=0;a<o;++a){var Ye=m[a],ut=Ye.cells[s];if(ut){var pt=Ye.pos-K;ut.depth=Ye.depth,ut.height=Ye.height,Le.push({type:"elem",elem:ut,shift:pt})}}var Rt=Jt({positionType:"individualShift",children:Le}),Ht=Ie(["col-align-"+(((W=O)==null?void 0:W.align)||"c")],[Rt]);if(J.push(Ht),s<d-1||t.hskipBeforeAndAfter){var at,Mt;ue=(at=(Mt=O)==null?void 0:Mt.postgap)!=null?at:x,ue!==0&&(H=Ie(["arraycolsep"],[]),H.style.width=Be(ue),J.push(H))}}}var ft=Ie(["mtable"],J);if(h.length>0){for(var Ut=go("hline",n,p),ze=go("hdashline",n,p),Qe=[{type:"elem",elem:ft,shift:0}];h.length>0;){var Ue=h.pop(),mt=Ue.pos-K;Ue.isDashed?Qe.push({type:"elem",elem:ze,shift:mt}):Qe.push({type:"elem",elem:Ut,shift:mt})}ft=Jt({positionType:"individualShift",children:Qe})}if(Y.length===0)return Ie(["mord"],[ft],n);var pe=Jt({positionType:"individualShift",children:Y}),me=Ie(["tag"],[pe],n);return ai([ft,me])},KI={c:"center ",l:"left ",r:"right "},Ra=function(t,n){for(var a=[],s=new De("mtd",[],["mtr-glue"]),o=new De("mtd",[],["mml-eqn-num"]),c=0;c<t.body.length;c++){for(var d=t.body[c],m=[],h=0;h<d.length;h++)m.push(new De("mtd",[dn(d[h],n)]));t.tags&&t.tags[c]&&(m.unshift(s),m.push(s),t.leqno?m.unshift(o):m.push(o)),a.push(new De("mtr",m))}var p=new De("mtable",a),b=t.arraystretch===.5?.1:.16+t.arraystretch-1+(t.addJot?.09:0);p.setAttribute("rowspacing",Be(b));var x="",y="";if(t.cols&&t.cols.length>0){var S=t.cols,T="",A=!1,C=0,M=S.length;S[0].type==="separator"&&(x+="top ",C=1),S[S.length-1].type==="separator"&&(x+="bottom ",M-=1);for(var I=C;I<M;I++){var P=S[I];P.type==="align"?(y+=KI[P.align],A&&(T+="none "),A=!0):P.type==="separator"&&A&&(T+=P.separator==="|"?"solid ":"dashed ",A=!1)}p.setAttribute("columnalign",y.trim()),/[sd]/.test(T)&&p.setAttribute("columnlines",T.trim())}if(t.colSeparationType==="align"){for(var U=t.cols||[],N="",z=1;z<U.length;z++)N+=z%2?"0em ":"1em ";p.setAttribute("columnspacing",N.trim())}else t.colSeparationType==="alignat"||t.colSeparationType==="gather"?p.setAttribute("columnspacing","0em"):t.colSeparationType==="small"?p.setAttribute("columnspacing","0.2778em"):t.colSeparationType==="CD"?p.setAttribute("columnspacing","0.5em"):p.setAttribute("columnspacing","1em");var X="",B=t.hLinesBeforeRow;x+=B[0].length>0?"left ":"",x+=B[B.length-1].length>0?"right ":"";for(var $=1;$<B.length-1;$++)X+=B[$].length===0?"none ":B[$][0]?"dashed ":"solid ";return/[sd]/.test(X)&&p.setAttribute("rowlines",X.trim()),x!==""&&(p=new De("menclose",[p]),p.setAttribute("notation",x.trim())),t.arraystretch&&t.arraystretch<1&&(p=new De("mstyle",[p]),p.setAttribute("scriptlevel","1")),p},d7=function(t,n){t.envName.includes("ed")||Md(t);var a=[],s=t.envName.includes("at")?"alignat":"align",o=t.envName==="split",c=Vi(t.parser,{cols:a,addJot:!0,autoTag:o?void 0:yp(t.envName),emptySingleRow:!0,colSeparationType:s,maxNumCols:o?2:void 0,leqno:t.parser.settings.leqno},"display"),d=0,m=0,h={type:"ordgroup",mode:t.mode,body:[]};if(n[0]&&n[0].type==="ordgroup"){for(var p="",b=0;b<n[0].body.length;b++){var x=It(n[0].body[b],"textord");p+=x.text}d=Number(p),m=d*2}var y=!m;c.body.forEach(function(C){for(var M=1;M<C.length;M+=2){var I=It(C[M],"styling"),P=It(I.body[0],"ordgroup");P.body.unshift(h)}if(y)m<C.length&&(m=C.length);else{var U=C.length/2;if(d<U)throw new Me("Too many math in a row: "+("expected "+d+", but got "+U),C[0])}});for(var S=0;S<m;++S){var T="r",A=0;S%2===1?T="l":S>0&&y&&(A=1),a[S]={type:"align",align:T,pregap:A,postgap:0}}return c.colSeparationType=y?"align":"alignat",c};Ta({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=Rd(t[0]),a=n?[t[0]]:It(t[0],"ordgroup").body,s=a.map(function(c){var d=Cd(c),m=d.text;if("lcr".includes(m))return{type:"align",align:m};if(m==="|")return{type:"separator",separator:"|"};if(m===":")return{type:"separator",separator:":"};throw new Me("Unknown column alignment: "+m,c)}),o={cols:s,hskipBeforeAndAfter:!0,maxNumCols:s.length};return Vi(e.parser,o,xp(e.envName))},htmlBuilder:Ca,mathmlBuilder:Ra});Ta({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 s=e.parser;if(s.consumeSpaces(),s.fetch().text==="["){if(s.consume(),s.consumeSpaces(),n=s.fetch().text,!"lcr".includes(n))throw new Me("Expected l or c or r",s.nextToken);s.consume(),s.consumeSpaces(),s.expect("]"),s.consume(),a.cols=[{type:"align",align:n}]}}var o=Vi(e.parser,a,xp(e.envName)),c=Math.max(0,...o.body.map(d=>d.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:Ca,mathmlBuilder:Ra});Ta({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t={arraystretch:.5},n=Vi(e.parser,t,"script");return n.colSeparationType="small",n},htmlBuilder:Ca,mathmlBuilder:Ra});Ta({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=Rd(t[0]),a=n?[t[0]]:It(t[0],"ordgroup").body,s=a.map(function(d){var m=Cd(d),h=m.text;if("lc".includes(h))return{type:"align",align:h};throw new Me("Unknown column alignment: "+h,d)});if(s.length>1)throw new Me("{subarray} can contain only one column");var o={cols:s,hskipBeforeAndAfter:!1,arraystretch:.5},c=Vi(e.parser,o,"script");if(c.body.length>0&&c.body[0].length>1)throw new Me("{subarray} can contain only one column");return c},htmlBuilder:Ca,mathmlBuilder:Ra});Ta({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=Vi(e.parser,t,xp(e.envName));return{type:"leftright",mode:e.mode,body:[n],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:Ca,mathmlBuilder:Ra});Ta({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:d7,htmlBuilder:Ca,mathmlBuilder:Ra});Ta({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){VI.has(e.envName)&&Md(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:yp(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Vi(e.parser,t,"display")},htmlBuilder:Ca,mathmlBuilder:Ra});Ta({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:d7,htmlBuilder:Ca,mathmlBuilder:Ra});Ta({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Md(e);var t={autoTag:yp(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Vi(e.parser,t,"display")},htmlBuilder:Ca,mathmlBuilder:Ra});Ta({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Md(e),DI(e.parser)},htmlBuilder:Ca,mathmlBuilder:Ra});q("\\nonumber","\\gdef\\@eqnsw{0}");q("\\notag","\\nonumber");Ge({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new Me(e.funcName+" valid only within array environment")}});var Gv=c7;Ge({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:n,funcName:a}=e,s=t[0];if(s.type!=="ordgroup")throw new Me("Invalid environment name",s);for(var o="",c=0;c<s.body.length;++c)o+=It(s.body[c],"textord").text;if(a==="\\begin"){if(!Gv.hasOwnProperty(o))throw new Me("No such environment: "+o,s);var d=Gv[o],{args:m,optArgs:h}=n.parseArguments("\\begin{"+o+"}",d),p={mode:n.mode,envName:o,parser:n},b=d.handler(p,m,h);n.expect("\\end",!1);var x=n.nextToken,y=It(n.parseFunction(),"environment");if(y.name!==o)throw new Me("Mismatch: \\begin{"+o+"} matched by \\end{"+y.name+"}",x);return b}return{type:"environment",mode:n.mode,name:o,nameGroup:s}}});var f7=(e,t)=>{var n=e.font,a=t.withFont(n);return en(e.body,a)},m7=(e,t)=>{var n=e.font,a=t.withFont(n);return dn(e.body,a)},Vv={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};Ge({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,s=od(t[0]),o=a;return o in Vv&&(o=Vv[o]),{type:"font",mode:n.mode,font:o.slice(1),body:s}},htmlBuilder:f7,mathmlBuilder:m7});Ge({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:Nd(a),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:a}],isCharacterBox:ni(a)}}});Ge({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:a,breakOnTokenText:s}=e,{mode:o}=n,c=n.parseExpression(!0,s);return{type:"font",mode:o,font:"math"+a.slice(1),body:{type:"ordgroup",mode:n.mode,body:c}}},htmlBuilder:f7,mathmlBuilder:m7});var YI=(e,t)=>{var n=t.style,a=n.fracNum(),s=n.fracDen(),o;o=t.havingStyle(a);var c=en(e.numer,o,t);if(e.continued){var d=8.5/t.fontMetrics().ptPerEm,m=3.5/t.fontMetrics().ptPerEm;c.height=c.height<d?d:c.height,c.depth=c.depth<m?m:c.depth}o=t.havingStyle(s);var h=en(e.denom,o,t),p,b,x;e.hasBarLine?(e.barSize?(b=En(e.barSize,t),p=go("frac-line",t,b)):p=go("frac-line",t),b=p.height,x=p.height):(p=null,b=0,x=t.fontMetrics().defaultRuleThickness);var y,S,T;n.size===xt.DISPLAY.size?(y=t.fontMetrics().num1,b>0?S=3*x:S=7*x,T=t.fontMetrics().denom1):(b>0?(y=t.fontMetrics().num2,S=x):(y=t.fontMetrics().num3,S=3*x),T=t.fontMetrics().denom2);var A;if(p){var M=t.fontMetrics().axisHeight;y-c.depth-(M+.5*b)<S&&(y+=S-(y-c.depth-(M+.5*b))),M-.5*b-(h.height-T)<S&&(T+=S-(M-.5*b-(h.height-T)));var I=-(M-.5*b);A=Jt({positionType:"individualShift",children:[{type:"elem",elem:h,shift:T},{type:"elem",elem:p,shift:I},{type:"elem",elem:c,shift:-y}]})}else{var C=y-c.depth-(h.height-T);C<S&&(y+=.5*(S-C),T+=.5*(S-C)),A=Jt({positionType:"individualShift",children:[{type:"elem",elem:h,shift:T},{type:"elem",elem:c,shift:-y}]})}o=t.havingStyle(n),A.height*=o.sizeMultiplier/t.sizeMultiplier,A.depth*=o.sizeMultiplier/t.sizeMultiplier;var P;n.size===xt.DISPLAY.size?P=t.fontMetrics().delim1:n.size===xt.SCRIPTSCRIPT.size?P=t.havingStyle(xt.SCRIPT).fontMetrics().delim2:P=t.fontMetrics().delim2;var U,N;return e.leftDelim==null?U=Gl(t,["mopen"]):U=v1(e.leftDelim,P,!0,t.havingStyle(n),e.mode,["mopen"]),e.continued?N=Ie([]):e.rightDelim==null?N=Gl(t,["mclose"]):N=v1(e.rightDelim,P,!0,t.havingStyle(n),e.mode,["mclose"]),Ie(["mord"].concat(o.sizingClasses(t)),[U,Ie(["mfrac"],[A]),N],t)},WI=(e,t)=>{var n=new De("mfrac",[dn(e.numer,t),dn(e.denom,t)]);if(!e.hasBarLine)n.setAttribute("linethickness","0px");else if(e.barSize){var a=En(e.barSize,t);n.setAttribute("linethickness",Be(a))}if(e.leftDelim!=null||e.rightDelim!=null){var s=[];if(e.leftDelim!=null){var o=new De("mo",[new Un(e.leftDelim.replace("\\",""))]);o.setAttribute("fence","true"),s.push(o)}if(s.push(n),e.rightDelim!=null){var c=new De("mo",[new Un(e.rightDelim.replace("\\",""))]);c.setAttribute("fence","true"),s.push(c)}return pp(s)}return n},h7=(e,t)=>{if(!t)return e;var n={type:"styling",mode:e.mode,style:t,body:[e]};return n};Ge({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,s=t[0],o=t[1],c,d=null,m=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,d="(",m=")";break;case"\\\\bracefrac":c=!1,d="\\{",m="\\}";break;case"\\\\brackfrac":c=!1,d="[",m="]";break;default:throw new Error("Unrecognized genfrac command")}var h=a==="\\cfrac",p=null;return h||a.startsWith("\\d")?p="display":a.startsWith("\\t")&&(p="text"),h7({type:"genfrac",mode:n.mode,numer:s,denom:o,continued:h,hasBarLine:c,leftDelim:d,rightDelim:m,barSize:null},p)},htmlBuilder:YI,mathmlBuilder:WI});Ge({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:n,token:a}=e,s;switch(n){case"\\over":s="\\frac";break;case"\\choose":s="\\binom";break;case"\\atop":s="\\\\atopfrac";break;case"\\brace":s="\\\\bracefrac";break;case"\\brack":s="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:t.mode,replaceWith:s,token:a}}});var Kv=["display","text","script","scriptscript"],Yv=function(t){var n=null;return t.length>0&&(n=t,n=n==="."?null:n),n};Ge({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],s=t[5],o=od(t[0]),c=o.type==="atom"&&o.family==="open"?Yv(o.text):null,d=od(t[1]),m=d.type==="atom"&&d.family==="close"?Yv(d.text):null,h=It(t[2],"size"),p,b=null;h.isBlank?p=!0:(b=h.value,p=b.number>0);var x=null,y=t[3];if(y.type==="ordgroup"){if(y.body.length>0){var S=It(y.body[0],"textord");x=Kv[Number(S.text)]}}else y=It(y,"textord"),x=Kv[Number(y.text)];return h7({type:"genfrac",mode:n.mode,numer:a,denom:s,continued:!1,hasBarLine:p,barSize:b,leftDelim:c,rightDelim:m},x)}});Ge({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:a,token:s}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:It(t[0],"size").value,token:s}}});Ge({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:a}=e,s=t[0],o=It(t[1],"infix").size;if(!o)throw new Error("\\\\abovefrac expected size, but got "+String(o));var c=t[2],d=o.number>0;return{type:"genfrac",mode:n.mode,numer:s,denom:c,continued:!1,hasBarLine:d,barSize:o,leftDelim:null,rightDelim:null}}});var p7=(e,t)=>{var n=t.style,a,s;e.type==="supsub"?(a=e.sup?en(e.sup,t.havingStyle(n.sup()),t):en(e.sub,t.havingStyle(n.sub()),t),s=It(e.base,"horizBrace")):s=It(e,"horizBrace");var o=en(s.base,t.havingBaseStyle(xt.DISPLAY)),c=Td(s,t),d;if(s.isOver?d=Jt({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:c,wrapperClasses:["svg-align"]}]}):d=Jt({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 m=Ie(["minner",s.isOver?"mover":"munder"],[d],t);s.isOver?d=Jt({positionType:"firstBaseline",children:[{type:"elem",elem:m},{type:"kern",size:.2},{type:"elem",elem:a}]}):d=Jt({positionType:"bottom",positionData:m.depth+.2+a.height+a.depth,children:[{type:"elem",elem:a},{type:"kern",size:.2},{type:"elem",elem:m}]})}return Ie(["minner",s.isOver?"mover":"munder"],[d],t)},ZI=(e,t)=>{var n=Ed(e.label);return new De(e.isOver?"mover":"munder",[dn(e.base,t),n])};Ge({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:p7,mathmlBuilder:ZI});Ge({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=t[1],s=It(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:s})?{type:"href",mode:n.mode,href:s,body:Hn(a)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=Vn(e.body,t,!1);return cI(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=$i(e.body,t);return n instanceof De||(n=new De("mrow",[n])),n.setAttribute("href",e.href),n}});Ge({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=It(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:a}))return n.formatUnsupportedCmd("\\url");for(var s=[],o=0;o<a.length;o++){var c=a[o];c==="~"&&(c="\\textasciitilde"),s.push({type:"textord",mode:"text",text:c})}var d={type:"text",mode:n.mode,font:"\\texttt",body:s};return{type:"href",mode:n.mode,href:a,body:Hn(d)}}});Ge({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:Hn(t[0])}},htmlBuilder(e,t){var n=Vn(e.body,t.withFont(""),!1);return ai(n)},mathmlBuilder(e,t){return new De("mrow",Fr(e.body,t.withFont("")))}});Ge({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:a,token:s}=e,o=It(t[0],"raw").string,c=t[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var d,m={};switch(a){case"\\htmlClass":m.class=o,d={command:"\\htmlClass",class:o};break;case"\\htmlId":m.id=o,d={command:"\\htmlId",id:o};break;case"\\htmlStyle":m.style=o,d={command:"\\htmlStyle",style:o};break;case"\\htmlData":{for(var h=o.split(","),p=0;p<h.length;p++){var b=h[p],x=b.indexOf("=");if(x<0)throw new Me("\\htmlData key/value '"+b+"' missing equals sign");var y=b.slice(0,x),S=b.slice(x+1);m["data-"+y.trim()]=S}d={command:"\\htmlData",attributes:m};break}default:throw new Error("Unrecognized html command")}return n.settings.isTrusted(d)?{type:"html",mode:n.mode,attributes:m,body:Hn(c)}:n.formatUnsupportedCmd(a)},htmlBuilder:(e,t)=>{var n=Vn(e.body,t,!1),a=["enclosing"];e.attributes.class&&a.push(...e.attributes.class.trim().split(/\s+/));var s=Ie(a,n,t);for(var o in e.attributes)o!=="class"&&e.attributes.hasOwnProperty(o)&&s.setAttribute(o,e.attributes[o]);return s},mathmlBuilder:(e,t)=>$i(e.body,t)});Ge({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:Hn(t[0]),mathml:Hn(t[1])}},htmlBuilder:(e,t)=>{var n=Vn(e.html,t,!1);return ai(n)},mathmlBuilder:(e,t)=>$i(e.mathml,t)});var Am=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 Me("Invalid size: '"+t+"' in \\includegraphics");var a={number:+(n[1]+n[2]),unit:n[3]};if(!_6(a))throw new Me("Invalid unit: '"+a.unit+"' in \\includegraphics.");return a};Ge({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:a}=e,s={number:0,unit:"em"},o={number:.9,unit:"em"},c={number:0,unit:"em"},d="";if(n[0])for(var m=It(n[0],"raw").string,h=m.split(","),p=0;p<h.length;p++){var b=h[p].split("=");if(b.length===2){var x=b[1].trim();switch(b[0].trim()){case"alt":d=x;break;case"width":s=Am(x);break;case"height":o=Am(x);break;case"totalheight":c=Am(x);break;default:throw new Me("Invalid key: '"+b[0]+"' in \\includegraphics.")}}}var y=It(t[0],"url").url;return d===""&&(d=y,d=d.replace(/^.*[\\/]/,""),d=d.substring(0,d.lastIndexOf("."))),a.settings.isTrusted({command:"\\includegraphics",url:y})?{type:"includegraphics",mode:a.mode,alt:d,width:s,height:o,totalheight:c,src:y}:a.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var n=En(e.height,t),a=0;e.totalheight.number>0&&(a=En(e.totalheight,t)-n);var s=0;e.width.number>0&&(s=En(e.width,t));var o={height:Be(n+a)};s>0&&(o.width=Be(s)),a>0&&(o.verticalAlign=Be(-a));var c=new QA(e.src,e.alt,o);return c.height=n,c.depth=a,c},mathmlBuilder:(e,t)=>{var n=new De("mglyph",[]);n.setAttribute("alt",e.alt);var a=En(e.height,t),s=0;if(e.totalheight.number>0&&(s=En(e.totalheight,t)-a,n.setAttribute("valign",Be(-s))),n.setAttribute("height",Be(a+s)),e.width.number>0){var o=En(e.width,t);n.setAttribute("width",Be(o))}return n.setAttribute("src",e.src),n}});Ge({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,s=It(t[0],"size");if(n.settings.strict){var o=a[1]==="m",c=s.value.unit==="mu";o?(c||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" supports only mu units, "+("not "+s.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:s.value}},htmlBuilder(e,t){return B6(e.dimension,t)},mathmlBuilder(e,t){var n=En(e.dimension,t);return new P6(n)}});Ge({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:a}=e,s=t[0];return{type:"lap",mode:n.mode,alignment:a.slice(5),body:s}},htmlBuilder:(e,t)=>{var n;e.alignment==="clap"?(n=Ie([],[en(e.body,t)]),n=Ie(["inner"],[n],t)):n=Ie(["inner"],[en(e.body,t)]);var a=Ie(["fix"],[]),s=Ie([e.alignment],[n,a],t),o=Ie(["strut"]);return o.style.height=Be(s.height+s.depth),s.depth&&(o.style.verticalAlign=Be(-s.depth)),s.children.unshift(o),s=Ie(["thinbox"],[s],t),Ie(["mord","vbox"],[s],t)},mathmlBuilder:(e,t)=>{var n=new De("mpadded",[dn(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}});Ge({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:a}=e,s=a.mode;a.switchMode("math");var o=n==="\\("?"\\)":"$",c=a.parseExpression(!1,o);return a.expect(o),a.switchMode(s),{type:"styling",mode:a.mode,style:"text",resetFont:!0,body:c}}});Ge({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new Me("Mismatched "+e.funcName)}});var Wv=(e,t)=>{switch(t.style.size){case xt.DISPLAY.size:return e.display;case xt.TEXT.size:return e.text;case xt.SCRIPT.size:return e.script;case xt.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Ge({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:Hn(t[0]),text:Hn(t[1]),script:Hn(t[2]),scriptscript:Hn(t[3])}},htmlBuilder:(e,t)=>{var n=Wv(e,t),a=Vn(n,t,!1);return ai(a)},mathmlBuilder:(e,t)=>{var n=Wv(e,t);return $i(n,t)}});var g7=(e,t,n,a,s,o,c)=>{e=Ie([],[e]);var d=n&&ni(n),m,h;if(t){var p=en(t,a.havingStyle(s.sup()),a);h={elem:p,kern:Math.max(a.fontMetrics().bigOpSpacing1,a.fontMetrics().bigOpSpacing3-p.depth)}}if(n){var b=en(n,a.havingStyle(s.sub()),a);m={elem:b,kern:Math.max(a.fontMetrics().bigOpSpacing2,a.fontMetrics().bigOpSpacing4-b.height)}}var x;if(h&&m){var y=a.fontMetrics().bigOpSpacing5+m.elem.height+m.elem.depth+m.kern+e.depth+c;x=Jt({positionType:"bottom",positionData:y,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:m.elem,marginLeft:Be(-o)},{type:"kern",size:m.kern},{type:"elem",elem:e},{type:"kern",size:h.kern},{type:"elem",elem:h.elem,marginLeft:Be(o)},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]})}else if(m){var S=e.height-c;x=Jt({positionType:"top",positionData:S,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:m.elem,marginLeft:Be(-o)},{type:"kern",size:m.kern},{type:"elem",elem:e}]})}else if(h){var T=e.depth+c;x=Jt({positionType:"bottom",positionData:T,children:[{type:"elem",elem:e},{type:"kern",size:h.kern},{type:"elem",elem:h.elem,marginLeft:Be(o)},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]})}else return e;var A=[x];if(m&&o!==0&&!d){var C=Ie(["mspace"],[],a);C.style.marginRight=Be(o),A.unshift(C)}return Ie(["mop","op-limits"],A,a)},b7=new Set(["\\smallint"]),To=(e,t)=>{var n,a,s=!1,o;e.type==="supsub"?(n=e.sup,a=e.sub,o=It(e.base,"op"),s=!0):o=It(e,"op");var c=t.style,d=!1;c.size===xt.DISPLAY.size&&o.symbol&&!b7.has(o.name)&&(d=!0);var m,h;if(o.symbol){var p=d?"Size2-Regular":"Size1-Regular",b="";if((o.name==="\\oiint"||o.name==="\\oiiint")&&(b=o.name.slice(1),o.name=b==="oiint"?"\\iint":"\\iiint"),m=cr(o.name,p,"math",t,["mop","op-symbol",d?"large-op":"small-op"]),h=m.italic,b.length>0){var x=H6(b+"Size"+(d?"2":"1"),t);m=Jt({positionType:"individualShift",children:[{type:"elem",elem:m,shift:0},{type:"elem",elem:x,shift:d?.08:0}]}),o.name="\\"+b,m.classes.unshift("mop"),m.italic=h}}else if(o.body){var y=Vn(o.body,t,!0);y.length===1&&y[0]instanceof Hr?(m=y[0],m.classes[0]="mop"):m=Ie(["mop"],y,t)}else{for(var S=[],T=1;T<o.name.length;T++)S.push(mp(o.name[T],o.mode,t));m=Ie(["mop"],S,t)}var A=0,C=0;if((m instanceof Hr||o.name==="\\oiint"||o.name==="\\oiiint")&&!o.suppressBaseShift){var M;A=(m.height-m.depth)/2-t.fontMetrics().axisHeight,C=(M=m.italic)!=null?M:0}return s?g7(m,n,a,t,c,C,A):(A&&(m.style.position="relative",m.style.top=Be(A)),m)},tc=(e,t)=>{var n;if(e.symbol)n=new De("mo",[ta(e.name,e.mode)]),b7.has(e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new De("mo",Fr(e.body,t));else{n=new De("mi",[new Un(e.name.slice(1))]);var a=new De("mo",[ta("","text")]);e.parentIsSupSub?n=new De("mrow",[n,a]):n=$6([n,a])}return n},XI={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Ge({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,s=a;return s.length===1&&(s=XI[s]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:s}},htmlBuilder:To,mathmlBuilder:tc});Ge({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:Hn(a)}},htmlBuilder:To,mathmlBuilder:tc});var QI={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Ge({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:To,mathmlBuilder:tc});Ge({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:To,mathmlBuilder:tc});Ge({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=QI[a]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:a}},htmlBuilder:To,mathmlBuilder:tc});var v7=(e,t)=>{var n,a,s=!1,o;e.type==="supsub"?(n=e.sup,a=e.sub,o=It(e.base,"operatorname"),s=!0):o=It(e,"operatorname");var c;if(o.body.length>0){for(var d=o.body.map(b=>{var x="text"in b?b.text:void 0;return typeof x=="string"?{type:"textord",mode:b.mode,text:x}:b}),m=Vn(d,t.withFont("mathrm"),!0),h=0;h<m.length;h++){var p=m[h];p instanceof Hr&&(p.text=p.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}c=Ie(["mop"],m,t)}else c=Ie(["mop"],[],t);return s?g7(c,n,a,t,t.style,0,0):c},JI=(e,t)=>{for(var n=Fr(e.body,t.withFont("mathrm")),a=!0,s=0;s<n.length;s++){var o=n[s];if(!(o instanceof P6))if(o instanceof De)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 Un?c.text=c.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):a=!1;break}default:a=!1}else a=!1}if(a){var d=n.map(p=>p.toText()).join("");n=[new Un(d)]}var m=new De("mi",n);m.setAttribute("mathvariant","normal");var h=new De("mo",[ta("","text")]);return e.parentIsSupSub?new De("mrow",[m,h]):$6([m,h])};Ge({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:a}=e,s=t[0];return{type:"operatorname",mode:n.mode,body:Hn(s),alwaysHandleSupSub:a==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:v7,mathmlBuilder:JI});q("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Rs({type:"ordgroup",htmlBuilder(e,t){return e.semisimple?ai(Vn(e.body,t,!1)):Ie(["mord"],Vn(e.body,t,!0),t)},mathmlBuilder(e,t){return $i(e.body,t,!0)}});Ge({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=en(e.body,t.havingCrampedStyle()),a=go("overline-line",t),s=t.fontMetrics().defaultRuleThickness,o=Jt({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*s},{type:"elem",elem:a},{type:"kern",size:s}]});return Ie(["mord","overline"],[o],t)},mathmlBuilder(e,t){var n=new De("mo",[new Un("‾")]);n.setAttribute("stretchy","true");var a=new De("mover",[dn(e.body,t),n]);return a.setAttribute("accent","true"),a}});Ge({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:Hn(a)}},htmlBuilder:(e,t)=>{var n=Vn(e.body,t.withPhantom(),!1);return ai(n)},mathmlBuilder:(e,t)=>{var n=Fr(e.body,t);return new De("mphantom",n)}});q("\\hphantom","\\smash{\\phantom{#1}}");Ge({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=Ie(["inner"],[en(e.body,t.withPhantom())]),a=Ie(["fix"],[]);return Ie(["mord","rlap"],[n,a],t)},mathmlBuilder:(e,t)=>{var n=Fr(Hn(e.body),t),a=new De("mphantom",n),s=new De("mpadded",[a]);return s.setAttribute("width","0px"),s}});Ge({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,a=It(t[0],"size").value,s=t[1];return{type:"raisebox",mode:n.mode,dy:a,body:s}},htmlBuilder(e,t){var n=en(e.body,t),a=En(e.dy,t);return Jt({positionType:"shift",positionData:-a,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new De("mpadded",[dn(e.body,t)]),a=e.dy.number+e.dy.unit;return n.setAttribute("voffset",a),n}});Ge({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}});Ge({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,s=n[0],o=It(t[0],"size"),c=It(t[1],"size");return{type:"rule",mode:a.mode,shift:s&&It(s,"size").value,width:o.value,height:c.value}},htmlBuilder(e,t){var n=Ie(["mord","rule"],[],t),a=En(e.width,t),s=En(e.height,t),o=e.shift?En(e.shift,t):0;return n.style.borderRightWidth=Be(a),n.style.borderTopWidth=Be(s),n.style.bottom=Be(o),n.width=a,n.height=s+o,n.depth=-o,n.maxFontSize=s*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=En(e.width,t),a=En(e.height,t),s=e.shift?En(e.shift,t):0,o=t.color&&t.getColor()||"black",c=new De("mspace");c.setAttribute("mathbackground",o),c.setAttribute("width",Be(n)),c.setAttribute("height",Be(a));var d=new De("mpadded",[c]);return s>=0?d.setAttribute("height",Be(s)):(d.setAttribute("height",Be(s)),d.setAttribute("depth",Be(-s))),d.setAttribute("voffset",Be(s)),d}});function y7(e,t,n){for(var a=Vn(e,t,!1),s=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*=s,a[o].depth*=s}return ai(a)}var Zv=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],e_=(e,t)=>{var n=t.havingSize(e.size);return y7(e.body,n,t)};Ge({type:"sizing",names:Zv,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:a,parser:s}=e,o=s.parseExpression(!1,n);return{type:"sizing",mode:s.mode,size:Zv.indexOf(a)+1,body:o}},htmlBuilder:e_,mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),a=Fr(e.body,n),s=new De("mstyle",a);return s.setAttribute("mathsize",Be(n.sizeMultiplier)),s}});Ge({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:a}=e,s=!1,o=!1,c=n[0]&&It(n[0],"ordgroup");if(c)for(var d,m=0;m<c.body.length;++m){var h=c.body[m];if(d=Cd(h).text,d==="t")s=!0;else if(d==="b")o=!0;else{s=!1,o=!1;break}}else s=!0,o=!0;var p=t[0];return{type:"smash",mode:a.mode,body:p,smashHeight:s,smashDepth:o}},htmlBuilder:(e,t)=>{var n=Ie([],[en(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 Ie(["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 s=Jt({positionType:"firstBaseline",children:[{type:"elem",elem:n}]});return Ie(["mord"],[s],t)},mathmlBuilder:(e,t)=>{var n=new De("mpadded",[dn(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}});Ge({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:a}=e,s=n[0],o=t[0];return{type:"sqrt",mode:a.mode,body:o,index:s}},htmlBuilder(e,t){var n=en(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=bo(n,t);var a=t.fontMetrics(),s=a.defaultRuleThickness,o=s;t.style.id<xt.TEXT.id&&(o=t.fontMetrics().xHeight);var c=s+o/4,d=n.height+n.depth+c+s,{span:m,ruleWidth:h,advanceWidth:p}=HI(d,t),b=m.height-h;b>n.height+n.depth+c&&(c=(c+b-n.height-n.depth)/2);var x=m.height-n.height-c-h;n.style.paddingLeft=Be(p);var y=Jt({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+x)},{type:"elem",elem:m},{type:"kern",size:h}]});if(e.index){var S=t.havingStyle(xt.SCRIPTSCRIPT),T=en(e.index,S,t),A=.6*(y.height-y.depth),C=Jt({positionType:"shift",positionData:-A,children:[{type:"elem",elem:T}]}),M=Ie(["root"],[C]);return Ie(["mord","sqrt"],[M,y],t)}else return Ie(["mord","sqrt"],[y],t)},mathmlBuilder(e,t){var{body:n,index:a}=e;return a?new De("mroot",[dn(n,t),dn(a,t)]):new De("msqrt",[dn(n,t)])}});var y1={display:xt.DISPLAY,text:xt.TEXT,script:xt.SCRIPT,scriptscript:xt.SCRIPTSCRIPT};function t_(e){return e in y1}Ge({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:a,parser:s}=e,o=s.parseExpression(!0,n),c=a.slice(1,a.length-5);if(!t_(c))throw new Error("Unknown style: "+c);return{type:"styling",mode:s.mode,style:c,body:o}},htmlBuilder(e,t){var n=y1[e.style],a=t.havingStyle(n);return e.resetFont&&(a=a.withFont("")),y7(e.body,a,t)},mathmlBuilder(e,t){var n=y1[e.style],a=t.havingStyle(n);e.resetFont&&(a=a.withFont(""));var s=Fr(e.body,a),o=new De("mstyle",s),c={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},d=c[e.style];return o.setAttribute("scriptlevel",d[0]),o.setAttribute("displaystyle",d[1]),o}});var n_=function(t,n){var a=t.base;if(a)if(a.type==="op"){var s=a.limits&&(n.style.size===xt.DISPLAY.size||a.alwaysHandleSupSub);return s?To:null}else if(a.type==="operatorname"){var o=a.alwaysHandleSupSub&&(n.style.size===xt.DISPLAY.size||a.limits);return o?v7:null}else{if(a.type==="accent")return ni(a.base)?bp:null;if(a.type==="horizBrace"){var c=!t.sub;return c===a.isOver?p7:null}else return null}else return null};Rs({type:"supsub",htmlBuilder(e,t){var n=n_(e,t);if(n)return n(e,t);var{base:a,sup:s,sub:o}=e,c=en(a,t),d,m,h=t.fontMetrics(),p=0,b=0,x=a&&ni(a);if(s){var y=t.havingStyle(t.style.sup());d=en(s,y,t),x||(p=c.height-y.fontMetrics().supDrop*y.sizeMultiplier/t.sizeMultiplier)}if(o){var S=t.havingStyle(t.style.sub());m=en(o,S,t),x||(b=c.depth+S.fontMetrics().subDrop*S.sizeMultiplier/t.sizeMultiplier)}var T;t.style===xt.DISPLAY?T=h.sup1:t.style.cramped?T=h.sup3:T=h.sup2;var A=t.sizeMultiplier,C=Be(.5/h.ptPerEm/A),M=null;if(m){var I=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(c instanceof Hr||I){var P;M=Be(-((P=c.italic)!=null?P:0))}}var U;if(d&&m){p=Math.max(p,T,d.depth+.25*h.xHeight),b=Math.max(b,h.sub2);var N=h.defaultRuleThickness,z=4*N;if(p-d.depth-(m.height-b)<z){b=z-(p-d.depth)+m.height;var X=.8*h.xHeight-(p-d.depth);X>0&&(p+=X,b-=X)}var B=[{type:"elem",elem:m,shift:b,marginRight:C,marginLeft:M},{type:"elem",elem:d,shift:-p,marginRight:C}];U=Jt({positionType:"individualShift",children:B})}else if(m){b=Math.max(b,h.sub1,m.height-.8*h.xHeight);var $=[{type:"elem",elem:m,marginLeft:M,marginRight:C}];U=Jt({positionType:"shift",positionData:b,children:$})}else if(d)p=Math.max(p,T,d.depth+.25*h.xHeight),U=Jt({positionType:"shift",positionData:-p,children:[{type:"elem",elem:d,marginRight:C}]});else throw new Error("supsub must have either sup or sub.");var F=h1(c,"right")||"mord";return Ie([F],[c,Ie(["msupsub"],[U])],t)},mathmlBuilder(e,t){var n=!1,a,s;e.base&&e.base.type==="horizBrace"&&(s=!!e.sup,s===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=[dn(e.base,t)];e.sub&&o.push(dn(e.sub,t)),e.sup&&o.push(dn(e.sup,t));var c;if(n)c=a?"mover":"munder";else if(e.sub)if(e.sup){var h=e.base;h&&h.type==="op"&&h.limits&&t.style===xt.DISPLAY||h&&h.type==="operatorname"&&h.alwaysHandleSupSub&&(t.style===xt.DISPLAY||h.limits)?c="munderover":c="msubsup"}else{var m=e.base;m&&m.type==="op"&&m.limits&&(t.style===xt.DISPLAY||m.alwaysHandleSupSub)||m&&m.type==="operatorname"&&m.alwaysHandleSupSub&&(m.limits||t.style===xt.DISPLAY)?c="munder":c="msub"}else{var d=e.base;d&&d.type==="op"&&d.limits&&(t.style===xt.DISPLAY||d.alwaysHandleSupSub)||d&&d.type==="operatorname"&&d.alwaysHandleSupSub&&(d.limits||t.style===xt.DISPLAY)?c="mover":c="msup"}return new De(c,o)}});Rs({type:"atom",htmlBuilder(e,t){return mp(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){var n=new De("mo",[ta(e.text,e.mode)]);if(e.family==="bin"){var a=gp(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 x7={mi:"italic",mn:"normal",mtext:"normal"};Rs({type:"mathord",htmlBuilder(e,t){return Sd(e,t,"mathord")},mathmlBuilder(e,t){var n=new De("mi",[ta(e.text,e.mode,t)]),a=gp(e,t)||"italic";return a!==x7[n.type]&&n.setAttribute("mathvariant",a),n}});Rs({type:"textord",htmlBuilder(e,t){return Sd(e,t,"textord")},mathmlBuilder(e,t){var n=ta(e.text,e.mode,t),a=gp(e,t)||"normal",s;return e.mode==="text"?s=new De("mtext",[n]):/[0-9]/.test(e.text)?s=new De("mn",[n]):e.text==="\\prime"?s=new De("mo",[n]):s=new De("mi",[n]),a!==x7[s.type]&&s.setAttribute("mathvariant",a),s}});var Im={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},_m={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Rs({type:"spacing",htmlBuilder(e,t){if(_m.hasOwnProperty(e.text)){var n=_m[e.text].className||"";if(e.mode==="text"){var a=Sd(e,t,"textord");return a.classes.push(n),a}else return Ie(["mspace",n],[mp(e.text,e.mode,t)],t)}else{if(Im.hasOwnProperty(e.text))return Ie(["mspace",Im[e.text]],[],t);throw new Me('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,t){var n;if(_m.hasOwnProperty(e.text))n=new De("mtext",[new Un(" ")]);else{if(Im.hasOwnProperty(e.text))return new De("mspace");throw new Me('Unknown type of space "'+e.text+'"')}return n}});var Xv=()=>{var e=new De("mtd",[]);return e.setAttribute("width","50%"),e};Rs({type:"tag",mathmlBuilder(e,t){var n=new De("mtable",[new De("mtr",[Xv(),new De("mtd",[$i(e.body,t)]),Xv(),new De("mtd",[$i(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var Qv={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Jv={"\\textbf":"textbf","\\textmd":"textmd"},r_={"\\textit":"textit","\\textup":"textup"},ey=(e,t)=>{var n=e.font;if(n){if(Qv[n])return t.withTextFontFamily(Qv[n]);if(Jv[n])return t.withTextFontWeight(Jv[n]);if(n==="\\emph")return t.fontShape==="textit"?t.withTextFontShape("textup"):t.withTextFontShape("textit")}else return t;return t.withTextFontShape(r_[n])};Ge({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,s=t[0];return{type:"text",mode:n.mode,body:Hn(s),font:a}},htmlBuilder(e,t){var n=ey(e,t),a=Vn(e.body,n,!0);return Ie(["mord","text"],a,n)},mathmlBuilder(e,t){var n=ey(e,t);return $i(e.body,n)}});Ge({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=en(e.body,t),a=go("underline-line",t),s=t.fontMetrics().defaultRuleThickness,o=Jt({positionType:"top",positionData:n.height,children:[{type:"kern",size:s},{type:"elem",elem:a},{type:"kern",size:3*s},{type:"elem",elem:n}]});return Ie(["mord","underline"],[o],t)},mathmlBuilder(e,t){var n=new De("mo",[new Un("‾")]);n.setAttribute("stretchy","true");var a=new De("munder",[dn(e.body,t),n]);return a.setAttribute("accentunder","true"),a}});Ge({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=en(e.body,t),a=t.fontMetrics().axisHeight,s=.5*(n.height-a-(n.depth+a));return Jt({positionType:"shift",positionData:s,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new De("mpadded",[dn(e.body,t)],["vcenter"]);return new De("mrow",[n])}});Ge({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new Me("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=ty(e),a=[],s=t.havingStyle(t.style.text()),o=0;o<n.length;o++){var c=n[o];c==="~"&&(c="\\textasciitilde"),a.push(cr(c,"Typewriter-Regular",e.mode,s,["mord","texttt"]))}return Ie(["mord","text"].concat(s.sizingClasses(t)),z6(a),s)},mathmlBuilder(e,t){var n=new Un(ty(e)),a=new De("mtext",[n]);return a.setAttribute("mathvariant","monospace"),a}});var ty=e=>e.body.replace(/ /g,e.star?"␣":" "),zi=U6,w7=`[ \r
|
|
303
|
-
]`,a_="\\\\[a-zA-Z@]+",i_="\\\\[^\uD800-\uDFFF]",s_="("+a_+")"+w7+"*",o_=`\\\\(
|
|
304
|
-
|[ \r ]+
|
|
305
|
-
?)[ \r ]*`,x1="[̀-ͯ]",l_=new RegExp(x1+"+$"),c_="("+w7+"+)|"+(o_+"|")+"([!-\\[\\]-‧-豈-]"+(x1+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(x1+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+s_)+("|"+i_+")");class ny{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(c_,"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 qr("EOF",new Tr(this,n,n));var a=this.tokenRegex.exec(t);if(a===null||a.index!==n)throw new Me("Unexpected character: '"+t[n]+"'",new qr(t[n],new Tr(this,n,n+1)));var s=a[6]||a[3]||(a[2]?"\\ ":" ");if(this.catcodes[s]===14){var o=t.indexOf(`
|
|
306
|
-
`,this.tokenRegex.lastIndex);return o===-1?(this.tokenRegex.lastIndex=t.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=o+1,this.lex()}return new qr(s,new Tr(this,n,this.tokenRegex.lastIndex))}}class u_{constructor(t,n){t===void 0&&(t={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=t,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Me("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var t=this.undefStack.pop();for(var n in t)t.hasOwnProperty(n)&&(t[n]==null?delete this.current[n]:this.current[n]=t[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(t){return this.current.hasOwnProperty(t)||this.builtins.hasOwnProperty(t)}get(t){return this.current.hasOwnProperty(t)?this.current[t]:this.builtins[t]}set(t,n,a){if(a===void 0&&(a=!1),a){for(var s=0;s<this.undefStack.length;s++)delete this.undefStack[s][t];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][t]=n)}else{var o=this.undefStack[this.undefStack.length-1];o&&!o.hasOwnProperty(t)&&(o[t]=this.current[t])}n==null?delete this.current[t]:this.current[t]=n}}var d_=u7;q("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}});q("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}});q("\\@firstoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[0],numArgs:0}});q("\\@secondoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[1],numArgs:0}});q("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}});q("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");q("\\TextOrMath",function(e){var t=e.consumeArgs(2);return e.mode==="text"?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var ry={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};q("\\char",function(e){var t=e.popToken(),n,a=0;if(t.text==="'")n=8,t=e.popToken();else if(t.text==='"')n=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]==="\\")a=t.text.charCodeAt(1);else{if(t.text==="EOF")throw new Me("\\char` missing argument");a=t.text.charCodeAt(0)}else n=10;if(n){if(a=ry[t.text],a==null||a>=n)throw new Me("Invalid base-"+n+" digit "+t.text);for(var s;(s=ry[e.future().text])!=null&&s<n;)a*=n,a+=s,e.popToken()}return"\\@char{"+a+"}"});var wp=(e,t,n,a)=>{var s=e.consumeArg().tokens;if(s.length!==1)throw new Me("\\newcommand's first argument must be a macro name");var o=s[0].text,c=e.isDefined(o);if(c&&!t)throw new Me("\\newcommand{"+o+"} attempting to redefine "+(o+"; use \\renewcommand"));if(!c&&!n)throw new Me("\\renewcommand{"+o+"} when command "+o+" does not yet exist; use \\newcommand");var d=0;if(s=e.consumeArg().tokens,s.length===1&&s[0].text==="["){for(var m="",h=e.expandNextToken();h.text!=="]"&&h.text!=="EOF";)m+=h.text,h=e.expandNextToken();if(!m.match(/^\s*[0-9]+\s*$/))throw new Me("Invalid number of arguments: "+m);d=parseInt(m),s=e.consumeArg().tokens}return c&&a||e.macros.set(o,{tokens:s,numArgs:d}),""};q("\\newcommand",e=>wp(e,!1,!0,!1));q("\\renewcommand",e=>wp(e,!0,!1,!1));q("\\providecommand",e=>wp(e,!0,!0,!0));q("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(n=>n.text).join("")),""});q("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(n=>n.text).join("")),""});q("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),zi[n],vn.math[n],vn.text[n]),""});q("\\bgroup","{");q("\\egroup","}");q("~","\\nobreakspace");q("\\lq","`");q("\\rq","'");q("\\aa","\\r a");q("\\AA","\\r A");q("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");q("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");q("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");q("ℬ","\\mathscr{B}");q("ℰ","\\mathscr{E}");q("ℱ","\\mathscr{F}");q("ℋ","\\mathscr{H}");q("ℐ","\\mathscr{I}");q("ℒ","\\mathscr{L}");q("ℳ","\\mathscr{M}");q("ℛ","\\mathscr{R}");q("ℭ","\\mathfrak{C}");q("ℌ","\\mathfrak{H}");q("ℨ","\\mathfrak{Z}");q("\\Bbbk","\\Bbb{k}");q("\\llap","\\mathllap{\\textrm{#1}}");q("\\rlap","\\mathrlap{\\textrm{#1}}");q("\\clap","\\mathclap{\\textrm{#1}}");q("\\mathstrut","\\vphantom{(}");q("\\underbar","\\underline{\\text{#1}}");q("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');q("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");q("\\ne","\\neq");q("≠","\\neq");q("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");q("∉","\\notin");q("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");q("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");q("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");q("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");q("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");q("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");q("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");q("⟂","\\perp");q("‼","\\mathclose{!\\mkern-0.8mu!}");q("∌","\\notni");q("⌜","\\ulcorner");q("⌝","\\urcorner");q("⌞","\\llcorner");q("⌟","\\lrcorner");q("©","\\copyright");q("®","\\textregistered");q("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');q("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');q("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');q("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');q("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");q("⋮","\\vdots");q("\\varGamma","\\mathit{\\Gamma}");q("\\varDelta","\\mathit{\\Delta}");q("\\varTheta","\\mathit{\\Theta}");q("\\varLambda","\\mathit{\\Lambda}");q("\\varXi","\\mathit{\\Xi}");q("\\varPi","\\mathit{\\Pi}");q("\\varSigma","\\mathit{\\Sigma}");q("\\varUpsilon","\\mathit{\\Upsilon}");q("\\varPhi","\\mathit{\\Phi}");q("\\varPsi","\\mathit{\\Psi}");q("\\varOmega","\\mathit{\\Omega}");q("\\substack","\\begin{subarray}{c}#1\\end{subarray}");q("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");q("\\boxed","\\fbox{$\\displaystyle{#1}$}");q("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");q("\\implies","\\DOTSB\\;\\Longrightarrow\\;");q("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");q("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");q("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var ay={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},f_=new Set(["bin","rel"]);q("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in ay?t=ay[n]:(n.slice(0,4)==="\\not"||n in vn.math&&f_.has(vn.math[n].group))&&(t="\\dotsb"),t});var kp={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};q("\\dotso",function(e){var t=e.future().text;return t in kp?"\\ldots\\,":"\\ldots"});q("\\dotsc",function(e){var t=e.future().text;return t in kp&&t!==","?"\\ldots\\,":"\\ldots"});q("\\cdots",function(e){var t=e.future().text;return t in kp?"\\@cdots\\,":"\\@cdots"});q("\\dotsb","\\cdots");q("\\dotsm","\\cdots");q("\\dotsi","\\!\\cdots");q("\\dotsx","\\ldots\\,");q("\\DOTSI","\\relax");q("\\DOTSB","\\relax");q("\\DOTSX","\\relax");q("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");q("\\,","\\tmspace+{3mu}{.1667em}");q("\\thinspace","\\,");q("\\>","\\mskip{4mu}");q("\\:","\\tmspace+{4mu}{.2222em}");q("\\medspace","\\:");q("\\;","\\tmspace+{5mu}{.2777em}");q("\\thickspace","\\;");q("\\!","\\tmspace-{3mu}{.1667em}");q("\\negthinspace","\\!");q("\\negmedspace","\\tmspace-{4mu}{.2222em}");q("\\negthickspace","\\tmspace-{5mu}{.277em}");q("\\enspace","\\kern.5em ");q("\\enskip","\\hskip.5em\\relax");q("\\quad","\\hskip1em\\relax");q("\\qquad","\\hskip2em\\relax");q("\\tag","\\@ifstar\\tag@literal\\tag@paren");q("\\tag@paren","\\tag@literal{({#1})}");q("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Me("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});q("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");q("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");q("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");q("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");q("\\newline","\\\\\\relax");q("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var k7=Be(Sa["Main-Regular"][84][1]-.7*Sa["Main-Regular"][65][1]);q("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+k7+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");q("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+k7+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");q("\\hspace","\\@ifstar\\@hspacer\\@hspace");q("\\@hspace","\\hskip #1\\relax");q("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");q("\\ordinarycolon",":");q("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");q("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');q("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');q("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');q("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');q("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');q("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');q("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');q("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');q("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');q("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');q("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');q("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');q("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');q("∷","\\dblcolon");q("∹","\\eqcolon");q("≔","\\coloneqq");q("≕","\\eqqcolon");q("⩴","\\Coloneqq");q("\\ratio","\\vcentcolon");q("\\coloncolon","\\dblcolon");q("\\colonequals","\\coloneqq");q("\\coloncolonequals","\\Coloneqq");q("\\equalscolon","\\eqqcolon");q("\\equalscoloncolon","\\Eqqcolon");q("\\colonminus","\\coloneq");q("\\coloncolonminus","\\Coloneq");q("\\minuscolon","\\eqcolon");q("\\minuscoloncolon","\\Eqcolon");q("\\coloncolonapprox","\\Colonapprox");q("\\coloncolonsim","\\Colonsim");q("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");q("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");q("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");q("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");q("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");q("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");q("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");q("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");q("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");q("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");q("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");q("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");q("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");q("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");q("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");q("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");q("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");q("\\nleqq","\\html@mathml{\\@nleqq}{≰}");q("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");q("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");q("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");q("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");q("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");q("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");q("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");q("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");q("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");q("\\imath","\\html@mathml{\\@imath}{ı}");q("\\jmath","\\html@mathml{\\@jmath}{ȷ}");q("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");q("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");q("⟦","\\llbracket");q("⟧","\\rrbracket");q("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");q("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");q("⦃","\\lBrace");q("⦄","\\rBrace");q("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");q("⦵","\\minuso");q("\\darr","\\downarrow");q("\\dArr","\\Downarrow");q("\\Darr","\\Downarrow");q("\\lang","\\langle");q("\\rang","\\rangle");q("\\uarr","\\uparrow");q("\\uArr","\\Uparrow");q("\\Uarr","\\Uparrow");q("\\N","\\mathbb{N}");q("\\R","\\mathbb{R}");q("\\Z","\\mathbb{Z}");q("\\alef","\\aleph");q("\\alefsym","\\aleph");q("\\Alpha","\\mathrm{A}");q("\\Beta","\\mathrm{B}");q("\\bull","\\bullet");q("\\Chi","\\mathrm{X}");q("\\clubs","\\clubsuit");q("\\cnums","\\mathbb{C}");q("\\Complex","\\mathbb{C}");q("\\Dagger","\\ddagger");q("\\diamonds","\\diamondsuit");q("\\empty","\\emptyset");q("\\Epsilon","\\mathrm{E}");q("\\Eta","\\mathrm{H}");q("\\exist","\\exists");q("\\harr","\\leftrightarrow");q("\\hArr","\\Leftrightarrow");q("\\Harr","\\Leftrightarrow");q("\\hearts","\\heartsuit");q("\\image","\\Im");q("\\infin","\\infty");q("\\Iota","\\mathrm{I}");q("\\isin","\\in");q("\\Kappa","\\mathrm{K}");q("\\larr","\\leftarrow");q("\\lArr","\\Leftarrow");q("\\Larr","\\Leftarrow");q("\\lrarr","\\leftrightarrow");q("\\lrArr","\\Leftrightarrow");q("\\Lrarr","\\Leftrightarrow");q("\\Mu","\\mathrm{M}");q("\\natnums","\\mathbb{N}");q("\\Nu","\\mathrm{N}");q("\\Omicron","\\mathrm{O}");q("\\plusmn","\\pm");q("\\rarr","\\rightarrow");q("\\rArr","\\Rightarrow");q("\\Rarr","\\Rightarrow");q("\\real","\\Re");q("\\reals","\\mathbb{R}");q("\\Reals","\\mathbb{R}");q("\\Rho","\\mathrm{P}");q("\\sdot","\\cdot");q("\\sect","\\S");q("\\spades","\\spadesuit");q("\\sub","\\subset");q("\\sube","\\subseteq");q("\\supe","\\supseteq");q("\\Tau","\\mathrm{T}");q("\\thetasym","\\vartheta");q("\\weierp","\\wp");q("\\Zeta","\\mathrm{Z}");q("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");q("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");q("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");q("\\bra","\\mathinner{\\langle{#1}|}");q("\\ket","\\mathinner{|{#1}\\rangle}");q("\\braket","\\mathinner{\\langle{#1}\\rangle}");q("\\Bra","\\left\\langle#1\\right|");q("\\Ket","\\left|#1\\right\\rangle");var S7=e=>t=>{var n=t.consumeArg().tokens,a=t.consumeArg().tokens,s=t.consumeArg().tokens,o=t.consumeArg().tokens,c=t.macros.get("|"),d=t.macros.get("\\|");t.macros.beginGroup();var m=b=>x=>{e&&(x.macros.set("|",c),s.length&&x.macros.set("\\|",d));var y=b;if(!b&&s.length){var S=x.future();S.text==="|"&&(x.popToken(),y=!0)}return{tokens:y?s:a,numArgs:0}};t.macros.set("|",m(!1)),s.length&&t.macros.set("\\|",m(!0));var h=t.consumeArg().tokens,p=t.expandTokens([...o,...h,...n]);return t.macros.endGroup(),{tokens:p.reverse(),numArgs:0}};q("\\bra@ket",S7(!1));q("\\bra@set",S7(!0));q("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");q("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");q("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");q("\\angln","{\\angl n}");q("\\blue","\\textcolor{##6495ed}{#1}");q("\\orange","\\textcolor{##ffa500}{#1}");q("\\pink","\\textcolor{##ff00af}{#1}");q("\\red","\\textcolor{##df0030}{#1}");q("\\green","\\textcolor{##28ae7b}{#1}");q("\\gray","\\textcolor{gray}{#1}");q("\\purple","\\textcolor{##9d38bd}{#1}");q("\\blueA","\\textcolor{##ccfaff}{#1}");q("\\blueB","\\textcolor{##80f6ff}{#1}");q("\\blueC","\\textcolor{##63d9ea}{#1}");q("\\blueD","\\textcolor{##11accd}{#1}");q("\\blueE","\\textcolor{##0c7f99}{#1}");q("\\tealA","\\textcolor{##94fff5}{#1}");q("\\tealB","\\textcolor{##26edd5}{#1}");q("\\tealC","\\textcolor{##01d1c1}{#1}");q("\\tealD","\\textcolor{##01a995}{#1}");q("\\tealE","\\textcolor{##208170}{#1}");q("\\greenA","\\textcolor{##b6ffb0}{#1}");q("\\greenB","\\textcolor{##8af281}{#1}");q("\\greenC","\\textcolor{##74cf70}{#1}");q("\\greenD","\\textcolor{##1fab54}{#1}");q("\\greenE","\\textcolor{##0d923f}{#1}");q("\\goldA","\\textcolor{##ffd0a9}{#1}");q("\\goldB","\\textcolor{##ffbb71}{#1}");q("\\goldC","\\textcolor{##ff9c39}{#1}");q("\\goldD","\\textcolor{##e07d10}{#1}");q("\\goldE","\\textcolor{##a75a05}{#1}");q("\\redA","\\textcolor{##fca9a9}{#1}");q("\\redB","\\textcolor{##ff8482}{#1}");q("\\redC","\\textcolor{##f9685d}{#1}");q("\\redD","\\textcolor{##e84d39}{#1}");q("\\redE","\\textcolor{##bc2612}{#1}");q("\\maroonA","\\textcolor{##ffbde0}{#1}");q("\\maroonB","\\textcolor{##ff92c6}{#1}");q("\\maroonC","\\textcolor{##ed5fa6}{#1}");q("\\maroonD","\\textcolor{##ca337c}{#1}");q("\\maroonE","\\textcolor{##9e034e}{#1}");q("\\purpleA","\\textcolor{##ddd7ff}{#1}");q("\\purpleB","\\textcolor{##c6b9fc}{#1}");q("\\purpleC","\\textcolor{##aa87ff}{#1}");q("\\purpleD","\\textcolor{##7854ab}{#1}");q("\\purpleE","\\textcolor{##543b78}{#1}");q("\\mintA","\\textcolor{##f5f9e8}{#1}");q("\\mintB","\\textcolor{##edf2df}{#1}");q("\\mintC","\\textcolor{##e0e5cc}{#1}");q("\\grayA","\\textcolor{##f6f7f7}{#1}");q("\\grayB","\\textcolor{##f0f1f2}{#1}");q("\\grayC","\\textcolor{##e3e5e6}{#1}");q("\\grayD","\\textcolor{##d6d8da}{#1}");q("\\grayE","\\textcolor{##babec2}{#1}");q("\\grayF","\\textcolor{##888d93}{#1}");q("\\grayG","\\textcolor{##626569}{#1}");q("\\grayH","\\textcolor{##3b3e40}{#1}");q("\\grayI","\\textcolor{##21242c}{#1}");q("\\kaBlue","\\textcolor{##314453}{#1}");q("\\kaGreen","\\textcolor{##71B307}{#1}");var E7={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class m_{constructor(t,n,a){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=n,this.expansionCount=0,this.feed(t),this.macros=new u_(d_,n.macros),this.mode=a,this.stack=[]}feed(t){this.lexer=new ny(t,this.settings)}switchMode(t){this.mode=t}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(t){this.stack.push(t)}pushTokens(t){this.stack.push(...t)}scanArgument(t){var n,a,s;if(t){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:s,end:a}=this.consumeArg(["]"])}else({tokens:s,start:n,end:a}=this.consumeArg());return this.pushToken(new qr("EOF",a.loc)),this.pushTokens(s),new qr("",Tr.range(n,a))}consumeSpaces(){for(;;){var t=this.future();if(t.text===" ")this.stack.pop();else break}}consumeArg(t){var n=[],a=t&&t.length>0;a||this.consumeSpaces();var s=this.future(),o,c=0,d=0;do{if(o=this.popToken(),n.push(o),o.text==="{")++c;else if(o.text==="}"){if(--c,c===-1)throw new Me("Extra }",o)}else if(o.text==="EOF")throw new Me("Unexpected end of input in a macro argument, expected '"+(t&&a?t[d]:"}")+"'",o);if(t&&a)if((c===0||c===1&&t[d]==="{")&&o.text===t[d]){if(++d,d===t.length){n.splice(-d,d);break}}else d=0}while(c!==0||a);return s.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:s,end:o}}consumeArgs(t,n){if(n){if(n.length!==t+1)throw new Me("The length of delimiters doesn't match the number of args!");for(var a=n[0],s=0;s<a.length;s++){var o=this.popToken();if(a[s]!==o.text)throw new Me("Use of the macro doesn't match its definition",o)}}for(var c=[],d=0;d<t;d++)c.push(this.consumeArg(n&&n[d+1]).tokens);return c}countExpansion(t){if(this.expansionCount+=t,this.expansionCount>this.settings.maxExpand)throw new Me("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(t){var n=this.popToken(),a=n.text,s=n.noexpand?null:this._getExpansion(a);if(s==null||t&&s.unexpandable){if(t&&s==null&&a[0]==="\\"&&!this.isDefined(a))throw new Me("Undefined control sequence: "+a);return this.pushToken(n),!1}this.countExpansion(1);var o=s.tokens,c=this.consumeArgs(s.numArgs,s.delimiters);if(s.numArgs){o=o.slice();for(var d=o.length-1;d>=0;--d){var m=o[d];if(m.text==="#"){if(d===0)throw new Me("Incomplete placeholder at end of macro body",m);if(m=o[--d],m.text==="#")o.splice(d+1,1);else if(/^[1-9]$/.test(m.text))o.splice(d,2,...c[+m.text-1]);else throw new Me("Not a valid argument number",m)}}}return this.pushTokens(o),o.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var t=this.stack.pop();return t.treatAsRelax&&(t.text="\\relax"),t}}expandMacro(t){return this.macros.has(t)?this.expandTokens([new qr(t)]):void 0}expandTokens(t){var n=[],a=this.stack.length;for(this.pushTokens(t);this.stack.length>a;)if(this.expandOnce(!0)===!1){var s=this.stack.pop();s.treatAsRelax&&(s.noexpand=!1,s.treatAsRelax=!1),n.push(s)}return this.countExpansion(n.length),n}expandMacroAsText(t){var n=this.expandMacro(t);return n&&n.map(a=>a.text).join("")}_getExpansion(t){var n=this.macros.get(t);if(n==null)return n;if(t.length===1){var a=this.lexer.catcodes[t];if(a!=null&&a!==13)return}var s=typeof n=="function"?n(this):n;if(typeof s=="string"){var o=0;if(s.includes("#"))for(var c=s.replace(/##/g,"");c.includes("#"+(o+1));)++o;for(var d=new ny(s,this.settings),m=[],h=d.lex();h.text!=="EOF";)m.push(h),h=d.lex();m.reverse();var p={tokens:m,numArgs:o};return p}return s}isDefined(t){return this.macros.has(t)||zi.hasOwnProperty(t)||vn.math.hasOwnProperty(t)||vn.text.hasOwnProperty(t)||E7.hasOwnProperty(t)}isExpandable(t){var n=this.macros.get(t);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:zi.hasOwnProperty(t)&&!zi[t].primitive}}var iy=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Nu=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),Mm={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},sy={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Od{constructor(t,n){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new m_(t,n,this.mode),this.settings=n,this.leftrightDepth=0,this.nextToken=null}expect(t,n){if(n===void 0&&(n=!0),this.fetch().text!==t)throw new Me("Expected '"+t+"', got '"+this.fetch().text+"'",this.fetch());n&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(t){this.mode=t,this.gullet.switchMode(t)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var t=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),t}finally{this.gullet.endGroups()}}subparse(t){var n=this.nextToken;this.consume(),this.gullet.pushToken(new qr("}")),this.gullet.pushTokens(t);var a=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,a}parseExpression(t,n){for(var a=[];;){this.mode==="math"&&this.consumeSpaces();var s=this.fetch();if(Od.endOfExpression.has(s.text)||n&&s.text===n||t&&zi[s.text]&&zi[s.text].infix)break;var o=this.parseAtom(n);if(o){if(o.type==="internal")continue}else break;a.push(o)}return this.mode==="text"&&this.formLigatures(a),this.handleInfixNodes(a)}handleInfixNodes(t){for(var n=-1,a,s=0;s<t.length;s++){var o=t[s];if(o.type==="infix"){if(n!==-1)throw new Me("only one infix operator per group",o.token);n=s,a=o.replaceWith}}if(n!==-1&&a){var c,d,m=t.slice(0,n),h=t.slice(n+1);m.length===1&&m[0].type==="ordgroup"?c=m[0]:c={type:"ordgroup",mode:this.mode,body:m},h.length===1&&h[0].type==="ordgroup"?d=h[0]:d={type:"ordgroup",mode:this.mode,body:h};var p;return a==="\\\\abovefrac"?p=this.callFunction(a,[c,t[n],d],[]):p=this.callFunction(a,[c,d],[]),[p]}else return t}handleSupSubscript(t){var n=this.fetch(),a=n.text;this.consume(),this.consumeSpaces();var s;do{var o;s=this.parseGroup(t)}while(((o=s)==null?void 0:o.type)==="internal");if(!s)throw new Me("Expected group after '"+a+"'",n);return s}formatUnsupportedCmd(t){for(var n=[],a=0;a<t.length;a++)n.push({type:"textord",mode:"text",text:t[a]});var s={type:"text",mode:this.mode,body:n},o={type:"color",mode:this.mode,color:this.settings.errorColor,body:[s]};return o}parseAtom(t){var n=this.parseGroup("atom",t);if(n?.type==="internal"||this.mode==="text")return n;for(var a,s;;){this.consumeSpaces();var o=this.fetch();if(o.text==="\\limits"||o.text==="\\nolimits"){if(n&&n.type==="op"){var c=o.text==="\\limits";n.limits=c,n.alwaysHandleSupSub=!0}else if(n&&n.type==="operatorname")n.alwaysHandleSupSub&&(n.limits=o.text==="\\limits");else throw new Me("Limit controls must follow a math operator",o);this.consume()}else if(o.text==="^"){if(a)throw new Me("Double superscript",o);a=this.handleSupSubscript("superscript")}else if(o.text==="_"){if(s)throw new Me("Double subscript",o);s=this.handleSupSubscript("subscript")}else if(o.text==="'"){if(a)throw new Me("Double superscript",o);var d={type:"textord",mode:this.mode,text:"\\prime"},m=[d];for(this.consume();this.fetch().text==="'";)m.push(d),this.consume();this.fetch().text==="^"&&m.push(this.handleSupSubscript("superscript")),a={type:"ordgroup",mode:this.mode,body:m}}else if(Nu[o.text]){var h=iy.test(o.text),p=[];for(p.push(new qr(Nu[o.text])),this.consume();;){var b=this.fetch().text;if(!Nu[b]||iy.test(b)!==h)break;p.unshift(new qr(Nu[b])),this.consume()}var x=this.subparse(p);h?s={type:"ordgroup",mode:"math",body:x}:a={type:"ordgroup",mode:"math",body:x}}else break}return a||s?{type:"supsub",mode:this.mode,base:n,sup:a,sub:s}:n}parseFunction(t,n){var a=this.fetch(),s=a.text,o=zi[s];if(!o)return null;if(this.consume(),n&&n!=="atom"&&!o.allowedInArgument)throw new Me("Got function '"+s+"' with no arguments"+(n?" as "+n:""),a);if(this.mode==="text"&&!o.allowedInText)throw new Me("Can't use function '"+s+"' in text mode",a);if(this.mode==="math"&&o.allowedInMath===!1)throw new Me("Can't use function '"+s+"' in math mode",a);var{args:c,optArgs:d}=this.parseArguments(s,o);return this.callFunction(s,c,d,a,t)}callFunction(t,n,a,s,o){var c={funcName:t,parser:this,token:s,breakOnTokenText:o},d=zi[t];if(d&&d.handler)return d.handler(c,n,a);throw new Me("No function handler for "+t)}parseArguments(t,n){var a=n.numArgs+n.numOptionalArgs;if(a===0)return{args:[],optArgs:[]};for(var s=[],o=[],c=0;c<a;c++){var d=n.argTypes&&n.argTypes[c],m=c<n.numOptionalArgs;("primitive"in n&&n.primitive&&d==null||n.type==="sqrt"&&c===1&&o[0]==null)&&(d="primitive");var h=this.parseGroupOfType("argument to '"+t+"'",d,m);if(m)o.push(h);else if(h!=null)s.push(h);else throw new Me("Null argument, please report this as a bug")}return{args:s,optArgs:o}}parseGroupOfType(t,n,a){switch(n){case"color":return this.parseColorGroup(a);case"size":return this.parseSizeGroup(a);case"url":return this.parseUrlGroup(a);case"math":case"text":return this.parseArgumentGroup(a,n);case"hbox":{var s=this.parseArgumentGroup(a,"text");return s!=null?{type:"styling",mode:s.mode,body:[s],style:"text",resetFont:!0}:null}case"raw":{var o=this.parseStringGroup("raw",a);return o!=null?{type:"raw",mode:"text",string:o.text}:null}case"primitive":{if(a)throw new Me("A primitive argument cannot be optional");var c=this.parseGroup(t);if(c==null)throw new Me("Expected group as "+t,this.fetch());return c}case"original":case null:case void 0:return this.parseArgumentGroup(a);default:throw new Me("Unknown group type as "+t,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(t,n){var a=this.gullet.scanArgument(n);if(a==null)return null;for(var s="",o;(o=this.fetch()).text!=="EOF";)s+=o.text,this.consume();return this.consume(),a.text=s,a}parseRegexGroup(t,n){for(var a=this.fetch(),s=a,o="",c;(c=this.fetch()).text!=="EOF"&&t.test(o+c.text);)s=c,o+=s.text,this.consume();if(o==="")throw new Me("Invalid "+n+": '"+a.text+"'",a);return a.range(s,o)}parseColorGroup(t){var n=this.parseStringGroup("color",t);if(n==null)return null;var a=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(n.text);if(!a)throw new Me("Invalid color: '"+n.text+"'",n);var s=a[0];return/^[0-9a-f]{6}$/i.test(s)&&(s="#"+s),{type:"color-token",mode:this.mode,color:s}}parseSizeGroup(t){var n,a=!1;if(this.gullet.consumeSpaces(),!t&&this.gullet.future().text!=="{"?n=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):n=this.parseStringGroup("size",t),!n)return null;!t&&n.text.length===0&&(n.text="0pt",a=!0);var s=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n.text);if(!s)throw new Me("Invalid size: '"+n.text+"'",n);var o={number:+(s[1]+s[2]),unit:s[3]};if(!_6(o))throw new Me("Invalid unit: '"+o.unit+"'",n);return{type:"size",mode:this.mode,value:o,isBlank:a}}parseUrlGroup(t){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var n=this.parseStringGroup("url",t);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),n==null)return null;var a=n.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:a}}parseArgumentGroup(t,n){var a=this.gullet.scanArgument(t);if(a==null)return null;var s=this.mode;n&&this.switchMode(n),this.gullet.beginGroup();var o=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var c={type:"ordgroup",mode:this.mode,loc:a.loc,body:o};return n&&this.switchMode(s),c}parseGroup(t,n){var a=this.fetch(),s=a.text,o;if(s==="{"||s==="\\begingroup"){this.consume();var c=s==="{"?"}":"\\endgroup";this.gullet.beginGroup();var d=this.parseExpression(!1,c),m=this.fetch();this.expect(c),this.gullet.endGroup(),o={type:"ordgroup",mode:this.mode,loc:Tr.range(a,m),body:d,semisimple:s==="\\begingroup"||void 0}}else if(o=this.parseFunction(n,t)||this.parseSymbol(),o==null&&s[0]==="\\"&&!E7.hasOwnProperty(s)){if(this.settings.throwOnError)throw new Me("Undefined control sequence: "+s,a);o=this.formatUnsupportedCmd(s),this.consume()}return o}formLigatures(t){for(var n=t.length-1,a=0;a<n;++a){var s=t[a];if(s.type==="textord"){var o=s.text,c=t[a+1];if(!(!c||c.type!=="textord")){if(o==="-"&&c.text==="-"){var d=t[a+2];a+1<n&&d&&d.type==="textord"&&d.text==="-"?(t.splice(a,3,{type:"textord",mode:"text",loc:Tr.range(s,d),text:"---"}),n-=2):(t.splice(a,2,{type:"textord",mode:"text",loc:Tr.range(s,c),text:"--"}),n-=1)}(o==="'"||o==="`")&&c.text===o&&(t.splice(a,2,{type:"textord",mode:"text",loc:Tr.range(s,c),text:o+o}),n-=1)}}}}parseSymbol(){var t=this.fetch(),n=t.text;if(/^\\verb[^a-zA-Z]/.test(n)){this.consume();var a=n.slice(5),s=a.charAt(0)==="*";if(s&&(a=a.slice(1)),a.length<2||a.charAt(0)!==a.slice(-1))throw new Me(`\\verb assertion failed --
|
|
307
|
-
please report what input caused this bug`);return a=a.slice(1,-1),{type:"verb",mode:"text",body:a,star:s}}sy.hasOwnProperty(n[0])&&!vn[this.mode][n[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+n[0]+'" used in math mode',t),n=sy[n[0]]+n.slice(1));var o=l_.exec(n);o&&(n=n.substring(0,o.index),n==="i"?n="ı":n==="j"&&(n="ȷ"));var c;if(vn[this.mode][n]){this.settings.strict&&this.mode==="math"&&s1.includes(n)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',t);var d=vn[this.mode][n].group,m=Tr.range(t),h;AI(d)?h={type:"atom",mode:this.mode,family:d,loc:m,text:n}:h={type:d,mode:this.mode,loc:m,text:n},c=h}else if(n.charCodeAt(0)>=128)this.settings.strict&&(I6(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),t)),c={type:"textord",mode:"text",loc:Tr.range(t),text:n};else return null;if(this.consume(),o)for(var p=0;p<o[0].length;p++){var b=o[0][p];if(!Mm[b])throw new Me("Unknown accent ' "+b+"'",t);var x=Mm[b][this.mode]||Mm[b].text;if(!x)throw new Me("Accent "+b+" unsupported in "+this.mode+" mode",t);c={type:"accent",mode:this.mode,loc:Tr.range(t),label:x,isStretchy:!1,isShifty:!0,base:c}}return c}}Od.endOfExpression=new Set(["}","\\endgroup","\\end","\\right","&"]);var Sp=function(t,n){if(!(typeof t=="string"||t instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var a=new Od(t,n);delete a.gullet.macros.current["\\df@tag"];var s=a.parse();if(delete a.gullet.macros.current["\\current@color"],delete a.gullet.macros.current["\\color"],a.gullet.macros.get("\\df@tag")){if(!n.displayMode)throw new Me("\\tag works only in display equations");s=[{type:"tag",mode:"text",body:s,tag:a.subparse([new qr("\\df@tag")])}]}return s},Ep=function(t,n,a){n.textContent="";var s=Dd(t,a).toNode();n.appendChild(s)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),Ep=function(){throw new Me("KaTeX doesn't work in quirks mode.")});var T7=function(t,n){var a=Dd(t,n).toMarkup();return a},C7=function(t,n){var a=new cp(n);return Sp(t,a)},R7=function(t,n,a){if(a.throwOnError||!(t instanceof Me))throw t;var s=Ie(["katex-error"],[new Hr(n)]);return s.setAttribute("title",t.toString()),s.setAttribute("style","color:"+a.errorColor),s},Dd=function(t,n){var a=new cp(n);try{var s=Sp(t,a);return wI(s,t,a)}catch(o){return R7(o,t,a)}},N7=function(t,n){var a=new cp(n);try{var s=Sp(t,a);return kI(s,t,a)}catch(o){return R7(o,t,a)}},A7="0.16.47",I7={Span:So,Anchor:wd,SymbolNode:Hr,SvgNode:ei,PathNode:Ui,LineNode:i1},w1={version:A7,render:Ep,renderToString:T7,ParseError:Me,SETTINGS_SCHEMA:nd,__parse:C7,__renderToDomTree:Dd,__renderToHTMLTree:N7,__setFontMetrics:j6,__defineSymbol:k,__defineFunction:Ge,__defineMacro:q,__domTree:I7};const nz=Object.freeze(Object.defineProperty({__proto__:null,ParseError:Me,SETTINGS_SCHEMA:nd,__defineFunction:Ge,__defineMacro:q,__defineSymbol:k,__domTree:I7,__parse:C7,__renderToDomTree:Dd,__renderToHTMLTree:N7,__setFontMetrics:j6,default:w1,get render(){return Ep},renderToString:T7,version:A7},Symbol.toStringTag,{value:"Module"})),h_={};function p_(e){const t=this,n=e||h_,a=t.data(),s=a.micromarkExtensions||(a.micromarkExtensions=[]),o=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),c=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);s.push(kA(n)),o.push(hA()),c.push(pA(n))}const oy=/[#.]/g;function g_(e,t){const n=e||"",a={};let s=0,o,c;for(;s<n.length;){oy.lastIndex=s;const d=oy.exec(n),m=n.slice(s,d?d.index:n.length);m&&(o?o==="#"?a.id=m:Array.isArray(a.className)?a.className.push(m):a.className=[m]:c=m,s+=m.length),d&&(o=d[0],s++)}return{type:"element",tagName:c||t||"div",properties:a,children:[]}}function _7(e,t,n){const a=n?x_(n):void 0;function s(o,c,...d){let m;if(o==null){m={type:"root",children:[]};const h=c;d.unshift(h)}else{m=g_(o,t);const h=m.tagName.toLowerCase(),p=a?a.get(h):void 0;if(m.tagName=p||h,b_(c))d.unshift(c);else for(const[b,x]of Object.entries(c))v_(e,m.properties,b,x)}for(const h of d)k1(m.children,h);return m.type==="element"&&m.tagName==="template"&&(m.content={type:"root",children:m.children},m.children=[]),m}return s}function b_(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 s=t[a];if(s&&typeof s=="object"){if(!Array.isArray(s))return!0;const o=s;for(const c of o)if(typeof c!="number"&&typeof c!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function v_(e,t,n,a){const s=A5(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"?s.spaceSeparated?o=Lb(a):s.commaSeparated?o=_b(a):s.commaOrSpaceSeparated?o=Lb(_b(a).join(" ")):o=ly(s,s.property,a):Array.isArray(a)?o=[...a]:o=s.property==="style"?y_(a):String(a);if(Array.isArray(o)){const c=[];for(const d of o)c.push(ly(s,s.property,d));o=c}s.property==="className"&&Array.isArray(t.className)&&(o=t.className.concat(o)),t[s.property]=o}}function k1(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)k1(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?k1(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function ly(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Ul(n)===Ul(t)))return!0}return n}function y_(e){const t=[];for(const[n,a]of Object.entries(e))t.push([n,a].join(": "));return t.join("; ")}function x_(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const w_=["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"],k_=_7(I5,"div"),S_=_7(gd,"g",w_),Om={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function E_(e,t){return M7(e,{})||{type:"root",children:[]}}function M7(e,t){const n=T_(e,t);return n&&t.afterTransform&&t.afterTransform(e,n),n}function T_(e,t){switch(e.nodeType){case 1:return A_(e,t);case 3:return R_(e);case 8:return N_(e);case 9:return cy(e,t);case 10:return C_();case 11:return cy(e,t);default:return}}function cy(e,t){return{type:"root",children:O7(e,t)}}function C_(){return{type:"doctype"}}function R_(e){return{type:"text",value:e.nodeValue||""}}function N_(e){return{type:"comment",value:e.nodeValue||""}}function A_(e,t){const n=e.namespaceURI,a=n===Om.svg?S_:k_,s=n===Om.html?e.tagName.toLowerCase():e.tagName,o=n===Om.html&&s==="template"?e.content:e,c=e.getAttributeNames(),d={};let m=-1;for(;++m<c.length;)d[c[m]]=e.getAttribute(c[m])||"";return a(s,d,O7(o,t))}function O7(e,t){const n=e.childNodes,a=[];let s=-1;for(;++s<n.length;){const o=M7(n[s],t);o!==void 0&&a.push(o)}return a}new DOMParser;function I_(e,t){const n=__(e);return E_(n)}function __(e){const t=document.createElement("template");return t.innerHTML=e,t.content}const uy=(function(e,t,n){const a=Ql(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]}),Ns=(function(e){if(e==null)return D_;if(typeof e=="string")return O_(e);if(typeof e=="object")return M_(e);if(typeof e=="function")return Tp(e);throw new Error("Expected function, string, or array as `test`")});function M_(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Ns(e[n]);return Tp(a);function a(...s){let o=-1;for(;++o<t.length;)if(t[o].apply(this,s))return!0;return!1}}function O_(e){return Tp(t);function t(n){return n.tagName===e}}function Tp(e){return t;function t(n,a,s){return!!(j_(n)&&e.call(this,n,typeof a=="number"?a:void 0,s||void 0))}}function D_(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function j_(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const dy=/\n/g,fy=/[\t ]+/g,S1=Ns("br"),my=Ns($_),L_=Ns("p"),hy=Ns("tr"),z_=Ns(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",F_,P_]),D7=Ns(["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 B_(e,t){const n=t||{},a="children"in e?e.children:[],s=D7(e),o=z7(e,{whitespace:n.whitespace||"normal"}),c=[];(e.type==="text"||e.type==="comment")&&c.push(...L7(e,{breakBefore:!0,breakAfter:!0}));let d=-1;for(;++d<a.length;)c.push(...j7(a[d],e,{whitespace:o,breakBefore:d?void 0:s,breakAfter:d<a.length-1?S1(a[d+1]):s}));const m=[];let h;for(d=-1;++d<c.length;){const p=c[d];typeof p=="number"?h!==void 0&&p>h&&(h=p):p&&(h!==void 0&&h>-1&&m.push(`
|
|
308
|
-
`.repeat(h)||" "),h=-1,m.push(p))}return m.join("")}function j7(e,t,n){return e.type==="element"?q_(e,t,n):e.type==="text"?n.whitespace==="normal"?L7(e,n):H_(e):[]}function q_(e,t,n){const a=z7(e,n),s=e.children||[];let o=-1,c=[];if(z_(e))return c;let d,m;for(S1(e)||hy(e)&&uy(t,e,hy)?m=`
|
|
309
|
-
`:L_(e)?(d=2,m=2):D7(e)&&(d=1,m=1);++o<s.length;)c=c.concat(j7(s[o],e,{whitespace:a,breakBefore:o?void 0:d,breakAfter:o<s.length-1?S1(s[o+1]):m}));return my(e)&&uy(t,e,my)&&c.push(" "),d&&c.unshift(d),m&&c.push(m),c}function L7(e,t){const n=String(e.value),a=[],s=[];let o=0;for(;o<=n.length;){dy.lastIndex=o;const m=dy.exec(n),h=m&&"index"in m?m.index:n.length;a.push(U_(n.slice(o,h).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),o===0?t.breakBefore:!0,h===n.length?t.breakAfter:!0)),o=h+1}let c=-1,d;for(;++c<a.length;)a[c].charCodeAt(a[c].length-1)===8203||c<a.length-1&&a[c+1].charCodeAt(0)===8203?(s.push(a[c]),d=void 0):a[c]?(typeof d=="number"&&s.push(d),s.push(a[c]),d=0):(c===0||c===a.length-1)&&s.push(0);return s}function H_(e){return[String(e.value)]}function U_(e,t,n){const a=[];let s=0,o;for(;s<e.length;){fy.lastIndex=s;const c=fy.exec(e);o=c?c.index:e.length,!s&&!o&&c&&!t&&a.push(""),s!==o&&a.push(e.slice(s,o)),s=c?o+c[0].length:o}return s!==o&&!n&&a.push(""),a.join(" ")}function z7(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 F_(e){return!!(e.properties||{}).hidden}function $_(e){return e.tagName==="td"||e.tagName==="th"}function P_(e){return e.tagName==="dialog"&&!(e.properties||{}).open}const G_={},V_=[];function K_(e){const t=e||G_;return function(n,a){rp(n,"element",function(s,o){const c=Array.isArray(s.properties.className)?s.properties.className:V_,d=c.includes("language-math"),m=c.includes("math-display"),h=c.includes("math-inline");let p=m;if(!d&&!m&&!h)return;let b=o[o.length-1],x=s;if(s.tagName==="code"&&d&&b&&b.type==="element"&&b.tagName==="pre"&&(x=b,b=o[o.length-2],p=!0),!b)return;const y=B_(x,{whitespace:"pre"});let S;try{S=w1.renderToString(y,{...t,displayMode:p,throwOnError:!0})}catch(A){const C=A,M=C.name.toLowerCase();a.message("Could not render math with KaTeX",{ancestors:[...o,s],cause:C,place:s.position,ruleId:M,source:"rehype-katex"});try{S=w1.renderToString(y,{...t,displayMode:p,strict:"ignore",throwOnError:!1})}catch{S=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(t.errorColor||"#cc0000"),title:String(A)},children:[{type:"text",value:y}]}]}}typeof S=="string"&&(S=I_(S).children);const T=b.children.indexOf(x);return b.children.splice(T,1,...S),a6})}}var Dm,py;function Y_(){if(py)return Dm;py=1;function e(Q){return Q instanceof Map?Q.clear=Q.delete=Q.set=function(){throw new Error("map is read-only")}:Q instanceof Set&&(Q.add=Q.clear=Q.delete=function(){throw new Error("set is read-only")}),Object.freeze(Q),Object.getOwnPropertyNames(Q).forEach(ke=>{const qe=Q[ke],et=typeof qe;(et==="object"||et==="function")&&!Object.isFrozen(qe)&&e(qe)}),Q}class t{constructor(ke){ke.data===void 0&&(ke.data={}),this.data=ke.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(Q){return Q.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function a(Q,...ke){const qe=Object.create(null);for(const et in Q)qe[et]=Q[et];return ke.forEach(function(et){for(const St in et)qe[St]=et[St]}),qe}const s="</span>",o=Q=>!!Q.scope,c=(Q,{prefix:ke})=>{if(Q.startsWith("language:"))return Q.replace("language:","language-");if(Q.includes(".")){const qe=Q.split(".");return[`${ke}${qe.shift()}`,...qe.map((et,St)=>`${et}${"_".repeat(St+1)}`)].join(" ")}return`${ke}${Q}`};class d{constructor(ke,qe){this.buffer="",this.classPrefix=qe.classPrefix,ke.walk(this)}addText(ke){this.buffer+=n(ke)}openNode(ke){if(!o(ke))return;const qe=c(ke.scope,{prefix:this.classPrefix});this.span(qe)}closeNode(ke){o(ke)&&(this.buffer+=s)}value(){return this.buffer}span(ke){this.buffer+=`<span class="${ke}">`}}const m=(Q={})=>{const ke={children:[]};return Object.assign(ke,Q),ke};class h{constructor(){this.rootNode=m(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(ke){this.top.children.push(ke)}openNode(ke){const qe=m({scope:ke});this.add(qe),this.stack.push(qe)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(ke){return this.constructor._walk(ke,this.rootNode)}static _walk(ke,qe){return typeof qe=="string"?ke.addText(qe):qe.children&&(ke.openNode(qe),qe.children.forEach(et=>this._walk(ke,et)),ke.closeNode(qe)),ke}static _collapse(ke){typeof ke!="string"&&ke.children&&(ke.children.every(qe=>typeof qe=="string")?ke.children=[ke.children.join("")]:ke.children.forEach(qe=>{h._collapse(qe)}))}}class p extends h{constructor(ke){super(),this.options=ke}addText(ke){ke!==""&&this.add(ke)}startScope(ke){this.openNode(ke)}endScope(){this.closeNode()}__addSublanguage(ke,qe){const et=ke.root;qe&&(et.scope=`language:${qe}`),this.add(et)}toHTML(){return new d(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function b(Q){return Q?typeof Q=="string"?Q:Q.source:null}function x(Q){return T("(?=",Q,")")}function y(Q){return T("(?:",Q,")*")}function S(Q){return T("(?:",Q,")?")}function T(...Q){return Q.map(qe=>b(qe)).join("")}function A(Q){const ke=Q[Q.length-1];return typeof ke=="object"&&ke.constructor===Object?(Q.splice(Q.length-1,1),ke):{}}function C(...Q){return"("+(A(Q).capture?"":"?:")+Q.map(et=>b(et)).join("|")+")"}function M(Q){return new RegExp(Q.toString()+"|").exec("").length-1}function I(Q,ke){const qe=Q&&Q.exec(ke);return qe&&qe.index===0}const P=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function U(Q,{joinWith:ke}){let qe=0;return Q.map(et=>{qe+=1;const St=qe;let jt=b(et),Ke="";for(;jt.length>0;){const Pe=P.exec(jt);if(!Pe){Ke+=jt;break}Ke+=jt.substring(0,Pe.index),jt=jt.substring(Pe.index+Pe[0].length),Pe[0][0]==="\\"&&Pe[1]?Ke+="\\"+String(Number(Pe[1])+St):(Ke+=Pe[0],Pe[0]==="("&&qe++)}return Ke}).map(et=>`(${et})`).join(ke)}const N=/\b\B/,z="[a-zA-Z]\\w*",X="[a-zA-Z_]\\w*",B="\\b\\d+(\\.\\d+)?",$="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",F="\\b(0b[01]+)",K="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",oe=(Q={})=>{const ke=/^#![ ]*\//;return Q.binary&&(Q.begin=T(ke,/.*\b/,Q.binary,/\b.*/)),a({scope:"meta",begin:ke,end:/$/,relevance:0,"on:begin":(qe,et)=>{qe.index!==0&&et.ignoreMatch()}},Q)},J={begin:"\\\\[\\s\\S]",relevance:0},H={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[J]},_={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[J]},Y={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},re=function(Q,ke,qe={}){const et=a({scope:"comment",begin:Q,end:ke,contains:[]},qe);et.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const St=C("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return et.contains.push({begin:T(/[ ]+/,"(",St,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),et},fe=re("//","$"),j=re("/\\*","\\*/"),G=re("#","$"),W={scope:"number",begin:B,relevance:0},O={scope:"number",begin:$,relevance:0},be={scope:"number",begin:F,relevance:0},se={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[J,{begin:/\[/,end:/\]/,relevance:0,contains:[J]}]},V={scope:"title",begin:z,relevance:0},Z={scope:"title",begin:X,relevance:0},ne={begin:"\\.\\s*"+X,relevance:0};var he=Object.freeze({__proto__:null,APOS_STRING_MODE:H,BACKSLASH_ESCAPE:J,BINARY_NUMBER_MODE:be,BINARY_NUMBER_RE:F,COMMENT:re,C_BLOCK_COMMENT_MODE:j,C_LINE_COMMENT_MODE:fe,C_NUMBER_MODE:O,C_NUMBER_RE:$,END_SAME_AS_BEGIN:function(Q){return Object.assign(Q,{"on:begin":(ke,qe)=>{qe.data._beginMatch=ke[1]},"on:end":(ke,qe)=>{qe.data._beginMatch!==ke[1]&&qe.ignoreMatch()}})},HASH_COMMENT_MODE:G,IDENT_RE:z,MATCH_NOTHING_RE:N,METHOD_GUARD:ne,NUMBER_MODE:W,NUMBER_RE:B,PHRASAL_WORDS_MODE:Y,QUOTE_STRING_MODE:_,REGEXP_MODE:se,RE_STARTERS_RE:K,SHEBANG:oe,TITLE_MODE:V,UNDERSCORE_IDENT_RE:X,UNDERSCORE_TITLE_MODE:Z});function Re(Q,ke){Q.input[Q.index-1]==="."&&ke.ignoreMatch()}function Le(Q,ke){Q.className!==void 0&&(Q.scope=Q.className,delete Q.className)}function Ye(Q,ke){ke&&Q.beginKeywords&&(Q.begin="\\b("+Q.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",Q.__beforeBegin=Re,Q.keywords=Q.keywords||Q.beginKeywords,delete Q.beginKeywords,Q.relevance===void 0&&(Q.relevance=0))}function ut(Q,ke){Array.isArray(Q.illegal)&&(Q.illegal=C(...Q.illegal))}function pt(Q,ke){if(Q.match){if(Q.begin||Q.end)throw new Error("begin & end are not supported with match");Q.begin=Q.match,delete Q.match}}function Rt(Q,ke){Q.relevance===void 0&&(Q.relevance=1)}const Ht=(Q,ke)=>{if(!Q.beforeMatch)return;if(Q.starts)throw new Error("beforeMatch cannot be used with starts");const qe=Object.assign({},Q);Object.keys(Q).forEach(et=>{delete Q[et]}),Q.keywords=qe.keywords,Q.begin=T(qe.beforeMatch,x(qe.begin)),Q.starts={relevance:0,contains:[Object.assign(qe,{endsParent:!0})]},Q.relevance=0,delete qe.beforeMatch},at=["of","and","for","in","not","or","if","then","parent","list","value"],Mt="keyword";function ft(Q,ke,qe=Mt){const et=Object.create(null);return typeof Q=="string"?St(qe,Q.split(" ")):Array.isArray(Q)?St(qe,Q):Object.keys(Q).forEach(function(jt){Object.assign(et,ft(Q[jt],ke,jt))}),et;function St(jt,Ke){ke&&(Ke=Ke.map(Pe=>Pe.toLowerCase())),Ke.forEach(function(Pe){const it=Pe.split("|");et[it[0]]=[jt,Ut(it[0],it[1])]})}}function Ut(Q,ke){return ke?Number(ke):ze(Q)?0:1}function ze(Q){return at.includes(Q.toLowerCase())}const Qe={},Ue=Q=>{console.error(Q)},mt=(Q,...ke)=>{console.log(`WARN: ${Q}`,...ke)},pe=(Q,ke)=>{Qe[`${Q}/${ke}`]||(console.log(`Deprecated as of ${Q}. ${ke}`),Qe[`${Q}/${ke}`]=!0)},me=new Error;function He(Q,ke,{key:qe}){let et=0;const St=Q[qe],jt={},Ke={};for(let Pe=1;Pe<=ke.length;Pe++)Ke[Pe+et]=St[Pe],jt[Pe+et]=!0,et+=M(ke[Pe-1]);Q[qe]=Ke,Q[qe]._emit=jt,Q[qe]._multi=!0}function we(Q){if(Array.isArray(Q.begin)){if(Q.skip||Q.excludeBegin||Q.returnBegin)throw Ue("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),me;if(typeof Q.beginScope!="object"||Q.beginScope===null)throw Ue("beginScope must be object"),me;He(Q,Q.begin,{key:"beginScope"}),Q.begin=U(Q.begin,{joinWith:""})}}function Fe(Q){if(Array.isArray(Q.end)){if(Q.skip||Q.excludeEnd||Q.returnEnd)throw Ue("skip, excludeEnd, returnEnd not compatible with endScope: {}"),me;if(typeof Q.endScope!="object"||Q.endScope===null)throw Ue("endScope must be object"),me;He(Q,Q.end,{key:"endScope"}),Q.end=U(Q.end,{joinWith:""})}}function lt(Q){Q.scope&&typeof Q.scope=="object"&&Q.scope!==null&&(Q.beginScope=Q.scope,delete Q.scope)}function Ae(Q){lt(Q),typeof Q.beginScope=="string"&&(Q.beginScope={_wrap:Q.beginScope}),typeof Q.endScope=="string"&&(Q.endScope={_wrap:Q.endScope}),we(Q),Fe(Q)}function Kt(Q){function ke(Ke,Pe){return new RegExp(b(Ke),"m"+(Q.case_insensitive?"i":"")+(Q.unicodeRegex?"u":"")+(Pe?"g":""))}class qe{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Pe,it){it.position=this.position++,this.matchIndexes[this.matchAt]=it,this.regexes.push([it,Pe]),this.matchAt+=M(Pe)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Pe=this.regexes.map(it=>it[1]);this.matcherRe=ke(U(Pe,{joinWith:"|"}),!0),this.lastIndex=0}exec(Pe){this.matcherRe.lastIndex=this.lastIndex;const it=this.matcherRe.exec(Pe);if(!it)return null;const Xt=it.findIndex((Nr,na)=>na>0&&Nr!==void 0),Yt=this.matchIndexes[Xt];return it.splice(0,Xt),Object.assign(it,Yt)}}class et{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Pe){if(this.multiRegexes[Pe])return this.multiRegexes[Pe];const it=new qe;return this.rules.slice(Pe).forEach(([Xt,Yt])=>it.addRule(Xt,Yt)),it.compile(),this.multiRegexes[Pe]=it,it}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Pe,it){this.rules.push([Pe,it]),it.type==="begin"&&this.count++}exec(Pe){const it=this.getMatcher(this.regexIndex);it.lastIndex=this.lastIndex;let Xt=it.exec(Pe);if(this.resumingScanAtSamePosition()&&!(Xt&&Xt.index===this.lastIndex)){const Yt=this.getMatcher(0);Yt.lastIndex=this.lastIndex+1,Xt=Yt.exec(Pe)}return Xt&&(this.regexIndex+=Xt.position+1,this.regexIndex===this.count&&this.considerAll()),Xt}}function St(Ke){const Pe=new et;return Ke.contains.forEach(it=>Pe.addRule(it.begin,{rule:it,type:"begin"})),Ke.terminatorEnd&&Pe.addRule(Ke.terminatorEnd,{type:"end"}),Ke.illegal&&Pe.addRule(Ke.illegal,{type:"illegal"}),Pe}function jt(Ke,Pe){const it=Ke;if(Ke.isCompiled)return it;[Le,pt,Ae,Ht].forEach(Yt=>Yt(Ke,Pe)),Q.compilerExtensions.forEach(Yt=>Yt(Ke,Pe)),Ke.__beforeBegin=null,[Ye,ut,Rt].forEach(Yt=>Yt(Ke,Pe)),Ke.isCompiled=!0;let Xt=null;return typeof Ke.keywords=="object"&&Ke.keywords.$pattern&&(Ke.keywords=Object.assign({},Ke.keywords),Xt=Ke.keywords.$pattern,delete Ke.keywords.$pattern),Xt=Xt||/\w+/,Ke.keywords&&(Ke.keywords=ft(Ke.keywords,Q.case_insensitive)),it.keywordPatternRe=ke(Xt,!0),Pe&&(Ke.begin||(Ke.begin=/\B|\b/),it.beginRe=ke(it.begin),!Ke.end&&!Ke.endsWithParent&&(Ke.end=/\B|\b/),Ke.end&&(it.endRe=ke(it.end)),it.terminatorEnd=b(it.end)||"",Ke.endsWithParent&&Pe.terminatorEnd&&(it.terminatorEnd+=(Ke.end?"|":"")+Pe.terminatorEnd)),Ke.illegal&&(it.illegalRe=ke(Ke.illegal)),Ke.contains||(Ke.contains=[]),Ke.contains=[].concat(...Ke.contains.map(function(Yt){return _t(Yt==="self"?Ke:Yt)})),Ke.contains.forEach(function(Yt){jt(Yt,it)}),Ke.starts&&jt(Ke.starts,Pe),it.matcher=St(it),it}if(Q.compilerExtensions||(Q.compilerExtensions=[]),Q.contains&&Q.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return Q.classNameAliases=a(Q.classNameAliases||{}),jt(Q)}function gt(Q){return Q?Q.endsWithParent||gt(Q.starts):!1}function _t(Q){return Q.variants&&!Q.cachedVariants&&(Q.cachedVariants=Q.variants.map(function(ke){return a(Q,{variants:null},ke)})),Q.cachedVariants?Q.cachedVariants:gt(Q)?a(Q,{starts:Q.starts?a(Q.starts):null}):Object.isFrozen(Q)?a(Q):Q}var Tt="11.11.2";class Mn extends Error{constructor(ke,qe){super(ke),this.name="HTMLInjectionError",this.html=qe}}const pn=n,st=a,je=Symbol("nomatch"),wt=7,bt=function(Q){const ke=Object.create(null),qe=Object.create(null),et=[];let St=!0;const jt="Could not find the language '{}', did you forget to load/include a language module?",Ke={disableAutodetect:!0,name:"Plain text",contains:[]};let Pe={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:p};function it(_e){return Pe.noHighlightRe.test(_e)}function Xt(_e){let Je=_e.className+" ";Je+=_e.parentNode?_e.parentNode.className:"";const Nt=Pe.languageDetectRe.exec(Je);if(Nt){const ee=Wn(Nt[1]);return ee||(mt(jt.replace("{}",Nt[1])),mt("Falling back to no-highlight mode for this block.",_e)),ee?Nt[1]:"no-highlight"}return Je.split(/\s+/).find(ee=>it(ee)||Wn(ee))}function Yt(_e,Je,Nt){let ee="",Ee="";typeof Je=="object"?(ee=_e,Nt=Je.ignoreIllegals,Ee=Je.language):(pe("10.7.0","highlight(lang, code, ...args) has been deprecated."),pe("10.7.0",`Please use highlight(code, options) instead.
|
|
310
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),Ee=_e,ee=Je),Nt===void 0&&(Nt=!0);const vt={code:ee,language:Ee};ma("before:highlight",vt);const Lt=vt.result?vt.result:Nr(vt.language,vt.code,Nt);return Lt.code=vt.code,ma("after:highlight",Lt),Lt}function Nr(_e,Je,Nt,ee){const Ee=Object.create(null);function vt($e,Ze){return $e.keywords[Ze]}function Lt(){if(!dt.keywords){On.addText(tn);return}let $e=0;dt.keywordPatternRe.lastIndex=0;let Ze=dt.keywordPatternRe.exec(tn),Et="";for(;Ze;){Et+=tn.substring($e,Ze.index);const Ft=Zn.case_insensitive?Ze[0].toLowerCase():Ze[0],kn=vt(dt,Ft);if(kn){const[$r,No]=kn;if(On.addText(Et),Et="",Ee[Ft]=(Ee[Ft]||0)+1,Ee[Ft]<=wt&&(oi+=No),$r.startsWith("_"))Et+=Ze[0];else{const ic=Zn.classNameAliases[$r]||$r;fn(Ze[0],ic)}}else Et+=Ze[0];$e=dt.keywordPatternRe.lastIndex,Ze=dt.keywordPatternRe.exec(tn)}Et+=tn.substring($e),On.addText(Et)}function gn(){if(tn==="")return;let $e=null;if(typeof dt.subLanguage=="string"){if(!ke[dt.subLanguage]){On.addText(tn);return}$e=Nr(dt.subLanguage,tn,!0,ac[dt.subLanguage]),ac[dt.subLanguage]=$e._top}else $e=Na(tn,dt.subLanguage.length?dt.subLanguage:null);dt.relevance>0&&(oi+=$e.relevance),On.__addSublanguage($e._emitter,$e.language)}function Ot(){dt.subLanguage!=null?gn():Lt(),tn=""}function fn($e,Ze){$e!==""&&(On.startScope(Ze),On.addText($e),On.endScope())}function hr($e,Ze){let Et=1;const Ft=Ze.length-1;for(;Et<=Ft;){if(!$e._emit[Et]){Et++;continue}const kn=Zn.classNameAliases[$e[Et]]||$e[Et],$r=Ze[Et];kn?fn($r,kn):(tn=$r,Lt(),tn=""),Et++}}function pr($e,Ze){return $e.scope&&typeof $e.scope=="string"&&On.openNode(Zn.classNameAliases[$e.scope]||$e.scope),$e.beginScope&&($e.beginScope._wrap?(fn(tn,Zn.classNameAliases[$e.beginScope._wrap]||$e.beginScope._wrap),tn=""):$e.beginScope._multi&&(hr($e.beginScope,Ze),tn="")),dt=Object.create($e,{parent:{value:dt}}),dt}function sr($e,Ze,Et){let Ft=I($e.endRe,Et);if(Ft){if($e["on:end"]){const kn=new t($e);$e["on:end"](Ze,kn),kn.isMatchIgnored&&(Ft=!1)}if(Ft){for(;$e.endsParent&&$e.parent;)$e=$e.parent;return $e}}if($e.endsWithParent)return sr($e.parent,Ze,Et)}function ia($e){return dt.matcher.regexIndex===0?(tn+=$e[0],1):(li=!0,0)}function Ld($e){const Ze=$e[0],Et=$e.rule,Ft=new t(Et),kn=[Et.__beforeBegin,Et["on:begin"]];for(const $r of kn)if($r&&($r($e,Ft),Ft.isMatchIgnored))return ia(Ze);return Et.skip?tn+=Ze:(Et.excludeBegin&&(tn+=Ze),Ot(),!Et.returnBegin&&!Et.excludeBegin&&(tn=Ze)),pr(Et,$e),Et.returnBegin?0:Ze.length}function gr($e){const Ze=$e[0],Et=Je.substring($e.index),Ft=sr(dt,$e,Et);if(!Ft)return je;const kn=dt;dt.endScope&&dt.endScope._wrap?(Ot(),fn(Ze,dt.endScope._wrap)):dt.endScope&&dt.endScope._multi?(Ot(),hr(dt.endScope,$e)):kn.skip?tn+=Ze:(kn.returnEnd||kn.excludeEnd||(tn+=Ze),Ot(),kn.excludeEnd&&(tn=Ze));do dt.scope&&On.closeNode(),!dt.skip&&!dt.subLanguage&&(oi+=dt.relevance),dt=dt.parent;while(dt!==Ft.parent);return Ft.starts&&pr(Ft.starts,$e),kn.returnEnd?0:Ze.length}function Co(){const $e=[];for(let Ze=dt;Ze!==Zn;Ze=Ze.parent)Ze.scope&&$e.unshift(Ze.scope);$e.forEach(Ze=>On.openNode(Ze))}let Yi={};function _s($e,Ze){const Et=Ze&&Ze[0];if(tn+=$e,Et==null)return Ot(),0;if(Yi.type==="begin"&&Ze.type==="end"&&Yi.index===Ze.index&&Et===""){if(tn+=Je.slice(Ze.index,Ze.index+1),!St){const Ft=new Error(`0 width match regex (${_e})`);throw Ft.languageName=_e,Ft.badRule=Yi.rule,Ft}return 1}if(Yi=Ze,Ze.type==="begin")return Ld(Ze);if(Ze.type==="illegal"&&!Nt){const Ft=new Error('Illegal lexeme "'+Et+'" for mode "'+(dt.scope||"<unnamed>")+'"');throw Ft.mode=dt,Ft}else if(Ze.type==="end"){const Ft=gr(Ze);if(Ft!==je)return Ft}if(Ze.type==="illegal"&&Et==="")return Ze.index===Je.length||(tn+=`
|
|
311
|
-
`),1;if(Ro>1e5&&Ro>Ze.index*3)throw new Error("potential infinite loop, way more iterations than matches");return tn+=Et,Et.length}const Zn=Wn(_e);if(!Zn)throw Ue(jt.replace("{}",_e)),new Error('Unknown language: "'+_e+'"');const rc=Kt(Zn);let Ms="",dt=ee||rc;const ac={},On=new Pe.__emitter(Pe);Co();let tn="",oi=0,Ia=0,Ro=0,li=!1;try{if(Zn.__emitTokens)Zn.__emitTokens(Je,On);else{for(dt.matcher.considerAll();;){Ro++,li?li=!1:dt.matcher.considerAll(),dt.matcher.lastIndex=Ia;const $e=dt.matcher.exec(Je);if(!$e)break;const Ze=Je.substring(Ia,$e.index),Et=_s(Ze,$e);Ia=$e.index+Et}_s(Je.substring(Ia))}return On.finalize(),Ms=On.toHTML(),{language:_e,value:Ms,relevance:oi,illegal:!1,_emitter:On,_top:dt}}catch($e){if($e.message&&$e.message.includes("Illegal"))return{language:_e,value:pn(Je),illegal:!0,relevance:0,_illegalBy:{message:$e.message,index:Ia,context:Je.slice(Ia-100,Ia+100),mode:$e.mode,resultSoFar:Ms},_emitter:On};if(St)return{language:_e,value:pn(Je),illegal:!1,relevance:0,errorRaised:$e,_emitter:On,_top:dt};throw $e}}function na(_e){const Je={value:pn(_e),illegal:!1,relevance:0,_top:Ke,_emitter:new Pe.__emitter(Pe)};return Je._emitter.addText(_e),Je}function Na(_e,Je){Je=Je||Pe.languages||Object.keys(ke);const Nt=na(_e),ee=Je.filter(Wn).filter(ra).map(Ot=>Nr(Ot,_e,!1));ee.unshift(Nt);const Ee=ee.sort((Ot,fn)=>{if(Ot.relevance!==fn.relevance)return fn.relevance-Ot.relevance;if(Ot.language&&fn.language){if(Wn(Ot.language).supersetOf===fn.language)return 1;if(Wn(fn.language).supersetOf===Ot.language)return-1}return 0}),[vt,Lt]=Ee,gn=vt;return gn.secondBest=Lt,gn}function mr(_e,Je,Nt){const ee=Je&&qe[Je]||Nt;_e.classList.add("hljs"),_e.classList.add(`language-${ee}`)}function xn(_e){let Je=null;const Nt=Xt(_e);if(it(Nt))return;if(ma("before:highlightElement",{el:_e,language:Nt}),_e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",_e);return}if(_e.children.length>0&&(Pe.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(_e)),Pe.throwUnescapedHTML))throw new Mn("One of your code blocks includes unescaped HTML.",_e.innerHTML);Je=_e;const ee=Je.textContent,Ee=Nt?Yt(ee,{language:Nt,ignoreIllegals:!0}):Na(ee);_e.innerHTML=Ee.value,_e.dataset.highlighted="yes",mr(_e,Nt,Ee.language),_e.result={language:Ee.language,re:Ee.relevance,relevance:Ee.relevance},Ee.secondBest&&(_e.secondBest={language:Ee.secondBest.language,relevance:Ee.secondBest.relevance}),ma("after:highlightElement",{el:_e,result:Ee,text:ee})}function Kn(_e){Pe=st(Pe,_e)}const da=()=>{ii(),pe("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Aa(){ii(),pe("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let As=!1;function ii(){function _e(){ii()}if(document.readyState==="loading"){As||window.addEventListener("DOMContentLoaded",_e,!1),As=!0;return}document.querySelectorAll(Pe.cssSelector).forEach(xn)}function Is(_e,Je){let Nt=null;try{Nt=Je(Q)}catch(ee){if(Ue("Language definition for '{}' could not be registered.".replace("{}",_e)),St)Ue(ee);else throw ee;Nt=Ke}Nt.name||(Nt.name=_e),ke[_e]=Nt,Nt.rawDefinition=Je.bind(null,Q),Nt.aliases&&ir(Nt.aliases,{languageName:_e})}function fa(_e){delete ke[_e];for(const Je of Object.keys(qe))qe[Je]===_e&&delete qe[Je]}function si(){return Object.keys(ke)}function Wn(_e){return _e=(_e||"").toLowerCase(),ke[_e]||ke[qe[_e]]}function ir(_e,{languageName:Je}){typeof _e=="string"&&(_e=[_e]),_e.forEach(Nt=>{qe[Nt.toLowerCase()]=Je})}function ra(_e){const Je=Wn(_e);return Je&&!Je.disableAutodetect}function aa(_e){_e["before:highlightBlock"]&&!_e["before:highlightElement"]&&(_e["before:highlightElement"]=Je=>{_e["before:highlightBlock"](Object.assign({block:Je.el},Je))}),_e["after:highlightBlock"]&&!_e["after:highlightElement"]&&(_e["after:highlightElement"]=Je=>{_e["after:highlightBlock"](Object.assign({block:Je.el},Je))})}function wn(_e){aa(_e),et.push(_e)}function Ki(_e){const Je=et.indexOf(_e);Je!==-1&&et.splice(Je,1)}function ma(_e,Je){const Nt=_e;et.forEach(function(ee){ee[Nt]&&ee[Nt](Je)})}function Ar(_e){return pe("10.7.0","highlightBlock will be removed entirely in v12.0"),pe("10.7.0","Please use highlightElement now."),xn(_e)}Object.assign(Q,{highlight:Yt,highlightAuto:Na,highlightAll:ii,highlightElement:xn,highlightBlock:Ar,configure:Kn,initHighlighting:da,initHighlightingOnLoad:Aa,registerLanguage:Is,unregisterLanguage:fa,listLanguages:si,getLanguage:Wn,registerAliases:ir,autoDetection:ra,inherit:st,addPlugin:wn,removePlugin:Ki}),Q.debugMode=function(){St=!1},Q.safeMode=function(){St=!0},Q.versionString=Tt,Q.regex={concat:T,lookahead:x,either:C,optional:S,anyNumberOfTimes:y};for(const _e in he)typeof he[_e]=="object"&&e(he[_e]);return Object.assign(Q,he),Q},Gt=bt({});return Gt.newInstance=()=>bt({}),Dm=Gt,Gt.HighlightJS=Gt,Gt.default=Gt,Dm}var jm,gy;function W_(){if(gy)return jm;gy=1;function e(t){const n=t.regex,a=n.concat(/[\p{L}_]/u,n.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),s=/[\p{L}0-9._:-]+/u,o={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},c={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},d=t.inherit(c,{begin:/\(/,end:/\)/}),m=t.inherit(t.APOS_STRING_MODE,{className:"string"}),h=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),p={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:s,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[o]},{begin:/'/,end:/'/,contains:[o]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[c,h,m,d,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[c,d,h,m]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},o,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[h]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[p],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[p],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:n.concat(/</,n.lookahead(n.concat(a,n.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:a,relevance:0,starts:p}]},{className:"tag",begin:n.concat(/<\//,n.lookahead(n.concat(a,/>/))),contains:[{className:"name",begin:a,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}return jm=e,jm}var Lm,by;function Z_(){if(by)return Lm;by=1;function e(t){const n=t.regex,a={},s={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[a]}]};Object.assign(a,{className:"variable",variants:[{begin:n.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},s]});const o={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},c=t.inherit(t.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),d={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},m={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,a,o]};o.contains.push(m);const h={match:/\\"/},p={className:"string",begin:/'/,end:/'/},b={match:/\\'/},x={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,a]},y=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],S=t.SHEBANG({binary:`(${y.join("|")})`,relevance:10}),T={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},A=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],C=["true","false"],M={match:/(\/[a-z._-]+)+/},I=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],P=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],U=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],N=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:A,literal:C,built_in:[...I,...P,"set","shopt",...U,...N]},contains:[S,t.SHEBANG(),T,x,c,d,M,m,h,p,b,a]}}return Lm=e,Lm}var zm,vy;function X_(){if(vy)return zm;vy=1;function e(t){const n=t.regex,a=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),s="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",d="("+s+"|"+n.optional(o)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",m={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},p={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},b={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},x={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(p,{className:"string"}),{className:"string",begin:/<.*?>/},a,t.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:n.optional(o)+t.IDENT_RE,relevance:0},S=n.optional(o)+t.IDENT_RE+"\\s*\\(",C={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},M=[x,m,a,t.C_BLOCK_COMMENT_MODE,b,p],I={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:C,contains:M.concat([{begin:/\(/,end:/\)/,keywords:C,contains:M.concat(["self"]),relevance:0}]),relevance:0},P={begin:"("+d+"[\\*&\\s]+)+"+S,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:C,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:s,keywords:C,relevance:0},{begin:S,returnBegin:!0,contains:[t.inherit(y,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:[a,t.C_BLOCK_COMMENT_MODE,p,b,m,{begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:["self",a,t.C_BLOCK_COMMENT_MODE,p,b,m]}]},m,a,t.C_BLOCK_COMMENT_MODE,x]};return{name:"C",aliases:["h"],keywords:C,disableAutodetect:!0,illegal:"</",contains:[].concat(I,P,M,[x,{begin:t.IDENT_RE+"::",keywords:C},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:x,strings:p,keywords:C}}}return zm=e,zm}var Bm,yy;function Q_(){if(yy)return Bm;yy=1;function e(t){const n=t.regex,a=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),s="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",d="(?!struct)("+s+"|"+n.optional(o)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",m={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},p={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},t.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},b={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},x={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(p,{className:"string"}),{className:"string",begin:/<.*?>/},a,t.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:n.optional(o)+t.IDENT_RE,relevance:0},S=n.optional(o)+t.IDENT_RE+"\\s*\\(",T=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],A=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],C=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],M=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],U={type:A,keyword:T,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:C},N={className:"function.dispatch",relevance:0,keywords:{_hint:M},begin:n.concat(/\b/,`(?!${T.join("|")})`,t.IDENT_RE,n.lookahead(/(<[^<>]+>|)\s*\(/))},z=[N,x,m,a,t.C_BLOCK_COMMENT_MODE,b,p],X={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:U,contains:z.concat([{begin:/\(/,end:/\)/,keywords:U,contains:z.concat(["self"]),relevance:0}]),relevance:0},B={className:"function",begin:"("+d+"[\\*&\\s]+)+"+S,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:U,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:s,keywords:U,relevance:0},{begin:S,returnBegin:!0,contains:[y],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[p,b]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:U,relevance:0,contains:[a,t.C_BLOCK_COMMENT_MODE,p,b,m,{begin:/\(/,end:/\)/,keywords:U,relevance:0,contains:["self",a,t.C_BLOCK_COMMENT_MODE,p,b,m]}]},m,a,t.C_BLOCK_COMMENT_MODE,x]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:U,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(X,B,N,z,[x,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:U,contains:["self",m]},{begin:t.IDENT_RE+"::",keywords:U},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}return Bm=e,Bm}var qm,xy;function J_(){if(xy)return qm;xy=1;function e(t){const n=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],a=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],s=["default","false","null","true"],o=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],c=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],d={keyword:o.concat(c),built_in:n,literal:s},m=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),h={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9'_]+|(\\b[\\d'_]+(\\.[\\d'_]*)?|\\.[\\d'_]+)([eE][-+]?[\\d'_]+)?)"}],relevance:0},p={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},b={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},x=t.inherit(b,{illegal:/\n/}),y={className:"subst",begin:/\{/,end:/\}/,keywords:d},S=t.inherit(y,{illegal:/\n/}),T={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,S]},A={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},y]},C=t.inherit(A,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},S]});y.contains=[A,T,b,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,h,t.C_BLOCK_COMMENT_MODE],S.contains=[C,T,x,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,h,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const M={variants:[p,A,T,b,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},I={begin:"<",end:">",contains:[{beginKeywords:"in out"},m]},P=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",U={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:d,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},M,h,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},m,I,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[m,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[m,I,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+P+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:d,contains:[{beginKeywords:a.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,I],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,relevance:0,contains:[M,h,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},U]}}return qm=e,qm}var Hm,wy;function eM(){if(wy)return Hm;wy=1;const e=h=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:h.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,4}(-[0-9A-Fa-f][0-9A-Fa-f]{0,4})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[h.APOS_STRING_MODE,h.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:h.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),t=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],n=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],a=[...t,...n],s=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),o=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),c=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),d=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function m(h){const p=h.regex,b=e(h),x={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},y="and or not only",S=/@-?\w[\w]*(-\w+)*/,T="[a-zA-Z-][a-zA-Z0-9_-]*",A=[h.APOS_STRING_MODE,h.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[b.BLOCK_COMMENT,x,b.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+T,relevance:0},b.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+o.join("|")+")"},{begin:":(:)?("+c.join("|")+")"}]},b.CSS_VARIABLE,{className:"attribute",begin:"\\b("+d.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[b.BLOCK_COMMENT,b.HEXCOLOR,b.IMPORTANT,b.CSS_NUMBER_MODE,b.UNICODE_RANGE,...A,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...A,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},b.FUNCTION_DISPATCH]},{begin:p.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:S},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:y,attribute:s.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...A,b.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+a.join("|")+")\\b"}]}}return Hm=m,Hm}var Um,ky;function tM(){if(ky)return Um;ky=1;function e(t){const n=t.regex,a={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},s={begin:"^[-\\*]{3,}",end:"$"},o={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},c={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},d={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},m=/[A-Za-z][A-Za-z0-9+.-]*/,h={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:n.concat(/\[.+?\]\(/,m,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},p={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},b={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},x=t.inherit(p,{contains:[]}),y=t.inherit(b,{contains:[]});p.contains.push(y),b.contains.push(x);let S=[a,h];return[p,b,x,y].forEach(M=>{M.contains=M.contains.concat(S)}),S=S.concat(p,b),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:S},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:S}]}]},a,c,p,b,{className:"quote",begin:"^>\\s+",contains:S,end:"$"},o,s,h,d,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}return Um=e,Um}var Fm,Sy;function nM(){if(Sy)return Fm;Sy=1;function e(t){const n=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:n.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+,\d+ +\+\d+ +@@/,/^@@ +-\d+ +\+\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:n.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}return Fm=e,Fm}var $m,Ey;function rM(){if(Ey)return $m;Ey=1;function e(t){const n=t.regex,a="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",s=n.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),o=n.concat(s,/(::\w+)*/),d={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},m={className:"doctag",begin:"@[A-Za-z]+"},h={begin:"#<",end:">"},p=[t.COMMENT("#","$",{contains:[m]}),t.COMMENT("^=begin","^=end",{contains:[m],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],b={className:"subst",begin:/#\{/,end:/\}/,keywords:d},x={className:"string",contains:[t.BACKSLASH_ESCAPE,b],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:n.concat(/<<[-~]?'?/,n.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,b]})]}]},y="[1-9](_?[0-9])*|0",S="[0-9](_?[0-9])*",T={className:"number",relevance:0,variants:[{begin:`\\b(${y})(\\.(${S}))?([eE][+-]?(${S})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},A={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:d}]},z=[x,{variants:[{match:[/class\s+/,o,/\s+<\s+/,o]},{match:[/\b(class|module)\s+/,o]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:d},{match:[/(include|extend)\s+/,o],scope:{2:"title.class"},keywords:d},{relevance:0,match:[o,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:s,scope:"title.class"},{match:[/def/,/\s+/,a],scope:{1:"keyword",3:"title.function"},contains:[A]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[x,{begin:a}],relevance:0},T,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:d},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.BACKSLASH_ESCAPE,b],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(h,p),relevance:0}].concat(h,p);b.contains=z,A.contains=z;const F=[{begin:/^\s*=>/,starts:{end:"$",contains:z}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:d,contains:z}}];return p.unshift(h),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:d,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(F).concat(p).concat(z)}}return $m=e,$m}var Pm,Ty;function aM(){if(Ty)return Pm;Ty=1;function e(t){const c={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:c,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:c,illegal:/["']/}]}]}}return Pm=e,Pm}var Gm,Cy;function iM(){if(Cy)return Gm;Cy=1;function e(t){const n=t.regex,a=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[t.HASH_COMMENT_MODE,t.QUOTE_STRING_MODE,t.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:n.concat(a,n.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}return Gm=e,Gm}var Vm,Ry;function sM(){if(Ry)return Vm;Ry=1;function e(t){const n=t.regex,a={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:t.NUMBER_RE}]},s=t.COMMENT();s.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const o={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},c={className:"literal",begin:/\bon|off|true|false|yes|no\b/},d={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},m={begin:/\[/,end:/\]/,contains:[s,c,o,d,a,"self"],relevance:0},h=/[A-Za-z0-9_-]+/,p=/"(\\"|[^"])*"/,b=/'[^']*'/,x=n.either(h,p,b),y=n.concat(x,"(\\s*\\.\\s*",x,")*",n.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[s,{className:"section",begin:/\[+/,end:/\]+/},{begin:y,className:"attr",starts:{end:/$/,contains:[s,m,c,o,d,a]}}]}}return Vm=e,Vm}var Km,Ny;function oM(){if(Ny)return Km;Ny=1;var e="[0-9](_*[0-9])*",t=`\\.(${e})`,n="[0-9a-fA-F](_*[0-9a-fA-F])*",a={className:"number",variants:[{begin:`(\\b(${e})((${t})|\\.)?|(${t}))[eE][+-]?(${e})[fFdD]?\\b`},{begin:`\\b(${e})((${t})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${t})[fFdD]?\\b`},{begin:`\\b(${e})[fFdD]\\b`},{begin:`\\b0[xX]((${n})\\.?|(${n})?\\.(${n}))[pP][+-]?(${e})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${n})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function s(c,d,m){return m===-1?"":c.replace(d,h=>s(c,d,m-1))}function o(c){const d=c.regex,m="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",h=m+s("(?:<"+m+"~~~(?:\\s*,\\s*"+m+"~~~)*>)?",/~~~/g,2),S={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},T={className:"meta",begin:"@"+m,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},A={className:"params",begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:[c.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:S,illegal:/<\/|#/,contains:[c.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},c.C_LINE_COMMENT_MODE,c.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[c.BACKSLASH_ESCAPE]},c.APOS_STRING_MODE,c.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,m],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[d.concat(/(?!else)/,m),/\s+/,m,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,m],className:{1:"keyword",3:"title.class"},contains:[A,c.C_LINE_COMMENT_MODE,c.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+h+"\\s+)",c.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:S,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:S,relevance:0,contains:[T,c.APOS_STRING_MODE,c.QUOTE_STRING_MODE,a,c.C_BLOCK_COMMENT_MODE]},c.C_LINE_COMMENT_MODE,c.C_BLOCK_COMMENT_MODE]},a,T]}}return Km=o,Km}var Ym,Ay;function lM(){if(Ay)return Ym;Ay=1;const e="[A-Za-z$_][0-9A-Za-z$_]*",t=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],n=["true","false","null","undefined","NaN","Infinity"],a=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],s=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],o=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],c=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],d=[].concat(o,a,s);function m(h){const p=h.regex,b=(Z,{after:ne})=>{const ue="</"+Z[0].slice(1);return Z.input.indexOf(ue,ne)!==-1},x=e,y={begin:"<>",end:"</>"},S=/<[A-Za-z0-9\\._:-]+\s*\/>/,T={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Z,ne)=>{const ue=Z[0].length+Z.index,he=Z.input[ue];if(he==="<"||he===","){ne.ignoreMatch();return}he===">"&&(b(Z,{after:ue})||ne.ignoreMatch());let Re;const Le=Z.input.substring(ue);if(Re=Le.match(/^\s*=/)){ne.ignoreMatch();return}if((Re=Le.match(/^\s+extends\s+/))&&Re.index===0){ne.ignoreMatch();return}}},A={$pattern:e,keyword:t,literal:n,built_in:d,"variable.language":c},C="[0-9](_?[0-9])*",M=`\\.(${C})`,I="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",P={className:"number",variants:[{begin:`(\\b(${I})((${M})|\\.)?|(${M}))[eE][+-]?(${C})\\b`},{begin:`\\b(${I})\\b((${M})\\b|\\.)?|(${M})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},U={className:"subst",begin:"\\$\\{",end:"\\}",keywords:A,contains:[]},N={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[h.BACKSLASH_ESCAPE,U],subLanguage:"xml"}},z={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[h.BACKSLASH_ESCAPE,U],subLanguage:"css"}},X={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[h.BACKSLASH_ESCAPE,U],subLanguage:"graphql"}},B={className:"string",begin:"`",end:"`",contains:[h.BACKSLASH_ESCAPE,U]},F={className:"comment",variants:[h.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:x+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),h.C_BLOCK_COMMENT_MODE,h.C_LINE_COMMENT_MODE]},K=[h.APOS_STRING_MODE,h.QUOTE_STRING_MODE,N,z,X,B,{match:/\$\d+/},P];U.contains=K.concat({begin:/\{/,end:/\}/,keywords:A,contains:["self"].concat(K)});const oe=[].concat(F,U.contains),J=oe.concat([{begin:/(\s*)\(/,end:/\)/,keywords:A,contains:["self"].concat(oe)}]),H={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:A,contains:J},_={variants:[{match:[/class/,/\s+/,x,/\s+/,/extends/,/\s+/,p.concat(x,"(",p.concat(/\./,x),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,x],scope:{1:"keyword",3:"title.class"}}]},Y={relevance:0,match:p.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...a,...s]}},re={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},fe={variants:[{match:[/function/,/\s+/,x,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[H],illegal:/%/},j={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function G(Z){return p.concat("(?!",Z.join("|"),")")}const W={match:p.concat(/\b/,G([...o,"super","import","await"].map(Z=>`${Z}\\s*\\(`)),x,p.lookahead(/\s*\(/)),className:"title.function",relevance:0},O={begin:p.concat(/\./,p.lookahead(p.concat(x,/(?![0-9A-Za-z$_(])/))),end:x,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},be={match:[/get|set/,/\s+/,x,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},H]},se="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+h.UNDERSCORE_IDENT_RE+")\\s*=>",V={match:[/const|var|let/,/\s+/,x,/\s*/,/=\s*/,/(async\s*)?/,p.lookahead(se)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[H]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:A,exports:{PARAMS_CONTAINS:J,CLASS_REFERENCE:Y},illegal:/#(?![$_A-Za-z])/,contains:[h.SHEBANG({label:"shebang",binary:"node",relevance:5}),re,h.APOS_STRING_MODE,h.QUOTE_STRING_MODE,N,z,X,B,F,{match:/\$\d+/},P,Y,{scope:"attr",match:x+p.lookahead(":"),relevance:0},V,{begin:"("+h.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[F,h.REGEXP_MODE,{className:"function",begin:se,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:h.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:A,contains:J}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:y.begin,end:y.end},{match:S},{begin:T.begin,"on:begin":T.isTrulyOpeningTag,end:T.end}],subLanguage:"xml",contains:[{begin:T.begin,end:T.end,skip:!0,contains:["self"]}]}]},fe,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+h.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[H,h.inherit(h.TITLE_MODE,{begin:x,className:"title.function"})]},{match:/\.\.\./,relevance:0},O,{match:"\\$"+x,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[H]},W,j,_,be,{match:/\$[(.]/}]}}return Ym=m,Ym}var Wm,Iy;function cM(){if(Iy)return Wm;Iy=1;const t={scope:"number",match:"([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",relevance:0};function n(a){const s={className:"attr",begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},o={match:/[{}[\],:]/,className:"punctuation",relevance:0},c=["true","false","null"],d={scope:"literal",beginKeywords:c.join(" ")};return{name:"JSON",aliases:["jsonc","json5"],keywords:{literal:c},contains:[s,o,a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,d,t,a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}return Wm=n,Wm}var Zm,_y;function uM(){if(_y)return Zm;_y=1;var e="[0-9](_*[0-9])*",t=`\\.(${e})`,n="[0-9a-fA-F](_*[0-9a-fA-F])*",a={className:"number",variants:[{begin:`(\\b(${e})((${t})|\\.)?|(${t}))[eE][+-]?(${e})[fFdD]?\\b`},{begin:`\\b(${e})((${t})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${t})[fFdD]?\\b`},{begin:`\\b(${e})[fFdD]\\b`},{begin:`\\b0[xX]((${n})\\.?|(${n})?\\.(${n}))[pP][+-]?(${e})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${n})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function s(o){const c={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},d={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},m={className:"symbol",begin:o.UNDERSCORE_IDENT_RE+"@"},h={className:"subst",begin:/\$\{/,end:/\}/,contains:[o.C_NUMBER_MODE]},p={className:"variable",begin:"\\$"+o.UNDERSCORE_IDENT_RE},b={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[p,h]},{begin:"'",end:"'",illegal:/\n/,contains:[o.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[o.BACKSLASH_ESCAPE,p,h]}]};h.contains.push(b);const x={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+o.UNDERSCORE_IDENT_RE+")?"},y={className:"meta",begin:"@"+o.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[o.inherit(b,{className:"string"}),"self"]}]},S=a,T=o.COMMENT("/\\*","\\*/",{contains:[o.C_BLOCK_COMMENT_MODE]}),A={variants:[{className:"type",begin:o.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},C=A;return C.variants[1].contains=[A],A.variants[1].contains=[C],{name:"Kotlin",aliases:["kt","kts"],keywords:c,contains:[o.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),o.C_LINE_COMMENT_MODE,T,d,m,x,y,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:c,relevance:5,contains:[{begin:o.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[o.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:c,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[A,o.C_LINE_COMMENT_MODE,T],relevance:0},o.C_LINE_COMMENT_MODE,T,x,y,b,o.C_NUMBER_MODE]},T]},{begin:[/class|interface|trait/,/\s+/,o.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},o.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},x,y]},b,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
312
|
-
`},S]}}return Zm=s,Zm}var Xm,My;function dM(){if(My)return Xm;My=1;const e=p=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:p.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,4}(-[0-9A-Fa-f][0-9A-Fa-f]{0,4})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[p.APOS_STRING_MODE,p.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:p.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),t=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],n=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],a=[...t,...n],s=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),o=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),c=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),d=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),m=o.concat(c).sort().reverse();function h(p){const b=e(p),x=m,y="and or not only",S="[\\w-]+",T="("+S+"|@\\{"+S+"\\})",A=[],C=[],M=function(oe){return{className:"string",begin:"~?"+oe+".*?"+oe}},I=function(oe,J,H){return{className:oe,begin:J,relevance:H}},P={$pattern:/[a-z-]+/,keyword:y,attribute:s.join(" ")},U={begin:"\\(",end:"\\)",contains:C,keywords:P,relevance:0};C.push(p.C_LINE_COMMENT_MODE,p.C_BLOCK_COMMENT_MODE,M("'"),M('"'),b.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},b.UNICODE_RANGE,b.HEXCOLOR,U,I("variable","@@?"+S,10),I("variable","@\\{"+S+"\\}"),I("built_in","~?`[^`]*?`"),{className:"attribute",begin:S+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},b.IMPORTANT,{beginKeywords:"and not"},b.FUNCTION_DISPATCH);const N=C.concat({begin:/\{/,end:/\}/,contains:A}),z={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(C)},X={begin:T+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},b.CSS_VARIABLE,{className:"attribute",begin:"\\b("+d.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:C}}]},B={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:P,returnEnd:!0,contains:C,relevance:0}},$={className:"variable",variants:[{begin:"@"+S+"\\s*:",relevance:15},{begin:"@"+S}],starts:{end:"[;}]",returnEnd:!0,contains:N}},F={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:T,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[p.C_LINE_COMMENT_MODE,p.C_BLOCK_COMMENT_MODE,z,I("keyword","all\\b"),I("variable","@\\{"+S+"\\}"),{begin:"\\b("+a.join("|")+")\\b",className:"selector-tag"},b.CSS_NUMBER_MODE,I("selector-tag",T,0),I("selector-id","#"+T),I("selector-class","\\."+T,0),I("selector-tag","&",0),b.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+o.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+c.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:N},{begin:"!important"},b.FUNCTION_DISPATCH]},K={begin:S+`:(:)?(${x.join("|")})`,returnBegin:!0,contains:[F]};return A.push(p.C_LINE_COMMENT_MODE,p.C_BLOCK_COMMENT_MODE,B,$,K,X,F,z,b.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:A}}return Xm=h,Xm}var Qm,Oy;function fM(){if(Oy)return Qm;Oy=1;function e(t){const n="\\[=*\\[",a="\\]=*\\]",s={begin:n,end:a,contains:["self"]},o=[t.COMMENT("--(?!"+n+")","$"),t.COMMENT("--"+n,a,{contains:[s],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:t.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:o.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:o}].concat(o)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:n,end:a,contains:[s],relevance:5}])}}return Qm=e,Qm}var Jm,Dy;function mM(){if(Dy)return Jm;Dy=1;function e(t){const n={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},a={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n]},s={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[n,a]},o={begin:"^"+t.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},c={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},d={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[n]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[t.HASH_COMMENT_MODE,n,a,s,o,c,d]}}return Jm=e,Jm}var eh,jy;function hM(){if(jy)return eh;jy=1;function e(t){const n=t.regex,a=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],s=/[dualxmsipngr]{0,12}/,o={$pattern:/[\w.]+/,keyword:a.join(" ")},c={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:o},d={begin:/->\{/,end:/\}/},m={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},h={scope:"variable",variants:[{begin:/\$\d/},{begin:n.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[m]},p={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},b=[t.BACKSLASH_ESCAPE,c,h],x=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],y=(A,C,M="\\1")=>{const I=M==="\\1"?M:n.concat(M,C);return n.concat(n.concat("(?:",A,")"),C,/(?:\\.|[^\\\/])*?/,I,/(?:\\.|[^\\\/])*?/,M,s)},S=(A,C,M)=>n.concat(n.concat("(?:",A,")"),C,/(?:\\.|[^\\\/])*?/,M,s),T=[h,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),d,{className:"string",contains:b,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},p,{begin:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:y("s|tr|y",n.either(...x,{capture:!0}))},{begin:y("s|tr|y","\\(","\\)")},{begin:y("s|tr|y","\\[","\\]")},{begin:y("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:S("(?:m|qr)?",/\//,/\//)},{begin:S("m|qr",n.either(...x,{capture:!0}),/\1/)},{begin:S("m|qr",/\(/,/\)/)},{begin:S("m|qr",/\[/,/\]/)},{begin:S("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,m]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[t.TITLE_MODE,m,p]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return c.contains=T,d.contains=T,{name:"Perl",aliases:["pl","pm"],keywords:o,contains:T}}return eh=e,eh}var th,Ly;function pM(){if(Ly)return th;Ly=1;function e(t){const n={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},a=/[a-zA-Z@][a-zA-Z0-9_]*/,m={"variable.language":["this","super"],$pattern:a,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},h={$pattern:a,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:m,illegal:"</",contains:[n,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.C_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[t.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+h.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:h,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}return th=e,th}var nh,zy;function gM(){if(zy)return nh;zy=1;function e(t){const n=t.regex,a=/(?![A-Za-z0-9])(?![$])/,s=n.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,a),o=n.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,a),c=n.concat(/[A-Z]+/,a),d={scope:"variable",match:"\\$+"+s},m={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},h={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},p=t.inherit(t.APOS_STRING_MODE,{illegal:null}),b=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(h)}),x={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(h),"on:begin":(H,_)=>{_.data._beginMatch=H[1]||H[2]},"on:end":(H,_)=>{_.data._beginMatch!==H[1]&&_.ignoreMatch()}},y=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),S=`[
|
|
313
|
-
]`,T={scope:"string",variants:[b,p,x,y]},A={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},C=["false","null","true"],M=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],I=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],U={keyword:M,literal:(H=>{const _=[];return H.forEach(Y=>{_.push(Y),Y.toLowerCase()===Y?_.push(Y.toUpperCase()):_.push(Y.toLowerCase())}),_})(C),built_in:I},N=H=>H.map(_=>_.replace(/\|\d+$/,"")),z={variants:[{match:[/new/,n.concat(S,"+"),n.concat("(?!",N(I).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},X=n.concat(s,"\\b(?!\\()"),B={variants:[{match:[n.concat(/::/,n.lookahead(/(?!class\b)/)),X],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[o,n.concat(/::/,n.lookahead(/(?!class\b)/)),X],scope:{1:"title.class",3:"variable.constant"}},{match:[o,n.concat("::",n.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[o,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},$={scope:"attr",match:n.concat(s,n.lookahead(":"),n.lookahead(/(?!::)/))},F={relevance:0,begin:/\(/,end:/\)/,keywords:U,contains:[$,d,B,t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE,t.HASH_COMMENT_MODE,T,A,z]},K={relevance:0,match:[/\b/,n.concat("(?!fn\\b|function\\b|",N(M).join("\\b|"),"|",N(I).join("\\b|"),"\\b)"),s,n.concat(S,"*"),n.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[F]};F.contains.push(K);const oe=[$,B,t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE,t.HASH_COMMENT_MODE,T,A,z],J={begin:n.concat(/#\[\s*\\?/,n.either(o,c)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:C,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:C,keyword:["new","array"]},contains:["self",...oe]},...oe,{scope:"meta",variants:[{match:o},{match:c}]}]};return{case_insensitive:!1,keywords:U,contains:[J,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},m,{scope:"variable.language",match:/\$this\b/},d,K,B,{match:[/const/,/\s/,s],scope:{1:"keyword",3:"variable.constant"}},z,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:U,contains:["self",J,d,B,t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE,t.HASH_COMMENT_MODE,T,A]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},T,A]}}return nh=e,nh}var rh,By;function bM(){if(By)return rh;By=1;function e(t){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}return rh=e,rh}var ah,qy;function vM(){if(qy)return ah;qy=1;function e(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}return ah=e,ah}var ih,Hy;function yM(){if(Hy)return ih;Hy=1;function e(t){const n=t.regex,a=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),s=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],m={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:s,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},h={className:"meta",begin:/^(>>>|\.\.\.) /},p={className:"subst",begin:/\{/,end:/\}/,keywords:m,illegal:/#/},b={begin:/\{\{/,relevance:0},x={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,h],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,h],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,h,b,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,h,b,p]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,b,p]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,b,p]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},y="[0-9](_?[0-9])*",S=`(\\b(${y}))?\\.(${y})|\\b(${y})\\.`,T=`\\b|${s.join("|")}`,A={className:"number",relevance:0,variants:[{begin:`(\\b(${y})|(${S}))[eE][+-]?(${y})[jJ]?(?=${T})`},{begin:`(${S})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${T})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${T})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${T})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${T})`},{begin:`\\b(${y})[jJ](?=${T})`}]},C={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:m,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},M={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:m,contains:["self",h,A,x,t.HASH_COMMENT_MODE]}]};return p.contains=[x,A,h],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:m,illegal:/(<\/|\?)|=>/,contains:[h,A,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},x,C,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,a],scope:{1:"keyword",3:"title.function"},contains:[M]},{variants:[{match:[/\bclass/,/\s+/,a,/\s*/,/\(\s*/,a,/\s*\)/]},{match:[/\bclass/,/\s+/,a]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[A,M,x]}]}}return ih=e,ih}var sh,Uy;function xM(){if(Uy)return sh;Uy=1;function e(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}return sh=e,sh}var oh,Fy;function wM(){if(Fy)return oh;Fy=1;function e(t){const n=t.regex,a=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,s=n.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),o=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,c=n.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:a,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:n.lookahead(n.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:a},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[o,s]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,s]},{scope:{1:"punctuation",2:"number"},match:[c,s]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,s]}]},{scope:{3:"operator"},match:[a,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:o},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:c},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}return oh=e,oh}var lh,$y;function kM(){if($y)return lh;$y=1;function e(t){const n=t.regex,a=/(r#)?/,s=n.concat(a,t.UNDERSCORE_IDENT_RE),o=n.concat(a,t.IDENT_RE),c={className:"title.function.invoke",relevance:0,begin:n.concat(/\b/,/(?!let|for|while|if|else|match\b)/,o,n.lookahead(/\s*\(/))},d="([ui](8|16|32|64|128|size)|f(32|64))?",m=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],h=["true","false","Some","None","Ok","Err"],p=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],b=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:t.IDENT_RE+"!?",type:b,keyword:m,literal:h,built_in:p},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+d},{begin:"\\b0o([0-7_]+)"+d},{begin:"\\b0x([A-Fa-f0-9_]+)"+d},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+d}],relevance:0},{begin:[/fn/,/\s+/,s],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,s],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,s,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,s],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,s],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:p,type:b}},{className:"punctuation",begin:"->"},c]}}return lh=e,lh}var ch,Py;function SM(){if(Py)return ch;Py=1;const e=h=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:h.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,4}(-[0-9A-Fa-f][0-9A-Fa-f]{0,4})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[h.APOS_STRING_MODE,h.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:h.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),t=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],n=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],a=[...t,...n],s=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),o=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),c=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),d=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function m(h){const p=e(h),b=c,x=o,y="@[a-z-]+",S="and or not only",A={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[h.C_LINE_COMMENT_MODE,h.C_BLOCK_COMMENT_MODE,p.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},p.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+a.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+x.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+b.join("|")+")"},A,{begin:/\(/,end:/\)/,contains:[p.CSS_NUMBER_MODE]},p.CSS_VARIABLE,{className:"attribute",begin:"\\b("+d.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[p.BLOCK_COMMENT,A,p.HEXCOLOR,p.CSS_NUMBER_MODE,p.UNICODE_RANGE,h.QUOTE_STRING_MODE,h.APOS_STRING_MODE,p.IMPORTANT,p.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:y,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:S,attribute:s.join(" ")},contains:[{begin:y,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},A,h.QUOTE_STRING_MODE,h.APOS_STRING_MODE,p.HEXCOLOR,p.CSS_NUMBER_MODE]},p.FUNCTION_DISPATCH]}}return ch=m,ch}var uh,Gy;function EM(){if(Gy)return uh;Gy=1;function e(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}return uh=e,uh}var dh,Vy;function TM(){if(Vy)return dh;Vy=1;function e(t){const n=t.regex,a=t.COMMENT("--","$"),s={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},o={begin:/"/,end:/"/,contains:[{match:/""/}]},c=["true","false","unknown"],d=["double precision","large object","with timezone","without timezone"],m=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],h=["add","asc","collation","desc","final","first","last","view"],p=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],b=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],x=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],y=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],S=b,T=[...p,...h].filter(N=>!b.includes(N)),A={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},C={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},M={match:n.concat(/\b/,n.either(...S),/\s*\(/),relevance:0,keywords:{built_in:S}};function I(N){return n.concat(/\b/,n.either(...N.map(z=>z.replace(/\s+/,"\\s+"))),/\b/)}const P={scope:"keyword",match:I(y),relevance:0};function U(N,{exceptions:z,when:X}={}){const B=X;return z=z||[],N.map($=>$.match(/\|\d+$/)||z.includes($)?$:B($)?`${$}|0`:$)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:U(T,{when:N=>N.length<3}),literal:c,type:m,built_in:x},contains:[{scope:"type",match:I(d)},P,M,A,s,o,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,a,C]}}return dh=e,dh}var fh,Ky;function CM(){if(Ky)return fh;Ky=1;function e(X){return X?typeof X=="string"?X:X.source:null}function t(X){return n("(?=",X,")")}function n(...X){return X.map($=>e($)).join("")}function a(X){const B=X[X.length-1];return typeof B=="object"&&B.constructor===Object?(X.splice(X.length-1,1),B):{}}function s(...X){return"("+(a(X).capture?"":"?:")+X.map(F=>e(F)).join("|")+")"}const o=X=>n(/\b/,X,/\w$/.test(X)?/\b/:/\B/),c=["Protocol","Type"].map(o),d=["init","self"].map(o),m=["Any","Self"],h=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],p=["false","nil","true"],b=["assignment","associativity","higherThan","left","lowerThan","none","right"],x=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],y=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],S=s(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),T=s(S,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),A=n(S,T,"*"),C=s(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),M=s(C,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),I=n(C,M,"*"),P=n(/[A-Z]/,M,"*"),U=["attached","autoclosure",n(/convention\(/,s("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",n(/objc\(/,I,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],N=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function z(X){const B={match:/\s+/,relevance:0},$=X.COMMENT("/\\*","\\*/",{contains:["self"]}),F=[X.C_LINE_COMMENT_MODE,$],K={match:[/\./,s(...c,...d)],className:{2:"keyword"}},oe={match:n(/\./,s(...h)),relevance:0},J=h.filter(je=>typeof je=="string").concat(["_|0"]),H=h.filter(je=>typeof je!="string").concat(m).map(o),_={variants:[{className:"keyword",match:s(...H,...d)}]},Y={$pattern:s(/\b\w+/,/#\w+/),keyword:J.concat(x),literal:p},re=[K,oe,_],fe={match:n(/\./,s(...y)),relevance:0},j={className:"built_in",match:n(/\b/,s(...y),/(?=\()/)},G=[fe,j],W={match:/->/,relevance:0},O={className:"operator",relevance:0,variants:[{match:A},{match:`\\.(\\.|${T})+`}]},be=[W,O],se="([0-9]_*)+",V="([0-9a-fA-F]_*)+",Z={className:"number",relevance:0,variants:[{match:`\\b(${se})(\\.(${se}))?([eE][+-]?(${se}))?\\b`},{match:`\\b0x(${V})(\\.(${V}))?([pP][+-]?(${se}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},ne=(je="")=>({className:"subst",variants:[{match:n(/\\/,je,/[0\\tnr"']/)},{match:n(/\\/,je,/u\{[0-9a-fA-F]{1,8}\}/)}]}),ue=(je="")=>({className:"subst",match:n(/\\/,je,/[\t ]*(?:[\r\n]|\r\n)/)}),he=(je="")=>({className:"subst",label:"interpol",begin:n(/\\/,je,/\(/),end:/\)/}),Re=(je="")=>({begin:n(je,/"""/),end:n(/"""/,je),contains:[ne(je),ue(je),he(je)]}),Le=(je="")=>({begin:n(je,/"/),end:n(/"/,je),contains:[ne(je),he(je)]}),Ye={className:"string",variants:[Re(),Re("#"),Re("##"),Re("###"),Le(),Le("#"),Le("##"),Le("###")]},ut=[X.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[X.BACKSLASH_ESCAPE]}],pt={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:ut},Rt=je=>{const wt=n(je,/\//),bt=n(/\//,je);return{begin:wt,end:bt,contains:[...ut,{scope:"comment",begin:`#(?!.*${bt})`,end:/$/}]}},Ht={scope:"regexp",variants:[Rt("###"),Rt("##"),Rt("#"),pt]},at={match:n(/`/,I,/`/)},Mt={className:"variable",match:/\$\d+/},ft={className:"variable",match:`\\$${M}+`},Ut=[at,Mt,ft],ze={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:N,contains:[...be,Z,Ye]}]}},Qe={scope:"keyword",match:n(/@/,s(...U),t(s(/\(/,/\s+/)))},Ue={scope:"meta",match:n(/@/,I)},mt=[ze,Qe,Ue],pe={match:t(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:n(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,M,"+")},{className:"type",match:P,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:n(/\s+&\s+/,t(P)),relevance:0}]},me={begin:/</,end:/>/,keywords:Y,contains:[...F,...re,...mt,W,pe]};pe.contains.push(me);const He={match:n(I,/\s*:/),keywords:"_|0",relevance:0},we={begin:/\(/,end:/\)/,relevance:0,keywords:Y,contains:["self",He,...F,Ht,...re,...G,...be,Z,Ye,...Ut,...mt,pe]},Fe={begin:/</,end:/>/,keywords:"repeat each",contains:[...F,pe]},lt={begin:s(t(n(I,/\s*:/)),t(n(I,/\s+/,I,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:I}]},Ae={begin:/\(/,end:/\)/,keywords:Y,contains:[lt,...F,...re,...be,Z,Ye,...mt,pe,we],endsParent:!0,illegal:/["']/},Kt={match:[/(func|macro)/,/\s+/,s(at.match,I,A)],className:{1:"keyword",3:"title.function"},contains:[Fe,Ae,B],illegal:[/\[/,/%/]},gt={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[Fe,Ae,B],illegal:/\[|%/},_t={match:[/operator/,/\s+/,A],className:{1:"keyword",3:"title"}},Tt={begin:[/precedencegroup/,/\s+/,P],className:{1:"keyword",3:"title"},contains:[pe],keywords:[...b,...p],end:/}/},Mn={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},pn={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},st={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,I,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:Y,contains:[Fe,...re,{begin:/:/,end:/\{/,keywords:Y,contains:[{scope:"title.class.inherited",match:P},...re],relevance:0}]};for(const je of Ye.variants){const wt=je.contains.find(Gt=>Gt.label==="interpol");wt.keywords=Y;const bt=[...re,...G,...be,Z,Ye,...Ut];wt.contains=[...bt,{begin:/\(/,end:/\)/,contains:["self",...bt]}]}return{name:"Swift",keywords:Y,contains:[...F,Kt,gt,Mn,pn,st,_t,Tt,{beginKeywords:"import",end:/$/,contains:[...F],relevance:0},Ht,...re,...G,...be,Z,Ye,...Ut,...mt,pe,we]}}return fh=z,fh}var mh,Yy;function RM(){if(Yy)return mh;Yy=1;function e(t){const n="true false yes no null",a="[\\w#;/?:@&=+$,.~*'()[\\]]+",s={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},o={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},c={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},d={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,o]},m=t.inherit(d,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),y={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},S={end:",",endsWithParent:!0,excludeEnd:!0,keywords:n,relevance:0},T={begin:/\{/,end:/\}/,contains:[S],illegal:"\\n",relevance:0},A={begin:"\\[",end:"\\]",contains:[S],illegal:"\\n",relevance:0},C=[s,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+a},{className:"type",begin:"!<"+a+">"},{className:"type",begin:"!"+a},{className:"type",begin:"!!"+a},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:n,keywords:{literal:n}},y,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},T,A,c,d],M=[...C];return M.pop(),M.push(m),S.contains=M,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:C}}return mh=e,mh}var hh,Wy;function NM(){if(Wy)return hh;Wy=1;const e="[A-Za-z$_][0-9A-Za-z$_]*",t=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],n=["true","false","null","undefined","NaN","Infinity"],a=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],s=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],o=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],c=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],d=[].concat(o,a,s);function m(p){const b=p.regex,x=(ne,{after:ue})=>{const he="</"+ne[0].slice(1);return ne.input.indexOf(he,ue)!==-1},y=e,S={begin:"<>",end:"</>"},T=/<[A-Za-z0-9\\._:-]+\s*\/>/,A={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ne,ue)=>{const he=ne[0].length+ne.index,Re=ne.input[he];if(Re==="<"||Re===","){ue.ignoreMatch();return}Re===">"&&(x(ne,{after:he})||ue.ignoreMatch());let Le;const Ye=ne.input.substring(he);if(Le=Ye.match(/^\s*=/)){ue.ignoreMatch();return}if((Le=Ye.match(/^\s+extends\s+/))&&Le.index===0){ue.ignoreMatch();return}}},C={$pattern:e,keyword:t,literal:n,built_in:d,"variable.language":c},M="[0-9](_?[0-9])*",I=`\\.(${M})`,P="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",U={className:"number",variants:[{begin:`(\\b(${P})((${I})|\\.)?|(${I}))[eE][+-]?(${M})\\b`},{begin:`\\b(${P})\\b((${I})\\b|\\.)?|(${I})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},N={className:"subst",begin:"\\$\\{",end:"\\}",keywords:C,contains:[]},z={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[p.BACKSLASH_ESCAPE,N],subLanguage:"xml"}},X={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[p.BACKSLASH_ESCAPE,N],subLanguage:"css"}},B={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[p.BACKSLASH_ESCAPE,N],subLanguage:"graphql"}},$={className:"string",begin:"`",end:"`",contains:[p.BACKSLASH_ESCAPE,N]},K={className:"comment",variants:[p.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:y+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),p.C_BLOCK_COMMENT_MODE,p.C_LINE_COMMENT_MODE]},oe=[p.APOS_STRING_MODE,p.QUOTE_STRING_MODE,z,X,B,$,{match:/\$\d+/},U];N.contains=oe.concat({begin:/\{/,end:/\}/,keywords:C,contains:["self"].concat(oe)});const J=[].concat(K,N.contains),H=J.concat([{begin:/(\s*)\(/,end:/\)/,keywords:C,contains:["self"].concat(J)}]),_={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:C,contains:H},Y={variants:[{match:[/class/,/\s+/,y,/\s+/,/extends/,/\s+/,b.concat(y,"(",b.concat(/\./,y),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,y],scope:{1:"keyword",3:"title.class"}}]},re={relevance:0,match:b.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...a,...s]}},fe={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},j={variants:[{match:[/function/,/\s+/,y,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[_],illegal:/%/},G={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function W(ne){return b.concat("(?!",ne.join("|"),")")}const O={match:b.concat(/\b/,W([...o,"super","import","await"].map(ne=>`${ne}\\s*\\(`)),y,b.lookahead(/\s*\(/)),className:"title.function",relevance:0},be={begin:b.concat(/\./,b.lookahead(b.concat(y,/(?![0-9A-Za-z$_(])/))),end:y,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},se={match:[/get|set/,/\s+/,y,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},_]},V="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+p.UNDERSCORE_IDENT_RE+")\\s*=>",Z={match:[/const|var|let/,/\s+/,y,/\s*/,/=\s*/,/(async\s*)?/,b.lookahead(V)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[_]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:C,exports:{PARAMS_CONTAINS:H,CLASS_REFERENCE:re},illegal:/#(?![$_A-Za-z])/,contains:[p.SHEBANG({label:"shebang",binary:"node",relevance:5}),fe,p.APOS_STRING_MODE,p.QUOTE_STRING_MODE,z,X,B,$,K,{match:/\$\d+/},U,re,{scope:"attr",match:y+b.lookahead(":"),relevance:0},Z,{begin:"("+p.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[K,p.REGEXP_MODE,{className:"function",begin:V,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:p.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:C,contains:H}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:S.begin,end:S.end},{match:T},{begin:A.begin,"on:begin":A.isTrulyOpeningTag,end:A.end}],subLanguage:"xml",contains:[{begin:A.begin,end:A.end,skip:!0,contains:["self"]}]}]},j,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+p.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[_,p.inherit(p.TITLE_MODE,{begin:y,className:"title.function"})]},{match:/\.\.\./,relevance:0},be,{match:"\\$"+y,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[_]},O,G,Y,se,{match:/\$[(.]/}]}}function h(p){const b=p.regex,x=m(p),y=e,S=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],T={begin:[/namespace/,/\s+/,p.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},A={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:S},contains:[x.exports.CLASS_REFERENCE]},C={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},M=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],I={$pattern:e,keyword:t.concat(M),literal:n,built_in:d.concat(S),"variable.language":c},P={className:"meta",begin:"@"+y},U=(B,$,F)=>{const K=B.contains.findIndex(oe=>oe.label===$);if(K===-1)throw new Error("can not find mode to replace");B.contains.splice(K,1,F)};Object.assign(x.keywords,I),x.exports.PARAMS_CONTAINS.push(P);const N=x.contains.find(B=>B.scope==="attr"),z=Object.assign({},N,{match:b.concat(y,b.lookahead(/\s*\?:/))});x.exports.PARAMS_CONTAINS.push([x.exports.CLASS_REFERENCE,N,z]),x.contains=x.contains.concat([P,T,A,z]),U(x,"shebang",p.SHEBANG()),U(x,"use_strict",C);const X=x.contains.find(B=>B.label==="func.def");return X.relevance=0,Object.assign(x,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),x}return hh=h,hh}var ph,Zy;function AM(){if(Zy)return ph;Zy=1;function e(t){const n=t.regex,a={className:"string",begin:/"(""|[^/n])"C\b/},s={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},o=/\d{1,2}\/\d{1,2}\/\d{4}/,c=/\d{4}-\d{1,2}-\d{1,2}/,d=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,m=/\d{1,2}(:\d{1,2}){1,2}/,h={className:"literal",variants:[{begin:n.concat(/# */,n.either(c,o),/ *#/)},{begin:n.concat(/# */,m,/ *#/)},{begin:n.concat(/# */,d,/ *#/)},{begin:n.concat(/# */,n.either(c,o),/ +/,n.either(d,m),/ *#/)}]},p={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},b={className:"label",begin:/^\w+:/},x=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),y=t.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[a,s,h,p,b,x,y,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[y]}]}}return ph=e,ph}var gh,Xy;function IM(){if(Xy)return gh;Xy=1;function e(t){t.regex;const n=t.COMMENT(/\(;/,/;\)/);n.contains.push("self");const a=t.COMMENT(/;;/,/$/),s=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],o={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},c={className:"variable",begin:/\$[\w_]+/},d={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},m={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},h={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},p={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:s},contains:[a,n,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},c,d,o,t.QUOTE_STRING_MODE,h,p,m]}}return gh=e,gh}var bh,Qy;function _M(){if(Qy)return bh;Qy=1;var e=Y_();return e.registerLanguage("xml",W_()),e.registerLanguage("bash",Z_()),e.registerLanguage("c",X_()),e.registerLanguage("cpp",Q_()),e.registerLanguage("csharp",J_()),e.registerLanguage("css",eM()),e.registerLanguage("markdown",tM()),e.registerLanguage("diff",nM()),e.registerLanguage("ruby",rM()),e.registerLanguage("go",aM()),e.registerLanguage("graphql",iM()),e.registerLanguage("ini",sM()),e.registerLanguage("java",oM()),e.registerLanguage("javascript",lM()),e.registerLanguage("json",cM()),e.registerLanguage("kotlin",uM()),e.registerLanguage("less",dM()),e.registerLanguage("lua",fM()),e.registerLanguage("makefile",mM()),e.registerLanguage("perl",hM()),e.registerLanguage("objectivec",pM()),e.registerLanguage("php",gM()),e.registerLanguage("php-template",bM()),e.registerLanguage("plaintext",vM()),e.registerLanguage("python",yM()),e.registerLanguage("python-repl",xM()),e.registerLanguage("r",wM()),e.registerLanguage("rust",kM()),e.registerLanguage("scss",SM()),e.registerLanguage("shell",EM()),e.registerLanguage("sql",TM()),e.registerLanguage("swift",CM()),e.registerLanguage("yaml",RM()),e.registerLanguage("typescript",NM()),e.registerLanguage("vbnet",AM()),e.registerLanguage("wasm",IM()),e.HighlightJS=e,e.default=e,bh=e,bh}var MM=_M();const Jy=dd(MM),B7=/^(javascript|vbscript|data):/i;function OM(e){if(!e)return!1;const t=e.trim();return!(!t||B7.test(t))}function DM(e){if(!e)return!1;const t=e.trim();return!t||B7.test(t)||t.startsWith("blob:")||t.startsWith("data:image/")||/^https?:\/\//i.test(t)?!1:!!(t.startsWith("/")||t.startsWith("./")||t.startsWith("../")||!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(t))}const jM=[[mA,{singleTilde:!1}],[p_,{singleDollarTextMath:!0}]],LM=[K_];let vh=null,e3=null;async function zM(){return vh||(e3??=Kk(()=>import("./mermaid.core-DwPGvpCv.js").then(e=>e.bp),[]).then(e=>{e.default.initialize({startOnLoad:!1,securityLevel:"strict",theme:"neutral"});const t=async(n,a)=>{const{svg:s}=await e.default.render(`oc-mermaid-${Math.random().toString(36).slice(2,10)}`,a);n.innerHTML=s};return vh=t,t}).catch(()=>null),e3)}function BM({code:e}){const t=w.useRef(null),[n,a]=w.useState(!1);return w.useEffect(()=>{let s=!1;return zM().then(o=>{if(s||!o||!t.current){o||a(!0);return}o(t.current,e).catch(()=>{s||a(!0)})}),()=>{s=!0}},[e]),n?u.jsx(E1,{lang:"mermaid",text:e}):u.jsx("div",{className:"oc-mermaid",ref:t,role:"img","aria-label":"Mermaid 图表"})}function E1({lang:e,text:t,children:n}){const[a,s]=w.useState(!1),o=w.useMemo(()=>{const d=Jy.getLanguage(e)?e:"";return d?Jy.highlight(t,{language:d,ignoreIllegals:!0}).value:void 0},[e,t]),c=()=>{navigator.clipboard?.writeText(t).then(()=>{s(!0),window.setTimeout(()=>s(!1),1600)},()=>{})};return u.jsxs("div",{className:"oc-codeblock",children:[u.jsxs("div",{className:"oc-codeblock-head",children:[u.jsx("span",{className:"oc-codeblock-lang",children:e||"text"}),u.jsx("button",{type:"button",className:"oc-codeblock-copy",onClick:c,children:a?"已复制":"复制"})]}),u.jsx("pre",{children:o!==void 0?u.jsx("code",{className:`hljs language-${e}`,dangerouslySetInnerHTML:{__html:o}}):u.jsx("code",{className:e?`hljs language-${e}`:"hljs",children:n??t})})]})}function qM(e){return e?.children?.find(a=>a.tagName==="thead"||a.tagName==="tbody")?.children?.find(a=>a.tagName==="tr")?.children?.filter(a=>a.tagName==="th"||a.tagName==="td").length??0}function T1(e){if(e==null||typeof e=="boolean")return"";if(typeof e=="string"||typeof e=="number")return String(e);if(Array.isArray(e))return e.map(T1).join("");if(typeof e=="object"&&"props"in e){const t=e.props;return T1(t?.children)}return""}const HM={pre({children:e}){return u.jsx(u.Fragment,{children:e})},code({className:e,children:t,...n}){const a=T1(t).replace(/\n$/,""),s=/language-([\w-]+)/.exec(e??"");return s?.[1]==="mermaid"?u.jsx(BM,{code:a}):s||e&&a.includes(`
|
|
314
|
-
`)?u.jsx(E1,{lang:s?.[1]??"",text:a}):a.includes(`
|
|
315
|
-
`)?u.jsx(E1,{lang:"",text:a}):u.jsx("code",{className:e,...n,children:t})},a({href:e,children:t,...n}){if(!OM(e))return u.jsx("span",{...n,children:t});const a=/^https?:\/\//i.test(e??"");return u.jsx("a",{href:e,...a?{target:"_blank",rel:"noopener noreferrer"}:{},...n,children:t})},img({src:e,alt:t}){return DM(e)?u.jsxs(u.Fragment,{children:[u.jsx("img",{src:e,alt:t??"",loading:"lazy",onError:n=>{const a=n.currentTarget;a.hidden=!0,a.nextElementSibling?.removeAttribute("hidden")}}),u.jsx("span",{className:"oc-md-img-fallback",hidden:!0,title:e??void 0,children:t?`[图片加载失败: ${t}]`:"[图片加载失败]"})]}):u.jsx("span",{className:"oc-md-img-fallback",title:e??void 0,children:t?`[图片: ${t}]`:"[图片已屏蔽]"})},table({children:e,node:t}){const n=qM(t)>=4;return u.jsx("div",{className:`oc-md-table-wrap ${n?"is-wide":"is-fill"}`,tabIndex:n?0:void 0,children:u.jsx("table",{children:e})})},input(e){return e.type==="checkbox"?u.jsx("input",{type:"checkbox",checked:!!e.checked,disabled:!0,readOnly:!0}):u.jsx("input",{...e,disabled:!0,readOnly:!0})}};class UM extends w.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,n){}componentDidUpdate(t){t.text!==this.props.text&&this.state.hasError&&this.setState({hasError:!1})}render(){return this.state.hasError?u.jsx("div",{className:"oc-md",children:u.jsx("pre",{className:"oc-md-fallback",children:this.props.text})}):this.props.children}}function nc({text:e}){try{return u.jsx(UM,{text:e,children:u.jsx("div",{className:"oc-md",children:u.jsx(tR,{remarkPlugins:jM,rehypePlugins:LM,components:HM,children:e})})})}catch{return u.jsx("div",{className:"oc-md",children:u.jsx("pre",{className:"oc-md-fallback",children:e})})}}const t3="无法在浏览器中打开:弹窗被拦截",FM="内容已截断,以下为已加载片段。";function $M(e){const t=e?.availWidth??1440,n=e?.availHeight??900,a=Math.min(1280,Math.max(880,Math.floor(t*.82))),s=Math.min(960,Math.max(640,Math.floor(n*.88)));return["popup=yes",`width=${a}`,`height=${s}`,"left=72","top=36","menubar=yes","toolbar=yes","location=yes","status=yes","resizable=yes","scrollbars=yes"].join(",")}function mo(e){return e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function jd(e){return e.trim().toLowerCase()}function PM(e){const t=jd(e);return t==="html"||t==="htm"}function GM(e){const t=jd(e);return t==="md"||t==="markdown"}function VM(e){if(jd(e.language)!=="json")return e.content;try{return JSON.stringify(JSON.parse(e.content),null,2)}catch{return e.content}}function KM(e){return/^https?:\/\//i.test(e.trim())}function Cl(e){const t=[];return e.replace(/`([^`]+)`/g,(o,c)=>(t.push(`<code>${c}</code>`),`\0${t.length-1}\0`)).replace(/\[([^\]]+)\]\(([^)\s]+)\)/g,(o,c,d)=>KM(d)?`<a href="${d}" rel="noopener noreferrer" target="_blank">${c}</a>`:c).replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>").replace(/__([^_]+)__/g,"<strong>$1</strong>").replace(/\*([^*]+)\*/g,"<em>$1</em>").replace(/\u0000(\d+)\u0000/g,(o,c)=>t[Number(c)]??"")}function YM(e){return e.length?`<p>${Cl(e.join(" "))}</p>`:""}function n3(e){const t=e.replaceAll(`\r
|
|
316
|
-
`,`
|
|
317
|
-
`).split(`
|
|
318
|
-
`),n=[];let a=[],s=null;const o=()=>{s&&(n.push(s==="ul"?"</ul>":"</ol>"),s=null)},c=()=>{a.length&&(n.push(YM(a)),a=[])};for(const d of t){const m=/^(#{1,6})\s+(.+)$/.exec(d);if(m){c(),o();const x=m[1].length;n.push(`<h${x}>${Cl(m[2])}</h${x}>`);continue}if(/^---+$/.test(d.trim())||/^\*\*\*+$/.test(d.trim())){c(),o(),n.push("<hr>");continue}const h=/^>\s?(.*)$/.exec(d);if(h){c(),o(),n.push(`<blockquote><p>${Cl(h[1]??"")}</p></blockquote>`);continue}const p=/^[-*]\s+(.+)$/.exec(d);if(p){c(),s!=="ul"&&(o(),n.push("<ul>"),s="ul"),n.push(`<li>${Cl(p[1])}</li>`);continue}const b=/^\d+\.\s+(.+)$/.exec(d);if(b){c(),s!=="ol"&&(o(),n.push("<ol>"),s="ol"),n.push(`<li>${Cl(b[1])}</li>`);continue}if(d.trim()===""){c(),o();continue}o(),a.push(d)}return c(),o(),n.join(`
|
|
319
|
-
`)}function WM(e){const t=mo(e),n=[],a=/```([^\n`]*)\n([\s\S]*?)```/g;let s=0,o;for(;o=a.exec(t);)o.index>s&&n.push(n3(t.slice(s,o.index))),n.push(`<pre class="md-code"><code>${o[2]??""}</code></pre>`),s=o.index+o[0].length;return s<t.length&&n.push(n3(t.slice(s))),n.filter(Boolean).join(`
|
|
320
|
-
`)}function ZM(){return`
|
|
321
|
-
:root { color-scheme: light dark; }
|
|
322
|
-
html, body { margin: 0; min-height: 100%; background: #f7f5f0; color: #1f1b16; }
|
|
323
|
-
body { font: 16px/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
|
|
324
|
-
.bar { position: sticky; top: 0; z-index: 1; display: flex; gap: 12px; align-items: center; padding: 10px 16px 10px 20px; border-bottom: 1px solid #e4ddd2; background: #fffdf8; }
|
|
325
|
-
.bar .meta { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
|
|
326
|
-
.bar strong { font-size: 13px; font-weight: 650; word-break: break-all; }
|
|
327
|
-
.bar .kind { color: #6b6258; font-size: 12px; }
|
|
328
|
-
.modes { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid #e4ddd2; border-radius: 8px; background: #f3eee6; }
|
|
329
|
-
.modes button { appearance: none; border: 0; background: transparent; color: #6b6258; font: 12px/1.2 inherit; padding: 5px 10px; border-radius: 6px; cursor: pointer; }
|
|
330
|
-
.modes button:hover { color: #1f1b16; }
|
|
331
|
-
.modes button.is-active { background: #fff; color: #1f1b16; font-weight: 600; box-shadow: 0 1px 2px rgb(0 0 0 / 8%); }
|
|
332
|
-
.notice { margin: 0; padding: 8px 20px; background: #fff6d8; color: #5c4b00; font-size: 13px; }
|
|
333
|
-
.pane { display: none; }
|
|
334
|
-
.pane.is-active { display: block; }
|
|
335
|
-
.doc { max-width: 52rem; margin: 0 auto; padding: 32px 24px 96px; }
|
|
336
|
-
.doc.md h1, .doc.md h2, .doc.md h3, .doc.md h4 { line-height: 1.25; margin: 1.4em 0 0.5em; }
|
|
337
|
-
.doc.md h1 { font-size: 2rem; }
|
|
338
|
-
.doc.md h2 { font-size: 1.45rem; }
|
|
339
|
-
.doc.md p { margin: 0.8em 0; }
|
|
340
|
-
.doc.md ul, .doc.md ol { margin: 0.6em 0; padding-left: 1.4em; }
|
|
341
|
-
.doc.md blockquote { margin: 0.8em 0; padding: 0.2em 0.9em; border-left: 3px solid #d9cfc0; color: #4a433c; }
|
|
342
|
-
.doc.md hr { border: 0; border-top: 1px solid #e4ddd2; margin: 1.6em 0; }
|
|
343
|
-
.doc.md a { color: #0b57d0; }
|
|
344
|
-
.doc.md code, .md-code, .source { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; }
|
|
345
|
-
.doc.md :not(pre) > code { padding: 0.1em 0.35em; border-radius: 4px; background: #efe8dc; }
|
|
346
|
-
.md-code, .source { margin: 1em 0; padding: 14px 16px; overflow: auto; white-space: pre-wrap; background: #fff; border: 1px solid #e4ddd2; border-radius: 8px; }
|
|
347
|
-
.frame { margin: 0; padding: 0; }
|
|
348
|
-
iframe.page { display: block; width: 100%; height: calc(100vh - 53px); border: 0; background: #fff; }
|
|
349
|
-
`.trim()}function q7(e){return mo(VM(e))}function XM(e){return PM(e.language)?`<div class="frame"><iframe class="page" sandbox="" srcdoc="${mo(e.content)}"></iframe></div>`:GM(e.language)?`<article class="doc md">${WM(e.content)}</article>`:`<article class="doc"><pre class="source">${q7(e)}</pre></article>`}function QM(e){return`<article class="doc"><pre class="source">${q7(e)}</pre></article>`}function JM(){return`<script>
|
|
350
|
-
(function () {
|
|
351
|
-
var previewBtn = document.getElementById("view-preview");
|
|
352
|
-
var sourceBtn = document.getElementById("view-source");
|
|
353
|
-
var previewPane = document.getElementById("pane-preview");
|
|
354
|
-
var sourcePane = document.getElementById("pane-source");
|
|
355
|
-
if (!previewBtn || !sourceBtn || !previewPane || !sourcePane) return;
|
|
356
|
-
function show(mode) {
|
|
357
|
-
var source = mode === "source";
|
|
358
|
-
previewBtn.classList.toggle("is-active", !source);
|
|
359
|
-
sourceBtn.classList.toggle("is-active", source);
|
|
360
|
-
previewBtn.setAttribute("aria-pressed", String(!source));
|
|
361
|
-
sourceBtn.setAttribute("aria-pressed", String(source));
|
|
362
|
-
previewPane.classList.toggle("is-active", !source);
|
|
363
|
-
sourcePane.classList.toggle("is-active", source);
|
|
364
|
-
}
|
|
365
|
-
previewBtn.addEventListener("click", function () { show("preview"); });
|
|
366
|
-
sourceBtn.addEventListener("click", function () { show("source"); });
|
|
367
|
-
})();
|
|
368
|
-
<\/script>`}function eO(e){const t=mo(e.path),n=e.truncated?`<p class="notice">${mo(FM)}</p>`:"",a=jd(e.language);return`<!doctype html>
|
|
369
|
-
<html lang="zh-CN">
|
|
370
|
-
<head>
|
|
371
|
-
<meta charset="utf-8">
|
|
372
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
373
|
-
<title>${t}</title>
|
|
374
|
-
<style>
|
|
375
|
-
${ZM()}
|
|
376
|
-
</style>
|
|
377
|
-
</head>
|
|
378
|
-
<body>
|
|
379
|
-
<header class="bar">
|
|
380
|
-
<div class="meta">
|
|
381
|
-
<strong>${t}</strong>
|
|
382
|
-
<span class="kind">${mo(a||"text")}${e.truncated?" · 已截断":""}</span>
|
|
383
|
-
</div>
|
|
384
|
-
<div class="modes" role="group" aria-label="查看模式">
|
|
385
|
-
<button type="button" id="view-preview" class="is-active" aria-pressed="true">预览</button>
|
|
386
|
-
<button type="button" id="view-source" aria-pressed="false">查看原文</button>
|
|
387
|
-
</div>
|
|
388
|
-
</header>
|
|
389
|
-
${n}
|
|
390
|
-
<div id="pane-preview" class="pane is-active">${XM(e)}</div>
|
|
391
|
-
<div id="pane-source" class="pane">${QM(e)}</div>
|
|
392
|
-
${JM()}
|
|
393
|
-
</body>
|
|
394
|
-
</html>`}function tO(){const e=globalThis.screen;return{availWidth:e?.availWidth,availHeight:e?.availHeight}}function nO(){const e=globalThis;if(typeof e.open!="function")throw new Error("window.open is unavailable");return{open:e.open.bind(e),createObjectURL:e.URL.createObjectURL.bind(e.URL),revokeObjectURL:e.URL.revokeObjectURL.bind(e.URL)}}function rO(e,t=nO(),n=$M(tO())){let a;try{const s=eO(e),o=new Blob([s],{type:"text/html;charset=utf-8"});a=t.createObjectURL(o);const c=t.open(a,"_blank",n);if(!c)return t.revokeObjectURL(a),{ok:!1,error:t3};try{c.opener=null}catch{}return{ok:!0}}catch{return a&&t.revokeObjectURL(a),{ok:!1,error:t3}}}function Au(e){const t=e.nodes.length,n=e.nodes.filter(a=>["succeeded","completed","passed"].includes(a.status)).length;return{completed:n,total:t,pct:t?Math.round(n/t*100):0}}function r3(e){const[t,n]=w.useState("files"),a=e.activeTab??t,s=!!e.dagRunId,o=[{id:"files",label:"文件"},...e.contextContent?[{id:"context",label:"上下文"}]:[],...e.callsContent?[{id:"calls",label:"调用记录"}]:[],...e.activityContent?[{id:"activity",label:"运行活动"}]:[],...s?[{id:"dag",label:"DAG"}]:[]],c=o.some(C=>C.id===a)?a:"files",d=w.useRef(null),m=w.useRef(null),h=w.useRef(null),p=w.useRef(null),b=w.useRef(null),x=w.useRef(null),y=w.useRef(e.open),S=C=>{n(C),e.onSelectTab?.(C)},T=C=>{switch(C){case"context":return m;case"calls":return h;case"activity":return p;case"dag":return b;default:return d}};w.useEffect(()=>{c!==a&&S(c)},[a,c]),w.useEffect(()=>{const C=y.current;y.current=e.open,!C&&e.open&&x.current?.focus()},[e.open]);const A=C=>{if(o.length<2)return;let M=null;const I=Math.max(0,o.findIndex(P=>P.id===c));if(C.key==="ArrowLeft"||C.key==="ArrowRight"){const P=C.key==="ArrowRight"?1:-1;M=o[(I+P+o.length)%o.length]?.id??null}else C.key==="Home"?M=o[0]?.id??null:C.key==="End"&&(M=o[o.length-1]?.id??null);M&&(C.preventDefault(),S(M),T(M).current?.focus())};return e.open?u.jsxs("aside",{className:"oc-details-rail","aria-label":"辅助栏",children:[u.jsxs("header",{className:"oc-details-rail-head",children:[u.jsx("div",{className:"oc-details-tabs",role:"tablist","aria-label":"辅助栏",children:o.map(C=>{const M=C.id==="context"||C.id==="calls"||C.id==="activity"?C.id:null;return u.jsxs("div",{className:`oc-details-tab${c===C.id?" is-active":""}`,role:"presentation",children:[u.jsx("button",{type:"button",id:`oc-details-tab-${C.id}`,ref:T(C.id),role:"tab","aria-selected":c===C.id,"aria-controls":"oc-details-rail-body",tabIndex:c===C.id?0:-1,className:"oc-details-tab-select",onClick:()=>S(C.id),onKeyDown:A,children:C.label}),M&&e.onCloseTab?u.jsx("button",{type:"button",className:"oc-details-tab-close","aria-label":`关闭${C.label}标签页`,title:`关闭${C.label}`,onClick:()=>e.onCloseTab?.(M),children:u.jsx(Ss,{size:13,"aria-hidden":"true"})}):null]},C.id)})}),u.jsx("button",{type:"button",className:"oc-details-rail-toggle",ref:x,onClick:e.onToggleOpen,"aria-label":"关闭辅助栏","aria-expanded":e.open,"aria-controls":"oc-details-rail-body",title:"关闭辅助栏",children:u.jsx(Dk,{})})]}),e.open?u.jsx("div",{id:"oc-details-rail-body",className:"oc-details-rail-body",role:"tabpanel","aria-labelledby":`oc-details-tab-${c}`,"data-tab":c,children:c==="dag"&&e.dagRunId?u.jsxs("section",{className:"oc-details-dag","aria-label":"当前 DAG",children:[u.jsxs("header",{children:[u.jsx("strong",{children:"当前 DAG"}),u.jsx("code",{children:e.dagRunId})]}),e.dagRun?u.jsxs(u.Fragment,{children:[u.jsxs("p",{className:"oc-details-dag-point",children:["运行点:",u.jsx("code",{children:e.dagRun.currentNodeId??"—"}),e.dagRun.status?u.jsxs("span",{children:["(",e.dagRun.status,")"]}):null]}),u.jsx("ul",{className:"oc-details-dag-nodes","aria-label":"DAG 节点",children:e.dagRun.nodes.map(C=>u.jsxs("li",{"data-status":C.status,children:[u.jsx("span",{className:"oc-details-dag-node-id",children:C.id}),u.jsx("span",{className:"oc-details-dag-node-status",children:C.status})]},C.id))}),u.jsxs("p",{className:"oc-details-dag-progress",children:["完成 ",Au(e.dagRun).completed,"/",Au(e.dagRun).total]}),u.jsx("div",{className:"oc-details-dag-progressbar",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Au(e.dagRun).pct,"aria-label":"DAG 完成进度",children:u.jsx("div",{className:"oc-details-dag-progressfill",style:{width:`${Au(e.dagRun).pct}%`}})})]}):u.jsx("p",{className:"oc-details-dag-empty-reason",children:"当前运行暂无安全汇总数据,等待运行数据同步。"})]}):c==="context"?e.contextContent:c==="calls"?e.callsContent:c==="activity"?e.activityContent:e.children},c):null]}):u.jsx("aside",{className:"oc-details-rail is-collapsed","aria-label":"辅助栏","aria-hidden":"true",inert:!0})}function aO(e){return e.language==="md"||e.language==="markdown"}function a3(e){const t=e.previews.find(d=>d.path===e.activePath),n=t?aO(t):!1,[a,s]=w.useState(n?"preview":"source"),[o,c]=w.useState(null);return w.useEffect(()=>{s(n?"preview":"source"),c(null)},[t?.path,n]),!t&&!e.loading?null:u.jsxs(u.Fragment,{children:[t&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"oc-file-preview-backdrop",onMouseDown:d=>{d.target===d.currentTarget&&e.onClose(t.path)}}),u.jsxs("section",{className:"oc-file-preview","aria-label":`文件预览 ${t.path}`,children:[u.jsxs("header",{children:[u.jsx("div",{className:"oc-file-tabs",role:"tablist","aria-label":"文件预览 Tabs",children:e.previews.map(d=>{const m=d.path===t.path;return u.jsxs("div",{className:`oc-file-tab${m?" is-active":""}`,title:d.path,children:[u.jsx("button",{type:"button",role:"tab","aria-selected":m,className:"oc-file-tab-activate",onClick:()=>e.onActivate(d.path),children:d.path}),u.jsx("button",{type:"button",className:"oc-file-preview-close","aria-label":`关闭预览 ${d.path}`,title:"关闭预览",onClick:()=>e.onClose(d.path),children:u.jsx(Ss,{size:14,"aria-hidden":"true"})})]},d.path)})}),u.jsxs("span",{children:[t.bytes," bytes",t.truncated?" · 已截断":""]}),u.jsxs("div",{className:"oc-file-preview-actions",children:[n&&u.jsxs("div",{className:"oc-file-view-modes",role:"group","aria-label":"文件查看模式",children:[u.jsx("button",{type:"button",className:`oc-file-view-mode${a==="preview"?" is-active":""}`,"aria-pressed":a==="preview",onClick:()=>s("preview"),children:"预览"}),u.jsx("button",{type:"button",className:`oc-file-view-mode${a==="source"?" is-active":""}`,"aria-pressed":a==="source",onClick:()=>s("source"),children:"源文件"})]}),u.jsx("button",{type:"button",className:"oc-file-preview-open",title:"新窗口打开","aria-label":`新窗口打开 ${t.path}`,onClick:()=>{const d=rO(t);c(d.ok?null:d.error)},children:u.jsx(tk,{size:16,"aria-hidden":"true"})})]})]}),o?u.jsx("p",{className:"oc-file-preview-open-error",role:"alert",children:o}):null,a==="preview"&&n?u.jsx("div",{className:"oc-file-preview-rendered",children:u.jsx(nc,{text:t.content})}):u.jsx("pre",{children:u.jsx("code",{children:t.content})})]})]}),e.loading&&u.jsx("div",{className:"oc-file-preview-loading",children:"正在读取文件…"})]})}const H7=[{command:"/task",label:"Task context",description:"查看当前任务、Draft 与 assessment",action:"focus-panel:task",source:"operator"},{command:"/contract",label:"Contract",description:"查看 contract diff 与 apply gate",action:"focus-panel:contract",source:"operator"},{command:"/dag",label:"DAG",description:"查看 DAG spine、确认与运行状态",action:"focus-panel:dag",source:"operator"},{command:"/interview",label:"Interview",description:"打开 Requirement Interview",action:"focus:interview",source:"operator"},{command:"/reload",label:"Reload session",description:"重新加载当前 Pi 会话的设置、扩展、技能、提示词、主题与上下文文件(不产生消息)",action:"reload",source:"operator"}],U7=[{command:"/compact",label:"压缩上下文",description:"压缩当前会话上下文,释放 token",action:"compact",source:"web"},{command:"/name",label:"重命名会话",description:"设置当前会话标题",action:"name",source:"web"},{command:"/session",label:"会话信息",description:"显示当前会话元信息",action:"session",source:"web"},{command:"/copy",label:"复制回复",description:"复制最后一条助手消息原文",action:"copy",source:"web"}],ys={operator:0,web:1,extension:2,skill:3,prompt:4};function i3(e){const t=e.trim().split(/\s+/,1)[0]??"";return t?t.startsWith("/")?t.toLowerCase():`/${t.toLowerCase()}`:""}function s3(e){const t=e.trim().split(/\s+/,1)[0]?.toLowerCase();if(!t?.startsWith("/"))return;const n=[...H7,...U7].find(a=>a.command===t);return n?{command:n.command,action:n.action}:{command:t,action:"unknown"}}function iO(e){if(e==="focus-panel:task"||e==="focus-panel:contract")return"tasks";if(e==="focus-panel:dag")return"recovery"}function sO(e=[]){const t=new Map,n=a=>{const s=i3(a.command);if(!s)return;const o=t.get(s);if(!o){t.set(s,{...a,command:s});return}ys[a.source]<ys[o.source]&&t.set(s,{...a,command:s})};for(const a of H7)n({command:a.command,label:a.label,description:a.description,source:a.source,action:a.action});for(const a of U7)n({command:a.command,label:a.label,description:a.description,source:a.source,action:a.action});for(const a of e){const s=i3(a.command);s&&n({command:s,label:a.label||s,description:a.description||"",source:a.source,action:"pi-prompt"})}return[...t.values()].sort((a,s)=>{const o=ys[a.source]-ys[s.source];return o!==0?o:a.command.localeCompare(s.command)})}function oO(e,t){const n=(t.trim().split(/\s+/,1)[0]??"").toLowerCase();if((/\s/.test(t.trimStart().slice(1))||t.includes(" "))&&t.trimStart().includes(" "))return[];const a=n.startsWith("/")?n:n?`/${n}`:"/",s=a==="/"?"":a.slice(1),o=[];for(const c of e){const d=c.command.toLowerCase(),m=d.startsWith("/")?d.slice(1):d,h=c.description.toLowerCase();let p=100;if(!s)p=10+ys[c.source];else if(d===a||m===s)p=0;else if(d.startsWith(a)||m.startsWith(s))p=1;else if(m.includes(s)||d.includes(s))p=2;else if(h.includes(s))p=3;else continue;o.push({...c,score:p})}return o.sort((c,d)=>{if(c.score!==d.score)return c.score-d.score;const m=ys[c.source]-ys[d.source];return m!==0?m:c.command.localeCompare(d.command)})}const lO={operator:"Operator",web:"Pi Web",extension:"Extensions",prompt:"Prompts",skill:"Skills"},cO=new Set(["operatorCapabilities","operationList","operationGet","operationEventSummary","statsContext","sourceInstructions","spineCheck","inspect","observeLink"]);function uO(e){return cO.has(e)?"technical-only":e==="doctor"?"inline-detail":"activity-detail"}const dO={newTask:"创建任务",importPrd:"任务需求",contractShow:"任务边界",contractApply:"更新任务契约",contractDiff:"任务契约差异",contractDraftSave:"任务契约草稿",contractValidate:"检查任务契约",taskAdvance:"推进任务准备",dagRunTask:"执行流程",dagValidate:"校验执行流程",prepareDagConfirmation:"执行确认",confirmDagConfirmation:"确认执行边界",prepareDagExecution:"执行边界",runDag:"任务执行",operationWait:"执行监督",operationGet:"任务活动详情",operationList:"会话活动",operationEventSummary:"执行进展摘要",dagStatus:"执行状态",dagDoctor:"执行诊断",dagReport:"执行结果",dagRerunPlan:"节点恢复评估",dagRerun:"从失败节点恢复",dagInterruptEligibility:"中止资格",standaloneTaskRerun:"带反馈重新执行",workerTaskRetry:"重试 Worker 任务",workerPoolDoctor:"任务池诊断",promoteRun:"任务推进",status:"任务状态"},fO={newTask:{running:"正在创建任务",success:"任务已经创建",error:"创建任务时遇到问题"},importPrd:{running:"正在整理并导入任务需求",success:"任务需求已经导入",error:"导入任务需求时遇到问题"},contractShow:{running:"正在读取任务目标和执行边界",success:"任务目标与执行边界已经读取",error:"读取任务边界时遇到问题"},taskAdvance:{running:"正在推进任务契约并准备执行流程",success:"任务已经推进到下一安全阶段",error:"任务推进被契约或执行边界阻塞"},dagRunTask:{running:"正在生成并校验执行流程",success:"执行流程已经准备好",error:"准备执行流程时遇到问题"},prepareDagExecution:{running:"正在确认任务可以安全执行",success:"执行边界已经确认",error:"执行边界尚未通过确认"},runDag:{running:"正在启动任务执行",success:"任务执行已经启动",error:"启动任务执行时遇到问题"},dagReport:{running:"正在读取本次执行结果",success:"本次执行结果已经读取",error:"读取执行结果时遇到问题"},dagRerunPlan:{running:"正在评估能否从失败节点安全恢复",success:"节点恢复条件评估已经完成",error:"暂时无法确定安全的恢复方式"},dagRerun:{running:"正在创建节点恢复 run",success:"节点恢复 run 已经启动",error:"从失败节点恢复时遇到问题"},dagInterruptEligibility:{running:"正在检查能否协作中止此运行",success:"中止资格已经确认",error:"当前运行不能协作中止"},standaloneTaskRerun:{running:"正在创建新的完整 DAG,并带入上一轮未解决反馈",success:"新的完整 DAG 已经按上一轮反馈重新执行",error:"带反馈重新执行任务时遇到问题"},workerPoolDoctor:{running:"正在读取任务池状态",success:"任务池状态已经读取",error:"读取任务池状态时遇到问题"},promoteRun:{running:"正在推进任务状态",success:"任务状态已经更新",error:"推进任务状态时遇到问题"},status:{running:"正在读取任务状态",success:"任务状态已经更新",error:"读取任务状态时遇到问题"},contractApply:{running:"正在应用任务契约变更",success:"任务契约已经更新",error:"应用任务契约变更时遇到问题"},contractDiff:{running:"正在比较任务契约版本",success:"任务契约差异已经读取",error:"比较任务契约时遇到问题"},contractDraftSave:{running:"正在保存任务契约草稿",success:"任务契约草稿已经保存",error:"保存任务契约草稿时遇到问题"},contractValidate:{running:"正在检查任务契约",success:"任务契约检查已经完成",error:"任务契约检查没有通过"},dagValidate:{running:"正在校验执行流程",success:"执行流程校验已经通过",error:"执行流程校验没有通过"},prepareDagConfirmation:{running:"正在准备执行确认",success:"执行确认已经准备好",error:"准备执行确认时遇到问题"},confirmDagConfirmation:{running:"正在确认执行边界",success:"执行边界已经确认",error:"执行边界尚未通过确认"},operationGet:{running:"正在读取任务活动详情",success:"任务活动详情已经读取",error:"读取任务活动详情时遇到问题"},operationList:{running:"正在读取本次对话的活动",success:"本次对话的活动已经读取",error:"读取对话活动时遇到问题"},operationEventSummary:{running:"正在汇总执行进展",success:"执行进展已经汇总",error:"汇总执行进展时遇到问题"},dagStatus:{running:"正在读取执行状态",success:"执行状态已经更新",error:"读取执行状态时遇到问题"},dagDoctor:{running:"正在诊断本次任务执行",success:"任务执行诊断已经完成",error:"诊断任务执行时遇到问题"},workerTaskRetry:{running:"正在重试失败的任务",success:"失败任务已经重新开始",error:"重试失败任务时遇到问题"},doctor:{running:"正在检查运行环境",success:"运行环境检查已经完成",error:"运行环境检查发现问题"},inspect:{running:"正在读取详细运行信息",success:"详细运行信息已经读取",error:"读取详细运行信息时遇到问题"},observeLink:{running:"正在准备运行看板入口",success:"运行看板入口已经准备好",error:"准备运行看板入口时遇到问题"},operatorCapabilities:{running:"正在读取可用操作能力",success:"可用操作能力已经读取",error:"读取可用操作能力时遇到问题"},sourceInstructions:{running:"正在读取任务来源说明",success:"任务来源说明已经读取",error:"读取任务来源说明时遇到问题"},spineCheck:{running:"正在检查计划执行步骤",success:"计划执行步骤检查已经完成",error:"计划执行步骤检查发现问题"},statsContext:{running:"正在统计上下文使用情况",success:"上下文使用情况已经统计完成",error:"统计上下文使用情况时遇到问题"}},mO=[{pattern:/(?:^|-)contract(?:-pi)?$/i,running:"正在核对任务目标和执行边界",finished:"任务目标与执行边界已确认",error:"任务边界存在冲突,需要先处理"},{pattern:/scout-src/i,running:"正在梳理与任务相关的代码",finished:"相关代码范围已梳理",error:"梳理相关代码时遇到问题"},{pattern:/scout-tests/i,running:"正在检查现有测试和验证方式",finished:"现有测试与验证方式已确认",error:"检查现有测试时遇到问题"},{pattern:/plan/i,running:"正在整理具体实施步骤",finished:"实施步骤已经准备好",error:"实施方案还需要进一步完善"},{pattern:/implement|writer/i,running:"正在修改并保存相关文件",finished:"文件修改已经完成",error:"修改文件时遇到问题"},{pattern:/verify|reverify/i,running:"正在验证本次修改",finished:"本次修改已通过验证",error:"验证没有通过,正在检查原因"},{pattern:/review/i,running:"正在检查改动是否完整",finished:"改动完整性检查已通过",error:"发现需要补充或修正的内容"},{pattern:/closeout/i,running:"正在整理交付结果",finished:"任务已经完成并形成交付记录",error:"交付结果尚未整理完整"}];function F7(e){if(!(!e||typeof e!="object"))return e}function Cp(e){if(e&&typeof e=="object")return e;if(typeof e=="string")try{return F7(JSON.parse(e))}catch{return}}function yh(e){const n=Cp(e)?.operationId;return typeof n=="string"&&n?n:void 0}function hO(e){const n=Cp(e)?.maxWaitMs;if(!(typeof n!="number"||!Number.isFinite(n)||n<=0))return Math.max(1,Math.round(n/1e3))}function $7(e){const t=e.operationId??yh(e.args)??yh(e.result)??yh(e.resultText);return t?`operation:${t}`:`tool:${e.id}`}function pO(e){return e==="running"?"progress":e==="error"?"error":"success"}function gO(e){return Cp(e.resultText??e.result)}function bO(e){return Array.isArray(e.events)?e.events.flatMap(t=>{const n=F7(t);if(!n)return[];const a=n.messagePreview??n.message;return typeof a=="string"?[a]:[]}):[]}function vO(e,t,n){const a=[];for(const m of e)for(const h of m.matchAll(/node-(started|finished)[^\n]*?node=([^\s,]+)/gi)){const p=h[1]?.toLowerCase(),b=h[2]??"",x=m.match(/status=([^\s,]+)/i)?.[1]?.toUpperCase();let y="finished";x==="ERROR"||x==="FAILED"?y="error":p==="started"&&(y="running"),a.push({node:b,status:y})}const s=a.at(-1);if(!s)return;const o=a.some(m=>/scout-src/i.test(m.node)&&m.status==="finished"),c=a.some(m=>/scout-tests/i.test(m.node)&&m.status==="finished");if(o&&c)return{id:t,kind:"success",title:"代码与测试的影响范围已确认",activityRef:n};const d=mO.find(m=>m.pattern.test(s.node));return d?s.status==="running"?{id:t,kind:"progress",title:d.running,activityRef:n}:s.status==="error"?{id:t,kind:"error",title:d.error,activityRef:n}:{id:t,kind:"success",title:d.finished,activityRef:n}:{id:t,kind:"success",title:"执行状态已经更新",activityRef:n}}function yO(e){const t=$7(e),n=`activity:${e.id}`,a=hO(e.args);if(e.status==="running")return{id:n,kind:"progress",title:a?`正在等待新的执行进展,最长等待时间 ${a} 秒`:"正在等待新的执行进展",activityRef:t};if(e.status==="error")return{id:n,kind:"error",title:"等待执行进展时遇到问题",activityRef:t};let s="";typeof e.resultText=="string"?s=e.resultText:typeof e.result=="string"&&(s=e.result);const o=gO(e),c=vO([s,...o?bO(o):[]],n,t);if(c)return c;if(o){if(o.timedOut===!0||o.changed===!1)return{id:n,kind:"warning",title:"等待期间没有新的执行进展",activityRef:t};if(o.changed===!0)return{id:n,kind:"success",title:"已经收到新的执行进展",activityRef:t}}return{id:n,kind:"success",title:"执行状态已经更新",activityRef:t}}function xO(e){const t=uO(e.toolName);if(t==="technical-only"||t==="inline-detail")return;if(e.toolName==="operationWait")return yO(e);const n=fO[e.toolName];if(!n)return;let a=n.success;return e.status==="running"?a=n.running:e.status==="error"&&(a=n.error),{id:`activity:${e.id}`,kind:pO(e.status),title:a,activityRef:$7(e)}}function P7(e){return dO[e]??"任务活动"}function Rp(e){switch(e){case"starting":return{label:"正在启动",kind:"progress"};case"running":return{label:"运行中",kind:"progress"};case"succeeded":case"finished":case"FINISHED":case"pass":return{label:"已完成",kind:"success"};case"failed":case"partial_failed":case"ERROR":case"FAILED":case"timed-out":return{label:"未完成",kind:"error"};case"needs-reconcile":return{label:"需要同步",kind:"warning"};case"cancelled":case"abandoned":case"superseded":return{label:"已停止",kind:"warning"};default:return{label:"状态已更新",kind:"success"}}}function G7(e){return[e.activityRef??`operation:${e.operationId}`,`operation:${e.operationId}`,...e.toolCallId?[`tool:${e.toolCallId}`]:[]]}function V7(e){return[e.activityRef??`gate:${e.cardId}`]}function K7(e){return[e.activityRef??`artifact:${e.artifactId}`]}function wO(e){return new Set([...e.operations.flatMap(G7),...e.gates.flatMap(V7),...e.artifacts.flatMap(K7)])}function o3(e){return e.updatedSeq??e.eventSeq}function l3(e){const t=Date.parse(e.updatedAt);return Number.isFinite(t)?t:0}function Np(e,t){const n=o3(e),a=o3(t);return n!==void 0&&a!==void 0?n-a:l3(e)-l3(t)}function kO(e){return e.taskId?`task:${e.taskId}`:e.dagRunId?`run:${e.dagRunId}`:`operation:${e.operationId}`}function SO(e){return e.taskId?e.taskId.replace(/^\d{4}-\d{2}-\d{2}-/,"").replace(/[-_]+/g," ").trim()||e.taskId:P7(e.action)}function EO(e){return[...new Set(e)]}function TO(e){const t=new Map;for(const n of e)t.set(n.action,n);return[...t.values()].sort(Np).map(n=>{const a=Rp(n.state);return{id:n.operationId,label:P7(n.action),stateLabel:a.label,kind:a.kind,at:n.updatedAt}})}function CO(e){const t=new Map;for(const n of e){const a=n.dagRunId??n.runSummary?.runId;if(!a)continue;const s=t.get(a)??[];s.push(n),t.set(a,s)}return[...t.entries()].flatMap(([n,a])=>{const s=[...a].sort((h,p)=>Np(p,h)),o=s[0];if(!o)return[];const c=s.find(h=>h.runSummary)?.runSummary,d=c?.status??o.state,m=Rp(d);return[{runId:n,state:d,stateLabel:m.label,kind:m.kind,updatedAt:o.updatedAt,operationCount:a.length,firstFailedNode:c?.nodes.find(h=>h.status==="ERROR")?.id,failureCategory:c?.failureCategory,inspectHref:o.inspectHref}]}).sort((n,a)=>Date.parse(a.updatedAt)-Date.parse(n.updatedAt))}function Y7(e){const t=new Map;for(const n of e){const a=kO(n),s=t.get(a)??[];s.push(n),t.set(a,s)}return[...t.entries()].flatMap(([n,a])=>{const s=[...a].sort(Np),o=s.at(-1);if(!o)return[];const c=Rp(o.state);return[{key:n,taskId:o.taskId,displayTitle:SO(o),state:o.state,stateLabel:c.label,kind:c.kind,updatedAt:o.updatedAt,latestOperation:o,operations:s,steps:TO(s),runs:CO(s),activityRefs:EO(s.flatMap(G7)),compactEligible:c.kind==="success"}]}).sort((n,a)=>{const s=n.kind==="progress"||n.kind==="error"?0:1,o=a.kind==="progress"||a.kind==="error"?0:1;return s!==o?s-o:Date.parse(a.updatedAt)-Date.parse(n.updatedAt)})}const RO={operation:"执行记录",contract:"任务契约",dag:"执行流程",report:"报告",html:"HTML 预览"};function NO(e){const{artifact:t}=e,n=!!(t.reportText||t.htmlPreview);return u.jsxs("section",{className:"oc-artifact-card","aria-label":`任务产物:${t.title??t.artifactId}`,"data-activity-ref":t.activityRef??`artifact:${t.artifactId}`,children:[u.jsxs("header",{children:[u.jsxs("div",{children:[u.jsx("small",{children:"任务产物"}),u.jsx("strong",{children:t.title??t.artifactId}),u.jsx("code",{children:t.artifactId})]}),u.jsx("span",{children:RO[t.kind]})]}),t.summary?u.jsx("p",{children:t.summary}):null,n?u.jsxs("details",{className:"oc-artifact-details",children:[u.jsx("summary",{children:"预览与技术详情"}),t.reportText?u.jsx("pre",{children:t.reportText}):null,t.htmlPreview?u.jsx("iframe",{title:`${t.title??t.artifactId} preview`,sandbox:"",srcDoc:t.htmlPreview}):null]}):null,t.inspectHref?u.jsx("footer",{children:u.jsx("button",{className:"btn btn-ghost",type:"button",onClick:()=>ks(qi(t.inspectHref??"")),children:"打开产物"})}):null]})}const c3={prepared:"等待确认",confirmed:"已经确认",dispatched:"正在执行",consumed:"已经完成",stale:"已经失效",expired:"已经过期",error:"处理失败"};function u3(e){return e.gateType==="contract-apply"?"确认任务契约变更":e.gateType==="mutation"?"确认执行工作区修改":"确认启动任务执行"}function AO({card:e,origin:t,sessionId:n}){const[a,s]=w.useState(!1),[o,c]=w.useState(),d=async()=>{s(!0),c(void 0);try{let b="contract-apply";e.gateType==="dag-run"?b=e.state==="prepared"?"dag-confirm":"dag-run":e.gateType==="mutation"&&(b="mutation-apply");const x=e.gateType==="dag-run"?{confirmationId:e.confirmationId,...e.state==="prepared"?{humanGateToken:e.humanGateToken}:{}}:{receiptId:e.receiptId,humanGateToken:e.humanGateToken},y=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(n)}/human-gate/${b}`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json","x-loop-console-confirmation":qn()},body:JSON.stringify(x)}),S=await y.json();if(!y.ok)throw new Error(S.error?.message??`HTTP ${y.status}`)}catch(b){c(b instanceof Error?b.message:String(b))}finally{s(!1)}},m=e.state==="prepared"||e.gateType==="dag-run"&&e.state==="confirmed";let h="确认接受";e.gateType==="mutation"?h="确认执行":e.gateType==="dag-run"&&(h=e.state==="prepared"?"确认边界":"启动执行");const p=(e.displayOnlyChallenges?.length??0)+(e.dagSpine?.length??0);return u.jsxs("section",{className:`oc-human-gate-card is-${e.state}`,"aria-label":`${u3(e)}:${c3[e.state]}`,"data-activity-ref":e.activityRef??`gate:${e.cardId}`,children:[u.jsxs("header",{children:[u.jsxs("div",{children:[u.jsx("small",{children:"人工门禁"}),u.jsx("strong",{children:u3(e)}),u.jsx("code",{children:e.taskId})]}),u.jsx("span",{children:c3[e.state]})]}),e.contractDiffSummary?u.jsx("p",{className:"oc-human-gate-summary",children:e.contractDiffSummary}):null,p>0||e.errorMessage?u.jsxs("details",{className:"oc-human-gate-details",children:[u.jsxs("summary",{children:["门禁详情 · ",p," 项"]}),e.displayOnlyChallenges?.length?u.jsxs("div",{className:"oc-human-gate-challenges",children:[u.jsx("b",{children:"确认前请检查"}),u.jsx("ul",{children:e.displayOnlyChallenges.map(b=>u.jsx("li",{children:b},b))})]}):null,e.dagSpine?.length?u.jsxs("div",{children:[u.jsx("b",{children:"计划执行步骤"}),u.jsx("ol",{children:e.dagSpine.map(b=>u.jsx("li",{children:u.jsx("code",{children:b})},b))})]}):null,e.errorMessage?u.jsx("p",{className:"oc-human-gate-error",children:e.errorMessage}):null]}):null,u.jsxs("footer",{children:[u.jsx("button",{className:"btn btn-ghost",type:"button",onClick:()=>ks(qi(e.inspectHref)),children:"查看记录"}),u.jsx("button",{className:"btn btn-primary",type:"button",disabled:!m||a,onClick:()=>{d()},children:a?"提交中…":h})]}),o?u.jsx("div",{className:"oc-human-gate-error",children:o}):null]})}const IO={validation:"节点输出未通过契约或门禁校验。可在恢复页从失败节点重跑;若错误指向任务契约(如验证命令、Mock 策略),先修正任务配置并重新生成 DAG。",executor:"执行器或模型提供方调用失败(网络、配额或运行时错误)。稍后可在恢复页从失败节点重跑;反复出现请到「模型与认证」页检查配置与凭据。","write-guard":"写入越过了授权边界(writeSet / allowedPaths)。检查计划中的写入路径是否越界,修正后从失败节点重跑。",timeout:"节点执行超时。可在恢复页从失败节点重跑;反复超时建议缩小任务范围或排查卡住的命令。",auth:"模型或服务认证失败。请先到「模型与认证」页检查 API Key 与模型配置,再从失败节点重跑。","human-required":"节点正在等待人工审批。完成审批后该节点可继续执行;也可在恢复页查看对账状态。","human-rejected":"人工审批被拒绝。请调整任务描述或契约后重新发起任务。","shell-command":"验证/构建命令以非零退出。进入 DAG 查看命令输出定位具体失败,修复后从失败节点重跑。","static-error":"静态检查(typecheck / lint 等)失败。修复对应代码错误后从失败节点重跑。","decision-envelope":"决策与证据不匹配(决策包络校验失败)。进入 DAG 查看节点决策依据,修正后重跑。",unknown:"失败原因未归类。进入 DAG 查看节点详情,或在恢复页使用对账 / 诊断入口。"};function _O(e){if(e)return IO[e]}function d3(e,t=900){if(e)return e.length>t?`${e.slice(0,t)}…`:e}function xh(e){return new Date(e).toLocaleString()}function f3(e){if(!e)return;const t=e.trim();if(/taskId[^\n]*(?:placeholder|占位)|["']?<id>["']?/i.test(t))return"任务编号仍是占位符;请提供实际的 YYYY-MM-DD-<slug> 任务编号后重试。";if(/ENOENT|no such file or directory/i.test(t))return"任务活动缺少所需文件或目录,可进入 DAG 查看详情。";if(/command failed|exited with code/i.test(t))return"相关命令没有成功完成,可进入 DAG 查看详情。";if(!(t.length>220||t.startsWith("{")||t.startsWith("[")||t.includes("[dag execute]")||t.includes("schemaVersion")||/[A-Za-z]:\\/.test(t)))return t}function MO(e){const t=e.latestOperation,n=t.runSummary;if(e.kind==="success"||e.kind==="progress")return;const a=n?.nodes.find(c=>c.status==="ERROR")?.id;if(a){const c=n?.failureCategory?`,原因分类为 ${n.failureCategory}`:"";return`执行在 ${a} 阶段未完成${c}。`}const s=n?.next?.description;if(s&&/fail|error|block|cannot|unable/i.test(s))return s;const o=f3(t.stderrPreview)??f3(t.summaryPreview);return o||(e.kind==="error"?"本次任务活动没有完成,可进入 DAG 查看详情或使用恢复选项。":"本次任务活动需要进一步确认,请查看相关记录。")}function OO(e){const{journey:t}=e,n=t.latestOperation,a=t.runs[0],s=t.runs.slice(1),o=qi(n.inspectHref),c=MO(t),d=t.kind==="error"||t.kind==="warning",m=t.latestOperation.runSummary,h=m?.nodes.find(x=>x.failureCategory)?.failureCategory??m?.failureCategory,p=d?_O(h):void 0,b=(x,y)=>{e.onNavigateWorkspace?e.onNavigateWorkspace(x,y):window.location.assign(V9(x,y))};return e.compact?u.jsxs("details",{className:"oc-journey-compact",children:[u.jsxs("summary",{children:[u.jsx("span",{className:`oc-journey-dot is-${t.kind}`,"aria-hidden":"true"}),u.jsxs("span",{children:[u.jsx("strong",{children:t.displayTitle}),u.jsxs("small",{children:[t.stateLabel," · ",xh(t.updatedAt)]})]}),u.jsx("span",{"aria-hidden":"true",children:"›"})]}),u.jsxs("div",{className:"oc-journey-compact-body",children:[t.taskId?u.jsx("code",{children:t.taskId}):null,u.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>ks(o),children:"查看记录"})]})]}):u.jsxs("section",{className:`oc-task-journey-card is-${t.kind}`,"aria-label":`${t.displayTitle}:${t.stateLabel}`,children:[u.jsxs("header",{className:"oc-journey-head",children:[u.jsxs("div",{children:[u.jsxs("div",{className:"oc-journey-state-line",children:[u.jsx("span",{className:`oc-journey-dot is-${t.kind}`,"aria-hidden":"true"}),u.jsx("span",{children:t.stateLabel})]}),u.jsx("strong",{children:t.displayTitle}),t.taskId?u.jsxs("small",{children:["Task · ",u.jsx("code",{children:t.taskId})]}):null]}),u.jsx("time",{dateTime:t.updatedAt,children:xh(t.updatedAt)})]}),u.jsx("div",{className:"oc-journey-steps","aria-label":"任务旅程",children:t.steps.slice(-6).map(x=>u.jsxs("div",{className:"oc-journey-step",children:[u.jsx("span",{className:`oc-journey-step-icon is-${x.kind}`,"aria-hidden":"true",children:x.kind==="success"?"✓":x.kind==="error"?"!":"•"}),u.jsx("span",{children:x.label}),u.jsx("small",{children:x.stateLabel})]},x.id))}),c?u.jsxs("div",{className:`oc-journey-outcome is-${t.kind}`,children:[u.jsx("strong",{children:d?"当前问题":"最新结果"}),u.jsx("p",{children:c}),p?u.jsxs("p",{className:"oc-journey-advice","data-testid":"oc-journey-advice",children:["建议:",p]}):null]}):null,a?u.jsxs("div",{className:"oc-journey-latest-run",children:[u.jsx("span",{children:"最新执行"}),u.jsx("code",{children:a.runId}),u.jsx("b",{className:`is-${a.kind}`,children:a.stateLabel}),a.firstFailedNode?u.jsxs("small",{children:["失败阶段 · ",a.firstFailedNode]}):null]}):null,s.length>0?u.jsxs("details",{className:"oc-journey-history",children:[u.jsxs("summary",{children:["执行历史 ",t.runs.length," 次"]}),u.jsx("div",{children:t.runs.map(x=>u.jsxs("div",{className:"oc-journey-run-row",children:[u.jsx("code",{children:x.runId}),u.jsx("span",{className:`is-${x.kind}`,children:x.stateLabel}),x.firstFailedNode?u.jsx("small",{children:x.firstFailedNode}):null,u.jsx("time",{dateTime:x.updatedAt,children:xh(x.updatedAt)})]},x.runId))})]}):null,u.jsxs("footer",{className:"oc-journey-actions",children:[u.jsx("button",{className:"btn btn-ghost",type:"button",onClick:()=>{const x=n.dagRunId??a?.runId,y=x?qi(`/#/inspect/dag/${encodeURIComponent(x)}`):o;ks(y)},children:"进入 DAG"}),d&&(t.taskId||n.dagRunId)?u.jsx("button",{className:"btn btn-primary",type:"button",onClick:()=>b("recovery",{taskId:t.taskId,dagRunId:n.dagRunId}),children:"恢复选项"}):null]}),u.jsxs("details",{className:"oc-journey-technical",children:[u.jsxs("summary",{children:["技术详情 · ",t.operations.length," 项活动"]}),u.jsx("div",{className:"oc-journey-technical-body",children:t.operations.map(x=>u.jsxs("div",{className:"oc-journey-operation-row",children:[u.jsxs("div",{children:[u.jsx("code",{children:x.operationId}),u.jsx("span",{children:x.action})]}),x.dagRunId?u.jsxs("small",{children:["run · ",x.dagRunId]}):null,x.controller?u.jsxs("small",{children:["controller · ",x.controller]}):null,x.stderrPreview?u.jsx("pre",{className:"is-error",children:d3(x.stderrPreview)}):null,x.summaryPreview?u.jsx("pre",{children:d3(x.summaryPreview)}):null]},x.operationId))})]})]})}function m3(e){return e.state==="prepared"||e.state==="confirmed"?0:e.state==="dispatched"?1:e.state==="error"?2:3}function wh(e,t){return e!==null&&t.includes(e)}function DO(e){return e.operations>0?"operations":e.gates>0?"gates":"artifacts"}function jO(e){const t=w.useRef(null),[n,a]=w.useState("operations"),s=w.useMemo(()=>Y7(e.operationCards),[e.operationCards]),o=s.length+e.humanGateCards.length+e.artifactCards.length,c=w.useMemo(()=>[...e.humanGateCards].sort((m,h)=>{const p=m3(m)-m3(h);return p!==0?p:(h.eventSeq??0)-(m.eventSeq??0)}),[e.humanGateCards]),d=w.useMemo(()=>[...e.artifactCards].sort((m,h)=>(h.eventSeq??0)-(m.eventSeq??0)),[e.artifactCards]);return w.useEffect(()=>{a(DO({operations:s.length,gates:e.humanGateCards.length,artifacts:e.artifactCards.length}))},[e.sessionId]),w.useEffect(()=>{e.focusRef&&(e.focusRef.startsWith("gate:")?a("gates"):e.focusRef.startsWith("artifact:")?a("artifacts"):a("operations"))},[e.focusRef]),w.useEffect(()=>{if(!e.focusRef)return;const m=window.requestAnimationFrame(()=>{const h=t.current;if(!h)return;Array.from(h.querySelectorAll("[data-activity-ref], [data-tool-call-id], [data-activity-refs]")).find(x=>{const y=x.dataset.activityRefs?.split(" ")??[];return x.dataset.activityRef===e.focusRef||y.includes(e.focusRef??"")||x.dataset.toolCallId&&`tool:${x.dataset.toolCallId}`===e.focusRef})?.scrollIntoView({block:"nearest",behavior:"smooth"})});return()=>window.cancelAnimationFrame(m)},[n,e.focusRef]),o===0?null:u.jsxs("section",{ref:t,id:"oc-activity-panel",className:"oc-activity-rail is-embedded","aria-label":"本次对话的活动",children:[u.jsxs("header",{className:"oc-activity-rail-head",children:[u.jsxs("div",{children:[u.jsx("strong",{children:"本次对话的活动"}),u.jsx("small",{children:"运行、门禁与任务产物"})]}),u.jsx("span",{className:"oc-activity-count",children:o})]}),u.jsxs("div",{className:"oc-activity-content",children:[u.jsxs("div",{className:"oc-activity-tabs",role:"tablist","aria-label":"活动类型",children:[u.jsxs("button",{type:"button",role:"tab","aria-selected":n==="operations",className:n==="operations"?"is-active":"",onClick:()=>a("operations"),children:["运行 ",u.jsx("span",{children:s.length})]}),u.jsxs("button",{type:"button",role:"tab","aria-selected":n==="gates",className:n==="gates"?"is-active":"",onClick:()=>a("gates"),children:["门禁 ",u.jsx("span",{children:c.length})]}),u.jsxs("button",{type:"button",role:"tab","aria-selected":n==="artifacts",className:n==="artifacts"?"is-active":"",onClick:()=>a("artifacts"),children:["产物 ",u.jsx("span",{children:d.length})]})]}),u.jsxs("div",{className:"oc-activity-list",children:[n==="operations"&&s.length===0?u.jsx("div",{className:"oc-activity-empty",children:"本次对话还没有任务执行记录。"}):null,n==="operations"?s.map((m,h)=>{const p=m.activityRefs;return u.jsxs("div",{"data-activity-refs":p.join(" "),className:`oc-activity-card-wrap${wh(e.focusRef,p)?" is-focused":""}`,children:[u.jsx(OO,{journey:m,compact:h>0&&m.compactEligible,origin:e.origin,onNavigateWorkspace:e.onNavigateWorkspace}),u.jsx("button",{type:"button",className:"oc-activity-locate",onClick:()=>e.onLocateConversation(p),children:"查看对话位置"})]},m.key)}):null,n==="gates"&&c.length===0?u.jsx("div",{className:"oc-activity-empty",children:"本次对话还没有需要展示的门禁。"}):null,n==="gates"?c.map(m=>{const h=V7(m);return u.jsx("div",{className:`oc-activity-card-wrap${wh(e.focusRef,h)?" is-focused":""}`,children:u.jsx(AO,{card:m,origin:e.origin,sessionId:e.sessionId})},m.cardId)}):null,n==="artifacts"&&d.length===0?u.jsx("div",{className:"oc-activity-empty",children:"本次对话还没有任务产物。"}):null,n==="artifacts"?d.map(m=>{const h=K7(m);return u.jsx("div",{className:`oc-activity-card-wrap${wh(e.focusRef,h)?" is-focused":""}`,children:u.jsx(NO,{artifact:m})},m.artifactId)}):null]})]},e.sessionId)]})}const h3={comfortableMin:620,compactMin:480};function LO(e){return!Number.isFinite(e)||e<0?"extra-compact":e>=h3.comfortableMin?"comfortable":e>=h3.compactMin?"compact":"extra-compact"}function zO(e){return`is-landing-${e}`}const BO=[{label:"新建任务",hint:"先走需求分析 skills,再导入创建任务",prompt:["我要新建任务。请先做需求分析,不要用一句话直接 bootstrapFromPrd。","1. 先问我需求内容和范围(frontend / backend / both,默认 both)。","2. 读取并严格执行 `.agents/skills/analyze-product-requirements/SKILL.md`(`loop-agent init --profile full` 会投影该 skill):按规程澄清访谈、校验,并把产物写到 `docs/product-analysis/<requirement-id>/`(product-analysis.md、requirement-clarification.md、product-requirement.md)。","3. product-requirement 为 complete 且校验通过后,再严格执行 `.agents/skills/analyze-product-dependencies/SKILL.md`,生成 dependency-analysis.md 和按需的 api-documentation.md。","4. 两套产物都校验通过后,再用这些文件 bootstrapFromPrd 创建任务,并建议 taskKind。","若上述 skill 不存在,先说明缺失,并提示运行 `loop-agent init --repo-root . --profile full --merge`。"].join(`
|
|
395
|
-
`)},{label:"查看任务状态",hint:"列出任务与就绪/阻塞状态",prompt:"列出当前所有 task 及其状态,重点说明哪些是 Ready 可以推进、哪些 Blocked 及阻塞原因。"},{label:"诊断 DAG 运行",hint:"对失败运行跑 Doctor",prompt:"帮我诊断最近失败或异常的 DAG 运行:先列出最近的 DAG 运行,对有问题的运行执行 doctor,总结根因和可执行的恢复方案。"},{label:"恢复或重跑任务",hint:"默认从节点续跑,勿无故新开 task",prompt:"我要恢复失败或卡住的 DAG。请先 dagReport/dagDoctor 看 primaryFailure.nodeId 与 primaryRecovery;默认用 dagRerunPlan→dagRerun 从失败节点续跑(plan 合格后直接 dagRerun,不要 prepareMutationGate)。不要新建 task-id。plan 不合格时:Worker Task Pool Failed 用 workerPoolDoctor 确认后再 workerTaskRetry;独立 Console run 用 standaloneTaskRerun(整单重生,不是从节点续跑)。paused/中断需要 resume 时准备 Human Gate,不要自己调 dagResume。确定后直接帮我发起。"}];function W7(e){const t=e.readiness==="setup-required",n=!!e.disabled||t,a=e.density??"comfortable",s=e.mode==="no-session"?"开始一段新的对话":"今天想推进什么?",o=e.mode==="no-session"?"用自然语言编排 loop-agent:查询状态、诊断问题、创建与恢复任务。可先点选下方建议,或新建空白对话。":"会话已就绪。点选建议快速开场,或在下方输入框直接描述目标。业务写入仍经受治理 DAG。";return u.jsxs("div",{className:`oc-empty ${zO(a)}`,role:"status","data-landing-density":a,children:[u.jsxs("div",{className:"oc-empty-hero",children:[u.jsx("img",{className:"oc-empty-icon oc-empty-brand",src:"/favicon.svg",alt:"","aria-hidden":"true",draggable:!1}),u.jsxs("div",{className:"oc-empty-copy",children:[u.jsx("h3",{children:s}),u.jsx("p",{children:o})]})]}),u.jsx("div",{className:"oc-suggestions","aria-label":"开场建议",children:BO.map(c=>u.jsxs("button",{type:"button",className:"oc-suggestion",onClick:()=>e.onSuggest(c.prompt),disabled:n,children:[u.jsx("strong",{children:c.label}),u.jsx("span",{children:a==="extra-compact"?c.hint.replace(/[,,].*$/,""):c.hint})]},c.label))}),u.jsxs("ul",{className:"oc-empty-tips",children:[u.jsxs("li",{children:[u.jsx("kbd",{children:"@"}),u.jsx("span",{children:"引用仓库文件"})]}),u.jsxs("li",{children:[u.jsx("kbd",{children:"/"}),u.jsx("span",{children:"快捷命令"})]}),u.jsxs("li",{children:[u.jsx("kbd",{children:"Enter"}),u.jsx("span",{children:"发送 · Shift+Enter 换行"})]})]}),e.mode==="no-session"&&e.onCreateSession?u.jsx("button",{type:"button",className:"btn btn-primary oc-empty-cta",onClick:e.onCreateSession,disabled:n,"aria-busy":e.disabled||void 0,children:t?"需先完成 Pi setup":e.disabled?"创建中…":"新建空白对话"}):null]})}function qO(e){const{interview:t,interviewAnswer:n,onAnswerChange:a,onAnswer:s}=e;return u.jsxs("section",{className:"oc-draft-card","aria-label":"Requirement Interview",children:[u.jsxs("header",{children:[u.jsx("strong",{children:"Requirement Interview"}),u.jsx("span",{children:t.state})]}),t.question&&u.jsxs("div",{className:"oc-interview-bubble",children:[u.jsx("strong",{children:t.question.text}),u.jsxs("p",{children:["建议:",t.question.recommendation]}),u.jsx("textarea",{value:n,onChange:o=>a(o.target.value),placeholder:"输入答案"}),u.jsxs("div",{children:[u.jsx("button",{className:"btn btn-primary",type:"button",onClick:()=>s("override"),disabled:!n.trim(),children:"提交答案"}),u.jsx("button",{className:"btn btn-ghost",type:"button",onClick:()=>s("accept-recommendation"),children:"接受建议"})]})]}),t.draft&&u.jsxs("details",{open:!0,children:[u.jsxs("summary",{children:["TaskContractDraftV1 · ",t.draftSha256?.slice(0,12)]}),u.jsx("pre",{children:JSON.stringify(t.draft,null,2)})]}),t.assessment&&u.jsxs("div",{className:`oc-assessment${t.assessment.fresh?" is-fresh":""}`,children:[u.jsxs("strong",{children:["完整性:",t.assessment.outcome]}),(t.assessment.missingFields??[]).length>0&&u.jsxs("p",{children:["缺失:",t.assessment.missingFields?.join("、")]})]}),t.taskKindRecommendation&&u.jsxs("div",{className:"oc-task-kind-card",children:[u.jsx("span",{children:"taskKind 建议"}),u.jsx("strong",{children:t.taskKindRecommendation}),u.jsx("button",{className:"btn btn-primary",type:"button",onClick:()=>e.onConfirmTaskKind(),children:"由我确认"}),u.jsx("small",{children:"模型不能代替人类确认。"})]}),t.confirmedTaskKind&&u.jsxs("div",{className:"oc-task-kind-card is-confirmed",children:["已由人类确认:",u.jsx("strong",{children:t.confirmedTaskKind})]})]})}function Fu(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toLocaleString()}function C1(e){const[t,n]=w.useState(!1),a=()=>{navigator.clipboard?.writeText(e.text).then(()=>{n(!0),window.setTimeout(()=>n(!1),1600)},()=>{})};return u.jsx("button",{type:"button",className:`oc-message-copy${t?" is-copied":""}`,"aria-label":t?"已复制":"复制消息",title:t?"已复制":"复制",onClick:a,children:t?u.jsx(Mk,{}):u.jsx(_k,{})})}function HO({message:e,streaming:t}){const[n,a]=w.useState(!1),s=e.text.trim().length>0,o=e.compaction,c=o?.status??"completed",d=o?.tokensBefore,m=o?.estimatedTokensAfter;let h;return c==="running"?h=o?.reason==="overflow"?"检测到上下文过大,正在压缩上下文…":o?.reason==="threshold"?"上下文接近上限,正在压缩上下文…":"正在压缩上下文…":c==="failed"?h="上下文压缩失败":c==="aborted"?h="上下文压缩已取消":d!==void 0&&m!==void 0?h=`已压缩历史上下文(${Fu(d)} → ${Fu(m)} tokens)`:d!==void 0?h=`已压缩历史上下文(压缩前约 ${Fu(d)} tokens)`:h="已压缩历史上下文",c==="completed"&&o?.willRetry&&(h+=t?" · 正在继续原请求…":" · 已继续原请求"),u.jsxs("div",{className:`oc-compaction-card is-${c}${n?" is-expanded":""}`,role:c==="failed"?"alert":"status",children:[u.jsxs("button",{type:"button",className:"oc-compaction-trigger",disabled:!s,"aria-busy":c==="running","aria-expanded":s?n:void 0,onClick:()=>a(p=>!p),children:[u.jsxs("span",{className:"oc-compaction-leading","aria-hidden":"true",children:[u.jsx("span",{className:"oc-compaction-icon",children:c==="running"?u.jsx("span",{className:"oc-spinner oc-spinner-inline"}):u.jsx(ik,{size:15})}),u.jsx("span",{className:"oc-compaction-chevron",children:n?u.jsx(md,{size:15}):u.jsx(Pw,{size:15})})]}),u.jsx("strong",{children:"compact"}),u.jsx("span",{className:"oc-compaction-separator","aria-hidden":"true"}),u.jsx("span",{className:"oc-compaction-summary-line",children:h}),u.jsx("span",{className:"oc-compaction-time",children:Hl(e.createdAt)})]}),n&&s?u.jsx("div",{className:"oc-compaction-details",children:u.jsx(nc,{text:e.text})}):null]})}function p3(e){const{message:t,streaming:n,activeAssistantId:a}=e;if(t.kind==="compaction")return u.jsx(HO,{message:t,streaming:n});const s=t.role==="user",o=s?"你":"助手",c=!s&&n&&a!==null&&t.id===a,d=c&&t.text.length===0,m=t.text.trim().length>0,h=u.jsxs("div",{className:"oc-meta",children:[!s&&u.jsx("span",{className:"oc-role oc-role-assistant","aria-hidden":"true",children:"π"}),u.jsxs("span",{className:"oc-time",children:[Hl(t.createdAt),u.jsxs("span",{className:"sr-only",children:["(",o,")"]})]}),m&&u.jsx(C1,{text:t.text})]}),p=u.jsxs("div",{className:`oc-bubble ${s?"oc-bubble-user":"oc-bubble-assistant"}`,children:[m?s?u.jsx("div",{style:{whiteSpace:"pre-wrap"},children:t.text}):u.jsx(nc,{text:t.text}):d?u.jsx("span",{className:"oc-cursor","aria-hidden":"true"}):null,c&&m&&u.jsx("span",{className:"oc-cursor","aria-hidden":"true"})]});return u.jsx("div",{className:`oc-row ${s?"is-user":"is-assistant"}`,"data-user-message-id":s?t.id:void 0,children:s?u.jsxs("div",{className:"oc-user-stack",children:[p,h]}):u.jsxs(u.Fragment,{children:[h,p]})})}function UO(e){switch(e){case"authentication":return"认证失败";case"context-overflow":return"上下文过大";case"rate-limit":return"请求过于频繁";default:return"Provider 请求失败"}}function FO(){return u.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[u.jsx("path",{d:"M10 2.4 18 16H2L10 2.4Z",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinejoin:"round"}),u.jsx("path",{d:"M10 7v4.3",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),u.jsx("circle",{cx:"10",cy:"14",r:".9",fill:"currentColor"})]})}function $O({error:e}){const[t,n]=w.useState(!1),a=[e.code===void 0?void 0:`HTTP ${e.code}`,e.type].filter(Boolean);return u.jsxs("section",{className:"oc-provider-error",role:"status",children:[u.jsx("div",{className:"oc-provider-error-mark",children:u.jsx(FO,{})}),u.jsxs("div",{className:"oc-provider-error-body",children:[u.jsxs("div",{className:"oc-provider-error-heading",children:[u.jsx("strong",{children:UO(e.category)}),a.length>0&&u.jsx("span",{className:"oc-provider-error-meta",children:a.join(" · ")})]}),u.jsx("p",{children:e.message}),u.jsxs("details",{className:"oc-provider-error-details",open:t,onToggle:s=>n(s.currentTarget.open),children:[u.jsx("summary",{children:t?"收起原始响应":"查看原始响应"}),u.jsx("pre",{children:e.raw})]})]})]})}function PO(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return null}if(!t||typeof t!="object")return null;const n=t.todos;return Array.isArray(n)?n.filter(a=>!!a&&typeof a=="object"&&typeof a.content=="string"&&(a.status==="pending"||a.status==="in_progress"||a.status==="completed")):null}function GO(e){const t=PO(e);if(!t)return null;const n=t.filter(s=>s.status==="completed").length,a=t.filter(s=>s.status==="in_progress");return{text:`${n}/${t.length} 已完成${a[0]?.content?` · ${a[0].content}`:""}`,extra:Math.max(0,a.length-1)}}function VO(e){const t={size:14,"aria-hidden":!0};return e.kind==="bash"?u.jsx(rk,{...t}):e.kind==="read"?u.jsx(Yw,{...t}):e.kind==="search"?u.jsx(Ph,{...t}):e.kind==="write"?u.jsx(F1,{...t}):e.kind==="web"?u.jsx(Ww,{...t}):e.kind==="mcp"?u.jsx(Qw,{...t}):u.jsx(sk,{...t})}function KO(e,t){const n=e.split(/\r?\n/).map(a=>a.trim()).filter(Boolean);return(t?n.at(-1):n[0])??"…"}function YO(e){const t=e.split(/\r?\n/).map(n=>n.replace(/\s+/g," ").trim()).find(Boolean);return t?t.length>180?`${t.slice(0,180)}…`:t:"工具调用失败"}function Z7(e){const{entry:t}=e,[n,a]=w.useState(t.status==="error"),[s,o]=w.useState(!1),c=t.status==="running"?"运行中":t.status==="error"?"出错":"完成",d=fk(t.args,{toolName:t.toolName}),m=bk(t.createdAt,t.finishedAt),h=hk(t.toolName),p=mk(t.toolName),b=t.toolName==="todo_write",x=b?GO(t.args):null,y=u5(t.resultText??t.result),S=t.status==="error"?YO(y):d,T=x?.text??S,A=gk(y,s?{maxLen:Number.MAX_SAFE_INTEGER}:void 0);return w.useEffect(()=>{t.status==="error"&&a(!0)},[t.status]),u.jsxs("div",{className:`oc-tool ${t.status==="error"?"is-error":""} ${t.status==="running"?"is-running":""} is-${p.kind}`,"data-tool-kind":p.kind,children:[u.jsxs("button",{type:"button",className:"oc-tool-head","aria-expanded":n,onClick:()=>a(C=>!C),children:[u.jsxs("span",{className:"oc-tool-leading",children:[t.status==="error"?u.jsx("span",{className:"oc-tool-state-dot","aria-hidden":"true"}):u.jsx("span",{className:"oc-tool-icon",children:b?u.jsx(s5,{size:14,"aria-hidden":"true"}):u.jsx(VO,{kind:p.kind})}),u.jsx(g5,{})]}),u.jsx("span",{className:"oc-tool-name",children:b?"更新任务清单":p.label}),S&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"oc-tool-separator","aria-hidden":"true"}),u.jsx("span",{className:`oc-tool-args${t.status==="error"?" is-error":""}`,children:T})]}),x&&x.extra>0?u.jsxs("span",{className:"oc-tool-summary-suffix",children:["+",x.extra]}):null,m!==void 0&&u.jsxs("span",{className:"oc-tool-duration",children:[m,"s"]}),u.jsx("span",{className:"sr-only",children:c})]}),n&&u.jsxs("div",{className:"oc-tool-body",children:[t.args!==void 0&&u.jsxs("div",{className:"oc-tool-section",children:[u.jsx("div",{className:"oc-tool-label",children:h.argsLabel}),u.jsx("pre",{className:"oc-tool-code",children:pk(t.args)})]}),(t.resultText!==void 0||t.result!==void 0)&&u.jsxs("div",{className:"oc-tool-section",children:[u.jsx("div",{className:"oc-tool-label",children:t.status==="error"?"错误":h.resultLabel}),u.jsx("pre",{className:"oc-tool-code",children:A.text}),A.truncated&&!s&&u.jsx("button",{type:"button",className:"btn btn-ghost oc-tool-expand-result",onClick:()=>o(!0),children:"展开全部"})]}),t.status==="running"&&t.resultText===void 0&&t.result===void 0&&t.args===void 0&&u.jsx("div",{className:"oc-tool-section",children:u.jsx("div",{className:"oc-tool-waiting",children:"等待结果…"})})]})]})}function WO(e){const{thinking:t,defaultOpen:n}=e,[a,s]=w.useState(n),o=KO(t,n);return w.useEffect(()=>{s(n)},[n]),u.jsxs("div",{className:`oc-thinking${n?" is-running":""}`,children:[n?u.jsx("span",{className:"sr-only",children:"运行中"}):null,u.jsxs("button",{type:"button",className:`oc-thinking-summary${a?" is-open":""}`,"aria-expanded":a,onClick:()=>s(c=>!c),children:[u.jsxs("span",{className:"oc-tool-leading",children:[u.jsx("span",{className:"oc-tool-icon",children:u.jsx(ak,{size:14,"aria-hidden":"true"})}),u.jsx(g5,{})]}),u.jsx("span",{className:"oc-thinking-label",children:"Think"}),a?null:u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"oc-tool-separator","aria-hidden":"true"}),u.jsx("span",{className:"oc-thinking-preview",children:o})]})]}),a?u.jsx("pre",{className:"oc-thinking-body",children:t||"…"}):null]})}function ZO(e){return e.kind==="progress"?"••":e.kind==="success"?"✓":e.kind==="warning"?"!":"×"}function XO(e){const{activity:t,onActivate:n}=e,a=!!(t.activityRef&&n&&(e.canActivate?.(t.activityRef)??!0)),s=u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"oc-semantic-activity-icon","aria-hidden":"true",children:ZO(t)}),u.jsxs("span",{className:"oc-semantic-activity-copy",children:[u.jsx("strong",{children:t.title}),t.detail?u.jsx("small",{children:t.detail}):null]}),a?u.jsx("span",{className:"oc-semantic-activity-link",children:"查看详情"}):null]});if(a&&t.activityRef&&n){const o=t.activityRef;return u.jsx("button",{type:"button",className:`oc-semantic-activity is-${t.kind}`,"data-activity-ref":o,onClick:()=>n(o),children:s})}return u.jsx("div",{className:`oc-semantic-activity is-${t.kind}`,"data-activity-ref":t.activityRef,children:s})}function QO(e){const{items:t,live:n}=e;return u.jsx(u.Fragment,{children:t.map((a,s)=>{if(a.kind==="thinking")return u.jsx(WO,{thinking:a.thinking,defaultOpen:n},`thinking-${s}`);if(a.kind==="text")return u.jsx("div",{className:"oc-process-text",children:u.jsx(nc,{text:a.text})},`text-${s}`);if(a.kind==="activity")return u.jsx(XO,{activity:a.activity,onActivate:e.onActivateActivity,canActivate:e.canActivateActivity},a.activity.id);if(a.kind==="tool")return u.jsx(Z7,{entry:a.tool},a.tool.id);if(a.kind==="provider-error")return u.jsx($O,{error:a.error},`provider-error-${s}`)})})}function JO(e){const{scrollContainerRef:t,messagesEndRef:n,onScroll:a,showScrollToLatest:s,onScrollToLatest:o,hasThread:c,readiness:d,streaming:m,streamingAssistantId:h,messagesCount:p,visibleCount:b,onLoadMore:x,turnGroups:y,interview:S}=e;return u.jsxs("div",{ref:t,className:`oc-messages${c?" has-thread":" is-empty"}`,onScroll:a,children:[c?null:u.jsx(W7,{mode:"empty-session",readiness:d,disabled:m,onSuggest:e.onSuggest}),c?u.jsxs("div",{className:"oc-message-column",children:[p>b&&u.jsx("button",{type:"button",className:"btn btn-ghost oc-load-history",onClick:x,children:"加载更早消息"}),y.map((T,A)=>{const C=T.user??T.assistants[0],M=A>0?y[A-1].user??y[A-1].assistants[0]:void 0,I=!!C&&(!M||Jf(M.createdAt)!==Jf(C.createdAt)),P=T.answer,U=!!P?.text.trim(),N=T.live&&T.processItems.length===0;return u.jsxs("div",{className:"oc-turn-group","aria-live":T.live?"polite":void 0,children:[I&&C&&u.jsx("div",{className:"oc-day-sep",children:Jf(C.createdAt)}),T.user&&u.jsx(p3,{message:T.user,streaming:m,activeAssistantId:h}),T.processItems.length>0&&u.jsx(QO,{items:T.processItems,live:T.live,onActivateActivity:e.onActivateActivity,canActivateActivity:e.canActivateActivity}),P&&(U||N)?u.jsx(p3,{message:P,streaming:m,activeAssistantId:h}):null]},T.key)}),S&&u.jsx(qO,{interview:S,interviewAnswer:e.interviewAnswer,onAnswerChange:e.onInterviewAnswerChange,onAnswer:e.onAnswerInterview,onConfirmTaskKind:e.onConfirmTaskKind}),u.jsx("div",{ref:n})]}):u.jsx("div",{ref:n}),c&&s?u.jsx("div",{className:"oc-scroll-to-latest-slot",children:u.jsx("button",{type:"button",className:"oc-scroll-to-latest","aria-label":"跳转到最新输出",title:"跳转到最新输出",onClick:o,children:u.jsx(md,{size:19,"aria-hidden":"true"})})}):null]})}const eD=13,g3=240;function tD(e){const t=e.trim();return t.length>g3?`${t.slice(0,g3).trimEnd()}…`:t}function kh(e,t=64){const n=e.trim().replace(/\s+/g," ");return n.length>t?`${n.slice(0,t)}…`:n}function nD(e,t){if(e.length===0)return[];const n=t>0?Math.max(1,Math.floor(t/eD)):e.length;if(e.length<=n)return e.map((s,o)=>({key:`b${o}`,members:[s]}));const a=[];for(let s=0;s<n;s+=1){const o=Math.floor(s*e.length/n),c=Math.floor((s+1)*e.length/n),d=e.slice(o,Math.max(c,o+1));d.length>0&&a.push({key:`b${s}`,members:d})}return a}function rD(e){const{scrollContainerRef:t,turnGroups:n,measureKey:a}=e,s=w.useRef(null),o=w.useMemo(()=>n.filter(I=>I.user).map((I,P)=>{const U=I.user;return{id:U.id,index:P+1,text:U.text,createdAt:U.createdAt}}),[n]),[c,d]=w.useState(0),[m,h]=w.useState(null),[p,b]=w.useState(null),x=w.useRef(new Map),y=w.useRef(0),S=w.useRef(null),T=w.useCallback(()=>{const I=t.current;if(!I)return;const P=I.offsetTop,U=new Map;for(const z of o){const X=I.querySelector(`[data-user-message-id="${CSS.escape(z.id)}"]`);X&&U.set(z.id,Math.max(0,X.offsetTop-P))}x.current=U;const N=s.current?.clientHeight??I.clientHeight;N!==y.current&&(y.current=N,d(N))},[t,o]),A=w.useCallback(()=>{const I=t.current;if(!I)return;const P=48;let U=null;for(const N of o){const z=x.current.get(N.id);if(z!==void 0)if(z<=I.scrollTop+P)U=N.id;else break}h(U)},[t,o]);w.useEffect(()=>{const I=window.requestAnimationFrame(T);return()=>window.cancelAnimationFrame(I)},[T,a]),w.useEffect(()=>{const I=t.current;if(!I)return;const P=()=>{S.current=null,T(),A()},U=()=>{S.current===null&&(S.current=window.requestAnimationFrame(P))};U(),I.addEventListener("scroll",U,{passive:!0}),window.addEventListener("resize",U);const N=new MutationObserver(U);return N.observe(I,{childList:!0,subtree:!0}),()=>{I.removeEventListener("scroll",U),window.removeEventListener("resize",U),N.disconnect(),S.current!==null&&(window.cancelAnimationFrame(S.current),S.current=null)}},[T,A,t]);const C=w.useMemo(()=>nD(o,c),[o,c]),M=w.useCallback(I=>{const P=t.current,U=x.current.get(I);!P||U===void 0||P.scrollTo({top:Math.max(0,U-8),behavior:"smooth"})},[t]);return o.length===0?null:u.jsx("nav",{ref:s,className:"oc-anchor-rail","aria-label":`用户消息锚点(共 ${o.length} 条)`,children:C.map(I=>{const P=I.members[0],U=m!==null&&I.members.some(X=>X.id===m),N=I.members.length,z=p===I.key;return u.jsxs("div",{className:"oc-anchor-cluster",onMouseEnter:()=>b(I.key),onMouseLeave:()=>b(null),children:[u.jsx("button",{type:"button",className:`oc-anchor-bar${U?" is-active":""}${N>1?" is-cluster":""}`,title:N>1?`${N} 条相邻输入`:void 0,"aria-label":N>1?`定位到 ${N} 条聚合输入中的第 ${P.index} 条:${kh(P.text,40)}`:`定位到第 ${P.index} 条输入:${kh(P.text,80)}`,onClick:()=>M(P.id),onFocus:()=>b(I.key),onBlur:()=>b(null)}),z?u.jsx("div",{className:"oc-anchor-popover",role:"tooltip",children:N>1?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"oc-anchor-popover-head",children:[u.jsxs("span",{children:[N," 条聚合输入"]}),u.jsxs("span",{children:["第 ",P.index,"–",I.members[I.members.length-1].index," 条"]})]}),u.jsx("ul",{className:"oc-anchor-popover-list",children:I.members.map(X=>u.jsx("li",{children:u.jsxs("button",{type:"button",className:"oc-anchor-popover-item",onClick:()=>M(X.id),children:[u.jsx("span",{className:"oc-anchor-popover-item-time",children:Hl(X.createdAt)}),u.jsx("span",{className:"oc-anchor-popover-item-text",children:kh(X.text)})]})},X.id))})]}):u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"oc-anchor-popover-head",children:[u.jsxs("span",{children:["第 ",P.index,"/",o.length," 条输入"]}),u.jsx("span",{children:Hl(P.createdAt)})]}),u.jsx("div",{className:"oc-anchor-popover-body",children:tD(P.text)})]})}):null]},I.key)})})}function X7(e){return e.inputTokens+e.cacheReadTokens+e.cacheWriteTokens}function aD(e){const t=X7(e);return t>0?Math.round(e.cacheReadTokens/t*100):null}function Sh(e){const t=e/1e3;if(t<60)return`${Math.round(t*10)/10}s`;const n=Math.round(t);return`${Math.floor(n/60)}m${n%60}s`}function b3(e){const t=n=>n>=100?String(Math.round(n)):String(Math.round(n*10)/10);return e<1e3?String(e):e<1e6?`${t(e/1e3)}K`:`${t(e/1e6)}M`}const iD={auto:"auto(跟随 Pi 默认等级)",off:"off · 关闭",minimal:"minimal · 极简",low:"low · 低",medium:"medium · 中",high:"high · 高",xhigh:"xhigh · 极高",max:"max · 最高"};function Q7(e,t){const n=t.trim().toLowerCase(),a=new Map;for(const s of e){if(n&&!s.provider.toLowerCase().includes(n)&&!s.id.toLowerCase().includes(n)&&!(s.name??"").toLowerCase().includes(n))continue;const o=a.get(s.provider)??[];o.push(s),a.set(s.provider,o)}return[...a.entries()].map(([s,o])=>({provider:s,models:o}))}function sD(e,t){const n=new Set,a=[],s=o=>{n.has(o)||(n.add(o),a.push({value:o,label:iD[o]??o,...o==="auto"&&t?{effective:t}:{}}))};s("auto");for(const o of e)s(o);return a}function Ts(e,t){return`${e}/${t}`}function R1(e){return{...e.modelProvider&&e.modelId?{model:{provider:e.modelProvider,modelId:e.modelId}}:{},...e.thinkingLevel?{thinkingLevel:e.thinkingLevel}:{}}}function J7(e,t){return{...e,model:t.model??e.model,thinkingLevel:t.thinkingLevel??e.thinkingLevel}}function oD(e,t){const n=J7(e,t);return n.model?.provider===e.model?.provider&&n.model?.modelId===e.model?.modelId&&n.thinkingLevel===e.thinkingLevel}const v3={auto:"Auto",off:"Off",minimal:"Minimal",low:"Low",medium:"Medium",high:"High",xhigh:"XHigh",max:"Max"};function lD(e,t){const n=e,a=v3[n]??n;return n!=="auto"||!t?a:`${a} · ${v3[t]??t}`}function cD(e,t){if(!t)return"选择模型";const n=e.find(s=>Ts(s.provider,s.id)===t);if(n)return n.name?.trim()||n.id;const a=t.indexOf("/");return a===-1?t:t.slice(a+1)}function uD(){return u.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",children:u.jsx("path",{d:"M2.6 4.2 6 7.6l3.4-3.4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function y3(){return u.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14","aria-hidden":"true",children:u.jsx("path",{d:"m5 3.5 3.5 3.5L5 10.5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function dD(){return u.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14","aria-hidden":"true",children:u.jsx("path",{d:"M9 3.5 5.5 7 9 10.5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function fD(e){const t=Wl(),[n,a]=w.useState(!1),[s,o]=w.useState("root"),[c,d]=w.useState(""),[m,h]=w.useState(0),[p,b]=w.useState(0),[x,y]=w.useState(0),S=w.useRef(null),T=w.useRef(null),A=w.useRef(null),C=t.snapshot,M=t.status==="loading",I=t.status==="error"?t.error:null,P=C?.selection?.effectiveThinkingLevel,U=w.useMemo(()=>C?.thinkingLevels?.length?C.thinkingLevels.map(W=>W.value):void 0,[C?.thinkingLevels]),N=w.useMemo(()=>sD(U??e.thinkingLevels,P),[U,e.thinkingLevels,P]),z=w.useMemo(()=>C?(C.models??[]).map(W=>({provider:W.provider,id:W.id,...W.name?{name:W.name}:{},...W.hasCredentials!==void 0?{hasCredentials:W.hasCredentials}:{}})):e.models,[C,e.models]),X=w.useMemo(()=>Q7(z,c),[z,c]),B=w.useMemo(()=>X.flatMap(W=>W.models),[X]),$=cD(z,e.activeModelRef),F=e.activeThinkingLevel||"auto",K=lD(F,P),oe=!!e.activeModelRef&&(!e.activeModelListed||!z.some(W=>Ts(W.provider,W.id)===e.activeModelRef)),J=()=>{a(!1),o("root"),d("")};w.useEffect(()=>{if(!n)return;const W=be=>{be.target instanceof Node&&S.current&&!S.current.contains(be.target)&&J()},O=be=>{be.key==="Escape"&&J()};return document.addEventListener("mousedown",W),document.addEventListener("keydown",O),()=>{document.removeEventListener("mousedown",W),document.removeEventListener("keydown",O)}},[n]),w.useEffect(()=>{if(!n)return;if(s==="root"){h(0),window.setTimeout(()=>T.current?.focus(),0);return}if(s==="model"){d(""),b(0),window.setTimeout(()=>A.current?.focus(),0);return}const W=N.findIndex(O=>O.value===F);y(W<0?0:W),window.setTimeout(()=>T.current?.focus(),0)},[n,s,N,F]);const H=W=>{e.disabled||o(W)},_=W=>{if(e.disabled)return;const O=B[W];O&&(J(),e.onSelectModel(O.provider,O.id))},Y=W=>{if(e.disabled)return;const O=N[W];O&&(J(),e.onSelectThinking(O.value))},re=W=>{if(W.key==="ArrowDown"||W.key==="ArrowUp"){W.preventDefault(),h(O=>O===0?1:0);return}(W.key==="Enter"||W.key==="ArrowRight")&&(W.preventDefault(),H(m===0?"model":"thinking"))},fe=W=>{if(W.key==="ArrowDown"){W.preventDefault(),b(O=>B.length?(O+1)%B.length:0);return}if(W.key==="ArrowUp"){W.preventDefault(),b(O=>B.length?(O-1+B.length)%B.length:0);return}if(W.key==="Enter"){W.preventDefault(),_(p);return}W.key==="ArrowLeft"&&(W.preventDefault(),o("root"))},j=W=>{if(W.key==="ArrowDown"){W.preventDefault(),y(O=>N.length?(O+1)%N.length:0);return}if(W.key==="ArrowUp"){W.preventDefault(),y(O=>N.length?(O-1+N.length)%N.length:0);return}if(W.key==="Enter"){W.preventDefault(),Y(x);return}W.key==="ArrowLeft"&&(W.preventDefault(),o("root"))},G=`选择模型,当前 ${$},推理等级 ${K}`;return u.jsxs("div",{className:"oc-select-menu oc-runtime-selection-menu",ref:S,children:[u.jsxs("button",{type:"button",className:"oc-select-trigger oc-runtime-selection-trigger","aria-haspopup":"menu","aria-expanded":n,"aria-label":G,title:G,disabled:e.disabled,onClick:()=>{n?J():(o("root"),a(!0))},children:[u.jsx("span",{className:"oc-runtime-selection-model",children:$}),u.jsx("span",{className:"oc-runtime-selection-effort",children:K}),u.jsx(uD,{})]}),n&&u.jsx("div",{ref:T,className:"oc-select-panel oc-runtime-selection-panel",role:"menu","aria-label":"模型与推理等级",tabIndex:-1,onKeyDown:s==="root"?re:s==="model"?fe:j,children:s==="root"?u.jsxs(u.Fragment,{children:[u.jsxs("button",{type:"button",role:"menuitem",className:`oc-runtime-selection-root-row${m===0?" is-highlighted":""}`,onMouseEnter:()=>h(0),onClick:()=>H("model"),children:[u.jsx("span",{className:"oc-runtime-selection-row-label",children:"模型"}),u.jsxs("span",{className:"oc-runtime-selection-row-value",children:[$,oe?"(不可用)":""]}),u.jsx(y3,{})]}),u.jsxs("button",{type:"button",role:"menuitem",className:`oc-runtime-selection-root-row${m===1?" is-highlighted":""}`,onMouseEnter:()=>h(1),onClick:()=>H("thinking"),children:[u.jsx("span",{className:"oc-runtime-selection-row-label",children:"推理等级"}),u.jsx("span",{className:"oc-runtime-selection-row-value",children:K}),u.jsx(y3,{})]})]}):u.jsxs(u.Fragment,{children:[u.jsxs("button",{type:"button",role:"menuitem",className:"oc-runtime-selection-back",onClick:()=>o("root"),children:[u.jsx(dD,{}),u.jsx("span",{children:s==="model"?"选择模型":"推理等级"})]}),s==="model"?u.jsxs(u.Fragment,{children:[u.jsx("input",{ref:A,className:"oc-select-search",placeholder:"搜索模型或供应商…","aria-label":"搜索模型或供应商",value:c,onChange:W=>{d(W.target.value),b(0)}}),u.jsxs("div",{className:"oc-runtime-selection-groups",children:[M&&u.jsx("div",{className:"oc-select-status",children:"模型列表加载中…"}),I&&u.jsxs("div",{className:"oc-select-status is-error",children:[u.jsxs("span",{children:[I.code?`${I.code}:`:"",I.message]}),u.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{Gh()},children:"重试"})]}),!M&&!I&&X.length===0&&u.jsx("div",{className:"oc-select-status",children:"没有匹配的可用模型"}),X.map(W=>u.jsxs("div",{className:"oc-model-group",children:[u.jsx("div",{className:"oc-model-group-head",children:W.provider}),W.models.map(O=>{const be=Ts(O.provider,O.id),se=be===e.activeModelRef,V=B[p]===O;return u.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":se,title:be,disabled:e.disabled,className:`oc-select-option oc-model-option${V?" is-highlighted":""}${se?" is-active":""}`,onMouseEnter:()=>b(B.indexOf(O)),onClick:()=>{e.disabled||(J(),e.onSelectModel(O.provider,O.id))},children:[u.jsx("span",{className:"oc-model-option-name",children:O.name?.trim()||O.id}),se&&u.jsx("span",{className:"oc-model-option-check",children:"✓"})]},be)})]},W.provider))]})]}):N.map((W,O)=>{const be=W.value===F;return u.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":be,disabled:e.disabled,className:`oc-select-option oc-thinking-option${x===O?" is-highlighted":""}${be?" is-active":""}`,onMouseEnter:()=>y(O),onClick:()=>Y(O),children:[u.jsx("span",{className:"oc-thinking-option-label",children:W.label}),W.value==="auto"&&W.effective?u.jsxs("span",{className:"oc-thinking-badge",children:["Pi 实际:",W.effective]}):null,be&&u.jsx("span",{className:"oc-model-option-check",children:"✓"})]},W.value)})]})})]})}const Eh="--oc-shortcut-palette-available-height",mD=8,hD=8;function pD(e){const t=e.viewportTop??0,n=e.topInset??mD,a=e.anchorGap??hD;if([e.boundaryTop,e.anchorTop,t,n,a].some(c=>!Number.isFinite(c)))return null;const o=Math.max(e.boundaryTop,t);return Math.max(0,Math.floor(e.anchorTop-o-n-a))}function gD(e){const t=w.useMemo(()=>e.items.filter(y=>y.state==="queued"||y.state==="failed"),[e.items]),[n,a]=w.useState(!0),[s,o]=w.useState(null),[c,d]=w.useState(null),m=w.useId();if(w.useEffect(()=>{t.length===0&&!n&&a(!0),s!==null&&!t.some(y=>y.clientRequestId===s.id)&&o(null)},[n,s,t]),t.length===0)return null;const h=s!==null||c!==null,p=!n||h,b=t.length===1||p,x=(y,S,T)=>{d(y),S().then(()=>T?.()).catch(()=>{}).finally(()=>d(A=>A===y?null:A))};return u.jsx("div",{className:"oc-queue-dock","data-queue-dock":"",children:u.jsxs("div",{className:"oc-queue-panel",children:[t.length>1?u.jsxs("button",{type:"button",className:"oc-queue-header","aria-controls":m,"aria-expanded":p,disabled:h,onClick:()=>a(y=>!y),children:[u.jsx("span",{className:"oc-queue-lead","aria-hidden":"true",children:u.jsx(Eb,{size:14})}),u.jsxs("span",{className:"oc-queue-count",children:[t.length," 条排队消息"]}),u.jsx("span",{className:"oc-queue-chevron","aria-hidden":"true",children:p?u.jsx(md,{size:14}):u.jsx(i5,{size:14})})]}):null,u.jsx("ul",{id:m,className:"oc-queue-list",hidden:!b,children:b?t.map(y=>{const S=y.clientRequestId,T={clientRequestId:S,revision:y.revision},A="textPreview"in y?y.textPreview:y.text,C=("text"in y?y.text:A)??"",M="imageCount"in y?y.imageCount:y.images?.length??0;return u.jsxs("li",{className:`oc-queue-row is-${y.state}`,children:[t.length===1?u.jsx("span",{className:"oc-queue-lead","aria-hidden":"true",children:u.jsx(Eb,{size:14})}):null,s?.id===S?u.jsx("input",{autoFocus:!0,className:"oc-queue-editor","aria-label":"编辑排队消息",value:s.text,onChange:I=>o({id:S,text:I.currentTarget.value}),onKeyDown:I=>{I.key==="Escape"&&o(null),I.key==="Enter"&&!I.nativeEvent.isComposing&&(I.preventDefault(),x(S,()=>e.onEdit(T,s.text),()=>o(null)))}}):u.jsx("span",{className:"oc-queue-preview",title:C,children:A||(M>0?`${M} 张图片`:"待发送消息")}),u.jsx("div",{className:"oc-queue-actions",children:s?.id===S?u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",className:"oc-queue-action","aria-label":"保存排队消息",title:"保存排队消息",disabled:c!==null||s.text.trim()==="",onClick:()=>x(S,()=>e.onEdit(T,s.text),()=>o(null)),children:u.jsx(Gw,{size:15})}),u.jsx("button",{type:"button",className:"oc-queue-action","aria-label":"取消编辑",title:"取消编辑",disabled:c!==null,onClick:()=>o(null),children:u.jsx(Ss,{size:15})})]}):u.jsxs(u.Fragment,{children:[u.jsx("button",{type:"button",className:"oc-queue-action","aria-label":"编辑排队消息",title:"编辑排队消息",disabled:c!==null||!("text"in y),onClick:()=>o({id:S,text:C}),children:u.jsx(F1,{size:15})}),u.jsx("button",{type:"button",className:"oc-queue-action","aria-label":"删除排队消息",title:"删除排队消息",disabled:c!==null,onClick:()=>x(S,()=>e.onRemove(T)),children:u.jsx(U1,{size:15})}),u.jsx("button",{type:"button",className:"oc-queue-action","aria-label":"插话发送",title:"插话发送",disabled:c!==null||e.turnPhase==="idle",onClick:()=>x(S,()=>e.onSteer(T)),children:u.jsx(ek,{size:15})})]})})]},S)}):null})]})})}function bD(){return u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[u.jsx("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),u.jsx("circle",{cx:"8.5",cy:"10",r:"1.5"}),u.jsx("path",{d:"m21 16-5.5-5.5L9 17"})]})}function vD(e){const{composer:t,streaming:n,turnPhase:a,deferredTurn:s,deferredTurns:o=s?[s]:[],hasThread:c}=e,d=w.useRef(null),m=Wl(),h=m.reloading,p=m.reloadError,x=m.mutationBusy||h||a!=="idle",y=w.useCallback(()=>{t.setInput(""),t.setShortcutOpen(!1),Xu()},[t.setInput,t.setShortcutOpen]),S=w.useCallback(B=>{const $=t.isComposingNow()||B.nativeEvent.isComposing,F=t.recentlyComposedNow();if(B.key==="Enter"&&!B.shiftKey&&!$&&!F&&(!n||a!=="idle")){if(t.shortcutOpen&&t.filteredShortcuts.length>0){if((t.filteredShortcuts[t.shortcutIndex]??t.filteredShortcuts[0])?.command==="/reload"){B.preventDefault(),y();return}}else if(t.input.trim()==="/reload"){B.preventDefault(),y();return}}e.onKeyDown(B)},[t.isComposingNow,t.recentlyComposedNow,t.shortcutOpen,t.filteredShortcuts,t.shortcutIndex,t.input,y,n,a,e.onKeyDown]),T=w.useCallback((B,$)=>{if($==="pi-prompt"||B==="/name"||B==="/compact"){t.setInput(`${B} `),t.setShortcutOpen(!1),t.textareaRef.current?.focus();return}if(B==="/reload"){y();return}e.onRunShortcut(B)},[y,e.onRunShortcut,t]),A=w.useCallback(()=>{if(t.input.trim()==="/reload"){y();return}e.onSend(t.input)},[t.input,y,e.onSend]);w.useEffect(()=>{if(!t.shortcutOpen||t.filteredShortcuts.length===0||!e.paletteKeyboardNavRef.current)return;const B=e.shortcutPaletteRef.current;if(!B)return;B.querySelector(`[data-shortcut-index="${t.shortcutIndex}"]`)?.scrollIntoView({block:"nearest",inline:"nearest"}),e.paletteKeyboardNavRef.current=!1},[t.shortcutOpen,t.filteredShortcuts,t.shortcutIndex,e.shortcutPaletteRef,e.paletteKeyboardNavRef]),w.useEffect(()=>{if(!t.shortcutOpen||t.filteredShortcuts.length===0)return;const B=d.current,$=e.shortcutPaletteRef.current,F=B?.closest(".oc-main")??null;if(!B||!$||!F)return;let K=0;const oe=()=>{K=0;const _=F.getBoundingClientRect(),Y=B.getBoundingClientRect(),re=pD({boundaryTop:_.top,anchorTop:Y.top,viewportTop:window.visualViewport?.offsetTop??0});if(re===null){$.style.removeProperty(Eh);return}$.style.setProperty(Eh,`${re}px`)},J=()=>{K!==0&&window.cancelAnimationFrame(K),K=window.requestAnimationFrame(oe)};oe();const H=typeof ResizeObserver>"u"?null:new ResizeObserver(J);return H?.observe(F),H?.observe(B),window.addEventListener("resize",J),window.visualViewport?.addEventListener("resize",J),window.visualViewport?.addEventListener("scroll",J),()=>{K!==0&&window.cancelAnimationFrame(K),H?.disconnect(),window.removeEventListener("resize",J),window.visualViewport?.removeEventListener("resize",J),window.visualViewport?.removeEventListener("scroll",J),$.style.removeProperty(Eh)}},[t.shortcutOpen,t.filteredShortcuts.length,e.layoutMode,e.shortcutPaletteRef]);const C=(()=>{const B=e.processSummary;return B?B.statusKind==="error"?`查看工具调用记录,共 ${B.count} 次,其中 ${B.statusLabel}`:B.statusKind==="running"?`查看工具调用记录,共 ${B.count} 次,${B.statusLabel||"正在运行"}`:`查看工具调用记录,共 ${B.count} 次,全部已完成`:"查看工具调用记录"})(),M=(()=>{const B=e.sessionStats,$=[];if(B.steps>0){$.push(`${B.turns} 轮 · ${B.steps} 步`);const oe=[];B.llmMs>0&&oe.push(`LLM ${Sh(B.llmMs)}`),B.toolMs>0&&oe.push(`工具调用 ${Sh(B.toolMs)}`),oe.length>0&&$.push(oe.join(" · "));const J=[];if(B.ttftSteps>0&&J.push(`首 token 平均 ${Sh(B.ttftMs/B.ttftSteps)}`),B.decodeMs>0){const H=B.decodeTokens/(B.decodeMs/1e3),_=H>=10?String(Math.round(H)):String(Math.round(H*10)/10);J.push(`${_} tok/s`)}J.length>0&&$.push(J.join(" · "))}const F=X7(e.usage),K=e.usage.outputTokens;if(F>0||K>0){const oe=aD(e.usage);oe!==null&&$.push(`缓存命中 ${oe}%`),$.push(`输入 ${b3(F)} tok · 输出 ${b3(K)} tok`)}return $})(),I=M.join(" | "),P=e.usage.contextUsage,U=P?.percent??null,N=P?`上下文 ${U===null?"—":`${Math.round(U*10)/10}%`} / ${P.contextWindow>0?Fu(P.contextWindow):"—"}`:"上下文 —",z=u.jsxs(u.Fragment,{children:[u.jsxs("label",{className:"oc-attach-button oc-attach-icon",title:"添加图片","aria-label":"添加图片",children:[u.jsx(bD,{}),u.jsx("span",{className:"sr-only",children:"添加图片"}),u.jsx("input",{type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",multiple:!0,hidden:!0,onChange:B=>{t.addImagesFromFiles(Array.from(B.target.files??[]).slice(0,4)),B.target.value=""}})]}),u.jsx("span",{className:"oc-composer-actions-spacer"}),u.jsx("div",{className:"oc-composer-model-controls",children:u.jsx(fD,{models:e.models,activeModelRef:e.activeModelRef,activeModelListed:e.activeModelListed,activeThinkingLevel:e.activeThinkingLevel||"auto",thinkingLevels:e.thinkingLevels,disabled:x,onSelectModel:(B,$)=>e.onSwitchRuntime({provider:B,modelId:$}),onSelectThinking:B=>e.onSwitchRuntime({thinkingLevel:B})})}),u.jsxs("button",{type:"button",className:"btn btn-ghost oc-composer-compact",onClick:e.onCompact,disabled:a!=="idle"||!c||e.compacting,title:e.compacting?"正在压缩上下文…":c?a!=="idle"?"生成中,暂不可压缩":"压缩上下文,释放 token":"先进行对话后再压缩上下文","aria-label":e.compacting?"正在压缩上下文…":c?a!=="idle"?"生成中,暂不可压缩":"压缩上下文,释放 token":"先进行对话后再压缩上下文",children:[e.compacting?u.jsx("span",{className:"oc-spinner oc-spinner-inline","aria-hidden":"true"}):u.jsx(nk,{size:16,"aria-hidden":"true"}),u.jsx("span",{className:"sr-only",children:e.compacting?"正在压缩上下文":"压缩上下文"})]}),e.runtimeContext?u.jsxs("button",{type:"button",ref:e.runtimeContextTriggerRef,className:`oc-runtime-context-toggle${e.runtimeContextOpen?" is-active":""}`,style:{"--oc-context-percent":`${Math.max(0,Math.min(100,U??0))}%`},"aria-expanded":e.runtimeContextOpen,"aria-controls":"oc-runtime-context-panel",title:N,"aria-label":e.runtimeContextOpen?"关闭注入上下文(当前运行时上下文与活跃工具)":"展开注入上下文(当前运行时上下文与活跃工具)",onClick:e.onToggleRuntimeContext,children:[u.jsx("span",{className:"oc-context-ring","aria-hidden":"true"}),u.jsx("span",{className:"sr-only",children:N})]}):null]}),X=u.jsxs("div",{className:"oc-telemetry",title:I||void 0,children:[a!=="idle"?u.jsx("span",{className:"oc-usage-state",children:a==="stopping"?"正在停止":"运行中"}):null,e.unread>0?u.jsxs("span",{children:[e.unread," 未读"]}):null,M.length>0?u.jsx("span",{className:"oc-telemetry-stats",children:M.map((B,$)=>u.jsx("span",{className:"oc-telemetry-group",children:B},`${$}:${B}`))}):null,e.processSummary?u.jsxs("button",{type:"button",ref:e.processTriggerRef,className:`oc-process-summary is-${e.processSummary.statusKind}${e.processOpen?" is-open":""}`,"aria-expanded":e.processOpen,"aria-controls":"oc-process-panel","aria-label":C,title:C,onClick:e.onToggleProcess,children:["调用记录 ",e.processSummary.count]}):null]});return u.jsx("div",{className:"oc-composer",children:u.jsxs("div",{className:"oc-composer-inner",ref:d,children:[t.fileOptions.length>0&&u.jsx("div",{className:"oc-file-palette",role:"listbox","aria-label":"Repository files",children:t.fileOptions.map(B=>u.jsx("button",{type:"button",role:"option",className:B.endsWith("/")?"is-dir":void 0,onMouseDown:$=>$.preventDefault(),onClick:()=>t.insertFileReference(B),children:u.jsxs("code",{children:["@",B]})},B))}),t.pendingImages.length>0&&u.jsx("div",{className:"oc-attachment-list",children:t.pendingImages.map(B=>u.jsxs("span",{children:[B.name,u.jsx("button",{type:"button","aria-label":`移除 ${B.name}`,onClick:()=>t.removeImage(B),children:"×"})]},B.name))}),t.shortcutOpen&&t.filteredShortcuts.length>0&&u.jsxs("div",{className:"oc-shortcut-palette",id:"oc-shortcut-palette",ref:e.shortcutPaletteRef,role:"listbox","aria-label":"命令","aria-busy":t.dynamicCommandsLoading||void 0,"data-layout-mode":e.layoutMode,children:[u.jsxs("div",{className:"oc-shortcut-palette-head",children:[u.jsxs("strong",{children:["命令 · ",t.filteredShortcuts.length]}),t.dynamicCommandsLoading?u.jsx("span",{className:"oc-shortcut-palette-meta",children:"正在加载扩展、提示词与技能…"}):null,t.dynamicCommandsError?u.jsxs("span",{className:"oc-shortcut-palette-meta is-error",children:[t.dynamicCommandsError,u.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>t.retryDynamicCommands(),children:"重试"})]}):null]}),u.jsx("div",{className:"oc-shortcut-palette-body",children:e.paletteModel.map(B=>u.jsxs("div",{className:"oc-shortcut-group",children:[u.jsxs("small",{children:[B.label," · ",B.items.length]}),B.items.map(({entry:$,globalIndex:F})=>u.jsxs("button",{type:"button",role:"option",id:`oc-shortcut-option-${F}`,"aria-label":$.command,"aria-describedby":`oc-shortcut-option-desc-${F}`,"aria-selected":F===t.shortcutIndex,className:F===t.shortcutIndex?"is-active":"","data-shortcut-index":F,title:$.command,onMouseEnter:()=>t.setShortcutIndex(F),onMouseDown:K=>K.preventDefault(),onClick:K=>{K.currentTarget.scrollIntoView({block:"nearest"}),T($.command,$.action)},children:[u.jsx("code",{children:$.command}),u.jsx("small",{id:`oc-shortcut-option-desc-${F}`,children:$.description})]},`${$.source}:${$.command}`))]},B.source))})," "]}),u.jsx(gD,{items:o,turnPhase:a,onEdit:e.onEditDeferred,onRemove:B=>e.onDiscardDeferred(B),onSteer:e.onSteerDeferred}),u.jsxs("div",{className:`oc-composer-shell${a!=="idle"?" is-busy":""}`,children:[u.jsx("textarea",{ref:t.textareaRef,className:"oc-textarea",value:t.input,rows:2,placeholder:a==="stopping"?"上一轮正在停止…输入后可排队自动发送":n?"正在执行…继续输入以排队,当前回合结束后自动发送":c?"输入消息… Enter 发送 · Shift+Enter 换行 · ↑ 召回历史输入":"描述目标,或点选上方建议开始…",onChange:B=>t.handleInputChange(B.target.value),onKeyDown:S,onCompositionStart:t.onCompositionStart,onCompositionEnd:t.onCompositionEnd,"aria-expanded":t.shortcutOpen,"aria-controls":t.shortcutOpen?"oc-shortcut-palette":void 0,"aria-activedescendant":t.shortcutOpen&&t.filteredShortcuts.length>0?`oc-shortcut-option-${t.shortcutIndex}`:void 0}),u.jsxs("div",{className:"oc-composer-actions",children:[z,a==="running"?u.jsxs(u.Fragment,{children:[(t.input.trim()!==""||t.pendingImages.length>0)&&u.jsx("button",{type:"button",className:"oc-send is-queue",title:"排队发送:当前回合结束后自动发送","aria-label":"排队发送:当前回合结束后自动发送",onClick:A,disabled:h,children:u.jsx(Rb,{})}),u.jsxs("button",{type:"button",className:"oc-stop",title:s?"对话进行中,点击停止后立即发送排队消息":"对话进行中,点击停止","aria-label":s?"对话进行中,点击停止后立即发送排队消息":"对话进行中,点击停止",onClick:e.onStop,children:[u.jsx("span",{className:"oc-spinner","aria-hidden":"true"}),u.jsx(Ok,{})]})]}):u.jsx("button",{type:"button",className:"oc-send",title:a==="stopping"?"停止后发送":"发送","aria-label":a==="stopping"?"停止后发送":"发送",onClick:A,disabled:!t.input.trim()&&t.pendingImages.length===0||h,children:u.jsx(Rb,{})})]})]}),p&&u.jsxs("div",{className:"oc-reload-banner is-error",role:"alert",children:[u.jsxs("span",{children:[p.code?`${p.code}:`:"",p.message]}),u.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{Xu()},children:"重试"})]}),h?u.jsx("div",{className:"oc-reload-status",children:"正在重新加载会话…"}):null,X]})})}function yD(e){return e.nativeEvent.isComposing||e.nativeEvent.keyCode===229}function xD(e){const t=/\s*(?:\((?:recommended|推荐)\)|((?:recommended|推荐)))\s*$/i;return t.test(e)?{label:e.replace(t,""),recommended:!0}:{label:e,recommended:!1}}function Th(e){const t={left:"9 2.5 5.5 6 9 9.5",right:"3 2.5 6.5 6 3 9.5",up:"2.5 8 6 4.5 9.5 8",down:"2.5 4 6 7.5 9.5 4"}[e.direction];return u.jsx("svg",{viewBox:"0 0 12 12","aria-hidden":"true",children:u.jsx("polyline",{points:t})})}function wD(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("path",{d:"m4 4 8 8m0-8-8 8"})})}function x3(){return u.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:u.jsx("path",{d:"m3.25 8.25 3.1 3.1 6.4-6.7"})})}function kD(){return u.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[u.jsx("path",{d:"m3.2 11.9-.7 2.6 2.6-.7L12.8 6a1.7 1.7 0 0 0-2.4-2.4L3.2 11.9Z"}),u.jsx("path",{d:"m9.5 4.5 2 2"})]})}function SD(e){return u.jsxs("div",{className:"oc-question-answer-field",children:[u.jsx("div",{className:"oc-question-field-mirror","aria-hidden":"true",children:`${e.value}
|
|
396
|
-
`}),u.jsx("textarea",{className:"oc-question-field-input",rows:1,value:e.value,disabled:e.disabled,autoFocus:e.autoFocus,placeholder:e.placeholder,onFocus:e.onFocus,onChange:e.onChange,onKeyDown:e.onKeyDown})]})}function ED(e){const t=e.pending.questions,[n,a]=w.useState(0),[s,o]=w.useState(()=>t.map(()=>({selected:[],custom:"",skipped:!1}))),[c,d]=w.useState(null),[m,h]=w.useState(null),[p,b]=w.useState(!1),x=w.useRef(new Set),y=t[n],S=s[n],T=!!y.options?.length,A=B=>{o($=>$.map((F,K)=>K===n?B(F):F)),h(null)},C=B=>B.selected.length>0||B.custom.trim().length>0,M=B=>C(B)||B.skipped,I=async(B,$)=>{const F=e.workspaceId?`?workspaceId=${encodeURIComponent(e.workspaceId)}`:"",K=await fetch(`${e.origin}/api/operator/v1/chat/sessions/${encodeURIComponent(e.pending.sessionId)}/questions/${encodeURIComponent(e.pending.requestId)}/${B}${F}`,{method:"POST",credentials:"include",headers:{"content-type":"application/json","x-loop-console-confirmation":qn()},body:JSON.stringify($)}),oe=await K.json().catch(()=>({}));if(!K.ok){if(K.status===404||K.status===409){e.onSettled();return}throw new Error(oe.error?.message??`请求失败 (${K.status})`)}e.onSettled()},P=B=>{const $=B.findIndex(K=>!M(K));if($>=0){a($),h("请回答或跳过这个问题");return}const F={answers:t.map((K,oe)=>{const J=B[oe];if(J.skipped)return{id:K.id,selected:[]};const H=J.custom.trim();return{id:K.id,selected:H&&K.multiSelect!==!0?[]:J.selected,...H?{custom:H}:{}}})};d("answer"),h(null),I("answer",F).catch(K=>{d(null),h(K instanceof Error?K.message:String(K))})},U=()=>{if(!C(S)){h("请选择一个选项或填写回答");return}if(n<t.length-1){a(B=>B+1),h(null);return}P(s)},N=B=>{A($=>y.multiSelect?{...$,selected:$.selected.includes(B)?$.selected.filter(F=>F!==B):[...$.selected,B],skipped:!1}:{selected:[B],custom:"",skipped:!1}),!y.multiSelect&&n<t.length-1&&a($=>$+1)},z=B=>{const $=B.target.value;A(F=>({...F,selected:y.multiSelect?F.selected:[],custom:$,skipped:!1}))},X=()=>{const B=s.map(($,F)=>F===n?{selected:[],custom:"",skipped:!0}:$);o(B),h(null),n<t.length-1?a($=>$+1):P(B)};return u.jsx("div",{className:"oc-question-composer","data-question-request":e.pending.requestId,children:u.jsxs("section",{className:`oc-question-card${p?" is-minimized":""}`,"aria-labelledby":`oc-question-${e.pending.requestId}-${n}`,children:[u.jsxs("header",{className:"oc-question-header",children:[u.jsxs("div",{className:"oc-question-heading",children:[y.header?u.jsx("div",{className:"oc-question-eyebrow",children:y.header}):null,u.jsx("h2",{id:`oc-question-${e.pending.requestId}-${n}`,children:y.question})]}),u.jsxs("div",{className:"oc-question-header-actions",children:[u.jsx("button",{type:"button",className:"oc-question-icon-button","aria-label":p?"展开问题":"收起问题",title:p?"展开问题":"收起问题","aria-expanded":!p,disabled:c!==null,onClick:()=>b(B=>!B),children:u.jsx(Th,{direction:p?"up":"down"})}),u.jsx("button",{type:"button",className:"oc-question-icon-button","aria-label":"取消回答",title:"取消回答",disabled:c!==null,onClick:()=>{d("cancel"),h(null),I("cancel",{reason:"USER_CANCELLED"}).catch(B=>{d(null),h(B instanceof Error?B.message:String(B))})},children:u.jsx(wD,{})})]})]}),p?null:u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"oc-question-body",children:[y.detail!==void 0?u.jsx("div",{className:"oc-question-detail",children:u.jsx(nc,{text:y.detail})}):null,u.jsxs("div",{className:"oc-question-options",role:y.multiSelect?"group":"radiogroup",children:[(y.options??[]).map((B,$)=>{const F=S.selected.includes(B.label),K=xD(B.label);return u.jsxs("button",{type:"button",className:`oc-question-option${F&&!y.multiSelect?" is-selected":""}`,role:y.multiSelect?"checkbox":"radio","aria-checked":F,disabled:c!==null,onClick:()=>N(B.label),children:[y.multiSelect?u.jsx("span",{className:`oc-question-checkbox${F?" is-checked":""}`,"aria-hidden":"true",children:F?u.jsx(x3,{}):null}):u.jsx("span",{className:"oc-question-number",children:$+1}),u.jsx("span",{className:"oc-question-option-copy",children:u.jsxs("span",{className:"oc-question-option-main",children:[u.jsx("span",{className:"oc-question-option-label",children:K.label}),K.recommended?u.jsx("span",{className:"oc-question-badge",children:"推荐"}):null,B.description?u.jsx("span",{className:"oc-question-description",children:B.description}):null]})})]},`${B.label}-${$}`)}),u.jsxs("div",{className:`oc-question-custom${S.custom?" is-active":""}`,children:[T?y.multiSelect===!0?u.jsx("span",{className:`oc-question-checkbox${S.custom?" is-checked":""}`,"aria-hidden":"true",children:S.custom?u.jsx(x3,{}):null}):u.jsx("span",{className:"oc-question-number",children:u.jsx(kD,{})}):null,u.jsx(SD,{value:S.custom,disabled:c!==null,placeholder:"输入自定义回答…",autoFocus:!T&&!x.current.has(n),onFocus:()=>x.current.add(n),onChange:z,onKeyDown:B=>{B.key!=="Enter"||B.shiftKey||yD(B)||(B.preventDefault(),U())}})]})]})]}),u.jsxs("footer",{className:"oc-question-footer",children:[u.jsxs("div",{className:"oc-question-pager",children:[u.jsx("button",{type:"button",className:"oc-question-icon-button","aria-label":"上一题",title:"上一题",disabled:n===0||c!==null,onClick:()=>{a(n-1),h(null)},children:u.jsx(Th,{direction:"left"})}),u.jsxs("span",{children:[n+1," / ",t.length]}),u.jsx("button",{type:"button",className:"oc-question-icon-button","aria-label":"下一题",title:"下一题",disabled:n===t.length-1||c!==null,onClick:()=>{a(n+1),h(null)},children:u.jsx(Th,{direction:"right"})})]}),u.jsx("div",{className:"oc-question-feedback",role:"status",children:m}),u.jsxs("div",{className:"oc-question-actions",children:[u.jsx("button",{type:"button",className:"oc-question-button is-secondary",disabled:c!==null,onClick:X,children:"跳过"}),u.jsx("button",{type:"button",className:"oc-question-button is-primary",disabled:c!==null||!C(S),onClick:U,children:c==="answer"?"提交中…":n===t.length-1?"提交":"下一题"})]})]})]})]})})}function TD({status:e}){return e==="completed"?u.jsx(Vw,{size:15,"aria-hidden":"true"}):e==="in_progress"?u.jsx(Xw,{size:15,"aria-hidden":"true",className:"oc-todo-spin"}):u.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none","aria-hidden":"true",children:u.jsx("circle",{cx:"7.5",cy:"7.5",r:"6.4",stroke:"currentColor",strokeWidth:"1.2",strokeDasharray:"2.4 2.4"})})}function CD({todos:e}){const[t,n]=w.useState(!0);if(e.length===0)return null;const a=e.filter(d=>d.status==="completed").length,s=e.filter(d=>d.status==="in_progress").length,o=e.length-a-s,c=[a?`${a} 已完成`:"",s?`${s} 进行中`:"",o?`${o} 待处理`:""].filter(Boolean).join(" · ");return u.jsxs("section",{className:"oc-todo-panel","aria-label":"任务",children:[u.jsxs("button",{type:"button",className:"oc-todo-head","aria-expanded":!t,onClick:()=>n(d=>!d),children:[u.jsx("span",{className:"oc-todo-leading",children:u.jsx(s5,{size:15,"aria-hidden":"true"})}),u.jsx("strong",{children:"任务"}),u.jsx("span",{className:"oc-todo-summary",children:c}),u.jsx("span",{className:"oc-todo-chevron","aria-hidden":"true",children:t?u.jsx(i5,{size:16}):u.jsx(md,{size:16})})]}),t?null:u.jsx("ul",{className:"oc-todo-list",children:e.map(d=>u.jsxs("li",{className:`oc-todo-item is-${d.status}`,children:[u.jsx("span",{className:"oc-todo-status","aria-hidden":"true",children:u.jsx(TD,{status:d.status})}),u.jsx("span",{children:d.content})]},d.content))})]})}function RD(e){const{toolCalls:t,onClose:n,overlay:a=!1,embedded:s=!1}=e,o=w.useRef(null);return pd({open:a&&!s,containerRef:o,triggerRef:e.triggerRef,onEscape:n}),u.jsxs("aside",{ref:o,id:"oc-process-panel",className:`oc-process${a?" is-process-overlay":""}${s?" is-details-tab":""}`,"aria-label":"工具调用记录",role:a&&!s?"dialog":"region","aria-modal":a&&!s?!0:void 0,tabIndex:-1,children:[s?null:u.jsxs("header",{className:"oc-process-head",children:[u.jsxs("div",{className:"oc-process-title",children:[u.jsx("span",{className:"oc-process-title-mark","aria-hidden":"true"}),"工具调用记录",u.jsxs("span",{className:"oc-process-count",children:[t.length," 次"]})]}),u.jsx("button",{type:"button",className:"btn btn-ghost oc-process-close","aria-label":"关闭工具调用记录",onClick:n,children:"关闭"})]}),u.jsx("div",{className:"oc-process-timeline",children:t.length===0?u.jsx("div",{className:"oc-process-empty",children:"本轮对话尚无工具调用。诊断细节会在这里按时间线展示。"}):t.map((c,d)=>u.jsxs("div",{className:`oc-process-item${d===0?" is-first":""}${d===t.length-1?" is-last":""}${c.status==="error"?" is-error":""}${c.status==="running"?" is-running":""}`,children:[u.jsx("div",{className:"oc-process-rail","aria-hidden":"true",children:u.jsx("span",{className:"oc-process-dot"})}),u.jsx("div",{className:"oc-process-time",children:Hl(c.createdAt)}),u.jsx("div",{className:"oc-process-body",children:u.jsx(Z7,{entry:c})})]},c.id))})]})}const w3=[{id:"overview",label:"概览"},{id:"system",label:"System prompt"},{id:"files",label:"Context files"},{id:"skills",label:"Skills"},{id:"extensions",label:"Extensions"},{id:"packages",label:"Plugins"},{id:"tools",label:"Active tools"},{id:"raw",label:"原始 JSON"}];function Iu(e){const t=Array.isArray(e.items)?e.items:void 0;return u.jsxs("section",{className:"oc-runtime-context-section",children:[u.jsxs("header",{className:"oc-runtime-context-section-head",children:[u.jsx("strong",{children:e.title}),u.jsx("span",{className:"oc-runtime-context-meta",children:t?`${t.length} 项`:"未投影"})]}),t===void 0?u.jsx("p",{className:"oc-runtime-context-empty",children:"该 session 未提供资源投影"}):t.length===0?u.jsx("p",{className:"oc-runtime-context-empty",children:e.emptyText}):u.jsx("ul",{className:"oc-runtime-context-resources",children:t.map((n,a)=>u.jsx(ND,{item:n},`${n.name??n.path??a}:${a}`))})]})}function ND(e){const t=e.item,a=[t.scope?`scope ${t.scope}`:"",t.source??"",t.version?`v${t.version}`:"",t.cwd?`cwd ${t.cwd}`:""].filter(Boolean).join(" · "),s=t.path?`${t.path}${t.baseDir?`(base: ${t.baseDir})`:""}`:"";return u.jsxs("li",{children:[u.jsxs("div",{className:"oc-runtime-context-resource-head",children:[u.jsx("strong",{className:"oc-runtime-context-resource-name",title:t.path??t.name,children:t.name||t.path||"未命名资源"}),t.enabled===!1?u.jsx("span",{className:"oc-runtime-context-resource-flag",children:"未启用"}):null,a?u.jsx("span",{className:"oc-runtime-context-meta",title:a,children:a}):null]}),t.description?u.jsx("span",{className:"oc-runtime-context-resource-desc",children:t.description}):null,t.path?u.jsx("code",{className:"oc-runtime-context-resource-path",title:s,children:s}):null,t.error?u.jsxs("span",{className:"oc-runtime-context-diag is-error",children:[u.jsx("span",{className:"oc-runtime-context-diag-icon","aria-hidden":"true",children:"✕"}),t.error]}):null,Array.isArray(t.diagnostics)&&t.diagnostics.length>0?u.jsxs("span",{className:"oc-runtime-context-diag",children:[u.jsx("span",{className:"oc-runtime-context-diag-icon","aria-hidden":"true",children:"⚠"}),t.diagnostics.join(";")]}):null,Array.isArray(t.resolved)&&t.resolved.length>0?u.jsxs("details",{className:"oc-runtime-context-resolved",children:[u.jsxs("summary",{children:["已解析 ",t.resolved.length," 项"]}),u.jsx("ul",{className:"oc-runtime-context-resolved-list",children:t.resolved.map((o,c)=>{const d=`${o.type??"?"}:${o.name??o.path??"?"}`;return u.jsx("li",{children:u.jsx("code",{title:d,children:d})},c)})})]}):null]})}const AD=w.forwardRef(function({open:t,onToggle:n,onClose:a,context:s,panelOnly:o=!1,embedded:c=!1,triggerOnly:d=!1,triggerRef:m},h){const p=Wl(),b=p.reloading,x=p.reloadError,[y,S]=w.useState("overview"),T=w.useRef(null);pd({open:t&&!d&&!c,containerRef:T,triggerRef:m,onEscape:a}),w.useEffect(()=>{t||S("overview")},[t]);const A=Array.isArray(s.resources.activeTools)?s.resources.activeTools:[],C=typeof s.resources.activeToolCount=="number"?s.resources.activeToolCount:A.length,M=s.systemPrompt.text??s.systemPrompt.summary??"",I=s.systemPrompt.charCount??M.length,P=s.suffix.present?s.suffix.text??s.suffix.summary??"":"",U=s.model?Ts(s.model.provider,s.model.modelId):"",N=s.resources,z=String(s.resources.mode??"closed"),X=z.includes("open")?"open":"closed",B={files:N.contextFiles?.length??0,skills:N.skills?.length??0,extensions:N.extensions?.length??0,packages:N.packages?.length??0},$=["files","skills","extensions","packages"].map(oe=>({id:oe,label:w3.find(J=>J.id===oe)?.label??oe,count:B[oe]??0})),F=u.jsx("button",{type:"button",ref:oe=>{typeof h=="function"?h(oe):h&&(h.current=oe)},className:`btn btn-ghost oc-runtime-context-toggle${t?" is-active":""}`,"aria-expanded":t,"aria-controls":"oc-runtime-context-panel",onClick:n,children:"注入上下文"});if(d)return F;const K=t?u.jsxs("div",{ref:T,id:"oc-runtime-context-panel",className:`oc-runtime-context-sidepanel${c?" is-details-tab":""}`,role:c?"region":"dialog","aria-modal":c?void 0:!0,"aria-label":"注入上下文",tabIndex:-1,children:[c?null:u.jsxs("header",{className:"oc-runtime-context-head",children:[u.jsxs("div",{className:"oc-runtime-context-head-copy",children:[u.jsx("strong",{children:"注入上下文"}),u.jsx("span",{className:"oc-runtime-context-meta",children:"只读 · 本轮实际注入的 system prompt / 资源(已脱敏)"})]}),u.jsx("button",{type:"button",className:"btn btn-ghost oc-runtime-context-close","aria-label":"关闭注入上下文",onClick:a,children:"关闭"})]}),u.jsxs("div",{className:"oc-runtime-context-layout",children:[u.jsx("nav",{className:"oc-runtime-context-nav","aria-label":"上下文分类",children:w3.map(oe=>{const J=B[oe.id];return u.jsxs("button",{type:"button",className:`oc-runtime-context-nav-item${y===oe.id?" is-active":""}`,"aria-current":y===oe.id?"page":void 0,onClick:()=>S(oe.id),children:[u.jsx("span",{className:"oc-runtime-context-nav-label",title:oe.label,children:oe.label}),typeof J=="number"?u.jsx("span",{className:"oc-runtime-context-nav-count",children:J}):null]},oe.id)})}),u.jsxs("div",{className:"oc-runtime-context-body",children:[y==="overview"?u.jsxs("div",{className:"oc-runtime-context-overview",children:[s.model?u.jsxs("section",{className:"oc-runtime-context-model-card",children:[u.jsx("span",{className:"oc-runtime-context-model-label",children:"模型"}),u.jsx("code",{className:"oc-runtime-context-model-ref",title:U,children:U})]}):null,u.jsxs("div",{className:"oc-runtime-context-stat-grid",children:[u.jsxs("div",{className:"oc-runtime-context-stat",children:[u.jsx("span",{className:"oc-runtime-context-stat-label",children:"Prompt 字数"}),u.jsxs("strong",{className:"oc-runtime-context-stat-value",children:[I.toLocaleString()," 字"]})]}),u.jsxs("div",{className:"oc-runtime-context-stat",children:[u.jsx("span",{className:"oc-runtime-context-stat-label",children:"工具"}),u.jsx("strong",{className:"oc-runtime-context-stat-value",children:C})]}),u.jsxs("div",{className:"oc-runtime-context-stat",children:[u.jsx("span",{className:"oc-runtime-context-stat-label",children:"思考"}),u.jsx("strong",{className:"oc-runtime-context-stat-value",children:s.thinkingLevel??"—"})]}),u.jsxs("div",{className:"oc-runtime-context-stat",children:[u.jsx("span",{className:"oc-runtime-context-stat-label",children:"资源面"}),u.jsxs("strong",{className:`oc-runtime-context-stat-value oc-runtime-context-mode is-${X}`,title:z,children:[u.jsx("span",{className:"oc-runtime-context-mode-dot","aria-hidden":"true"}),z]})]})]}),u.jsxs("section",{className:"oc-runtime-context-section",children:[u.jsx("header",{className:"oc-runtime-context-section-head",children:u.jsx("strong",{children:"已加载资源"})}),u.jsx("div",{className:"oc-runtime-context-resource-links",children:$.map(oe=>u.jsxs("button",{type:"button",className:"oc-runtime-context-resource-link",onClick:()=>S(oe.id),children:[u.jsx("span",{className:"oc-runtime-context-resource-label",children:oe.label}),u.jsx("span",{className:`oc-runtime-context-resource-count${oe.count===0?" is-zero":""}`,children:oe.count}),u.jsx("span",{className:"oc-runtime-context-resource-chevron","aria-hidden":"true",children:"›"})]},oe.id))})]})]}):null,y==="system"?u.jsxs(u.Fragment,{children:[u.jsxs("section",{className:"oc-runtime-context-section",children:[u.jsxs("header",{className:"oc-runtime-context-section-head",children:[u.jsxs("div",{children:[u.jsx("strong",{children:"System prompt"}),u.jsxs("code",{className:"oc-runtime-context-hash",children:[s.systemPrompt.hash.slice(0,12),"…"]})]}),M?u.jsx(C1,{text:M}):null]}),u.jsx("pre",{className:"oc-runtime-context-text",children:M||"(空)"})]}),u.jsxs("section",{className:"oc-runtime-context-section",children:[u.jsxs("header",{className:"oc-runtime-context-section-head",children:[u.jsxs("div",{className:"oc-runtime-context-section-title",children:[u.jsx("strong",{children:"Session suffix"}),u.jsx("span",{className:"oc-runtime-context-meta",children:s.suffix.present?`${(s.suffix.charCount??0).toLocaleString()} 字`:"未注入"})]}),P?u.jsx(C1,{text:P}):null]}),s.suffix.present?u.jsx("pre",{className:"oc-runtime-context-text",children:P||"已注入"}):u.jsx("p",{className:"oc-runtime-context-empty",children:"本会话无额外 suffix"})]})]}):null,y==="files"?u.jsx(Iu,{title:"Context files",items:N.contextFiles?.map(oe=>({name:oe.path,description:`${oe.characters.toLocaleString()} 字符`})),emptyText:"该 session 未加载任何上下文文件"}):null,y==="skills"?u.jsx(Iu,{title:"Skills",items:N.skills,emptyText:"该 session 未加载任何 Skills"}):null,y==="extensions"?u.jsx(Iu,{title:"Extensions",items:N.extensions,emptyText:"该 session 未加载任何 Extensions"}):null,y==="packages"?u.jsx(Iu,{title:"Plugins",items:N.packages,emptyText:"该会话没有插件"}):null,y==="tools"?u.jsxs("section",{className:"oc-runtime-context-section",children:[u.jsxs("header",{className:"oc-runtime-context-section-head",children:[u.jsx("strong",{children:"Active tools"}),u.jsxs("span",{className:"oc-runtime-context-meta",children:[C," 项"]})]}),A.length===0?u.jsx("p",{className:"oc-runtime-context-empty",children:"无激活工具"}):u.jsx("ul",{className:"oc-runtime-context-tools",children:A.map(oe=>u.jsx("li",{children:u.jsx("code",{children:oe})},oe))}),Array.isArray(N.diagnostics)&&N.diagnostics.length>0?u.jsx("ul",{className:"oc-runtime-context-resources",children:N.diagnostics.map((oe,J)=>u.jsxs("li",{children:[u.jsxs("span",{className:`oc-runtime-context-diag is-${oe.type??"warning"}`,children:[oe.type,": ",oe.message]}),oe.path?u.jsx("code",{children:oe.path}):null]},J))}):null]}):null,y==="raw"?u.jsxs("details",{className:"oc-runtime-context-raw",open:!0,children:[u.jsx("summary",{children:"原始投影 JSON"}),u.jsx("pre",{children:JSON.stringify(s,null,2)})]}):null]},y)]}),u.jsxs("footer",{className:"oc-runtime-context-foot",children:[u.jsx("span",{className:"oc-runtime-context-meta",children:b?"正在重新加载会话…":"重新加载 Pi 会话设置、扩展、技能、提示词与上下文文件"}),u.jsx("button",{type:"button",className:"btn btn-ghost",disabled:b,onClick:()=>{Xu()},children:"重新加载会话"}),x&&u.jsxs("span",{className:"oc-runtime-context-diag is-error",role:"alert",children:[x.code?`${x.code}:`:"",x.message,u.jsx("button",{type:"button",className:"btn btn-ghost",onClick:()=>{Xu()},children:"重试"})]})]})]}):null;return o?K:u.jsxs("div",{className:"oc-runtime-context-menu",children:[F,K]})});function ID(){const e=w.useRef(null),t=w.useRef(!1),n=w.useRef(null),a=w.useRef(new Map),s=w.useRef(new Set),o=w.useRef(null),c=w.useRef(null),d=w.useRef(0),m=w.useRef(null),h=w.useRef(new Set),p=w.useRef(new Set),b=w.useRef(new Map),x=w.useRef(new Set),y=w.useRef(null),S=w.useRef(null),T=w.useRef(!1),A=w.useRef(0),C=w.useRef(null),M=w.useRef(!1),I=w.useRef(!1),P=w.useRef(null),U=w.useRef(new Set),N=w.useRef(new Set),z=w.useRef(new Set),X=w.useRef(new Map),B=w.useRef(!1),$=w.useRef(0);return w.useMemo(()=>({sessionRef:e,streamingRef:t,abortRef:n,sessionAbortControllersRef:a,inlineStreamSessionIdsRef:s,assistantIdRef:o,lastEventIdRef:c,sessionGenerationRef:d,eventsStreamStateRef:m,settledTurnIdsRef:h,seenEventIdsRef:p,turnAssistantIdsRef:b,sealedAssistantIdsRef:x,reconnectAbortRef:y,activeTurnIdRef:S,submitInFlightRef:T,submitGenerationRef:A,pendingSubmissionRef:C,stopInFlightRef:M,stopRequestedRef:I,stoppingTurnIdRef:P,abortPostedTurnIdsRef:U,releasedClientRequestIdsRef:N,usageResponseKeysRef:z,unlinkedOperationIdsRef:X,isComposingRef:B,compositionEndedAtRef:$}),[e,t,n,a,s,o,c,d,m,h,p,b,x,y,S,T,A,C,M,I,P,U,N,z,X,B,$])}function _D(e){if(!(!e||typeof e!="object"))return e}function ji(e){return typeof e=="string"?e:void 0}function N1(e){if(!Array.isArray(e))return;const t=[];for(const n of e){const a=_D(n);if(!a)continue;const s=ji(a.type)??"";if(s==="thinking"||s==="reasoning"){const o=ji(a.thinking)??ji(a.text)??"";t.push({type:"thinking",thinking:o});continue}if(s==="toolCall"||s==="tool_call"||s==="toolUse"||s==="tool_use"){const o=ji(a.toolCallId)??ji(a.id)??"";if(!o)continue;const c=ji(a.toolName)??ji(a.name);t.push({type:"toolCall",toolCallId:o,...c?{toolName:c}:{}});continue}if(s==="text"||s==="output_text"||s===""){const o=ji(a.text);o!==void 0&&t.push({type:"text",text:o})}}return t}function MD(e,t={}){return e.type==="thinking"&&!t.isStreaming&&e.thinking.trim()===""}function A1(e,t={}){return e.filter(n=>!MD(n,t))}function OD(e){return e.type==="text"}function DD(e,t={}){const n=A1(e,t);let a=-1;for(let s=n.length-1;s>=0;s--)if(!OD(n[s])){a=s;break}return a===-1?{answerBlocks:n,processBlocks:[]}:{answerBlocks:n.slice(a+1),processBlocks:n.slice(0,a+1)}}function jD(e){return e.filter(t=>t.type==="text").map(t=>t.text).join("")}function LD(e){return{key:e,assistants:[],tools:[],processItems:[],live:!1}}function I1(e){const t=[],n=[];let a,s=[];const o=c=>{for(const d of s)d.assistantMessageId||(d.assistantMessageId=c),d.turnId||(d.turnId=a);s=[]};for(const c of e){const d=Date.parse(c.at)||Date.now();if(c.role==="user"){a=`restored-${c.id}`,s=[],t.push({id:c.id,role:"user",text:c.text,createdAt:d});continue}if(c.role==="assistant"){a||(a=`restored-${c.id}`);const m=N1(c.content);t.push({id:c.id,role:"assistant",text:c.text,createdAt:d,...c.kind==="provider-error"&&c.providerError?{kind:c.kind,providerError:c.providerError}:{},...m&&m.length>0?{content:m}:{}}),o(c.id);continue}if(c.role==="tool"){a||(a=`restored-tool-${c.id}`);const m={id:c.toolCallId||c.id,toolName:c.toolName||"tool",status:c.isError===!0?"error":"ok",resultText:c.text,result:c.text,createdAt:d,finishedAt:d,turnId:a,...c.operationId?{operationId:c.operationId}:{}};n.push(m),s.push(m)}}return{messages:t,toolCalls:n}}function zD(e){return[...e].sort((t,n)=>t.eventSeq!==void 0&&n.eventSeq!==void 0&&t.eventSeq!==n.eventSeq?t.eventSeq-n.eventSeq:t.createdAt!==n.createdAt?t.createdAt-n.createdAt:t.id<n.id?-1:1)}function jl(e,t){if(t.length===0)return;const n=zD(t);for(const a of n){const s=xO(a);s?e.push({kind:"activity",activity:s}):e.push({kind:"tool",tool:a})}}function Ch(e,t,n,a){let s=[];for(const o of e){if(o.type==="thinking"){jl(n,s),s=[],n.push({kind:"thinking",thinking:o.thinking});continue}if(o.type==="text"){jl(n,s),s=[],o.text.trim()&&n.push({kind:"text",text:o.text});continue}const c=t.tools.find(d=>d.id===o.toolCallId);c&&!a.has(c.id)&&(s.push(c),a.add(c.id))}jl(n,s)}function Rh(e,t,n,a){const s=e.tools.filter(o=>!a.has(o.id)&&o.assistantMessageId===t.id);if(s.length!==0){for(const o of s)a.add(o.id);jl(n,s)}}function BD(e){const t=new Set,n=[],a=e.assistants.at(-1),s=a?.kind==="provider-error"?void 0:a,o=s?e.assistants.lastIndexOf(s):-1;for(const[p,b]of e.assistants.entries())if(p!==o){if(b.kind==="provider-error"&&b.providerError){Ch(A1(b.content??[]),e,n,t),Rh(e,b,n,t),n.push({kind:"provider-error",error:b.providerError});continue}Ch(A1(b.content??[]),e,n,t),Rh(e,b,n,t)}const c=s?.content??[],d=DD(c,{isStreaming:e.live});Ch(d.processBlocks,e,n,t),s&&Rh(e,s,n,t);const m=e.tools.filter(p=>!t.has(p.id));if(m.length>0&&jl(n,m),e.processItems=n,!s)return;if(c.length===0){e.answer=s;return}const h=jD(d.answerBlocks);e.answer={...s,text:h,content:d.answerBlocks}}function qD(e){const t=e.messages.filter(d=>d.role==="user"||d.role==="assistant"),n=[];let a=null;const s=d=>{const m=LD(d);return n.push(m),m};for(const d of t){if(d.role==="user"){a=s(`user-${d.id}`),a.user=d;continue}if(d.kind==="compaction"){a=s(`compaction-${d.id}`),a.assistants.push(d),a=null;continue}a||(a=s(`assistant-${d.id}`)),a.assistants.push(d)}const o=new Set,c=new Map;for(const d of n)for(const m of d.assistants)c.set(m.id,d);for(const d of e.toolCalls)if(d.assistantMessageId){const m=c.get(d.assistantMessageId);m&&(m.tools.push(d),o.add(d.id))}for(const d of e.toolCalls)if(!o.has(d.id)&&d.turnId){const m=n.find(p=>p.tools.some(b=>b.turnId===d.turnId)||p.key===`turn-${d.turnId}`||p.user&&`restored-${p.user.id}`===d.turnId);if(m){m.tools.push(d),o.add(d.id);continue}const h=n.find(p=>d.turnId===`restored-${p.user?.id}`||p.assistants.some(b=>d.turnId===`restored-${b.id}`));h&&(h.tools.push(d),o.add(d.id))}for(const d of e.toolCalls){if(o.has(d.id))continue;const m=n.find((h,p)=>{const b=h.user?.createdAt??h.assistants[0]?.createdAt??0,y=n[p+1]?.user?.createdAt??Number.POSITIVE_INFINITY;return d.createdAt>=b&&d.createdAt<y});m&&(m.tools.push(d),o.add(d.id))}for(const d of n)d.tools.sort((m,h)=>m.eventSeq!==void 0&&h.eventSeq!==void 0?m.eventSeq-h.eventSeq:m.createdAt-h.createdAt),d.live=e.streaming&&e.activeAssistantId!==null&&d.assistants.some(m=>m.id===e.activeAssistantId),BD(d);return n}function HD(e,t){return t<=0?[]:e.length<=t?[...e]:e.slice(-t)}function ex(e,t){const n=e.findIndex(a=>a.operationId===t.operationId);return n<0?[...e,t]:e.map((a,s)=>{if(s!==n)return a;let o=a.eventSeq;return o===void 0?o=t.eventSeq:t.eventSeq!==void 0&&(o=Math.min(o,t.eventSeq)),{...a,...t,...o===void 0?{}:{eventSeq:o},updatedSeq:Math.max(a.updatedSeq??a.eventSeq??0,t.updatedSeq??t.eventSeq??0),toolCallId:a.toolCallId??t.toolCallId,activityRef:a.activityRef??t.activityRef}})}function UD(e){const t=e.operation;if(!t||typeof t!="object")return;const n=t;if(n.schemaVersion!==1||typeof n.operationId!="string"||typeof n.action!="string"||typeof n.state!="string"||typeof n.inspectHref!="string"||typeof n.createdAt!="string"||typeof n.updatedAt!="string"||typeof n.previewHash!="string")return;const a=FD(n.runSummary),{runSummary:s,...o}=n;return{...o,...a?{runSummary:a}:{}}}function FD(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t=e;if(typeof t.runId!="string"||!t.runId||typeof t.status!="string"||!t.status)return;let n=[];Array.isArray(t.nodes)&&(n=t.nodes.flatMap(o=>{if(!o||typeof o!="object")return[];const c=String(o.id??""),d=String(o.status??"");if(!c||!d)return[];const m=String(o.failureCategory??"");return[{id:c,status:d,...m?{failureCategory:m}:{}}]}).slice(0,20));let a;if(t.next&&typeof t.next=="object"){const o=t.next;a={kind:String(o.kind??""),...typeof o.description=="string"?{description:o.description}:{}}}return{runId:t.runId,status:t.status,nodes:n,...typeof t.verdict=="string"?{verdict:t.verdict}:{},...typeof t.failureCategory=="string"?{failureCategory:t.failureCategory}:{},...a&&a.kind?{next:a}:{}}}const $D=["operation","contract","dag","report","html"];function PD(e){const t=e.artifact;if(!t||typeof t!="object")return;const n=t;if(!(n.schemaVersion!==1||typeof n.artifactId!="string"||!n.artifactId||typeof n.kind!="string"||!$D.includes(n.kind)||typeof n.previewHash!="string")){for(const a of["title","summary","htmlPreview","reportText","inspectHref"])if(n[a]!==void 0&&typeof n[a]!="string")return;return n}}function GD(e,t){const n=e.findIndex(a=>a.artifactId===t.artifactId);return n<0?[...e,t]:e.map((a,s)=>s===n?{...a,...t,eventSeq:a.eventSeq??t.eventSeq,activityRef:a.activityRef??t.activityRef}:a)}function VD(e){if(!e||typeof e!="object")return;const t=e;if(!(t.schemaVersion!==1||typeof t.cardId!="string"||t.gateType!=="contract-apply"&&t.gateType!=="dag-run"||typeof t.taskId!="string"||typeof t.state!="string"||typeof t.expiresAt!="string"||typeof t.inspectHref!="string"||typeof t.previewHash!="string"))return t}function KD(e,t){const n=e.findIndex(o=>o.cardId===t.cardId);if(n<0)return[...e,t];const a=[...e],s=a[n];return s?(a[n]={...s,...t,eventSeq:s.eventSeq??t.eventSeq,activityRef:s.activityRef??t.activityRef},a):[...e,t]}function _u(e){return typeof e=="number"&&Number.isFinite(e)?Math.max(0,Math.floor(e)):void 0}function YD(e){const t=e.data&&typeof e.data=="object"?e.data:{},n=typeof e.eventId=="string"?e.eventId:void 0,a=typeof t.compactionId=="string"&&t.compactionId?t.compactionId:n;if(!a)return;const s=t.status==="running"||t.status==="completed"||t.status==="failed"||t.status==="aborted"?t.status:"completed",o=t.reason==="manual"||t.reason==="threshold"||t.reason==="overflow"?t.reason:"manual",c=typeof t.summary=="string"?t.summary:"",d=typeof t.errorMessage=="string"?t.errorMessage:void 0;return{id:`compaction-${a}`,role:"assistant",kind:"compaction",text:c||d||(s==="completed"?"历史上下文已精简,关键决策与当前任务已保留。":""),createdAt:Date.parse(e.at??"")||Date.now(),compaction:{compactionId:a,status:s,reason:o,willRetry:t.willRetry===!0,..._u(t.tokensBefore)===void 0?{}:{tokensBefore:_u(t.tokensBefore)},..._u(t.estimatedTokensAfter)===void 0?{}:{estimatedTokensAfter:_u(t.estimatedTokensAfter)},...typeof t.firstKeptEntryId=="string"&&t.firstKeptEntryId?{firstKeptEntryId:t.firstKeptEntryId}:{},...d?{errorMessage:d}:{},...n?{eventId:n}:{}}}}function Ap(e,t){const n=YD(t);return n?(e.find(o=>o.id===n.id)?e.map(o=>o.id===n.id?{...o,...n,createdAt:Math.min(o.createdAt,n.createdAt),text:n.text||o.text,compaction:{...o.compaction,...n.compaction}}:o):[...e,n]).sort((o,c)=>o.createdAt-c.createdAt):e}function WD(e){const{refs:t,onReconcile:n,setError:a,setInterview:s,setHumanGateCards:o,setArtifactCards:c,setStreaming:d,setTurnPhase:m=()=>{},setDeferredTurn:h=()=>{},setDeferredTurns:p=()=>{},setStreamingAssistantId:b,setUnread:x,setOperationCards:y,setUsage:S,onTelemetryRefresh:T,setMessages:A,setToolCalls:C,setPendingQuestion:M=()=>{},setTodos:I=()=>{}}=e;let P,U=-1;return(N,z,X,B)=>{if(B?.generation!==void 0&&t.sessionGenerationRef.current!==B.generation)return;const $=B?.replay===!0;if(N==="stream_ready")return;if(N==="reconcile"){const Y={reason:typeof z.reason=="string"?z.reason:"cursor_expired",...typeof z.minSeq=="number"?{minSeq:z.minSeq}:{},...typeof z.epoch=="string"?{epoch:z.epoch}:{},...typeof z.latestTurnId=="string"?{latestTurnId:z.latestTurnId}:{}};(typeof z.latestEventId=="string"||z.latestEventId===null)&&(Y.latestEventId=z.latestEventId),n?.(Y);return}const F=z.data&&typeof z.data=="object"?z.data:z;if(N==="todo_updated"||N==="todo_cleared"){const _=Array.isArray(F.todos)?F.todos:[];I(_.filter(Y=>!!Y&&typeof Y=="object"&&typeof Y.content=="string"&&(Y.status==="pending"||Y.status==="in_progress"||Y.status==="completed")));return}if((N==="question_requested"||N==="question_resolved"||N==="question_cancelled")&&F.question&&typeof F.question=="object"){const _=F.question;typeof _.requestId=="string"&&typeof _.sessionId=="string"&&_.sessionId===t.sessionRef.current?.sessionId&&M(N==="question_requested"&&_.status==="pending"?_:null);return}const K=typeof z.turnId=="string"?z.turnId:void 0,oe=typeof z.seq=="number"&&Number.isFinite(z.seq)?z.seq:void 0,J=typeof z.at=="string"&&Number.isFinite(Date.parse(z.at))?Date.parse(z.at):Date.now();if(N==="queue_update"){const _=typeof F.revision=="number"?F.revision:-1,Y=t.sessionRef.current?.sessionId;if(Y!==P&&(P=Y,U=-1),_<U)return;U=_,h(F.deferredTurn&&typeof F.deferredTurn=="object"?F.deferredTurn:null),Array.isArray(F.deferredTurns)&&p(F.deferredTurns);return}if(N==="user_message"){const _=F.message&&typeof F.message=="object"?F.message:null;if(_&&typeof _.id=="string"&&typeof _.text=="string"){const Y=typeof _.at=="string"&&Number.isFinite(Date.parse(_.at))?Date.parse(_.at):Date.now();A(re=>re.some(fe=>fe.id===_.id)?re:[...re,{id:_.id,role:"user",text:_.text,createdAt:Y}])}return}if(N==="compact"||N==="compaction_start"||N==="compaction_end"){A(_=>Ap(_,{eventId:typeof z.eventId=="string"?z.eventId:void 0,at:new Date(J).toISOString(),data:F}));return}if(K&&(N==="agent_start"||N==="message_update")&&t.settledTurnIdsRef.current.has(K))return;let H=X;if(K){const _=t.turnAssistantIdsRef.current.get(K);_?H=_:t.turnAssistantIdsRef.current.set(K,X)}if(N==="interview-turn"){s(_=>({..._??{},interviewSessionId:typeof F.interviewSessionId=="string"?F.interviewSessionId:_?.interviewSessionId,taskId:typeof F.taskId=="string"?F.taskId:_?.taskId,state:typeof F.state=="string"?F.state:_?.state,question:F.question&&typeof F.question=="object"?F.question:void 0}));return}if(N==="draft"){s(_=>({..._??{},taskId:typeof F.taskId=="string"?F.taskId:_?.taskId,draft:F.draft&&typeof F.draft=="object"?F.draft:_?.draft,draftSha256:typeof F.draftSha256=="string"?F.draftSha256:_?.draftSha256,taskKindRecommendation:typeof F.taskKindRecommendation=="string"?F.taskKindRecommendation:_?.taskKindRecommendation}));return}if(N==="assessment"){s(_=>({..._??{},assessment:F}));return}if(N==="taskKind-confirmed"){s(_=>({..._??{},confirmedTaskKind:typeof F.taskKind=="string"?F.taskKind:_?.confirmedTaskKind,taskKindRecommendation:void 0}));return}if(N==="human-gate-card"){const _=VD(F);_&&o(Y=>KD(Y,{..._,...oe===void 0?{}:{eventSeq:oe},...K?{turnId:K}:{},activityRef:`gate:${_.cardId}`}));return}if(N==="artifact-ref"){const _=PD(F);_&&c(Y=>GD(Y,{..._,...oe===void 0?{}:{eventSeq:oe},...K?{turnId:K}:{},activityRef:`artifact:${_.artifactId}`}));return}if(N==="agent_start"){if($&&K!==void 0&&K!==t.activeTurnIdRef.current)return;if(K&&(t.settledTurnIdsRef.current.delete(K),t.activeTurnIdRef.current=K),t.stopRequestedRef.current&&(!K||K===t.stoppingTurnIdRef.current||K===t.activeTurnIdRef.current)){t.streamingRef.current=!1,d(!1),m("idle"),b(null);return}t.streamingRef.current=!0,d(!0),m("running"),b(H);return}if(N==="agent_settled"||N==="agent_end"){if(K&&t.settledTurnIdsRef.current.add(K),N==="agent_end")return;const _=t.pendingSubmissionRef.current;_&&K&&_.acceptedTurnId===K&&(t.releasedClientRequestIdsRef.current.add(_.clientRequestId),t.pendingSubmissionRef.current=null,t.submitInFlightRef.current=!1),(!K||K===t.stoppingTurnIdRef.current||K===t.activeTurnIdRef.current)&&(t.stoppingTurnIdRef.current=null,t.stopRequestedRef.current=!1),K===t.activeTurnIdRef.current&&(t.activeTurnIdRef.current=null),t.streamingRef.current=!1,t.assistantIdRef.current=null,d(!1),m("idle"),b(null),N==="agent_settled"&&!$&&typeof document<"u"&&document.hidden&&x(re=>re+1);let Y=!1;C(re=>(Y=re.some(fe=>fe.assistantMessageId===H),re.map(fe=>fe.status==="running"&&(K!==void 0&&fe.turnId===K||fe.assistantMessageId===H)?{...fe,status:"error",finishedAt:Date.now()}:fe))),A(re=>re.filter(fe=>fe.id!==H||fe.role!=="assistant"||fe.text.trim()||fe.content&&fe.content.length>0?!0:Y)),$||T?.();return}if(N==="operation-ref"||N==="operation-status"){const _=UD(F),Y=t.sessionRef.current?.sessionId;if(_&&Y&&t.unlinkedOperationIdsRef.current.get(Y)?.has(_.operationId))return;if(_){const re=typeof F.toolCallId=="string"?F.toolCallId:void 0;y(fe=>ex(fe,{..._,...oe===void 0?{}:{eventSeq:oe,updatedSeq:oe},...K?{turnId:K}:{},...re?{toolCallId:re}:{},activityRef:`operation:${_.operationId}`}))}return}if(N==="operation-unlinked"){const _=typeof F.operationId=="string"?F.operationId:"",Y=t.sessionRef.current?.sessionId;if(_&&Y){const re=t.unlinkedOperationIdsRef.current.get(Y)??new Set;re.add(_),t.unlinkedOperationIdsRef.current.set(Y,re),y(fe=>fe.filter(j=>j.operationId!==_))}return}if(N==="usage"){if($)return;const _=F,Y=typeof _.responseKey=="string"&&_.responseKey?_.responseKey:void 0;if(Y&&t.usageResponseKeysRef.current.has(Y))return;Y&&t.usageResponseKeysRef.current.add(Y),S(re=>{const fe=_.inputTokens??0,j=_.outputTokens??0,G=_.cacheReadTokens??0,W=_.cacheWriteTokens??0,O=_.totalTokens??fe+j+G+W,be=_.contextUsage,se=be&&typeof be=="object"?{tokens:typeof be.tokens=="number"?be.tokens:null,contextWindow:typeof be.contextWindow=="number"?be.contextWindow:0,percent:typeof be.percent=="number"?be.percent:null}:re.contextUsage;return{inputTokens:re.inputTokens+fe,outputTokens:re.outputTokens+j,cacheReadTokens:re.cacheReadTokens+G,cacheWriteTokens:re.cacheWriteTokens+W,totalTokens:re.totalTokens+O,cost:_.cost===void 0?re.cost:(re.cost??0)+_.cost,...se?{contextUsage:se}:{}}});return}if(N==="message_update"||N==="message_end"){if($)return;const _=t.sealedAssistantIdsRef.current;if(N==="message_update"&&_.has(H)){const j=Li("a");K&&t.turnAssistantIdsRef.current.set(K,j);const G=H;C(W=>W.map(O=>O.assistantMessageId===G?{...O,assistantMessageId:j}:O)),H=j,b(j)}const Y=typeof F.text=="string"?F.text:"",re=N1(F.content),fe=H;A(j=>j.some(W=>W.id===fe)?j.map(W=>W.id!==fe?W:{...W,text:Y,...re?{content:re}:{}}):[...j,{id:fe,role:"assistant",text:Y,createdAt:J,...re?{content:re}:{}}]),N==="message_end"&&_.add(fe)}else if(N==="tool_call"){const _=typeof F.toolCallId=="string"?F.toolCallId:Li("t"),Y=typeof F.toolName=="string"?F.toolName:"tool",re=typeof F.argsPreview=="string"?F.argsPreview:"{}";C(fe=>fe.some(j=>j.id===_)?fe.map(j=>j.id!==_?j:{...j,args:re,status:"running",turnId:K??j.turnId,assistantMessageId:H,...oe===void 0?{}:{eventSeq:oe}}):[...fe,{id:_,toolName:Y,args:re,status:"running",createdAt:J,...oe===void 0?{}:{eventSeq:oe},turnId:K,assistantMessageId:H}])}else if(N==="tool_result"){const _=typeof F.toolCallId=="string"?F.toolCallId:Li("r"),Y=typeof F.toolName=="string"?F.toolName:"tool",re=F.isError===!0,fe=typeof F.resultPreview=="string"?F.resultPreview:"{}",j=typeof F.operationId=="string"&&F.operationId?F.operationId:void 0;C(G=>G.find(O=>O.id===_)?G.map(O=>O.id!==_?O:{...O,result:fe,resultText:fe,status:re?"error":"ok",finishedAt:J,...oe===void 0?{}:{finishedSeq:oe},turnId:K??O.turnId,assistantMessageId:O.assistantMessageId??H,...j?{operationId:j}:O.operationId?{operationId:O.operationId}:{}}):[...G,{id:_,toolName:Y,result:fe,resultText:fe,status:re?"error":"ok",createdAt:J,finishedAt:J,...oe===void 0?{}:{eventSeq:oe,finishedSeq:oe},turnId:K,assistantMessageId:H,...j?{operationId:j}:{}}])}else if(N==="error"){const _=F.providerError&&typeof F.providerError=="object"?F.providerError:void 0;if(_&&typeof _.message=="string"&&typeof _.raw=="string"&&(_.category==="authentication"||_.category==="context-overflow"||_.category==="rate-limit"||_.category==="provider")){if($)return;const Y=_,re=N1(F.content),fe=K&&oe!==void 0?`provider-error-${K}-${oe}`:Li("provider-error");A(j=>{if(j.some(W=>W.id===fe))return j;const G=j.some(W=>W.id===H&&!!W.content?.length);return[...j,{id:fe,role:"assistant",kind:"provider-error",text:Y.message,createdAt:J,providerError:Y,...!G&&re?{content:re}:{}}]});return}a(typeof F.message=="string"?F.message:"chat error")}}}const Nh={inputTokens:0,outputTokens:0,cacheReadTokens:0,cacheWriteTokens:0,totalTokens:0},Ah={turns:0,steps:0,llmMs:0,toolMs:0,ttftMs:0,ttftSteps:0,decodeMs:0,decodeTokens:0};function ZD(e){const t=m=>{const h=e[m];return typeof h=="string"&&h?h:void 0},n=t("operationId"),a=t("action"),s=t("state"),o=t("createdAt");if(!n||!a||!s||!o)return;const c=t("updatedAt")??t("finishedAt")??t("startedAt")??o,d=t("dagRunId");return{schemaVersion:1,operationId:n,action:a,state:s,createdAt:o,updatedAt:c,inspectHref:`/inspect/?operationId=${encodeURIComponent(n)}#/`,...t("taskId")?{taskId:t("taskId")}:{},...d?{dagRunId:d}:{},...t("errorCode")?{errorCode:t("errorCode")}:{},activityRef:`operation:${n}`,previewHash:`${n}:${s}:${c}`}}async function XD(e){const{identity:t}=e,n=()=>{const a=e.currentOwner();return a.sessionId===t.sessionId&&a.workspaceId===t.workspaceId};if(!t.workspaceId||!n())return!1;if(t.action==="remove")return e.setOperationCards(a=>a.filter(s=>s.operationId!==t.operationId)),!0;try{const a=new URLSearchParams({workspaceId:t.workspaceId}),o=await(e.fetchFn??fetch)(`${e.origin}/api/operator/v1/operations/${encodeURIComponent(t.operationId)}?${a.toString()}`,{credentials:"include"});if(!o.ok||!n())return!1;const c=await o.json(),d=c.operation;if(c.workspaceId!==t.workspaceId||!d||d.workspaceId!==t.workspaceId||d.operationId!==t.operationId||!n())return!1;const m=ZD(d);return m?(e.setOperationCards(h=>n()?ex(h,m):h),n()):!1}catch{return!1}}function QD(e,t){return(t??[]).reduce((n,a)=>Ap(n,a),e)}function JD(e){const{origin:t,refs:n,sessionId:a,workspaceId:s,setError:o,onReconcile:c}=e,[d,m]=w.useState([]),[h,p]=w.useState([]),[b,x]=w.useState([]),[y,S]=w.useState([]),[T,A]=w.useState(50),[C,M]=w.useState(0),[I,P]=w.useState([]),[U,N]=w.useState(null),[z,X]=w.useState(null),[B,$]=w.useState(!1),[F,K]=w.useState(Nh),[oe,J]=w.useState(Ah),[H,_]=w.useState(!1),[Y,re]=w.useState("idle"),[fe,j]=w.useState(null),[G,W]=w.useState([]),[O,be]=w.useState(null),[se,V]=w.useState([]),[Z,ne]=w.useState(null),[ue]=w.useState(!1),he=w.useCallback(async()=>{const ze=n.sessionRef.current?.sessionId;if(ze)try{const Qe=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(ze)}`,{credentials:"include"});if(!Qe.ok)return;const Ue=await Qe.json();if(n.sessionRef.current?.sessionId!==ze)return;Ue.sessionStats&&J(Ue.sessionStats),Ue.usage&&K(Ue.usage)}catch{}},[t,n]),Re=w.useMemo(()=>WD({refs:n,onReconcile:c,setError:o,setInterview:N,setHumanGateCards:P,setArtifactCards:S,setStreaming:_,setTurnPhase:re,setDeferredTurn:j,setDeferredTurns:W,setPendingQuestion:be,setTodos:V,setStreamingAssistantId:ne,setUnread:M,setOperationCards:x,setUsage:K,onTelemetryRefresh:()=>{he()},setMessages:m,setToolCalls:p}),[n,c,o,he]),Le=w.useCallback((ze,Qe,Ue)=>{if(Ue?.targetSessionId&&n.sessionRef.current?.sessionId!==Ue.targetSessionId||Ue?.generation!==void 0&&n.sessionGenerationRef.current!==Ue.generation)return null;const mt=ze.split(`
|
|
397
|
-
`);let pe="message",me="",He=null;for(const lt of mt)lt.startsWith("event: ")?pe=lt.slice(7).trim():lt.startsWith("data: ")?me+=lt.slice(6):lt.startsWith("id: ")&&(He=lt.slice(4).trim());if(!me)return He;let we;try{we=JSON.parse(me)}catch{return He}const Fe=He??(typeof we.eventId=="string"?we.eventId:null);if(Fe){if(n.seenEventIdsRef.current.has(Fe))return Fe;n.seenEventIdsRef.current.add(Fe)}return Re(pe,we,Qe,Ue),He??Fe},[Re,n]),Ye=w.useCallback(async(ze,Qe)=>{const Ue=Qe?.background===!0;Ue||$(!0);try{const mt=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(ze)}/context`,{credentials:"include"});if(!mt.ok)return;const pe=await mt.json();pe.context&&n.sessionRef.current?.sessionId===ze&&X(me=>vk(me,pe.context)?me:pe.context)}finally{Ue||$(!1)}},[t,n]);w.useEffect(()=>{a&&Ye(a)},[a,Ye]),w.useEffect(()=>{if(!a)return;const ze=window.setTimeout(()=>{Ye(a,{background:!0})},350);return()=>window.clearTimeout(ze)},[a,b,I,U,Ye]);const ut=w.useCallback(ze=>XD({origin:t,identity:ze,currentOwner:()=>({sessionId:n.sessionRef.current?.sessionId,workspaceId:s}),setOperationCards:x}),[t,n,s]),pt=w.useMemo(()=>d.filter(ze=>ze.role!=="system"||ue),[d,ue]);w.useEffect(()=>{const ze=()=>{document.hidden||M(0)};return document.addEventListener("visibilitychange",ze),()=>document.removeEventListener("visibilitychange",ze)},[]);const Rt=w.useMemo(()=>{if(h.length===0)return null;const ze=h.filter(me=>me.status==="running"),Qe=h.filter(me=>me.status==="error"),Ue=ze[ze.length-1];let mt="完成",pe="ok";return Qe.length>0?(mt=`${Qe.length} 次出错`,pe="error"):ze.length>0?(mt=Ue?`${Ue.toolName} 运行中`:"运行中",pe="running"):mt="",{count:h.length,statusLabel:mt,statusKind:pe}},[h]),Ht=w.useMemo(()=>{const ze=qD({messages:pt,toolCalls:h,streaming:H,activeAssistantId:Z});return HD(ze,T)},[pt,h,H,Z,T]),at=w.useMemo(()=>{const ze=[];for(const Qe of Ht)Qe.user&&ze.push(Qe.user),ze.push(...Qe.assistants);return ze},[Ht]),Mt=w.useCallback(()=>{m([]),p([]),x([]),P([]),S([]),N(null),X(null),K(Nh),J(Ah),_(!1),re("idle"),j(null),W([]),be(null),V([]),ne(null),M(0),A(50),n.usageResponseKeysRef.current=new Set},[n]),ft=w.useCallback(ze=>{const Qe=ze.turnPhase==="stopping";m(ze.messages),p(ze.toolCalls),x([]),P([]),S([]),X(null),N(null),K(ze.usage??Nh),J(ze.sessionStats??Ah),n.usageResponseKeysRef.current=new Set,_(Qe?!1:ze.streaming),re(Qe?"idle":ze.turnPhase??(ze.streaming?"running":"idle")),j(ze.deferredTurn??null),W(ze.deferredTurns??(ze.deferredTurn?[ze.deferredTurn]:[])),be(ze.pendingQuestion??null),V(ze.todos??[]),ne(null),M(0),A(50)},[n]),Ut=w.useCallback(async ze=>{try{const Qe=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(ze)}`,{credentials:"include"});if(!Qe.ok)return!1;const Ue=await Qe.json();if(!Ue.session||n.sessionRef.current?.sessionId!==ze)return!1;const mt=Ue.session.activeTurnId??null,pe=Ue.session.turnPhase==="stopping";n.activeTurnIdRef.current=mt,n.streamingRef.current=pe?!1:!!mt,_(pe?!1:!!mt),re(pe?"idle":Ue.session.turnPhase??(mt?"running":"idle")),j(Ue.session.deferredTurn??null),W(Ue.session.deferredTurns??(Ue.session.deferredTurn?[Ue.session.deferredTurn]:[])),be(Ue.session.pendingQuestion??null),V(Ue.session.todos??[]),Ue.sessionStats&&J(Ue.sessionStats),Ue.usage&&K(Ue.usage),n.lastEventIdRef.current=Ue.lastEventId??null,n.seenEventIdsRef.current=new Set,n.turnAssistantIdsRef.current=new Map,n.sealedAssistantIdsRef.current=new Set;const me=I1(Ue.session.messages??[]);return m(QD(me.messages,Ue.compactions)),p(me.toolCalls),ne(null),!0}catch{return!1}},[t,n,m,p,ne,_,re,j,be,V]);return{messages:d,setMessages:m,toolCalls:h,setToolCalls:p,operationCards:b,artifactCards:y,historyLimit:T,setHistoryLimit:A,unread:C,humanGateCards:I,interview:U,setInterview:N,taskContext:z,contextLoading:B,usage:F,sessionStats:oe,streaming:H,setStreaming:_,turnPhase:Y,setTurnPhase:re,deferredTurn:fe,setDeferredTurn:j,deferredTurns:G,setDeferredTurns:W,pendingQuestion:O,setPendingQuestion:be,todos:se,streamingAssistantId:Z,setStreamingAssistantId:ne,visibleMessages:at,turnGroups:Ht,processSummary:Rt,applyChatSseEvent:Re,applySseBlock:Le,loadTaskContext:Ye,applyOperationLinkMutation:ut,resetForNewSession:Mt,applyActivatedSession:ft,recoverSession:Ut}}const ej={error:6e3,info:4e3};function tj(e){const{toast:t,onDismiss:n}=e,[a,s]=w.useState(!1),o=w.useRef(null),c=w.useRef(null),d=()=>{o.current!==null&&window.clearTimeout(o.current),c.current!==null&&window.clearTimeout(c.current),o.current=null,c.current=null},m=()=>{d(),s(!0),c.current=window.setTimeout(()=>{s(!1),n()},140)};if(w.useEffect(()=>{if(t)return s(!1),o.current=window.setTimeout(m,ej[t.kind]),d},[t?.id]),w.useEffect(()=>d,[]),!t)return null;const h=t.kind==="error";return hd.createPortal(u.jsxs("div",{className:`oc-toast is-${t.kind}${a?" is-leaving":""}`,role:h?"alert":"status",onMouseEnter:d,onMouseLeave:()=>{a||(o.current=window.setTimeout(m,1600))},children:[u.jsx("span",{className:"oc-toast-icon","aria-hidden":"true",children:h?u.jsx(Kw,{size:16}):u.jsx(o5,{size:16})}),u.jsx("span",{className:"oc-toast-message",children:t.message}),u.jsx("button",{type:"button",className:"oc-toast-close","aria-label":"关闭提示",onClick:m,children:u.jsx(Ss,{size:14,"aria-hidden":"true"})})]}),document.body)}function k3(e){if(e.readiness==="ready"||e.readiness==="unknown")return null;const t=e.readiness==="setup-required";return u.jsxs("section",{className:`oc-readiness-notice is-${e.presentation}${t?" is-setup":" is-degraded"}`,role:"status","aria-live":"polite",children:[u.jsx("span",{className:"oc-readiness-notice-icon","aria-hidden":"true",children:t?u.jsx(c5,{size:18}):u.jsx(o5,{size:17})}),u.jsxs("div",{className:"oc-readiness-notice-copy",children:[u.jsx("strong",{children:t?"Pi 尚未配置":"Pi 当前为降级状态"}),u.jsx("span",{children:t?"完成认证并选择模型后即可开始对话":"仍可继续对话,但部分模型或工具能力可能暂不可用"})]}),t&&e.onOpenModels?u.jsx("button",{type:"button",className:"oc-readiness-notice-action",onClick:e.onOpenModels,children:"去配置"}):null]})}function Vl(e){return e==="missing-capability-token"||e==="invalid-capability-token"||e==="missing-confirmation-token"||e==="invalid-confirmation-token"||e==="host-not-loopback"||e==="origin-mismatch"||e==="cross-site-fetch"}function tx(e){return e==="invalid-capability-token"||e==="invalid-confirmation-token"||e==="missing-capability-token"||e==="missing-confirmation-token"}function Kl(e){return tx(e)?"页面凭证已失效(控制台可能已重启),请刷新页面(F5)后重试。":e==="host-not-loopback"?"请求主机校验失败:非回环绑定时要求 Host 头,请刷新页面或检查访问地址。":e==="origin-mismatch"?"请求来源与控制台地址不一致,请通过控制台页面操作。":e==="cross-site-fetch"?"检测到跨站请求,已拒绝。请通过控制台页面操作。":"操作被拒绝,请刷新页面后重试。"}class nj{constructor(t){this.options=t,this.fetchFn=t.fetchFn??fetch,this.backoffMs=t.backoffMs??1e3,this.deadlineMs=t.deadlineMs??3e4}options;eligible=new Set;controllers=new Map;fetchFn;backoffMs;deadlineMs;markEligible(t){this.eligible.add(t)}startIfEligible(t){if(!this.eligible.delete(t)||this.controllers.has(t))return;const n=new AbortController;this.controllers.set(t,n),this.run(t,n)}cancel(t){this.eligible.delete(t),this.controllers.get(t)?.abort(),this.controllers.delete(t)}reconcile(t){const n=new Set(t);for(const a of this.controllers.keys())n.has(a)||this.cancel(a)}dispose(){for(const t of this.controllers.values())t.abort();this.controllers.clear(),this.eligible.clear()}async run(t,n){let a;const s=new Set;let o=!1;const c=window.setTimeout(()=>{o=!0,n.abort()},this.deadlineMs);try{for(;!n.signal.aborted;){try{const d={Accept:"text/event-stream"};a&&(d["Last-Event-ID"]=a);const m=await this.fetchFn(`${this.options.origin}/api/operator/v1/chat/sessions/${encodeURIComponent(t)}/events`,{headers:d,credentials:"include",signal:n.signal});if(m.status===404||!m.body)return;if(!m.ok)throw new Error(`HTTP ${m.status}`);const h=m.body.getReader(),p=new TextDecoder;let b="";for(;;){const{done:x,value:y}=await h.read();if(x||n.signal.aborted)break;b+=p.decode(y,{stream:!0});const S=b.split(`
|
|
398
|
-
|
|
399
|
-
`);b=S.pop()??"";for(const T of S){const A=T.split(`
|
|
400
|
-
`).find(M=>M.startsWith("id: "))?.slice(4);if(A&&(a=A),!A||s.has(A)||!T.includes("event: session_title"))continue;const C=T.split(`
|
|
401
|
-
`).find(M=>M.startsWith("data: "))?.slice(6);if(C)try{const M=JSON.parse(C),I=M.data?.title?.trim();if(!I)continue;if(s.add(A),!this.options.hasSession(t)||(this.options.onTitle(t,{title:I,automatic:!!M.data?.automatic}),M.data?.automatic))return}catch{}}}}catch{if(n.signal.aborted)return}n.signal.aborted||await rj(this.backoffMs,n.signal)}}finally{window.clearTimeout(c),this.controllers.get(t)===n&&this.controllers.delete(t),(o||!this.options.hasSession(t))&&this.options.refresh()}}}function rj(e,t){return new Promise(n=>{const a=window.setTimeout(o,e),s=()=>o();function o(){window.clearTimeout(a),t.removeEventListener("abort",s),n()}t.addEventListener("abort",s,{once:!0})})}async function aj(e){if(e.creatingRef?.current)throw new Error("CREATE_SESSION_IN_FLIGHT");e.creatingRef&&(e.creatingRef.current=!0),e.setCreatingSession?.(!0);try{const t=await(e.fetchFn??fetch)(`${e.origin}/api/operator/v1/chat/sessions`,{method:"POST",headers:{"Content-Type":"application/json","x-loop-console-confirmation":qn()},credentials:"include",body:JSON.stringify(e.options??{})});if(!t.ok){const c=await t.json().catch(()=>({}));throw Vl(c.error?.code)?new Error(Kl(c.error.code)):new Error(c.error?.message??`HTTP ${t.status}`)}const n=await t.json();if(!n.session)throw new Error("创建会话响应缺少 durable session");const a=n.session,s={sessionId:a.sessionId,...a.workspaceId||e.options?.workspaceId?{workspaceId:a.workspaceId??e.options?.workspaceId}:{},...R1(a)},o=[a,...e.sessionListRef.current.filter(c=>c.sessionId!==a.sessionId)].slice(0,$1);return e.sessionListRef.current=o,e.setSessionList(o),e.titleWatcher?.markEligible(a.sessionId),e.refreshSessionList(),s}finally{e.creatingRef&&(e.creatingRef.current=!1),e.setCreatingSession?.(!1)}}function S3(e,t){return(t??[]).reduce((n,a)=>Ap(n,a),e)}function ij(e){const{origin:t,refs:n,setSession:a,thread:s,composer:o,browser:c,setError:d,setNotice:m,onCompactionChange:h,setProcessOpen:p,setAutoScroll:b}=e,{applyActivatedSession:x,resetForNewSession:y,setMessages:S}=s,{setInput:T,setPendingImages:A}=o,{setPreviews:C,setActivePreviewPath:M}=c,{workspaceId:I,blocked:P}=e,U=I?`?workspaceId=${encodeURIComponent(I)}`:"",N=w.useCallback(se=>{const V=se?.trim()||n.sessionRef.current?.workspaceId?.trim()||"";return V?`?workspaceId=${encodeURIComponent(V)}`:""},[n]),[z,X]=w.useState([]),B=w.useRef([]);B.current=z;const $=w.useRef(null),[F,K]=w.useState(!1),oe=w.useRef(!1),J=w.useRef(!1),H=w.useRef(0),_=w.useCallback(se=>{const V=se?.keepStreams===!0;n.sessionGenerationRef.current+=1,V||n.abortRef.current?.abort(),n.reconnectAbortRef.current?.abort();for(const Z of n.sessionAbortControllersRef.current.values())Z.abort();n.sessionAbortControllersRef.current.clear(),n.reconnectAbortRef.current=null,n.eventsStreamStateRef.current=null,n.streamingRef.current=!1,n.abortRef.current=null,n.assistantIdRef.current=null,n.lastEventIdRef.current=null,n.seenEventIdsRef.current=new Set,n.turnAssistantIdsRef.current=new Map,n.sealedAssistantIdsRef.current=new Set,n.settledTurnIdsRef.current=new Set,n.activeTurnIdRef.current=null,y(),T(""),A([]),C([]),M(null),p(!1),b(!0)},[n,y,T,A,C,M,p,b]),Y=w.useCallback(async()=>{if(!P)try{const se=await fetch(`${t}/api/operator/v1/chat/sessions${U}`,{credentials:"include"});if(!se.ok)return;const V=(await se.json()).sessions??[],ne=(I?V.filter(ue=>!ue.workspaceId||ue.workspaceId===I):V).slice(0,$1);X(ne)}catch{}},[t,U,I,P]),re=w.useCallback(async se=>{try{const V=N(B.current.find(ne=>ne.sessionId===se)?.workspaceId??null);if(!(await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(se)}${V}`,{method:"DELETE",credentials:"include",headers:{"x-loop-console-confirmation":qn()}})).ok)return d("删除会话失败"),!1;if($.current?.cancel(se),n.sessionRef.current?.sessionId===se){const ne=n.sessionRef.current.workspaceId??I;H.current+=1,n.sessionRef.current=null,_(),a(null),pu(window.localStorage,ne,se)}return await Y(),!0}catch(V){return d(V instanceof Error?V.message:String(V)),!1}},[t,n,a,_,Y,d,N,I]),fe=w.useCallback(async(se,V)=>{const Z=++H.current,ne=N(V);try{const ue=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(se)}${ne}`,{credentials:"include"}),he=await ue.json();if(!ue.ok||!he.session)throw new Error(he.error?.message??"会话不可用");if(Z!==H.current)return;const Re={sessionId:he.session.sessionId,...he.session.workspaceId?{workspaceId:he.session.workspaceId}:{},...R1(he.session)};_({keepStreams:!0}),n.sessionRef.current=Re,n.activeTurnIdRef.current=he.session.activeTurnId??null;const Le=he.session.turnPhase==="stopping";n.streamingRef.current=Le?!1:!!he.session.activeTurnId,n.stoppingTurnIdRef.current=Le?he.session.activeTurnId??null:null,n.stopRequestedRef.current=Le,n.seenEventIdsRef.current=new Set,n.turnAssistantIdsRef.current=new Map,n.sealedAssistantIdsRef.current=new Set,n.settledTurnIdsRef.current=new Set,n.lastEventIdRef.current=null,a(Re),n.assistantIdRef.current=null,n.abortRef.current=n.sessionAbortControllersRef.current.get(se)??null,A([]),C([]),T(he.session.composerDraft??"");const Ye=I1(he.session.messages??[]);Ye.messages=S3(Ye.messages,he.compactions),x({messages:Ye.messages,toolCalls:Ye.toolCalls,sessionStats:he.sessionStats,usage:he.usage,streaming:Le?!1:!!he.session.activeTurnId,turnPhase:he.session.turnPhase??(he.session.activeTurnId?"running":"idle"),deferredTurn:he.session.deferredTurn??null,deferredTurns:he.session.deferredTurns??(he.session.deferredTurn?[he.session.deferredTurn]:[]),pendingQuestion:he.session.pendingQuestion??null,todos:he.session.todos??[]}),Vf(window.localStorage,he.session.workspaceId??V??I,se),M(null)}catch(ue){if(Z!==H.current)return;d(ue instanceof Error?ue.message:String(ue))}},[t,n,a,A,C,T,x,_,M,d,N,I]);w.useEffect(()=>{Y()},[Y]),$.current||($.current=new nj({origin:t,hasSession:se=>B.current.some(V=>V.sessionId===se),onTitle:(se,V)=>{X(Z=>Z.map(ne=>ne.sessionId!==se||V.automatic&&ne.title?ne:V.automatic?{...ne,title:V.title}:{...ne,displayTitle:V.title}))},refresh:Y}));const j=w.useCallback(se=>$.current?.startIfEligible(se),[]);w.useEffect(()=>{$.current?.reconcile(z.filter(se=>se.state!=="archived"&&!se.title).map(se=>se.sessionId))},[z]),w.useEffect(()=>()=>$.current?.dispose(),[]),w.useEffect(()=>{let se=!1;if(P)return;const V=++H.current;_({keepStreams:!0}),n.sessionRef.current=null,a(null);const Z=q9(window.localStorage,I);if(!Z){pu(window.localStorage,I);return}return(async()=>{try{const ne=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(Z)}${U}`,{credentials:"include"});if(!ne.ok){pu(window.localStorage,I,Z);return}const ue=await ne.json();if(se||P||V!==H.current||!ue.session)return;const he={sessionId:ue.session.sessionId,...ue.session.workspaceId?{workspaceId:ue.session.workspaceId}:I?{workspaceId:I}:{},...R1(ue.session)};n.sessionGenerationRef.current+=1,n.sessionRef.current=he,n.activeTurnIdRef.current=ue.session.activeTurnId??null;const Re=ue.session.turnPhase==="stopping";n.streamingRef.current=Re?!1:!!ue.session.activeTurnId,n.stoppingTurnIdRef.current=Re?ue.session.activeTurnId??null:null,n.stopRequestedRef.current=Re,n.seenEventIdsRef.current=new Set,n.turnAssistantIdsRef.current=new Map,n.sealedAssistantIdsRef.current=new Set,n.settledTurnIdsRef.current=new Set,n.lastEventIdRef.current=null,a(he),Vf(window.localStorage,he.workspaceId??I,he.sessionId),T(ue.session.composerDraft??"");const Le=I1(ue.session.messages??[]);Le.messages=S3(Le.messages,ue.compactions),x({messages:Le.messages,toolCalls:Le.toolCalls,sessionStats:ue.sessionStats,usage:ue.usage,streaming:Re?!1:!!ue.session.activeTurnId,turnPhase:ue.session.turnPhase??(ue.session.activeTurnId?"running":"idle"),deferredTurn:ue.session.deferredTurn??null,deferredTurns:ue.session.deferredTurns??(ue.session.deferredTurn?[ue.session.deferredTurn]:[]),pendingQuestion:ue.session.pendingQuestion??null,todos:ue.session.todos??[]})}catch{}})(),()=>{se=!0}},[t,U,n,a,T,x,P,_,I]);const G=w.useCallback(se=>{const V=se?.workspaceId?.trim()??I?.trim();return V?aj({origin:t,sessionListRef:B,setSessionList:X,titleWatcher:$.current,refreshSessionList:Y,options:{...se,workspaceId:V},setCreatingSession:K,creatingRef:oe}):(d("创建会话需要选择一个有效的工作区(不会回退默认工作区)"),Promise.reject(new Error("WORKSPACE_REQUIRED")))},[t,Y,I,d]),W=w.useCallback(async se=>{if(oe.current||P)return null;const V=++H.current;d(null);try{const Z=await G(se);return V!==H.current?null:(_({keepStreams:!0}),n.sessionRef.current=Z,Vf(window.localStorage,Z.workspaceId??se?.workspaceId??I,Z.sessionId),a(Z),Z)}catch(Z){if(V!==H.current)return null;const ne=Z instanceof Error?Z.message:String(Z);return ne!=="CREATE_SESSION_IN_FLIGHT"&&d(ne),null}},[n,a,d,_,G,P,I]),O=w.useCallback(async se=>{const V=n.sessionRef.current;if(!V||n.streamingRef.current)return;const Z=typeof se=="string"?se.trim():"";h?.(!0);try{const ne={"x-loop-console-confirmation":qn()};Z&&(ne["content-type"]="application/json");const ue=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(V.sessionId)}/compact${N()}`,{method:"POST",credentials:"include",headers:ne,...Z?{body:JSON.stringify({instructions:Z})}:{}}),he=await ue.json().catch(()=>({}));if(!ue.ok){const Ye=he.error?.code;if(Vl(Ye)){d(Kl(Ye)),tx(Ye)&&!J.current&&(J.current=!0,window.setTimeout(()=>window.location.reload(),1200));return}d(he.error?.message??"上下文压缩失败");return}d(null);const Le=he.snapshot?.summary?.trim()||"历史上下文已精简,关键决策与当前任务已保留。";await fe(V.sessionId),m({id:Date.now(),message:`已压缩上下文:${Le.slice(0,72)}${Le.length>72?"…":""}`})}catch(ne){d(ne instanceof Error?ne.message:"上下文压缩失败")}finally{h?.(!1)}},[t,n,d,m,h,fe,N]);return{sessionList:z,creatingSession:F,activateSession:fe,refreshSessionList:Y,deleteSession:re,createSession:W,updateSession:async(se,V)=>{if(!(await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(se)}${N(B.current.find(ne=>ne.sessionId===se)?.workspaceId??null)}`,{method:"PATCH",credentials:"include",headers:{"content-type":"application/json","x-loop-console-confirmation":qn()},body:JSON.stringify(V)})).ok){d("会话更新失败");return}if(await Y(),V.state==="archived"&&$.current?.cancel(se),V.state==="archived"&&n.sessionRef.current?.sessionId===se){const ne=n.sessionRef.current.workspaceId??I,ue=n.sessionRef.current.sessionId;H.current+=1,n.sessionRef.current=null,_(),a(null),pu(window.localStorage,ne,ue)}},watchSessionTitle:j,compactSession:O}}function sj(e){return e.turnPhase==="stopping"?e.blockedByTurnId?{action:"queue-deferred",blockedByTurnId:e.blockedByTurnId}:{action:"hold"}:e.turnPhase==="running"?e.blockedByTurnId?{action:"queue-deferred",blockedByTurnId:e.blockedByTurnId}:{action:"hold"}:{action:"send-now"}}function E3(e){const{clientRequestId:t,blockedByTurnId:n,state:a}=e;if(!a)return{action:"hold"};const s=a.deferredTurns?.find(c=>c.clientRequestId===t)??(a.deferredTurn?.clientRequestId===t?a.deferredTurn:void 0);if(s)return{action:"deferred",deferredTurn:s};if(a.activeTurn?.clientRequestId===t)return{action:"accepted",turn:a.activeTurn};if(a.latestTurn?.clientRequestId===t)return{action:"accepted",turn:a.latestTurn};const o=a.activeTurn?.turnId??a.activeTurnId??null;return a.turnPhase==="stopping"&&o===n?{action:"retry-deferred"}:Yl(a)?{action:"hold"}:{action:"send-now"}}function oj(e){let t;const n=new Promise(a=>{t=a});return{...e,outcomePromise:n,resolveOutcome:t}}function T3(e="network error while creating turn"){return{kind:"ambiguous",message:e}}function lj(e="无法确认 Turn 是否已创建,正在与服务端对账(不会重复提交新的请求 ID)"){return{kind:"ambiguous",message:e}}function C3(e){const{body:t,clientRequestId:n}=e,a=t.error?.code,s=t.error?.message??(e.httpOk?"turn was not accepted":`HTTP ${e.status}`);if(a==="TURN_ACTIVE"&&t.activeTurn?.turnId)return{kind:"adopt-active",activeTurn:t.activeTurn,message:"上一轮仍在运行,已重新连接;当前消息已保留。"};if(t.accepted===!0||e.httpOk&&t.turnId){const o=t.turn?.turnId??t.turnId;return o?{kind:"accepted",turnId:o,idempotent:t.idempotent===!0,turn:t.turn??{turnId:o,clientRequestId:n,state:t.state}}:{kind:"ambiguous",message:s}}return t.accepted===!1||a?{kind:"rejected",code:a,message:s}:{kind:"ambiguous",message:s}}function cj(e){const t=e.clientRequestId,n=e.state?.activeTurn,a=e.state?.latestTurn;return n?.clientRequestId===t&&n.turnId?{kind:"accepted",turnId:n.turnId,idempotent:!0,turn:n}:a?.clientRequestId===t&&a.turnId?{kind:"accepted",turnId:a.turnId,idempotent:!0,turn:a}:n?.turnId?{kind:"adopt-active",activeTurn:n,message:"上一轮仍在运行,已重新连接;当前消息已保留。"}:null}function uj(e){const t=e.clientRequestId,n=e.state?.activeTurn,a=e.state?.latestTurn,s=n?.state??e.state?.activeTurnState??void 0,o=a?.state??e.state?.latestTurnState??void 0;if(n?.clientRequestId===t&&n.turnId)return xs(s)?{action:"release-terminal",turnId:n.turnId,state:String(s)}:{action:"bind-active",turnId:n.turnId};if(a?.clientRequestId===t&&a.turnId){if(xs(o))return{action:"release-terminal",turnId:a.turnId,state:String(o)};if(!n?.turnId||n.clientRequestId===t)return{action:"bind-active",turnId:a.turnId}}return!Yl(e.state)&&!(!!n?.turnId&&n?.clientRequestId!==t)?{action:"release-not-accepted"}:{action:"hold"}}function Yl(e){if(e?.activeTurnId||e?.activeTurn?.turnId)return!0;const t=e?.runtime;return t?t.isStreaming===!0||t.isPromptRunning===!0||t.isCompacting===!0||t.isBashRunning===!0:!1}function xs(e){return e==="settled"||e==="aborted"||e==="failed"}function ld(e){return e.pending.sessionId===e.sessionId&&e.pending.sessionGeneration===e.sessionGeneration&&e.pending.submitGeneration===e.submitGeneration}function dj(e,t){return`${e}/api/operator/v1/chat/sessions/${encodeURIComponent(t)}/turns`}function R3(e,t){return`${e}/api/operator/v1/chat/sessions/${encodeURIComponent(t)}/state`}function fj(e,t){return`${e}/api/operator/v1/chat/sessions/${encodeURIComponent(t)}/events`}function mj(e,t,n){return`${e}/api/operator/v1/chat/sessions/${encodeURIComponent(t)}/turns/${encodeURIComponent(n)}/abort`}function Rl(e){return e.stoppingTurnId||e.stopRequested?"stopping":e.activeTurnId||e.streaming||e.submitInFlight||e.pendingSubmission?"running":"idle"}function Mu(e){const t=Rl(e);return t==="stopping"?"idle":t}function Pi(e,t){const n=e.pendingSubmission;t&&n&&n.clientRequestId!==t||(e.submitInFlight=!1,(!t||n?.clientRequestId===t)&&(n?.clientRequestId?e.releasedClientRequestIds.add(n.clientRequestId):t&&e.releasedClientRequestIds.add(t),e.pendingSubmission=null),e.pendingSubmission||(e.stopRequested=!1))}function nx(e){e.stopRequested=!0}function vo(e){e.stopRequested=!1}function hj(e,t){return!(!t||e.abortPostedTurnIds.has(t))}function pj(e,t){t&&e.abortPostedTurnIds.add(t)}function cd(e,t){return!e.stopRequested||!hj(e,t)?null:(pj(e,t),e.stoppingTurnId=t,e.activeTurnId=t,t)}function N3(e,t){const n=e.pendingSubmission;return n&&n.clientRequestId!==t.clientRequestId?!1:(t.turnId&&e.settledTurnIds.add(t.turnId),Pi(e,t.clientRequestId),vo(e),t.markIdle!==!1&&(e.streaming=!1,e.activeTurnId=null,e.assistantId=null,e.stoppingTurnId=null),!0)}function gj(e,t){return ld({pending:t.pending,sessionId:e.sessionId,sessionGeneration:e.sessionGeneration,submitGeneration:e.submitGeneration})?(t.pending.acceptedTurnId=t.turnId,e.activeTurnId=t.turnId,e.turnAssistantIds.set(t.turnId,t.assistantId),e.streaming=!0,e.submitInFlight=!1,t.pending.resolveOutcome({kind:"accepted",turnId:t.turnId}),t.ui?.setStreaming(!0),t.ui?.setStreamingAssistantId(t.assistantId),t.ui?.setPendingImages([]),t.ui?.watchSessionTitle?.(t.sessionId),!0):(t.pending.resolveOutcome({kind:"stale"}),!1)}function bj(e,t){t.pending.resolveOutcome({kind:"adopt-active",activeTurn:{turnId:t.activeTurnId},message:t.message}),Pi(e,t.pending.clientRequestId),t.current&&(t.ui?.clearEmptyAssistant(t.assistantId),t.ui?.setInput(t.text),t.ui?.setPendingImages(t.images),e.activeTurnId=t.activeTurnId,e.assistantId=null,e.streaming=!0,t.ui?.setStreaming(!0),t.ui?.setStreamingAssistantId(null),t.notice.setError(null),t.notice.showNotice(t.message))}function vj(e,t){if(t.pending.resolveOutcome({kind:"rejected",message:t.message}),Pi(e,t.pending.clientRequestId),!t.current)return;const n=t.ui?.formatError?t.ui.formatError(t.message):t.message;t.ui?.setError(n),e.streaming=!1,e.assistantId=null,t.ui?.setStreaming(!1),t.ui?.setStreamingAssistantId(null),t.ui?.clearEmptyAssistant(t.assistantId),t.ui?.setInput(t.text),t.ui?.setPendingImages(t.images)}function yj(e,t,n){const a=ld({pending:n.pending,sessionId:e.sessionId,sessionGeneration:e.sessionGeneration,submitGeneration:e.submitGeneration});if(t.kind==="accepted"){if(gj(e,{turnId:t.turnId,assistantId:n.assistantId,pending:n.pending,sessionId:n.sessionId,ui:n.acceptedUi})){const o=cd(e,t.turnId);o&&n.onAutoAbort?.(o)}return}if(t.kind==="adopt-active"){const s=a?cd(e,t.activeTurn.turnId):null;bj(e,{activeTurnId:t.activeTurn.turnId,message:t.message,assistantId:n.assistantId,text:n.text,images:n.images,pending:n.pending,current:a,notice:n.notice,ui:n.adoptUi}),s&&n.onAutoAbort?.(s);return}if(t.kind==="rejected"){vj(e,{message:t.message,assistantId:n.assistantId,text:n.text,images:n.images,pending:n.pending,current:a,ui:n.rejectedUi}),vo(e);return}if(t.kind==="stale"){n.pending.resolveOutcome(t),Pi(e,n.pending.clientRequestId),vo(e);return}n.pending.resolveOutcome(t)}function xj(e,t,n,a){const s=e.pendingSubmission;if(!s)return"held";if(t.action==="bind-active"){const c=!!s.acceptedTurnId;c||(s.acceptedTurnId=t.turnId,e.activeTurnId=t.turnId,e.turnAssistantIds.set(t.turnId,s.assistantId),e.streaming=!0,e.submitInFlight=!1);const d=cd(e,t.turnId);return d&&a?.onAutoAbort?.(d),c?"held":"bound"}if(t.action==="release-terminal"||t.action==="release-not-accepted")return t.action==="release-terminal"&&e.settledTurnIds.add(t.turnId),Pi(e,s.clientRequestId),vo(e),Yl(n)||(e.streaming=!1,e.activeTurnId=null,e.assistantId=null,e.stoppingTurnId=null,a?.markIdle?.()),"released";const o=n?.activeTurn?.turnId??n?.activeTurnId??null;return o&&(e.activeTurnId=o),"held"}const wj="正在停止…",kj="正在停止…",Sj="停止请求未完成,正在与服务端对账…",Ej="停止请求失败,正在与服务端对账…";function A3(e){e.showNotice(wj)}function I3(e){if(e.networkError)return{action:"keep-busy-notice",message:Ej};const t=e.body.turn?.state;return e.body.accepted===!0&&xs(t)?{action:"terminal-idle",turnId:e.turnId}:e.httpOk&&e.body.accepted===!0?{action:"abort-accepted-background"}:e.body.error?.code==="TURN_ABORT_PENDING"?{action:"abort-pending-notice"}:e.body.error?.code==="CHAT_TURN_OWNER_LOST"||e.body.error?.code==="OWNER_LOST"?{action:"owner-lost-reconcile"}:e.httpOk?{action:"noop"}:{action:"keep-busy-notice",message:Sj}}function Ih(e,t,n,a){const s=a?.sessionStillCurrent!==!1;if(t.action==="terminal-idle"){if(!s)return;e.settledTurnIds.add(t.turnId),e.pendingSubmission&&Pi(e,e.pendingSubmission.clientRequestId),vo(e),e.streaming=!1,e.activeTurnId=null,e.assistantId=null,e.stoppingTurnId=null,a?.markIdle?.();return}if(t.action!=="abort-accepted-background"){if(t.action==="abort-pending-notice"){n.showNotice(kj);return}if(t.action==="owner-lost-reconcile"){if(!s)return;a?.runtimeBusy||(e.stoppingTurnId&&e.settledTurnIds.add(e.stoppingTurnId),e.streaming=!1,e.pendingSubmission&&Pi(e,e.pendingSubmission.clientRequestId),vo(e),e.activeTurnId=null,e.assistantId=null,e.stoppingTurnId=null,a?.markIdle?.());return}if(t.action==="keep-busy-notice"){n.showNotice(t.message);return}}}function _3(e,t){nx(e);const n=e.activeTurnId??e.pendingSubmission?.acceptedTurnId??null;if(n){const a=cd(e,n);return a?(t.notice&&A3(t.notice),t.postAbort(a),{abortedTurnId:a,stopRequested:!0}):{abortedTurnId:null,stopRequested:!0}}return t.notice&&A3(t.notice),{abortedTurnId:null,stopRequested:!0}}function va(e){return{submitInFlight:e.submitInFlightRef.current,pendingSubmission:e.pendingSubmissionRef.current,activeTurnId:e.activeTurnIdRef.current,streaming:e.streamingRef.current,assistantId:e.assistantIdRef.current,stoppingTurnId:e.stoppingTurnIdRef.current,settledTurnIds:e.settledTurnIdsRef.current,turnAssistantIds:e.turnAssistantIdsRef.current,sessionId:e.sessionRef.current?.sessionId??null,sessionGeneration:e.sessionGenerationRef.current,submitGeneration:e.submitGenerationRef.current,stopInFlight:e.stopInFlightRef.current,stopRequested:e.stopRequestedRef.current,abortPostedTurnIds:e.abortPostedTurnIdsRef.current,releasedClientRequestIds:e.releasedClientRequestIdsRef.current}}function ya(e,t){e.submitInFlightRef.current=t.submitInFlight,e.pendingSubmissionRef.current=t.pendingSubmission,e.activeTurnIdRef.current=t.activeTurnId,e.streamingRef.current=t.streaming,e.assistantIdRef.current=t.assistantId,e.stoppingTurnIdRef.current=t.stoppingTurnId,e.submitGenerationRef.current=t.submitGeneration,e.stopInFlightRef.current=t.stopInFlight,e.stopRequestedRef.current=t.stopRequested}function Tj(e){return e.split(`
|
|
402
|
-
`).find(t=>t.startsWith("event: "))?.slice(7).trim()??"message"}function Cj(){return new Promise(e=>window.setTimeout(e,25))}const M3=[100,250,500,1e3,2e3];function _h(e,t){t&&e(n=>n.filter(a=>!(a.id===t&&a.role==="assistant"&&!a.text.trim())))}function Rj(e){const{origin:t,refs:n,session:a,thread:s,composer:o,setError:c,setAutoScroll:d,setNotice:m,recoveryVersion:h=0,watchSessionTitle:p}=e,{applySseBlock:b,setMessages:x,setStreaming:y,setStreamingAssistantId:S,streaming:T,setTurnPhase:A,setDeferredTurn:C,setDeferredTurns:M}=s,{setInput:I,setPendingImages:P,recordHistory:U}=o,N=w.useCallback(se=>{m&&m({id:Date.now(),message:se})},[m]),z=w.useCallback(se=>{const V=va(n);Pi(V,se),ya(n,V)},[n]),X=w.useCallback((se,V,Z)=>{if(n.sessionRef.current?.sessionId!==se||n.sessionGenerationRef.current!==V)return;const ne=n.pendingSubmissionRef.current?.clientRequestId;ne&&z(ne),n.streamingRef.current=!1,n.activeTurnIdRef.current=null,n.assistantIdRef.current=null,n.stoppingTurnIdRef.current=null,n.stopRequestedRef.current=!1,y(!1),A("idle"),S(null),_h(x,Z)},[n,z,y,A,S,x]),B=w.useCallback(async(se,V,Z)=>{for(;!Z.aborted;){const ne=n.eventsStreamStateRef.current;if(!ne||ne.sessionId!==se||ne.generation!==V)return;ne.ready=!1;try{const ue={Accept:"text/event-stream"},he=n.lastEventIdRef.current;he&&(ue["Last-Event-ID"]=he);const Re=await fetch(fj(t,se),{headers:ue,credentials:"include",signal:Z});if(!Re.ok||!Re.body){if(Re.status===404)return;await Qf(2e3,Z);continue}const Le=Re.body.getReader(),Ye=new TextDecoder;let ut="",pt=!0;const Rt=Li("a");for(;;){const{done:at,value:Mt}=await Le.read();if(at)break;ut+=Ye.decode(Mt,{stream:!0});const ft=ut.split(`
|
|
403
|
-
|
|
404
|
-
`);ut=ft.pop()??"";for(const Ut of ft){if(Tj(Ut)==="stream_ready"){const Ue=n.eventsStreamStateRef.current;Ue?.sessionId===se&&Ue.generation===V&&(Ue.ready=!0),pt=!1;continue}const ze=n.assistantIdRef.current??Rt,Qe=b(Ut,ze,{replay:pt,targetSessionId:se,generation:V});Qe&&(n.lastEventIdRef.current=Qe)}}const Ht=n.eventsStreamStateRef.current;Ht?.sessionId===se&&Ht.generation===V&&(Ht.ready=!1),await Qf(1e3,Z)}catch{if(Z.aborted)return;await Qf(2e3,Z)}}},[t,n,b]),$=w.useCallback((se,V)=>{const Z=n.eventsStreamStateRef.current;if(Z?.sessionId===se&&Z.generation===V&&n.reconnectAbortRef.current)return;n.reconnectAbortRef.current?.abort();const ne=new AbortController;n.reconnectAbortRef.current=ne,n.eventsStreamStateRef.current={sessionId:se,generation:V,ready:!1},B(se,V,ne.signal)},[n,B]),F=w.useCallback(async(se,V)=>{$(se,V);const Z=Date.now()+5e3;for(;Date.now()<Z;){const ne=n.eventsStreamStateRef.current;if(ne?.sessionId===se&&ne.generation===V&&ne.ready)return;if(n.sessionRef.current?.sessionId!==se||n.sessionGenerationRef.current!==V)throw new Error("会话已切换");await Cj()}throw new Error("事件连接未就绪,请检查 Console 连接后重试")},[n,$]),K=w.useCallback(async se=>{try{const V=await fetch(R3(t,se),{credentials:"include"}),Z=await V.json().catch(()=>({}));return V.ok?Z.state??null:null}catch{return null}},[t]),oe=w.useCallback(async se=>{try{const V=await fetch(dj(t,se.sessionId),{method:"POST",headers:{"Content-Type":"application/json","x-loop-console-confirmation":qn()},credentials:"include",body:JSON.stringify({clientRequestId:se.clientRequestId,text:se.text.trim()||"请查看附件图片。",images:se.images.map(({type:ne,mimeType:ue,data:he})=>({type:ne,mimeType:ue,data:he}))})}),Z=await V.json().catch(()=>({}));return{httpOk:V.ok,status:V.status,body:Z}}catch{return{httpOk:!1,status:0,body:{},networkError:!0}}},[t]),J=w.useCallback(()=>({showNotice:N,setError:se=>c(se)}),[N,c]),H=w.useCallback(async(se,V,Z)=>{n.stoppingTurnIdRef.current=Z,n.streamingRef.current=!1,y(!1),A("idle"),S(null);try{const ne=await fetch(mj(t,se,Z),{method:"POST",headers:{"Content-Type":"application/json","x-loop-console-confirmation":qn()},credentials:"include",body:"{}"}),ue=await ne.json().catch(()=>({}));if(n.sessionRef.current?.sessionId!==se||n.sessionGenerationRef.current!==V||n.stoppingTurnIdRef.current!==Z)return;const he=I3({httpOk:ne.ok,turnId:Z,body:ue}),Re=va(n);if(Re.stoppingTurnId=Z,he.action==="owner-lost-reconcile"){const Le=await K(se);if(!(n.sessionRef.current?.sessionId===se&&n.sessionGenerationRef.current===V)||n.stoppingTurnIdRef.current!==Z)return;Ih(Re,he,J(),{sessionStillCurrent:!0,runtimeBusy:Yl(Le??void 0),markIdle:()=>X(se,V,n.assistantIdRef.current)}),ya(n,Re),A(Mu(Re));return}Ih(Re,he,J(),{sessionStillCurrent:!0,markIdle:()=>X(se,V,n.assistantIdRef.current)}),ya(n,Re),A(Mu(Re))}catch{const ne=va(n);Ih(ne,I3({httpOk:!1,turnId:Z,body:{},networkError:!0}),J()),ya(n,ne),n.streamingRef.current=!1,y(!1),A("idle")}},[t,n,y,A,X,K,J]),_=w.useCallback((se,V)=>{const Z=va(n);Z.sessionId=n.sessionRef.current?.sessionId??null,Z.sessionGeneration=n.sessionGenerationRef.current,Z.submitGeneration=n.submitGenerationRef.current;const ne=he=>{P(he)};yj(Z,se,{assistantId:V.assistantId,text:V.text,images:V.images,pending:V.pending,sessionId:V.sessionId,notice:J(),acceptedUi:{setStreaming:y,setStreamingAssistantId:S,setPendingImages:ne,watchSessionTitle:p},adoptUi:{clearEmptyAssistant:he=>_h(x,he),setInput:I,setPendingImages:ne,setStreaming:y,setStreamingAssistantId:S},rejectedUi:{setError:c,setStreaming:y,setStreamingAssistantId:S,clearEmptyAssistant:he=>_h(x,he),setInput:I,setPendingImages:ne,formatError:Xa},onAutoAbort:he=>{H(V.sessionId,V.generation,he)}}),ya(n,Z);const ue=Rl(Z);A(Mu(Z)),ue==="stopping"&&(n.streamingRef.current=!1,y(!1),S(null))},[n,J,y,A,S,P,p,x,I,c,H]),Y=w.useCallback(async se=>{const V=n.sessionRef.current;if(!V||!se.text.trim()&&se.images.length===0)return{action:"handled"};N("正在排队…");const Z=(he,Re)=>{C(Re?.[0]??he),M(Re??[he]),I(""),P([]),c(null),N("已排队,将在当前回合结束后自动发送")},ne=()=>{C(null),M([]),I(""),P([]),c(null),N("消息已进入发送")},ue=async()=>{const he=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(V.sessionId)}/deferred-turn`,{method:"PUT",headers:{"Content-Type":"application/json","x-loop-console-confirmation":qn()},credentials:"include",body:JSON.stringify({clientRequestId:se.clientRequestId,blockedByTurnId:se.blockedByTurnId,text:se.text,images:se.images})}),Re=await he.json().catch(()=>({}));return{response:he,body:Re}};try{for(let he=0;he<2;he+=1){const{response:Re,body:Le}=await ue();if(Re.ok&&Le.accepted&&Le.deferredTurn)return Z(Le.deferredTurn,Le.deferredTurns),{action:"handled"};if(Le.deferredTurns&&M(Le.deferredTurns),Le.deferredTurn&&C(Le.deferredTurn),Le.error?.code!=="TURN_NOT_ACTIVE")return c(Le.error?.message??`待发送消息未被服务端接受(HTTP ${Re.status})`),{action:"handled"};const Ye=await K(V.sessionId),ut=E3({clientRequestId:se.clientRequestId,blockedByTurnId:se.blockedByTurnId,state:Ye??void 0});if(ut.action==="deferred")return Z(ut.deferredTurn,Ye?.deferredTurns),{action:"handled"};if(ut.action==="accepted")return ne(),{action:"handled"};if(!(ut.action==="retry-deferred"&&he===0))return ut.action==="send-now"?(N("上一轮已停止,正在发送当前消息…"),{action:"send-now"}):(c(Le.error?.message??"停止状态已变化,当前消息仍保留在输入框"),{action:"handled"})}return{action:"handled"}}catch(he){const Re=await K(V.sessionId),Le=E3({clientRequestId:se.clientRequestId,blockedByTurnId:se.blockedByTurnId,state:Re??void 0});return Le.action==="deferred"?(Z(Le.deferredTurn,Re?.deferredTurns),{action:"handled"}):Le.action==="accepted"?(ne(),{action:"handled"}):Le.action==="send-now"?(N("上一轮已停止,正在发送当前消息…"),{action:"send-now"}):(c(he instanceof Error?`无法确认消息是否已排队:${he.message}`:"无法确认消息是否已排队,请刷新后查看服务端状态"),{action:"handled"})}},[t,n,s.deferredTurn,C,M,I,P,c,N,K]),re=w.useCallback(async(se,V)=>{const Z=n.sessionRef.current,ne=V?s.deferredTurns.find(ue=>ue.clientRequestId===V.clientRequestId):s.deferredTurns[0]??s.deferredTurn;if(!(!Z||!ne))try{const ue=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(Z.sessionId)}/deferred-turn`,{method:"DELETE",headers:{"Content-Type":"application/json","x-loop-console-confirmation":qn()},credentials:"include",body:JSON.stringify({clientRequestId:ne.clientRequestId,expectedRevision:ne.revision})}),he=await ue.json().catch(()=>({}));if(!ue.ok||!he.cancelled){c(he.error?.message??"待发送消息撤回失败");return}const Re=s.deferredTurns.filter(Le=>Le.clientRequestId!==ne.clientRequestId);M(Re),C(Re[0]??null),se==="restore"?(I(ne.text??he.deferredTurn?.text??""),P(ne.images??he.deferredTurn?.images??[]),N("待发送消息已移回输入框")):N("已删除排队消息"),c(null)}catch(ue){c(ue instanceof Error?ue.message:String(ue))}},[t,n,s.deferredTurn,s.deferredTurns,C,M,I,P,c,N]),fe=w.useCallback(()=>re("restore"),[re]),j=w.useCallback(se=>re("discard",se),[re]),G=w.useCallback(async(se,V)=>{const Z=n.sessionRef.current;if(!Z)return;const ne=s.deferredTurns.find(ue=>ue.clientRequestId===se.clientRequestId);if(ne)try{const ue=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(Z.sessionId)}/deferred-turn`,{method:"PUT",headers:{"Content-Type":"application/json","x-loop-console-confirmation":qn()},credentials:"include",body:JSON.stringify({clientRequestId:se.clientRequestId,blockedByTurnId:ne.blockedByTurnId,text:V,images:ne.images??[],expectedRevision:se.revision})}),he=await ue.json().catch(()=>({}));if(!ue.ok)throw new Error(he.error?.message??"编辑排队消息失败");he.deferredTurns&&M(he.deferredTurns),he.deferredTurn&&C(he.deferredTurn),c(null)}catch(ue){c(ue instanceof Error?ue.message:"编辑排队消息失败")}},[t,n,s.deferredTurns,C,M,c]),W=w.useCallback(async se=>{const V=n.sessionRef.current;if(V)try{const Z=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(V.sessionId)}/deferred-turn/${encodeURIComponent(se.clientRequestId)}/steer`,{method:"POST",headers:{"Content-Type":"application/json","x-loop-console-confirmation":qn()},credentials:"include",body:JSON.stringify({expectedRevision:se.revision})}),ne=await Z.json().catch(()=>({}));if(!Z.ok)throw new Error(ne.error?.message??"插话发送失败");const ue=ne.deferredTurns??s.deferredTurns.filter(he=>he.clientRequestId!==se.clientRequestId);M(ue),C(ue[0]??null),c(null)}catch(Z){c(Z instanceof Error?Z.message:"插话发送失败")}},[t,n,s.deferredTurns,C,M,c]),O=w.useCallback(async(se,V)=>{const Z=n.sessionRef.current;if(!Z||!se.trim()&&V.length===0)return;const ne=va(n),ue=sj({turnPhase:Rl(ne),blockedByTurnId:ne.stoppingTurnId??ne.activeTurnId}),he=Li("chat-submit");if(ue.action==="hold"){const Qe=Rl(ne);Qe==="stopping"?N("正在确认上一轮停止状态,当前消息已保留"):Qe==="running"&&N("正在确认当前回合状态,当前消息已保留");return}if(U?.(se),ue.action==="queue-deferred"&&(await Y({text:se,images:V,clientRequestId:he,blockedByTurnId:ue.blockedByTurnId})).action!=="send-now")return;const Re=n.sessionRef.current,Le=n.sessionGenerationRef.current;if(!Re||Re.sessionId!==Z.sessionId||!se.trim()&&V.length===0||n.streamingRef.current||n.submitInFlightRef.current||n.pendingSubmissionRef.current)return;n.submitInFlightRef.current=!0;const Ye=++n.submitGenerationRef.current,ut=Li("u"),pt=Li("a"),Rt=se.trim(),Ht=V.slice(),at=oj({clientRequestId:he,submitGeneration:Ye,sessionId:Re.sessionId,sessionGeneration:Le,text:Rt,images:Ht,assistantId:pt,userMessageId:ut});n.pendingSubmissionRef.current=at;try{await F(Re.sessionId,Le)}catch(Qe){n.sessionRef.current?.sessionId===Re.sessionId&&n.sessionGenerationRef.current===Le&&c(Xa(Qe instanceof Error?Qe.message:String(Qe))),z(he);return}if(n.sessionRef.current?.sessionId!==Re.sessionId||n.sessionGenerationRef.current!==Le){z(he);return}const Mt={id:ut,role:"user",text:Rt,createdAt:Date.now()};x(Qe=>[...Qe,Mt,{id:pt,role:"assistant",text:"",createdAt:Date.now()}]),I(""),d(!0),c(null),n.streamingRef.current=!0,A("running"),n.assistantIdRef.current=pt,y(!0),S(pt);const ft={sessionId:Re.sessionId,generation:Le,submitGeneration:Ye,assistantId:pt,text:Rt,images:Ht,pending:at},Ut=await oe({sessionId:Re.sessionId,clientRequestId:he,text:Rt,images:Ht});if(!ld({pending:at,sessionId:n.sessionRef.current?.sessionId,sessionGeneration:n.sessionGenerationRef.current,submitGeneration:n.submitGenerationRef.current})){at.resolveOutcome({kind:"stale"}),z(he);return}let ze=Ut.networkError?T3():C3({httpOk:Ut.httpOk,status:Ut.status,body:Ut.body,clientRequestId:he});if(ze.kind==="ambiguous"){const Qe=await K(Re.sessionId),Ue=Qe?cj({clientRequestId:he,state:Qe}):null;if(Ue)ze=Ue;else{const mt=await oe({sessionId:Re.sessionId,clientRequestId:he,text:Rt,images:Ht});if(!ld({pending:at,sessionId:n.sessionRef.current?.sessionId,sessionGeneration:n.sessionGenerationRef.current,submitGeneration:n.submitGenerationRef.current})){at.resolveOutcome({kind:"stale"}),z(he);return}if(ze=mt.networkError?T3("无法确认 Turn 是否已创建,正在与服务端对账(不会重复提交新的请求 ID)"):C3({httpOk:mt.httpOk,status:mt.status,body:mt.body,clientRequestId:he}),ze.kind==="ambiguous"){const pe=ze.message||"无法确认 Turn 是否已创建,正在与服务端对账(不会重复提交新的请求 ID)";ze=lj(pe),N(pe)}}}_(ze,ft)},[t,n,F,oe,K,_,z,N,x,I,d,c,y,A,S,Y,U]),be=w.useCallback(async()=>{const se=n.sessionRef.current?.sessionId,V=n.sessionGenerationRef.current;if(!se)return;const Z=va(n),ne=_3(Z,{postAbort:()=>{}});if(ya(n,Z),n.streamingRef.current=!1,y(!1),S(null),A("idle"),ne.abortedTurnId){if(n.stopInFlightRef.current)return;n.stopInFlightRef.current=!0;try{await H(se,V,ne.abortedTurnId)}finally{n.stopInFlightRef.current=!1}return}const ue=n.pendingSubmissionRef.current;if(ue&&!n.stopInFlightRef.current){n.stopInFlightRef.current=!0;try{const he=await ue.outcomePromise;if(n.sessionRef.current?.sessionId!==se||n.sessionGenerationRef.current!==V)return;let Re=null;if(he.kind==="accepted")Re=he.turnId;else if(he.kind==="adopt-active")Re=he.activeTurn.turnId;else{if(he.kind==="ambiguous")return;n.stopRequestedRef.current=!1;return}if(!Re)return;const Le=va(n);nx(Le);const Ye=_3(Le,{postAbort:()=>{}});ya(n,Le),Ye.abortedTurnId&&await H(se,V,Ye.abortedTurnId)}finally{n.stopInFlightRef.current=!1}}},[n,H,y,S,A]);return w.useEffect(()=>{const se=!!n.pendingSubmissionRef.current||n.submitInFlightRef.current||n.stopRequestedRef.current||!!n.activeTurnIdRef.current;if(!a||!T&&!se)return;const V=a.sessionId,Z=n.sessionGenerationRef.current;let ne=!1,ue=null;const he=async()=>{try{const at=await fetch(R3(t,V),{credentials:"include"}),Mt=await at.json().catch(()=>({}));if(ne||!at.ok||n.sessionRef.current?.sessionId!==V||n.sessionGenerationRef.current!==Z)return;const ft=Mt.state,Ut=n.pendingSubmissionRef.current;if(Ut){const me=uj({clientRequestId:Ut.clientRequestId,state:ft}),He=va(n),we=xj(He,me,ft,{markIdle:()=>X(V,Z,n.assistantIdRef.current),onAutoAbort:lt=>{H(V,Z,lt)}});ya(n,He);const Fe=Rl(He);if(A(Mu(He)),Fe==="stopping"&&(n.streamingRef.current=!1,y(!1),S(null)),ft&&"deferredTurn"in ft&&C(ft.deferredTurn??null),we==="bound"&&Fe!=="stopping"){y(!0);return}if(we==="released"||!Ut.acceptedTurnId&&!He.pendingSubmission?.acceptedTurnId)return}const ze=ft?.activeTurn?.turnId??ft?.activeTurnId??null;n.activeTurnIdRef.current=ze;const Qe=Yl(ft),Ue=n.pendingSubmissionRef.current;if(Ue){const me=ft?.latestTurn?.clientRequestId===Ue.clientRequestId&&xs(ft?.latestTurn?.state),He=ft?.activeTurn?.clientRequestId===Ue.clientRequestId&&xs(ft?.activeTurn?.state);if(me||He){const we=He?ft?.activeTurn?.turnId??null:ft?.latestTurn?.turnId??Ue.acceptedTurnId??null,Fe=va(n);N3(Fe,{clientRequestId:Ue.clientRequestId,turnId:we,markIdle:!Qe}),ya(n,Fe),Qe||X(V,Z,n.assistantIdRef.current);return}}if(Qe)return;const mt=n.assistantIdRef.current;if(ze&&!(xs(ft?.activeTurn?.state)||xs(ft?.activeTurnState)))return;ze&&n.settledTurnIdsRef.current.add(ze);const pe=Ue?.clientRequestId;if(pe){const me=va(n);N3(me,{clientRequestId:pe,turnId:ze,markIdle:!0}),ya(n,me)}else z();X(V,Z,mt)}catch{}},Re=()=>ue||(ue=he().finally(()=>{ue=null}),ue),Le=()=>{document.visibilityState==="visible"&&Re()},Ye=()=>{Re()},ut=window.setInterval(()=>{Re()},15e3);let pt,Rt=0;const Ht=()=>{if(ne||Rt>=M3.length||!n.stopRequestedRef.current&&!n.stoppingTurnIdRef.current)return;const at=M3[Rt++];pt=window.setTimeout(()=>{Re().finally(Ht)},at)};return document.addEventListener("visibilitychange",Le),window.addEventListener("online",Ye),Re().finally(Ht),()=>{ne=!0,window.clearInterval(ut),pt!==void 0&&window.clearTimeout(pt),document.removeEventListener("visibilitychange",Le),window.removeEventListener("online",Ye)}},[t,n,a,T,A,X,z,H]),w.useEffect(()=>{if(!a)return;const se=n.sessionGenerationRef.current;return $(a.sessionId,se),()=>{const V=n.eventsStreamStateRef.current;V?.sessionId===a.sessionId&&V.generation===se&&(n.reconnectAbortRef.current?.abort(),n.reconnectAbortRef.current=null,n.eventsStreamStateRef.current=null)}},[a,h,n,$]),{sendPrompt:O,handleStop:be,cancelDeferredTurn:fe,discardDeferredTurn:j,editDeferredTurn:G,steerDeferredTurn:W,openEventsStream:B}}function Nj(e){const{origin:t,refs:n,thread:a,setError:s}=e,{interview:o,setInterview:c}=a,[d,m]=w.useState(""),h=w.useCallback(async()=>{const x=n.sessionRef.current;if(!x)return;const y=window.prompt("Task ID(例如 2026-07-26-my-task)")?.trim();if(!y)return;const S=await fetch(`${t}/api/operator/v1/chat/sessions/${x.sessionId}/interviews`,{method:"POST",headers:{"Content-Type":"application/json","x-loop-console-confirmation":qn()},credentials:"include",body:JSON.stringify({taskId:y})}),T=await S.json();if(!S.ok){s(T.error?.message??`HTTP ${S.status}`);return}c({interviewSessionId:T.interview?.sessionId,taskId:y,state:T.interview?.state,question:T.question,draft:T.draft?.draft,draftSha256:T.draft?.draftSha256,assessment:T.assessment})},[t,n,c,s]),p=w.useCallback(async x=>{const y=n.sessionRef.current;if(!y||!o?.interviewSessionId||!o.question)return;const S=await fetch(`${t}/api/operator/v1/chat/sessions/${y.sessionId}/interviews/${o.interviewSessionId}/answers`,{method:"POST",headers:{"Content-Type":"application/json","x-loop-console-confirmation":qn()},credentials:"include",body:JSON.stringify({questionId:o.question.id,response:x,...x==="override"?{text:d}:{}})}),T=await S.json();if(!S.ok){s(T.error?.message??`HTTP ${S.status}`);return}c(A=>({...A??{},state:T.interview?.state,question:T.question,draft:T.draft?.draft,draftSha256:T.draft?.draftSha256,assessment:T.assessment,taskKindRecommendation:T.taskKindRecommendation??A?.taskKindRecommendation})),m("")},[t,n,o,d,c,s]),b=w.useCallback(async()=>{const x=n.sessionRef.current;if(!x||!o?.interviewSessionId||!o.taskKindRecommendation)return;const y=await fetch(`${t}/api/operator/v1/chat/sessions/${x.sessionId}/interviews/${o.interviewSessionId}/task-kind/confirm`,{method:"POST",headers:{"Content-Type":"application/json","x-loop-console-confirmation":qn()},credentials:"include",body:JSON.stringify({taskKind:o.taskKindRecommendation})}),S=await y.json();if(!y.ok){s(S.error?.message??`HTTP ${y.status}`);return}c(T=>({...T??{},confirmedTaskKind:T?.taskKindRecommendation,taskKindRecommendation:void 0,draft:S.draft?.draft,draftSha256:S.draft?.draftSha256,assessment:S.assessment}))},[t,n,o,c,s]);return{interviewAnswer:d,setInterviewAnswer:m,startInterview:h,answerInterview:p,confirmTaskKind:b}}function Aj(e){const{origin:t,refs:n,sessionId:a,workspaceId:s,blocked:o,setError:c}=e,[d,m]=w.useState({}),[h,p]=w.useState(new Set),[b,x]=w.useState(null),[y,S]=w.useState([]),[T,A]=w.useState(null),[C,M]=w.useState(!1),I=w.useRef(s??null);I.current=s??null;const P=w.useRef(new Set),U=w.useRef(new Set);U.current=h;const N=s?`&workspaceId=${encodeURIComponent(s)}`:"",z=w.useCallback(async(J="")=>{if(o)return;const H=s??null;try{x(null);const _=await fetch(`${t}/api/operator/v1/chat/repo/tree?path=${encodeURIComponent(J)}${N}`,{credentials:"include"}),Y=await _.json();if(I.current!==H)return;if(!_.ok)throw new Error(Y.error?.message??"无法读取仓库目录");m(re=>({...re,[J]:Y.data?.entries??[]}))}catch(_){if(I.current!==H)return;x(_ instanceof Error?_.message:String(_))}},[t,N,s,o]);w.useEffect(()=>{z()},[z]);const[X,B]=w.useState(0),$=w.useCallback(()=>{B(J=>J+1)},[]);w.useEffect(()=>{const J=["",...U.current];for(const H of J)z(H)},[z,X]),w.useEffect(()=>{const J=()=>{document.hidden||$()};return document.addEventListener("visibilitychange",J),()=>document.removeEventListener("visibilitychange",J)},[$]);const F=w.useCallback(async J=>{if(o)return;const H=s??null;M(!0);try{const _=await fetch(`${t}/api/operator/v1/chat/repo/file?path=${encodeURIComponent(J)}${N}`,{credentials:"include"}),Y=await _.json();if(I.current!==H)return;if(!_.ok||!Y.data)throw new Error(Y.error?.message??"无法预览文件");S(re=>{const fe=[...re.filter(G=>G.path!==Y.data.path),Y.data],j=n.sessionRef.current?.sessionId;return j&&window.localStorage.setItem(`${Qa}.previews.${j}`,JSON.stringify(fe.map(G=>G.path))),fe}),A(Y.data.path)}catch(_){if(I.current!==H)return;c(_ instanceof Error?_.message:String(_))}finally{I.current===H&&M(!1)}},[t,N,s,n,c,o]);w.useEffect(()=>{m({}),p(new Set),x(null),S([]),A(null),M(!1)},[s]),w.useEffect(()=>{if(o||T||y.length>0)return;const J=s??"__default__";if(P.current.has(J))return;const H=(d[""]??[]).filter(Y=>Y.kind==="file");if(H.length===0)return;const _=H.find(Y=>/^readme(?:\.[^.]+)?$/i.test(Y.name))??H[0];P.current.add(J),F(_.path)},[T,o,F,y.length,d,s]),w.useEffect(()=>{if(!a)return;let J=[];try{const H=JSON.parse(window.localStorage.getItem(`${Qa}.previews.${a}`)??"[]");Array.isArray(H)&&(J=H.filter(_=>typeof _=="string").slice(0,10))}catch{}J.length&&Promise.all(J.map(async H=>{const _=await fetch(`${t}/api/operator/v1/chat/repo/file?path=${encodeURIComponent(H)}${N}`,{credentials:"include"});if(_.ok)return(await _.json()).data})).then(H=>{if(n.sessionRef.current?.sessionId!==a)return;const _=H.filter(Y=>!!Y);S(_),A(_.at(-1)?.path??null)})},[t,N,a,n]);const K=w.useCallback(J=>{p(H=>{const _=new Set(H);return _.has(J)?_.delete(J):_.add(J),_}),d[J]||z(J)},[d,z]),oe=w.useCallback(J=>{S(H=>{const _=H.filter(Y=>Y.path!==J);return a&&window.localStorage.setItem(`${Qa}.previews.${a}`,JSON.stringify(_.map(Y=>Y.path))),_}),A(H=>H===J?y.find(_=>_.path!==J)?.path??null:H)},[y,a]);return{tree:d,expandedDirs:h,treeError:b,previews:y,activePreviewPath:T,setActivePreviewPath:A,previewLoading:C,setPreviews:S,loadTree:z,refreshTree:$,openPreview:F,closePreview:oe,toggleDir:K}}const Mh={status:"ok"};function Oh(e){return e.status!=="ok"}const Ij=["operator","web","extension","prompt","skill"];function _j(e){const t=[];for(const n of Ij){const a=[];for(let s=0;s<e.length;s+=1)e[s].source===n&&a.push({entry:e[s],globalIndex:s});a.length!==0&&t.push({source:n,label:lO[n],items:a})}return t}function Mj(e,t){return!Number.isFinite(t)||t<=0||!Number.isFinite(e)||e<0?0:e>=t?t-1:e}function Oj(e){return e==="comfortable"?3:e==="compact"?2:1}function O3(e,t,n,a){const s=t.findIndex(b=>b.items.some(x=>x.globalIndex===e));if(s<0)return e;const o=t[s],c=o.items.findIndex(b=>b.globalIndex===e);if(c<0)return e;const d=Math.floor(c/n),m=c%n;if(a==="left"||a==="right"){if(n<=1)return e;const x=c+(a==="left"?-1:1);return x<0||x>=o.items.length||Math.floor(x/n)!==d?e:o.items[x].globalIndex}const h=a==="up"?-1:1,p=c+h*n;if(p>=0&&p<o.items.length)return o.items[p].globalIndex;for(let b=s+h;b>=0&&b<t.length;b+=h){const x=t[b];if(x.items.length===0)continue;const y=Math.floor((x.items.length-1)/n)*n,S=a==="up"?y+m:m;return S>=x.items.length?e:x.items[S].globalIndex}return e}function Dj(e,t,n){const a=(e.left+e.right)/2;let s=null;for(const o of t){if(o.globalIndex===e.globalIndex)continue;const c=n==="up"?e.top-o.bottom:o.top-e.bottom;if(c<0)continue;const d=(o.left+o.right)/2,m=Math.abs(d-a);(s===null||c<s.gap||c===s.gap&&m<s.dist||c===s.gap&&m===s.dist&&o.globalIndex<s.index)&&(s={gap:c,dist:m,index:o.globalIndex})}return s?.index??null}function jj(){return{entries:[],index:-1,draft:""}}function Lj(e,t){return t.trim()?e.entries[e.entries.length-1]===t?e.index===-1?e:{...e,index:-1,draft:""}:{entries:[...e.entries,t].slice(-100),index:-1,draft:""}:e}function zj(e){return e.index===-1?e:{...e,index:-1}}function Bj(e,t,n){const{text:a,caretStart:s,caretEnd:o}=n;if(e.entries.length===0)return{handled:!1};if(t==="up"){if(a.slice(0,s).includes(`
|
|
405
|
-
`))return{handled:!1};if(e.index===-1){const m=e.entries.length-1;return{handled:!0,state:{...e,index:m,draft:a},text:e.entries[m]}}if(e.index===0)return{handled:!0,state:e,text:e.entries[0]};const d=e.index-1;return{handled:!0,state:{...e,index:d},text:e.entries[d]}}if(e.index===-1)return{handled:!1};if(a.slice(o).includes(`
|
|
406
|
-
`))return{handled:!1};if(e.index>=e.entries.length-1)return{handled:!0,state:{...e,index:-1},text:e.draft};const c=e.index+1;return{handled:!0,state:{...e,index:c},text:e.entries[c]}}function qj(e){const{origin:t,sessionId:n,refs:a,setError:s}=e,[o,c]=w.useState(""),[d,m]=w.useState([]),[h,p]=w.useState([]),[b,x]=w.useState(!1),y=w.useCallback(V=>{if(typeof V=="function"){c(Z=>{const ne=V(Z);return x(ne.startsWith("/")),ne});return}c(V),x(V.startsWith("/"))},[]),[S,T]=w.useState(0),[A,C]=w.useState([]),[M,I]=w.useState(!1),[P,U]=w.useState(null),[N,z]=w.useState(0),X=w.useRef(null),B=w.useRef(jj()),$=w.useRef(n),F=w.useRef(0),K=w.useCallback(V=>{y(V),x(V.startsWith("/")),T(0),B.current=zj(B.current)},[]),oe=w.useCallback(V=>{const Z=X.current,ne=Bj(B.current,V,{text:o,caretStart:Z?.selectionStart??o.length,caretEnd:Z?.selectionEnd??o.length});if(!ne.handled)return!1;B.current=ne.state,y(ne.text);const ue=ne.text.length;return queueMicrotask(()=>{const he=X.current;he&&he.value===ne.text&&he.setSelectionRange(ue,ue)}),!0},[o,y]),J=w.useCallback(V=>{B.current=Lj(B.current,V)},[]);w.useLayoutEffect(()=>{$.current=n,F.current+=1,C([]),U(null),I(!1)},[n]);const H=w.useCallback(async()=>{if(!n){C([]),U(null),I(!1);return}const V=n,Z=F.current;$.current=V,I(!0),U(null);const ne=()=>$.current===V&&F.current===Z;try{const ue=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(V)}/commands`,{credentials:"include"});if(!ne())return;if(!ue.ok){U("动态命令加载失败"),C([]);return}const he=await ue.json().catch(()=>null),Re=[];for(const Ye of he?.commands??[]){const ut=Ye.source;if(ut!=="extension"&&ut!=="prompt"&&ut!=="skill")continue;const pt=String(Ye.command??Ye.name??"").trim();pt&&Re.push({command:pt.startsWith("/")?pt:`/${pt}`,label:String(Ye.label??Ye.name??pt),description:String(Ye.description??""),source:ut})}if(!ne())return;C(Re);const Le=typeof he?.warning=="string"?he.warning.trim():"";U(Le?Le.slice(0,160):null)}catch{if(!ne())return;U("动态命令加载失败"),C([])}finally{ne()&&I(!1)}},[t,n]);w.useEffect(()=>{n&&(!b&&N===0||H())},[n,b,N,H]);const _=w.useCallback(()=>{z(V=>V+1),H()},[H]);w.useEffect(()=>{if(!n)return;const V=o.slice(0,X.current?.selectionStart??o.length).match(/(?:^|\s)@([^\s@]*)$/);if(!V){m([]);return}const Z=window.setTimeout(()=>{fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(n)}/files?q=${encodeURIComponent(V[1]??"")}`).then(ne=>ne.ok?ne.json():null).then(ne=>m((ne?.files??[]).map(ue=>ue.path)))},150);return()=>window.clearTimeout(Z)},[t,n,o]);const Y=w.useCallback(V=>{const Z=X.current?.selectionStart??o.length,ue=o.slice(0,Z).search(/@[^\s@]*$/);ue<0||(y(`${o.slice(0,ue)}@${V} ${o.slice(Z)}`),m([]))},[o]),re=w.useCallback(V=>{for(const Z of Array.from(V).slice(0,4)){if(!Z.type.startsWith("image/")||Z.size>5*1024*1024){s("图片仅支持 PNG/JPEG/GIF/WebP,单张不超过 5 MiB");continue}const ne=new FileReader;ne.onload=()=>{const ue=String(ne.result??""),he=ue.slice(ue.indexOf(",")+1);p(Re=>[...Re,{name:Z.name,type:"image",mimeType:Z.type,data:he}].slice(0,4))},ne.readAsDataURL(Z)}},[s]),fe=w.useCallback(V=>{p(Z=>Z.filter(ne=>ne!==V))},[]);w.useLayoutEffect(()=>{const V=X.current;V&&(V.style.height="auto",V.style.height=`${Math.min(V.scrollHeight,280)}px`)},[o]),w.useEffect(()=>{if(!n)return;const V=window.setTimeout(()=>{fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(n)}/draft`,{method:"PUT",credentials:"include",headers:{"content-type":"application/json","x-loop-console-confirmation":qn()},body:JSON.stringify({text:o})})},400);return()=>window.clearTimeout(V)},[t,n,o]);const j=w.useMemo(()=>sO(A),[A]),G=w.useMemo(()=>o.startsWith("/")?oO(j,o):[],[o,j]);w.useEffect(()=>{T(V=>Mj(V,G.length))},[G.length]);const W=w.useCallback(()=>{a.isComposingRef.current=!0},[a]),O=w.useCallback(()=>{a.isComposingRef.current=!1,a.compositionEndedAtRef.current=Date.now()},[a]),be=w.useCallback(()=>a.isComposingRef.current,[a]),se=w.useCallback(()=>Date.now()-a.compositionEndedAtRef.current<100,[a]);return w.useEffect(()=>{Ek({origin:t,sessionId:n,refs:a})},[t,n,a]),{input:o,setInput:y,handleInputChange:K,navigateHistory:oe,recordHistory:J,fileOptions:d,pendingImages:h,setPendingImages:p,addImagesFromFiles:re,removeImage:fe,shortcutOpen:b,setShortcutOpen:x,shortcutIndex:S,setShortcutIndex:T,filteredShortcuts:G,dynamicCommandsLoading:M,dynamicCommandsError:P,retryDynamicCommands:_,insertFileReference:Y,textareaRef:X,onCompositionStart:W,onCompositionEnd:O,isComposingNow:be,recentlyComposedNow:se}}const Hj=[{toolId:"read",kind:"explore",description:"Pi 内置读取文件。"},{toolId:"write",kind:"explore",description:"Pi 内置写入文件(软约束:大改优先走 DAG)。"},{toolId:"edit",kind:"explore",description:"Pi 内置编辑文件(软约束:大改优先走 DAG)。"},{toolId:"bash",kind:"explore",description:"Pi 内置 shell 执行(软约束:优先受治路径)。"},{toolId:"grep",kind:"explore",description:"Pi 内置内容搜索。"},{toolId:"find",kind:"explore",description:"按名称查找文件路径。"},{toolId:"ls",kind:"explore",description:"列出目录内容。"},{toolId:"safe-read",kind:"explore",description:"安全读取仓库相对路径文件;拒绝敏感文件并自动脱敏 secret。"},{toolId:"safe-grep",kind:"explore",description:"安全搜索仓库内容;跳过敏感文件并自动脱敏搜索结果。"},{toolId:"git-status",kind:"explore",description:"固定参数执行 git status --porcelain(无 shell)。"},{toolId:"git-diff",kind:"explore",description:"固定参数查看 git diff;敏感路径不可查看且结果自动脱敏。"}];function Uj(e){if(!e)return null;const t=(e.tools??[]).map(a=>({toolId:a.toolId,action:a.action,description:a.description,kind:a.kind??"read",cli:a.cli})),n=[...Hj];return{explore:n,operator:t,total:n.length+t.length}}let Fj=0;function $j(e){const{origin:t,session:n,setSession:a,refs:s,setError:o}=e,[c,d]=w.useState(null),[m,h]=w.useState([]),[p,b]=w.useState("idle"),[x,y]=w.useState(null),[S,T]=w.useState([]),[A,C]=w.useState(null),[M,I]=w.useState(null),[P,U]=w.useState(!1),[N,z]=w.useState(!1),[X,B]=w.useState(!1),$=w.useRef(null),F=w.useRef(null),K=w.useRef(0);w.useEffect(()=>{K.current=-1,U(!1)},[n?.sessionId,U]);const J=Wl().snapshot,H=w.useCallback(async()=>{try{const V=await fetch(`${t}/api/operator/v1/chat/capabilities`);if(!V.ok)return;const Z=await V.json();d(Z)}catch{}},[t]);w.useEffect(()=>{H()},[H]);const _=w.useCallback(async()=>{if(!n){h([]),b("idle");return}const V=n.sessionId;b("loading"),y(null);try{const Z=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(V)}/models`,{credentials:"include"}),ne=await Z.json().catch(()=>null);if(s.sessionRef.current?.sessionId!==V)return;if(!Z.ok||!ne){b("error"),y(ne?.error?.message??`模型列表读取失败(HTTP ${Z.status})`);return}h(ne.models??[]),T(ne.thinkingLevels??[]),b("ready")}catch(Z){if(s.sessionRef.current?.sessionId!==V)return;b("error"),y(Z instanceof Error?Z.message:String(Z))}},[t,n,s]);w.useEffect(()=>{_()},[_]),w.useEffect(()=>{if(!n){C(null),I(null);return}const V=n.sessionId,Z=`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(V)}`;I(null),fetch(`${Z}/runtime-context`,{credentials:"include"}).then(async ne=>{const ue=await ne.json().catch(()=>null);if(!ue?.context||s.sessionRef.current?.sessionId!==V)return;const he=ue.context,Re=Rk().snapshot;C(Le=>xk(Le,he,Re,V))}).catch(()=>{s.sessionRef.current?.sessionId===V&&I("注入上下文读取失败,请重试")})},[t,n?.sessionId,s]),w.useEffect(()=>{if(!J||!n||J.sessionId!==n.sessionId)return;const V=f5(J);a(Z=>{if(!Z||Z.sessionId!==J.sessionId||oD(Z,V))return Z;const ne=J7(Z,V);return s.sessionRef.current=ne,ne}),C(Z=>{if(!Z)return Z;const ne={...Z,...V.model?{model:V.model}:{},...V.thinkingLevel?{thinkingLevel:V.thinkingLevel}:{}};return ne.model?.provider===Z.model?.provider&&ne.model?.modelId===Z.model?.modelId&&ne.thinkingLevel===Z.thinkingLevel?Z:ne})},[J,n?.sessionId,s,a,C]);const Y=w.useCallback(async V=>{if(!n)return!1;const Z=n.sessionId,ne=++Fj;K.current=ne,p5({type:"mutation-start",token:ne}),U(!0);try{const ue=await fetch(`${t}/api/operator/v1/chat/sessions/${encodeURIComponent(n.sessionId)}/model`,{method:"POST",credentials:"include",headers:{"content-type":"application/json","x-loop-console-confirmation":qn()},body:JSON.stringify(V)}),he=await ue.json().catch(()=>({}));return K.current!==ne?!1:ue.ok?!he.session||s.sessionRef.current?.sessionId!==Z?!1:Tk(ne,Z,he.snapshot):(s.sessionRef.current?.sessionId===Z&&(o(he.error?.message??`模型或思考等级切换失败(HTTP ${ue.status})`),Gh()),!1)}catch(ue){return K.current!==ne||s.sessionRef.current?.sessionId===Z&&o(ue instanceof Error?ue.message:String(ue)),!1}finally{Ck(ne,Z,s)&&K.current===ne&&U(!1)}},[t,n,s,a,o]);w.useEffect(()=>{if(!N)return;const V=ne=>{const ue=$.current;ue&&ne.target instanceof Node&&!ue.contains(ne.target)&&z(!1)},Z=ne=>{ne.key==="Escape"&&z(!1)};return document.addEventListener("mousedown",V),document.addEventListener("keydown",Z),()=>{document.removeEventListener("mousedown",V),document.removeEventListener("keydown",Z)}},[N]),w.useEffect(()=>{if(!X)return;const V=ne=>{const ue=F.current;ue&&ne.target instanceof Node&&!ue.contains(ne.target)&&B(!1)},Z=ne=>{ne.key==="Escape"&&B(!1)};return document.addEventListener("mousedown",V),document.addEventListener("keydown",Z),()=>{document.removeEventListener("mousedown",V),document.removeEventListener("keydown",Z)}},[X]);const re=w.useMemo(()=>Uj(c),[c]),fe=J?(J.models??[]).map(V=>({provider:V.provider,id:V.id,...V.name?{name:V.name}:{},...V.hasCredentials!==void 0?{hasCredentials:V.hasCredentials}:{}})):m,j=J?.thinkingLevels?.length?J.thinkingLevels.map(V=>V.value):S,G=n?.model??A?.model,W=G?Ts(G.provider,G.modelId):"",O=J?.selection?.thinkingSelection??n?.thinkingLevel??"",be=J?.selection?.effectiveThinkingLevel??n?.thinkingLevel??void 0,se=!W||fe.some(V=>Ts(V.provider,V.id)===W);return{capabilities:c,models:fe,modelsStatus:p,modelsError:x,onRetryModels:()=>{_()},thinkingLevels:j,runtimeContext:A,runtimeContextError:M,onRetryRuntimeContext:()=>{I(null),Gh()},toolsOpen:N,setToolsOpen:z,runtimeContextOpen:X,setRuntimeContextOpen:B,toolsMenuRef:$,runtimeContextMenuRef:F,switchRuntime:Y,switching:P,toolCatalog:re,activeModel:G,activeModelRef:W,activeThinkingLevel:O,effectiveThinkingLevel:be,activeModelListed:se}}const D3={comfortableMin:1200,compactMin:720};function Pj(e){return!Number.isFinite(e)||e<0?"narrow":e>=D3.comfortableMin?"comfortable":e>=D3.compactMin?"compact":"narrow"}const Gj={mode:"comfortable",width:1600,landingDensity:"comfortable",emptyHeight:720};function Vj(e,t){const[n,a]=w.useState(Gj);return w.useEffect(()=>{const s=e.current;if(!s||typeof ResizeObserver>"u")return;const o=()=>{const p=s.getBoundingClientRect().width,b=t?.current??null,x=b?b.getBoundingClientRect().height:720;a({mode:Pj(p),width:p,landingDensity:LO(x),emptyHeight:x})};o();const c=new ResizeObserver(()=>o());c.observe(s);let d=null;const m=()=>{const p=t?.current??null;p&&p!==d&&(d&&c.unobserve(d),c.observe(p),d=p,o())};m();const h=window.setInterval(m,250);return()=>{window.clearInterval(h),c.disconnect()}},[e,t]),n}const _1="loop-console.operator-shell.active-workspace.v1";function Kj(e){try{return e?.getItem(_1)?.trim()||null}catch{return null}}function Ou(e,t){try{e?t?.setItem(_1,e):t?.removeItem(_1)}catch{}}function Yj(e,t){return t?e.some(n=>n.workspaceId===t)?{status:"ok",workspaceId:t}:{status:"ok",workspaceId:e[0]?.workspaceId??null}:{status:"ok",workspaceId:e[0]?.workspaceId??null}}function Wj(e,t,n){return e===409||t==="DUPLICATE"?n||"该目录(或等价路径)已存在为 Workspace:请直接选择既有条目,或更换其他真实目录。":e===400||t==="INVALID_PATH"?n||"目录不可用:请确认输入的是存在的真实目录绝对路径。":Vl(t)?Kl(t):n||`添加 Workspace 失败(HTTP ${e})`}function Zj(e={}){const t=e.origin??"",n=e.fetchFn??fetch,a=e.storage,s=e.confirmationTokenFn??qn,o=new Set;let c={workspaces:[],loading:!0,error:null,workspaceId:Kj(a),unknownWorkspaceId:null};const d=()=>{for(const S of o)S()},m=S=>{c={...c,...S},d()},h=async()=>{try{const S=await n(`${t}/api/operator/v1/workspaces`,{credentials:"include"});if(!S.ok)return;const A=(await S.json()).workspaces??[],C=Yj(A,c.workspaceId);if(C.status==="unknown-workspace"){m({workspaces:A,unknownWorkspaceId:C.workspaceId});return}const M=C.workspaceId,I=c.workspaceId;m({workspaces:A,unknownWorkspaceId:null,...M!==I?{workspaceId:M}:{}}),M!==I&&Ou(M,a)}catch{}finally{c.loading&&m({loading:!1})}},p=async(S,T)=>{m({error:null});try{const A=await n(`${t}/api/operator/v1/workspaces`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json","x-loop-console-confirmation":s()},body:JSON.stringify({directoryPath:S,...T?{name:T}:{}})}),C=await A.json().catch(()=>({}));if(!A.ok||!C.workspace){const M=Wj(A.status,C.error?.code,C.error?.message);return m({error:M}),{ok:!1,error:M}}return await h(),m({workspaceId:C.workspace.workspaceId}),Ou(C.workspace.workspaceId,a),{ok:!0,workspaceId:C.workspace.workspaceId}}catch(A){const M=`添加 Workspace 失败:${A instanceof Error?A.message:String(A)}`;return m({error:M}),{ok:!1,error:M}}},b=async()=>{m({error:null});try{const S=await n(`${t}/api/operator/v1/workspaces/pick`,{method:"POST",credentials:"include",headers:{"x-loop-console-confirmation":s()}}),T=await S.json().catch(()=>({}));if(!S.ok){const A=Vl(T.error?.code)?Kl(T.error?.code??""):T.error?.message??`打开目录选择窗口失败(HTTP ${S.status})`;return m({error:A}),null}return typeof T.directoryPath=="string"&&T.directoryPath.trim()?T.directoryPath:null}catch(S){const T=S instanceof Error?S.message:String(S);return m({error:`打开目录选择窗口失败:${T}`}),null}},x=async S=>{m({error:null});try{const T=await n(`${t}/api/operator/v1/workspaces/${encodeURIComponent(S)}`,{method:"DELETE",credentials:"include",headers:{"x-loop-console-confirmation":s()}}),A=await T.json().catch(()=>({}));if(!T.ok){const C=T.status===404?"Workspace 已不存在(可能已被移除),列表将刷新。":Vl(A.error?.code)?Kl(A.error?.code??""):A.error?.message??`移除 Workspace 失败(HTTP ${T.status})`;return m({error:C}),await h(),{ok:!1,error:C}}if(await h(),c.workspaceId===S){const C=c.workspaces[0]?.workspaceId??null;m({workspaceId:C}),Ou(C,a)}return{ok:!0}}catch(T){const C=`移除 Workspace 失败:${T instanceof Error?T.message:String(T)}`;return m({error:C}),{ok:!1,error:C}}},y=S=>{S===c.workspaceId&&!c.unknownWorkspaceId||(m({workspaceId:S,unknownWorkspaceId:null}),Ou(S,a))};return h(),{get workspaces(){return c.workspaces},get loading(){return c.loading},get error(){return c.error},get workspaceId(){return c.workspaceId},get unknownWorkspaceId(){return c.unknownWorkspaceId},refresh:h,pickWorkspaceDirectory:b,addWorkspace:p,removeWorkspace:x,selectWorkspace:y,subscribe(S){return o.add(S),()=>o.delete(S)}}}function Xj(e){const t=w.useRef(null);t.current||(t.current=Zj(e));const n=t.current,[a,s]=w.useState(()=>({workspaces:n.workspaces,loading:n.loading,error:n.error,workspaceId:n.workspaceId,unknownWorkspaceId:n.unknownWorkspaceId}));return w.useEffect(()=>n.subscribe(()=>{s({workspaces:n.workspaces,loading:n.loading,error:n.error,workspaceId:n.workspaceId,unknownWorkspaceId:n.unknownWorkspaceId})}),[n]),w.useMemo(()=>({get workspaces(){return a.workspaces},get loading(){return a.loading},get error(){return a.error},get workspaceId(){return a.workspaceId},get unknownWorkspaceId(){return a.unknownWorkspaceId},refresh:n.refresh,pickWorkspaceDirectory:n.pickWorkspaceDirectory,addWorkspace:n.addWorkspace,removeWorkspace:n.removeWorkspace,selectWorkspace:n.selectWorkspace}),[a,n])}function Qj(e="none"){return{active:e}}function kl(e,t){return{active:t}}function Qr(e={active:"none"}){return{active:"none"}}function Jj(e){return{sidebarDrawerOpen:e.active==="sidebar-drawer",processOpen:e.active==="process",runtimeContextOpen:e.active==="runtime-context",toolsOpen:e.active==="tools"}}const eL=264,tL=420,Nl=280,rx=360,bs=160,ax=480,nL=240,rL=120,j3="loop-agent:operator-chat:details-width:v1",Dh="loop-agent:operator-chat:details-tree-width:v1";function xa(e,t,n){return Math.min(n,Math.max(t,Math.round(e)))}function Du(){return typeof window>"u"?rx:Math.max(Nl,window.innerWidth)}function Sl(e){return Math.min(ax,Math.max(bs,Math.round(e-rL)))}function L3(e,t,n,a){if(typeof window>"u")return t;try{const s=Number(window.localStorage.getItem(e));return Number.isFinite(s)&&s>0?xa(s,n,a):t}catch{return t}}function jh(e,t){try{window.localStorage.setItem(e,String(Math.round(t)))}catch{}}function ju(e){const t=w.useRef(0),n=w.useRef(0),a=w.useRef(0),s=w.useRef(null),o=w.useRef(!1),c=w.useRef(null),d=w.useRef(e);d.current=e;const m=w.useCallback(()=>{s.current=null;const p=d.current,b=a.current-t.current,x=n.current+(p.side==="sidebar"?b:-b);return p.onResize(x),x},[]),h=w.useCallback((p,b,x)=>{if(!o.current)return;typeof x=="number"&&(a.current=x),o.current=!1,p&&b!==void 0&&p.hasPointerCapture(b)&&p.releasePointerCapture(b),s.current!==null&&(cancelAnimationFrame(s.current),s.current=null);const y=m(),S=p??c.current;S&&delete S.dataset.dragging,d.current.onResizeEnd?.(y),d.current.onDragChange(!1)},[m]);return w.useEffect(()=>{const p=y=>{o.current&&(a.current=y.clientX,s.current??=requestAnimationFrame(m))},b=y=>h(void 0,void 0,y.clientX),x=()=>h();return window.addEventListener("pointermove",p),window.addEventListener("pointerup",b),window.addEventListener("pointercancel",x),()=>{if(window.removeEventListener("pointermove",p),window.removeEventListener("pointerup",b),window.removeEventListener("pointercancel",x),s.current!==null&&(cancelAnimationFrame(s.current),s.current=null),o.current){o.current=!1;const y=c.current;y&&delete y.dataset.dragging,d.current.onDragChange(!1)}}},[h,m]),u.jsx("div",{ref:c,className:"oc-column-resize-handle","data-side":e.side,role:"separator","aria-orientation":"vertical","aria-label":e.side==="sidebar"?"调整左侧栏宽度":e.side==="details-tree"?"调整文件树宽度":"调整右侧栏宽度",onPointerDown:p=>{p.preventDefault(),p.currentTarget.setPointerCapture(p.pointerId),p.currentTarget.dataset.dragging="true",o.current=!0,t.current=p.clientX,a.current=p.clientX,n.current=d.current.value,d.current.onDragChange(!0)},onPointerMove:p=>{p.currentTarget.hasPointerCapture(p.pointerId)&&(a.current=p.clientX,s.current??=requestAnimationFrame(m))},onPointerUp:p=>h(p.currentTarget,p.pointerId,p.clientX),onPointerCancel:p=>h(p.currentTarget,p.pointerId),onLostPointerCapture:p=>h(p.currentTarget)})}function aL(e){const{origin:t,surface:n="standalone"}=e,a=n==="workspace",s=ID(),[o,c]=w.useState(null),[d,m]=w.useState(!1),[h,p]=w.useState(null),[b,x]=w.useState(!0),[y,S]=w.useState(!1),[T,A]=w.useState("files"),[C,M]=w.useState(!1),[I,P]=w.useState(!1),[U,N]=w.useState(!1),[z,X]=w.useState(280),[B,$]=w.useState(()=>L3(j3,rx,Nl,Du())),[F,K]=w.useState(()=>L3(Dh,nL,bs,ax)),[oe,J]=w.useState(!1);w.useEffect(()=>{let ee=null;const Ee=()=>{ee=null,$(Lt=>xa(Lt,Nl,Du()))},vt=()=>{ee??=window.requestAnimationFrame(Ee)};return window.addEventListener("resize",vt),()=>{window.removeEventListener("resize",vt),ee!==null&&window.cancelAnimationFrame(ee)}},[]);const H=w.useRef(!0),[_,Y]=w.useState(!0),re=w.useCallback(ee=>{const Ee=typeof ee=="function"?ee(H.current):ee;H.current=Ee,Y(Ee)},[]),[fe,j]=w.useState(()=>Qj()),[G,W]=w.useState(null),[O,be]=w.useState(null),[se,V]=w.useState(0),Z=w.useRef(null),ne=w.useRef(null),ue=w.useRef(null),he=w.useRef(null),Re=w.useRef(null),Le=w.useRef(null),Ye=w.useRef(null),ut=w.useRef(()=>{}),pt=w.useRef(null),Rt=w.useRef(!1),Ht=Vj(ue,he),at=Ht.mode,Mt=e.workspaceRegistry,[ft,Ut]=w.useState(null),ze=Jj(fe),Qe=ze.processOpen,Ue=ze.runtimeContextOpen,mt=y&&T==="activity";w.useEffect(()=>{S(!1),A("files"),M(!1),P(!1),N(!1),j(ee=>ee.active==="process"||ee.active==="runtime-context"?Qr(ee):ee)},[h?.sessionId,e.workspaceId]);const pe=w.useCallback(ee=>{j(Ee=>{const vt=Ee.active==="process";return(typeof ee=="function"?ee(vt):ee)?(A("calls"),P(!0),S(!0),kl(Ee,"process")):(vt&&(P(!1),A("files"),S(!1)),Ee.active==="process"?Qr(Ee):Ee)})},[]),me=qj({origin:t,sessionId:h?.sessionId,refs:s,setError:c}),He=w.useMemo(()=>_j(me.filteredShortcuts),[me.filteredShortcuts]),we=Aj({origin:t,refs:s,sessionId:h?.sessionId,workspaceId:h?.workspaceId??e.workspaceId,blocked:Oh(e.workspaceGate??Mh),setError:c}),Fe=w.useRef(()=>{}),lt=w.useCallback(ee=>{Fe.current(ee)},[]),Ae=JD({origin:t,refs:s,sessionId:h?.sessionId,workspaceId:e.workspaceId??null,setError:c,onReconcile:lt});Fe.current=ee=>{const Ee=s.sessionRef.current?.sessionId;Ee&&(async()=>await Ae.recoverSession(Ee)?(be({id:Date.now(),message:"已自动恢复:会话事件已重新同步,可继续对话。"}),V(Lt=>Lt+1)):be({id:Date.now(),message:"自动恢复未完成,将在重连时重试。"}))()};const Kt=Ae.operationCards.length+Ae.humanGateCards.length+Ae.artifactCards.length,gt=w.useMemo(()=>{for(const ee of Ae.operationCards)if(ee.dagRunId)return ee.dagRunId;return null},[Ae.operationCards]),_t=w.useMemo(()=>{if(!gt)return null;for(const ee of Ae.operationCards){if(ee.dagRunId!==gt||!ee.runSummary)continue;const Ee=ee.runSummary,vt=Ee.next&&Ee.nodes.every(Lt=>Lt.id!==Ee.next?.kind)?Ee.nodes.find(Lt=>!["succeeded","completed","passed"].includes(Lt.status))?.id:void 0;return{dagRunId:gt,currentNodeId:vt,nodes:Ee.nodes,status:Ee.status}}return{dagRunId:gt,nodes:[]}},[gt,Ae.operationCards]),Tt=w.useMemo(()=>Y7(Ae.operationCards).length+Ae.humanGateCards.length+Ae.artifactCards.length,[Ae.operationCards,Ae.humanGateCards.length,Ae.artifactCards.length]),Mn=w.useMemo(()=>wO({operations:Ae.operationCards,gates:Ae.humanGateCards,artifacts:Ae.artifactCards}),[Ae.operationCards,Ae.humanGateCards,Ae.artifactCards]),pn=w.useCallback(ee=>Mn.has(ee),[Mn]);w.useEffect(()=>{at==="comfortable"&&fe.active==="sidebar-drawer"&&j(Ee=>Ee.active===fe.active?Qr(Ee):Ee)},[at,fe.active]),w.useEffect(()=>{W(null)},[h?.sessionId]),w.useEffect(()=>{Kt>0||!U||(N(!1),W(null),A(ee=>ee==="activity"?"files":ee))},[Kt,U]);const st=w.useCallback(ee=>{const Ee=ne.current;if(!Ee)return;const Lt=Array.from(Ee.querySelectorAll("[data-activity-ref]")).find(gn=>ee.includes(gn.dataset.activityRef??""));if(!Lt){be({id:Date.now(),message:"详细运行记录暂时没有对应的对话位置。"});return}Lt.scrollIntoView({block:"center",behavior:"smooth"}),Lt.classList.add("is-located"),window.setTimeout(()=>Lt.classList.remove("is-located"),1400)},[]),je=ij({origin:t,refs:s,setSession:p,thread:Ae,composer:{setInput:me.setInput,setPendingImages:me.setPendingImages},browser:{setPreviews:we.setPreviews,setActivePreviewPath:we.setActivePreviewPath},setError:c,setNotice:be,onCompactionChange:m,setProcessOpen:pe,setAutoScroll:re,workspaceId:e.workspaceId??void 0,blocked:Oh(e.workspaceGate??Mh)}),wt=w.useRef(null);w.useEffect(()=>{const ee=e.requestedSessionId?.trim();if(!ee||Oh(e.workspaceGate??Mh)||h?.sessionId===ee)return;const Ee=`${e.workspaceId??""}:${ee}`;if(wt.current===Ee)return;wt.current=Ee;const vt=je.sessionList.find(Lt=>Lt.sessionId===ee)?.workspaceId;je.activateSession(ee,vt)},[e.requestedSessionId,e.workspaceGate,e.workspaceId,h?.sessionId,je.activateSession]);const bt=Rj({origin:t,refs:s,session:h,thread:Ae,composer:{setInput:me.setInput,setPendingImages:me.setPendingImages,recordHistory:me.recordHistory},setError:c,setNotice:be,setAutoScroll:re,recoveryVersion:se,watchSessionTitle:je.watchSessionTitle}),Gt=Nj({origin:t,refs:s,thread:Ae,setError:c}),Q=$j({origin:t,session:h,setSession:p,refs:s,setError:c});w.useEffect(()=>{if(Ae.streaming){je.refreshSessionList();return}we.refreshTree();const ee=window.setTimeout(()=>{je.refreshSessionList()},1200);return()=>window.clearTimeout(ee)},[Ae.streaming,Ae.turnPhase,Ae.deferredTurn?.revision,Ae.deferredTurn?.state,je.refreshSessionList,we.refreshTree]),w.useEffect(()=>{Q.runtimeContextOpen&&fe.active!=="runtime-context"?j(ee=>kl(ee,"runtime-context")):!Q.runtimeContextOpen&&fe.active==="runtime-context"&&j(ee=>Qr(ee))},[Q.runtimeContextOpen,fe.active]),w.useEffect(()=>{fe.active!=="runtime-context"&&Q.runtimeContextOpen&&Q.setRuntimeContextOpen(!1)},[fe.active]),w.useEffect(()=>{Ae.streaming&&fe.active==="process"&&j(Qr)},[Ae.streaming,fe.active]);const{sendPrompt:ke,handleStop:qe,discardDeferredTurn:et,editDeferredTurn:St,steerDeferredTurn:jt}=bt,Ke=w.useRef(()=>{}),Pe=w.useCallback(async ee=>{const Ee=s3(ee);if(Ee&&Ee.action!=="unknown"&&Ee.action!=="pi-prompt"){if(s.streamingRef.current){be({id:Date.now(),message:"当前回合进行中,命令请在回合结束后执行"});return}Ke.current(ee);return}await ke(ee,me.pendingImages)},[ke,me.pendingImages,s]);ut.current=ee=>{Pe(ee)};const it=w.useCallback(()=>{me.textareaRef.current?.focus()},[me.textareaRef]),Xt=w.useCallback(()=>{j(ee=>ee.active==="sidebar-drawer"?Qr(ee):ee)},[]),Yt=w.useCallback(ee=>{if(A(ee),S(!0),ee==="context"){M(!0),Q.setRuntimeContextOpen(!0),j(Ee=>kl(Ee,"runtime-context"));return}if(ee==="calls"){P(!0),Q.setRuntimeContextOpen(!1),j(Ee=>kl(Ee,"process"));return}Q.setRuntimeContextOpen(!1),j(Ee=>Ee.active==="process"||Ee.active==="runtime-context"?Qr(Ee):Ee)},[Q.setRuntimeContextOpen]),Nr=w.useCallback(ee=>{ee==="context"?(M(!1),Q.setRuntimeContextOpen(!1),j(Ee=>Ee.active==="runtime-context"?Qr(Ee):Ee)):ee==="calls"?(P(!1),j(Ee=>Ee.active==="process"?Qr(Ee):Ee)):(N(!1),W(null)),T===ee&&A("files")},[T,Q.setRuntimeContextOpen]),na=w.useCallback(ee=>{if(y&&T===ee){S(!1),ee==="context"&&Q.setRuntimeContextOpen(!1),ee==="calls"&&j(Ee=>Ee.active==="process"?Qr(Ee):Ee);return}Yt(ee)},[Nr,y,T,Yt]),Na=w.useCallback(ee=>{if(y&&T==="activity"&&(!ee||ee===G)){S(!1);return}W(ee??null),N(!0),Yt("activity")},[G,y,T,Yt]),mr=w.useCallback(()=>{Q.setRuntimeContextOpen(!1),j(ee=>kl(ee,"sidebar-drawer"))},[Q.setRuntimeContextOpen]),xn=w.useCallback((ee,Ee)=>{je.activateSession(ee,Ee),e.onNavigateWorkspace?.("chat",{...e.workspaceId?{workspaceId:e.workspaceId}:{},sessionId:ee}),Xt(),queueMicrotask(()=>{ne.current?.focus?.(),it()})},[je,Xt,it,e.onNavigateWorkspace,e.workspaceId]),Kn=w.useCallback(ee=>{me.setInput(Ee=>`${Ee}${Ee&&!Ee.endsWith(" ")?" ":""}@${ee} `),Xt(),queueMicrotask(()=>it())},[me,Xt,it]),da=w.useCallback(ee=>{A("files"),S(!0),we.openPreview(ee),Xt()},[we,Xt]),Aa=w.useCallback(ee=>{A("files"),S(!0),we.openPreview(ee)},[we]),As=w.useCallback(()=>{const ee=ne.current;ee&&(re(!0),ee.scrollTop=ee.scrollHeight)},[re]),ii=w.useCallback(()=>{const ee=ne.current;if(!ee)return;const Ee=ee.scrollHeight-ee.scrollTop-ee.clientHeight<=25;re(Ee)},[re]);w.useLayoutEffect(()=>{if(!H.current)return;const ee=ne.current;ee&&(ee.scrollTop=ee.scrollHeight)},[Ae.messages,Ae.streaming]),w.useEffect(()=>{const ee=Z.current?.parentElement;if(!ee||typeof ResizeObserver>"u")return;const Ee=new ResizeObserver(()=>{if(!H.current)return;const vt=ne.current;vt&&(vt.scrollTop=vt.scrollHeight)});return Ee.observe(ee),()=>Ee.disconnect()},[h?.sessionId]),w.useEffect(()=>{if(!O)return;const ee=window.setTimeout(()=>be(null),6500);return()=>window.clearTimeout(ee)},[O]);const Is=o?{id:O?.id??1,kind:"error",message:o}:O?{id:O.id,kind:"info",message:O.message}:null,fa=w.useCallback(ee=>{if(ee.action==="pi-prompt"||ee.command==="/name"||ee.command==="/compact"){me.setInput(`${ee.command} `),me.setShortcutOpen(!1),me.textareaRef.current?.focus();return}Ke.current(ee.command)},[me]),si=w.useCallback(ee=>{const Ee=s3(ee),vt=ee.trim(),Lt=vt.split(/\s+/,1)[0]?.toLowerCase()??"";if(me.setInput(""),me.setShortcutOpen(!1),!Ee)return;if(Ee.action==="focus:interview"){if(!h){be({id:Date.now(),message:"请先创建或打开一个会话,再开始 Interview"});return}Gt.startInterview();return}const gn=iO(Ee.action);if(gn){e.onNavigateWorkspace?.(gn,{});return}if(Ee.action==="compact"){const Ot=vt.slice(Lt.length).trim();je.compactSession(Ot||void 0);return}if(Ee.action==="name"){const Ot=vt.slice(Lt.length).trim(),fn=h?.sessionId;if(!fn){c("当前没有可重命名的会话");return}const hr=je.sessionList.find(sr=>sr.sessionId===fn),pr=Ot||window.prompt("会话名称",hr?.title??hr?.displayTitle??"")||"";pr.trim()&&je.updateSession(fn,{title:pr.trim()});return}if(Ee.action==="session"){const Ot=h?.sessionId??"(none)",fn=je.sessionList.find(pr=>pr.sessionId===Ot),hr=fn?.title||fn?.displayTitle||"未命名对话";be({id:Date.now(),message:`当前会话:${hr}(${Ot})`});return}if(Ee.action==="copy"){const fn=[...Ae.visibleMessages??[]].reverse().find(hr=>hr.role==="assistant");if(!fn?.text){c("没有可复制的助手消息");return}navigator.clipboard?.writeText(fn.text).then(()=>be({id:Date.now(),message:"已复制最后一条助手消息"}),()=>c("复制失败"));return}if(Ee.action==="unknown"){ke(vt,me.pendingImages);return}c(`未知 shortcut:${Ee.command}`)},[me.setInput,me.setShortcutOpen,me.pendingImages,Gt.startInterview,e.onNavigateWorkspace,je,h,Ae.visibleMessages,ke]);Ke.current=si;const Wn=w.useCallback(ee=>{const Ee=s.isComposingRef.current||ee.nativeEvent.isComposing,vt=Date.now()-s.compositionEndedAtRef.current<100;if(me.shortcutOpen&&me.filteredShortcuts.length>0&&!Ee&&!vt){if(ee.key==="ArrowLeft"||ee.key==="ArrowRight"||ee.key==="ArrowUp"||ee.key==="ArrowDown"){ee.preventDefault();const Lt=Oj(at);let gn=me.shortcutIndex;if(ee.key==="ArrowLeft"||ee.key==="ArrowRight")gn=O3(me.shortcutIndex,He,Lt,ee.key==="ArrowLeft"?"left":"right");else{const Ot=pt.current;let fn=null;if(Ot){const hr=Array.from(Ot.querySelectorAll("[data-shortcut-index]")).map(sr=>{const ia=sr.getBoundingClientRect();return{globalIndex:Number(sr.dataset.shortcutIndex??-1),top:ia.top,bottom:ia.bottom,left:ia.left,right:ia.right}}).filter(sr=>Number.isFinite(sr.globalIndex)&&sr.globalIndex>=0),pr=hr.find(sr=>sr.globalIndex===me.shortcutIndex)??null;pr&&(fn=Dj(pr,hr,ee.key==="ArrowUp"?"up":"down"))}gn=fn??O3(me.shortcutIndex,He,Lt,ee.key==="ArrowUp"?"up":"down")}gn!==me.shortcutIndex&&(Rt.current=!0,me.setShortcutIndex(gn));return}if(ee.key==="Escape"){ee.preventDefault(),me.setShortcutOpen(!1);return}if(ee.key==="Enter"||ee.key==="Tab"){ee.preventDefault();const Lt=me.filteredShortcuts[me.shortcutIndex]??me.filteredShortcuts[0];fa(Lt);return}}if(ee.key==="Enter"&&!ee.shiftKey&&(Ee||vt)){vt&&ee.preventDefault();return}if((ee.key==="ArrowUp"||ee.key==="ArrowDown")&&!Ee&&!vt&&me.fileOptions.length===0&&me.navigateHistory(ee.key==="ArrowUp"?"up":"down")){ee.preventDefault();return}if(ee.key==="Enter"&&!ee.shiftKey){ee.preventDefault(),Pe(me.input);return}},[me.input,me.shortcutOpen,me.filteredShortcuts,me.shortcutIndex,me.setShortcutIndex,me.setShortcutOpen,me.fileOptions,me.navigateHistory,s,Pe,fa,at,He,pt,Rt]),ir=Ae.visibleMessages.length>0||Ae.operationCards.length>0||Ae.humanGateCards.length>0||Ae.artifactCards.length>0||!!Ae.interview,ra=e.onNavigateWorkspace?()=>e.onNavigateWorkspace?.("models",{}):void 0,aa=u.jsx(Pk,{origin:t,readiness:e.readiness,workspaces:Mt.workspaces,workspacesLoading:Mt.loading,workspacesError:Mt.error,activeWorkspaceId:e.workspaceId??Mt.workspaceId,removingWorkspaceId:ft,onPickWorkspaceDirectory:Mt.pickWorkspaceDirectory,onAddWorkspace:ee=>Mt.addWorkspace(ee),onActivateWorkspace:ee=>{ee!==(e.workspaceId??Mt.workspaceId)&&e.onSwitchWorkspace?.(ee)},onRemoveWorkspace:ee=>{Ut(ee),Mt.removeWorkspace(ee).finally(()=>{Ut(null)})},onDismissWorkspaceError:()=>{Mt.refresh()},open:b,layoutMode:at,drawerOpen:ze.sidebarDrawerOpen,activeSessionId:h?.sessionId,activeSessionStreaming:Ae.streaming,activeSessionTurnPhase:Ae.turnPhase,sessions:je.sessionList,tree:we.tree,expanded:we.expandedDirs,treeError:we.treeError,onToggleOpen:()=>x(ee=>!ee),onOpenDrawer:mr,onCloseDrawer:Xt,onCreate:()=>{je.createSession()},onCreateInWorkspace:ee=>{je.createSession(ee===(e.workspaceId??Mt.workspaceId)?void 0:{workspaceId:ee})},creatingSession:je.creatingSession,onActivate:ee=>{const Ee=je.sessionList.find(vt=>vt.sessionId===ee)?.workspaceId;ze.sidebarDrawerOpen?xn(ee,Ee):(je.activateSession(ee,Ee),e.onNavigateWorkspace?.("chat",{...e.workspaceId?{workspaceId:e.workspaceId}:{},sessionId:ee}))},onRename:(ee,Ee)=>{je.updateSession(ee,{title:Ee})},onSetState:(ee,Ee)=>{je.updateSession(ee,{state:Ee})},onDelete:ee=>je.deleteSession(ee),onRefreshTree:we.refreshTree,onToggleDir:we.toggleDir,onInsert:ee=>{ze.sidebarDrawerOpen?Kn(ee):me.setInput(Ee=>`${Ee}${Ee&&!Ee.endsWith(" ")?" ":""}@${ee} `)},onPreview:ee=>{ze.sidebarDrawerOpen?da(ee):Aa(ee)},drawerTriggerRef:Re}),wn=["oc-workspace",oe?"is-column-dragging":""].filter(Boolean).join(" "),Ki=at==="narrow"?0:at==="compact"?56:b?z:40,ma=at==="narrow"||!y?0:B,Ar=xa(F,bs,Sl(B)),_e={"--oc-sidebar-width":`${Ki}px`,"--oc-details-width":`${ma}px`,"--oc-file-tree-width":`${Ar}px`,gridTemplateColumns:at==="narrow"?"minmax(0, 1fr)":`${Ki}px minmax(0, 1fr) ${ma}px`},Je=u.jsxs(u.Fragment,{children:[at==="comfortable"&&b?u.jsx(ju,{side:"sidebar",value:z,onResize:ee=>X(xa(ee,eL,tL)),onDragChange:J}):null,y&&at!=="narrow"?u.jsx(ju,{side:"details",value:B,onResize:ee=>$(xa(ee,Nl,Du())),onResizeEnd:ee=>jh(j3,xa(ee,Nl,Du())),onDragChange:J}):null,!y&&at!=="narrow"?u.jsx("button",{type:"button",className:"oc-details-reopen",onClick:()=>Yt(T),"aria-label":"展开右侧辅助栏",title:"展开辅助栏",children:u.jsx(Vh,{side:"right"})}):null]}),Nt=ee=>u.jsx("div",{className:"oc-messages is-empty",ref:he,"data-landing-density":Ht.landingDensity,children:e.readiness==="setup-required"?u.jsx(k3,{readiness:e.readiness,presentation:"landing",onOpenModels:ra}):u.jsx(W7,{mode:ee,readiness:e.readiness,density:Ht.landingDensity,onSuggest:async Ee=>{je.creatingSession||(ee==="no-session"?await je.createSession()&&await Pe(Ee):await Pe(Ee))},disabled:je.creatingSession,onCreateSession:ee==="no-session"?()=>{je.createSession()}:void 0})});return u.jsxs("div",{className:"oc-shell",children:[a?null:u.jsxs("div",{className:"oc-banner",children:[u.jsxs("span",{className:"oc-banner-title",children:[u.jsx("span",{className:"oc-banner-dot","aria-hidden":"true"}),"对话"]}),u.jsxs("span",{className:"oc-banner-body",children:["用自然语言编排 loop-agent / agent-worker 的",u.jsx("strong",{children:"全部能力"}),"。这是 ",u.jsx("strong",{children:"Operator"})," 面:默认具备完整 Pi 工具(read/write/edit/bash/grep/find/ls)与 safe-* 探查、以及受策略约束的 operator action(ADR 0011)。",u.jsx("strong",{children:"软约束"}),":大改与高风险变更优先走受治 DAG 的 implement-pi / repair-pi 与 Human Gate,而非把 Chat 当作第二套 DAG kernel。"]})]}),u.jsx(tj,{toast:Is,onDismiss:()=>{c(null),be(null)}}),h?u.jsxs("div",{className:wn,ref:ue,"data-layout-mode":at,style:_e,children:[aa,u.jsxs("div",{className:`oc-main${ir?"":" is-landing"}`,children:[at==="narrow"||Kt>0?u.jsxs("div",{className:"oc-main-topbar",children:[at==="narrow"?u.jsx("button",{type:"button",className:"oc-main-topbar-btn",ref:Re,"aria-label":"打开会话与仓库","aria-expanded":ze.sidebarDrawerOpen,onClick:()=>ze.sidebarDrawerOpen?Xt():mr(),children:"会话与仓库"}):null,Kt>0?u.jsxs("button",{type:"button",className:"oc-main-topbar-btn oc-activity-trigger","aria-controls":"oc-details-rail-body","aria-expanded":mt,onClick:()=>Na(),children:["运行活动 ",u.jsx("span",{children:Tt})]}):null]}):null,ir&&e.readiness!=="ready"?u.jsx(k3,{readiness:e.readiness,presentation:"thread",onOpenModels:ra}):null,ir?u.jsxs("div",{className:"oc-thread-anchor-wrap",children:[u.jsx(rD,{scrollContainerRef:ne,turnGroups:Ae.turnGroups,measureKey:Ae.visibleMessages.length}),u.jsx(JO,{scrollContainerRef:ne,messagesEndRef:Z,onScroll:ii,showScrollToLatest:!_,onScrollToLatest:As,hasThread:ir,readiness:e.readiness,streaming:Ae.streaming,streamingAssistantId:Ae.streamingAssistantId,messagesCount:Ae.messages.length,visibleCount:Ae.visibleMessages.length,onLoadMore:()=>Ae.setHistoryLimit(ee=>ee+50),turnGroups:Ae.turnGroups,interview:Ae.interview,interviewAnswer:Gt.interviewAnswer,onInterviewAnswerChange:Gt.setInterviewAnswer,onAnswerInterview:ee=>{Gt.answerInterview(ee)},onConfirmTaskKind:()=>{Gt.confirmTaskKind()},onActivateActivity:Na,canActivateActivity:pn,onSuggest:ee=>{Pe(ee)}})]}):Nt("empty-session"),Ae.pendingQuestion?u.jsx(ED,{origin:t,pending:Ae.pendingQuestion,workspaceId:h?.workspaceId,onSettled:()=>Ae.setPendingQuestion(null)}):u.jsxs("div",{className:"oc-composer-dock",children:[u.jsx(CD,{todos:Ae.todos}),u.jsx(vD,{composer:me,streaming:Ae.streaming,turnPhase:Ae.turnPhase,deferredTurn:Ae.deferredTurn,deferredTurns:Ae.deferredTurns,hasThread:ir,layoutMode:at,paletteModel:He,shortcutPaletteRef:pt,paletteKeyboardNavRef:Rt,onSend:ee=>{Pe(ee)},onStop:qe,onDiscardDeferred:et,onEditDeferred:St,onSteerDeferred:jt,onKeyDown:Wn,onRunShortcut:si,models:Q.models,activeModel:Q.activeModel,activeModelRef:Q.activeModelRef,activeModelListed:Q.activeModelListed,activeThinkingLevel:Q.activeThinkingLevel,thinkingLevels:Q.thinkingLevels,onSwitchRuntime:ee=>{Q.switchRuntime(ee)},usage:Ae.usage,sessionStats:Ae.sessionStats,unread:Ae.unread,onCompact:()=>{je.compactSession()},compacting:d,processSummary:Ae.streaming?null:Ae.processSummary,processOpen:Qe,onToggleProcess:()=>na("calls"),processTriggerRef:Le,runtimeContext:Q.runtimeContext,runtimeContextOpen:Ue,onToggleRuntimeContext:()=>na("context"),runtimeContextTriggerRef:Ye})]})]}),u.jsxs(r3,{open:y,onToggleOpen:()=>{S(!1),T==="context"&&Q.setRuntimeContextOpen(!1),T==="calls"&&j(ee=>ee.active==="process"?Qr(ee):ee)},activeTab:T,onSelectTab:Yt,dagRunId:gt,dagRun:_t,activityContent:U&&h?u.jsx(jO,{origin:t,sessionId:h.sessionId,focusRef:G,operationCards:Ae.operationCards,humanGateCards:Ae.humanGateCards,artifactCards:Ae.artifactCards,onLocateConversation:st,onNavigateWorkspace:e.onNavigateWorkspace}):void 0,contextContent:C&&Q.runtimeContext?u.jsx(AD,{panelOnly:!0,embedded:!0,open:T==="context"&&y&&!!Q.runtimeContext,onToggle:()=>na("context"),onClose:()=>{S(!1),Q.setRuntimeContextOpen(!1),j(ee=>ee.active==="runtime-context"?Qr(ee):ee)},context:Q.runtimeContext,triggerRef:Ye}):void 0,callsContent:I?u.jsx(RD,{toolCalls:Ae.toolCalls,overlay:!1,embedded:!0,onClose:()=>na("calls"),triggerRef:Le}):void 0,onCloseTab:Nr,children:[u.jsx(a3,{previews:we.previews,activePath:we.activePreviewPath,loading:we.previewLoading,onActivate:we.setActivePreviewPath,onClose:we.closePreview}),u.jsx(ju,{side:"details-tree",value:Ar,onResize:ee=>K(xa(ee,bs,Sl(B))),onResizeEnd:ee=>jh(Dh,xa(ee,bs,Sl(B))),onDragChange:J}),u.jsx(Nb,{workspaceName:Mt.workspaces.find(ee=>ee.workspaceId===e.workspaceId)?.name??"Workspace",tree:we.tree,expanded:we.expandedDirs,treeError:we.treeError,onRefresh:we.refreshTree,onToggle:we.toggleDir,onInsert:ee=>me.setInput(Ee=>`${Ee}${Ee&&!Ee.endsWith(" ")?" ":""}@${ee} `),onPreview:ee=>{Aa(ee)}})]}),Je]}):u.jsxs("div",{className:wn,ref:ue,"data-layout-mode":at,style:_e,children:[aa,u.jsxs("div",{className:"oc-main is-landing",children:[at==="narrow"?u.jsx("div",{className:"oc-main-topbar",children:u.jsx("button",{type:"button",className:"oc-main-topbar-btn",ref:Re,"aria-label":"打开会话与仓库","aria-expanded":ze.sidebarDrawerOpen,onClick:()=>ze.sidebarDrawerOpen?Xt():mr(),children:"会话与仓库"})}):null,Nt("no-session")]}),u.jsxs(r3,{open:y,onToggleOpen:()=>S(ee=>!ee),activeTab:T,onSelectTab:Yt,onCloseTab:Nr,dagRunId:gt,dagRun:_t,children:[u.jsx(a3,{previews:we.previews,activePath:we.activePreviewPath,loading:we.previewLoading,onActivate:we.setActivePreviewPath,onClose:we.closePreview}),u.jsx(ju,{side:"details-tree",value:Ar,onResize:ee=>K(xa(ee,bs,Sl(B))),onResizeEnd:ee=>jh(Dh,xa(ee,bs,Sl(B))),onDragChange:J}),u.jsx(Nb,{workspaceName:Mt.workspaces.find(ee=>ee.workspaceId===e.workspaceId)?.name??"Workspace",tree:we.tree,expanded:we.expandedDirs,treeError:we.treeError,onRefresh:we.refreshTree,onToggle:we.toggleDir,onInsert:ee=>me.setInput(Ee=>`${Ee}${Ee&&!Ee.endsWith(" ")?" ":""}@${ee} `),onPreview:ee=>{Aa(ee)}})]}),Je]})]})}function iL(e){const{active:t}=e;return u.jsxs("section",{id:"workspace-chat",className:"workspace-pane workspace-pane--chat panel panel--chat","aria-labelledby":"chat-title",hidden:!t,"aria-hidden":!t,inert:!t,tabIndex:t?-1:void 0,style:{minWidth:0,height:"100%"},children:[u.jsx("h2",{id:"chat-title",className:"sr-only",children:"对话"}),u.jsx(aL,{origin:"",readiness:e.readiness,surface:"workspace",workspaceRegistry:e.workspaceRegistry,workspaceId:e.workspaceId,requestedSessionId:e.sessionId,workspaceGate:e.workspaceGate,onSwitchWorkspace:e.onSwitchWorkspace,onNavigateWorkspace:e.onNavigateWorkspace})]})}function sL(e){const{board:t,busy:n}=e;return u.jsxs("details",{className:"night-advanced","data-testid":"night-advanced",open:t.advancedOpen,onToggle:a=>t.setAdvancedOpen(a.target.open),children:[u.jsx("summary",{children:"高级 / Inspect"}),u.jsxs("p",{className:"muted",children:["只读深链:"," ",u.jsx("a",{className:"external-link",href:"/#/inspect/night",children:"/#/inspect/night"})]}),u.jsx("div",{className:"cta-row",children:u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:n,"data-testid":"night-morning-btn",onClick:()=>{t.onMorningReport()},children:"早晨 night 报告"})}),t.morningPreview?u.jsx("pre",{className:"cmd","data-testid":"night-morning-preview",children:t.morningPreview}):null]})}function Lu(e){return!e||typeof e!="object"||Array.isArray(e)?null:e}function _n(e,t){const n=e[t];return typeof n=="string"&&n.trim()?n.trim():void 0}function z3(e,t){const n=e[t];if(!Array.isArray(n))return;const a=n.filter(s=>typeof s=="string");return a.length>0?a:void 0}function oL(e){const t=Lu(e);if(!t)return null;const n=Lu(t.result),a=[Lu(t.reviewPacket),n?Lu(n.reviewPacket):null,n,t].filter(Boolean);for(const s of a){const o=_n(s,"scheduleId")??_n(s,"id"),c=_n(s,"gateToken")??_n(s,"approveGate")??_n(s,"writeSetGateToken");if(!(!o||!c))return{scheduleId:o,gateToken:c,..._n(s,"featureId")?{featureId:_n(s,"featureId")}:{},..._n(s,"taskId")?{taskId:_n(s,"taskId")}:{},...z3(s,"writeSet")?{writeSet:z3(s,"writeSet")}:{},..._n(s,"worktreePath")?{worktreePath:_n(s,"worktreePath")}:{},..._n(s,"branch")?{branch:_n(s,"branch")}:{},..._n(s,"baseBranch")?{baseBranch:_n(s,"baseBranch")}:{},..._n(s,"baseCommit")?{baseCommit:_n(s,"baseCommit")}:{},..._n(s,"executeAtUtc")?{executeAtUtc:_n(s,"executeAtUtc")}:{},..._n(s,"taskCard")?{taskCard:_n(s,"taskCard")}:{}}}return null}function B3(e){return`docs/features/${e.trim().replace(/^\/+|\/+$/g,"")}`}function lL(e){const t=e.trim(),n=/^(\d{4}-\d{2}-\d{2})[T ](\d{2}:\d{2})/.exec(t);return n?`${n[1]} ${n[2]}`:null}function q3(){const e=new Date;e.setHours(20,0,0,0);const t=n=>String(n).padStart(2,"0");return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}`}function ix(e){if(!e)return"—";const t=Date.parse(e);if(Number.isNaN(t))return e;try{return new Intl.DateTimeFormat("zh-CN",{dateStyle:"short",timeStyle:"short",timeZone:"Asia/Shanghai"}).format(new Date(t))}catch{return e}}function cL(e){return e.mergeState==="pending-harvest"||/\bscheduler harvest\b/i.test(e.nextAction)}function uL(e){return e.status==="failed"||e.status==="human_required"||e.status==="cancelled"||/\bscheduler discard\b/i.test(e.nextAction)}function ud(e){return e==="failed"||e==="human_required"}function dL(e){return`${e}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`}function sx(e){return{submitted:"已提交",validating:"校验中",validated:"待预约确认",scheduled:"已预约",waiting:"等待触发",dispatching:"派发中",running:"执行中",succeeded:"成功",failed:"失败",human_required:"需人工",cancelled:"已取消",rejected:"已拒绝",cancel_requested:"取消中"}[e]??e}function fL(e){const{target:t,reason:n,onReasonChange:a,force:s,onForceChange:o,busy:c}=e;return u.jsxs("div",{className:"night-discard-card","data-testid":"night-discard-card",children:[u.jsx("h3",{children:"确认 Discard"}),u.jsxs("p",{className:"muted",children:[t.featureId,"/",t.taskId,"(",sx(t.status),")"]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"原因"}),u.jsx("input",{"data-testid":"night-discard-reason",value:n,disabled:c,placeholder:"human discard reason",onChange:d=>a(d.target.value)})]}),ud(t.status)?u.jsxs("label",{className:"field checkbox-field",children:[u.jsx("input",{type:"checkbox","data-testid":"night-discard-force",checked:s,disabled:c,onChange:d=>o(d.target.checked)}),u.jsx("span",{className:"muted",children:"强制 Discard(failed / human_required)"})]}):null,u.jsxs("div",{className:"cta-row",children:[u.jsx("button",{type:"button",className:"btn btn-primary",disabled:c||ud(t.status)&&!s,"data-testid":"night-discard-confirm",onClick:e.onConfirm,children:"确认 Discard"}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:c,onClick:e.onCancel,children:"返回"})]})]})}function mL(e){const{board:t}=e,{doctor:n,list:a,clockHint:s,doctorIssues:o,auxTicker:c}=t;return u.jsxs("div",{className:"night-health","data-testid":"night-health-bar",children:[u.jsxs("div",{className:"night-health-main",children:[u.jsx("span",{className:`night-health-pill${n?.ok===!1?" is-bad":""}`,children:n?.ok===!1?"Scheduler 异常":"Scheduler 健康"}),u.jsxs("span",{className:"muted",children:["计划 ",n?.scheduleCount??a?.summary.total??"—"," · 活动"," ",n?.activeCount??a?.summary.active??"—"]})]}),s?u.jsxs("p",{className:"muted night-health-hint","data-testid":"night-clock-hint",children:["时钟:",s.message,"(安装/启停请用 CLI:",u.jsx("code",{children:"agent-worker scheduler clock status --repo ."}),")"]}):u.jsxs("p",{className:"muted night-health-hint",children:["到点执行依赖本机 clock / tick,不在此面板安装。详见"," ",u.jsx("a",{className:"external-link",href:"/#/inspect/night",children:"/#/inspect/night"})]}),u.jsxs("div",{className:"night-aux-ticker","data-testid":"night-aux-ticker",children:[u.jsxs("p",{className:"night-aux-ticker-label",children:["开着 Console 时辅助 tick(每 ",c?.intervalSec??60,"s)"]}),u.jsx("p",{className:"muted night-health-hint","data-testid":"night-aux-ticker-disclaimer",children:c?.disclaimer??"仅在本 Console 进程开着时有效;过夜无人值守仍需 OS clock。"}),c?.lastOutcome?u.jsxs("p",{className:"muted","data-testid":"night-aux-ticker-last",children:["上次:",c.lastOutcome,c.running?"(进行中)":"",c.lastSummary?` · ${c.lastSummary}`:"",c.lastError?` · ${c.lastError}`:""]}):null]}),o.length>0?u.jsx("ul",{className:"night-doctor-list","data-testid":"night-doctor-findings",children:o.slice(0,4).map(d=>u.jsxs("li",{children:[u.jsx("strong",{children:d.severity})," ",d.message]},`${d.code}-${d.scheduleId??""}-${d.message}`))}):null]})}function hL(e){const{board:t,busy:n,onHarvest:a,onOpenDiscard:s}=e,{list:o}=t;return u.jsxs(u.Fragment,{children:[o?u.jsxs("div",{className:"night-kpi","data-testid":"night-kpi",children:[u.jsxs("span",{children:["合计 ",o.summary.total]}),u.jsxs("span",{children:["活动 ",o.summary.active]}),u.jsxs("span",{children:["待收成 ",o.summary.pendingHarvest]}),u.jsxs("span",{children:["需人工 ",o.summary.humanRequired]}),u.jsxs("span",{children:["失败 ",o.summary.failed]})]}):null,u.jsxs("div",{className:"night-board","data-testid":"night-board",children:[u.jsx("h3",{children:"计划列表"}),!o||o.schedules.length===0?u.jsxs("div",{className:"empty-state","data-testid":"night-board-empty",children:[u.jsx("p",{className:"empty-title",children:"暂无夜间计划"}),u.jsx("p",{className:"muted",children:"用下方向导预约第一个任务。"})]}):u.jsx("ul",{className:"night-schedule-list",children:o.schedules.map(c=>u.jsxs("li",{className:"night-schedule-row","data-testid":"night-schedule-row","data-status":c.status,children:[u.jsxs("div",{className:"night-schedule-head",children:[u.jsxs("strong",{children:[c.featureId,"/",c.taskId]}),u.jsx("span",{className:"night-status-chip",children:sx(c.status)})]}),u.jsxs("p",{className:"muted",children:["执行 ",ix(c.executeAtUtc),c.mergeState?` · merge ${c.mergeState}`:"",c.taskCard?` · ${c.taskCard}`:""]}),c.waitingReason?u.jsxs("p",{className:"muted",children:["等待原因:",c.waitingReason]}):null,u.jsxs("p",{className:"muted night-next-action",children:["下一步:",c.nextAction]}),u.jsxs("div",{className:"cta-row",children:[cL(c)?u.jsx("button",{type:"button",className:"btn btn-primary",disabled:n,"data-testid":"night-row-harvest",onClick:()=>a(c),children:"Harvest"}):null,uL(c)?u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:n,"data-testid":"night-row-discard",onClick:()=>s(c),children:"Discard"}):null,u.jsx("a",{className:"external-link",href:`/#/inspect/night/${encodeURIComponent(c.scheduleId)}`,children:"Inspect"})]})]},c.scheduleId))})]})]})}function pL(e){const{wizard:t,busy:n}=e;return u.jsxs("div",{className:"night-wizard","data-testid":"night-wizard",children:[u.jsx("h3",{children:"预约夜间任务"}),t.phase==="pick"?u.jsxs(u.Fragment,{children:[t.selectableTasks.length===0?u.jsxs("div",{className:"empty-state","data-testid":"night-task-empty",children:[u.jsx("p",{className:"empty-title",children:"没有可选任务"}),u.jsx("p",{className:"muted",children:"请先在 Feature Packet / Task Pool 中创建任务,再回到此处刷新。"})]}):u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"Feature / Task"}),u.jsxs("select",{"data-testid":"night-task-select",value:t.selectedKey,disabled:n,onChange:a=>t.setSelectedKey(a.target.value),children:[u.jsx("option",{value:"",children:"选择任务…"}),t.selectableTasks.map(a=>{const s=`${a.featureId}::${a.taskId}`;return u.jsxs("option",{value:s,children:[a.featureId,"/",a.taskId,a.status?` · ${a.status}`:""]},s)})]})]}),t.derivedFeatureDir?u.jsxs("p",{className:"muted","data-testid":"night-feature-dir",children:["Feature 目录:",u.jsx("code",{children:t.derivedFeatureDir})]}):null,u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"本地执行时间"}),u.jsx("input",{type:"datetime-local","data-testid":"night-at",value:t.nightAt,disabled:n,onChange:a=>t.setNightAt(a.target.value)})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"任务卡片(可选)"}),u.jsx("input",{"data-testid":"night-task-card",value:t.taskCard,disabled:n,placeholder:"UCP-LOOP#11",onChange:a=>t.setTaskCard(a.target.value)})]}),u.jsx("div",{className:"cta-row",children:u.jsx("button",{type:"button",className:"btn btn-primary",disabled:n||!t.selectedKey||!t.nightAt,"data-testid":"night-prepare-btn",onClick:()=>{t.onPrepare()},children:"准备并审阅"})})]}):u.jsxs("div",{className:"night-review-card","data-testid":"night-review-card",children:[u.jsx("p",{className:"muted",children:"请确认 writeSet 与执行环境后预约。Token 已隐藏。"}),u.jsxs("dl",{className:"kv",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"Schedule"}),u.jsx("dd",{children:u.jsx("code",{children:t.review?.scheduleId})})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"任务"}),u.jsxs("dd",{children:[t.review?.featureId,"/",t.review?.taskId]})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"执行时间 (UTC)"}),u.jsx("dd",{children:ix(t.review?.executeAtUtc)})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Worktree"}),u.jsx("dd",{children:u.jsx("code",{children:t.review?.worktreePath??"—"})})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"分支"}),u.jsx("dd",{children:u.jsx("code",{children:t.review?.branch??"—"})})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Base"}),u.jsx("dd",{children:u.jsxs("code",{children:[t.review?.baseBranch??"—","@",(t.review?.baseCommit??"").slice(0,12)||"—"]})})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"WriteSet"}),u.jsx("dd",{children:t.review?.writeSet&&t.review.writeSet.length>0?u.jsx("ul",{className:"night-writeset",children:t.review.writeSet.map(a=>u.jsx("li",{children:u.jsx("code",{children:a})},a))}):u.jsx("span",{className:"muted",children:"(未返回显式 writeSet)"})})]})]}),u.jsxs("div",{className:"cta-row",children:[u.jsx("button",{type:"button",className:"btn btn-primary",disabled:n||!t.review,"data-testid":"night-confirm-add-btn",onClick:()=>{t.onConfirmAdd()},children:"确认预约"}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:n,"data-testid":"night-review-back-btn",onClick:t.onCancelWizard,children:"返回修改"})]})]})]})}function gL(e){const{setOpError:t}=e,[n,a]=w.useState(null),[s,o]=w.useState(null),[c,d]=w.useState([]),[m,h]=w.useState(null),[p,b]=w.useState(!1),[x,y]=w.useState(!1),[S,T]=w.useState(null),[A,C]=w.useState(null),M=w.useCallback(async()=>{b(!0),h(null);try{const[N,z,X,B]=await Promise.all([fetch(Cr("/api/night-jobs"),{credentials:"same-origin"}),fetch(Cr("/api/night-jobs/doctor"),{credentials:"same-origin"}),fetch(Cr("/api/tasks"),{credentials:"same-origin"}),fetch(Cr("/api/operator/v1/night-aux-ticker"),{credentials:"same-origin"})]);if(!N.ok)throw new Error(`加载计划列表失败(HTTP ${N.status})`);const $=await N.json();if(a($),z.ok?o(await z.json()):o(null),X.ok){const F=await X.json();d(Array.isArray(F)?F:[])}else d([]);if(B.ok){const F=await B.json();F.ticker&&C(F.ticker)}}catch(N){h(N instanceof Error?N.message:String(N))}finally{b(!1)}},[]);w.useEffect(()=>{M()},[M]);const I=w.useCallback(async()=>{try{const N=await fetch(Cr("/api/night-jobs/morning"),{credentials:"same-origin"});if(!N.ok){t(`早晨报告加载失败(HTTP ${N.status})`);return}const z=await N.json();T(JSON.stringify(z,null,2).slice(0,4e3)),y(!0)}catch(N){t(N instanceof Error?N.message:String(N))}},[t]),P=(s?.findings??[]).filter(N=>N.severity==="error"||N.severity==="warning"),U=(s?.findings??[]).find(N=>/clock/i.test(N.code)||/clock/i.test(N.message));return{list:n,doctor:s,tasks:c,loadError:m,loadingBoard:p,advancedOpen:x,setAdvancedOpen:y,morningPreview:S,auxTicker:A,refreshBoard:M,onMorningReport:I,doctorIssues:P,clockHint:U}}function bL(e){const{board:t,runAction:n,isActionSuccess:a,setOpError:s}=e,{tasks:o,refreshBoard:c}=t,[d,m]=w.useState("pick"),[h,p]=w.useState(""),[b,x]=w.useState(q3),[y,S]=w.useState(""),[T,A]=w.useState(null),[C,M]=w.useState(""),[I,P]=w.useState(null),[U,N]=w.useState(!1),z=w.useMemo(()=>{const Y=o.filter(re=>typeof re.featureId=="string"&&re.featureId.trim()&&re.taskId);return Y.sort((re,fe)=>{const j=re.featureId??"",G=fe.featureId??"";return j!==G?j.localeCompare(G):re.taskId.localeCompare(fe.taskId)}),Y},[o]),X=w.useMemo(()=>h?z.find(Y=>`${Y.featureId}::${Y.taskId}`===h)??null:null,[z,h]),B=X?.featureId?B3(X.featureId):"",$=w.useCallback(async(Y,re,fe)=>{const j=await n("prepareMutationGate",{action:Y,actionParams:re});if(!a(j))return;const G=j?.result??j,W=G.receiptId?G:G.result??G;if(!W.receiptId||!W.humanGateToken){s("prepareMutationGate 未返回可消费的 Human Gate receipt");return}return n(Y,{...re,confirmationId:W.receiptId,humanGateToken:W.humanGateToken},{clientRequestId:dL(fe)})},[a,n,s]),F=w.useCallback(async()=>{if(!X?.featureId){s("请先点选 Feature / Task");return}const Y=lL(b);if(!Y){s("执行时间格式无效,请使用日期时间选择器");return}const re={featureDir:B3(X.featureId),taskId:X.taskId,at:Y,tz:"Asia/Shanghai",...y.trim()?{taskCard:y.trim()}:{}},fe=await $("workerAdmissionPrepare",re,"night-prepare");if(!a(fe))return;const j=oL(fe?.result??fe);if(!j){s("准备成功但未解析到 scheduleId / gateToken。请刷新后重试,或查看 Inspect。");return}A(j),m("review")},[a,b,$,X,s,y]),K=w.useCallback(async()=>{if(!T)return;const Y=await $("workerSchedulerAdd",{scheduleId:T.scheduleId,approveGate:T.gateToken},"night-add");a(Y)&&(A(null),m("pick"),p(""),S(""),x(q3()),await c())},[a,c,T,$]),oe=w.useCallback(()=>{m("pick"),A(null)},[]),J=w.useCallback(async Y=>{const re=await $("workerSchedulerHarvest",{scheduleId:Y.scheduleId},"night-harvest");a(re)&&await c()},[a,c,$]),H=w.useCallback(async()=>{if(!I)return;const Y=C.trim()||"discard from console night workbench",re=ud(I.status),fe=await $("workerSchedulerDiscard",{scheduleId:I.scheduleId,reason:Y,...re||U?{force:!0}:{}},"night-discard");a(fe)&&(P(null),M(""),N(!1),await c())},[C,I,U,a,c,$]),_=w.useCallback(Y=>{P(Y),N(ud(Y.status)),M("")},[]);return{phase:d,selectedKey:h,setSelectedKey:p,nightAt:b,setNightAt:x,taskCard:y,setTaskCard:S,review:T,discardReason:C,setDiscardReason:M,discardTarget:I,setDiscardTarget:P,forceDiscard:U,setForceDiscard:N,selectableTasks:z,derivedFeatureDir:B,onPrepare:F,onConfirmAdd:K,onCancelWizard:oe,onHarvest:J,onDiscard:H,openDiscard:_}}function vL({busy:e,runAction:t,isActionSuccess:n,setOpError:a}){const s=gL({setOpError:a}),o=bL({board:s,runAction:t,isActionSuccess:n,setOpError:a});return u.jsxs("section",{className:"panel night-workbench","aria-labelledby":"night-title","data-testid":"night-jobs-panel",children:[u.jsx("h2",{id:"night-title",children:"夜间任务"}),u.jsx("p",{className:"panel-lead",children:"白天点选任务并预约;列表查看状态;早晨在行内收成或丢弃。写操作仍经 Human Gate,列表复用 Inspect 投影。"}),u.jsx(mL,{board:s,busy:e}),u.jsx("div",{className:"cta-row",children:u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:e||s.loadingBoard,"data-testid":"night-refresh-btn",onClick:()=>{s.refreshBoard()},children:"刷新看板"})}),s.loadError?u.jsx("p",{className:"error","data-testid":"night-load-error",children:s.loadError}):null,u.jsx(hL,{board:s,busy:e,onHarvest:c=>{o.onHarvest(c)},onOpenDiscard:o.openDiscard}),o.discardTarget?u.jsx(fL,{target:o.discardTarget,reason:o.discardReason,onReasonChange:o.setDiscardReason,force:o.forceDiscard,onForceChange:o.setForceDiscard,busy:e,onConfirm:()=>{o.onDiscard()},onCancel:()=>o.setDiscardTarget(null)}):null,u.jsx(pL,{wizard:o,busy:e}),u.jsx(sL,{board:s,busy:e})]})}function yL(){return u.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",children:u.jsx("path",{d:"M2.6 4.2 6 7.6l3.4-3.4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}function zu(e){return e.provider?Ts(e.provider,e.id):e.id}function xL(e){const t=e.trim();if(!t)return;const n=t.indexOf("/");return n<=0||n===t.length-1?{provider:"",id:t}:{provider:t.slice(0,n),id:t.slice(n+1)}}function wL(e){const[t,n]=w.useState(!1),[a,s]=w.useState(""),[o,c]=w.useState(0),d=w.useRef(null),m=w.useRef(null),h=w.useRef(null),p=w.useMemo(()=>{const T=[...e.models];if(e.value&&!T.some(A=>zu(A)===e.value)){const A=xL(e.value);A&&T.push(A)}return T},[e.models,e.value]),b=w.useMemo(()=>Q7(p,a),[p,a]),x=w.useMemo(()=>b.flatMap(T=>T.models),[b]);w.useEffect(()=>{t&&(s(""),c(Math.max(0,p.findIndex(T=>zu(T)===e.value))),window.setTimeout(()=>h.current?.focus(),0))},[t,p,e.value]),w.useEffect(()=>{if(!t)return;const T=C=>{const M=d.current;M&&C.target instanceof Node&&!M.contains(C.target)&&n(!1)},A=C=>{C.key==="Escape"&&(n(!1),m.current?.focus())};return document.addEventListener("mousedown",T),document.addEventListener("keydown",A),()=>{document.removeEventListener("mousedown",T),document.removeEventListener("keydown",A)}},[t]);const y=T=>{if(e.disabled)return;const A=x[T];A&&(n(!1),e.onChange(zu(A)),m.current?.focus())},S=T=>{if(T.key==="ArrowDown"){T.preventDefault(),c(A=>x.length?(A+1)%x.length:0);return}if(T.key==="ArrowUp"){T.preventDefault(),c(A=>x.length?(A-1+x.length)%x.length:0);return}if(T.key==="Enter"){T.preventDefault(),y(o);return}if(T.key==="Escape"){T.preventDefault(),n(!1),m.current?.focus();return}};return u.jsxs("div",{className:"oc-select-menu models-matrix-select",ref:d,children:[u.jsxs("button",{type:"button",ref:m,id:e.id,className:"oc-select-trigger","aria-haspopup":"listbox","aria-expanded":t,"aria-invalid":e.ariaInvalid,"data-testid":e.dataTestId,disabled:e.disabled,onClick:()=>n(T=>!T),children:[u.jsx("span",{className:"oc-select-trigger-label",children:e.value||"选择模型"}),u.jsx(yL,{})]}),t&&u.jsxs("div",{className:"oc-select-panel oc-model-panel is-below",role:"listbox","aria-label":"选择模型",children:[u.jsx("input",{ref:h,className:"oc-select-search",placeholder:"搜索模型…",value:a,onChange:T=>{s(T.target.value),c(0)},onKeyDown:S}),b.length===0&&u.jsx("div",{className:"oc-select-status",children:"没有可用模型"}),b.map(T=>u.jsxs("div",{className:"oc-model-group",children:[u.jsx("div",{className:"oc-model-group-head",children:T.provider||"其他"}),T.models.map(A=>{const C=zu(A),M=C===e.value,I=x[o]===A;return u.jsxs("button",{type:"button",role:"option","aria-selected":M,disabled:e.disabled,className:`oc-select-option oc-model-option${I?" is-highlighted":""}${M?" is-active":""}`,onMouseDown:P=>P.preventDefault(),onClick:()=>{e.disabled||(n(!1),e.onChange(C))},children:[u.jsxs("span",{className:"oc-model-option-name",children:[A.name?`${A.name} · `:"",A.id]}),M&&u.jsx("span",{className:"oc-model-option-check",children:"✓"})]},C)})]},T.provider))]})]})}const kL=[{key:"sdkAvailable",detailKey:"sdkMessage",label:"Pi SDK",hint:"Node 侧 Pi SDK 可加载"},{key:"authReady",detailKey:"authMessage",label:"认证凭据",hint:"Pi auth / provider 密钥已配置"},{key:"modelsAvailable",detailKey:"modelsMessage",label:"可用模型",hint:"harness.json executors.pi(LOW/MED/HIGH)可在 Pi 凭据面解析"},{key:"interviewSessionOk",detailKey:"sessionMessage",label:"访谈会话",hint:"Interview 会话预检通过"}];function SL(e){if(!e)return null;const t=Date.parse(e);return Number.isNaN(t)?e:new Date(t).toLocaleString()}function EL(e){const t=e.readinessReport?.state??e.readiness,n=e.readinessReport?.probe,a=n?.details??{},s=e.readinessReport?.blockedActions??[],o=SL(e.readinessReport?.generatedAt),c=e.readinessReport??{state:e.readiness,health:e.health},d=n?.piModelMatrix,m=n?.piAvailableModels??[],[h,p]=w.useState(()=>bb(d)),[b,x]=w.useState(!1),[y,S]=w.useState(null),[T,A]=w.useState(null);w.useEffect(()=>{p(bb(d)),S(null)},[d]);const C=A9(h),M=!I9(C),I=e.busy||b||M;async function P(){if(!I){x(!0),S(null),A(null);try{const U=await e.onSaveMatrix({LOW:h.LOW,MED:h.MED,HIGH:h.HIGH});if(U&&U.ok===!1){S(U.error?.message??"保存模型矩阵失败");return}const N=window.localStorage.getItem(Qa)?.trim();if(N)try{const z=await fetch(`/api/operator/v1/chat/sessions/${encodeURIComponent(N)}/reload`,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json",[O1]:j1()},body:"{}"});z.ok?A("配置已保存,活动会话已重载。"):z.status===409?A("配置已保存;活动会话正忙(PI_SESSION_BUSY),请稍后手动重载。"):A("配置已保存;活动会话重载未完成,请手动重载。")}catch{A("配置已保存;活动会话重载未完成,请手动重载。")}else A("配置已保存,检测结果已刷新。")}catch(U){S(U instanceof Error?U.message:String(U))}finally{x(!1)}}}return u.jsxs("section",{className:"panel models-page","aria-labelledby":"models-title",children:[u.jsxs("div",{className:"models-header",children:[u.jsx("h2",{id:"models-title",children:"模型与认证"}),u.jsx("span",{className:"models-status-pill","data-state":t,"data-testid":"models-readiness-pill",children:K3[t]??t})]}),u.jsxs("p",{className:"panel-lead",children:["复用 Pi ModelRuntime 凭据平面;密钥不会回传到页面。请用"," ",u.jsx("code",{children:"pi"})," 或 Pi 认证存储完成配置,然后刷新就绪探测。"]}),u.jsxs("section",{className:"models-probe-card","aria-labelledby":"models-probe-title","data-testid":"readiness-details",children:[u.jsx("h3",{id:"models-probe-title",className:"models-subtitle",children:"就绪检查"}),u.jsx("ul",{className:"models-probe-list",children:kL.map(U=>{const N=n?.[U.key],z=a[U.detailKey],X=N===void 0;return u.jsxs("li",{className:`models-probe-item${X?" is-pending":N?" is-ok":" is-bad"}`,children:[u.jsx("span",{className:"models-probe-badge","aria-label":X?"未探测":N?"通过":"未通过",children:X?"—":N?"✓":"✕"}),u.jsxs("div",{className:"models-probe-body",children:[u.jsx("strong",{children:U.label}),u.jsx("span",{className:"muted",children:U.hint}),z?u.jsx("p",{className:"models-probe-detail",children:z}):null]})]},U.key)})})]}),u.jsxs("section",{className:"models-matrix-card","aria-labelledby":"models-matrix-title","data-testid":"models-matrix-editor",children:[u.jsx("h3",{id:"models-matrix-title",className:"models-subtitle",children:"Herness模型矩阵(LOW/MED/HIGH)"}),u.jsxs("p",{className:"models-matrix-lead",children:["从 Pi 可用模型中选择 ",u.jsx("code",{children:"provider/model"})," 或裸 model id; 保存后原子写入 ",u.jsx("code",{children:"executors.pi"})," 并自动重测就绪。"]}),u.jsx("div",{className:"models-matrix-list",children:D1.map(U=>u.jsxs("div",{className:"models-matrix-row",children:[u.jsxs("label",{htmlFor:`pi-model-${U}`,children:[U," 档",C[U]?u.jsxs("span",{className:"error","data-testid":`pi-model-error-${U}`,children:[" ","— ",C[U]]}):null]}),u.jsx(wL,{id:`pi-model-${U}`,value:h[U],models:m,onChange:N=>p(z=>({...z,[U]:N})),ariaInvalid:C[U]!==void 0,"data-testid":`pi-model-select-${U}`})]},U))}),y?u.jsx("p",{className:"error","data-testid":"models-matrix-save-error",children:y}):null,T?u.jsx("p",{className:"muted","data-testid":"models-matrix-save-notice",children:T}):null,u.jsxs("div",{className:"models-actions",children:[u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:I,"data-testid":"models-matrix-save",onClick:()=>{P()},children:b||e.busy?"保存中…":"保存模型矩阵"}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:e.busy||b,"data-testid":"models-matrix-refresh-models",onClick:e.onRefreshReadiness,children:e.busy?"刷新中…":"刷新模型"})]})]}),t==="setup-required"?u.jsxs("div",{className:"models-setup-card","data-testid":"models-setup-hint",children:[u.jsx("h3",{className:"models-subtitle",children:"如何完成配置"}),u.jsxs("ol",{className:"models-setup-steps",children:[u.jsxs("li",{children:["在终端配置 Pi 认证(例如 ",u.jsx("code",{children:"pi auth login"}),")或写入 provider API key。"]}),u.jsxs("li",{children:["确认 agent 目录下 ",u.jsx("code",{children:"models.json"})," / 认证文件可读。"]}),u.jsx("li",{children:"点击下方「刷新就绪探测」,或运行诊断命令查看详情。"})]}),u.jsx("pre",{className:"cmd",children:V3})]}):null,t==="degraded"?u.jsx("p",{className:"models-degraded-note","data-testid":"models-degraded-note",children:"Pi 暂时降级:仍可恢复草稿与需求访谈;部分写入/运行类操作会被拦截。"}):null,s.length>0?u.jsxs("div",{className:"models-blocked-card",children:[u.jsx("h3",{className:"models-subtitle",children:"当前受限操作"}),u.jsx("ul",{className:"models-blocked-list",children:s.map(U=>u.jsx("li",{children:u.jsx("code",{children:U})},U))})]}):null,u.jsxs("div",{className:"models-actions",children:[u.jsx("button",{type:"button",className:"btn btn-primary",disabled:e.busy,onClick:e.onRefreshReadiness,children:"刷新就绪探测"}),o?u.jsxs("span",{className:"muted models-generated-at",children:["上次探测:",o]}):null]}),u.jsxs("details",{className:"models-raw-details",children:[u.jsx("summary",{children:"查看原始探测数据(调试)"}),u.jsx("pre",{className:"cmd models-raw-json",children:JSON.stringify(c,null,2)})]})]})}const TL=[{value:"requirements-changed",label:"需求已变更"},{value:"suspected-runaway",label:"疑似失控"},{value:"resource-protection",label:"保护资源"},{value:"operator-request",label:"操作者请求"},{value:"other",label:"其他"}];function H3(e){const{lane:t,cta:n,planSummary:a,reason:s,busy:o,confirmRef:c}=e;return!n||n.lane!==t?null:u.jsxs("div",{ref:c,className:"recovery-confirm","data-testid":"recovery-confirm",children:[u.jsxs("h3",{children:["待确认:",n.label]}),u.jsx("p",{className:"muted",children:n.id==="reconcile"?"破坏性对账需经浏览器 Human Gate 确认。请核对运行与原因后再点「确定」。":n.id==="interrupt"?"协作中止需经浏览器 Human Gate。原因已按当前运行预填,可改分类或编辑后再确定。提交只表示请求已登记,当前节点仍会跑完。":"核对上方运行 / 节点与恢复原因后直接执行;服务端会校验资格,不再走 Human Gate。"}),n.id==="interrupt"?u.jsxs("fieldset",{className:"recovery-reason-code","data-testid":"recovery-interrupt-reason-code",disabled:o,children:[u.jsx("legend",{children:"原因分类"}),u.jsx("div",{className:"recovery-reason-code-group",children:TL.map(d=>{const m=(e.reasonCode??"operator-request")===d.value;return u.jsxs("label",{className:m?"recovery-reason-code-option is-active":"recovery-reason-code-option",children:[u.jsx("input",{type:"radio",name:"recovery-interrupt-reason-code",value:d.value,checked:m,onChange:()=>e.onReasonCodeChange?.(d.value)}),d.label]},d.value)})})]}):null,a?u.jsxs("div",{className:"recovery-plan-summary",children:[u.jsxs("p",{className:"muted",children:["计划 eligible=",String(a.eligible??"—")," · 风险=",Y3[a.risk??""]??a.risk??"—"]}),a.effectiveFromNodeId?u.jsxs("p",{className:"muted",children:["有效起点:",a.effectiveFromNodeId]}):null,a.estimatedExecution?u.jsxs("p",{className:"muted",children:["将执行 ",a.estimatedExecution.nodeCount??"?"," 个节点 / ",a.estimatedExecution.piCallCount??"?"," 次 Pi;预计避免"," ",a.estimatedExecution.avoidedNodeCount??"?"," 个节点"]}):null,a.planHash?u.jsxs("p",{className:"muted",children:["planHash: ",u.jsxs("code",{children:[a.planHash.slice(0,16),"…"]})]}):null]}):n.id==="dagRerun"?u.jsx("p",{className:"muted",children:"未加载计划摘要;点「确定」前将再次尝试资格检查。"}):null,u.jsxs("div",{className:"cta-row",children:[u.jsx("button",{type:"button",className:"btn btn-primary",disabled:o||!s.trim(),"data-testid":"recovery-confirm-submit",onClick:e.onSubmit,children:"确定"}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:o,"data-testid":"recovery-confirm-cancel",onClick:e.onCancel,children:"取消"})]})]})}function CL(e){const{shell:t,recovery:n,wizard:a}=e,{busy:s}=t,o=gw({interruptStatus:n.interruptEligibility?.interruptStatus,dagStatus:n.recoveryRunStatus,failureCategory:n.recoveryFailureCategory,targetOperationState:n.interruptEligibility?.targetOperationState}),c={planSummary:n.recoveryPlanSummary,reason:n.recoveryReason,reasonCode:n.interruptReasonCode,onReasonCodeChange:n.setInterruptReasonCode,busy:s,confirmRef:n.recoveryConfirmRef,onSubmit:()=>{n.submitRecoveryConfirm()},onCancel:()=>{n.setRecoveryConfirm(null),n.setRecoveryPlanSummary(null)}};return u.jsxs("section",{className:"panel","aria-labelledby":"recovery-title",children:[u.jsx("h2",{id:"recovery-title",children:"恢复"}),u.jsxs("p",{className:"muted",children:["事实分类:",W3[n.recoveryFact]," · 无 Cancel · 无「直接改代码」"]}),n.frontendRecovery?u.jsxs("div",{className:"muted","data-testid":"frontend-recovery-lineage",style:{marginBottom:"0.75rem"},children:[u.jsxs("div",{children:["前端恢复:outcome=",u.jsx("code",{children:n.frontendRecovery.outcome??"—"})," phase=",u.jsx("code",{children:n.frontendRecovery.phase??"—"})]}),u.jsxs("div",{children:["root ",u.jsx("code",{children:n.frontendRecovery.recoveryRootRunId??"—"}),n.frontendRecovery.parentRunId?` · parent ${n.frontendRecovery.parentRunId}`:"",n.frontendRecovery.childRunId?` · child ${n.frontendRecovery.childRunId}`:"",n.frontendRecovery.attemptIndex!==void 0?` · attempt ${n.frontendRecovery.attemptIndex}`:""]})]}):null,u.jsxs("ol",{className:"muted recovery-steps",children:[u.jsx("li",{children:"上方选 DAG 运行 / 节点,用「DAG 运行恢复」动作"}),u.jsx("li",{children:"Worker 持有的失败 run 用下方「Worker Task 重排队」;独立 DAG run 无法从节点恢复时才用「带反馈重新执行任务」"}),u.jsx("li",{children:"带 * 的动作:核对预填原因后点「确定」。重跑/重试直接执行;对账与中止运行走 Human Gate"})]}),o?u.jsxs("p",{className:"muted","data-testid":"recovery-interrupt-status",children:["中止进度:",o]}):null,n.recoveryFact==="running-active"&&n.interruptEligibility&&!n.interruptEligibility.eligible&&(!n.interruptEligibility.interruptStatus||n.interruptEligibility.interruptStatus==="none")?u.jsx("p",{className:"muted","data-testid":"recovery-interrupt-unavailable",children:n.interruptEligibility.ownerKind==="worker-managed"?"此运行不由当前 Console 持有,暂不支持协作中止。请用 Doctor / 报告查看。":n.interruptEligibility.message??"当前运行不具备协作中止资格。"}):null,u.jsxs("p",{className:"muted",children:[a.taskId.trim()?`按任务 ${a.taskId.trim()} 拉取候选。`:"未填任务 ID 时列出最近 DAG 运行。","Doctor 诊断可选,不是重跑前置。"," ",u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:s||n.recoveryRunsLoading,"data-testid":"recovery-refresh-candidates",onClick:()=>{n.loadRecoveryRuns()},children:n.recoveryRunsLoading?"刷新中…":"刷新候选"})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"DAG 运行 ID"}),!n.manualRunId&&n.recoveryRuns.length>0?u.jsxs("select",{"data-testid":"recovery-run-select",value:n.dagRunId,disabled:s||n.recoveryRunsLoading,onChange:d=>{n.setManualRunId(!1),n.setManualNodeId(!1),n.setFromNodeId(""),n.setDagRunId(d.target.value),n.recoveryReasonTouched||n.setRecoveryReasonTouched(!1)},children:[n.recoveryRuns.some(d=>d.dagRunId===n.dagRunId)?null:u.jsx("option",{value:n.dagRunId||"",children:n.dagRunId?`${n.dagRunId}(当前)`:"— 请选择 —"}),n.recoveryRuns.map(d=>u.jsx("option",{value:d.dagRunId,children:Cw(d)},d.dagRunId))]}):u.jsx("input",{"data-testid":"recovery-run-input",value:n.dagRunId,disabled:s,onChange:d=>{n.setManualRunId(!0),n.setDagRunId(d.target.value.trim())},placeholder:"dag-run-id(节点恢复/完整重新执行)"}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:s,"data-testid":"recovery-run-manual-toggle",onClick:()=>{if(!n.manualRunId&&n.recoveryRuns.length>0){n.setManualRunId(!0);return}n.setManualRunId(!1),n.loadRecoveryRuns()},children:!n.manualRunId&&n.recoveryRuns.length>0?"手动输入运行 ID":"刷新并改用下拉"})]}),u.jsxs("label",{className:"field",children:[u.jsxs("span",{className:"muted",children:["起始节点 ID(从失败节点恢复)",n.recoveryNodesLoading?" · 加载节点…":""]}),!n.manualNodeId&&n.recoveryNodes.length>0?u.jsxs("select",{"data-testid":"recovery-node-select",value:n.fromNodeId,disabled:s||n.recoveryNodesLoading,onChange:d=>{n.setManualNodeId(!1),n.setFromNodeId(d.target.value)},children:[n.recoveryNodes.some(d=>d.nodeId===n.fromNodeId)?null:u.jsx("option",{value:n.fromNodeId||"",children:n.fromNodeId?`${n.fromNodeId}(当前)`:"— 请选择 —"}),n.recoveryNodes.map(d=>u.jsx("option",{value:d.nodeId,children:Rw(d)},d.nodeId))]}):u.jsx("input",{"data-testid":"recovery-node-input",value:n.fromNodeId,disabled:s,onChange:d=>{n.setManualNodeId(!0),n.setFromNodeId(d.target.value.trim())},placeholder:"例如 review-verdict-recovery-pi"}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:s,"data-testid":"recovery-node-manual-toggle",onClick:()=>{if(!n.manualNodeId&&n.recoveryNodes.length>0){n.setManualNodeId(!0);return}n.setManualNodeId(!1),n.loadRecoveryNodes(n.dagRunId)},children:!n.manualNodeId&&n.recoveryNodes.length>0?"手动输入节点 ID":"刷新并改用下拉"})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"恢复原因(已按 run/节点失败事实自动预填,可编辑)"}),u.jsx("textarea",{"data-testid":"recovery-reason",value:n.recoveryReason,disabled:s,rows:4,onChange:d=>{n.setRecoveryReasonTouched(!0),n.setRecoveryReason(d.target.value)},placeholder:"将自动预填 operator-recovery / run / from-node / detail"}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:s,"data-testid":"recovery-reason-refresh",onClick:()=>{n.setRecoveryReasonTouched(!1),n.setRecoveryReason(n.buildCurrentRecoveryReason(n.recoveryConfirm?.label))},children:"重新预填原因"})]}),u.jsxs("div",{className:"recovery-lane","data-testid":"recovery-lane-dag",children:[u.jsx("h3",{children:"DAG 运行恢复"}),u.jsx("p",{className:"muted",children:"针对 `.harness/dag-runs` 的 Agent DAG 运行。橙色为当前建议;带 * 需确认原因。"}),u.jsxs("div",{className:"recovery-cta-row","data-testid":"recovery-cta-row-dag",children:[n.recoveryLanes.dag.map(d=>{const m=d.id===n.recommendedCtaId;return u.jsxs("button",{type:"button",className:m?"btn btn-primary":"btn btn-secondary",disabled:s,title:d.guide,"aria-pressed":n.recoveryConfirm?.id===d.id?!0:void 0,"data-testid":`recovery-cta-${d.id}`,"data-recommended":m?"true":void 0,onClick:()=>{n.handleRecoveryCta(d)},children:[d.label,d.requiresReason?" *":""]},d.id)}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:!n.dagRunId.trim(),"data-testid":"recovery-dag-preview",title:"在本页侧栏预览,可关闭返回",onClick:()=>{if(!n.dagRunId.trim()){t.setOpError("侧栏预览需要先选择 DAG 运行 ID");return}n.setInspectSplitOpen(!0)},children:"侧栏预览"})]}),n.recoveryReport?u.jsxs("div",{className:"recovery-report","data-testid":"recovery-report",children:[u.jsxs("div",{className:"recovery-report-header",children:[u.jsx("h3",{children:"交接报告摘要"}),u.jsx("button",{type:"button",className:"btn btn-ghost","data-testid":"recovery-report-close",onClick:()=>n.setRecoveryReport(null),children:"关闭"})]}),u.jsxs("dl",{className:"recovery-report-facts",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"运行"}),u.jsx("dd",{children:u.jsx("code",{children:n.recoveryReport.runId})})]}),n.recoveryReport.title?u.jsxs("div",{children:[u.jsx("dt",{children:"标题"}),u.jsx("dd",{children:n.recoveryReport.title})]}):null,u.jsxs("div",{children:[u.jsx("dt",{children:"状态"}),u.jsx("dd",{children:n.recoveryReport.status??"—"})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"失败分类"}),u.jsx("dd",{children:n.recoveryReport.category??"—"})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"建议"}),u.jsx("dd",{children:n.recoveryReport.recommendation??"暂无结构化建议"})]})]}),u.jsxs("p",{className:"muted",children:["完整 Markdown 可用 CLI:",u.jsxs("code",{children:["loop-agent dag report --run-id"," ",n.recoveryReport.runId," --markdown"]})]})]}):null,u.jsx(H3,{lane:"dag",cta:n.recoveryConfirm,...c})]}),u.jsxs("div",{className:"recovery-lane","data-testid":"recovery-lane-worker",children:[u.jsx("h3",{children:"Worker Task 重排队"}),u.jsx("p",{className:"muted",children:"针对 agent-worker Task Pool,不是 DAG run。需要 Task ID;Feature ID 可选。"}),u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"Task ID(Worker 重排队必填)"}),u.jsx("input",{"data-testid":"recovery-worker-task-id",value:a.taskId,disabled:s,onChange:d=>a.setTaskId(d.target.value.trim()),placeholder:"harness / worker task-id"})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"Feature ID(可选)"}),u.jsx("input",{"data-testid":"recovery-feature-id",value:n.featureId,disabled:s,onChange:d=>n.setFeatureId(d.target.value.trim()),placeholder:"feature-id"})]}),u.jsx("div",{className:"recovery-cta-row","data-testid":"recovery-cta-row-worker",children:n.recoveryLanes.worker.length>0?n.recoveryLanes.worker.map(d=>u.jsxs("button",{type:"button",className:d.id===n.recommendedCtaId?"btn btn-primary":"btn btn-secondary",disabled:s,title:d.guide,"data-testid":`recovery-cta-${d.id}`,"data-recommended":d.id===n.recommendedCtaId?"true":void 0,onClick:()=>{n.handleRecoveryCta(d)},children:[d.label,d.requiresReason?" *":""]},d.id)):u.jsx("p",{className:"muted","data-testid":"recovery-worker-unavailable",children:"当前事实分类下不提供 Worker 重排队。"})}),u.jsx(H3,{lane:"worker",cta:n.recoveryConfirm,...c})]}),u.jsx("div",{className:"recovery-cta-row","data-testid":"recovery-cta-row",hidden:!0,children:n.recoveryCtas.map(d=>u.jsx("span",{children:d.id},d.id))}),n.observeLinkMessage?u.jsxs("p",{className:"muted",children:["[",_9[n.observeLinkStatus],"]"," ",n.observeLinkMessage]}):null,n.observeUrl?u.jsx("p",{className:"muted",children:u.jsx("a",{className:"external-link",href:n.observeUrl,children:n.observeUrl})}):null]})}function RL(e){const{health:t,readiness:n,healthError:a,layers:s,setupBlocked:o,degraded:c}=e;return u.jsxs(u.Fragment,{children:[u.jsxs("section",{className:"panel","aria-labelledby":"settings-title",children:[u.jsx("h2",{id:"settings-title",children:"设置"}),u.jsxs("dl",{className:"kv",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"产品"}),u.jsx("dd",{children:t?.productName??"Loop Operator Console"})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"仓库根目录"}),u.jsx("dd",{children:u.jsx("code",{children:t?.repoRoot??"—"})})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"仓库指纹"}),u.jsx("dd",{children:u.jsx("code",{title:t?.repoFingerprint??void 0,children:t?.repoFingerprint?`${t.repoFingerprint.slice(0,12)}…`:"—"})})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Pi 就绪"}),u.jsxs("dd",{children:[u.jsxs("code",{children:[K3[n]??n,"(",n,")"]}),o?u.jsx("p",{className:"muted",children:"Pi SDK / 认证 / 模型未就绪。不提供纯表单兜底。请前往「模型与认证」。"}):c?u.jsx("p",{className:"muted",children:"Pi 暂时降级:仍可恢复草稿与需求访谈。"}):null]})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"Inspect"}),u.jsxs("dd",{children:[u.jsx("code",{children:"/inspect/"}),"(同一 Console 进程)"]})]})]}),a?u.jsx("p",{className:"error",children:a}):null]}),u.jsxs("section",{className:"panel","aria-labelledby":"layers-title",children:[u.jsx("h2",{id:"layers-title",children:"完成语义分层"}),u.jsx("p",{className:"muted",children:"MVP 不执行收尾提交;不显示「任务已关闭/已交付」。"}),u.jsxs("dl",{className:"kv","data-testid":"completion-layers",children:[u.jsxs("div",{children:[u.jsx("dt",{children:"命令"}),u.jsx("dd",{children:hu(s.command)})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"DAG 生命周期"}),u.jsx("dd",{children:hu(s.dag)})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"最终验证"}),u.jsx("dd",{children:hu(s.verification)})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"晋升"}),u.jsx("dd",{children:hu(s.promote)})]}),u.jsxs("div",{children:[u.jsx("dt",{children:"任务关闭"}),u.jsx("dd",{children:"不可用(MVP)"})]})]})]})]})}function NL(e){const t=(e??"").trim().toLowerCase();return t?t.includes("running")||t==="in_progress"||t==="active"?"running":t.includes("fail")||t.includes("error")||t==="blocked"?"failed":t.includes("finish")||t.includes("success")||t==="done"||t==="ok"?"finished":t.includes("skip")?"skipped":"pending":"pending"}function AL(e){const t=String(e.nodeId??e.id??"").trim();return{nodeId:t,label:String((e.label??e.name??t)||"未命名节点"),status:String(e.status??""),rank:typeof e.rank=="string"?e.rank:void 0,startedAt:typeof e.startedAt=="string"?e.startedAt:void 0,durationMs:typeof e.durationMs=="number"?e.durationMs:void 0,errorPreview:typeof e.errorPreview=="string"?e.errorPreview:void 0}}function Lh(e,t){if(!e)return null;const n=Date.parse(e);if(Number.isNaN(n))return null;const a=t-n;return a>=0?a:null}function IL(e,t=Date.now()){if(!e)return{total:0,finished:0,running:null,failed:null,terminal:!1,effectiveStatus:null,stalled:!1,currentNodeElapsedMs:null,runElapsedMs:null};const a=(Array.isArray(e.nodes)?e.nodes:[]).map(AL),s=a.map(S=>NL(S.status)),o=s.filter(S=>S==="finished"||S==="skipped").length,c=s.indexOf("running"),d=c>=0?a[c]:null,m=s.indexOf("failed"),h=m>=0?a[m]:null,p=String(e.effectiveStatus??e.status??"").toLowerCase(),b=_L.has(p),x=typeof e.startedAt=="string"?e.startedAt:void 0,y=typeof e.durationMs=="number"?e.durationMs:void 0;return{total:a.length,finished:o,running:d,failed:h,terminal:b,effectiveStatus:p||null,stalled:p==="running-suspected-stall",currentNodeElapsedMs:d?.durationMs??Lh(d?.startedAt,t),runElapsedMs:b?y??Lh(x,t):Lh(x,t)}}const _L=new Set(["finished","failed","partial_failed","superseded","abandoned"]);function U3(e){if(e==null||!Number.isFinite(e)||e<0)return"—";const t=Math.floor(e/1e3),n=Math.floor(t/3600),a=Math.floor(t%3600/60),s=t%60;return n>0?`${n} 时 ${a} 分`:a>0?`${a} 分 ${s} 秒`:`${s} 秒`}const ML=5e3;function OL(e){const[t,n]=w.useState(null);return w.useEffect(()=>{const a=e.trim();if(n(null),!a)return;const s=new AbortController;let o;const c=async()=>{try{const d=await fetch(Cr(`/api/dag-runs/${encodeURIComponent(a)}`),{credentials:"same-origin",signal:s.signal});if(!d.ok)return;const m=await d.json();if(s.signal.aborted)return;n(m),qh(m)&&o!==void 0&&(window.clearInterval(o),o=void 0)}catch{}};return c(),o=window.setInterval(()=>{c()},ML),()=>{s.abort(),o!==void 0&&window.clearInterval(o)}},[e]),w.useMemo(()=>IL(t),[t])}function DL(e){const t=[`fragments=${e.fragmentCount}`,`canonical=${e.canonicalRequirementCount}`,`context-only=${e.contextOnlyCount}`,`duplicate=${e.duplicateCount}`,`unresolved=${e.unresolvedCount}`,`conflict=${e.conflictCount}`];return e.bindingSchemaVersion===2&&(t.push(`binding=v2${e.stale?" · STALE(输入漂移)":""}`),e.ledgerSha256&&t.push(`ledgerSha256=${e.ledgerSha256}`),e.inputDigest&&t.push(`inputDigest=${e.inputDigest}`)),t.join(" ")}function Ip(e){const{ledgerLoading:t=!1,ledgerError:n=null,ledgerSummary:a=null}=e;return u.jsxs("div",{className:"contract-checks","data-testid":"ledger-summary-block","aria-busy":t||void 0,"aria-labelledby":"ledger-summary-heading",children:[u.jsx("h4",{id:"ledger-summary-heading",children:"Source fidelity ledger"}),t?u.jsxs("p",{className:"muted",role:"status",children:[u.jsx("span",{className:"sr-only",children:"ledger 加载中"}),"加载中…"]}):n?u.jsxs("p",{className:"muted",role:"alert",children:["ledger 只读接口失败:",n,"(安全降级,不展示敏感内容)"]}):!a||a.present!==!0?u.jsx("p",{className:"empty",role:"status",children:"无 source fidelity ledger(任务无引用或 ledger 缺失,不伪造计数)"}):u.jsxs(u.Fragment,{children:[u.jsxs("p",{children:[u.jsx("strong",{children:"gate"}),": ",R9(a.gateStatus),a.bindingSchemaVersion===2?u.jsxs(u.Fragment,{children:[" ",u.jsxs("code",{"data-testid":"ledger-binding-version",children:["binding v2",a.stale?" · STALE":""]})]}):null,a.failureCode?u.jsxs(u.Fragment,{children:[" ",u.jsx("code",{"data-testid":"ledger-failure-code",children:a.failureCode})]}):null]}),u.jsx("pre",{className:"cmd","data-testid":"ledger-summary",children:DL(a)}),a.exclusions.length>0?u.jsx("ul",{"data-testid":"ledger-exclusions",children:a.exclusions.slice(0,10).map(s=>u.jsxs("li",{className:"muted",children:[u.jsx("code",{children:s.fragmentId}),": ",s.reason]},s.fragmentId))}):null]})]})}function jL(e){const{busy:t,taskId:n,confirmationId:a,confirmationDetails:s,ledgerLoading:o=!1,ledgerError:c=null,ledgerSummary:d=null,runAction:m,onConfirmAndRun:h}=e;return u.jsxs("div",{"data-testid":"panel-dag-confirm",children:[u.jsx("h3",{children:"DAG 确认(§5.5)"}),u.jsxs("ul",{className:"checklist",children:[u.jsx("li",{children:"源绑定(source)"}),u.jsx("li",{children:"Writer 写集范围(writer-scope)"}),u.jsx("li",{children:"验证命令(verification)"}),u.jsx("li",{children:"人工门禁(human-gates)"})]}),s?u.jsx("pre",{className:"cmd",children:JSON.stringify(s,null,2).slice(0,4e3)}):null,u.jsx(Ip,{ledgerLoading:o,ledgerError:c,ledgerSummary:d}),u.jsxs("div",{className:"cta-row",children:[u.jsx("button",{type:"button",className:"btn btn-primary",disabled:t,onClick:()=>{m("prepareDagConfirmation",{taskId:n,dagHandle:`${n}.dag.json`,profile:"auto"})},children:"生成 DAG 并准备确认"}),u.jsx("button",{type:"button",className:"btn btn-primary",disabled:t||!a,onClick:h,children:"开始运行"})]}),a?u.jsxs("p",{className:"muted",children:["确认 ID: ",u.jsx("code",{children:a})]}):null]})}function LL(e){const{busy:t,degraded:n,taskId:a,assessmentId:s,contractValidateOk:o,contractValidateSummary:c,contractDiffSummary:d,contractApplied:m,spineOk:h,ledgerLoading:p=!1,ledgerError:b=null,ledgerSummary:x=null,onRerunPreflight:y,onApplyContract:S,onRetrySpine:T}=e;return u.jsxs("div",{"data-testid":"panel-contract",children:[u.jsx("h3",{children:"契约落地"}),u.jsx("p",{className:"muted",children:"进入本步后自动跑确定性校验与差异(非 AI 代判)。写入仓库仍需你人工确认一次;应用成功后会自动跑 Spine 审计。"}),u.jsxs("p",{className:"muted",children:["评估 ID: ",u.jsx("code",{children:s??"—"})]}),u.jsxs("div",{className:"contract-checks",children:[u.jsxs("p",{children:[u.jsx("strong",{children:"校验"}),":"," ",o===null?t?"进行中…":"等待开始":o?"通过":"未通过"]}),c?u.jsx("pre",{className:"cmd","data-testid":"contract-validate-summary",children:c}):null,u.jsxs("p",{children:[u.jsx("strong",{children:"差异"}),d?"":":尚未拉取"]}),d?u.jsx("pre",{className:"cmd","data-testid":"contract-diff-summary",children:d}):null,m?u.jsxs("p",{children:[u.jsx("strong",{children:"Spine"}),":"," ",h===null?"待检查":h?"通过":"未通过"]}):null]}),u.jsx(Ip,{ledgerLoading:p,ledgerError:b,ledgerSummary:x}),u.jsxs("div",{className:"cta-row",children:[u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:t||!a.trim(),onClick:y,children:"重新校验"}),u.jsx("button",{type:"button",className:"btn btn-primary","data-testid":"contract-apply",disabled:t||n||!s||o!==!0||m,onClick:S,children:"确认并应用契约"}),m&&h===!1?u.jsx("button",{type:"button",className:"btn btn-primary",disabled:t,onClick:T,children:"重试 Spine"}):null]})]})}function zL(e){const{busy:t,taskKind:n,onTaskKindChange:a,workflowHint:s,prd:o,engineering:c,onEngineeringChange:d,onImport:m}=e,h=t||o.prdFileReading;return u.jsxs("div",{"data-testid":"panel-import-prd",children:[u.jsx("h3",{children:"导入需求"}),u.jsx("p",{className:"muted",children:"粘贴、选择或拖入一份或多份 PRD / 需求 Markdown。多文件会分别归档到 source/references,并合成一份可编辑正文。创建前可继续编辑。 系统会对 PRD 做确定性/语义结构化;工程边界(路径与验证)须人类确认,不会由模型编造。"}),u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"流程类型"}),u.jsx("select",{"data-testid":"workflow-kind-select",value:n,disabled:t||o.prdFileReading,onChange:p=>a(p.target.value),children:Bh.map(p=>u.jsx("option",{value:p.kind,children:p.label},p.kind))})]}),u.jsxs("p",{className:"workflow-hint","data-testid":"workflow-kind-hint",children:[s," · taskKind=",u.jsx("code",{children:n})]}),u.jsxs("div",{className:`prd-drop-zone${o.prdDragOver?" is-dragover":""}`,"data-testid":"prd-drop-zone","data-dragover":o.prdDragOver?"true":"false",onDragEnter:p=>o.onDragEnter(p,h),onDragOver:p=>{p.preventDefault(),p.stopPropagation()},onDragLeave:o.onDragLeave,onDrop:p=>o.onDrop(p,h),children:[u.jsxs("div",{className:"prd-upload-toolbar",children:[u.jsxs("label",{className:`btn btn-ghost prd-upload-btn${h?" is-disabled":""}`,children:["选择需求文档",u.jsx("input",{type:"file",accept:J9,multiple:!0,hidden:!0,disabled:h,"data-testid":"prd-file-input",onChange:p=>{const b=p.currentTarget;o.loadPrdFromFiles(b.files).finally(()=>{b.value=""})}})]}),u.jsxs("span",{className:"muted prd-upload-hint",children:["支持多文件 .md / .markdown / .txt,单文件最大"," ",Uh(Hh),",最多 ",Vu," 个"]}),o.prdDocuments.length>0?u.jsx("button",{type:"button",className:"btn btn-ghost","data-testid":"prd-recompose",disabled:h,onClick:o.recomposeDocuments,children:"按文件重新合成"}):null]}),o.prdDocuments.length>0?u.jsx("ul",{className:"prd-file-list","data-testid":"prd-file-list",children:o.prdDocuments.map((p,b)=>u.jsxs("li",{className:b===o.prdPrimaryIndex?"is-primary":void 0,"data-testid":`prd-file-item-${b}`,children:[u.jsxs("span",{className:"prd-file-item-name",children:[p.fileName,b===o.prdPrimaryIndex?u.jsx("span",{className:"prd-file-primary-tag",children:"主"}):null,u.jsxs("span",{className:"muted",children:[" ","· ",Uh(p.sourceBytes)]})]}),u.jsxs("span",{className:"prd-file-item-actions",children:[u.jsx("button",{type:"button",className:"btn btn-ghost",disabled:h||b===o.prdPrimaryIndex,onClick:()=>o.setPrimaryDocument(b),children:"设为主"}),u.jsx("button",{type:"button",className:"btn btn-ghost",disabled:h||b===0,onClick:()=>o.moveDocument(b,-1),children:"上移"}),u.jsx("button",{type:"button",className:"btn btn-ghost",disabled:h||b===o.prdDocuments.length-1,onClick:()=>o.moveDocument(b,1),children:"下移"}),u.jsx("button",{type:"button",className:"btn btn-ghost",disabled:h,onClick:()=>o.removeDocument(b),children:"移除"})]})]},`${p.fileName}-${b}`))}):null,o.prdDocuments.length>0?u.jsxs("div",{className:"prd-file-meta",children:[u.jsxs("span",{children:["分卷=上传原件(将分别归档);正文=本会话采用稿",o.prdComposedDirty?"(已手动编辑)":""]}),u.jsx("button",{type:"button",className:"btn btn-ghost prd-file-clear","data-testid":"prd-file-clear",disabled:h,onClick:o.clearDocuments,children:"清除来源列表"})]}):null,o.prdDragOver?u.jsx("p",{className:"prd-drop-hint","data-testid":"prd-drop-hint",children:"释放以载入"}):null,u.jsxs("label",{className:"field prd-text-field",children:[u.jsx("span",{className:"muted",children:"PRD Markdown"}),u.jsx("textarea",{rows:10,value:o.prdText,disabled:h,"data-testid":"prd-textarea",onChange:p=>o.onPrdTextChange(p.target.value)})]})]}),o.prdFileError?u.jsx("p",{className:"prd-file-error",role:"alert","aria-live":"polite","data-testid":"prd-file-error",children:o.prdFileError}):null,u.jsxs("details",{className:"engineering-boundary","data-testid":"engineering-boundary",children:[u.jsx("summary",{children:"工程边界(可选,人类确认)"}),u.jsxs("p",{className:"muted",children:["逗号或换行分隔。留空则 intake 后进入访谈补齐;不会自动填",u.jsx("code",{children:"src/worker/console/**"})," 模板。"]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"allowedPaths"}),u.jsx("textarea",{rows:2,value:c.allowedPathsText,disabled:h,"data-testid":"prd-allowed-paths",placeholder:"src/**, test/**",onChange:p=>d({allowedPathsText:p.target.value})})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"forbiddenPaths"}),u.jsx("textarea",{rows:2,value:c.forbiddenPathsText,disabled:h,"data-testid":"prd-forbidden-paths",placeholder:".harness/**, node_modules/**",onChange:p=>d({forbiddenPathsText:p.target.value})})]}),u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"verifyCommands(label:command 或纯命令)"}),u.jsx("textarea",{rows:2,value:c.verifyCommandsText,disabled:h,"data-testid":"prd-verify-commands",placeholder:"typecheck:npm run typecheck",onChange:p=>d({verifyCommandsText:p.target.value})})]})]}),u.jsx("div",{className:"cta-row",children:u.jsxs("button",{type:"button",className:`btn btn-primary${t?" is-loading":""}`,disabled:t||o.prdFileReading||!o.prdText.trim(),"aria-busy":t||void 0,onClick:m,children:[t?u.jsx("span",{className:"spinner","aria-hidden":"true"}):null,t?"导入中…":"导入并创建任务"]})})]})}function BL(e){const{busy:t,taskId:n,taskTitle:a,taskKind:s,sessionId:o,question:c,answerText:d,onAnswerTextChange:m,draftSummary:h,assessmentId:p,runAction:b}=e;return u.jsxs("div",{"data-testid":"panel-interview",children:[u.jsx("h3",{children:"需求访谈(grill-me)"}),u.jsx("p",{className:"muted",children:"一次一问;也可跳过:系统会按推荐补齐草稿并签发评估,随后进入校验。 访谈中不可应用契约 / 运行 DAG / 对账。"}),h?u.jsx("pre",{className:"cmd","data-testid":"draft-summary",children:JSON.stringify(h,null,2)}):null,u.jsxs("div",{className:"cta-row",style:{marginBottom:"0.75rem"},children:[!o||!c?u.jsx("button",{type:"button",className:"btn btn-primary",disabled:t||!n.trim(),onClick:()=>{b("interviewStart",{taskId:n,title:a,taskKind:s})},children:"开始 / 继续访谈"}):null,u.jsx("button",{type:"button",className:"btn btn-ghost","data-testid":"interview-skip",disabled:t||!n.trim(),onClick:()=>{b("interviewSkip",{taskId:n,title:a,taskKind:s})},children:"跳过访谈"})]}),o&&c?u.jsxs("div",{className:"interview-card",children:[u.jsxs("p",{className:"interview-q",children:[u.jsx("strong",{children:c.id})," · 风险=",Y3[c.risk??""]??c.risk??"—"]}),u.jsx("p",{children:c.text}),c.recommendation?u.jsxs("p",{className:"muted",children:["推荐:",c.recommendation]}):null,u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"你的回答(覆盖推荐)"}),u.jsx("textarea",{rows:3,value:d,disabled:t,onChange:x=>m(x.target.value)})]}),u.jsxs("div",{className:"cta-row",children:[u.jsx("button",{type:"button",className:"btn btn-primary",disabled:t,onClick:()=>{b("interviewTurn",{sessionId:o,questionId:c.id,response:"accept-recommendation"}).then(()=>m(""))},children:"接受推荐"}),u.jsx("button",{type:"button",className:"btn btn-primary",disabled:t||!d.trim(),onClick:()=>{b("interviewTurn",{sessionId:o,questionId:c.id,response:"override",text:d}).then(()=>m(""))},children:"提交自定义回答"}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:t||c.risk==="high",onClick:()=>{b("interviewTurn",{sessionId:o,questionId:c.id,response:"defer",text:d||c.recommendation}).then(()=>m(""))},children:"暂缓(非高风险)"})]})]}):null,p?u.jsxs("p",{className:"muted",children:["评估 ID: ",u.jsx("code",{children:p})]}):null]})}function qL({progress:e}){const t=e.total>0?Math.round(e.finished/e.total*100):0;return u.jsxs("div",{className:"run-progress","data-testid":"run-progress",children:[u.jsxs("div",{className:"run-progress-head",children:[u.jsxs("b",{children:["节点进度 ",e.finished,"/",e.total||"—",e.total>0?`(${t}%)`:""]}),u.jsx("span",{className:`run-progress-status${e.stalled?" is-stalled":""}`,"data-testid":"run-progress-status",children:e.effectiveStatus??"未知状态"})]}),u.jsx("div",{className:"run-progress-bar",role:"progressbar","aria-valuemin":0,"aria-valuemax":e.total,"aria-valuenow":e.finished,"aria-label":"DAG 节点完成进度",children:u.jsx("span",{style:{width:`${t}%`}})}),u.jsx("p",{className:"run-progress-current","data-testid":"run-progress-current",children:e.running?u.jsxs(u.Fragment,{children:["当前节点:",u.jsx("strong",{children:e.running.label}),"(已运行 ",U3(e.currentNodeElapsedMs),")"]}):e.terminal?u.jsxs(u.Fragment,{children:["运行已结束(总时长 ",U3(e.runElapsedMs),")"]}):u.jsx(u.Fragment,{children:"暂无正在运行的节点"})}),e.stalled?u.jsx("p",{className:"run-progress-stall","data-testid":"run-progress-stall",children:"疑似停滞:超过阈值没有实质进展。可打开检视查看节点活动,或到恢复页 使用协作中止 / 诊断入口判断是否继续等待。"}):null,e.failed?u.jsxs("p",{className:"run-progress-failed","data-testid":"run-progress-failed",children:["失败节点:",u.jsx("strong",{children:e.failed.label}),e.failed.errorPreview?` — ${e.failed.errorPreview}`:""]}):null]})}function HL(e){const{busy:t,confirmationId:n,operationId:a,dagRunId:s,observeBusy:o,ledgerLoading:c=!1,ledgerError:d=null,ledgerSummary:m=null,sseLog:h,progress:p,runAction:b,onStopFollow:x,onShowInspectSplit:y,onOpenInspectSplit:S}=e;return u.jsxs("div",{"data-testid":"panel-run",children:[u.jsx("h3",{children:"运行详情"}),u.jsxs("div",{className:"meta-row",children:[u.jsxs("div",{children:["操作 ID: ",u.jsx("code",{children:a??"—"})]}),u.jsxs("div",{children:["确认 ID: ",u.jsx("code",{children:n??"—"})]})]}),u.jsx(Ip,{ledgerLoading:c,ledgerError:d,ledgerSummary:m}),u.jsxs("div",{className:"cta-row",children:[u.jsx("button",{type:"button",className:"btn btn-primary",disabled:t||!n,onClick:()=>{b("runDag",{confirmationId:n},{clientRequestId:$u("run")})},children:"重新运行"}),u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:x,children:"停止跟随日志"}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:!s.trim(),onClick:y,children:"打开检视"}),u.jsx("button",{type:"button",className:"btn btn-ghost",disabled:o||!s.trim(),title:"在本页侧栏预览当前运行的 DAG,可关闭返回",onClick:S,children:"侧栏预览"})]}),p?u.jsx(qL,{progress:p}):null,u.jsxs("details",{className:"run-sse-log",children:[u.jsx("summary",{children:"原始事件日志(最近 80 条)"}),u.jsx("pre",{className:"cmd","data-testid":"sse-log",children:h.join(`
|
|
407
|
-
`)||"(尚无事件)"})]})]})}const ox=[2e3,2e3,4e3,4e3,8e3,8e3,15e3,15e3,3e4,3e4];function UL(e,t){if(e===!0)return{kind:"own"};if(e===!1)return{kind:"clear"};const n=ox[t];return n===void 0?{kind:"give-up"}:{kind:"retry",delayMs:n}}ox.reduce((e,t)=>e+t,0);function FL(){return{baseline:null,ownedRunId:"",pendingSelection:""}}function $L(e,t){const n=e.task===void 0,a=!n&&e.task!==t.task,s=!n&&e.dispatch!==t.dispatchId,o={...e,task:t.task,dispatch:t.dispatchId,pendingSelection:""};if(a)return o.baseline=null,o.ownedRunId="",{state:o,observation:{action:"reset-selection"}};if(s&&(o.ownedRunId="",t.selectedRunId))return o.baseline=t.selectedRunId,{state:o,observation:{action:"invalidate-selection"}};const c=t.selectedRunId;return c&&c!==o.ownedRunId?(o.pendingSelection=c,{state:o,observation:{action:"verify-ownership"}}):{state:o,observation:{action:c?"idle":"probe"}}}function F3(e){return{...e,baseline:null}}function PL(e,t){return{...e,baseline:t??""}}function GL(e,t){return!t.ok||!t.dagRunId?{state:e,acceptedRunId:null}:e.baseline===null||t.dagRunId===e.baseline?{state:e,acceptedRunId:null}:{state:{...e,ownedRunId:t.dagRunId},acceptedRunId:t.dagRunId}}function VL(e,t){return t?{state:{...e,ownedRunId:e.pendingSelection,pendingSelection:""},clearSelection:!1}:{state:{...e,ownedRunId:"",pendingSelection:"",baseline:null},clearSelection:!0}}async function $3(e){try{const{status:t,body:n}=await Ll("observeLink",{taskId:e});if(t>=400||n.ok===!1)return{ok:!1};const a=n.result??{};return{ok:!0,dagRunId:(typeof a.dagRunId=="string"?a.dagRunId.trim():"")||null}}catch{return{ok:!1}}}async function KL(e,t){try{const n=await fetch(Cr(`/api/dag-runs/${encodeURIComponent(e)}`),{credentials:"same-origin"});if(n.status===404)return!1;if(!n.ok)return null;const a=await n.json(),s=typeof a.taskId=="string"?a.taskId.trim():"";return s?s===t.trim():null}catch{return null}}function YL(e){const{shell:t,actions:n,wizard:a,prd:s,recovery:o}=e,{busy:c,step:d,setupBlocked:m,degraded:h}=t,p=w.useRef(FL()),b=w.useRef(0),[x,y]=w.useState(""),S=w.useCallback(C=>{const M=++b.current;p.current=F3(p.current);const I=async P=>{const U=await $3(C);if(b.current===M){if(U.ok){p.current=PL(p.current,U.dagRunId);return}P>0&&window.setTimeout(()=>{I(P-1)},1500)}};I(8)},[]);w.useEffect(()=>{if(d!=="dag-confirm")return;const C=a.taskId.trim();if(!C){b.current+=1,p.current=F3(p.current);return}S(C)},[d,a.taskId,S]),w.useEffect(()=>{if(d!=="run")return;const C=a.taskId.trim();if(!C)return;const M=$L(p.current,{task:C,dispatchId:n.operationId??null,selectedRunId:o.dagRunId.trim()});switch(p.current=M.state,y(M.state.ownedRunId),M.observation.action){case"reset-selection":{o.setManualRunId(!1),o.setDagRunId(""),S(C);return}case"invalidate-selection":{o.setManualRunId(!1),o.setDagRunId("");return}case"verify-ownership":{const I=M.state.pendingSelection;let P=!1,U=0;const N=async z=>{if(P)return;const X=await KL(I,C);if(P)return;const B=UL(X,z);if(B.kind==="own"||B.kind==="clear"){const $=VL(p.current,B.kind==="own");p.current=$.state,y($.state.ownedRunId),$.clearSelection&&(o.setManualRunId(!1),o.setDagRunId(""),S(C));return}B.kind==="retry"&&(U=window.setTimeout(()=>{N(z+1)},B.delayMs))};return N(0),()=>{P=!0,window.clearTimeout(U)}}case"idle":return;case"probe":{p.current.baseline===null&&S(C);let I=!1,P=0,U=0;const N=async()=>{if(I)return;if(p.current.baseline===null){U+=1,U<120&&(P=window.setTimeout(()=>{N()},1e3));return}const z=await $3(C);if(I)return;U+=1;const X=GL(p.current,z);if(p.current=X.state,X.acceptedRunId){y(X.state.ownedRunId),o.setManualRunId(!0),o.setDagRunId(X.acceptedRunId);return}U<120&&(P=window.setTimeout(()=>{N()},2500))};return P=window.setTimeout(()=>{N()},1200),()=>{I=!0,window.clearTimeout(P)}}}},[d,n.operationId,a.taskId,o.dagRunId,o.setManualRunId,o.setDagRunId,S]);const T=o.dagRunId===x?o.dagRunId:"",A=OL(d==="run"?T:"");return u.jsxs("section",{className:"panel task-ops","aria-labelledby":"task-ops-title",children:[u.jsx("h2",{id:"task-ops-title",children:"任务操作"}),u.jsx("p",{className:"panel-lead",children:"按 Happy Path 推进;契约落地一步内自动校验,人工确认写入。"}),u.jsx("ol",{className:"wizard-steps","data-testid":"wizard-steps",children:a.wizardSteps.map((C,M)=>u.jsxs("li",{"data-active":d===C.id,"data-done":M<a.stepIndex,children:[u.jsx("span",{className:"step-index",children:String(M+1).padStart(2,"0")}),u.jsx("span",{className:"step-label",children:C.label})]},C.id))}),u.jsxs("label",{className:"field",children:[u.jsx("span",{className:"muted",children:"任务 ID"}),u.jsx("input",{"data-testid":"task-id-input",value:a.taskId,disabled:c||m||d==="import-prd",placeholder:d==="import-prd"?"导入需求后自动生成":"task-id",onChange:C=>a.setTaskId(C.target.value.trim())})]}),a.taskTitle?u.jsxs("p",{className:"workflow-hint","data-testid":"task-title-chip",children:["任务名称:",a.taskTitle]}):null,d!=="import-prd"&&!m?u.jsxs("p",{className:"workflow-hint","data-testid":"workflow-kind-chip",children:["当前流程:",a.workflowMeta.label," ·"," ",u.jsx("code",{children:a.taskKind})]}):null,m||d==="setup"?u.jsxs("div",{className:"empty-state","data-testid":"setup-gate",children:[u.jsx("p",{className:"empty-title",children:"需要先完成设置"}),u.jsx("p",{className:"muted",children:"请先在「模型与认证」完成 Pi 就绪,再导入需求与访谈。"}),u.jsxs("div",{className:"cta-row",children:[u.jsx("button",{type:"button",className:"btn btn-primary",disabled:c,onClick:()=>{t.selectNav("models"),n.runAction("refreshReadiness",{}).then(()=>t.loadHealth())},children:"刷新就绪状态"}),u.jsx("button",{type:"button",className:"btn btn-primary",disabled:c,onClick:()=>{n.runAction("doctor",{})},children:"运行诊断"}),u.jsx("pre",{className:"cmd",children:V3})]})]}):u.jsxs("div",{className:"wizard-body","data-testid":"wizard-body",children:[d==="import-prd"&&u.jsx(zL,{busy:c,taskKind:a.taskKind,onTaskKindChange:a.setTaskKind,workflowHint:a.workflowMeta.hint,prd:s,engineering:a.engineering,onEngineeringChange:a.setEngineering,onImport:()=>{a.importPrdAndCreate()}}),d==="interview"&&u.jsx(BL,{busy:c,taskId:a.taskId,taskTitle:a.taskTitle,taskKind:a.taskKind,sessionId:a.sessionId,question:a.question,answerText:a.answerText,onAnswerTextChange:a.setAnswerText,draftSummary:a.draftSummary,assessmentId:a.assessmentId,runAction:n.runAction}),d==="contract"&&u.jsx(LL,{busy:c,degraded:h,taskId:a.taskId,assessmentId:a.assessmentId,contractValidateOk:a.contractValidateOk,contractValidateSummary:a.contractValidateSummary,contractDiffSummary:a.contractDiffSummary,contractApplied:a.contractApplied,spineOk:a.spineOk,ledgerLoading:a.ledgerLoading,ledgerError:a.ledgerError,ledgerSummary:a.ledgerSummary,onRerunPreflight:()=>{a.runContractPreflight(!0)},onApplyContract:()=>{a.applyContractThenSpine()},onRetrySpine:()=>{a.retrySpineOnly()}}),d==="dag-confirm"&&u.jsx(jL,{busy:c,taskId:a.taskId,confirmationId:n.confirmationId,confirmationDetails:n.confirmationDetails,ledgerLoading:a.ledgerLoading,ledgerError:a.ledgerError,ledgerSummary:a.ledgerSummary,runAction:n.runAction,onConfirmAndRun:()=>{a.confirmAndRunDag()}}),d==="run"&&u.jsx(HL,{busy:c,confirmationId:n.confirmationId,operationId:n.operationId,dagRunId:T,observeBusy:t.observeBusy,ledgerLoading:a.ledgerLoading,ledgerError:a.ledgerError,ledgerSummary:a.ledgerSummary,sseLog:n.sseLog,progress:A,runAction:n.runAction,onStopFollow:n.stopFollowSse,onShowInspectSplit:()=>{T.trim()&&o.setInspectSplitOpen(!0)},onOpenInspectSplit:()=>{T.trim()&&o.openInspectSplit()}})]})]})}function WL(e,t){if(e.has(t))return e instanceof Set?e:new Set(e);const n=new Set(e);return n.add(t),n}function ZL(e,t,n){return n===!1?e instanceof Set?e:new Set(e):WL(e,t)}function El(e){return{hidden:!e,inert:!e,"aria-hidden":!e}}function XL(e){const{active:t,operateTab:n,shell:a,actions:s,wizard:o,prd:c,recovery:d}=e,[m,h]=w.useState(()=>new Set),p=ZL(m,n,t);return p!==m&&h(p),u.jsxs("section",{id:"workspace-operate",className:"workspace-pane workspace-pane--operate","aria-label":"操作工作区",hidden:!t,"aria-hidden":!t,inert:!t,tabIndex:t?-1:void 0,children:[p.has("tasks")?u.jsx("div",{className:"operate-subpane",...El(n==="tasks"),children:u.jsx(YL,{shell:a,actions:s,wizard:o,prd:c,recovery:d})}):null,p.has("recovery")?u.jsx("div",{className:"operate-subpane",...El(n==="recovery"),children:u.jsx(CL,{shell:a,recovery:d,wizard:o})}):null,p.has("night")?u.jsx("div",{className:"operate-subpane",...El(n==="night"),children:u.jsx(vL,{busy:a.busy,runAction:s.runAction,isActionSuccess:s.isActionSuccess,setOpError:a.setOpError})}):null,p.has("models")?u.jsx("div",{className:"operate-subpane",...El(n==="models"),children:u.jsx(EL,{busy:a.busy,readiness:a.readiness,readinessReport:a.readinessReport,health:a.health,onRefreshReadiness:()=>{s.runAction("refreshReadiness",{}).then(()=>a.loadHealth())},onSaveMatrix:async b=>{const x=await s.runAction("savePiModelMatrix",{matrix:b});return await a.loadHealth(),x}})}):null,p.has("settings")?u.jsx("div",{className:"operate-subpane",...El(n==="settings"),children:u.jsx(RL,{health:a.health,readiness:a.readiness,healthError:a.healthError,layers:a.layers,setupBlocked:a.setupBlocked,degraded:a.degraded})}):null]})}async function QL(){return await import("/inspect/inspect-workspace.js")}function zh(e,t){if(!t.active){e.setActive(!1),e.updateRoute(t.hash);return}e.updateRoute(t.hash),e.setActive(!0)}function JL(e){const{active:t,hash:n,onNavigate:a}=e,s=w.useRef(null),o=w.useRef(null),c=w.useRef(0),d=w.useRef(null),m=w.useRef(a);m.current=a;const h=w.useRef(t),p=w.useRef(n),b=w.useRef(e.workspaceId);h.current=t,p.current=n,b.current=e.workspaceId;const[x,y]=w.useState("idle"),[S,T]=w.useState(!1),A=(I,P,U)=>{I.then(N=>{if(P===c.current){if(!N){y("error");return}o.current=N,zh(N,{active:h.current,hash:p.current}),y("ready")}}).catch(()=>{P===c.current&&y("error")}).finally(()=>{d.current===I&&(d.current=null),U?.()})},C=async()=>{const I=await QL();if(!s.current)return null;typeof I.prepareInspectWorkspace=="function"&&await I.prepareInspectWorkspace(s.current);const P={active:h.current,hash:p.current};return o.current?(zh(o.current,P),o.current):I.mountInspectWorkspace(s.current,{hosted:!0,autoStart:!1,hash:P.hash,active:P.active,workspaceId:b.current??void 0,onNavigate:U=>m.current(U)})};w.useEffect(()=>{window.postMessage({type:"loop-console:workspace-scope",workspaceId:e.workspaceId??null},"*")},[e.workspaceId]),w.useEffect(()=>{if(o.current){zh(o.current,{active:t,hash:n});return}if(d.current||!t||x==="error")return;const I=++c.current;y("loading");const P=C();d.current=P,A(P,I)},[t,n,x]),w.useEffect(()=>()=>{o.current?.destroy(),o.current=null},[]);const M=()=>{if(S||d.current)return;T(!0),y("loading");const I=++c.current,P=C();d.current=P,A(P,I,()=>T(!1))};return u.jsxs("section",{id:"workspace-inspect",className:"workspace-pane workspace-pane--inspect","aria-label":"观测工作区",hidden:!t,"aria-hidden":!t,inert:!t,tabIndex:t?-1:void 0,children:[u.jsx("div",{ref:s,className:"inspect-workspace-root"}),x==="loading"&&!o.current?u.jsx("p",{className:"muted",role:"status",children:"正在加载观测工作区…"}):null,x==="error"?u.jsxs("div",{className:"workspace-inspect-error",role:"alert",children:[u.jsx("p",{children:"观测工作区加载失败。"}),u.jsx("button",{type:"button",className:"btn btn-secondary",disabled:S,onClick:M,children:"重试"})]}):null]})}function ez(e){const t=e==="chat"?"workspace-chat":e==="operate"?"workspace-operate":"workspace-inspect",n=document.getElementById(t);if(!(n instanceof HTMLElement))return;if(e==="chat"){n.focus();return}(n.querySelector('button:not([disabled]), [href], textarea, input, select, [tabindex]:not([tabindex="-1"])')??n).focus()}function tz(){const e=Y9(),t=Xj({}),n=w.useRef(()=>{}),a=w.useCallback(H=>n.current(H),[]),[s,o]=w.useState("chat"),[c,d]=w.useState(null),m=c?.workspaceId??t.unknownWorkspaceId,h=m?null:t.workspaceId,p=X9({shell:e,applyInterviewPayload:a,workspaceId:h}),b=mw(),x=Bw({shell:e,actions:p,prd:b}),y=Lw({shell:e,actions:p,wizard:x}),[S,T]=w.useState(()=>Kf(window.localStorage)),[A,C]=w.useState(()=>Mw(window.localStorage)),[M,I]=w.useState(()=>Xf(window.location,{lastOperateTab:Kf(window.localStorage)})?.sessionId??null);w.useEffect(()=>{n.current=x.applyInterviewPayload}),w.useEffect(()=>{m||t.loading||e.loadHealth(t.workspaceId)},[e.loadHealth,m,t.loading,t.workspaceId]);const P=w.useRef(h);w.useEffect(()=>{P.current!==h&&(P.current=h,p.resetForWorkspaceScope(),x.setTaskId(""),y.setDagRunId(""),y.setFromNodeId(""),y.setFeatureId(""),y.setRecoveryConfirm(null),y.setInspectSplitOpen(!1),y.setInterruptIntent(!1),e.setBusy(!1),e.setOpError(null),e.setOpMessage(null))},[p,y,h,e,x]);const U=w.useCallback((H,_={},Y={})=>{if(H==="operate"){const G=_.operateTab??S;T(G),_w(G,window.localStorage),e.selectNav(G)}else H==="chat"?(e.selectNav("chat"),"sessionId"in _&&I(_.sessionId??null)):e.selectNav("recovery");_.taskId&&x.setTaskId(_.taskId),_.dagRunId&&y.setDagRunId(_.dagRunId),_.fromNodeId&&y.setFromNodeId(_.fromNodeId),_.featureId&&y.setFeatureId(_.featureId),y.setInterruptIntent(_.intent==="interrupt"),o(H);const re=H==="inspect"?Yf(_.inspectHref??A,_.workspaceId??h):Wf({workspace:H,operateTab:_.operateTab??S,...h?{workspaceId:h}:{},..._});H==="inspect"&&(C(re),Ow(re,window.localStorage));const fe=re.startsWith("/#")?re.slice(1):re.startsWith("#")?re:`#${re}`;(window.location.hash.startsWith("#")?window.location.hash:`#${window.location.hash}`)!==fe&&(Y.replace&&typeof history.replaceState=="function"?history.replaceState(null,"",fe):window.location.hash=fe),queueMicrotask(()=>ez(H))},[A,S,y.setDagRunId,y.setFeatureId,y.setFromNodeId,y.setInterruptIntent,h,e.selectNav,x.setTaskId]),N=w.useCallback((H,_={})=>{if(H==="chat"){U("chat",_);return}U("operate",{..._,operateTab:H})},[U]),z=w.useCallback(H=>{const _=qi(H),Y=Xf({pathname:"/",hash:_.startsWith("/#")?_.slice(1):_});if(!Y){ks(_);return}U(Y.workspace,{...Y,operateTab:Y.operateTab,inspectHref:Y.canonicalHref},{replace:Y.replace})},[U]),X=w.useCallback(()=>{const H=Xf(window.location,{lastOperateTab:Kf(window.localStorage)});if(H){const _=Iw(H.workspaceId,t.workspaces.map(Y=>Y.workspaceId));if(_.status==="unknown-workspace"){d({workspaceId:_.workspaceId});return}d(null),H.workspaceId&&H.workspaceId!==h&&t.selectWorkspace(H.workspaceId),U(H.workspace,{...H,operateTab:H.operateTab,inspectHref:H.canonicalHref},{replace:H.replace});return}d(null),U("chat",{})},[U,h,t]),B=w.useCallback(H=>{t.selectWorkspace(H),U("chat",{workspaceId:H,sessionId:void 0},{replace:!0})},[U,t]),$=w.useCallback(H=>{if(d(null),t.selectWorkspace(H),s==="chat"){U("chat",{workspaceId:H,sessionId:void 0},{replace:!0});return}const _=s==="operate"?Yu(S,{workspaceId:H}):Yf(A,H);z(_)},[U,A,z,S,s,t]);w.useEffect(()=>(X(),window.addEventListener("hashchange",X),()=>window.removeEventListener("hashchange",X)),[X]);const F=y.dagRunId.trim()?ca(`/dag/${encodeURIComponent(y.dagRunId.trim())}`,"from=recovery"):zl,K=Yf(s==="inspect"?A:F,h),oe=H1(),J=Yu(S,h?{workspaceId:h}:{});return u.jsx(u.Fragment,{children:u.jsxs("div",{className:`console-app${s==="chat"?" is-chat-focus":""}`,children:[u.jsx(Uw,{nav:e.nav,primary:s,chatHref:oe,operateHref:J,readiness:e.readiness,setupBlocked:e.setupBlocked,degraded:e.degraded,inspectHref:K,workspaces:t.workspaces,workspaceId:h,workspacesLoading:t.loading,onSelectWorkspace:$,onNavigate:z}),u.jsx(Fw,{busy:e.busy,runAction:p.runAction}),u.jsxs("div",{className:`console-shell${s==="chat"?" is-chat-focus":""}`,children:[u.jsx($w,{opError:e.opError,opMessage:e.opMessage}),m?u.jsxs("div",{className:"workspace-route-error",role:"alert","aria-live":"polite",children:[u.jsxs("p",{children:["URL 指向的 Workspace",u.jsx("code",{children:m}),"不存在或已被移除。为避免数据泄漏,不会回退到默认 Workspace。"]}),u.jsx("ul",{className:"workspace-route-error-options",children:t.workspaces.map(H=>u.jsx("li",{children:u.jsxs("button",{type:"button",className:"btn btn-secondary",onClick:()=>{d(null),t.selectWorkspace(H.workspaceId),z(Wf({workspace:"chat",workspaceId:H.workspaceId}))},children:["选择 ",H.name]})},H.workspaceId))}),u.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>{d(null);const H=t.workspaces[0]?.workspaceId??null;H&&t.selectWorkspace(H),z(Wf({workspace:"chat"}))},children:"返回对话首页"})]}):null,m?null:u.jsxs("main",{className:`console-main${s==="chat"?" console-main--fill":""}`,children:[u.jsx(iL,{active:s==="chat",readiness:e.readiness,workspaceRegistry:t,workspaceId:h,sessionId:M,workspaceGate:c?{status:"unknown-workspace",workspaceId:c.workspaceId}:void 0,onSwitchWorkspace:B,onNavigateWorkspace:N}),u.jsx(XL,{active:s==="operate",operateTab:S,shell:e,actions:p,wizard:x,prd:b,recovery:y}),u.jsx(JL,{active:s==="inspect",hash:A.startsWith("/#")?A.slice(1):A,workspaceId:h,onNavigate:z})]}),!m&&y.inspectSplitOpen&&y.dagRunId.trim()?u.jsx(z9,{dagRunId:y.dagRunId.trim(),nodeId:y.fromNodeId.trim()||void 0,onClose:()=>y.setInspectSplitOpen(!1),onOpenFull:()=>z(ca(`/dag/${encodeURIComponent(y.dagRunId.trim())}`,"from=recovery"))}):null]})]})})}const lx=document.getElementById("root");if(!lx)throw new Error("Loop Operator Console: #root missing");y9.createRoot(lx).render(u.jsx(w.StrictMode,{children:u.jsx(tz,{})}));export{Kk as _,dd as g,nz as k};
|